summaryrefslogtreecommitdiffstats
path: root/support/include/nfs
diff options
context:
space:
mode:
authorhjl <hjl>1999-10-18 23:21:12 +0000
committerhjl <hjl>1999-10-18 23:21:12 +0000
commit8b7ad01b14df1e7529b9ba8a1ea17df0d6004ef9 (patch)
tree0904ef8554ed680fe3244fa618685e1fb7ea148b /support/include/nfs
downloadnfs-utils-8b7ad01b14df1e7529b9ba8a1ea17df0d6004ef9.tar.gz
nfs-utils-8b7ad01b14df1e7529b9ba8a1ea17df0d6004ef9.tar.xz
nfs-utils-8b7ad01b14df1e7529b9ba8a1ea17df0d6004ef9.zip
Initial revision
Diffstat (limited to 'support/include/nfs')
-rw-r--r--support/include/nfs/debug.h75
-rw-r--r--support/include/nfs/export.h26
-rw-r--r--support/include/nfs/nfs.h145
3 files changed, 246 insertions, 0 deletions
diff --git a/support/include/nfs/debug.h b/support/include/nfs/debug.h
new file mode 100644
index 0000000..876b5db
--- /dev/null
+++ b/support/include/nfs/debug.h
@@ -0,0 +1,75 @@
+#ifndef _NFS_DEBUG_H
+#define _NFS_DEBUG_H
+
+/*
+ * RPC debug facilities
+ */
+#define RPCDBG_XPRT 0x0001
+#define RPCDBG_CALL 0x0002
+#define RPCDBG_DEBUG 0x0004
+#define RPCDBG_NFS 0x0008
+#define RPCDBG_AUTH 0x0010
+#define RPCDBG_PMAP 0x0020
+#define RPCDBG_SCHED 0x0040
+#define RPCDBG_SVCSOCK 0x0100
+#define RPCDBG_SVCDSP 0x0200
+#define RPCDBG_MISC 0x0400
+#define RPCDBG_ALL 0x7fff
+
+/*
+ * Declarations for the sysctl debug interface, which allows to read or
+ * change the debug flags for rpc, nfs, nfsd, and lockd. Since the sunrpc
+ * module currently registers its sysctl table dynamically, the sysctl path
+ * for module FOO is <CTL_SUNRPC, CTL_FOODEBUG>.
+ */
+#define CTL_SUNRPC 7249 /* arbitrary and hopefully unused */
+
+enum {
+ CTL_RPCDEBUG = 1,
+ CTL_NFSDEBUG,
+ CTL_NFSDDEBUG,
+ CTL_NLMDEBUG,
+};
+
+
+/*
+ * knfsd debug flags
+ */
+#define NFSDDBG_SOCK 0x0001
+#define NFSDDBG_FH 0x0002
+#define NFSDDBG_EXPORT 0x0004
+#define NFSDDBG_SVC 0x0008
+#define NFSDDBG_PROC 0x0010
+#define NFSDDBG_FILEOP 0x0020
+#define NFSDDBG_AUTH 0x0040
+#define NFSDDBG_REPCACHE 0x0080
+#define NFSDDBG_XDR 0x0100
+#define NFSDDBG_LOCKD 0x0200
+#define NFSDDBG_ALL 0x7FFF
+#define NFSDDBG_NOCHANGE 0xFFFF
+
+/*
+ * Debug flags
+ */
+#define NLMDBG_SVC 0x0001
+#define NLMDBG_CLIENT 0x0002
+#define NLMDBG_CLNTLOCK 0x0004
+#define NLMDBG_SVCLOCK 0x0008
+#define NLMDBG_MONITOR 0x0010
+#define NLMDBG_CLNTSUBS 0x0020
+#define NLMDBG_SVCSUBS 0x0040
+#define NLMDBG_HOSTCACHE 0x0080
+#define NLMDBG_ALL 0x7fff
+
+
+#define NFSDBG_VFS 0x0001
+#define NFSDBG_DIRCACHE 0x0002
+#define NFSDBG_LOOKUPCACHE 0x0004
+#define NFSDBG_PAGECACHE 0x0008
+#define NFSDBG_PROC 0x0010
+#define NFSDBG_XDR 0x0020
+#define NFSDBG_FILE 0x0040
+#define NFSDBG_ROOT 0x0080
+#define NFSDBG_ALL 0xFFFF
+
+#endif /* _NFS_DEBUG_H */
diff --git a/support/include/nfs/export.h b/support/include/nfs/export.h
new file mode 100644
index 0000000..80d23fd
--- /dev/null
+++ b/support/include/nfs/export.h
@@ -0,0 +1,26 @@
+#ifndef _NSF_EXPORT_H
+#define _NSF_EXPORT_H
+
+/*
+ * Important limits for the exports stuff.
+ */
+#define NFSCLNT_IDMAX 1024
+#define NFSCLNT_ADDRMAX 16
+#define NFSCLNT_KEYMAX 32
+
+/*
+ * Export flags.
+ */
+#define NFSEXP_READONLY 0x0001
+#define NFSEXP_INSECURE_PORT 0x0002
+#define NFSEXP_ROOTSQUASH 0x0004
+#define NFSEXP_ALLSQUASH 0x0008
+#define NFSEXP_ASYNC 0x0010
+#define NFSEXP_GATHERED_WRITES 0x0020
+#define NFSEXP_UIDMAP 0x0040
+#define NFSEXP_KERBEROS 0x0080 /* not available */
+#define NFSEXP_SUNSECURE 0x0100
+#define NFSEXP_CROSSMNT 0x0200 /* not available */
+#define NFSEXP_ALLFLAGS 0x03FF
+
+#endif /* _NSF_EXPORT_H */
diff --git a/support/include/nfs/nfs.h b/support/include/nfs/nfs.h
new file mode 100644
index 0000000..0cfed07
--- /dev/null
+++ b/support/include/nfs/nfs.h
@@ -0,0 +1,145 @@
+#ifndef _NFS_NFS_H
+#define _NFS_NFS_H
+
+#include <linux/posix_types.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <rpcsvc/nfs_prot.h>
+#include <nfs/export.h>
+
+struct dentry;
+
+/*
+ * This is the new "dentry style" Linux NFSv2 file handle.
+ *
+ * The xino and xdev fields are currently used to transport the
+ * ino/dev of the exported inode.
+ */
+struct nfs_fhbase {
+ struct dentry * fb_dentry; /* dentry cookie */
+ u_int32_t fb_ino; /* our inode number */
+ u_int32_t fb_dirino; /* dir inode number */
+ u_int32_t fb_dev; /* our device */
+ u_int32_t fb_xdev;
+ u_int32_t fb_xino;
+};
+
+#define NFS_FH_PADDING (NFS_FHSIZE - sizeof(struct nfs_fhbase))
+struct knfs_fh {
+ struct nfs_fhbase fh_base;
+ u_int8_t fh_cookie[NFS_FH_PADDING];
+};
+
+#define fh_dcookie fh_base.fb_dentry
+#define fh_ino fh_base.fb_ino
+#define fh_dirino fh_base.fb_dirino
+#define fh_dev fh_base.fb_dev
+#define fh_xdev fh_base.fb_xdev
+#define fh_xino fh_base.fb_xino
+
+/*
+ * Version of the syscall interface
+ */
+#define NFSCTL_VERSION 0x0201
+
+/*
+ * These are the commands understood by nfsctl().
+ */
+#define NFSCTL_SVC 0 /* This is a server process. */
+#define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */
+#define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */
+#define NFSCTL_EXPORT 3 /* export a file system. */
+#define NFSCTL_UNEXPORT 4 /* unexport a file system. */
+#define NFSCTL_UGIDUPDATE 5 /* update a client's uid/gid map. */
+#define NFSCTL_GETFH 6 /* get an fh (used by mountd) */
+#define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */
+
+/* Above this is for lockd. */
+#define NFSCTL_LOCKD 0x10000
+#define LOCKDCTL_SVC NFSCTL_LOCKD
+
+
+
+/* SVC */
+struct nfsctl_svc {
+ unsigned short svc_port;
+ int svc_nthreads;
+};
+
+/* ADDCLIENT/DELCLIENT */
+struct nfsctl_client {
+ char cl_ident[NFSCLNT_IDMAX+1];
+ int cl_naddr;
+ struct in_addr cl_addrlist[NFSCLNT_ADDRMAX];
+ int cl_fhkeytype;
+ int cl_fhkeylen;
+ unsigned char cl_fhkey[NFSCLNT_KEYMAX];
+};
+
+/* EXPORT/UNEXPORT */
+struct nfsctl_export {
+ char ex_client[NFSCLNT_IDMAX+1];
+ char ex_path[NFS_MAXPATHLEN+1];
+ __kernel_dev_t ex_dev;
+ __kernel_ino_t ex_ino;
+ int ex_flags;
+ __kernel_uid_t ex_anon_uid;
+ __kernel_gid_t ex_anon_gid;
+};
+
+/* UGIDUPDATE */
+struct nfsctl_uidmap {
+ char * ug_ident;
+ __kernel_uid_t ug_uidbase;
+ int ug_uidlen;
+ __kernel_uid_t * ug_udimap;
+ __kernel_gid_t ug_gidbase;
+ int ug_gidlen;
+ __kernel_gid_t * ug_gdimap;
+};
+
+/* GETFH */
+struct nfsctl_fhparm {
+ struct sockaddr gf_addr;
+ __kernel_dev_t gf_dev;
+ __kernel_ino_t gf_ino;
+ int gf_version;
+};
+
+/* GETFD */
+struct nfsctl_fdparm {
+ struct sockaddr gd_addr;
+ char gd_path[NFS_MAXPATHLEN+1];
+ int gd_version;
+};
+
+/*
+ * This is the argument union.
+ */
+struct nfsctl_arg {
+ int ca_version; /* safeguard */
+ union {
+ struct nfsctl_svc u_svc;
+ struct nfsctl_client u_client;
+ struct nfsctl_export u_export;
+ struct nfsctl_uidmap u_umap;
+ struct nfsctl_fhparm u_getfh;
+ struct nfsctl_fdparm u_getfd;
+ unsigned int u_debug;
+ } u;
+#define ca_svc u.u_svc
+#define ca_client u.u_client
+#define ca_export u.u_export
+#define ca_umap u.u_umap
+#define ca_getfh u.u_getfh
+#define ca_getfd u.u_getfd
+#define ca_authd u.u_authd
+#define ca_debug u.u_debug
+};
+
+union nfsctl_res {
+ struct knfs_fh cr_getfh;
+ unsigned int cr_debug;
+};
+
+#endif /* _NFS_NFS_H */