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