#ifndef _NFS_NFS_H_
#define _NFS_NFS_H_
#define NFS_MAXIOVEC 34
#define NFS_TICKINTVL 500
#define NFS_HZ (hz / nfscl_ticks)
#define NFS_TIMEO (1 * NFS_HZ)
#define NFS_MINTIMEO (1 * NFS_HZ)
#define NFS_MAXTIMEO (60 * NFS_HZ)
#define NFS_TCPTIMEO 300
#define NFS_MAXRCVTIMEO 60
#define NFS_MINIDEMTIMEO (5 * NFS_HZ)
#define NFS_MAXREXMIT 100
#define NFSV4_CALLBACKTIMEO 800
#define NFSV4_CALLBACKRETRY 5
#define NFSV4_SLOTS 64
#define NFSV4_CBSLOTS 8
#define NFSV4_CBRETRYCNT 4
#define NFSV4_UPCALLTIMEO (15 * NFS_HZ)
#define NFSV4_UPCALLRETRY 4
#define NFS_MAXWINDOW 1024
#define NFS_RETRANS 10
#define NFS_RETRANS_TCP 2
#define NFS_MAXGRPS 16
#define NFS_TRYLATERDEL 15
#ifndef NFS_REMOVETIMEO
#define NFS_REMOVETIMEO 15
#endif
#ifndef NFS_MINATTRTIMO
#define NFS_MINATTRTIMO 5
#endif
#ifndef NFS_MAXATTRTIMO
#define NFS_MAXATTRTIMO 60
#endif
#define NFS_WSIZE 8192
#define NFS_RSIZE 8192
#define NFS_READDIRSIZE 8192
#define NFS_DEFRAHEAD 1
#define NFS_MAXRAHEAD 16
#define NFS_MAXASYNCDAEMON 64
#define NFS_MAXUIDHASH 64
#ifndef NFSRV_LEASE
#define NFSRV_LEASE 120
#endif
#ifndef NFSRV_STALELEASE
#define NFSRV_STALELEASE (5 * nfsrv_lease)
#endif
#ifndef NFSRV_MOULDYLEASE
#define NFSRV_MOULDYLEASE 604800
#endif
#ifndef NFSCLIENTHASHSIZE
#define NFSCLIENTHASHSIZE 20
#endif
#ifndef NFSLOCKHASHSIZE
#define NFSLOCKHASHSIZE 20
#endif
#ifndef NFSSESSIONHASHSIZE
#define NFSSESSIONHASHSIZE 20
#endif
#define NFSSTATEHASHSIZE 10
#define NFSLAYOUTHIGHWATER 1000000
#ifndef NFSCLDELEGHIGHWATER
#define NFSCLDELEGHIGHWATER 10000
#endif
#ifndef NFSCLLAYOUTHIGHWATER
#define NFSCLLAYOUTHIGHWATER 10000
#endif
#ifndef NFSNOOPEN
#define NFSNOOPEN 120
#endif
#define NFSRV_LEASEDELTA 15
#define NFS_IDMAXSIZE 4
#ifndef NFSRVCACHE_UDPTIMEOUT
#define NFSRVCACHE_UDPTIMEOUT 30
#endif
#ifndef NFSRVCACHE_UDPHIGHWATER
#define NFSRVCACHE_UDPHIGHWATER 500
#endif
#ifndef NFSRVCACHE_TCPTIMEOUT
#define NFSRVCACHE_TCPTIMEOUT (3600*12)
#endif
#ifndef NFSRVCACHE_FLOODLEVEL
#define NFSRVCACHE_FLOODLEVEL 16384
#endif
#ifndef NFSRV_CLIENTHIGHWATER
#define NFSRV_CLIENTHIGHWATER 1000
#endif
#ifndef NFSRV_MAXDUMPLIST
#define NFSRV_MAXDUMPLIST 10000
#endif
#ifndef NFS_ACCESSCACHESIZE
#define NFS_ACCESSCACHESIZE 8
#endif
#define NFSV4_CBPORT 7745
#define NFSRV_V4DELEGLIMIT(c) (((c) * 5) > nfsrv_v4statelimit)
#define NFS_READDIRBLKSIZ DIRBLKSIZ
#define NFSV4_MAXOWNERGROUPLEN (10 * 1024)
#define NFS_CMPFH(n, f, s) \
((n)->n_fhp->nfh_len == (s) && !NFSBCMP((n)->n_fhp->nfh_fh, (caddr_t)(f), (s)))
#define NFSRV_CMPFH(nf, ns, f, s) \
((ns) == (s) && !NFSBCMP((caddr_t)(nf), (caddr_t)(f), (s)))
#define NFS_CMPTIME(t1, t2) \
((t1).tv_sec == (t2).tv_sec && (t1).tv_nsec == (t2).tv_nsec)
#define NFS_SETTIME(t) do { \
(t).tv_sec = time.tv_sec; (t).tv_nsec = 1000 * time.tv_usec; } while (0)
#define NFS_SRVMAXDATA(n) \
(((n)->nd_flag & (ND_NFSV3 | ND_NFSV4)) ? \
nfs_srvmaxio : NFS_V2MAXDATA)
#define NFS64BITSSET 0xffffffffffffffffull
#define NFS64BITSMINUS1 0xfffffffffffffffeull
struct nfsd_addsock_args {
int sock;
caddr_t name;
int namelen;
};
struct nfsd_nfsd_args {
const char *principal;
int minthreads;
int maxthreads;
int version;
char *addr;
int addrlen;
char *dnshost;
int dnshostlen;
char *dspath;
int dspathlen;
char *mdspath;
int mdspathlen;
int mirrorcnt;
};
#define NFSDEV_MAXMIRRORS 4
#define NFSDEV_MAXVERS 4
struct nfsd_pnfsd_args {
int op;
char *mdspath;
char *dspath;
char *curdspath;
};
#define PNFSDOP_DELDSSERVER 1
#define PNFSDOP_COPYMR 2
#define PNFSDOP_FORCEDELDS 3
struct nfsd_nfsd_oargs {
const char *principal;
int minthreads;
int maxthreads;
};
struct nfsd_nfscbd_args {
const char *principal;
};
struct nfscbd_args {
int sock;
caddr_t name;
int namelen;
u_short port;
};
struct nfsd_idargs {
int nid_flag;
uid_t nid_uid;
gid_t nid_gid;
int nid_usermax;
int nid_usertimeout;
u_char *nid_name;
int nid_namelen;
gid_t *nid_grps;
int nid_ngroup;
};
struct nfsd_oidargs {
int nid_flag;
uid_t nid_uid;
gid_t nid_gid;
int nid_usermax;
int nid_usertimeout;
u_char *nid_name;
int nid_namelen;
};
struct nfsuserd_args {
sa_family_t nuserd_family;
u_short nuserd_port;
};
struct nfsd_clid {
int nclid_idlen;
u_char nclid_id[NFSV4_OPAQUELIMIT];
};
struct nfsd_dumplist {
int ndl_size;
void *ndl_list;
};
struct nfsd_dumpclients {
u_int32_t ndcl_flags;
u_int32_t ndcl_nopenowners;
u_int32_t ndcl_nopens;
u_int32_t ndcl_nlockowners;
u_int32_t ndcl_nlocks;
u_int32_t ndcl_ndelegs;
u_int32_t ndcl_nolddelegs;
sa_family_t ndcl_addrfam;
union {
struct in_addr sin_addr;
struct in6_addr sin6_addr;
} ndcl_cbaddr;
struct nfsd_clid ndcl_clid;
};
struct nfsd_dumplocklist {
char *ndllck_fname;
int ndllck_size;
void *ndllck_list;
};
struct nfsd_dumplocks {
u_int32_t ndlck_flags;
nfsv4stateid_t ndlck_stateid;
u_int64_t ndlck_first;
u_int64_t ndlck_end;
struct nfsd_clid ndlck_owner;
sa_family_t ndlck_addrfam;
union {
struct in_addr sin_addr;
struct in6_addr sin6_addr;
} ndlck_cbaddr;
struct nfsd_clid ndlck_clid;
};
struct nfsreferral {
u_char *nfr_srvlist;
int nfr_srvcnt;
vnode_t nfr_vp;
uint64_t nfr_dfileno;
};
#define LCL_NEEDSCONFIRM 0x00000001
#define LCL_DONTCLEAN 0x00000002
#define LCL_WAKEUPWANTED 0x00000004
#define LCL_TCPCALLBACK 0x00000008
#define LCL_CALLBACKSON 0x00000010
#define LCL_INDEXNOTOK 0x00000020
#define LCL_STAMPEDSTABLE 0x00000040
#define LCL_EXPIREIT 0x00000080
#define LCL_CBDOWN 0x00000100
#define LCL_KERBV 0x00000400
#define LCL_NAME 0x00000800
#define LCL_NEEDSCBNULL 0x00001000
#define LCL_GSSINTEGRITY 0x00002000
#define LCL_GSSPRIVACY 0x00004000
#define LCL_ADMINREVOKED 0x00008000
#define LCL_RECLAIMCOMPLETE 0x00010000
#define LCL_NFSV41 0x00020000
#define LCL_DONEBINDCONN 0x00040000
#define LCL_RECLAIMONEFS 0x00080000
#define LCL_NFSV42 0x00100000
#define LCL_TLSCB 0x00200000
#define LCL_MACHCRED 0x00400000
#define LCL_GSS LCL_KERBV
#define NFSLCK_READACCESS 0x00000001
#define NFSLCK_WRITEACCESS 0x00000002
#define NFSLCK_ACCESSBITS (NFSLCK_READACCESS | NFSLCK_WRITEACCESS)
#define NFSLCK_SHIFT 2
#define NFSLCK_READDENY 0x00000004
#define NFSLCK_WRITEDENY 0x00000008
#define NFSLCK_DENYBITS (NFSLCK_READDENY | NFSLCK_WRITEDENY)
#define NFSLCK_SHAREBITS \
(NFSLCK_READACCESS|NFSLCK_WRITEACCESS|NFSLCK_READDENY|NFSLCK_WRITEDENY)
#define NFSLCK_LOCKSHIFT 4
#define NFSLCK_READ 0x00000010
#define NFSLCK_WRITE 0x00000020
#define NFSLCK_BLOCKING 0x00000040
#define NFSLCK_RECLAIM 0x00000080
#define NFSLCK_OPENTOLOCK 0x00000100
#define NFSLCK_TEST 0x00000200
#define NFSLCK_LOCK 0x00000400
#define NFSLCK_UNLOCK 0x00000800
#define NFSLCK_OPEN 0x00001000
#define NFSLCK_CLOSE 0x00002000
#define NFSLCK_CHECK 0x00004000
#define NFSLCK_RELEASE 0x00008000
#define NFSLCK_NEEDSCONFIRM 0x00010000
#define NFSLCK_CONFIRM 0x00020000
#define NFSLCK_DOWNGRADE 0x00040000
#define NFSLCK_DELEGREAD 0x00080000
#define NFSLCK_DELEGWRITE 0x00100000
#define NFSLCK_DELEGCUR 0x00200000
#define NFSLCK_DELEGPREV 0x00400000
#define NFSLCK_OLDDELEG 0x00800000
#define NFSLCK_DELEGRECALL 0x01000000
#define NFSLCK_SETATTR 0x02000000
#define NFSLCK_DELEGPURGE 0x04000000
#define NFSLCK_DELEGRETURN 0x08000000
#define NFSLCK_WANTWDELEG 0x10000000
#define NFSLCK_WANTRDELEG 0x20000000
#define NFSLCK_WANTNODELEG 0x40000000
#define NFSLCK_WANTBITS \
(NFSLCK_WANTWDELEG | NFSLCK_WANTRDELEG | NFSLCK_WANTNODELEG)
#define NFSID_INITIALIZE 0x0001
#define NFSID_ADDUID 0x0002
#define NFSID_DELUID 0x0004
#define NFSID_ADDUSERNAME 0x0008
#define NFSID_DELUSERNAME 0x0010
#define NFSID_ADDGID 0x0020
#define NFSID_DELGID 0x0040
#define NFSID_ADDGROUPNAME 0x0080
#define NFSID_DELGROUPNAME 0x0100
#define NFS_NFSSTATS 1
#define NFSATTRBIT_MAXWORDS 3
typedef struct {
u_int32_t bits[NFSATTRBIT_MAXWORDS];
} nfsattrbit_t;
#define NFSZERO_ATTRBIT(b) do { \
(b)->bits[0] = 0; \
(b)->bits[1] = 0; \
(b)->bits[2] = 0; \
} while (0)
#define NFSSET_ATTRBIT(t, f) do { \
(t)->bits[0] = (f)->bits[0]; \
(t)->bits[1] = (f)->bits[1]; \
(t)->bits[2] = (f)->bits[2]; \
} while (0)
#define NFSSETSUPP_ATTRBIT(b, n) do { \
(b)->bits[0] = NFSATTRBIT_SUPP0; \
(b)->bits[1] = (NFSATTRBIT_SUPP1 | NFSATTRBIT_SUPPSETONLY1); \
(b)->bits[2] = (NFSATTRBIT_SUPP2 | NFSATTRBIT_SUPPSETONLY2); \
if (((n)->nd_flag & ND_NFSV41) == 0) { \
(b)->bits[1] &= ~NFSATTRBIT_NFSV41_1; \
(b)->bits[2] &= ~NFSATTRBIT_NFSV41_2; \
} \
if (((n)->nd_flag & ND_NFSV42) == 0) \
(b)->bits[2] &= ~NFSATTRBIT_NFSV42_2; \
} while (0)
#define NFSISSET_ATTRBIT(b, p) ((b)->bits[(p) / 32] & (1 << ((p) % 32)))
#define NFSSETBIT_ATTRBIT(b, p) ((b)->bits[(p) / 32] |= (1 << ((p) % 32)))
#define NFSCLRBIT_ATTRBIT(b, p) ((b)->bits[(p) / 32] &= ~(1 << ((p) % 32)))
#define NFSCLRALL_ATTRBIT(b, a) do { \
(b)->bits[0] &= ~((a)->bits[0]); \
(b)->bits[1] &= ~((a)->bits[1]); \
(b)->bits[2] &= ~((a)->bits[2]); \
} while (0)
#define NFSCLRNOT_ATTRBIT(b, a) do { \
(b)->bits[0] &= ((a)->bits[0]); \
(b)->bits[1] &= ((a)->bits[1]); \
(b)->bits[2] &= ((a)->bits[2]); \
} while (0)
#define NFSCLRNOTFILLABLE_ATTRBIT(b, n) do { \
(b)->bits[0] &= NFSATTRBIT_SUPP0; \
(b)->bits[1] &= NFSATTRBIT_SUPP1; \
(b)->bits[2] &= NFSATTRBIT_SUPP2; \
if (((n)->nd_flag & ND_NFSV41) == 0) { \
(b)->bits[1] &= ~NFSATTRBIT_NFSV41_1; \
(b)->bits[2] &= ~NFSATTRBIT_NFSV41_2; \
} \
if (((n)->nd_flag & ND_NFSV42) == 0) \
(b)->bits[2] &= ~NFSATTRBIT_NFSV42_2; \
} while (0)
#define NFSCLRNOTSETABLE_ATTRBIT(b, n) do { \
(b)->bits[0] &= NFSATTRBIT_SETABLE0; \
(b)->bits[1] &= NFSATTRBIT_SETABLE1; \
(b)->bits[2] &= NFSATTRBIT_SETABLE2; \
if (((n)->nd_flag & ND_NFSV41) == 0) \
(b)->bits[2] &= ~NFSATTRBIT_NFSV41_2; \
if (((n)->nd_flag & ND_NFSV42) == 0) \
(b)->bits[2] &= ~NFSATTRBIT_NFSV42_2; \
} while (0)
#define NFSNONZERO_ATTRBIT(b) ((b)->bits[0] || (b)->bits[1] || (b)->bits[2])
#define NFSEQUAL_ATTRBIT(b, p) ((b)->bits[0] == (p)->bits[0] && \
(b)->bits[1] == (p)->bits[1] && (b)->bits[2] == (p)->bits[2])
#define NFSGETATTR_ATTRBIT(b) do { \
(b)->bits[0] = NFSATTRBIT_GETATTR0; \
(b)->bits[1] = NFSATTRBIT_GETATTR1; \
(b)->bits[2] = NFSATTRBIT_GETATTR2; \
} while (0)
#define NFSWCCATTR_ATTRBIT(b) do { \
(b)->bits[0] = NFSATTRBIT_WCCATTR0; \
(b)->bits[1] = NFSATTRBIT_WCCATTR1; \
(b)->bits[2] = NFSATTRBIT_WCCATTR2; \
} while (0)
#define NFSWRITEGETATTR_ATTRBIT(b) do { \
(b)->bits[0] = NFSATTRBIT_WRITEGETATTR0; \
(b)->bits[1] = NFSATTRBIT_WRITEGETATTR1; \
(b)->bits[2] = NFSATTRBIT_WRITEGETATTR2; \
} while (0)
#define NFSCBGETATTR_ATTRBIT(b, c) do { \
(c)->bits[0] = ((b)->bits[0] & NFSATTRBIT_CBGETATTR0); \
(c)->bits[1] = ((b)->bits[1] & NFSATTRBIT_CBGETATTR1); \
(c)->bits[2] = ((b)->bits[2] & NFSATTRBIT_CBGETATTR2); \
} while (0)
#define NFSPATHCONF_GETATTRBIT(b) do { \
(b)->bits[0] = NFSGETATTRBIT_PATHCONF0; \
(b)->bits[1] = NFSGETATTRBIT_PATHCONF1; \
(b)->bits[2] = NFSGETATTRBIT_PATHCONF2; \
} while (0)
#define NFSSTATFS_GETATTRBIT(b) do { \
(b)->bits[0] = NFSGETATTRBIT_STATFS0; \
(b)->bits[1] = NFSGETATTRBIT_STATFS1; \
(b)->bits[2] = NFSGETATTRBIT_STATFS2; \
} while (0)
#define NFSROOTFS_GETATTRBIT(b) do { \
(b)->bits[0] = NFSGETATTRBIT_STATFS0 | NFSATTRBIT_GETATTR0 | \
NFSATTRBM_LEASETIME; \
(b)->bits[1] = NFSGETATTRBIT_STATFS1 | NFSATTRBIT_GETATTR1; \
(b)->bits[2] = NFSGETATTRBIT_STATFS2 | NFSATTRBIT_GETATTR2; \
} while (0)
#define NFSISSETSTATFS_ATTRBIT(b) \
(((b)->bits[0] & NFSATTRBIT_STATFS0) || \
((b)->bits[1] & NFSATTRBIT_STATFS1) || \
((b)->bits[2] & NFSATTRBIT_STATFS2))
#define NFSCLRSTATFS_ATTRBIT(b) do { \
(b)->bits[0] &= ~NFSATTRBIT_STATFS0; \
(b)->bits[1] &= ~NFSATTRBIT_STATFS1; \
(b)->bits[2] &= ~NFSATTRBIT_STATFS2; \
} while (0)
#define NFSREADDIRPLUS_ATTRBIT(b) do { \
(b)->bits[0] = NFSATTRBIT_READDIRPLUS0; \
(b)->bits[1] = NFSATTRBIT_READDIRPLUS1; \
(b)->bits[2] = NFSATTRBIT_READDIRPLUS2; \
} while (0)
#define NFSREFERRAL_ATTRBIT(b) do { \
(b)->bits[0] = NFSATTRBIT_REFERRAL0; \
(b)->bits[1] = NFSATTRBIT_REFERRAL1; \
(b)->bits[2] = NFSATTRBIT_REFERRAL2; \
} while (0)
#define NFSOPBIT_MAXWORDS 3
typedef struct {
uint32_t bits[NFSOPBIT_MAXWORDS];
} nfsopbit_t;
#define NFSZERO_OPBIT(b) do { \
(b)->bits[0] = 0; \
(b)->bits[1] = 0; \
(b)->bits[2] = 0; \
} while (0)
#define NFSSET_OPBIT(t, f) do { \
(t)->bits[0] = (f)->bits[0]; \
(t)->bits[1] = (f)->bits[1]; \
(t)->bits[2] = (f)->bits[2]; \
} while (0)
#define NFSISSET_OPBIT(b, p) ((b)->bits[(p) / 32] & (1 << ((p) % 32)))
#define NFSSETBIT_OPBIT(b, p) ((b)->bits[(p) / 32] |= (1 << ((p) % 32)))
#define NFSCLRBIT_OPBIT(b, p) ((b)->bits[(p) / 32] &= ~(1 << ((p) % 32)))
struct nfscred {
uid_t nfsc_uid;
gid_t nfsc_groups[NFS_MAXGRPS + 1];
int nfsc_ngroups;
};
#define NFSV4ROOT_FSID0 ((int32_t) -1)
#define NFSV4ROOT_FSID1 ((int32_t) -1)
#define NFSV4ROOT_REFERRAL ((int32_t) -2)
#define NFSV4ROOT_INO 2
#define NFSV4ROOT_GEN 1
#if defined(_KERNEL) || defined(KERNEL)
struct uio; struct buf; struct vattr; struct nameidata;
#define NFSIGNORE_SOERROR(s, e) \
((e) != EINTR && (e) != ERESTART && (e) != EWOULDBLOCK && \
((s) & PR_CONNREQUIRED) == 0)
struct nfssockreq {
NFSSOCKADDR_T nr_nam;
int nr_sotype;
int nr_soproto;
int nr_soflags;
struct ucred *nr_cred;
int nr_lock;
NFSMUTEX_T nr_mtx;
u_int32_t nr_prog;
u_int32_t nr_vers;
struct __rpc_client *nr_client;
AUTH *nr_auth;
char nr_srvprinc[1];
};
#define NFSR_SNDLOCK 0x01
#define NFSR_WANTSND 0x02
#define NFSR_RCVLOCK 0x04
#define NFSR_WANTRCV 0x08
#define NFSR_RESERVEDPORT 0x10
#define NFSR_LOCALHOST 0x20
TAILQ_HEAD(nfsreqhead, nfsreq);
#define R_DONTRECOVER 0x00000100
union nethostaddr {
struct in_addr had_inet;
struct in6_addr had_inet6;
};
struct nfsgss_mechlist {
int len;
const u_char *str;
int totlen;
};
#define KERBV_MECH 0
struct nfsrv_descript {
struct mbuf *nd_mrep;
struct mbuf *nd_md;
struct mbuf *nd_mreq;
struct mbuf *nd_mb;
NFSSOCKADDR_T nd_nam;
NFSSOCKADDR_T nd_nam2;
caddr_t nd_dpos;
caddr_t nd_bpos;
u_int64_t nd_flag;
u_int16_t nd_procnum;
u_int32_t nd_repstat;
int *nd_errp;
u_int32_t nd_retxid;
struct nfsrvcache *nd_rp;
fhandle_t nd_fh;
struct ucred *nd_cred;
uid_t nd_saveduid;
u_int64_t nd_sockref;
u_int64_t nd_compref;
time_t nd_tcpconntime;
nfsquad_t nd_clientid;
int nd_gssnamelen;
char *nd_gssname;
uint32_t *nd_slotseq;
uint8_t nd_sessionid[NFSX_V4SESSIONID];
uint32_t nd_slotid;
SVCXPRT *nd_xprt;
uint32_t *nd_sequence;
nfsv4stateid_t nd_curstateid;
nfsv4stateid_t nd_savedcurstateid;
uint32_t nd_maxreq;
uint32_t nd_maxresp;
int nd_bextpg;
int nd_bextpgsiz;
int nd_maxextsiz;
nfsopbit_t nd_allowops;
};
#define nd_princlen nd_gssnamelen
#define nd_principal nd_gssname
#define ND_DONTSAVEREPLY 0x00000001
#define ND_SAVEREPLY 0x00000002
#define ND_NFSV2 0x00000004
#define ND_NFSV3 0x00000008
#define ND_NFSV4 0x00000010
#define ND_KERBV 0x00000020
#define ND_GSSINTEGRITY 0x00000040
#define ND_GSSPRIVACY 0x00000080
#define ND_WINDOWVERF 0x00000100
#define ND_GSSINITREPLY 0x00000200
#define ND_STREAMSOCK 0x00000400
#define ND_PUBLOOKUP 0x00000800
#define ND_USEGSSNAME 0x00001000
#define ND_SAMETCPCONN 0x00002000
#define ND_IMPLIEDCLID 0x00004000
#define ND_NOMOREDATA 0x00008000
#define ND_V4WCCATTR 0x00010000
#define ND_NFSCB 0x00020000
#define ND_AUTHNONE 0x00040000
#define ND_EXAUTHSYS 0x00080000
#define ND_EXGSS 0x00100000
#define ND_EXGSSINTEGRITY 0x00200000
#define ND_EXGSSPRIVACY 0x00400000
#define ND_INCRSEQID 0x00800000
#define ND_NFSCL 0x01000000
#define ND_NFSV41 0x02000000
#define ND_HASSEQUENCE 0x04000000
#define ND_CACHETHIS 0x08000000
#define ND_LASTOP 0x10000000
#define ND_LOOPBADSESS 0x20000000
#define ND_DSSERVER 0x40000000
#define ND_CURSTATEID 0x80000000
#define ND_SAVEDCURSTATEID 0x100000000
#define ND_HASSLOTID 0x200000000
#define ND_NFSV42 0x400000000
#define ND_EXTPG 0x800000000
#define ND_TLS 0x1000000000
#define ND_TLSCERT 0x2000000000
#define ND_TLSCERTUSER 0x4000000000
#define ND_EXTLS 0x8000000000
#define ND_EXTLSCERT 0x10000000000
#define ND_EXTLSCERTUSER 0x20000000000
#define ND_ERELOOKUP 0x40000000000
#define ND_MACHCRED 0x80000000000
#define ND_GSS (ND_KERBV)
struct nfsv4_opflag {
int retfh;
int needscfh;
int savereply;
int modifyfs;
int lktype;
int needsseq;
int loopbadsess;
};
#define NFSRVSEQID_FIRST 0x01
#define NFSRVSEQID_LAST 0x02
#define NFSRVSEQID_OPEN 0x04
#define LIST_NEWHEAD(nhead, ohead, field) do { \
if (((nhead)->lh_first = (ohead)->lh_first) != NULL) \
(ohead)->lh_first->field.le_prev = &(nhead)->lh_first; \
(ohead)->lh_first = NULL; \
} while (0)
#define LIST_PREPEND(head, phead, lelm, field) do { \
if ((head)->lh_first != NULL) { \
(lelm)->field.le_next = (head)->lh_first; \
(lelm)->field.le_next->field.le_prev = \
&(lelm)->field.le_next; \
} \
(head)->lh_first = (phead)->lh_first; \
(head)->lh_first->field.le_prev = &(head)->lh_first; \
} while (0)
struct nfsfh {
u_int16_t nfh_len;
u_int8_t nfh_fh[1];
};
struct nfsrvfh {
u_int32_t nfsrvfh_len;
u_int8_t nfsrvfh_data[NFSRV_MAXFH];
};
struct nfsv4lock {
u_int32_t nfslock_usecnt;
u_int8_t nfslock_lock;
};
#define NFSV4LOCK_LOCK 0x01
#define NFSV4LOCK_LOCKWANTED 0x02
#define NFSV4LOCK_WANTED 0x04
#define NFSACCCHK_NOOVERRIDE 0
#define NFSACCCHK_ALLOWROOT 1
#define NFSACCCHK_ALLOWOWNER 2
#define NFSACCCHK_VPNOTLOCKED 0
#define NFSACCCHK_VPISLOCKED 1
struct nfsslot {
int nfssl_inprog;
uint32_t nfssl_seq;
struct mbuf *nfssl_reply;
};
typedef enum { NOTRUNNING=0, STARTSTOP=1, RUNNING=2 } nfsuserd_state;
typedef enum { UNKNOWN=0, DELETED=1, NLINK_ZERO=2, VALID=3 } nfsremove_status;
#endif
#endif