xref: /titanic_52/usr/src/lib/libshare/nfs/libshare_nfs.h (revision 5cb0d67909d9970a3e7adbea9422ca3fc88000bf)
1549ec3ffSdougm /*
2549ec3ffSdougm  * CDDL HEADER START
3549ec3ffSdougm  *
4549ec3ffSdougm  * The contents of this file are subject to the terms of the
5549ec3ffSdougm  * Common Development and Distribution License (the "License").
6549ec3ffSdougm  * You may not use this file except in compliance with the License.
7549ec3ffSdougm  *
8549ec3ffSdougm  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9549ec3ffSdougm  * or http://www.opensolaris.org/os/licensing.
10549ec3ffSdougm  * See the License for the specific language governing permissions
11549ec3ffSdougm  * and limitations under the License.
12549ec3ffSdougm  *
13549ec3ffSdougm  * When distributing Covered Code, include this CDDL HEADER in each
14549ec3ffSdougm  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15549ec3ffSdougm  * If applicable, add the following below this CDDL HEADER, with the
16549ec3ffSdougm  * fields enclosed by brackets "[]" replaced with your own identifying
17549ec3ffSdougm  * information: Portions Copyright [yyyy] [name of copyright owner]
18549ec3ffSdougm  *
19549ec3ffSdougm  * CDDL HEADER END
20549ec3ffSdougm  */
21549ec3ffSdougm 
22549ec3ffSdougm /*
23b56bf881SAntonello Cruz  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
24*5cb0d679SMarcel Telka  * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
25549ec3ffSdougm  */
26549ec3ffSdougm 
27549ec3ffSdougm /*
28549ec3ffSdougm  * basic API declarations for share management
29549ec3ffSdougm  */
30549ec3ffSdougm 
31549ec3ffSdougm #ifndef _LIBSHARE_NFS_H
32549ec3ffSdougm #define	_LIBSHARE_NFS_H
33549ec3ffSdougm 
34549ec3ffSdougm #ifdef	__cplusplus
35549ec3ffSdougm extern "C" {
36549ec3ffSdougm #endif
37549ec3ffSdougm 
38549ec3ffSdougm /* property names used by NFS */
39549ec3ffSdougm #define	SHOPT_RO	"ro"
40549ec3ffSdougm #define	SHOPT_RW	"rw"
41b89a8333Snatalie li - Sun Microsystems - Irvine United States #define	SHOPT_NONE	"none"
42b89a8333Snatalie li - Sun Microsystems - Irvine United States #define	SHOPT_ROOT_MAPPING	"root_mapping"
43549ec3ffSdougm 
44549ec3ffSdougm #define	SHOPT_SEC	"sec"
45549ec3ffSdougm #define	SHOPT_SECURE	"secure"
46549ec3ffSdougm #define	SHOPT_ROOT	"root"
47549ec3ffSdougm #define	SHOPT_ANON	"anon"
48549ec3ffSdougm #define	SHOPT_WINDOW	"window"
49549ec3ffSdougm #define	SHOPT_NOSUB	"nosub"
50549ec3ffSdougm #define	SHOPT_NOSUID	"nosuid"
51549ec3ffSdougm #define	SHOPT_ACLOK	"aclok"
52549ec3ffSdougm #define	SHOPT_PUBLIC	"public"
53549ec3ffSdougm #define	SHOPT_INDEX	"index"
54549ec3ffSdougm #define	SHOPT_LOG	"log"
55549ec3ffSdougm #define	SHOPT_CKSUM	"cksum"
566764e83bSVallish Vaidyeshwara #define	SHOPT_NOACLFAB	"noaclfab"
57*5cb0d679SMarcel Telka #define	SHOPT_UIDMAP	"uidmap"
58*5cb0d679SMarcel Telka #define	SHOPT_GIDMAP	"gidmap"
59549ec3ffSdougm 
60549ec3ffSdougm /*
61549ec3ffSdougm  * defined options types. These should be in a file rather than
62549ec3ffSdougm  * compiled in. Until there is a plugin mechanism to add new types,
63549ec3ffSdougm  * this is sufficient.
64549ec3ffSdougm  */
65549ec3ffSdougm #define	OPT_TYPE_ANY		0
66549ec3ffSdougm #define	OPT_TYPE_STRING		1
67549ec3ffSdougm #define	OPT_TYPE_BOOLEAN	2
68549ec3ffSdougm #define	OPT_TYPE_NUMBER		3
69549ec3ffSdougm #define	OPT_TYPE_RANGE		4
70549ec3ffSdougm #define	OPT_TYPE_USER		5
71549ec3ffSdougm #define	OPT_TYPE_ACCLIST	6
72549ec3ffSdougm #define	OPT_TYPE_DEPRECATED	7
73549ec3ffSdougm #define	OPT_TYPE_SECURITY	8
74549ec3ffSdougm #define	OPT_TYPE_PATH		9
75549ec3ffSdougm #define	OPT_TYPE_FILE		10
76549ec3ffSdougm #define	OPT_TYPE_LOGTAG		11
77549ec3ffSdougm #define	OPT_TYPE_STRINGSET	12
78549ec3ffSdougm #define	OPT_TYPE_DOMAIN		13
79549ec3ffSdougm #define	OPT_TYPE_ONOFF		14
80549ec3ffSdougm #define	OPT_TYPE_PROTOCOL	15
81*5cb0d679SMarcel Telka #define	OPT_TYPE_MAPPING	16
82549ec3ffSdougm 
83549ec3ffSdougm #define	OPT_SHARE_ONLY		1
84549ec3ffSdougm 
85549ec3ffSdougm struct option_defs {
86549ec3ffSdougm 	char *tag;
87549ec3ffSdougm 	int index;
88549ec3ffSdougm 	int type;
89549ec3ffSdougm 	int share;	/* share only option */
90687915e9Sdougm 	int (*check)(sa_handle_t, char *);
91549ec3ffSdougm };
92549ec3ffSdougm 
93549ec3ffSdougm /*
94549ec3ffSdougm  * service bit mask values
95549ec3ffSdougm  */
96549ec3ffSdougm #define	SVC_LOCKD	0x0001
97549ec3ffSdougm #define	SVC_STATD	0x0002
98549ec3ffSdougm #define	SVC_NFSD	0x0004
99549ec3ffSdougm #define	SVC_MOUNTD	0x0008
100549ec3ffSdougm #define	SVC_NFS4CBD	0x0010
101549ec3ffSdougm #define	SVC_NFSMAPID	0x0020
102549ec3ffSdougm #define	SVC_RQUOTAD	0x0040
103549ec3ffSdougm #define	SVC_NFSLOGD	0x0080
1042f172c55SRobert Thurlow #define	SVC_REPARSED	0x0100
105dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define	SVC_CLIENT	0x0200
106dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States 
107dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States /*
108dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States  * NFS Restart/Refresh options
109dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States  */
110dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define	NFSD_REFRESH		0x0001
111dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define	NFSD_RESTART		0x0002
112dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define	NLOCKMGR_REFESH		0x0003
113dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define	NLOCKMGR_RESTART	0x0004
114dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define	MAPID_REFRESH		0x0005
115dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define	MAPID_RESTART		0x0006
116549ec3ffSdougm 
117549ec3ffSdougm /*
118549ec3ffSdougm  * place holder for future service -- will move to daemon_utils.h when
119549ec3ffSdougm  * fully implemented.
120549ec3ffSdougm  */
121549ec3ffSdougm #define	NFSLOGD	"svc:/network/nfs/log:default"
122549ec3ffSdougm 
123549ec3ffSdougm /* The NFS export structure flags for read/write modes */
124549ec3ffSdougm #define	NFS_RWMODES	(M_RO|M_ROL|M_RW|M_RWL)
125549ec3ffSdougm 
126549ec3ffSdougm /* other values */
127549ec3ffSdougm /* max size of 64-bit integer in digits plus a bit extra */
128549ec3ffSdougm #define	MAXDIGITS	32
129549ec3ffSdougm 
130549ec3ffSdougm /* external variable */
131549ec3ffSdougm extern boolean_t nfsl_errs_to_syslog;
132549ec3ffSdougm 
133549ec3ffSdougm /* imported functions */
134549ec3ffSdougm extern int exportfs(char *, struct exportdata *);
135549ec3ffSdougm extern int nfs_getseconfig_default(seconfig_t *);
136549ec3ffSdougm extern int nfs_getseconfig_byname(char *, seconfig_t *);
137549ec3ffSdougm extern bool_t nfs_get_root_principal(seconfig_t *, char *, caddr_t *);
138549ec3ffSdougm extern int nfsl_getconfig_list(nfsl_config_t **);
139549ec3ffSdougm extern void nfsl_freeconfig_list(nfsl_config_t **);
140549ec3ffSdougm extern nfsl_config_t *nfsl_findconfig(nfsl_config_t *, char *, int *);
141549ec3ffSdougm 
142549ec3ffSdougm #ifdef	__cplusplus
143549ec3ffSdougm }
144549ec3ffSdougm #endif
145549ec3ffSdougm 
146549ec3ffSdougm #endif /* _LIBSHARE_NFS_H */
147