2 * include/linux/nfsd/syscall.h
4 * This file holds all declarations for the knfsd syscall interface.
6 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
10 #define NFSD_SYSCALL_H
12 #include <asm/types.h>
14 # include <linux/types.h>
15 # include <linux/in.h>
17 #include <linux/posix_types.h>
18 #include <linux/nfsd/const.h>
19 #include <linux/nfsd/export.h>
20 #include <linux/nfsd/nfsfh.h>
21 #include <linux/nfsd/auth.h>
24 * Version of the syscall interface
26 #define NFSCTL_VERSION 0x0201
29 * These are the commands understood by nfsctl().
31 #define NFSCTL_SVC 0 /* This is a server process. */
32 #define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */
33 #define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */
34 #define NFSCTL_EXPORT 3 /* export a file system. */
35 #define NFSCTL_UNEXPORT 4 /* unexport a file system. */
36 /*#define NFSCTL_UGIDUPDATE 5 / * update a client's uid/gid map. DISCARDED */
37 /*#define NFSCTL_GETFH 6 / * get an fh by ino DISCARDED */
38 #define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */
39 #define NFSCTL_GETFS 8 /* get an fh by path with max FH len */
42 * Macros used to set version and protocol
44 #define NFSCTL_VERSET(_cltbits, _v) ((_cltbits) |= (1 << (_v)))
45 #define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << (_v)))
46 #define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << (_v)))
48 #if defined(CONFIG_NFSD_V4)
49 #define NFSCTL_VERALL (0x1c /* 0b011100 */)
50 #elif defined(CONFIG_NFSD_V3)
51 #define NFSCTL_VERALL (0x0c /* 0b001100 */)
53 #define NFSCTL_VERALL (0x04 /* 0b000100 */)
56 #define NFSCTL_UDPSET(_cltbits) ((_cltbits) |= (1 << (17 - 1)))
57 #define NFSCTL_UDPUNSET(_cltbits) ((_cltbits) &= ~(1 << (17 - 1)))
58 #define NFSCTL_UDPISSET(_cltbits) ((_cltbits) & (1 << (17 - 1)))
60 #define NFSCTL_TCPSET(_cltbits) ((_cltbits) |= (1 << (18 - 1)))
61 #define NFSCTL_TCPUNSET(_cltbits) ((_cltbits) &= ~(1 << (18 - 1)))
62 #define NFSCTL_TCPISSET(_cltbits) ((_cltbits) & (1 << (18 - 1)))
67 unsigned short svc_port;
71 /* ADDCLIENT/DELCLIENT */
72 struct nfsctl_client {
73 char cl_ident[NFSCLNT_IDMAX+1];
75 struct in_addr cl_addrlist[NFSCLNT_ADDRMAX];
78 unsigned char cl_fhkey[NFSCLNT_KEYMAX];
82 struct nfsctl_export {
83 char ex_client[NFSCLNT_IDMAX+1];
84 char ex_path[NFS_MAXPATHLEN+1];
85 __kernel_old_dev_t ex_dev;
86 __kernel_ino_t ex_ino;
88 __kernel_uid_t ex_anon_uid;
89 __kernel_gid_t ex_anon_gid;
93 struct nfsctl_fdparm {
94 struct sockaddr gd_addr;
95 char gd_path[NFS_MAXPATHLEN+1];
99 /* GETFS - GET Filehandle with Size */
100 struct nfsctl_fsparm {
101 struct sockaddr gd_addr;
102 char gd_path[NFS_MAXPATHLEN+1];
107 * This is the argument union.
110 int ca_version; /* safeguard */
112 struct nfsctl_svc u_svc;
113 struct nfsctl_client u_client;
114 struct nfsctl_export u_export;
115 struct nfsctl_fdparm u_getfd;
116 struct nfsctl_fsparm u_getfs;
118 * The following dummy member is needed to preserve binary compatibility
119 * on platforms where alignof(void*)>alignof(int). It's needed because
120 * this union used to contain a member (u_umap) which contained a
125 #define ca_svc u.u_svc
126 #define ca_client u.u_client
127 #define ca_export u.u_export
128 #define ca_getfd u.u_getfd
129 #define ca_getfs u.u_getfs
133 __u8 cr_getfh[NFS_FHSIZE];
134 struct knfsd_fh cr_getfs;
139 * Kernel syscall implementation.
141 extern int exp_addclient(struct nfsctl_client *ncp);
142 extern int exp_delclient(struct nfsctl_client *ncp);
143 extern int exp_export(struct nfsctl_export *nxp);
144 extern int exp_unexport(struct nfsctl_export *nxp);
146 extern int nfsd_port;
147 extern unsigned int nfsd_versbits, nfsd_portbits;
149 #endif /* __KERNEL__ */
151 #endif /* NFSD_SYSCALL_H */