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