/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* onc72V src/oncplus/usr/include/oncplus/nfs/nfs_fscntl.h 1.54.1.10      */
/*                                                                        */
/*                                                                        */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 1996,2020              */
/* All Rights Reserved                                                    */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */

#ifndef _NFS_FSCNTL_
#define _NFS_FSCNTL_

#include <netinet/in.h>
#include <sys/corralid.h>
#include <rpc/types.h>
#include <rpc/auth.h>
#include <rpc/clnt.h>		/* for typedef  t_rcstat */
#include <rpc/svc.h>		/* for typedef  t_rsstat */
#include <nfs/nfs_addr.h>
#include <nfs4/nfs4_stats.h>


/* 
 * struct of configurable nfs options.  used with cmd define
 * NFS_CNTL_PRT_OPTIONS		      
 */
typedef int	nfs_portmonitor;
typedef int	nfsudpcksum;
typedef int	nfs_socketsize;
typedef int	nfs_setattr_err_ignore;
typedef int	nfs_write_gather;
typedef int	nfs_repeat;
typedef int	nfs_maxconn;
typedef int	nfs_maxthreads;
typedef int	nfs_max_rwsize;
typedef	int	nfs_dsb_t;
typedef	int	nfs4_timeout;

/*
 * struct of all configuable options,
 * struct is to be used with
 * NFS_CNTL_GET_OPTIONS in which the return stats are placed 
 * in var of this type, i.e.
 * t_nfs_options nfs_options
 * nfs_cntl(NFS_CNTL_GET_OPTIONS,&nfs_options,NFS_CNTL_OPTIONS_SIZE);
 */
typedef struct {
	nfs_portmonitor	portmon;
	nfsudpcksum	cksum;
	nfs_socketsize	socksize;
	nfs_socketsize	tcp_socksize;
	nfs_setattr_err_ignore nfs_setattr_error;
	nfs_write_gather wr_gather;
	nfs_repeat	nfs_repeat_msg;
	nfs_maxconn	nfs_max_connections;
	nfs_maxthreads	nfs_max_threads;
	nfs_maxthreads	nfs_clnt_max_threads;
	int             resv_port;
	nfs_dsb_t	nfs_dsb;
	int		nfs_rfc1323;
	nfs_max_rwsize	nfs_write_size;
	nfs_max_rwsize	nfs_read_size;
	int		nfs_allow_all_signals;
} t_nfs_options;
 
/* example of interface 
 * nfscntl(int, nfs_pormon *, int);
 * nfscntl(int, nfsudpcksum *, int);
 * nfscntl(int, nfs_socksize *, int);
 */

/*
 * server side nfs statistics
 * struct is to be used with 
 * NFS_CNTL_GET_SERV_STAT in which the return stats are placed 
 * in var of this type, i.e.
 * t_svstat svstat;
 * nfs_cntl(NFS_CNTL_GET_SERV_STAT,&svstat,NFS_CNTL_GET_SERV_STAT);
 */
typedef struct {
	u_int   ncalls;         /* number of calls received */
	u_int   nbadcalls;      /* calls that failed */
	u_int   reqs[32];       /* count for each request */
} t_svstat;

/*
 * server side nfs statistics (onc+ style)
 * struct is to be used with 
 * NFS_CNTL_GET_ONC_SERV_STAT in which the return stats are placed 
 * in var of this type, i.e.
 * t_svstat svstat;
 * nfs_cntl(NFS_CNTL_GET_ONC_SERV_STAT,&svstat,NFS_CNTL_GET_ONC_SERV_STAT);
 */
typedef struct {
	u_int   ncalls;         /* number of calls received */
	u_int   nbadcalls;      /* calls that failed */
	u_int   v2reqs[32];     /* count for each request NFS V2*/
	u_int   v3reqs[22];     /* count for each request NFS V3*/
	u_int   nfs2_public;	/* Count of V2 public fh lookups */
	u_int   nfs3_public;	/* Count of V3 public fh lookups */
} t_svstat_onc;

/*
 * client side nfs statistics
 * struct is to be used with 
 * NFS_CNTL_GET_CLNT_STAT in which the return stats are placed 
 * in var of this type, i.e.
 * t_clstat clstat;
 * nfs_cntl(NFS_CNTL_GET_CLNT_STAT,&clstat,NFS_CNTL_CLNT_SIZE);
 */

#ifdef _KERNEL
struct dist_svstat {
	t_svstat_onc    thestats;
	char    dummy[(sizeof(t_svstat_onc) < LINE_SIZE ? LINE_SIZE - sizeof(t_svstat_onc): LINE_SIZE - (sizeof( t_svstat_onc) % LINE_SIZE))];
};
typedef struct clstat {
	int     cltoomany; /* client handle waits*/
	int     clgets;   /* client handle gets */
	int     calls;    /* client requests */
	int     badcalls; /* rpc failures */
	int	reqs[32];  /* # of each request*/
} t_clstat;
#else
typedef struct {
	int     nclsleeps; /* client handle waits*/
	int     nclgets;   /* client handle gets */
	int     ncalls;    /* client requests */
	int     nbadcalls; /* rpc failures */
	int	reqs[32];  /* # of each request*/
} t_clstat;
#endif

/*
 * client side nfs statistics (new style)
 * struct is to be used with 
 * NFS[23]_CNTL_GET_CLNT_STAT in which the return stats are placed 
 * in var of this type, i.e.
 * t_clstat clstat;
 * nfs_cntl(NFS[23]_CNTL_GET_CLNT_STAT,&clstat_onc,NFS[23]_CNTL_CLNT_SIZE);
 */
typedef struct clstat_onc {
        int   calls;                  /* client requests */
        int   badcalls;               /* rpc failures */
        int   clgets;                 /* client handle gets */
        int   cltoomany;              /* Client handle cache misses */
} t_clstat_onc;

/*
 * client side V2 request statistics
 * struct is to be used with 
 * NFS_CNTL_GET_CLNT_REQ_STAT in which the return stats are placed 
 * in var of this type, i.e.
 * t_clstat clstat;
 * nfs_cntl(NFS_CNTL_GET_CLNT_REQ_STAT,&clreqstat,NFS_CNTL_REQ_SIZE); 
 */ 

typedef struct rfsreqcnt{ 
	int rfsreqcnt[22]; 
}t_rfsreqcnt;

/*
 * struct of nfs_stats (nfs statistics) is used with define
 * NFS_CNTL_GET_ALL_STAT in which the return stats are placed 
 * in var of this type, i.e.
 * t_nfs_stats nfsstats;
 * nfs_cntl(NFS_CNTL_GET_ALL_STAT_ONC,&nfsstats_onc,NFS_CNTL_ALL_SIZE_ONC);
 */
typedef struct {
	t_clstat_onc clstat;  /* client NFS call statistics (general) */
	t_rfsreqcnt clreqs3;  /* client NFS V3 request statistics (specific) */
	t_rfsreqcnt clreqs2;  /* client NFS V2 request statistics (specific) */
	t_svstat_onc svstat;  /* server NFS call statistics (general) */
	t_rcstat rcstat;      /* client CLTS RPC statistics */
	t_rsstat rsstat;      /* server CLTS RPC statistics */
	t_rcstat rcstat_cots; /* client COTS RPC statistics */
	t_rsstat rsstat_cots; /* server COTS RPC statistics */
} t_nfs_stats_onc;

/*
 * struct of nfs_stats (nfs statistics) is used with define
 * NFS_CNTL_GET_ALL_STAT in which the return stats are placed
 * in var of this type, i.e.
 * t_nfs_stats nfsstats;
 * nfs_cntl(NFS_CNTL_GET_ALL_STAT,&nfsstats,NFS_CNTL_ALL_SIZE);
 */
typedef struct {
        t_clstat clstat;
        t_svstat svstat;
        t_rcstat rcstat;
        t_rsstat rsstat;
} t_nfs_stats;

/*
 * struct of nfs_stats_pkts (nfs statistics pkts) is used with define
 * NFS_CNTL_GET_PKTS in which the return stats are placed 
 * in var of this type, i.e.
 * t_nfs_stats_pkts nfs_pkts;
 * nfs_cntl(NFS_CNTL_GET_PKTS_STAT,&nfs_pkts,NFS_CNTL_PKTS_SIZE);
 */
typedef struct {
	int nfs_good_sends;
	int nfs_send_tries;
} t_nfs_stats_pkts;

/*
 * struct of nfs_clnt_get_mntinfo.  The vfsnumber is supplied
 * by the caller - the mntinfo is returned.
 */
struct mntinfo_req_timer {
	u_short         rt_srtt;        /* smoothed round-trip time */
	u_short         rt_deviate;     /* estimated deviation */
	u_int           rt_rtxcur;      /* current (backed-off) rto */
};
struct mntinfo_req {
	int vfsnumber;
	int mi_protocol;
	sockaddr_in_all_t mi_addr;
	u_int mi_flags;
	int mi_tsize;
	int mi_stsize;
	int mi_timeo;
	int mi_retrans;
	char mi_hostname[32];
	int mi_authflavor;
	u_int mi_acregmin;
	u_int mi_acregmax;
	u_int mi_acdirmin;
	u_int mi_acdirmax;
	struct mntinfo_req_timer mi_timers[4];
	int mi_curread;
	int mi_curwrite;
	u_short mi_threads;
	u_short mi_max_threads;
	u_int mi_prog;
	u_int mi_vers;
};


/*
 * data type for setting the size of the NFS server duplicate cache.
 */
typedef u_int	nfs_dupcachesize;

/*
 * data type for setting the base priority for the NFS server
 */
typedef u_int	nfs_basepriority;

/*
 * data type for setting the dynamic retransmission flag on the NFS client
 */
typedef u_int	nfs_dynamicretrans;

typedef u_int	nfs_serverclread;

/*
 * data type for setting the NFS client iopacing number of pages
 */
typedef	u_int	nfs_clientiopace;

typedef u_int	nfs_ha;

typedef struct {
	int	vers;
	char	buffer[4];
} nfshadupcache_t;

typedef struct {
	in_addr_t addr;
	char      name[1024];
} freeall_t;

typedef struct {
	sockaddr_in_all_t addr;
	char      name[1024];
} nfs_freeall_t;


typedef struct {
	int64_t	pid;
	int	idx;
} nfs_pid_t;

typedef struct {
        int     port;
        int     idx;
} nfs_port_t;

/* 
 * data type for setting logging of hung NFS mounts
 */
typedef int	nfs_hang_log;

#define NFS_NUM_SAVED_PIDS	3
#define NFS_RGYD_PID		0
#define NFS_GSSD_PID		1
#define NFS_ACCESSD_PID		2

#define NFS_NUM_SAVED_PORTS     2
#define NFS_RGYD_PORT           0
#define NFS_GSSD_PORT           1

/* Checkpoint/restart request structure */

#define CHECKPOINT_VMOUNT_SIZE 1000

struct nfs_checkpoint_request {
	char *filename;
	cid_t cid;
	short app_flag;
};


/* old style checkpoint restart structure */
struct nfs_async_checkpoint_request {
	cid_t cid;
	uint size;
	char *buffer;
};

/* #defines for the cmd in nfs_async_checkpoint_request2 */
#define	NFS_ASYNC_RESTART_RESTORE_BEGIN		0x00000001
#define	NFS_ASYNC_RESTART_RESTORE_MOUNT		0x00000002
#define	NFS_ASYNC_RESTART_RESTORE_END		0x00000003

/* new checkpoint restart structure */ 
#ifdef _KERNEL
struct nfs_async_checkpoint_request2 {
	uint vers;		/* for both ckp and rst */
	cid_t cid;		/* for both ckp and rst */
	fsid_t fsid;		/* for rst */
	uint cmd;		/* for rst */
	uint size;		/* for both ckp and rst */
	char *buffer;		/* for both ckp and rst */
};
struct nfs_async_checkpoint_request2_32 {
	uint vers;
	short cid32;
	fsid_t fsid;
	uint cmd;
	uint size;
	ptr32 buffer32;
};
#else
struct nfs_async_checkpoint_request2 {
	uint vers;		/* for both ckp and rst */
	cid_t cid;		/* for both ckp and rst */
	fsid64_t fsid;		/* for rst */
	uint cmd;		/* for rst */
	uint size;		/* for both ckp and rst */
	char *buffer;		/* for both ckp and rst */
};
#endif

#ifdef _KERNEL
struct nfs_checkpoint_request32 {
	ptr32 filename32;
	short cid32;
	short app_flag;
};

struct nfs_async_checkpoint_request32 {
	short cid32;
	uint size;
	ptr32 buffer32;
};
#endif


/* WPAR status flags */
#define NFS_WPAR_FLAG_RESTARTED  1


/* Live Kernel Update debug */
#define NFS_LKU_DEBUG_SYSTEM                0
#define NFS_LKU_DEBUG_CHECKPOINTING         1
#define NFS_LKU_DEBUG_RESTARTING            2
#define NFS_LKU_DEBUG_LOOKUP_OK             3

#define NFS_LKU_DEBUG_OP_START_CHECKPOINT   1
#define NFS_LKU_DEBUG_OP_END_CHECKPOINT     2
#define NFS_LKU_DEBUG_OP_START_RESTART      3
#define NFS_LKU_DEBUG_OP_END_RESTART        4
#define NFS_LKU_DEBUG_OP_LOOKUP_OK          5
#define NFS_LKU_DEBUG_OP_CHECK              6
#define NFS_LKU_DEBUG_OP_PRE                7
#define NFS_LKU_DEBUG_OP_POST               8
#define NFS_LKU_DEBUG_OP_POST_ERROR         9



/* ioctl's */
#define NFS_IOC_OUT		0x40000000	/* copy out parameters */
#define NFS_IOC_IN	        0x80000000	/* copy in parameters */
#define NFS_IOW(c,t)		(NFS_IOC_IN|(sizeof(t)<<16)|('n'<<8)|c)
#define NFS_IOR(c,t)		(NFS_IOC_OUT|(sizeof(t)<<16)|('n'<<8)|c)
#define NFS_IOC_DEAD_MOUNT	NFS_IOR(1, int)	/* forced umounted */
#define NFS_IOC_SWAP_SEC	NFS_IOW(2, int) /* set swap sec method */

/*
 * commands recognized by nfs fscntl
 */
#define NFS_CNTL_SET_CHKSUM		1  /* set krpc udp checksum opt      */
#define NFS_CNTL_SET_SOCKS		2  /* set nfs socket size def=60000  */
#define NFS_CNTL_SET_PORTCK   		3  /* set portcheck opt   	     */
#define NFS_CNTL_GET_OPTIONS		4  /* get all configurable options   */
#define NFS_CNTL_GET_CLNT_STAT		5  /* get client nfs stats - t_clstat*/
#define NFS_CNTL_CLR_CLNT_STAT		6  /* clear client nfs statistics    */
#define NFS_CNTL_GET_SERV_STAT		7  /* get server rpc stats - t_rsstat*/
#define NFS_CNTL_CLR_SERV_STAT		8  /* clear server rpc statistics    */
#define NFS_CNTL_GET_CLKRPC_STAT	9  /* get client rpc stats - t_rcstat*/
#define NFS_CNTL_CLR_CLKRPC_STAT	10 /* clear client rpc statistics    */
#define NFS_CNTL_GET_SVKRPC_STAT	11 /* get server rpc stats - t_rcstat*/
#define NFS_CNTL_CLR_SVKRPC_STAT	12 /* clear server rpc statistics    */
#define NFS_CNTL_GET_ALL_STAT		13 /* get all stats - t_nfs_stats    */
#define NFS_CNTL_CLR_ALL_STAT		14 /* clear all statistics           */
#define NFS_CNTL_SET_SETATTR		15 /* ignore setattr error	     */
#define NFS_CNTL_SET_WRGATHER		16 /* set write gather size	     */
#define NFS_CNTL_SET_REPEATMSG		17 /* set nfs repeat msg behavior    */
#define NFS_CNTL_GET_PKTS_STAT 		18 /* get outgoing pkts statistics   */
#define NFS_CNTL_CLR_PKTS_STAT 		19 /* zero outgoing pkts statistics  */
#define NFS_CNTL_SET_NFSDUPCACHESZ	20 /* set size of nfs dup cache      */
#define NFS_CNTL_GET_NFSDUPCACHESZ	21 /* get size of nfs dup cache      */
#define NFS_CNTL_SET_NFSBASEPRIORITY	22 /* set base priority - nfs server */
#define NFS_CNTL_GET_NFSBASEPRIORITY	23 /* get base priority - nfs server */
#define NFS_CNTL_SET_NFSDYNAMICRETRANS	24 /* set client dynamic retrans     */
#define NFS_CNTL_GET_NFSDYNAMICRETRANS	25 /* get client dynamic retrans     */
#define NFS_CNTL_SET_NFSCLIENTIOPACE	26 /* set client iopace pages        */
#define NFS_CNTL_GET_NFSCLIENTIOPACE	27 /* get client iopace pages        */
#define NFS_CNTL_SET_NFSHA		28 /* turn ha on or off within NFS   */
#define NFS_CNTL_GET_NFSHA              29 /* get current ha setting         */
#define NFS_CNTL_SET_NFSHADUPCACHE	30 /* set dup cache entry            */
#define NFS_CNTL_GET_NFSHADUPCACHE	31 /* get dup cache entries          */
#define NFS_CNTL_SET_MAX_CONNECTIONS	32 /* set server max connections     */
#define NFS_CNTL_SET_MAX_THREADS	33 /* set server max threads         */

#define NFS2_CNTL_GET_CLNT_REQ_STAT	34
#define NFS2_CNTL_CLR_CLNT_REQ_STAT	35

#define NFS3_CNTL_GET_CLNT_REQ_STAT	36
#define NFS3_CNTL_CLR_CLNT_REQ_STAT	37

#define NFS2_CNTL_GET_SERV_REQ_STAT	38
#define NFS2_CNTL_CLR_SERV_REQ_STAT	39

#define NFS3_CNTL_GET_SERV_REQ_STAT	40
#define NFS3_CNTL_CLR_SERV_REQ_STAT	41

#define NFS_CNTL_GET_ONC_CLNT_STAT	42  /* get client nfs stats  t_clstat*/
#define NFS_CNTL_CLR_ONC_CLNT_STAT	43  /* clear client nfs statistics   */

#define NFS_CNTL_GET_ONC_SERV_STAT	44  /* get server rpc stats  t_rsstat*/
#define NFS_CNTL_CLR_ONC_SERV_STAT	45  /* clear server rpc statistics   */

#define NFS_CNTL_GET_COTS_CLKRPC_STAT	46  /* get client cots rpc stats */
#define NFS_CNTL_CLR_COTS_CLKRPC_STAT   47 /* clear client cots rpc statis */

#define NFS_CNTL_GET_CLTS_CLKRPC_STAT	48  /* get client clts rpc stats */
#define NFS_CNTL_CLR_CLTS_CLKRPC_STAT	49  /* clear client clts rpc statis */

#define NFS_CNTL_GET_COTS_SVKRPC_STAT	50 /* get server cots rpc stats   */
#define NFS_CNTL_CLR_COTS_SVKRPC_STAT	51 /* clear server cots rpc stats */

#define NFS_CNTL_GET_CLTS_SVKRPC_STAT	52 /* get server clts rpc stats */
#define NFS_CNTL_CLR_CLTS_SVKRPC_STAT	53 /* clear server clts rpc stats */

#define NFS_CNTL_GET_ALL_STAT_ONC	54 /* get all stats - t_nfs_stats    */
#define NFS_CNTL_CLR_ALL_STAT_ONC	55 /* clear all statistics           */

#define NFS_CNTL_SET_TCPDUPCACHESZ	56 /* set size of nfs tcp dup cache  */
#define NFS_CNTL_GET_TCPDUPCACHESZ	57 /* get size of nfs tcp dup cache  */
#define NFS_CNTL_SET_UDPDUPCACHESZ	58 /* set size of nfs udp dup cache  */
#define NFS_CNTL_GET_UDPDUPCACHESZ	59 /* get size of nfs udp dup cache  */

#define NFS_CNTL_GET_RESPORT_FLAG       60 /* tells rpc client to use        */
#define NFS_CNTL_SET_RESPORT_FLAG       61 /* reserved ports... or not to !  */
#define NFS_CNTL_GET_MNTINFO		62
#define	NFS_CNTL_GET_DSB		63 /* get device specific bufs       */
#define	NFS_CNTL_SET_DSB		64 /* set device specific bufs       */
#define NFS_CNTL_SET_TCP_SOCKS		65 /* set nfs tcp socket size        */
#define NFS_CNTL_SET_SERV_CLREAD	66 /* set the NFS server clread opt  */
#define NFS_CNTL_GET_SERV_CLREAD	67 /* get value of server clread opt */
#define NFS_CNTL_SET_RFC1323		68 /* set rfc1323 on new tcp connects*/
#define NFS_CNTL_GET_RFC1323		69 /* get rfc1323 on new tcp connects*/
#define NFS_CNTL_SET_MAX_READ_SIZE	70 /* max read size for this server  */
#define NFS_CNTL_SET_MAX_WRITE_SIZE	71 /* max read write for this server */
#define NFS_CNTL_SET_CATCH_ALL_SIGS	72 /*allow all signals to locked files*/
#define NFS_CNTL_GET_CATCH_ALL_SIGS	73 /*get signal status to locked files*/

#define NFS_CNTL_CLNT_KLM_FREE          74 /* free locks on server for clnt  */

#define NFS2_CNTL_SET_VM_PDTS		75 /* set v2 pdt count */
#define NFS3_CNTL_SET_VM_PDTS		76 /* set v3 pdt count */
#define NFS2_CNTL_GET_VM_PDTS		77 /* get v2 pdt count */
#define NFS3_CNTL_GET_VM_PDTS		78 /* get v3 pdt count */
#define NFS2_CNTL_GET_VM_BUFS		79 /* get v2 bufs/pdt count */
#define NFS3_CNTL_GET_VM_BUFS		80 /* get v3 bufs/pdt count */
#define NFS2_CNTL_SET_VM_BUFS		81 /* set v2 bufs/pdt count */
#define NFS3_CNTL_SET_VM_BUFS		82 /* set v3 bufs/pdt count */

#define NFS_CNTL_GET_SECNFS_CREDTIMEOUT	83 /* get value of secure nfs des cred timeout */
#define NFS_CNTL_SET_SECNFS_CREDTIMEOUT	84 /* set value of secure nfs des cred timeout */

#define NFS_CNTL_GET_SERVER_READDIRPLUS 85 /* get the value of nfs v3 readdirplus operation disabled */
#define NFS_CNTL_SET_SERVER_READDIRPLUS 86 /* set the value of nfs v3 readdirplus operation disabled */

#define NFS_CNTL_GET_MAX_READ_SIZE	87 /* get the max read size for this server  */
#define NFS_CNTL_GET_MAX_WRITE_SIZE	88 /* get the max read write for this server */

#define NFS4_CNTL_SET_ROOT		89 /* set v4 root directory */

#define NFS4_CNTL_SET_PUBLIC		90 /* set v4 public directory */

#define NFS4_CNTL_GET_NRS_CLNT_STAT	91 /* get client NRS stats */
#define NFS4_CNTL_GET_NRS_SERV_STAT	92 /* get server NRS stats */

#define NFS4_CNTL_SM4_REVOKE_CLID	93 /* revoke a client ID */
#define NFS4_CNTL_SM4_REVOKE_VFS	94 /* revoke a VFS-Cookie pair */
#define NFS4_CNTL_SM4_SETLEASE		95 /* set the SM4 lease time */

#define NFS4_CNTL_NRS_FLUSH_CACHE	96 /* flush NRS kernel cache */

#define NFS_CNTL_SET_PID		97 /* set a pid */
#define NFS4_CNTL_GET_TIMEOUT		98 /* fail over timeout in nfsv4 */
#define NFS4_CNTL_SET_TIMEOUT		99 /* fail over timeout in nfsv4 */

#define NFS4_CNTL_SRV_GET_STATS		100 /* server stats */
#define NFS4_CNTL_SRV_GET_EXPORTS	101 /* get export list */
#define NFS4_CNTL_SRV_GET_EXPORT_STATS	102 /* get stats for export */
#define NFS4_CNTL_GET_ROOT		103 /* get v4 root directory */
#define NFS4_CNTL_GET_PUBLIC		104 /* get v4 public directory */
#define NFS4_CNTL_GET_UTF8		105 /* Get UTF-8 validation flag */
#define NFS4_CNTL_SET_UTF8		106 /* Set UTF-8 validation flag */
#define	NFS4_CLNT_GET_STATS		107 /* get client stats */
#define NFS4_CNTL_SM4_GETLEASE		108 /* get the SM4 lease time */

#define NFS4_CNTL_SET_VM_PDTS		109 /* set v4 pdt count */
#define NFS4_CNTL_GET_VM_PDTS		110 /* get v4 pdt count */
#define NFS4_CNTL_SET_VM_BUFS		111 /* set v4 bufs/pdt count */
#define NFS4_CNTL_GET_VM_BUFS		112 /* get v4 bufs/pdt count */

#define NFS_CNTL_GET_GSS_STATS          113 /* get RPCSEC_GSS stats */

#define NFS4_CNTL_SET_SRV_DELEG		114 /* set server delegations ok */
#define NFS4_CNTL_GET_SRV_DELEG		115 /* get server delegations ok */

#define NFS_CNTL_SET_NFSAUTORBRTRIGGER	116 /* set auto_rbr_trigger value     */
#define NFS_CNTL_GET_NFSAUTORBRTRIGGER	117 /* get auto_rbr_trigger value     */

#define NFS4_CNTL_SET_REPLICAS_FLAG     118 /* enable/disable replicas */
#define NFS4_CNTL_GET_REPLICAS_FLAG     119 /* read replicas setting */
#define NFS4_CNTL_SET_REPLICAS          120 /* set nfsroot replicas */
#define NFS4_CNTL_GET_ROOT_LOCATIONS    121 /* read root replica locations */

#define NFS4_CNTL_DELEGRETURN		122 /* return delegations */

#define NFS4_CLNT_GET_DELEG_STATS       123 /* client delegation stats */
#define NFS4_CNTL_SET_CLNT_DELEG	124 /* set client delegations ok */
#define NFS4_CNTL_GET_CLNT_DELEG	125 /* get client delegations ok */

#define NFS4_CNTL_SM4_SETGP		126 /* set GP on/off */
#define NFS4_CNTL_SM4_SETGP_LEN		127 /* set GP length */
#define NFS4_CNTL_SM4_SETGP_AUTOX	128 /* set GP auto xtend cnt */
#define NFS4_CNTL_SM4_SETGP_SS_PATH	129 /* set GP SS path */
#define NFS4_CNTL_SM4_SETGP_SS_BLK_SIZE	130 /* set GP SS block size */
#define NFS4_CNTL_SM4_SETGP_BYPASS	131 /* set GP bypass */
#define NFS4_CNTL_SM4_GP_LOAD_SS	132 /* load SS for GP */
#define NFS4_CNTL_SM4_HA_BYPASS_STOP	133 /* HACMP: bypass SS stop */
#define NFS4_CNTL_SM4_HA_REG_NODE	134 /* HACMP: register node */
#define NFS4_CNTL_SM4_HA_ADD_ADDR	135 /* HACMP: add address for a node */
#define NFS4_CNTL_SM4_HA_UNREG_NODE	136 /* HACMP: unregister node */

#define NFS_CNTL_CHECKPOINT		137 /* WPAR - checkpoint */
#define NFS_CNTL_RESTART		138 /* WPAR - restart */

#define NFS_CNTL_SET_LOCKD_UP		139 /* WPAR - lockd is running */
#define NFS_CNTL_SET_STATD_UP		140 /* WPAR - statd is running */

#define NFS_CNTL_GET_PROXY_FS		141 /* PROXY - # of proxy file system */
#define NFS_CNTL_GET_WPAR_STATUS	142 /* SOme wpar flags */

#define NFS4_CNTL_SM4_HA_QUERY_NODE     143 /* HACMP: query node */

#define NFS_CNTL_ASYNC_CHECKPOINT	144 /* WPAR - checkpoint */
#define NFS_CNTL_ASYNC_RESTART		145 /* WPAR - the old restart */

#define NFS_CNTL_WPAR_SHUTDOWN		146 /* WPAR shutting down */

#define NFS_CNTL_ASYNC_RESTART2		147 /* WPAR - the new restart */

#define	NFS_CNTL_SET_NAS_VERSION	148 /* set the nas version within krpc */

#define NFS_CNTL_SET_SERVER_CLOSE_DELAY 149 /* Workaround for Linux client */
#define NFS_CNTL_GET_SERVER_CLOSE_DELAY 150 /* Workaround for Linux client */

#define NFS_CNTL_SET_HANG_LOG		151 /* set nfs hang logging */
#define NFS_CNTL_GET_HANG_LOG		152 /* get nfs hang logging */

#define NFS_CNTL_LKU_DEBUG_OP           153

#define NFS_CNTL_SET_GSS_WINDOW		154
#define NFS_CNTL_GET_GSS_WINDOW		155

#define NFS_CNTL_SET_GLOBAL_LOCKWINDOW_IMPR   156 /* set nfs cntl global lock window improvement */
#define NFS_CNTL_GET_GLOBAL_LOCKWINDOW_IMPR   157 /* get nfs cntl global lock window improvement */

#define NFS_CNTL_LKU_RECONSTRUCT_FSID_ROOTS 158 /* finish reconstruct fsid roots for LKU  */

#define NFS_CNTL_SET_PORT		159 /* set a port */

/*
 * Convention is:
 * NFS_ tags mean "Old V2 implementation style"
 * NFS2_ tags mean "NFS V2 style stats"
 * NFS3_ tags mean "NFS V3 style stats"
 */

/* size to be used with NFS_CNTL_SET_MAX_CONNECTIONS */
#define NFS_CNTL_MAX_CONNECTIONS_SIZE sizeof(nfs_maxconn)

/* size to be used with NFS_CNTL_SET_MAX_threads */
#define NFS_CNTL_MAX_THREADS_SIZE sizeof(nfs_maxthreads)

/* size to be used with NFS_CNTL_SET_CHKSUM */
#define NFS_CNTL_CHKSUM_SIZE sizeof(nfsudpcksum)

/* size to be used with NFS_CNTL_SET_SOCKS */
#define NFS_CNTL_SOCKS_SIZE	sizeof(nfs_socketsize)

/* size to be used with NFS_CNTL_SET_PORTCK */
#define NFS_CNTL_PORTCK_SIZE sizeof(nfs_portmonitor)

/* size to be used with NFS_CNTL_GET_OPTIONS */
#define NFS_CNTL_OPTIONS_SIZE	sizeof(t_nfs_options)

/* size to be used with NFS_CNTL_GET_CLNT_STAT	*/
#define NFS_CNTL_CLNT_SIZE	sizeof(t_clstat)

/* size to be used with NFS_CNTL_GET_ONC_CLNT_STAT	*/
#define NFS_CNTL_ONC_CLNT_SIZE	sizeof(t_clstat_onc)

/* size to be used with NFS3_CNTL_GET_CLNT_REQ_STAT	*/
#define NFS3_CNTL_CLNT_REQ_SIZE	sizeof(t_rfsreqcnt)

/* size to be used with NFS2_CNTL_GET_CLNT_REQ_STAT	*/
#define NFS2_CNTL_CLNT_REQ_SIZE	sizeof(t_rfsreqcnt)

/* size to be used with NFS3_CNTL_GET_SERV_REQ_STAT	*/ 
#define NFS3_CNTL_SERV_REQ_SIZE	sizeof(t_rfsreqcnt)

/* size to be used with NFS2_CNTL_GET_SERV_REQ_STAT	*/
#define NFS2_CNTL_SERV_REQ_SIZE	sizeof(t_rfsreqcnt)

/* size to be used with NFS_CNTL_GET_SERV_STAT	*/
#define NFS_CNTL_SERV_SIZE	sizeof(t_svstat)

/* size to be used with NFS_CNTL_GET_ONC_SERV_STAT	*/
#define NFS_CNTL_ONC_SERV_SIZE	sizeof(t_svstat_onc)

/* size to be used with NFS_CNTL_GET_CLKRPC_STAT	*/
#define NFS_CNTL_CLKRPC_SIZE	sizeof(t_rcstat)

/* size to be used with NFS_CNTL_GET_CLTS_CLKRPC_STAT	*/
#define NFS_CNTL_CLTS_CLKRPC_SIZE	sizeof(t_rcstat)

/* size to be used with NFS_CNTL_GET_COTS_CLKRPC_STAT	*/
#define NFS_CNTL_COTS_CLKRPC_SIZE	sizeof(t_rcstat)

/* size to be used with NFS_CNTL_GET_SVKRPC_STAT	*/
#define NFS_CNTL_SVKRPC_SIZE	sizeof(t_rsstat)

/* size to be used with NFS_CNTL_GET_CLTS_SVKRPC_STAT	*/
#define NFS_CNTL_CLTS_SVKRPC_SIZE	sizeof(t_rsstat)

/* size to be used with NFS_CNTL_GET_COTS_SVKRPC_STAT	*/
#define NFS_CNTL_COTS_SVKRPC_SIZE	sizeof(t_rsstat)

/* size to be used with NFS_CNTL_GET_ALL_STAT	  (old style)*/
#define NFS_CNTL_ALL_SIZE	sizeof(t_nfs_stats)

/* size to be used with NFS_CNTL_GET_ALL_STAT_ONC  (new style)	*/
#define NFS_CNTL_ALL_SIZE_ONC	sizeof(t_nfs_stats_onc)

/* size to be used with NFS_CNTL_SET_SETATTR */
#define NFS_CNTL_SETATTR_SIZE	sizeof(nfs_setattr_err_ignore)

/* size to be used with NFS_CNTL_SET_WRGATHER */
#define NFS_CNTL_WRGATHER_SIZE	sizeof(nfs_write_gather)

/* size to be used with NFS_CNTL_SET_REPEATMSG */
#define NFS_CNTL_REPEATMSG_SIZE	sizeof(nfs_repeat)

/* size to be used with NFS_CNTL_GET_PKTS_STAT 	*/
#define NFS_CNTL_PKTS_SIZE	sizeof(t_nfs_stats_pkts)

#define NFS_CNTL_DUPCACHE_SIZE	sizeof(nfs_dupcachesize)

#define NFS_CNTL_BASEPRIORITY_SIZE	sizeof(nfs_basepriority)

#define NFS_CNTL_DYNAMICRETRANS_SIZE	sizeof(nfs_dynamicretrans)

#define NFS_CNTL_CLIENTIOPACE_SIZE	sizeof(nfs_clientiopace)

#define NFS_CNTL_NFSHA_SIZE		sizeof(nfs_ha)

#define NFS_CNTL_MNTINFO_REQ_SIZE	sizeof(struct mntinfo_req)

#define NFS_CNTL_SERVER_CLREAD_SIZE	sizeof(nfs_serverclread)

#define NFS_CNTL_MAX_RW_SIZE		sizeof(nfs_max_rwsize)

#define NFS_CNTL_VM_PDTS_SIZE		sizeof(int)

#define NFS_CNTL_VM_BUFS_SIZE		sizeof(int)

#define NFS_CNTL_SECNFS_CREDTIMEOUT_SIZE sizeof(int)

#define NFS_CNTL_SERVER_READDIRPLUS_SIZE sizeof(int)

/* size to be used with NFS4_CNTL_GET_NRS_*_STAT 	*/
#define NFS4_CNTL_NRS_SIZE	sizeof(t_nrsstat)

#define NFS_CNTL_NFS_PID_SIZE	sizeof(nfs_pid_t)

#define NFS4_CNTL_TIMEOUT_SIZE	sizeof(nfs4_timeout)

#define NFS4_CNTL_SRV_GET_STATS_SIZE sizeof(struct nfs_srv_stats4)

#define NFS4_CNTL_SRV_GET_EXPORT_STATS_SIZE sizeof(struct nfs_srv_export_stats4)

#define NFS4_CNTL_GET_UTF8_SIZE		sizeof(int)
#define NFS4_CNTL_SET_UTF8_SIZE		sizeof(int)

#define	NFS4_CLNT_GET_STATS_SIZE	sizeof(clnt4_stats)

/* size to be used with NFS4_CNTL_SM4_REVOKE_VFS */
#define NFS4_CNTL_SM4_REVOKE_VFS_SIZE	sizeof(sm4_revoke_vfs_cookie_t)
 
/* size to be used with NFS4_CNTL_SM4_REVOKE_CLID */
#define NFS4_CNTL_SM4_REVOKE_CLID_SIZE	sizeof(sm4_revoke_clid_type_t)

#define NFS_CNTL_GSS_SIZE sizeof(t_gssstat)

#define NFS4_CNTL_SRV_DELEG_SIZE  sizeof(int)
#define NFS4_CNTL_CLNT_DELEG_SIZE  sizeof(int)

#define NFS_CNTL_AUTORBRTRIGGER_SIZE	sizeof(int)

#define NFS4_CLNT_DELEG_STATS_SIZE	sizeof(struct nc4_deleg_stats)

#define NFS_CNTL_CHECKPOINT_SIZE	sizeof(struct nfs_checkpoint_request)
#define NFS_CNTL_RESTART_SIZE		sizeof(struct nfs_checkpoint_request)

#define NFS_CNTL_ASYNC_CHECKPOINT_SIZE	sizeof(struct nfs_async_checkpoint_request)
#define NFS_CNTL_ASYNC_RESTART_SIZE	sizeof(struct nfs_async_checkpoint_request)

#define NFS_CNTL_SET_LOCKD_UP_SIZE	sizeof(int)
#define NFS_CNTL_SET_STATD_UP_SIZE	sizeof(int)

#define NFS_CNTL_GET_PROXY_FS_SIZE	sizeof(int)

#define NFS_CNTL_WPAR_SHUTDOWN_SIZE	sizeof(cid_t)

#define	NFS_CNTL_SET_NAS_VERSION_SIZE	sizeof(int)

#define NFS_CNTL_SET_SERVER_CLOSE_DELAY_SIZE  sizeof(int)

#define NFS_CNTL_GET_SERVER_CLOSE_DELAY_SIZE  sizeof(int)

#define NFS_CNTL_HANG_LOG_SIZE		sizeof(nfs_hang_log)

#define NFS_CNTL_LKU_DEBUG_OP_SIZE      sizeof(int)

#define NFS_CNTL_GSS_WINDOW_SIZE	sizeof(int)

#define NFS_CNTL_GLOBAL_LOCKWINDOW_IMPR_SIZE  sizeof(int)

#define NFS_CNTL_NFS_PORT_SIZE          sizeof(nfs_port_t)

extern int nfs_cntl(int, caddr_t, size_t);

#endif /* _NFS_FSCNTL_ */
