code:
%/*
% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
% * unrestricted use provided that this legend is included on all tape
% * media and as a part of the software program in whole or part.  Users
% * may copy or modify Sun RPC without charge, but are not authorized
% * to license or distribute it to anyone else except as part of a product or
% * program developed by the user.
% *
% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
% *
% * Sun RPC is provided with no support and without any obligation on the
% * part of Sun Microsystems, Inc. to assist in its use, correction,
% * modification or enhancement.
% *
% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
% * OR ANY PART THEREOF.
% *
% * In no event will Sun Microsystems, Inc. be liable for any lost revenue
% * or profits or other special, indirect and consequential damages, even if
% * Sun has been advised of the possibility of such damages.
% *
% * Sun Microsystems, Inc.
% * 2550 Garcia Avenue
% * Mountain View, California  94043
% */
/*
 * Key server protocol definition
 * Copyright (C) 1990, 1991 Sun Microsystems, Inc.
 *
 * The keyserver is a public key storage/encryption/decryption service
 * The encryption method used is based on the Diffie-Hellman exponential
 * key exchange technology.
 *
 * The key server is local to each machine, akin to the portmapper.
 * Under TI-RPC, communication with the keyserver is through the
 * loopback transport.
 *
 * NOTE: This .x file generates the USER level headers for the keyserver.
 * the KERNEL level headers are created by hand as they kernel has special
 * requirements.
 */

%/* From: #pragma ident	"@(#)key_prot.x	1.7	94/04/29 SMI" */
%/* Copyright (c)  1990, 1991 Sun Microsystems, Inc. */
%#include <sys/cdefs.h>
%__FBSDID("$FreeBSD: release/9.0.0/include/rpcsvc/key_prot.x 114629 2003-05-04 02:51:42Z obrien $");
%
%/*
% * Compiled from key_prot.x using rpcgen.
% * DO NOT EDIT THIS FILE!
% * This is NOT source code!
% */

/*
 * PROOT and MODULUS define the way the Diffie-Hellman key is generated.
 *
 * MODULUS should be chosen as a prime of the form: MODULUS == 2*p + 1,
 * where p is also prime.
 *
 * PROOT satisfies the following two conditions:
 * (1) (PROOT ** 2) % MODULUS != 1
 * (2) (PROOT ** p) % MODULUS != 1
 *
 */

const PROOT = 3;
const HEXMODULUS = "d4a0ba0250b6fd2ec626e7efd637df76c716e22d0944b88b";

const HEXKEYBYTES = 48;		/* HEXKEYBYTES == strlen(HEXMODULUS) */
const KEYSIZE = 192;		/* KEYSIZE == bit length of key */
const KEYBYTES = 24;		/* byte length of key */

/*
 * The first 16 hex digits of the encrypted secret key are used as
 * a checksum in the database.
 */
const KEYCHECKSUMSIZE = 16;

/*
 * status of operation
 */
enum keystatus {
	KEY_SUCCESS,	/* no problems */
	KEY_NOSECRET,	/* no secret key stored */
	KEY_UNKNOWN,	/* unknown netname */
	KEY_SYSTEMERR 	/* system error (out of memory, encryption failure) */
};

typedef opaque keybuf[HEXKEYBYTES];	/* store key in hex */

typedef string netnamestr<MAXNETNAMELEN>;

/*
 * Argument to ENCRYPT or DECRYPT
 */
struct cryptkeyarg {
	netnamestr remotename;
	des_block deskey;
};

/*
 * Argument to ENCRYPT_PK or DECRYPT_PK
 */
struct cryptkeyarg2 {
	netnamestr remotename;
	netobj	remotekey;	/* Contains a length up to 1024 bytes */
	des_block deskey;
};

/*
 * Result of ENCRYPT, DECRYPT, ENCRYPT_PK, and DECRYPT_PK
 */
union cryptkeyres switch (keystatus status) {
case KEY_SUCCESS:
	des_block deskey;
default:
	void;
};

const MAXGIDS  = 16;	/* max number of gids in gid list */

/*
 * Unix credential
 */
struct unixcred {
	u_int uid;
	u_int gid;
	u_int gids<MAXGIDS>;
};

/*
 * Result returned from GETCRED
 */
union getcredres switch (keystatus status) {
case KEY_SUCCESS:
	unixcred cred;
default:
	void;
};
/*
 * key_netstarg;
 */

struct key_netstarg {
	keybuf st_priv_key;
	keybuf st_pub_key;
	netnamestr st_netname;
};

union key_netstres switch (keystatus status){
case KEY_SUCCESS:
	key_netstarg knet;
default:
	void;
};

#ifdef RPC_HDR
%
%#ifndef opaque
%#define opaque char
%#endif
%
#endif
program KEY_PROG {
	version KEY_VERS {

		/*
		 * This is my secret key.
	 	 * Store it for me.
		 */
		keystatus
		KEY_SET(keybuf) = 1;

		/*
		 * I want to talk to X.
		 * Encrypt a conversation key for me.
	 	 */
		cryptkeyres
		KEY_ENCRYPT(cryptkeyarg) = 2;

		/*
		 * X just sent me a message.
		 * Decrypt the conversation key for me.
		 */
		cryptkeyres
		KEY_DECRYPT(cryptkeyarg) = 3;

		/*
		 * Generate a secure conversation key for me
		 */
		des_block
		KEY_GEN(void) = 4;

		/*
		 * Get me the uid, gid and group-access-list associated
		 * with this netname (for kernel which cannot use NIS)
		 */
		getcredres
		KEY_GETCRED(netnamestr) = 5;
	} = 1;
	version KEY_VERS2 {

		/*
		 * #######
		 * Procedures 1-5 are identical to version 1
		 * #######
		 */

		/*
		 * This is my secret key.
	 	 * Store it for me.
		 */
		keystatus
		KEY_SET(keybuf) = 1;

		/*
		 * I want to talk to X.
		 * Encrypt a conversation key for me.
	 	 */
		cryptkeyres
		KEY_ENCRYPT(cryptkeyarg) = 2;

		/*
		 * X just sent me a message.
		 * Decrypt the conversation key for me.
		 */
		cryptkeyres
		KEY_DECRYPT(cryptkeyarg) = 3;

		/*
		 * Generate a secure conversation key for me
		 */
		des_block
		KEY_GEN(void) = 4;

		/*
		 * Get me the uid, gid and group-access-list associated
		 * with this netname (for kernel which cannot use NIS)
		 */
		getcredres
		KEY_GETCRED(netnamestr) = 5;

		/*
		 * I want to talk to X. and I know X's public key
		 * Encrypt a conversation key for me.
	 	 */
		cryptkeyres
		KEY_ENCRYPT_PK(cryptkeyarg2) = 6;

		/*
		 * X just sent me a message. and I know X's public key
		 * Decrypt the conversation key for me.
		 */
		cryptkeyres
		KEY_DECRYPT_PK(cryptkeyarg2) = 7;

		/*
		 * Store my public key, netname and private key.
		 */
		keystatus
		KEY_NET_PUT(key_netstarg) = 8;

		/*
		 * Retrieve my public key, netname and private key.
		 */
 		key_netstres
		KEY_NET_GET(void) = 9;

		/*
		 * Return me the conversation key that is constructed
		 * from my secret key and this publickey.
		 */

		cryptkeyres
		KEY_GET_CONV(keybuf) = 10;

	} = 2;
} = 100029;


code:
/*
 * Please do not edit this file.
 * It was generated using rpcgen.
 */

#ifndef _KLM_PROT_H_RPCGEN
#define	_KLM_PROT_H_RPCGEN

#include <rpc/rpc.h>

#ifdef __cplusplus
extern "C" {
#endif

#define	LM_MAXSTRLEN 1024

enum klm_stats {
	klm_granted = 0,
	klm_denied = 1,
	klm_denied_nolocks = 2,
	klm_working = 3
};
typedef enum klm_stats klm_stats;

struct klm_lock {
	char *server_name;
	netobj fh;
	int pid;
	u_int l_offset;
	u_int l_len;
};
typedef struct klm_lock klm_lock;

struct klm_holder {
	bool_t exclusive;
	int svid;
	u_int l_offset;
	u_int l_len;
};
typedef struct klm_holder klm_holder;

struct klm_stat {
	klm_stats stat;
};
typedef struct klm_stat klm_stat;

struct klm_testrply {
	klm_stats stat;
	union {
		struct klm_holder holder;
	} klm_testrply_u;
};
typedef struct klm_testrply klm_testrply;

struct klm_lockargs {
	bool_t block;
	bool_t exclusive;
	struct klm_lock alock;
};
typedef struct klm_lockargs klm_lockargs;

struct klm_testargs {
	bool_t exclusive;
	struct klm_lock alock;
};
typedef struct klm_testargs klm_testargs;

struct klm_unlockargs {
	struct klm_lock alock;
};
typedef struct klm_unlockargs klm_unlockargs;

#define	KLM_PROG ((unsigned long)(100020))
#define	KLM_VERS ((unsigned long)(1))

extern  void klm_prog_1(struct svc_req *rqstp, SVCXPRT *transp);
#define	KLM_TEST ((unsigned long)(1))
extern  klm_testrply * klm_test_1(struct klm_testargs *, CLIENT *);
extern  klm_testrply * klm_test_1_svc(struct klm_testargs *, struct svc_req *);
#define	KLM_LOCK ((unsigned long)(2))
extern  klm_stat * klm_lock_1(struct klm_lockargs *, CLIENT *);
extern  klm_stat * klm_lock_1_svc(struct klm_lockargs *, struct svc_req *);
#define	KLM_CANCEL ((unsigned long)(3))
extern  klm_stat * klm_cancel_1(struct klm_lockargs *, CLIENT *);
extern  klm_stat * klm_cancel_1_svc(struct klm_lockargs *, struct svc_req *);
#define	KLM_UNLOCK ((unsigned long)(4))
extern  klm_stat * klm_unlock_1(struct klm_unlockargs *, CLIENT *);
extern  klm_stat * klm_unlock_1_svc(struct klm_unlockargs *, struct svc_req *);
extern int klm_prog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

/* the xdr functions */
extern  bool_t xdr_klm_stats(XDR *, klm_stats*);
extern  bool_t xdr_klm_lock(XDR *, klm_lock*);
extern  bool_t xdr_klm_holder(XDR *, klm_holder*);
extern  bool_t xdr_klm_stat(XDR *, klm_stat*);
extern  bool_t xdr_klm_testrply(XDR *, klm_testrply*);
extern  bool_t xdr_klm_lockargs(XDR *, klm_lockargs*);
extern  bool_t xdr_klm_testargs(XDR *, klm_testargs*);
extern  bool_t xdr_klm_unlockargs(XDR *, klm_unlockargs*);

#ifdef __cplusplus
}
#endif

#endif /* !_KLM_PROT_H_RPCGEN */

repo_name: veiledmerc/mira

license: mit


code:
/*
 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
 * unrestricted use provided that this legend is included on all tape
 * media and as a part of the software program in whole or part.  Users
 * may copy or modify Sun RPC without charge, but are not authorized
 * to license or distribute it to anyone else except as part of a product or
 * program developed by the user.
 *
 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
 *
 * Sun RPC is provided with no support and without any obligation on the
 * part of Sun Microsystems, Inc. to assist in its use, correction,
 * modification or enhancement.
 *
 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
 * OR ANY PART THEREOF.
 *
 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
 * or profits or other special, indirect and consequential damages, even if
 * Sun has been advised of the possibility of such damages.
 *
 * Sun Microsystems, Inc.
 * 2550 Garcia Avenue
 * Mountain View, California  94043
 */

/*
 * Kernel/lock manager protocol definition
 * Copyright (C) 1986 Sun Microsystems, Inc.
 *
 * protocol used between the UNIX kernel (the "client") and the
 * local lock manager.  The local lock manager is a deamon running
 * above the kernel.
 */

#ifndef RPC_HDR
%#ifndef lint
%/*static char sccsid[] = "from: @(#)klm_prot.x 1.7 87/07/08 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)klm_prot.x	2.1 88/08/01 4.0 RPCSRC";*/
%#endif /* not lint */
%#include <sys/cdefs.h>
%__FBSDID("$FreeBSD: release/9.0.0/include/rpcsvc/klm_prot.x 114629 2003-05-04 02:51:42Z obrien $");
#endif

const	LM_MAXSTRLEN = 1024;

/*
 * lock manager status returns
 */
enum klm_stats {
	klm_granted = 0,	/* lock is granted */
	klm_denied = 1,		/* lock is denied */
	klm_denied_nolocks = 2, /* no lock entry available */
	klm_working = 3 	/* lock is being processed */
};

/*
 * lock manager lock identifier
 */
struct klm_lock {
	string server_name<LM_MAXSTRLEN>;
	netobj fh;		/* a counted file handle */
	int pid;		/* holder of the lock */
	unsigned l_offset;	/* beginning offset of the lock */
	unsigned l_len;		/* byte length of the lock;
				 * zero means through end of file */
};

/*
 * lock holder identifier
 */
struct klm_holder {
	bool exclusive;		/* FALSE if shared lock */
	int svid;		/* holder of the lock (pid) */
	unsigned l_offset;	/* beginning offset of the lock */
	unsigned l_len;		/* byte length of the lock;
				 * zero means through end of file */
};

/*
 * reply to KLM_LOCK / KLM_UNLOCK / KLM_CANCEL
 */
struct klm_stat {
	klm_stats stat;
};

/*
 * reply to a KLM_TEST call
 */
union klm_testrply switch (klm_stats stat) {
	case klm_denied:
		struct klm_holder holder;
	default: /* All other cases return no arguments */
		void;
};

/*
 * arguments to KLM_LOCK
 */
struct klm_lockargs {
	bool block;
	bool exclusive;
	struct klm_lock alock;
};

/*
 * arguments to KLM_TEST
 */
struct klm_testargs {
	bool exclusive;
	struct klm_lock alock;
};

/*
 * arguments to KLM_UNLOCK
 */
struct klm_unlockargs {
	struct klm_lock alock;
};

program KLM_PROG {
	version KLM_VERS {

		klm_testrply	KLM_TEST (struct klm_testargs) =	1;

		klm_stat	KLM_LOCK (struct klm_lockargs) =	2;

		klm_stat	KLM_CANCEL (struct klm_lockargs) =	3;
		/* klm_granted=> the cancel request fails due to lock is already granted */
		/* klm_denied=> the cancel request successfully aborts
lock request  */

		klm_stat	KLM_UNLOCK (struct klm_unlockargs) =	4;
	} = 1;
} = 100020;


code:
/*
 * Please do not edit this file.
 * It was generated using rpcgen.
 */

#ifndef _MOUNT_H_RPCGEN
#define	_MOUNT_H_RPCGEN

#include <rpc/rpc.h>

#ifdef __cplusplus
extern "C" {
#endif

#define	MNTPATHLEN 1024
#define	MNTNAMLEN 255
#define	FHSIZE 32
#define	FHSIZE3 64

typedef char fhandle[FHSIZE];

typedef struct {
	u_int fhandle3_len;
	char *fhandle3_val;
} fhandle3;

struct fhstatus {
	u_int fhs_status;
	union {
		fhandle fhs_fhandle;
	} fhstatus_u;
};
typedef struct fhstatus fhstatus;

enum mountstat3 {
	MNT3_OK = 0,
	MNT3ERR_PERM = 1,
	MNT3ERR_NOENT = 2,
	MNT3ERR_IO = 5,
	MNT3ERR_ACCES = 13,
	MNT3ERR_NOTDIR = 20,
	MNT3ERR_INVAL = 22,
	MNT3ERR_NAMETOOLONG = 63,
	MNT3ERR_NOTSUPP = 10004,
	MNT3ERR_SERVERFAULT = 10006
};
typedef enum mountstat3 mountstat3;

struct mountres3_ok {
	fhandle3 fhandle;
	struct {
		u_int auth_flavors_len;
		int *auth_flavors_val;
	} auth_flavors;
};
typedef struct mountres3_ok mountres3_ok;

struct mountres3 {
	mountstat3 fhs_status;
	union {
		mountres3_ok mountinfo;
	} mountres3_u;
};
typedef struct mountres3 mountres3;

typedef char *dirpath;

typedef char *name;

typedef struct mountbody *mountlist;

struct mountbody {
	name ml_hostname;
	dirpath ml_directory;
	mountlist ml_next;
};
typedef struct mountbody mountbody;

typedef struct groupnode *groups;

struct groupnode {
	name gr_name;
	groups gr_next;
};
typedef struct groupnode groupnode;

typedef struct exportnode *exports;

struct exportnode {
	dirpath ex_dir;
	groups ex_groups;
	exports ex_next;
};
typedef struct exportnode exportnode;

#define	MOUNTPROG ((unsigned long)(100005))
#define	MOUNTVERS ((unsigned long)(1))

extern  void mountprog_1(struct svc_req *rqstp, SVCXPRT *transp);
#define	MOUNTPROC_NULL ((unsigned long)(0))
extern  void * mountproc_null_1(void *, CLIENT *);
extern  void * mountproc_null_1_svc(void *, struct svc_req *);
#define	MOUNTPROC_MNT ((unsigned long)(1))
extern  fhstatus * mountproc_mnt_1(dirpath *, CLIENT *);
extern  fhstatus * mountproc_mnt_1_svc(dirpath *, struct svc_req *);
#define	MOUNTPROC_DUMP ((unsigned long)(2))
extern  mountlist * mountproc_dump_1(void *, CLIENT *);
extern  mountlist * mountproc_dump_1_svc(void *, struct svc_req *);
#define	MOUNTPROC_UMNT ((unsigned long)(3))
extern  void * mountproc_umnt_1(dirpath *, CLIENT *);
extern  void * mountproc_umnt_1_svc(dirpath *, struct svc_req *);
#define	MOUNTPROC_UMNTALL ((unsigned long)(4))
extern  void * mountproc_umntall_1(void *, CLIENT *);
extern  void * mountproc_umntall_1_svc(void *, struct svc_req *);
#define	MOUNTPROC_EXPORT ((unsigned long)(5))
extern  exports * mountproc_export_1(void *, CLIENT *);
extern  exports * mountproc_export_1_svc(void *, struct svc_req *);
#define	MOUNTPROC_EXPORTALL ((unsigned long)(6))
extern  exports * mountproc_exportall_1(void *, CLIENT *);
extern  exports * mountproc_exportall_1_svc(void *, struct svc_req *);
extern int mountprog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
#define	MOUNTVERS3 ((unsigned long)(3))

extern  void mountprog_3(struct svc_req *rqstp, SVCXPRT *transp);
extern  void * mountproc_null_3(void *, CLIENT *);
extern  void * mountproc_null_3_svc(void *, struct svc_req *);
extern  mountres3 * mountproc_mnt_3(dirpath *, CLIENT *);
extern  mountres3 * mountproc_mnt_3_svc(dirpath *, struct svc_req *);
extern  mountlist * mountproc_dump_3(void *, CLIENT *);
extern  mountlist * mountproc_dump_3_svc(void *, struct svc_req *);
extern  void * mountproc_umnt_3(dirpath *, CLIENT *);
extern  void * mountproc_umnt_3_svc(dirpath *, struct svc_req *);
extern  void * mountproc_umntall_3(void *, CLIENT *);
extern  void * mountproc_umntall_3_svc(void *, struct svc_req *);
extern  exports * mountproc_export_3(void *, CLIENT *);
extern  exports * mountproc_export_3_svc(void *, struct svc_req *);
extern int mountprog_3_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

/* the xdr functions */
extern  bool_t xdr_fhandle(XDR *, fhandle);
extern  bool_t xdr_fhandle3(XDR *, fhandle3*);
extern  bool_t xdr_fhstatus(XDR *, fhstatus*);
extern  bool_t xdr_mountstat3(XDR *, mountstat3*);
extern  bool_t xdr_mountres3_ok(XDR *, mountres3_ok*);
extern  bool_t xdr_mountres3(XDR *, mountres3*);
extern  bool_t xdr_dirpath(XDR *, dirpath*);
extern  bool_t xdr_name(XDR *, name*);
extern  bool_t xdr_mountlist(XDR *, mountlist*);
extern  bool_t xdr_mountbody(XDR *, mountbody*);
extern  bool_t xdr_groups(XDR *, groups*);
extern  bool_t xdr_groupnode(XDR *, groupnode*);
extern  bool_t xdr_exports(XDR *, exports*);
extern  bool_t xdr_exportnode(XDR *, exportnode*);

#ifdef __cplusplus
}
#endif

#endif /* !_MOUNT_H_RPCGEN */


code:
/*
 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
 * unrestricted use provided that this legend is included on all tape
 * media and as a part of the software program in whole or part.  Users
 * may copy or modify Sun RPC without charge, but are not authorized
 * to license or distribute it to anyone else except as part of a product or
 * program developed by the user.
 *
 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
 *
 * Sun RPC is provided with no support and without any obligation on the
 * part of Sun Microsystems, Inc. to assist in its use, correction,
 * modification or enhancement.
 *
 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
 * OR ANY PART THEREOF.
 *
 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
 * or profits or other special, indirect and consequential damages, even if
 * Sun has been advised of the possibility of such damages.
 *
 * Sun Microsystems, Inc.
 * 2550 Garcia Avenue
 * Mountain View, California  94043
 */

/*
 * Protocol description for the mount program
 */

#ifndef RPC_HDR
%#ifndef lint
%/*static char sccsid[] = "from: @(#)mount.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)mount.x	2.1 88/08/01 4.0 RPCSRC";*/
%#endif /* not lint */
%#include <sys/cdefs.h>
%__FBSDID("$FreeBSD: release/9.0.0/include/rpcsvc/mount.x 114629 2003-05-04 02:51:42Z obrien $");
#endif

const MNTPATHLEN = 1024;	/* maximum bytes in a pathname argument */
const MNTNAMLEN = 255;		/* maximum bytes in a name argument */
const FHSIZE = 32;		/* size in bytes of a file handle */
#ifdef WANT_NFS3
const FHSIZE3 = 64;		/* size in bytes of a file handle (v3) */
#endif

/*
 * The fhandle is the file handle that the server passes to the client.
 * All file operations are done using the file handles to refer to a file
 * or a directory. The file handle can contain whatever information the
 * server needs to distinguish an individual file.
 */
typedef opaque fhandle[FHSIZE];
#ifdef WANT_NFS3
typedef opaque fhandle3<FHSIZE3>;
#endif

/*
 * If a status of zero is returned, the call completed successfully, and
 * a file handle for the directory follows. A non-zero status indicates
 * some sort of error. The status corresponds with UNIX error numbers.
 */
union fhstatus switch (unsigned fhs_status) {
case 0:
	fhandle fhs_fhandle;
default:
	void;
};

#ifdef WANT_NFS3
/*
 * Status codes returned by the version 3 mount call.
 */
enum mountstat3 {
	MNT3_OK = 0,                 /* no error */
	MNT3ERR_PERM = 1,            /* Not owner */
	MNT3ERR_NOENT = 2,           /* No such file or directory */
	MNT3ERR_IO = 5,              /* I/O error */
	MNT3ERR_ACCES = 13,          /* Permission denied */
	MNT3ERR_NOTDIR = 20,         /* Not a directory */
	MNT3ERR_INVAL = 22,          /* Invalid argument */
	MNT3ERR_NAMETOOLONG = 63,    /* Filename too long */
	MNT3ERR_NOTSUPP = 10004,     /* Operation not supported */
	MNT3ERR_SERVERFAULT = 10006  /* A failure on the server */
};

struct mountres3_ok {
	fhandle3	fhandle;
	int		auth_flavors<>;
};

union mountres3 switch (mountstat3 fhs_status) {
case 0:
	mountres3_ok	mountinfo;
default:
	void;
};
#endif

/*
 * The type dirpath is the pathname of a directory
 */
typedef string dirpath<MNTPATHLEN>;

/*
 * The type name is used for arbitrary names (hostnames, groupnames)
 */
typedef string name<MNTNAMLEN>;

/*
 * A list of who has what mounted
 */
typedef struct mountbody *mountlist;
struct mountbody {
	name ml_hostname;
	dirpath ml_directory;
	mountlist ml_next;
};

/*
 * A list of netgroups
 */
typedef struct groupnode *groups;
struct groupnode {
	name gr_name;
	groups gr_next;
};

/*
 * A list of what is exported and to whom
 */
typedef struct exportnode *exports;
struct exportnode {
	dirpath ex_dir;
	groups ex_groups;
	exports ex_next;
};

program MOUNTPROG {
	/*
	 * Version one of the mount protocol communicates with version two
	 * of the NFS protocol. Version three communicates with
	 * version three of the NFS protocol. The only connecting
	 * point is the fhandle structure, which is the same for both
	 * protocols.
	 */
	version MOUNTVERS {
		/*
		 * Does no work. It is made available in all RPC services
		 * to allow server reponse testing and timing
		 */
		void
		MOUNTPROC_NULL(void) = 0;

		/*
		 * If fhs_status is 0, then fhs_fhandle contains the
	 	 * file handle for the directory. This file handle may
		 * be used in the NFS protocol. This procedure also adds
		 * a new entry to the mount list for this client mounting
		 * the directory.
		 * Unix authentication required.
		 */
		fhstatus
		MOUNTPROC_MNT(dirpath) = 1;

		/*
		 * Returns the list of remotely mounted filesystems. The
		 * mountlist contains one entry for each hostname and
		 * directory pair.
		 */
		mountlist
		MOUNTPROC_DUMP(void) = 2;

		/*
		 * Removes the mount list entry for the directory
		 * Unix authentication required.
		 */
		void
		MOUNTPROC_UMNT(dirpath) = 3;

		/*
		 * Removes all of the mount list entries for this client
		 * Unix authentication required.
		 */
		void
		MOUNTPROC_UMNTALL(void) = 4;

		/*
		 * Returns a list of all the exported filesystems, and which
		 * machines are allowed to import it.
		 */
		exports
		MOUNTPROC_EXPORT(void)  = 5;

		/*
		 * Identical to MOUNTPROC_EXPORT above
		 */
		exports
		MOUNTPROC_EXPORTALL(void) = 6;
	} = 1;
#ifdef WANT_NFS3
	version MOUNTVERS3 {
		/*
		 * Does no work. It is made available in all RPC services
		 * to allow server reponse testing and timing
		 */
		void
		MOUNTPROC_NULL(void) = 0;

		/*
		 * If mountres3.fhs_status is MNT3_OK, then
		 * mountres3.mountinfo contains the file handle for
		 * the directory and a list of acceptable
		 * authentication flavors.  This file handle may only
		 * be used in the NFS version 3 protocol.  This
		 * procedure also results in the server adding a new
		 * entry to its mount list recording that this client
		 * has mounted the directory. AUTH_UNIX authentication
		 * or better is required.
		 */
		mountres3
		MOUNTPROC_MNT(dirpath) = 1;

		/*
		 * Returns the list of remotely mounted filesystems. The
		 * mountlist contains one entry for each hostname and
		 * directory pair.
		 */
		mountlist
		MOUNTPROC_DUMP(void) = 2;

		/*
		 * Removes the mount list entry for the directory
		 * Unix authentication required.
		 */
		void
		MOUNTPROC_UMNT(dirpath) = 3;

		/*
		 * Removes all of the mount list entries for this client
		 * Unix authentication required.
		 */
		void
		MOUNTPROC_UMNTALL(void) = 4;

		/*
		 * Returns a list of all the exported filesystems, and which
		 * machines are allowed to import it.
		 */
		exports
		MOUNTPROC_EXPORT(void)  = 5;
	} = 3;
#endif
} = 100005;


code:
/*
 * Please do not edit this file.
 * It was generated using rpcgen.
 */

#ifndef _NFS_PROT_H_RPCGEN
#define	_NFS_PROT_H_RPCGEN

#include <rpc/rpc.h>

#ifdef __cplusplus
extern "C" {
#endif

#define	NFS_PORT 2049
#define	NFS_MAXDATA 8192
#define	NFS_MAXPATHLEN 1024
#define	NFS_MAXNAMLEN 255
#define	NFS_FHSIZE 32
#define	NFS_COOKIESIZE 4
#define	NFS_FIFO_DEV -1
#define	NFSMODE_FMT 0170000
#define	NFSMODE_DIR 0040000
#define	NFSMODE_CHR 0020000
#define	NFSMODE_BLK 0060000
#define	NFSMODE_REG 0100000
#define	NFSMODE_LNK 0120000
#define	NFSMODE_SOCK 0140000
#define	NFSMODE_FIFO 0010000

enum nfsstat {
	NFS_OK = 0,
	NFSERR_PERM = 1,
	NFSERR_NOENT = 2,
	NFSERR_IO = 5,
	NFSERR_NXIO = 6,
	NFSERR_ACCES = 13,
	NFSERR_EXIST = 17,
	NFSERR_NODEV = 19,
	NFSERR_NOTDIR = 20,
	NFSERR_ISDIR = 21,
	NFSERR_FBIG = 27,
	NFSERR_NOSPC = 28,
	NFSERR_ROFS = 30,
	NFSERR_NAMETOOLONG = 63,
	NFSERR_NOTEMPTY = 66,
	NFSERR_DQUOT = 69,
	NFSERR_STALE = 70,
	NFSERR_WFLUSH = 99
};
typedef enum nfsstat nfsstat;

enum ftype {
	NFNON = 0,
	NFREG = 1,
	NFDIR = 2,
	NFBLK = 3,
	NFCHR = 4,
	NFLNK = 5,
	NFSOCK = 6,
	NFBAD = 7,
	NFFIFO = 8
};
typedef enum ftype ftype;

struct nfs_fh {
	char data[NFS_FHSIZE];
};
typedef struct nfs_fh nfs_fh;

struct nfstime {
	u_int seconds;
	u_int useconds;
};
typedef struct nfstime nfstime;

struct fattr {
	ftype type;
	u_int mode;
	u_int nlink;
	u_int uid;
	u_int gid;
	u_int size;
	u_int blocksize;
	u_int rdev;
	u_int blocks;
	u_int fsid;
	u_int fileid;
	nfstime atime;
	nfstime mtime;
	nfstime ctime;
};
typedef struct fattr fattr;

struct sattr {
	u_int mode;
	u_int uid;
	u_int gid;
	u_int size;
	nfstime atime;
	nfstime mtime;
};
typedef struct sattr sattr;

typedef char *filename;

typedef char *nfspath;

struct attrstat {
	nfsstat status;
	union {
		fattr attributes;
	} attrstat_u;
};
typedef struct attrstat attrstat;

struct sattrargs {
	nfs_fh file;
	sattr attributes;
};
typedef struct sattrargs sattrargs;

struct diropargs {
	nfs_fh dir;
	filename name;
};
typedef struct diropargs diropargs;

struct diropokres {
	nfs_fh file;
	fattr attributes;
};
typedef struct diropokres diropokres;

struct diropres {
	nfsstat status;
	union {
		diropokres diropres;
	} diropres_u;
};
typedef struct diropres diropres;

struct readlinkres {
	nfsstat status;
	union {
		nfspath data;
	} readlinkres_u;
};
typedef struct readlinkres readlinkres;

struct readargs {
	nfs_fh file;
	u_int offset;
	u_int count;
	u_int totalcount;
};
typedef struct readargs readargs;

struct readokres {
	fattr attributes;
	struct {
		u_int data_len;
		char *data_val;
	} data;
};
typedef struct readokres readokres;

struct readres {
	nfsstat status;
	union {
		readokres reply;
	} readres_u;
};
typedef struct readres readres;

struct writeargs {
	nfs_fh file;
	u_int beginoffset;
	u_int offset;
	u_int totalcount;
	struct {
		u_int data_len;
		char *data_val;
	} data;
};
typedef struct writeargs writeargs;

struct createargs {
	diropargs where;
	sattr attributes;
};
typedef struct createargs createargs;

struct renameargs {
	diropargs from;
	diropargs to;
};
typedef struct renameargs renameargs;

struct linkargs {
	nfs_fh from;
	diropargs to;
};
typedef struct linkargs linkargs;

struct symlinkargs {
	diropargs from;
	nfspath to;
	sattr attributes;
};
typedef struct symlinkargs symlinkargs;

typedef char nfscookie[NFS_COOKIESIZE];

struct readdirargs {
	nfs_fh dir;
	nfscookie cookie;
	u_int count;
};
typedef struct readdirargs readdirargs;

struct entry {
	u_int fileid;
	filename name;
	nfscookie cookie;
	struct entry *nextentry;
};
typedef struct entry entry;

struct dirlist {
	entry *entries;
	bool_t eof;
};
typedef struct dirlist dirlist;

struct readdirres {
	nfsstat status;
	union {
		dirlist reply;
	} readdirres_u;
};
typedef struct readdirres readdirres;

struct statfsokres {
	u_int tsize;
	u_int bsize;
	u_int blocks;
	u_int bfree;
	u_int bavail;
};
typedef struct statfsokres statfsokres;

struct statfsres {
	nfsstat status;
	union {
		statfsokres reply;
	} statfsres_u;
};
typedef struct statfsres statfsres;
#define	NFS3_FHSIZE 64
#define	NFS3_COOKIEVERFSIZE 8
#define	NFS3_CREATEVERFSIZE 8
#define	NFS3_WRITEVERFSIZE 8

typedef u_int64_t uint64;

typedef int64_t int64;

typedef u_long uint32;

typedef long int32;

typedef char *filename3;

typedef char *nfspath3;

typedef uint64 fileid3;

typedef uint64 cookie3;

typedef char cookieverf3[NFS3_COOKIEVERFSIZE];

typedef char createverf3[NFS3_CREATEVERFSIZE];

typedef char writeverf3[NFS3_WRITEVERFSIZE];

typedef uint32 uid3;

typedef uint32 gid3;

typedef uint64 size3;

typedef uint64 offset3;

typedef uint32 mode3;

typedef uint32 count3;

enum nfsstat3 {
	NFS3_OK = 0,
	NFS3ERR_PERM = 1,
	NFS3ERR_NOENT = 2,
	NFS3ERR_IO = 5,
	NFS3ERR_NXIO = 6,
	NFS3ERR_ACCES = 13,
	NFS3ERR_EXIST = 17,
	NFS3ERR_XDEV = 18,
	NFS3ERR_NODEV = 19,
	NFS3ERR_NOTDIR = 20,
	NFS3ERR_ISDIR = 21,
	NFS3ERR_INVAL = 22,
	NFS3ERR_FBIG = 27,
	NFS3ERR_NOSPC = 28,
	NFS3ERR_ROFS = 30,
	NFS3ERR_MLINK = 31,
	NFS3ERR_NAMETOOLONG = 63,
	NFS3ERR_NOTEMPTY = 66,
	NFS3ERR_DQUOT = 69,
	NFS3ERR_STALE = 70,
	NFS3ERR_REMOTE = 71,
	NFS3ERR_BADHANDLE = 10001,
	NFS3ERR_NOT_SYNC = 10002,
	NFS3ERR_BAD_COOKIE = 10003,
	NFS3ERR_NOTSUPP = 10004,
	NFS3ERR_TOOSMALL = 10005,
	NFS3ERR_SERVERFAULT = 10006,
	NFS3ERR_BADTYPE = 10007,
	NFS3ERR_JUKEBOX = 10008
};
typedef enum nfsstat3 nfsstat3;

enum ftype3 {
	NF3REG = 1,
	NF3DIR = 2,
	NF3BLK = 3,
	NF3CHR = 4,
	NF3LNK = 5,
	NF3SOCK = 6,
	NF3FIFO = 7
};
typedef enum ftype3 ftype3;

struct specdata3 {
	uint32 specdata1;
	uint32 specdata2;
};
typedef struct specdata3 specdata3;

struct nfs_fh3 {
	struct {
		u_int data_len;
		char *data_val;
	} data;
};
typedef struct nfs_fh3 nfs_fh3;

struct nfstime3 {
	uint32 seconds;
	uint32 nseconds;
};
typedef struct nfstime3 nfstime3;

struct fattr3 {
	ftype3 type;
	mode3 mode;
	uint32 nlink;
	uid3 uid;
	gid3 gid;
	size3 size;
	size3 used;
	specdata3 rdev;
	uint64 fsid;
	fileid3 fileid;
	nfstime3 atime;
	nfstime3 mtime;
	nfstime3 ctime;
};
typedef struct fattr3 fattr3;

struct post_op_attr {
	bool_t attributes_follow;
	union {
		fattr3 attributes;
	} post_op_attr_u;
};
typedef struct post_op_attr post_op_attr;

struct wcc_attr {
	size3 size;
	nfstime3 mtime;
	nfstime3 ctime;
};
typedef struct wcc_attr wcc_attr;

struct pre_op_attr {
	bool_t attributes_follow;
	union {
		wcc_attr attributes;
	} pre_op_attr_u;
};
typedef struct pre_op_attr pre_op_attr;

struct wcc_data {
	pre_op_attr before;
	post_op_attr after;
};
typedef struct wcc_data wcc_data;

struct post_op_fh3 {
	bool_t handle_follows;
	union {
		nfs_fh3 handle;
	} post_op_fh3_u;
};
typedef struct post_op_fh3 post_op_fh3;

enum time_how {
	DONT_CHANGE = 0,
	SET_TO_SERVER_TIME = 1,
	SET_TO_CLIENT_TIME = 2
};
typedef enum time_how time_how;

struct set_mode3 {
	bool_t set_it;
	union {
		mode3 mode;
	} set_mode3_u;
};
typedef struct set_mode3 set_mode3;

struct set_uid3 {
	bool_t set_it;
	union {
		uid3 uid;
	} set_uid3_u;
};
typedef struct set_uid3 set_uid3;

struct set_gid3 {
	bool_t set_it;
	union {
		gid3 gid;
	} set_gid3_u;
};
typedef struct set_gid3 set_gid3;

struct set_size3 {
	bool_t set_it;
	union {
		size3 size;
	} set_size3_u;
};
typedef struct set_size3 set_size3;

struct set_atime {
	time_how set_it;
	union {
		nfstime3 atime;
	} set_atime_u;
};
typedef struct set_atime set_atime;

struct set_mtime {
	time_how set_it;
	union {
		nfstime3 mtime;
	} set_mtime_u;
};
typedef struct set_mtime set_mtime;

struct sattr3 {
	set_mode3 mode;
	set_uid3 uid;
	set_gid3 gid;
	set_size3 size;
	set_atime atime;
	set_mtime mtime;
};
typedef struct sattr3 sattr3;

struct diropargs3 {
	nfs_fh3 dir;
	filename3 name;
};
typedef struct diropargs3 diropargs3;

struct GETATTR3args {
	nfs_fh3 object;
};
typedef struct GETATTR3args GETATTR3args;

struct GETATTR3resok {
	fattr3 obj_attributes;
};
typedef struct GETATTR3resok GETATTR3resok;

struct GETATTR3res {
	nfsstat3 status;
	union {
		GETATTR3resok resok;
	} GETATTR3res_u;
};
typedef struct GETATTR3res GETATTR3res;

struct sattrguard3 {
	bool_t check;
	union {
		nfstime3 obj_ctime;
	} sattrguard3_u;
};
typedef struct sattrguard3 sattrguard3;

struct SETATTR3args {
	nfs_fh3 object;
	sattr3 new_attributes;
	sattrguard3 guard;
};
typedef struct SETATTR3args SETATTR3args;

struct SETATTR3resok {
	wcc_data obj_wcc;
};
typedef struct SETATTR3resok SETATTR3resok;

struct SETATTR3resfail {
	wcc_data obj_wcc;
};
typedef struct SETATTR3resfail SETATTR3resfail;

struct SETATTR3res {
	nfsstat3 status;
	union {
		SETATTR3resok resok;
		SETATTR3resfail resfail;
	} SETATTR3res_u;
};
typedef struct SETATTR3res SETATTR3res;

struct LOOKUP3args {
	diropargs3 what;
};
typedef struct LOOKUP3args LOOKUP3args;

struct LOOKUP3resok {
	nfs_fh3 object;
	post_op_attr obj_attributes;
	post_op_attr dir_attributes;
};
typedef struct LOOKUP3resok LOOKUP3resok;

struct LOOKUP3resfail {
	post_op_attr dir_attributes;
};
typedef struct LOOKUP3resfail LOOKUP3resfail;

struct LOOKUP3res {
	nfsstat3 status;
	union {
		LOOKUP3resok resok;
		LOOKUP3resfail resfail;
	} LOOKUP3res_u;
};
typedef struct LOOKUP3res LOOKUP3res;
#define	ACCESS3_READ 0x0001
#define	ACCESS3_LOOKUP 0x0002
#define	ACCESS3_MODIFY 0x0004
#define	ACCESS3_EXTEND 0x0008
#define	ACCESS3_DELETE 0x0010
#define	ACCESS3_EXECUTE 0x0020

struct ACCESS3args {
	nfs_fh3 object;
	uint32 access;
};
typedef struct ACCESS3args ACCESS3args;

struct ACCESS3resok {
	post_op_attr obj_attributes;
	uint32 access;
};
typedef struct ACCESS3resok ACCESS3resok;

struct ACCESS3resfail {
	post_op_attr obj_attributes;
};
typedef struct ACCESS3resfail ACCESS3resfail;

struct ACCESS3res {
	nfsstat3 status;
	union {
		ACCESS3resok resok;
		ACCESS3resfail resfail;
	} ACCESS3res_u;
};
typedef struct ACCESS3res ACCESS3res;

struct READLINK3args {
	nfs_fh3 symlink;
};
typedef struct READLINK3args READLINK3args;

struct READLINK3resok {
	post_op_attr symlink_attributes;
	nfspath3 data;
};
typedef struct READLINK3resok READLINK3resok;

struct READLINK3resfail {
	post_op_attr symlink_attributes;
};
typedef struct READLINK3resfail READLINK3resfail;

struct READLINK3res {
	nfsstat3 status;
	union {
		READLINK3resok resok;
		READLINK3resfail resfail;
	} READLINK3res_u;
};
typedef struct READLINK3res READLINK3res;

struct READ3args {
	nfs_fh3 file;
	offset3 offset;
	count3 count;
};
typedef struct READ3args READ3args;

struct READ3resok {
	post_op_attr file_attributes;
	count3 count;
	bool_t eof;
	struct {
		u_int data_len;
		char *data_val;
	} data;
};
typedef struct READ3resok READ3resok;

struct READ3resfail {
	post_op_attr file_attributes;
};
typedef struct READ3resfail READ3resfail;

struct READ3res {
	nfsstat3 status;
	union {
		READ3resok resok;
		READ3resfail resfail;
	} READ3res_u;
};
typedef struct READ3res READ3res;

enum stable_how {
	UNSTABLE = 0,
	DATA_SYNC = 1,
	FILE_SYNC = 2
};
typedef enum stable_how stable_how;

struct WRITE3args {
	nfs_fh3 file;
	offset3 offset;
	count3 count;
	stable_how stable;
	struct {
		u_int data_len;
		char *data_val;
	} data;
};
typedef struct WRITE3args WRITE3args;

struct WRITE3resok {
	wcc_data file_wcc;
	count3 count;
	stable_how committed;
	writeverf3 verf;
};
typedef struct WRITE3resok WRITE3resok;

struct WRITE3resfail {
	wcc_data file_wcc;
};
typedef struct WRITE3resfail WRITE3resfail;

struct WRITE3res {
	nfsstat3 status;
	union {
		WRITE3resok resok;
		WRITE3resfail resfail;
	} WRITE3res_u;
};
typedef struct WRITE3res WRITE3res;

enum createmode3 {
	UNCHECKED = 0,
	GUARDED = 1,
	EXCLUSIVE = 2
};
typedef enum createmode3 createmode3;

struct createhow3 {
	createmode3 mode;
	union {
		sattr3 obj_attributes;
		createverf3 verf;
	} createhow3_u;
};
typedef struct createhow3 createhow3;

struct CREATE3args {
	diropargs3 where;
	createhow3 how;
};
typedef struct CREATE3args CREATE3args;

struct CREATE3resok {
	post_op_fh3 obj;
	post_op_attr obj_attributes;
	wcc_data dir_wcc;
};
typedef struct CREATE3resok CREATE3resok;

struct CREATE3resfail {
	wcc_data dir_wcc;
};
typedef struct CREATE3resfail CREATE3resfail;

struct CREATE3res {
	nfsstat3 status;
	union {
		CREATE3resok resok;
		CREATE3resfail resfail;
	} CREATE3res_u;
};
typedef struct CREATE3res CREATE3res;

struct MKDIR3args {
	diropargs3 where;
	sattr3 attributes;
};
typedef struct MKDIR3args MKDIR3args;

struct MKDIR3resok {
	post_op_fh3 obj;
	post_op_attr obj_attributes;
	wcc_data dir_wcc;
};
typedef struct MKDIR3resok MKDIR3resok;

struct MKDIR3resfail {
	wcc_data dir_wcc;
};
typedef struct MKDIR3resfail MKDIR3resfail;

struct MKDIR3res {
	nfsstat3 status;
	union {
		MKDIR3resok resok;
		MKDIR3resfail resfail;
	} MKDIR3res_u;
};
typedef struct MKDIR3res MKDIR3res;

struct symlinkdata3 {
	sattr3 symlink_attributes;
	nfspath3 symlink_data;
};
typedef struct symlinkdata3 symlinkdata3;

struct SYMLINK3args {
	diropargs3 where;
	symlinkdata3 symlink;
};
typedef struct SYMLINK3args SYMLINK3args;

struct SYMLINK3resok {
	post_op_fh3 obj;
	post_op_attr obj_attributes;
	wcc_data dir_wcc;
};
typedef struct SYMLINK3resok SYMLINK3resok;

struct SYMLINK3resfail {
	wcc_data dir_wcc;
};
typedef struct SYMLINK3resfail SYMLINK3resfail;

struct SYMLINK3res {
	nfsstat3 status;
	union {
		SYMLINK3resok resok;
		SYMLINK3resfail resfail;
	} SYMLINK3res_u;
};
typedef struct SYMLINK3res SYMLINK3res;

struct devicedata3 {
	sattr3 dev_attributes;
	specdata3 spec;
};
typedef struct devicedata3 devicedata3;

struct mknoddata3 {
	ftype3 type;
	union {
		devicedata3 device;
		sattr3 pipe_attributes;
	} mknoddata3_u;
};
typedef struct mknoddata3 mknoddata3;

struct MKNOD3args {
	diropargs3 where;
	mknoddata3 what;
};
typedef struct MKNOD3args MKNOD3args;

struct MKNOD3resok {
	post_op_fh3 obj;
	post_op_attr obj_attributes;
	wcc_data dir_wcc;
};
typedef struct MKNOD3resok MKNOD3resok;

struct MKNOD3resfail {
	wcc_data dir_wcc;
};
typedef struct MKNOD3resfail MKNOD3resfail;

struct MKNOD3res {
	nfsstat3 status;
	union {
		MKNOD3resok resok;
		MKNOD3resfail resfail;
	} MKNOD3res_u;
};
typedef struct MKNOD3res MKNOD3res;

struct REMOVE3args {
	diropargs3 object;
};
typedef struct REMOVE3args REMOVE3args;

struct REMOVE3resok {
	wcc_data dir_wcc;
};
typedef struct REMOVE3resok REMOVE3resok;

struct REMOVE3resfail {
	wcc_data dir_wcc;
};
typedef struct REMOVE3resfail REMOVE3resfail;

struct REMOVE3res {
	nfsstat3 status;
	union {
		REMOVE3resok resok;
		REMOVE3resfail resfail;
	} REMOVE3res_u;
};
typedef struct REMOVE3res REMOVE3res;

struct RMDIR3args {
	diropargs3 object;
};
typedef struct RMDIR3args RMDIR3args;

struct RMDIR3resok {
	wcc_data dir_wcc;
};
typedef struct RMDIR3resok RMDIR3resok;

struct RMDIR3resfail {
	wcc_data dir_wcc;
};
typedef struct RMDIR3resfail RMDIR3resfail;

struct RMDIR3res {
	nfsstat3 status;
	union {
		RMDIR3resok resok;
		RMDIR3resfail resfail;
	} RMDIR3res_u;
};
typedef struct RMDIR3res RMDIR3res;

struct RENAME3args {
	diropargs3 from;
	diropargs3 to;
};
typedef struct RENAME3args RENAME3args;

struct RENAME3resok {
	wcc_data fromdir_wcc;
	wcc_data todir_wcc;
};
typedef struct RENAME3resok RENAME3resok;

struct RENAME3resfail {
	wcc_data fromdir_wcc;
	wcc_data todir_wcc;
};
typedef struct RENAME3resfail RENAME3resfail;

struct RENAME3res {
	nfsstat3 status;
	union {
		RENAME3resok resok;
		RENAME3resfail resfail;
	} RENAME3res_u;
};
typedef struct RENAME3res RENAME3res;

struct LINK3args {
	nfs_fh3 file;
	diropargs3 link;
};
typedef struct LINK3args LINK3args;

struct LINK3resok {
	post_op_attr file_attributes;
	wcc_data linkdir_wcc;
};
typedef struct LINK3resok LINK3resok;

struct LINK3resfail {
	post_op_attr file_attributes;
	wcc_data linkdir_wcc;
};
typedef struct LINK3resfail LINK3resfail;

struct LINK3res {
	nfsstat3 status;
	union {
		LINK3resok resok;
		LINK3resfail resfail;
	} LINK3res_u;
};
typedef struct LINK3res LINK3res;

struct READDIR3args {
	nfs_fh3 dir;
	cookie3 cookie;
	cookieverf3 cookieverf;
	count3 count;
};
typedef struct READDIR3args READDIR3args;

struct entry3 {
	fileid3 fileid;
	filename3 name;
	cookie3 cookie;
	struct entry3 *nextentry;
};
typedef struct entry3 entry3;

struct dirlist3 {
	entry3 *entries;
	bool_t eof;
};
typedef struct dirlist3 dirlist3;

struct READDIR3resok {
	post_op_attr dir_attributes;
	cookieverf3 cookieverf;
	dirlist3 reply;
};
typedef struct READDIR3resok READDIR3resok;

struct READDIR3resfail {
	post_op_attr dir_attributes;
};
typedef struct READDIR3resfail READDIR3resfail;

struct READDIR3res {
	nfsstat3 status;
	union {
		READDIR3resok resok;
		READDIR3resfail resfail;
	} READDIR3res_u;
};
typedef struct READDIR3res READDIR3res;

struct READDIRPLUS3args {
	nfs_fh3 dir;
	cookie3 cookie;
	cookieverf3 cookieverf;
	count3 dircount;
	count3 maxcount;
};
typedef struct READDIRPLUS3args READDIRPLUS3args;

struct entryplus3 {
	fileid3 fileid;
	filename3 name;
	cookie3 cookie;
	post_op_attr name_attributes;
	post_op_fh3 name_handle;
	struct entryplus3 *nextentry;
};
typedef struct entryplus3 entryplus3;

struct dirlistplus3 {
	entryplus3 *entries;
	bool_t eof;
};
typedef struct dirlistplus3 dirlistplus3;

struct READDIRPLUS3resok {
	post_op_attr dir_attributes;
	cookieverf3 cookieverf;
	dirlistplus3 reply;
};
typedef struct READDIRPLUS3resok READDIRPLUS3resok;

struct READDIRPLUS3resfail {
	post_op_attr dir_attributes;
};
typedef struct READDIRPLUS3resfail READDIRPLUS3resfail;

struct READDIRPLUS3res {
	nfsstat3 status;
	union {
		READDIRPLUS3resok resok;
		READDIRPLUS3resfail resfail;
	} READDIRPLUS3res_u;
};
typedef struct READDIRPLUS3res READDIRPLUS3res;

struct FSSTAT3args {
	nfs_fh3 fsroot;
};
typedef struct FSSTAT3args FSSTAT3args;

struct FSSTAT3resok {
	post_op_attr obj_attributes;
	size3 tbytes;
	size3 fbytes;
	size3 abytes;
	size3 tfiles;
	size3 ffiles;
	size3 afiles;
	uint32 invarsec;
};
typedef struct FSSTAT3resok FSSTAT3resok;

struct FSSTAT3resfail {
	post_op_attr obj_attributes;
};
typedef struct FSSTAT3resfail FSSTAT3resfail;

struct FSSTAT3res {
	nfsstat3 status;
	union {
		FSSTAT3resok resok;
		FSSTAT3resfail resfail;
	} FSSTAT3res_u;
};
typedef struct FSSTAT3res FSSTAT3res;
#define	FSF3_LINK 0x0001
#define	FSF3_SYMLINK 0x0002
#define	FSF3_HOMOGENEOUS 0x0008
#define	FSF3_CANSETTIME 0x0010

struct FSINFO3args {
	nfs_fh3 fsroot;
};
typedef struct FSINFO3args FSINFO3args;

struct FSINFO3resok {
	post_op_attr obj_attributes;
	uint32 rtmax;
	uint32 rtpref;
	uint32 rtmult;
	uint32 wtmax;
	uint32 wtpref;
	uint32 wtmult;
	uint32 dtpref;
	size3 maxfilesize;
	nfstime3 time_delta;
	uint32 properties;
};
typedef struct FSINFO3resok FSINFO3resok;

struct FSINFO3resfail {
	post_op_attr obj_attributes;
};
typedef struct FSINFO3resfail FSINFO3resfail;

struct FSINFO3res {
	nfsstat3 status;
	union {
		FSINFO3resok resok;
		FSINFO3resfail resfail;
	} FSINFO3res_u;
};
typedef struct FSINFO3res FSINFO3res;

struct PATHCONF3args {
	nfs_fh3 object;
};
typedef struct PATHCONF3args PATHCONF3args;

struct PATHCONF3resok {
	post_op_attr obj_attributes;
	uint32 linkmax;
	uint32 name_max;
	bool_t no_trunc;
	bool_t chown_restricted;
	bool_t case_insensitive;
	bool_t case_preserving;
};
typedef struct PATHCONF3resok PATHCONF3resok;

struct PATHCONF3resfail {
	post_op_attr obj_attributes;
};
typedef struct PATHCONF3resfail PATHCONF3resfail;

struct PATHCONF3res {
	nfsstat3 status;
	union {
		PATHCONF3resok resok;
		PATHCONF3resfail resfail;
	} PATHCONF3res_u;
};
typedef struct PATHCONF3res PATHCONF3res;

struct COMMIT3args {
	nfs_fh3 file;
	offset3 offset;
	count3 count;
};
typedef struct COMMIT3args COMMIT3args;

struct COMMIT3resok {
	wcc_data file_wcc;
	writeverf3 verf;
};
typedef struct COMMIT3resok COMMIT3resok;

struct COMMIT3resfail {
	wcc_data file_wcc;
};
typedef struct COMMIT3resfail COMMIT3resfail;

struct COMMIT3res {
	nfsstat3 status;
	union {
		COMMIT3resok resok;
		COMMIT3resfail resfail;
	} COMMIT3res_u;
};
typedef struct COMMIT3res COMMIT3res;

#define	NFS_PROGRAM ((unsigned long)(100003))
#define	NFS_VERSION ((unsigned long)(2))

extern  void nfs_program_2(struct svc_req *rqstp, SVCXPRT *transp);
#define	NFSPROC_NULL ((unsigned long)(0))
extern  void * nfsproc_null_2(void *, CLIENT *);
extern  void * nfsproc_null_2_svc(void *, struct svc_req *);
#define	NFSPROC_GETATTR ((unsigned long)(1))
extern  attrstat * nfsproc_getattr_2(nfs_fh *, CLIENT *);
extern  attrstat * nfsproc_getattr_2_svc(nfs_fh *, struct svc_req *);
#define	NFSPROC_SETATTR ((unsigned long)(2))
extern  attrstat * nfsproc_setattr_2(sattrargs *, CLIENT *);
extern  attrstat * nfsproc_setattr_2_svc(sattrargs *, struct svc_req *);
#define	NFSPROC_ROOT ((unsigned long)(3))
extern  void * nfsproc_root_2(void *, CLIENT *);
extern  void * nfsproc_root_2_svc(void *, struct svc_req *);
#define	NFSPROC_LOOKUP ((unsigned long)(4))
extern  diropres * nfsproc_lookup_2(diropargs *, CLIENT *);
extern  diropres * nfsproc_lookup_2_svc(diropargs *, struct svc_req *);
#define	NFSPROC_READLINK ((unsigned long)(5))
extern  readlinkres * nfsproc_readlink_2(nfs_fh *, CLIENT *);
extern  readlinkres * nfsproc_readlink_2_svc(nfs_fh *, struct svc_req *);
#define	NFSPROC_READ ((unsigned long)(6))
extern  readres * nfsproc_read_2(readargs *, CLIENT *);
extern  readres * nfsproc_read_2_svc(readargs *, struct svc_req *);
#define	NFSPROC_WRITECACHE ((unsigned long)(7))
extern  void * nfsproc_writecache_2(void *, CLIENT *);
extern  void * nfsproc_writecache_2_svc(void *, struct svc_req *);
#define	NFSPROC_WRITE ((unsigned long)(8))
extern  attrstat * nfsproc_write_2(writeargs *, CLIENT *);
extern  attrstat * nfsproc_write_2_svc(writeargs *, struct svc_req *);
#define	NFSPROC_CREATE ((unsigned long)(9))
extern  diropres * nfsproc_create_2(createargs *, CLIENT *);
extern  diropres * nfsproc_create_2_svc(createargs *, struct svc_req *);
#define	NFSPROC_REMOVE ((unsigned long)(10))
extern  nfsstat * nfsproc_remove_2(diropargs *, CLIENT *);
extern  nfsstat * nfsproc_remove_2_svc(diropargs *, struct svc_req *);
#define	NFSPROC_RENAME ((unsigned long)(11))
extern  nfsstat * nfsproc_rename_2(renameargs *, CLIENT *);
extern  nfsstat * nfsproc_rename_2_svc(renameargs *, struct svc_req *);
#define	NFSPROC_LINK ((unsigned long)(12))
extern  nfsstat * nfsproc_link_2(linkargs *, CLIENT *);
extern  nfsstat * nfsproc_link_2_svc(linkargs *, struct svc_req *);
#define	NFSPROC_SYMLINK ((unsigned long)(13))
extern  nfsstat * nfsproc_symlink_2(symlinkargs *, CLIENT *);
extern  nfsstat * nfsproc_symlink_2_svc(symlinkargs *, struct svc_req *);
#define	NFSPROC_MKDIR ((unsigned long)(14))
extern  diropres * nfsproc_mkdir_2(createargs *, CLIENT *);
extern  diropres * nfsproc_mkdir_2_svc(createargs *, struct svc_req *);
#define	NFSPROC_RMDIR ((unsigned long)(15))
extern  nfsstat * nfsproc_rmdir_2(diropargs *, CLIENT *);
extern  nfsstat * nfsproc_rmdir_2_svc(diropargs *, struct svc_req *);
#define	NFSPROC_READDIR ((unsigned long)(16))
extern  readdirres * nfsproc_readdir_2(readdirargs *, CLIENT *);
extern  readdirres * nfsproc_readdir_2_svc(readdirargs *, struct svc_req *);
#define	NFSPROC_STATFS ((unsigned long)(17))
extern  statfsres * nfsproc_statfs_2(nfs_fh *, CLIENT *);
extern  statfsres * nfsproc_statfs_2_svc(nfs_fh *, struct svc_req *);
extern int nfs_program_2_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

#define	NFS3_PROGRAM ((unsigned long)(100003))
#define	NFS_V3 ((unsigned long)(3))

extern  void nfs3_program_3(struct svc_req *rqstp, SVCXPRT *transp);
#define	NFSPROC3_NULL ((unsigned long)(0))
extern  void * nfsproc3_null_3(void *, CLIENT *);
extern  void * nfsproc3_null_3_svc(void *, struct svc_req *);
#define	NFSPROC3_GETATTR ((unsigned long)(1))
extern  GETATTR3res * nfsproc3_getattr_3(GETATTR3args *, CLIENT *);
extern  GETATTR3res * nfsproc3_getattr_3_svc(GETATTR3args *, struct svc_req *);
#define	NFSPROC3_SETATTR ((unsigned long)(2))
extern  SETATTR3res * nfsproc3_setattr_3(SETATTR3args *, CLIENT *);
extern  SETATTR3res * nfsproc3_setattr_3_svc(SETATTR3args *, struct svc_req *);
#define	NFSPROC3_LOOKUP ((unsigned long)(3))
extern  LOOKUP3res * nfsproc3_lookup_3(LOOKUP3args *, CLIENT *);
extern  LOOKUP3res * nfsproc3_lookup_3_svc(LOOKUP3args *, struct svc_req *);
#define	NFSPROC3_ACCESS ((unsigned long)(4))
extern  ACCESS3res * nfsproc3_access_3(ACCESS3args *, CLIENT *);
extern  ACCESS3res * nfsproc3_access_3_svc(ACCESS3args *, struct svc_req *);
#define	NFSPROC3_READLINK ((unsigned long)(5))
extern  READLINK3res * nfsproc3_readlink_3(READLINK3args *, CLIENT *);
extern  READLINK3res * nfsproc3_readlink_3_svc(READLINK3args *, struct svc_req *);
#define	NFSPROC3_READ ((unsigned long)(6))
extern  READ3res * nfsproc3_read_3(READ3args *, CLIENT *);
extern  READ3res * nfsproc3_read_3_svc(READ3args *, struct svc_req *);
#define	NFSPROC3_WRITE ((unsigned long)(7))
extern  WRITE3res * nfsproc3_write_3(WRITE3args *, CLIENT *);
extern  WRITE3res * nfsproc3_write_3_svc(WRITE3args *, struct svc_req *);
#define	NFSPROC3_CREATE ((unsigned long)(8))
extern  CREATE3res * nfsproc3_create_3(CREATE3args *, CLIENT *);
extern  CREATE3res * nfsproc3_create_3_svc(CREATE3args *, struct svc_req *);
#define	NFSPROC3_MKDIR ((unsigned long)(9))
extern  MKDIR3res * nfsproc3_mkdir_3(MKDIR3args *, CLIENT *);
extern  MKDIR3res * nfsproc3_mkdir_3_svc(MKDIR3args *, struct svc_req *);
#define	NFSPROC3_SYMLINK ((unsigned long)(10))
extern  SYMLINK3res * nfsproc3_symlink_3(SYMLINK3args *, CLIENT *);
extern  SYMLINK3res * nfsproc3_symlink_3_svc(SYMLINK3args *, struct svc_req *);
#define	NFSPROC3_MKNOD ((unsigned long)(11))
extern  MKNOD3res * nfsproc3_mknod_3(MKNOD3args *, CLIENT *);
extern  MKNOD3res * nfsproc3_mknod_3_svc(MKNOD3args *, struct svc_req *);
#define	NFSPROC3_REMOVE ((unsigned long)(12))
extern  REMOVE3res * nfsproc3_remove_3(REMOVE3args *, CLIENT *);
extern  REMOVE3res * nfsproc3_remove_3_svc(REMOVE3args *, struct svc_req *);
#define	NFSPROC3_RMDIR ((unsigned long)(13))
extern  RMDIR3res * nfsproc3_rmdir_3(RMDIR3args *, CLIENT *);
extern  RMDIR3res * nfsproc3_rmdir_3_svc(RMDIR3args *, struct svc_req *);
#define	NFSPROC3_RENAME ((unsigned long)(14))
extern  RENAME3res * nfsproc3_rename_3(RENAME3args *, CLIENT *);
extern  RENAME3res * nfsproc3_rename_3_svc(RENAME3args *, struct svc_req *);
#define	NFSPROC3_LINK ((unsigned long)(15))
extern  LINK3res * nfsproc3_link_3(LINK3args *, CLIENT *);
extern  LINK3res * nfsproc3_link_3_svc(LINK3args *, struct svc_req *);
#define	NFSPROC3_READDIR ((unsigned long)(16))
extern  READDIR3res * nfsproc3_readdir_3(READDIR3args *, CLIENT *);
extern  READDIR3res * nfsproc3_readdir_3_svc(READDIR3args *, struct svc_req *);
#define	NFSPROC3_READDIRPLUS ((unsigned long)(17))
extern  READDIRPLUS3res * nfsproc3_readdirplus_3(READDIRPLUS3args *, CLIENT *);
extern  READDIRPLUS3res * nfsproc3_readdirplus_3_svc(READDIRPLUS3args *, struct svc_req *);
#define	NFSPROC3_FSSTAT ((unsigned long)(18))
extern  FSSTAT3res * nfsproc3_fsstat_3(FSSTAT3args *, CLIENT *);
extern  FSSTAT3res * nfsproc3_fsstat_3_svc(FSSTAT3args *, struct svc_req *);
#define	NFSPROC3_FSINFO ((unsigned long)(19))
extern  FSINFO3res * nfsproc3_fsinfo_3(FSINFO3args *, CLIENT *);
extern  FSINFO3res * nfsproc3_fsinfo_3_svc(FSINFO3args *, struct svc_req *);
#define	NFSPROC3_PATHCONF ((unsigned long)(20))
extern  PATHCONF3res * nfsproc3_pathconf_3(PATHCONF3args *, CLIENT *);
extern  PATHCONF3res * nfsproc3_pathconf_3_svc(PATHCONF3args *, struct svc_req *);
#define	NFSPROC3_COMMIT ((unsigned long)(21))
extern  COMMIT3res * nfsproc3_commit_3(COMMIT3args *, CLIENT *);
extern  COMMIT3res * nfsproc3_commit_3_svc(COMMIT3args *, struct svc_req *);
extern int nfs3_program_3_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

/* the xdr functions */
extern  bool_t xdr_nfsstat(XDR *, nfsstat*);
extern  bool_t xdr_ftype(XDR *, ftype*);
extern  bool_t xdr_nfs_fh(XDR *, nfs_fh*);
extern  bool_t xdr_nfstime(XDR *, nfstime*);
extern  bool_t xdr_fattr(XDR *, fattr*);
extern  bool_t xdr_sattr(XDR *, sattr*);
extern  bool_t xdr_filename(XDR *, filename*);
extern  bool_t xdr_nfspath(XDR *, nfspath*);
extern  bool_t xdr_attrstat(XDR *, attrstat*);
extern  bool_t xdr_sattrargs(XDR *, sattrargs*);
extern  bool_t xdr_diropargs(XDR *, diropargs*);
extern  bool_t xdr_diropokres(XDR *, diropokres*);
extern  bool_t xdr_diropres(XDR *, diropres*);
extern  bool_t xdr_readlinkres(XDR *, readlinkres*);
extern  bool_t xdr_readargs(XDR *, readargs*);
extern  bool_t xdr_readokres(XDR *, readokres*);
extern  bool_t xdr_readres(XDR *, readres*);
extern  bool_t xdr_writeargs(XDR *, writeargs*);
extern  bool_t xdr_createargs(XDR *, createargs*);
extern  bool_t xdr_renameargs(XDR *, renameargs*);
extern  bool_t xdr_linkargs(XDR *, linkargs*);
extern  bool_t xdr_symlinkargs(XDR *, symlinkargs*);
extern  bool_t xdr_nfscookie(XDR *, nfscookie);
extern  bool_t xdr_readdirargs(XDR *, readdirargs*);
extern  bool_t xdr_entry(XDR *, entry*);
extern  bool_t xdr_dirlist(XDR *, dirlist*);
extern  bool_t xdr_readdirres(XDR *, readdirres*);
extern  bool_t xdr_statfsokres(XDR *, statfsokres*);
extern  bool_t xdr_statfsres(XDR *, statfsres*);
extern  bool_t xdr_uint64(XDR *, uint64*);
extern  bool_t xdr_int64(XDR *, int64*);
extern  bool_t xdr_uint32(XDR *, uint32*);
extern  bool_t xdr_int32(XDR *, int32*);
extern  bool_t xdr_filename3(XDR *, filename3*);
extern  bool_t xdr_nfspath3(XDR *, nfspath3*);
extern  bool_t xdr_fileid3(XDR *, fileid3*);
extern  bool_t xdr_cookie3(XDR *, cookie3*);
extern  bool_t xdr_cookieverf3(XDR *, cookieverf3);
extern  bool_t xdr_createverf3(XDR *, createverf3);
extern  bool_t xdr_writeverf3(XDR *, writeverf3);
extern  bool_t xdr_uid3(XDR *, uid3*);
extern  bool_t xdr_gid3(XDR *, gid3*);
extern  bool_t xdr_size3(XDR *, size3*);
extern  bool_t xdr_offset3(XDR *, offset3*);
extern  bool_t xdr_mode3(XDR *, mode3*);
extern  bool_t xdr_count3(XDR *, count3*);
extern  bool_t xdr_nfsstat3(XDR *, nfsstat3*);
extern  bool_t xdr_ftype3(XDR *, ftype3*);
extern  bool_t xdr_specdata3(XDR *, specdata3*);
extern  bool_t xdr_nfs_fh3(XDR *, nfs_fh3*);
extern  bool_t xdr_nfstime3(XDR *, nfstime3*);
extern  bool_t xdr_fattr3(XDR *, fattr3*);
extern  bool_t xdr_post_op_attr(XDR *, post_op_attr*);
extern  bool_t xdr_wcc_attr(XDR *, wcc_attr*);
extern  bool_t xdr_pre_op_attr(XDR *, pre_op_attr*);
extern  bool_t xdr_wcc_data(XDR *, wcc_data*);
extern  bool_t xdr_post_op_fh3(XDR *, post_op_fh3*);
extern  bool_t xdr_time_how(XDR *, time_how*);
extern  bool_t xdr_set_mode3(XDR *, set_mode3*);
extern  bool_t xdr_set_uid3(XDR *, set_uid3*);
extern  bool_t xdr_set_gid3(XDR *, set_gid3*);
extern  bool_t xdr_set_size3(XDR *, set_size3*);
extern  bool_t xdr_set_atime(XDR *, set_atime*);
extern  bool_t xdr_set_mtime(XDR *, set_mtime*);
extern  bool_t xdr_sattr3(XDR *, sattr3*);
extern  bool_t xdr_diropargs3(XDR *, diropargs3*);
extern  bool_t xdr_GETATTR3args(XDR *, GETATTR3args*);
extern  bool_t xdr_GETATTR3resok(XDR *, GETATTR3resok*);
extern  bool_t xdr_GETATTR3res(XDR *, GETATTR3res*);
extern  bool_t xdr_sattrguard3(XDR *, sattrguard3*);
extern  bool_t xdr_SETATTR3args(XDR *, SETATTR3args*);
extern  bool_t xdr_SETATTR3resok(XDR *, SETATTR3resok*);
extern  bool_t xdr_SETATTR3resfail(XDR *, SETATTR3resfail*);
extern  bool_t xdr_SETATTR3res(XDR *, SETATTR3res*);
extern  bool_t xdr_LOOKUP3args(XDR *, LOOKUP3args*);
extern  bool_t xdr_LOOKUP3resok(XDR *, LOOKUP3resok*);
extern  bool_t xdr_LOOKUP3resfail(XDR *, LOOKUP3resfail*);
extern  bool_t xdr_LOOKUP3res(XDR *, LOOKUP3res*);
extern  bool_t xdr_ACCESS3args(XDR *, ACCESS3args*);
extern  bool_t xdr_ACCESS3resok(XDR *, ACCESS3resok*);
extern  bool_t xdr_ACCESS3resfail(XDR *, ACCESS3resfail*);
extern  bool_t xdr_ACCESS3res(XDR *, ACCESS3res*);
extern  bool_t xdr_READLINK3args(XDR *, READLINK3args*);
extern  bool_t xdr_READLINK3resok(XDR *, READLINK3resok*);
extern  bool_t xdr_READLINK3resfail(XDR *, READLINK3resfail*);
extern  bool_t xdr_READLINK3res(XDR *, READLINK3res*);
extern  bool_t xdr_READ3args(XDR *, READ3args*);
extern  bool_t xdr_READ3resok(XDR *, READ3resok*);
extern  bool_t xdr_READ3resfail(XDR *, READ3resfail*);
extern  bool_t xdr_READ3res(XDR *, READ3res*);
extern  bool_t xdr_stable_how(XDR *, stable_how*);
extern  bool_t xdr_WRITE3args(XDR *, WRITE3args*);
extern  bool_t xdr_WRITE3resok(XDR *, WRITE3resok*);
extern  bool_t xdr_WRITE3resfail(XDR *, WRITE3resfail*);
extern  bool_t xdr_WRITE3res(XDR *, WRITE3res*);
extern  bool_t xdr_createmode3(XDR *, createmode3*);
extern  bool_t xdr_createhow3(XDR *, createhow3*);
extern  bool_t xdr_CREATE3args(XDR *, CREATE3args*);
extern  bool_t xdr_CREATE3resok(XDR *, CREATE3resok*);
extern  bool_t xdr_CREATE3resfail(XDR *, CREATE3resfail*);
extern  bool_t xdr_CREATE3res(XDR *, CREATE3res*);
extern  bool_t xdr_MKDIR3args(XDR *, MKDIR3args*);
extern  bool_t xdr_MKDIR3resok(XDR *, MKDIR3resok*);
extern  bool_t xdr_MKDIR3resfail(XDR *, MKDIR3resfail*);
extern  bool_t xdr_MKDIR3res(XDR *, MKDIR3res*);
extern  bool_t xdr_symlinkdata3(XDR *, symlinkdata3*);
extern  bool_t xdr_SYMLINK3args(XDR *, SYMLINK3args*);
extern  bool_t xdr_SYMLINK3resok(XDR *, SYMLINK3resok*);
extern  bool_t xdr_SYMLINK3resfail(XDR *, SYMLINK3resfail*);
extern  bool_t xdr_SYMLINK3res(XDR *, SYMLINK3res*);
extern  bool_t xdr_devicedata3(XDR *, devicedata3*);
extern  bool_t xdr_mknoddata3(XDR *, mknoddata3*);
extern  bool_t xdr_MKNOD3args(XDR *, MKNOD3args*);
extern  bool_t xdr_MKNOD3resok(XDR *, MKNOD3resok*);
extern  bool_t xdr_MKNOD3resfail(XDR *, MKNOD3resfail*);
extern  bool_t xdr_MKNOD3res(XDR *, MKNOD3res*);
extern  bool_t xdr_REMOVE3args(XDR *, REMOVE3args*);
extern  bool_t xdr_REMOVE3resok(XDR *, REMOVE3resok*);
extern  bool_t xdr_REMOVE3resfail(XDR *, REMOVE3resfail*);
extern  bool_t xdr_REMOVE3res(XDR *, REMOVE3res*);
extern  bool_t xdr_RMDIR3args(XDR *, RMDIR3args*);
extern  bool_t xdr_RMDIR3resok(XDR *, RMDIR3resok*);
extern  bool_t xdr_RMDIR3resfail(XDR *, RMDIR3resfail*);
extern  bool_t xdr_RMDIR3res(XDR *, RMDIR3res*);
extern  bool_t xdr_RENAME3args(XDR *, RENAME3args*);
extern  bool_t xdr_RENAME3resok(XDR *, RENAME3resok*);
extern  bool_t xdr_RENAME3resfail(XDR *, RENAME3resfail*);
extern  bool_t xdr_RENAME3res(XDR *, RENAME3res*);
extern  bool_t xdr_LINK3args(XDR *, LINK3args*);
extern  bool_t xdr_LINK3resok(XDR *, LINK3resok*);
extern  bool_t xdr_LINK3resfail(XDR *, LINK3resfail*);
extern  bool_t xdr_LINK3res(XDR *, LINK3res*);
extern  bool_t xdr_READDIR3args(XDR *, READDIR3args*);
extern  bool_t xdr_entry3(XDR *, entry3*);
extern  bool_t xdr_dirlist3(XDR *, dirlist3*);
extern  bool_t xdr_READDIR3resok(XDR *, READDIR3resok*);
extern  bool_t xdr_READDIR3resfail(XDR *, READDIR3resfail*);
extern  bool_t xdr_READDIR3res(XDR *, READDIR3res*);
extern  bool_t xdr_READDIRPLUS3args(XDR *, READDIRPLUS3args*);
extern  bool_t xdr_entryplus3(XDR *, entryplus3*);
extern  bool_t xdr_dirlistplus3(XDR *, dirlistplus3*);
extern  bool_t xdr_READDIRPLUS3resok(XDR *, READDIRPLUS3resok*);
extern  bool_t xdr_READDIRPLUS3resfail(XDR *, READDIRPLUS3resfail*);
extern  bool_t xdr_READDIRPLUS3res(XDR *, READDIRPLUS3res*);
extern  bool_t xdr_FSSTAT3args(XDR *, FSSTAT3args*);
extern  bool_t xdr_FSSTAT3resok(XDR *, FSSTAT3resok*);
extern  bool_t xdr_FSSTAT3resfail(XDR *, FSSTAT3resfail*);
extern  bool_t xdr_FSSTAT3res(XDR *, FSSTAT3res*);
extern  bool_t xdr_FSINFO3args(XDR *, FSINFO3args*);
extern  bool_t xdr_FSINFO3resok(XDR *, FSINFO3resok*);
extern  bool_t xdr_FSINFO3resfail(XDR *, FSINFO3resfail*);
extern  bool_t xdr_FSINFO3res(XDR *, FSINFO3res*);
extern  bool_t xdr_PATHCONF3args(XDR *, PATHCONF3args*);
extern  bool_t xdr_PATHCONF3resok(XDR *, PATHCONF3resok*);
extern  bool_t xdr_PATHCONF3resfail(XDR *, PATHCONF3resfail*);
extern  bool_t xdr_PATHCONF3res(XDR *, PATHCONF3res*);
extern  bool_t xdr_COMMIT3args(XDR *, COMMIT3args*);
extern  bool_t xdr_COMMIT3resok(XDR *, COMMIT3resok*);
extern  bool_t xdr_COMMIT3resfail(XDR *, COMMIT3resfail*);
extern  bool_t xdr_COMMIT3res(XDR *, COMMIT3res*);

#ifdef __cplusplus
}
#endif

#endif /* !_NFS_PROT_H_RPCGEN */


code:
/*
 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
 * unrestricted use provided that this legend is included on all tape
 * media and as a part of the software program in whole or part.  Users
 * may copy or modify Sun RPC without charge, but are not authorized
 * to license or distribute it to anyone else except as part of a product or
 * program developed by the user.
 *
 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
 *
 * Sun RPC is provided with no support and without any obligation on the
 * part of Sun Microsystems, Inc. to assist in its use, correction,
 * modification or enhancement.
 *
 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
 * OR ANY PART THEREOF.
 *
 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
 * or profits or other special, indirect and consequential damages, even if
 * Sun has been advised of the possibility of such damages.
 *
 * Sun Microsystems, Inc.
 * 2550 Garcia Avenue
 * Mountain View, California  94043
 */

#ifndef RPC_HDR
%#ifndef lint
%/*static char sccsid[] = "from: @(#)nfs_prot.x 1.2 87/10/12 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)nfs_prot.x	2.1 88/08/01 4.0 RPCSRC";*/
%#endif /* not lint */
%#include <sys/cdefs.h>
%__FBSDID("$FreeBSD: release/9.0.0/include/rpcsvc/nfs_prot.x 114629 2003-05-04 02:51:42Z obrien $");
#endif

const NFS_PORT          = 2049;
const NFS_MAXDATA       = 8192;
const NFS_MAXPATHLEN    = 1024;
const NFS_MAXNAMLEN	= 255;
const NFS_FHSIZE	= 32;
const NFS_COOKIESIZE	= 4;
const NFS_FIFO_DEV	= -1;	/* size kludge for named pipes */

/*
 * File types
 */
const NFSMODE_FMT  = 0170000;	/* type of file */
const NFSMODE_DIR  = 0040000;	/* directory */
const NFSMODE_CHR  = 0020000;	/* character special */
const NFSMODE_BLK  = 0060000;	/* block special */
const NFSMODE_REG  = 0100000;	/* regular */
const NFSMODE_LNK  = 0120000;	/* symbolic link */
const NFSMODE_SOCK = 0140000;	/* socket */
const NFSMODE_FIFO = 0010000;	/* fifo */

/*
 * Error status
 */
enum nfsstat {
	NFS_OK= 0,		/* no error */
	NFSERR_PERM=1,		/* Not owner */
	NFSERR_NOENT=2,		/* No such file or directory */
	NFSERR_IO=5,		/* I/O error */
	NFSERR_NXIO=6,		/* No such device or address */
	NFSERR_ACCES=13,	/* Permission denied */
	NFSERR_EXIST=17,	/* File exists */
	NFSERR_NODEV=19,	/* No such device */
	NFSERR_NOTDIR=20,	/* Not a directory*/
	NFSERR_ISDIR=21,	/* Is a directory */
	NFSERR_FBIG=27,		/* File too large */
	NFSERR_NOSPC=28,	/* No space left on device */
	NFSERR_ROFS=30,		/* Read-only file system */
	NFSERR_NAMETOOLONG=63,	/* File name too long */
	NFSERR_NOTEMPTY=66,	/* Directory not empty */
	NFSERR_DQUOT=69,	/* Disc quota exceeded */
	NFSERR_STALE=70,	/* Stale NFS file handle */
	NFSERR_WFLUSH=99	/* write cache flushed */
};

/*
 * File types
 */
enum ftype {
	NFNON = 0,	/* non-file */
	NFREG = 1,	/* regular file */
	NFDIR = 2,	/* directory */
	NFBLK = 3,	/* block special */
	NFCHR = 4,	/* character special */
	NFLNK = 5,	/* symbolic link */
	NFSOCK = 6,	/* unix domain sockets */
	NFBAD = 7,	/* unused */
	NFFIFO = 8 	/* named pipe */
};

/*
 * File access handle
 */
struct nfs_fh {
	opaque data[NFS_FHSIZE];
};

/*
 * Timeval
 */
struct nfstime {
	unsigned seconds;
	unsigned useconds;
};

/*
 * File attributes
 */
struct fattr {
	ftype type;		/* file type */
	unsigned mode;		/* protection mode bits */
	unsigned nlink;		/* # hard links */
	unsigned uid;		/* owner user id */
	unsigned gid;		/* owner group id */
	unsigned size;		/* file size in bytes */
	unsigned blocksize;	/* prefered block size */
	unsigned rdev;		/* special device # */
	unsigned blocks;	/* Kb of disk used by file */
	unsigned fsid;		/* device # */
	unsigned fileid;	/* inode # */
	nfstime	atime;		/* time of last access */
	nfstime	mtime;		/* time of last modification */
	nfstime	ctime;		/* time of last change */
};

/*
 * File attributes which can be set
 */
struct sattr {
	unsigned mode;	/* protection mode bits */
	unsigned uid;	/* owner user id */
	unsigned gid;	/* owner group id */
	unsigned size;	/* file size in bytes */
	nfstime	atime;	/* time of last access */
	nfstime	mtime;	/* time of last modification */
};

typedef string filename<NFS_MAXNAMLEN>;
typedef string nfspath<NFS_MAXPATHLEN>;

/*
 * Reply status with file attributes
 */
union attrstat switch (nfsstat status) {
case NFS_OK:
	fattr attributes;
default:
	void;
};

struct sattrargs {
	nfs_fh file;
	sattr attributes;
};

/*
 * Arguments for directory operations
 */
struct diropargs {
	nfs_fh	dir;	/* directory file handle */
	filename name;		/* name (up to NFS_MAXNAMLEN bytes) */
};

struct diropokres {
	nfs_fh file;
	fattr attributes;
};

/*
 * Results from directory operation
 */
union diropres switch (nfsstat status) {
case NFS_OK:
	diropokres diropres;
default:
	void;
};

union readlinkres switch (nfsstat status) {
case NFS_OK:
	nfspath data;
default:
	void;
};

/*
 * Arguments to remote read
 */
struct readargs {
	nfs_fh file;		/* handle for file */
	unsigned offset;	/* byte offset in file */
	unsigned count;		/* immediate read count */
	unsigned totalcount;	/* total read count (from this offset)*/
};

/*
 * Status OK portion of remote read reply
 */
struct readokres {
	fattr	attributes;	/* attributes, need for pagin*/
	opaque data<NFS_MAXDATA>;
};

union readres switch (nfsstat status) {
case NFS_OK:
	readokres reply;
default:
	void;
};

/*
 * Arguments to remote write
 */
struct writeargs {
	nfs_fh	file;		/* handle for file */
	unsigned beginoffset;	/* beginning byte offset in file */
	unsigned offset;	/* current byte offset in file */
	unsigned totalcount;	/* total write count (to this offset)*/
	opaque data<NFS_MAXDATA>;
};

struct createargs {
	diropargs where;
	sattr attributes;
};

struct renameargs {
	diropargs from;
	diropargs to;
};

struct linkargs {
	nfs_fh from;
	diropargs to;
};

struct symlinkargs {
	diropargs from;
	nfspath to;
	sattr attributes;
};

typedef opaque nfscookie[NFS_COOKIESIZE];

/*
 * Arguments to readdir
 */
struct readdirargs {
	nfs_fh dir;		/* directory handle */
	nfscookie cookie;
	unsigned count;		/* number of directory bytes to read */
};

struct entry {
	unsigned fileid;
	filename name;
	nfscookie cookie;
	entry *nextentry;
};

struct dirlist {
	entry *entries;
	bool eof;
};

union readdirres switch (nfsstat status) {
case NFS_OK:
	dirlist reply;
default:
	void;
};

struct statfsokres {
	unsigned tsize;	/* preferred transfer size in bytes */
	unsigned bsize;	/* fundamental file system block size */
	unsigned blocks;	/* total blocks in file system */
	unsigned bfree;	/* free blocks in fs */
	unsigned bavail;	/* free blocks avail to non-superuser */
};

union statfsres switch (nfsstat status) {
case NFS_OK:
	statfsokres reply;
default:
	void;
};

#ifdef WANT_NFS3

/*
 * NFSv3 constants and types
 */
const NFS3_FHSIZE	= 64;	/* maximum size in bytes of a file handle */
const NFS3_COOKIEVERFSIZE = 8;	/* size of a cookie verifier for READDIR */
const NFS3_CREATEVERFSIZE = 8;	/* size of the verifier used for CREATE */
const NFS3_WRITEVERFSIZE = 8;	/* size of the verifier used for WRITE */

typedef unsigned hyper uint64;
typedef hyper int64;
typedef unsigned long uint32;
typedef long int32;
typedef string filename3<>;
typedef string nfspath3<>;
typedef uint64 fileid3;
typedef uint64 cookie3;
typedef opaque cookieverf3[NFS3_COOKIEVERFSIZE];
typedef opaque createverf3[NFS3_CREATEVERFSIZE];
typedef opaque writeverf3[NFS3_WRITEVERFSIZE];
typedef uint32 uid3;
typedef uint32 gid3;
typedef uint64 size3;
typedef uint64 offset3;
typedef uint32 mode3;
typedef uint32 count3;

/*
 * Error status (v3)
 */
enum nfsstat3 {
	NFS3_OK	= 0,
	NFS3ERR_PERM		= 1,
	NFS3ERR_NOENT		= 2,
	NFS3ERR_IO		= 5,
	NFS3ERR_NXIO		= 6,
	NFS3ERR_ACCES		= 13,
	NFS3ERR_EXIST		= 17,
	NFS3ERR_XDEV		= 18,
	NFS3ERR_NODEV		= 19,
	NFS3ERR_NOTDIR		= 20,
	NFS3ERR_ISDIR		= 21,
	NFS3ERR_INVAL		= 22,
	NFS3ERR_FBIG		= 27,
	NFS3ERR_NOSPC		= 28,
	NFS3ERR_ROFS		= 30,
	NFS3ERR_MLINK		= 31,
	NFS3ERR_NAMETOOLONG	= 63,
	NFS3ERR_NOTEMPTY	= 66,
	NFS3ERR_DQUOT		= 69,
	NFS3ERR_STALE		= 70,
	NFS3ERR_REMOTE		= 71,
	NFS3ERR_BADHANDLE	= 10001,
	NFS3ERR_NOT_SYNC	= 10002,
	NFS3ERR_BAD_COOKIE	= 10003,
	NFS3ERR_NOTSUPP		= 10004,
	NFS3ERR_TOOSMALL	= 10005,
	NFS3ERR_SERVERFAULT	= 10006,
	NFS3ERR_BADTYPE		= 10007,
	NFS3ERR_JUKEBOX		= 10008
};

/*
 * File types (v3)
 */
enum ftype3 {
	NF3REG	= 1,		/* regular file */
	NF3DIR	= 2,		/* directory */
	NF3BLK	= 3,		/* block special */
	NF3CHR	= 4,		/* character special */
	NF3LNK	= 5,		/* symbolic link */
	NF3SOCK	= 6,		/* unix domain sockets */
	NF3FIFO	= 7		/* named pipe */
};

struct specdata3 {
	uint32	specdata1;
	uint32	specdata2;
};

/*
 * File access handle (v3)
 */
struct nfs_fh3 {
	opaque data<NFS3_FHSIZE>;
};

/*
 * Timeval (v3)
 */
struct nfstime3 {
	uint32	seconds;
	uint32	nseconds;
};

/*
 * File attributes (v3)
 */
struct fattr3 {
	ftype3	type;		/* file type */
	mode3	mode;		/* protection mode bits */
	uint32	nlink;		/* # hard links */
	uid3	uid;		/* owner user id */
	gid3	gid;		/* owner group id */
	size3	size;		/* file size in bytes */
	size3	used;		/* prefered block size */
	specdata3 rdev;		/* special device # */
	uint64 fsid;		/* device # */
	fileid3	fileid;		/* inode # */
	nfstime3 atime;		/* time of last access */
	nfstime3 mtime;		/* time of last modification */
	nfstime3 ctime;		/* time of last change */
};

union post_op_attr switch (bool attributes_follow) {
case TRUE:
	fattr3	attributes;
case FALSE:
	void;
};

struct wcc_attr {
	size3	size;
	nfstime3 mtime;
	nfstime3 ctime;
};

union pre_op_attr switch (bool attributes_follow) {
case TRUE:
	wcc_attr attributes;
case FALSE:
	void;
};

struct wcc_data {
	pre_op_attr before;
	post_op_attr after;
};

union post_op_fh3 switch (bool handle_follows) {
case TRUE:
	nfs_fh3	handle;
case FALSE:
	void;
};

/*
 * File attributes which can be set (v3)
 */
enum time_how {
	DONT_CHANGE		= 0,
	SET_TO_SERVER_TIME	= 1,
	SET_TO_CLIENT_TIME	= 2
};

union set_mode3 switch (bool set_it) {
case TRUE:
	mode3	mode;
default:
	void;
};

union set_uid3 switch (bool set_it) {
case TRUE:
	uid3	uid;
default:
	void;
};

union set_gid3 switch (bool set_it) {
case TRUE:
	gid3	gid;
default:
	void;
};

union set_size3 switch (bool set_it) {
case TRUE:
	size3	size;
default:
	void;
};

union set_atime switch (time_how set_it) {
case SET_TO_CLIENT_TIME:
	nfstime3	atime;
default:
	void;
};

union set_mtime switch (time_how set_it) {
case SET_TO_CLIENT_TIME:
	nfstime3	mtime;
default:
	void;
};

struct sattr3 {
	set_mode3	mode;
	set_uid3	uid;
	set_gid3	gid;
	set_size3	size;
	set_atime	atime;
	set_mtime	mtime;
};

/*
 * Arguments for directory operations (v3)
 */
struct diropargs3 {
	nfs_fh3	dir;		/* directory file handle */
	filename3 name;		/* name (up to NFS_MAXNAMLEN bytes) */
};

/*
 * Arguments to getattr (v3).
 */
struct GETATTR3args {
	nfs_fh3		object;
};

struct GETATTR3resok {
	fattr3		obj_attributes;
};

union GETATTR3res switch (nfsstat3 status) {
case NFS3_OK:
	GETATTR3resok	resok;
default:
	void;
};

/*
 * Arguments to setattr (v3).
 */
union sattrguard3 switch (bool check) {
case TRUE:
	nfstime3	obj_ctime;
case FALSE:
	void;
};

struct SETATTR3args {
	nfs_fh3		object;
	sattr3		new_attributes;
	sattrguard3	guard;
};

struct SETATTR3resok {
	wcc_data	obj_wcc;
};

struct SETATTR3resfail {
	wcc_data	obj_wcc;
};

union SETATTR3res switch (nfsstat3 status) {
case NFS3_OK:
	SETATTR3resok	resok;
default:
	SETATTR3resfail	resfail;
};

/*
 * Arguments to lookup (v3).
 */
struct LOOKUP3args {
	diropargs3	what;
};

struct LOOKUP3resok {
	nfs_fh3		object;
	post_op_attr	obj_attributes;
	post_op_attr	dir_attributes;
};

struct LOOKUP3resfail {
	post_op_attr	dir_attributes;
};

union LOOKUP3res switch (nfsstat3 status) {
case NFS3_OK:
	LOOKUP3resok	resok;
default:
	LOOKUP3resfail	resfail;
};

/*
 * Arguments to access (v3).
 */
const ACCESS3_READ	= 0x0001;
const ACCESS3_LOOKUP	= 0x0002;
const ACCESS3_MODIFY	= 0x0004;
const ACCESS3_EXTEND	= 0x0008;
const ACCESS3_DELETE	= 0x0010;
const ACCESS3_EXECUTE	= 0x0020;

struct ACCESS3args {
	nfs_fh3		object;
	uint32		access;
};

struct ACCESS3resok {
	post_op_attr	obj_attributes;
	uint32		access;
};

struct ACCESS3resfail {
	post_op_attr	obj_attributes;
};

union ACCESS3res switch (nfsstat3 status) {
case NFS3_OK:
	ACCESS3resok	resok;
default:
	ACCESS3resfail	resfail;
};

/*
 * Arguments to readlink (v3).
 */
struct READLINK3args {
	nfs_fh3		symlink;
};

struct READLINK3resok {
	post_op_attr	symlink_attributes;
	nfspath3	data;
};

struct READLINK3resfail {
	post_op_attr	symlink_attributes;
};

union READLINK3res switch (nfsstat3 status) {
case NFS3_OK:
	READLINK3resok	resok;
default:
	READLINK3resfail resfail;
};

/*
 * Arguments to read (v3).
 */
struct READ3args {
	nfs_fh3		file;
	offset3		offset;
	count3		count;
};

struct READ3resok {
	post_op_attr	file_attributes;
	count3		count;
	bool		eof;
	opaque		data<>;
};

struct READ3resfail {
	post_op_attr	file_attributes;
};

/* XXX: solaris 2.6 uses ``nfsstat'' here */
union READ3res switch (nfsstat3 status) {
case NFS3_OK:
	READ3resok	resok;
default:
	READ3resfail	resfail;
};

/*
 * Arguments to write (v3).
 */
enum stable_how {
	UNSTABLE	= 0,
	DATA_SYNC	= 1,
	FILE_SYNC	= 2
};

struct WRITE3args {
	nfs_fh3		file;
	offset3		offset;
	count3		count;
	stable_how	stable;
	opaque		data<>;
};

struct WRITE3resok {
	wcc_data	file_wcc;
	count3		count;
	stable_how	committed;
	writeverf3	verf;
};

struct WRITE3resfail {
	wcc_data	file_wcc;
};

union WRITE3res switch (nfsstat3 status) {
case NFS3_OK:
	WRITE3resok	resok;
default:
	WRITE3resfail	resfail;
};

/*
 * Arguments to create (v3).
 */
enum createmode3 {
	UNCHECKED	= 0,
	GUARDED		= 1,
	EXCLUSIVE	= 2
};

union createhow3 switch (createmode3 mode) {
case UNCHECKED:
case GUARDED:
	sattr3		obj_attributes;
case EXCLUSIVE:
	createverf3	verf;
};

struct CREATE3args {
	diropargs3	where;
	createhow3	how;
};

struct CREATE3resok {
	post_op_fh3	obj;
	post_op_attr	obj_attributes;
	wcc_data	dir_wcc;
};

struct CREATE3resfail {
	wcc_data	dir_wcc;
};

union CREATE3res switch (nfsstat3 status) {
case NFS3_OK:
	CREATE3resok	resok;
default:
	CREATE3resfail	resfail;
};

/*
 * Arguments to mkdir (v3).
 */
struct MKDIR3args {
	diropargs3	where;
	sattr3		attributes;
};

struct MKDIR3resok {
	post_op_fh3	obj;
	post_op_attr	obj_attributes;
	wcc_data	dir_wcc;
};

struct MKDIR3resfail {
	wcc_data	dir_wcc;
};

union MKDIR3res switch (nfsstat3 status) {
case NFS3_OK:
	MKDIR3resok	resok;
default:
	MKDIR3resfail	resfail;
};

/*
 * Arguments to symlink (v3).
 */
struct symlinkdata3 {
	sattr3		symlink_attributes;
	nfspath3	symlink_data;
};

struct SYMLINK3args {
	diropargs3	where;
	symlinkdata3	symlink;
};

struct SYMLINK3resok {
	post_op_fh3	obj;
	post_op_attr	obj_attributes;
	wcc_data	dir_wcc;
};

struct SYMLINK3resfail {
	wcc_data	dir_wcc;
};

union SYMLINK3res switch (nfsstat3 status) {
case NFS3_OK:
	SYMLINK3resok	resok;
default:
	SYMLINK3resfail	resfail;
};

/*
 * Arguments to mknod (v3).
 */
struct devicedata3 {
	sattr3		dev_attributes;
	specdata3	spec;
};

union mknoddata3 switch (ftype3 type) {
case NF3CHR:
case NF3BLK:
	devicedata3	device;
case NF3SOCK:
case NF3FIFO:
	sattr3		pipe_attributes;
default:
	void;
};

struct MKNOD3args {
	diropargs3	where;
	mknoddata3	what;
};

struct MKNOD3resok {
	post_op_fh3	obj;
	post_op_attr	obj_attributes;
	wcc_data	dir_wcc;
};

struct MKNOD3resfail {
	wcc_data	dir_wcc;
};

union MKNOD3res switch (nfsstat3 status) {
case NFS3_OK:
	MKNOD3resok	resok;
default:
	MKNOD3resfail	resfail;
};

/*
 * Arguments to remove (v3).
 */
struct REMOVE3args {
	diropargs3	object;
};

struct REMOVE3resok {
	wcc_data	dir_wcc;
};

struct REMOVE3resfail {
	wcc_data	dir_wcc;
};

union REMOVE3res switch (nfsstat3 status) {
case NFS3_OK:
	REMOVE3resok	resok;
default:
	REMOVE3resfail	resfail;
};

/*
 * Arguments to rmdir (v3).
 */
struct RMDIR3args {
	diropargs3	object;
};

struct RMDIR3resok {
	wcc_data	dir_wcc;
};

struct RMDIR3resfail {
	wcc_data	dir_wcc;
};

union RMDIR3res switch (nfsstat3 status) {
case NFS3_OK:
	RMDIR3resok	resok;
default:
	RMDIR3resfail	resfail;
};

/*
 * Arguments to rename (v3).
 */
struct RENAME3args {
	diropargs3	from;
	diropargs3	to;
};

struct RENAME3resok {
	wcc_data	fromdir_wcc;
	wcc_data	todir_wcc;
};

struct RENAME3resfail {
	wcc_data	fromdir_wcc;
	wcc_data	todir_wcc;
};

union RENAME3res switch (nfsstat3 status) {
case NFS3_OK:
	RENAME3resok	resok;
default:
	RENAME3resfail	resfail;
};

/*
 * Arguments to link (v3).
 */
struct LINK3args {
	nfs_fh3		file;
	diropargs3	link;
};

struct LINK3resok {
	post_op_attr	file_attributes;
	wcc_data	linkdir_wcc;
};

struct LINK3resfail {
	post_op_attr	file_attributes;
	wcc_data	linkdir_wcc;
};

union LINK3res switch (nfsstat3 status) {
case NFS3_OK:
	LINK3resok	resok;
default:
	LINK3resfail	resfail;
};

/*
 * Arguments to readdir (v3).
 */
struct READDIR3args {
	nfs_fh3		dir;
	cookie3		cookie;
	cookieverf3	cookieverf;
	count3		count;
};

struct entry3 {
	fileid3		fileid;
	filename3	name;
	cookie3		cookie;
	entry3		*nextentry;
};

struct dirlist3 {
	entry3		*entries;
	bool		eof;
};

struct READDIR3resok {
	post_op_attr	dir_attributes;
	cookieverf3	cookieverf;
	dirlist3	reply;
};

struct READDIR3resfail {
	post_op_attr	dir_attributes;
};

union READDIR3res switch (nfsstat3 status) {
case NFS3_OK:
	READDIR3resok	resok;
default:
	READDIR3resfail	resfail;
};

/*
 * Arguments to readdirplus (v3).
 */
struct READDIRPLUS3args {
	nfs_fh3		dir;
	cookie3		cookie;
	cookieverf3	cookieverf;
	count3		dircount;
	count3		maxcount;
};

struct entryplus3 {
	fileid3		fileid;
	filename3	name;
	cookie3		cookie;
	post_op_attr	name_attributes;
	post_op_fh3	name_handle;
	entryplus3	*nextentry;
};

struct dirlistplus3 {
	entryplus3	*entries;
	bool		eof;
};

struct READDIRPLUS3resok {
	post_op_attr	dir_attributes;
	cookieverf3	cookieverf;
	dirlistplus3	reply;
};

struct READDIRPLUS3resfail {
	post_op_attr	dir_attributes;
};

union READDIRPLUS3res switch (nfsstat3 status) {
case NFS3_OK:
	READDIRPLUS3resok	resok;
default:
	READDIRPLUS3resfail	resfail;
};

/*
 * Arguments to fsstat (v3).
 */
struct FSSTAT3args {
	nfs_fh3		fsroot;
};

struct FSSTAT3resok {
	post_op_attr	obj_attributes;
	size3		tbytes;
	size3		fbytes;
	size3		abytes;
	size3		tfiles;
	size3		ffiles;
	size3		afiles;
	uint32		invarsec;
};

struct FSSTAT3resfail {
	post_op_attr	obj_attributes;
};

union FSSTAT3res switch (nfsstat3 status) {
case NFS3_OK:
	FSSTAT3resok	resok;
default:
	FSSTAT3resfail	resfail;
};

/*
 * Arguments to fsinfo (v3).
 */
const FSF3_LINK		= 0x0001;
const FSF3_SYMLINK	= 0x0002;
const FSF3_HOMOGENEOUS	= 0x0008;
const FSF3_CANSETTIME	= 0x0010;

struct FSINFO3args {
	nfs_fh3		fsroot;
};

struct FSINFO3resok {
	post_op_attr	obj_attributes;
	uint32		rtmax;
	uint32		rtpref;
	uint32		rtmult;
	uint32		wtmax;
	uint32		wtpref;
	uint32		wtmult;
	uint32		dtpref;
	size3		maxfilesize;
	nfstime3	time_delta;
	uint32		properties;
};

struct FSINFO3resfail {
	post_op_attr	obj_attributes;
};

union FSINFO3res switch (nfsstat3 status) {
case NFS3_OK:
	FSINFO3resok	resok;
default:
	FSINFO3resfail	resfail;
};

/*
 * Arguments to pathconf (v3).
 */
struct PATHCONF3args {
	nfs_fh3		object;
};

struct PATHCONF3resok {
	post_op_attr	obj_attributes;
	uint32		linkmax;
	uint32		name_max;
	bool		no_trunc;
	bool		chown_restricted;
	bool		case_insensitive;
	bool		case_preserving;
};

struct PATHCONF3resfail {
	post_op_attr	obj_attributes;
};

union PATHCONF3res switch (nfsstat3 status) {
case NFS3_OK:
	PATHCONF3resok	resok;
default:
	PATHCONF3resfail	resfail;
};

/*
 * Arguments to commit (v3).
 */
struct COMMIT3args {
	nfs_fh3		file;
	offset3		offset;
	count3		count;
};

struct COMMIT3resok {
	wcc_data	file_wcc;
	writeverf3	verf;
};

struct COMMIT3resfail {
	wcc_data	file_wcc;
};

union COMMIT3res switch (nfsstat3 status) {
case NFS3_OK:
	COMMIT3resok	resok;
default:
	COMMIT3resfail	resfail;
};

#endif /* WANT_NFS3 */

/*
 * Remote file service routines
 */
program NFS_PROGRAM {
	version NFS_VERSION {
		void
		NFSPROC_NULL(void) = 0;

		attrstat
		NFSPROC_GETATTR(nfs_fh) =	1;

		attrstat
		NFSPROC_SETATTR(sattrargs) = 2;

		void
		NFSPROC_ROOT(void) = 3;

		diropres
		NFSPROC_LOOKUP(diropargs) = 4;

		readlinkres
		NFSPROC_READLINK(nfs_fh) = 5;

		readres
		NFSPROC_READ(readargs) = 6;

		void
		NFSPROC_WRITECACHE(void) = 7;

		attrstat
		NFSPROC_WRITE(writeargs) = 8;

		diropres
		NFSPROC_CREATE(createargs) = 9;

		nfsstat
		NFSPROC_REMOVE(diropargs) = 10;

		nfsstat
		NFSPROC_RENAME(renameargs) = 11;

		nfsstat
		NFSPROC_LINK(linkargs) = 12;

		nfsstat
		NFSPROC_SYMLINK(symlinkargs) = 13;

		diropres
		NFSPROC_MKDIR(createargs) = 14;

		nfsstat
		NFSPROC_RMDIR(diropargs) = 15;

		readdirres
		NFSPROC_READDIR(readdirargs) = 16;

		statfsres
		NFSPROC_STATFS(nfs_fh) = 17;
	} = 2;
} = 100003;
#ifdef WANT_NFS3
program NFS3_PROGRAM {
	version NFS_V3 {
		void
		NFSPROC3_NULL(void)			= 0;

		GETATTR3res
		NFSPROC3_GETATTR(GETATTR3args)		= 1;

		SETATTR3res
		NFSPROC3_SETATTR(SETATTR3args)		= 2;

		LOOKUP3res
		NFSPROC3_LOOKUP(LOOKUP3args)		= 3;

		ACCESS3res
		NFSPROC3_ACCESS(ACCESS3args)		= 4;

		READLINK3res
		NFSPROC3_READLINK(READLINK3args)	= 5;

		READ3res
		NFSPROC3_READ(READ3args)		= 6;

		WRITE3res
		NFSPROC3_WRITE(WRITE3args)		= 7;

		CREATE3res
		NFSPROC3_CREATE(CREATE3args)		= 8;

		MKDIR3res
		NFSPROC3_MKDIR(MKDIR3args)		= 9;

		SYMLINK3res
		NFSPROC3_SYMLINK(SYMLINK3args)		= 10;

		MKNOD3res
		NFSPROC3_MKNOD(MKNOD3args)		= 11;

		REMOVE3res
		NFSPROC3_REMOVE(REMOVE3args)		= 12;

		RMDIR3res
		NFSPROC3_RMDIR(RMDIR3args)		= 13;

		RENAME3res
		NFSPROC3_RENAME(RENAME3args)		= 14;

		LINK3res
		NFSPROC3_LINK(LINK3args)		= 15;

		READDIR3res
		NFSPROC3_READDIR(READDIR3args)		= 16;

		READDIRPLUS3res
		NFSPROC3_READDIRPLUS(READDIRPLUS3args)	= 17;

		FSSTAT3res
		NFSPROC3_FSSTAT(FSSTAT3args)		= 18;

		FSINFO3res
		NFSPROC3_FSINFO(FSINFO3args)		= 19;

		PATHCONF3res
		NFSPROC3_PATHCONF(PATHCONF3args)	= 20;

		COMMIT3res
		NFSPROC3_COMMIT(COMMIT3args)		= 21;
	} = 3;
} = 100003;
#endif