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/config.h>
15 # include <linux/types.h>
16 # include <linux/in.h>
18 #include <linux/posix_types.h>
19 #include <linux/nfsd/const.h>
20 #include <linux/nfsd/export.h>
21 #include <linux/nfsd/nfsfh.h>
22 #include <linux/nfsd/auth.h>
25 * Version of the syscall interface
27 #define NFSCTL_VERSION 0x0201
30 * These are the commands understood by nfsctl().
32 #define NFSCTL_SVC 0 /* This is a server process. */
33 #define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */
34 #define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */
35 #define NFSCTL_EXPORT 3 /* export a file system. */
36 #define NFSCTL_UNEXPORT 4 /* unexport a file system. */
37 #define NFSCTL_UGIDUPDATE 5 /* update a client's uid/gid map. */
38 #define NFSCTL_GETFH 6 /* get an fh by ino (used by mountd) */
39 #define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */
40 #define NFSCTL_GETFS 8 /* get an fh by path with max FH len */
44 unsigned short svc_port
;
48 /* ADDCLIENT/DELCLIENT */
49 struct nfsctl_client
{
50 char cl_ident
[NFSCLNT_IDMAX
+1];
52 struct in_addr cl_addrlist
[NFSCLNT_ADDRMAX
];
55 unsigned char cl_fhkey
[NFSCLNT_KEYMAX
];
59 struct nfsctl_export
{
60 char ex_client
[NFSCLNT_IDMAX
+1];
61 char ex_path
[NFS_MAXPATHLEN
+1];
62 __kernel_dev_t ex_dev
;
63 __kernel_ino_t ex_ino
;
65 __kernel_uid_t ex_anon_uid
;
66 __kernel_gid_t ex_anon_gid
;
70 struct nfsctl_uidmap
{
72 __kernel_uid_t ug_uidbase
;
74 __kernel_uid_t
* ug_udimap
;
75 __kernel_gid_t ug_gidbase
;
77 __kernel_gid_t
* ug_gdimap
;
81 struct nfsctl_fhparm
{
82 struct sockaddr gf_addr
;
83 __kernel_dev_t gf_dev
;
84 __kernel_ino_t gf_ino
;
89 struct nfsctl_fdparm
{
90 struct sockaddr gd_addr
;
91 char gd_path
[NFS_MAXPATHLEN
+1];
95 /* GETFS - GET Filehandle with Size */
96 struct nfsctl_fsparm
{
97 struct sockaddr gd_addr
;
98 char gd_path
[NFS_MAXPATHLEN
+1];
103 * This is the argument union.
106 int ca_version
; /* safeguard */
108 struct nfsctl_svc u_svc
;
109 struct nfsctl_client u_client
;
110 struct nfsctl_export u_export
;
111 struct nfsctl_uidmap u_umap
;
112 struct nfsctl_fhparm u_getfh
;
113 struct nfsctl_fdparm u_getfd
;
114 struct nfsctl_fsparm u_getfs
;
116 #define ca_svc u.u_svc
117 #define ca_client u.u_client
118 #define ca_export u.u_export
119 #define ca_umap u.u_umap
120 #define ca_getfh u.u_getfh
121 #define ca_getfd u.u_getfd
122 #define ca_getfs u.u_getfs
123 #define ca_authd u.u_authd
127 __u8 cr_getfh
[NFS_FHSIZE
];
128 struct knfsd_fh cr_getfs
;
133 * Kernel syscall implementation.
135 #if defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE)
136 extern asmlinkage
long sys_nfsservctl(int, void *, void *);
138 #define sys_nfsservctl sys_ni_syscall
140 extern int exp_addclient(struct nfsctl_client
*ncp
);
141 extern int exp_delclient(struct nfsctl_client
*ncp
);
142 extern int exp_export(struct nfsctl_export
*nxp
);
143 extern int exp_unexport(struct nfsctl_export
*nxp
);
145 #endif /* __KERNEL__ */
147 #endif /* NFSD_SYSCALL_H */