4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
27 /* All Rights Reserved */
37 * Private definitions for the nfssys system call.
38 * Note: <nfs/export.h> and <nfs/nfs.h> must be included before
43 * Flavors of nfssys call. Note that OLD_mumble commands are no longer
44 * implemented, but the entries are kept as placeholders for binary
47 enum nfssys_op
{ OLD_NFS_SVC
, OLD_ASYNC_DAEMON
, EXPORTFS
, OLD_NFS_GETFH
,
48 OLD_NFS_CNVT
, NFS_REVAUTH
, OLD_NFS_FH_TO_FID
, OLD_LM_SVC
, KILL_LOCKMGR
,
49 LOG_FLUSH
, SVCPOOL_CREATE
, NFS_SVC
, LM_SVC
, SVCPOOL_WAIT
, SVCPOOL_RUN
,
50 NFS4_SVC
, RDMA_SVC_INIT
, NFS4_CLR_STATE
, NFS_IDMAP
,
51 NFS4_SVC_REQUEST_QUIESCE
, NFS_GETFH
, NFS4_DSS_SETPATHS
,
52 NFS4_DSS_SETPATHS_SIZE
, NFS4_EPHEMERAL_MOUNT_TO
, MOUNTD_ARGS
,
56 int fd
; /* Connection endpoint */
57 char *netid
; /* Identify transport */
58 struct netbuf addrmask
; /* Address mask for host */
59 int versmin
; /* Min protocol version to offer */
60 int versmax
; /* Max protocol version to offer */
61 int delegation
; /* NFSv4 delegation on/off? */
65 struct nfs_svc_args32
{
66 int32_t fd
; /* Connection endpoint */
67 caddr32_t netid
; /* Identify transport */
68 struct netbuf32 addrmask
; /* Address mask for host */
69 int32_t versmin
; /* Min protocol version to offer */
70 int32_t versmax
; /* Max protocol version to offer */
71 int32_t delegation
; /* NFSv4 delegation on/off? */
75 struct exportfs_args
{
77 struct exportdata
*uex
;
81 struct exportfs_args32
{
87 struct nfs_getfh_args
{
95 struct nfs_getfh_args32
{
103 struct nfs_revauth_args
{
109 struct nfs_revauth_args32
{
116 * Arguments for establishing lock manager service. If you change
117 * lm_svc_args, you should increment the version number. Try to keep
118 * supporting one or more old versions of the args, so that old lockd's
119 * will work with new kernels.
122 enum lm_fmly
{ LM_INET
, LM_INET6
, LM_LOOPBACK
};
123 enum lm_proto
{ LM_TCP
, LM_UDP
};
126 int version
; /* keep this first */
128 enum lm_fmly n_fmly
; /* protocol family */
129 enum lm_proto n_proto
; /* protocol */
130 dev_t n_rdev
; /* device ID */
131 int debug
; /* debugging level */
132 time_t timout
; /* client handle life (asynch RPCs) */
133 int grace
; /* secs in grace period */
134 time_t retransmittimeout
; /* retransmission interval */
138 struct lm_svc_args32
{
139 int32_t version
; /* keep this first */
141 enum lm_fmly n_fmly
; /* protocol family */
142 enum lm_proto n_proto
; /* protocol */
143 dev32_t n_rdev
; /* device ID */
144 int32_t debug
; /* debugging level */
145 time32_t timout
; /* client handle life (asynch RPCs) */
146 int32_t grace
; /* secs in grace period */
147 time32_t retransmittimeout
; /* retransmission interval */
151 #define LM_SVC_CUR_VERS 30 /* current lm_svc_args vers num */
154 * Arguments for nfslog flush service.
156 struct nfsl_flush_args
{
159 char *buff
; /* buffer to flush/rename */
160 int buff_len
; /* includes terminating '\0' */
163 #define NFSL_FLUSH_ARGS_VERS 1 /* current nfsl_flush_args vers num */
166 struct nfsl_flush_args32
{
169 caddr32_t buff
; /* buffer to flush/rename */
170 int32_t buff_len
; /* includes terminating '\0' */
175 * Arguments for initialising RDMA service.
177 struct rdma_svc_args
{
178 uint32_t poolid
; /* Thread Pool ID */
179 char *netid
; /* Network Identifier */
180 int nfs_versmin
; /* Min NFS version to offer */
181 int nfs_versmax
; /* Max NFS version to offer */
182 int delegation
; /* NFSv4 delegation on/off? */
186 struct rdma_svc_args32
{
187 uint32_t poolid
; /* Thread Pool ID */
188 caddr32_t netid
; /* Network Identifier */
189 int32_t nfs_versmin
; /* Min NFS version to offer */
190 int32_t nfs_versmax
; /* Max NFS version to offer */
191 int32_t delegation
; /* NFSv4 delegation on/off? */
196 #define NFS4_CLRST_VERSION 1
197 struct nfs4clrst_args
{
204 struct nfs4clrst_args32
{
211 struct nfsidmap_args
{
212 uint_t state
; /* Flushes caches, set state up 1 or down 0 */
213 uint_t did
; /* Door id to upcall */
216 #define NFSL_ALL 0x01 /* Flush all buffers */
217 #define NFSL_RENAME 0x02 /* Rename buffer(s) */
218 #define NFSL_SYNC 0x04 /* Perform operation synchronously? */
222 struct exportfs_args
*exportfs_args_u
; /* exportfs args */
223 struct nfs_getfh_args
*nfs_getfh_args_u
; /* nfs_getfh args */
224 struct nfs_svc_args
*nfs_svc_args_u
; /* nfs_svc args */
225 struct rdma_svc_args
*rdma_svc_args_u
; /* rdma_svc args */
226 struct nfs_revauth_args
*nfs_revauth_args_u
; /* nfs_revauth args */
227 struct lm_svc_args
*lm_svc_args_u
; /* lm_svc args */
228 /* kill_lockmgr args: none */
229 struct nfsl_flush_args
*nfsl_flush_args_u
; /* nfsl_flush args */
230 struct svcpool_args
*svcpool_args_u
; /* svcpool args */
231 struct nfs4clrst_args
*nfs4clrst_u
; /* nfs4 clear state */
232 struct nfsidmap_args
*nfsidmap_u
; /* nfsidmap */
236 enum nfssys_op opcode
; /* operation discriminator */
237 union nfssysargs arg
; /* syscall-specific arg pointer */
239 #define nfssysarg_exportfs arg.exportfs_args_u
240 #define nfssysarg_getfh arg.nfs_getfh_args_u
241 #define nfssysarg_svc arg.nfs_svc_args_u
242 #define nfssysarg_rdmastart arg.rdma_svc_args_u
243 #define nfssysarg_revauth arg.nfs_revauth_args_u
244 #define nfssysarg_lmsvc arg.lm_svc_args_u
245 #define nfssysarg_nfslflush arg.nfsl_flush_args_u
246 #define nfssysarg_svcpool arg.svcpool_args_u
247 #define nfssysarg_nfs4clrst arg.nfs4clrst_u
248 #define nfssysarg_nfsidmap arg.nfsidmap_u
252 caddr32_t exportfs_args_u
; /* exportfs args */
253 caddr32_t nfs_getfh_args_u
; /* nfs_getfh args */
254 caddr32_t nfs_svc_args_u
; /* nfs_svc args */
255 caddr32_t rdma_svc_args_u
; /* rdma_start args */
256 caddr32_t nfs_revauth_args_u
; /* nfs_revauth args */
257 caddr32_t lm_svc_args_u
; /* lm_svc args */
258 /* kill_lockmgr args: none */
259 caddr32_t nfsl_flush_args_u
; /* nfsl_flush args */
260 caddr32_t svcpool_args_u
;
261 caddr32_t nfs4clrst_u
;
264 enum nfssys_op opcode
; /* operation discriminator */
265 union nfssysargs32 arg
; /* syscall-specific arg pointer */
267 #endif /* _SYSCALL32 */
271 struct nfs4_svc_args
{
272 int fd
; /* Connection endpoint */
274 char *netid
; /* Transport Identifier */
275 char *addr
; /* Universal Address */
276 char *protofmly
; /* Protocol Family */
277 char *proto
; /* Protocol, eg. "tcp" */
278 struct netbuf addrmask
; /* Address mask for host */
282 struct nfs4_svc_args32
{
289 struct netbuf32 addrmask
;
293 #define NFS4_KRPC_START 1
294 #define NFS4_SETPORT 2
295 #define NFS4_DQUERY 4
297 /* DSS: distributed stable storage */
298 #define NFS4_DSS_STATE_LEAF "v4_state"
299 #define NFS4_DSS_OLDSTATE_LEAF "v4_oldstate"
300 #define NFS4_DSS_DIR_MODE 0755
301 #define NFS4_DSS_NVPAIR_NAME "dss_pathname_array"
302 /* default storage dir */
303 #define NFS4_DSS_VAR_DIR "/var/nfs"
307 #include <sys/systm.h> /* for rval_t typedef */
309 extern int nfssys(enum nfssys_op opcode
, void *arg
);
310 extern int exportfs(struct exportfs_args
*, model_t
, cred_t
*);
311 extern int nfs_getfh(struct nfs_getfh_args
*, model_t
, cred_t
*);
312 extern int nfs_svc(struct nfs_svc_args
*, model_t
);
313 extern int lm_svc(struct lm_svc_args
*uap
);
314 extern int lm_shutdown(void);
315 extern int nfsl_flush(struct nfsl_flush_args
*, model_t
);
316 extern int nfs4_svc(struct nfs4_svc_args
*, model_t
);
317 extern int rdma_start(struct rdma_svc_args
*);
318 extern void rfs4_clear_client_state(struct nfs4clrst_args
*);
319 extern void nfs_idmap_args(struct nfsidmap_args
*);
320 extern void nfs4_ephemeral_set_mount_to(uint_t
);
321 extern void mountd_args(uint_t
);
328 #endif /* _NFS_NFSSYS_H */