xref: /illumos-gate/usr/src/uts/common/sharefs/share.h (revision 2d6eb4a5)
1a237e38eSth /*
2a237e38eSth  * CDDL HEADER START
3a237e38eSth  *
4a237e38eSth  * The contents of this file are subject to the terms of the
5a237e38eSth  * Common Development and Distribution License (the "License").
6a237e38eSth  * You may not use this file except in compliance with the License.
7a237e38eSth  *
8a237e38eSth  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9a237e38eSth  * or http://www.opensolaris.org/os/licensing.
10a237e38eSth  * See the License for the specific language governing permissions
11a237e38eSth  * and limitations under the License.
12a237e38eSth  *
13a237e38eSth  * When distributing Covered Code, include this CDDL HEADER in each
14a237e38eSth  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15a237e38eSth  * If applicable, add the following below this CDDL HEADER, with the
16a237e38eSth  * fields enclosed by brackets "[]" replaced with your own identifying
17a237e38eSth  * information: Portions Copyright [yyyy] [name of copyright owner]
18a237e38eSth  *
19a237e38eSth  * CDDL HEADER END
20a237e38eSth  */
21a237e38eSth 
22a237e38eSth /*
23a237e38eSth  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24a237e38eSth  * Use is subject to license terms.
25a237e38eSth  */
26a237e38eSth 
27a237e38eSth #ifndef _SHAREFS_SHARE_H
28a237e38eSth #define	_SHAREFS_SHARE_H
29a237e38eSth 
30a237e38eSth #ifdef __cplusplus
31a237e38eSth extern "C" {
32a237e38eSth #endif
33a237e38eSth 
34a237e38eSth /*
35a237e38eSth  * struct share defines the format of an exported filesystem.
36a237e38eSth  *
37a237e38eSth  * It is also the interface between the userland tools and
38a237e38eSth  * the kernel.
39a237e38eSth  */
40a237e38eSth typedef struct share {
41a237e38eSth 	char		*sh_path;
42a237e38eSth 	char		*sh_res;
43a237e38eSth 	char		*sh_fstype;
44a237e38eSth 	char		*sh_opts;
45a237e38eSth 	char		*sh_descr;
46a237e38eSth 	size_t		sh_size;
47a237e38eSth 	struct share	*sh_next;
48a237e38eSth } share_t;
49a237e38eSth 
50a237e38eSth #ifdef _SYSCALL32
51a237e38eSth typedef struct share32 {
52a237e38eSth 	caddr32_t	sh_path;
53a237e38eSth 	caddr32_t	sh_res;
54a237e38eSth 	caddr32_t	sh_fstype;
55a237e38eSth 	caddr32_t	sh_opts;
56a237e38eSth 	caddr32_t	sh_descr;
57a237e38eSth 	size32_t	sh_size;
58a237e38eSth 	caddr32_t	sh_next;
59a237e38eSth } share32_t;
60a237e38eSth #endif /* _SYSCALL32 */
61a237e38eSth 
62a237e38eSth #define	SHARETAB	"/etc/dfs/sharetab"
63a237e38eSth #define	MAXBUFSIZE	65536
64a237e38eSth 
65a237e38eSth /*
66a237e38eSth  * Flavors of the system call.
67a237e38eSth  */
68a237e38eSth enum sharefs_sys_op { SHAREFS_ADD, SHAREFS_REMOVE, SHAREFS_REPLACE };
69a237e38eSth 
70a237e38eSth #ifdef _KERNEL
71a237e38eSth 
72*a3175730Sth extern int sharefs(enum sharefs_sys_op opcode, struct share *sh,
73*a3175730Sth     uint32_t iMaxLen);
74a237e38eSth 
75a237e38eSth #else
76a237e38eSth 
77*a3175730Sth extern int _sharefs(enum sharefs_sys_op opcode, struct share *sh);
78a237e38eSth 
79a237e38eSth #endif
80a237e38eSth 
81a237e38eSth #ifdef __cplusplus
82a237e38eSth }
83a237e38eSth #endif
84a237e38eSth 
85a237e38eSth #endif /* !_SHAREFS_SHARE_H */
86