| 1 | /* |
|---|
| 2 | * include/linux/nfsd/syscall.h |
|---|
| 3 | * |
|---|
| 4 | * This file holds all declarations for the knfsd syscall interface. |
|---|
| 5 | * |
|---|
| 6 | * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de> |
|---|
| 7 | */ |
|---|
| 8 | |
|---|
| 9 | #ifndef NFSD_SYSCALL_H |
|---|
| 10 | #define NFSD_SYSCALL_H |
|---|
| 11 | |
|---|
| 12 | #include <asm/types.h> |
|---|
| 13 | #include <linux/posix_types.h> |
|---|
| 14 | #include <linux/nfsd/const.h> |
|---|
| 15 | #include <linux/nfsd/export.h> |
|---|
| 16 | #include <linux/nfsd/nfsfh.h> |
|---|
| 17 | |
|---|
| 18 | /* |
|---|
| 19 | * Version of the syscall interface |
|---|
| 20 | */ |
|---|
| 21 | #define NFSCTL_VERSION 0x0201 |
|---|
| 22 | |
|---|
| 23 | /* |
|---|
| 24 | * These are the commands understood by nfsctl(). |
|---|
| 25 | */ |
|---|
| 26 | #define NFSCTL_SVC 0 /* This is a server process. */ |
|---|
| 27 | #define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */ |
|---|
| 28 | #define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */ |
|---|
| 29 | #define NFSCTL_EXPORT 3 /* export a file system. */ |
|---|
| 30 | #define NFSCTL_UNEXPORT 4 /* unexport a file system. */ |
|---|
| 31 | /*#define NFSCTL_UGIDUPDATE 5 / * update a client's uid/gid map. DISCARDED */ |
|---|
| 32 | /*#define NFSCTL_GETFH 6 / * get an fh by ino DISCARDED */ |
|---|
| 33 | #define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */ |
|---|
| 34 | #define NFSCTL_GETFS 8 /* get an fh by path with max FH len */ |
|---|
| 35 | |
|---|
| 36 | /* SVC */ |
|---|
| 37 | struct nfsctl_svc { |
|---|
| 38 | unsigned short svc_port; |
|---|
| 39 | int svc_nthreads; |
|---|
| 40 | }; |
|---|
| 41 | |
|---|
| 42 | /* ADDCLIENT/DELCLIENT */ |
|---|
| 43 | struct nfsctl_client { |
|---|
| 44 | char cl_ident[NFSCLNT_IDMAX+1]; |
|---|
| 45 | int cl_naddr; |
|---|
| 46 | struct in_addr cl_addrlist[NFSCLNT_ADDRMAX]; |
|---|
| 47 | int cl_fhkeytype; |
|---|
| 48 | int cl_fhkeylen; |
|---|
| 49 | unsigned char cl_fhkey[NFSCLNT_KEYMAX]; |
|---|
| 50 | }; |
|---|
| 51 | |
|---|
| 52 | /* EXPORT/UNEXPORT */ |
|---|
| 53 | struct nfsctl_export { |
|---|
| 54 | char ex_client[NFSCLNT_IDMAX+1]; |
|---|
| 55 | char ex_path[NFS_MAXPATHLEN+1]; |
|---|
| 56 | __kernel_old_dev_t ex_dev; |
|---|
| 57 | __kernel_ino_t ex_ino; |
|---|
| 58 | int ex_flags; |
|---|
| 59 | __kernel_uid_t ex_anon_uid; |
|---|
| 60 | __kernel_gid_t ex_anon_gid; |
|---|
| 61 | }; |
|---|
| 62 | |
|---|
| 63 | /* GETFD */ |
|---|
| 64 | struct nfsctl_fdparm { |
|---|
| 65 | struct sockaddr gd_addr; |
|---|
| 66 | char gd_path[NFS_MAXPATHLEN+1]; |
|---|
| 67 | int gd_version; |
|---|
| 68 | }; |
|---|
| 69 | |
|---|
| 70 | /* GETFS - GET Filehandle with Size */ |
|---|
| 71 | struct nfsctl_fsparm { |
|---|
| 72 | struct sockaddr gd_addr; |
|---|
| 73 | char gd_path[NFS_MAXPATHLEN+1]; |
|---|
| 74 | int gd_maxlen; |
|---|
| 75 | }; |
|---|
| 76 | |
|---|
| 77 | /* |
|---|
| 78 | * This is the argument union. |
|---|
| 79 | */ |
|---|
| 80 | struct nfsctl_arg { |
|---|
| 81 | int ca_version; /* safeguard */ |
|---|
| 82 | union { |
|---|
| 83 | struct nfsctl_svc u_svc; |
|---|
| 84 | struct nfsctl_client u_client; |
|---|
| 85 | struct nfsctl_export u_export; |
|---|
| 86 | struct nfsctl_fdparm u_getfd; |
|---|
| 87 | struct nfsctl_fsparm u_getfs; |
|---|
| 88 | /* |
|---|
| 89 | * The following dummy member is needed to preserve binary compatibility |
|---|
| 90 | * on platforms where alignof(void*)>alignof(int). It's needed because |
|---|
| 91 | * this union used to contain a member (u_umap) which contained a |
|---|
| 92 | * pointer. |
|---|
| 93 | */ |
|---|
| 94 | void *u_ptr; |
|---|
| 95 | } u; |
|---|
| 96 | #define ca_svc u.u_svc |
|---|
| 97 | #define ca_client u.u_client |
|---|
| 98 | #define ca_export u.u_export |
|---|
| 99 | #define ca_getfd u.u_getfd |
|---|
| 100 | #define ca_getfs u.u_getfs |
|---|
| 101 | }; |
|---|
| 102 | |
|---|
| 103 | union nfsctl_res { |
|---|
| 104 | __u8 cr_getfh[NFS_FHSIZE]; |
|---|
| 105 | struct knfsd_fh cr_getfs; |
|---|
| 106 | }; |
|---|
| 107 | |
|---|
| 108 | #endif /* NFSD_SYSCALL_H */ |
|---|