xref: /illumos-gate/usr/src/uts/common/nfs/nfs_log.h (revision 0dfe541e)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
22*0dfe541eSEvan Layton 
237c478bd9Sstevel@tonic-gate /*
247c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
257c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
267c478bd9Sstevel@tonic-gate  */
277c478bd9Sstevel@tonic-gate 
28*0dfe541eSEvan Layton /*
29*0dfe541eSEvan Layton  * Copyright 2018 Nexenta Systems, Inc.
30*0dfe541eSEvan Layton  */
31*0dfe541eSEvan Layton 
327c478bd9Sstevel@tonic-gate #ifndef	_NFS_LOG_H
337c478bd9Sstevel@tonic-gate #define	_NFS_LOG_H
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
367c478bd9Sstevel@tonic-gate extern "C" {
377c478bd9Sstevel@tonic-gate #endif
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate #include <nfs/nfs.h>
407c478bd9Sstevel@tonic-gate #include <nfs/export.h>
417c478bd9Sstevel@tonic-gate #include <rpc/rpc.h>
427c478bd9Sstevel@tonic-gate 
437c478bd9Sstevel@tonic-gate #define	LOG_MODE		0600	/* open log with these permissions */
447c478bd9Sstevel@tonic-gate #define	LOG_INPROG_STRING	"_log_in_process"
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate /*
477c478bd9Sstevel@tonic-gate  * Definition of dummy program for logging special non-nfs reqs
487c478bd9Sstevel@tonic-gate  */
497c478bd9Sstevel@tonic-gate #define	NFSLOG_PROGRAM		((rpcprog_t)42)
507c478bd9Sstevel@tonic-gate #define	NFSLOG_VERSION		((rpcvers_t)1)
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate #define	NFSLOG_VERSMIN		((rpcvers_t)1)
537c478bd9Sstevel@tonic-gate #define	NFSLOG_VERSMAX		((rpcvers_t)1)
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate #define	NFSLOG_NULL		((rpcproc_t)0)
567c478bd9Sstevel@tonic-gate #define	NFSLOG_SHARE		((rpcproc_t)1)
577c478bd9Sstevel@tonic-gate #define	NFSLOG_UNSHARE		((rpcproc_t)2)
587c478bd9Sstevel@tonic-gate #define	NFSLOG_LOOKUP		((rpcproc_t)3)
597c478bd9Sstevel@tonic-gate #define	NFSLOG_GETFH		((rpcproc_t)4)
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate /*
627c478bd9Sstevel@tonic-gate  * Version of the on disk log file
637c478bd9Sstevel@tonic-gate  */
647c478bd9Sstevel@tonic-gate #define	NFSLOG_BUF_VERSION	((rpcvers_t)2)
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate #define	NFSLOG_BUF_VERSMIN	((rpcvers_t)1)
677c478bd9Sstevel@tonic-gate #define	NFSLOG_BUF_VERSMAX	((rpcvers_t)2)
687c478bd9Sstevel@tonic-gate /*
697c478bd9Sstevel@tonic-gate  * Contents of the on disk log file header
707c478bd9Sstevel@tonic-gate  *
717c478bd9Sstevel@tonic-gate  * Note: This is the structure for older version 1 buffers, and does not
727c478bd9Sstevel@tonic-gate  * adequately support large buffer files, as the offset is 32 bit. Newer
737c478bd9Sstevel@tonic-gate  * buffer files are written using version 2 buffer header (below) which
747c478bd9Sstevel@tonic-gate  * has a 64 bit offset. However, because existing buffers continue to use
757c478bd9Sstevel@tonic-gate  * the old header format, the daemon xdr code can read and write either format.
767c478bd9Sstevel@tonic-gate  * This definition below is not explicitely used anywhere in the code,
777c478bd9Sstevel@tonic-gate  * but is implicitely used by the daemon xdr code. For that reason, it
787c478bd9Sstevel@tonic-gate  * is kept here for information purpose only.
797c478bd9Sstevel@tonic-gate  */
807c478bd9Sstevel@tonic-gate struct nfslog_buffer_header_1 {
817c478bd9Sstevel@tonic-gate 	uint32_t bh_length;		/* Length of this header */
827c478bd9Sstevel@tonic-gate 	uint32_t bh_version;		/* Version of buffer contents */
837c478bd9Sstevel@tonic-gate 	uint32_t bh_flags;		/* Optional flags field */
847c478bd9Sstevel@tonic-gate 	uint32_t bh_offset;		/* offset within file to begin */
857c478bd9Sstevel@tonic-gate 	timestruc32_t bh_timestamp;	/* When the buffer was created */
867c478bd9Sstevel@tonic-gate };
877c478bd9Sstevel@tonic-gate typedef struct nfslog_buffer_header_1 nfslog_buffer_header_1;
887c478bd9Sstevel@tonic-gate 
897c478bd9Sstevel@tonic-gate /*
907c478bd9Sstevel@tonic-gate  * For the current version 2, which supports largefiles
917c478bd9Sstevel@tonic-gate  */
927c478bd9Sstevel@tonic-gate struct nfslog_buffer_header_2 {
937c478bd9Sstevel@tonic-gate 	uint32_t bh_length;		/* Length of this header */
947c478bd9Sstevel@tonic-gate 	rpcvers_t bh_version;		/* Version of buffer contents */
957c478bd9Sstevel@tonic-gate 	u_offset_t bh_offset;		/* offset within file to begin */
967c478bd9Sstevel@tonic-gate 	uint32_t bh_flags;		/* Optional flags field */
977c478bd9Sstevel@tonic-gate 	timestruc32_t bh_timestamp;	/* When the buffer was created */
987c478bd9Sstevel@tonic-gate };
997c478bd9Sstevel@tonic-gate typedef struct nfslog_buffer_header_2 nfslog_buffer_header_2;
1007c478bd9Sstevel@tonic-gate 
1017c478bd9Sstevel@tonic-gate typedef struct nfslog_buffer_header_2 nfslog_buffer_header;
1027c478bd9Sstevel@tonic-gate 
1037c478bd9Sstevel@tonic-gate /* bh_flags values */
1047c478bd9Sstevel@tonic-gate #define	NFSLOG_BH_OFFSET_OVERFLOW	1	/* version 1 bh_offset */
1057c478bd9Sstevel@tonic-gate 
1067c478bd9Sstevel@tonic-gate /*
1077c478bd9Sstevel@tonic-gate  * For each record written to the log file, this struct is used
1087c478bd9Sstevel@tonic-gate  * as the logical header; it will be XDR encoded to be written to the file.
1097c478bd9Sstevel@tonic-gate  *
1107c478bd9Sstevel@tonic-gate  * Note: if the buffer file becomes large enough, the rh_rec_id may
1117c478bd9Sstevel@tonic-gate  * wrap around. This situation is appropriately handled by the daemon however.
1127c478bd9Sstevel@tonic-gate  */
1137c478bd9Sstevel@tonic-gate struct nfslog_record_header {
1147c478bd9Sstevel@tonic-gate 	uint32_t rh_reclen;		/* Length of entire record */
1157c478bd9Sstevel@tonic-gate 	uint32_t rh_rec_id;		/* unique id for this log */
1167c478bd9Sstevel@tonic-gate 	rpcprog_t rh_prognum;		/* Program number */
1177c478bd9Sstevel@tonic-gate 	rpcproc_t rh_procnum;		/* Procedure number */
1187c478bd9Sstevel@tonic-gate 	rpcvers_t rh_version;		/* Version number */
1197c478bd9Sstevel@tonic-gate 	uint32_t rh_auth_flavor;	/* Auth flavor of RPC request */
1207c478bd9Sstevel@tonic-gate 	timestruc32_t rh_timestamp;	/* time stamp of the request */
1217c478bd9Sstevel@tonic-gate 	uid_t rh_uid;			/* uid of requestor as per RPC */
1227c478bd9Sstevel@tonic-gate 	gid_t rh_gid;			/* gid of requestor as per RPC */
1237c478bd9Sstevel@tonic-gate };
1247c478bd9Sstevel@tonic-gate typedef struct nfslog_record_header nfslog_record_header;
1257c478bd9Sstevel@tonic-gate 
1267c478bd9Sstevel@tonic-gate /*
1277c478bd9Sstevel@tonic-gate  * For each record written to the log file, this is the logical
1287c478bd9Sstevel@tonic-gate  * structure of the record; it will be XDR encoded and written to
1297c478bd9Sstevel@tonic-gate  * the file.
1307c478bd9Sstevel@tonic-gate  */
1317c478bd9Sstevel@tonic-gate struct nfslog_request_record {
1327c478bd9Sstevel@tonic-gate 	nfslog_record_header re_header;	/* Header as defined above */
1337c478bd9Sstevel@tonic-gate 	char *re_principal_name;	/* Principal name of caller */
1347c478bd9Sstevel@tonic-gate 	char *re_netid;			/* Netid used for request */
1357c478bd9Sstevel@tonic-gate 	char *re_tag;			/* Log buffer tag for file system */
1367c478bd9Sstevel@tonic-gate 	struct netbuf re_ipaddr;	/* Requestors ip address */
1377c478bd9Sstevel@tonic-gate 	caddr_t re_rpc_arg;		/* RPC arguments and response */
1387c478bd9Sstevel@tonic-gate 	caddr_t re_rpc_res;
1397c478bd9Sstevel@tonic-gate };
1407c478bd9Sstevel@tonic-gate typedef struct nfslog_request_record nfslog_request_record;
1417c478bd9Sstevel@tonic-gate 
1427c478bd9Sstevel@tonic-gate /*
1437c478bd9Sstevel@tonic-gate  * From this point forward, the definitions represent the arguments
1447c478bd9Sstevel@tonic-gate  * and results of each possible RPC that can be logged.  These
1457c478bd9Sstevel@tonic-gate  * may have been trimmed in content from the real RPC arguments
1467c478bd9Sstevel@tonic-gate  * and results to save space.
1477c478bd9Sstevel@tonic-gate  */
1487c478bd9Sstevel@tonic-gate typedef fhandle_t fhandle;
1497c478bd9Sstevel@tonic-gate 
1507c478bd9Sstevel@tonic-gate struct nfslog_sharefsargs {
1517c478bd9Sstevel@tonic-gate 	int sh_flags;
1527c478bd9Sstevel@tonic-gate 	uint32_t sh_anon;
1537c478bd9Sstevel@tonic-gate 	char *sh_path;
1547c478bd9Sstevel@tonic-gate 	fhandle sh_fh_buf;
1557c478bd9Sstevel@tonic-gate };
1567c478bd9Sstevel@tonic-gate typedef struct nfslog_sharefsargs nfslog_sharefsargs;
1577c478bd9Sstevel@tonic-gate 
1587c478bd9Sstevel@tonic-gate typedef nfsstat nfslog_sharefsres;
1597c478bd9Sstevel@tonic-gate 
1607c478bd9Sstevel@tonic-gate struct nfslog_getfhargs {
1617c478bd9Sstevel@tonic-gate 	fhandle gfh_fh_buf;
1627c478bd9Sstevel@tonic-gate 	char *gfh_path;
1637c478bd9Sstevel@tonic-gate };
1647c478bd9Sstevel@tonic-gate typedef struct nfslog_getfhargs nfslog_getfhargs;
1657c478bd9Sstevel@tonic-gate 
1667c478bd9Sstevel@tonic-gate struct nfslog_diropargs {
1677c478bd9Sstevel@tonic-gate 	fhandle da_fhandle;
1687c478bd9Sstevel@tonic-gate 	char *da_name;
1697c478bd9Sstevel@tonic-gate };
1707c478bd9Sstevel@tonic-gate typedef struct nfslog_diropargs nfslog_diropargs;
1717c478bd9Sstevel@tonic-gate 
1727c478bd9Sstevel@tonic-gate struct nfslog_drok {
1737c478bd9Sstevel@tonic-gate 	fhandle drok_fhandle;
1747c478bd9Sstevel@tonic-gate };
1757c478bd9Sstevel@tonic-gate typedef struct nfslog_drok nfslog_drok;
1767c478bd9Sstevel@tonic-gate 
1777c478bd9Sstevel@tonic-gate struct nfslog_diropres {
1787c478bd9Sstevel@tonic-gate 	nfsstat dr_status;
1797c478bd9Sstevel@tonic-gate 	union {
1807c478bd9Sstevel@tonic-gate 		nfslog_drok dr_ok;
1817c478bd9Sstevel@tonic-gate 	} nfslog_diropres_u;
1827c478bd9Sstevel@tonic-gate };
1837c478bd9Sstevel@tonic-gate typedef struct nfslog_diropres nfslog_diropres;
1847c478bd9Sstevel@tonic-gate 
1857c478bd9Sstevel@tonic-gate typedef struct nfsreadargs nfslog_nfsreadargs;
1867c478bd9Sstevel@tonic-gate 
1877c478bd9Sstevel@tonic-gate struct nfslog_rrok {
1887c478bd9Sstevel@tonic-gate 	uint32_t filesize;
1897c478bd9Sstevel@tonic-gate 	uint32_t rrok_count;
1907c478bd9Sstevel@tonic-gate };
1917c478bd9Sstevel@tonic-gate typedef struct nfslog_rrok nfslog_rrok;
1927c478bd9Sstevel@tonic-gate 
1937c478bd9Sstevel@tonic-gate struct nfslog_rdresult {
1947c478bd9Sstevel@tonic-gate 	nfsstat r_status;
1957c478bd9Sstevel@tonic-gate 	union {
1967c478bd9Sstevel@tonic-gate 		nfslog_rrok r_ok;
1977c478bd9Sstevel@tonic-gate 	} nfslog_rdresult_u;
1987c478bd9Sstevel@tonic-gate };
1997c478bd9Sstevel@tonic-gate typedef struct nfslog_rdresult nfslog_rdresult;
2007c478bd9Sstevel@tonic-gate 
2017c478bd9Sstevel@tonic-gate struct nfslog_writeargs {
2027c478bd9Sstevel@tonic-gate 	fhandle waargs_fhandle;
2037c478bd9Sstevel@tonic-gate 	uint32_t waargs_begoff;
2047c478bd9Sstevel@tonic-gate 	uint32_t waargs_offset;
2057c478bd9Sstevel@tonic-gate 	uint32_t waargs_totcount;
2067c478bd9Sstevel@tonic-gate 	uint32_t waargs_count;
2077c478bd9Sstevel@tonic-gate };
2087c478bd9Sstevel@tonic-gate typedef struct nfslog_writeargs nfslog_writeargs;
2097c478bd9Sstevel@tonic-gate 
2107c478bd9Sstevel@tonic-gate struct nfslog_writeresult {
2117c478bd9Sstevel@tonic-gate 	nfsstat wr_status;
2127c478bd9Sstevel@tonic-gate 	union {
2137c478bd9Sstevel@tonic-gate 		uint32_t wr_size;
2147c478bd9Sstevel@tonic-gate 	} nfslog_writeresult_u;
2157c478bd9Sstevel@tonic-gate };
2167c478bd9Sstevel@tonic-gate typedef struct nfslog_writeresult nfslog_writeresult;
2177c478bd9Sstevel@tonic-gate 
2187c478bd9Sstevel@tonic-gate struct nfslog_sattr {
2197c478bd9Sstevel@tonic-gate 	uint32_t sa_mode;
2207c478bd9Sstevel@tonic-gate 	uint32_t sa_uid;
2217c478bd9Sstevel@tonic-gate 	uint32_t sa_gid;
2227c478bd9Sstevel@tonic-gate 	uint32_t sa_size;
2237c478bd9Sstevel@tonic-gate 	nfs2_timeval sa_atime;
2247c478bd9Sstevel@tonic-gate 	nfs2_timeval sa_mtime;
2257c478bd9Sstevel@tonic-gate };
2267c478bd9Sstevel@tonic-gate typedef struct nfslog_sattr nfslog_sattr;
2277c478bd9Sstevel@tonic-gate 
2287c478bd9Sstevel@tonic-gate struct nfslog_createargs {
2297c478bd9Sstevel@tonic-gate 	nfslog_sattr ca_sa;
2307c478bd9Sstevel@tonic-gate 	nfslog_diropargs ca_da;
2317c478bd9Sstevel@tonic-gate };
2327c478bd9Sstevel@tonic-gate typedef struct nfslog_createargs nfslog_createargs;
2337c478bd9Sstevel@tonic-gate 
2347c478bd9Sstevel@tonic-gate struct nfslog_setattrargs {
2357c478bd9Sstevel@tonic-gate 	fhandle saa_fh;
2367c478bd9Sstevel@tonic-gate 	nfslog_sattr saa_sa;
2377c478bd9Sstevel@tonic-gate };
2387c478bd9Sstevel@tonic-gate typedef struct nfslog_setattrargs nfslog_setattrargs;
2397c478bd9Sstevel@tonic-gate 
2407c478bd9Sstevel@tonic-gate struct nfslog_rdlnres {
2417c478bd9Sstevel@tonic-gate 	nfsstat rl_status;
2427c478bd9Sstevel@tonic-gate 	union {
2437c478bd9Sstevel@tonic-gate 		char *rl_ok;
2447c478bd9Sstevel@tonic-gate 	} nfslog_rdlnres_u;
2457c478bd9Sstevel@tonic-gate };
2467c478bd9Sstevel@tonic-gate typedef struct nfslog_rdlnres nfslog_rdlnres;
2477c478bd9Sstevel@tonic-gate 
2487c478bd9Sstevel@tonic-gate struct nfslog_rnmargs {
2497c478bd9Sstevel@tonic-gate 	nfslog_diropargs rna_from;
2507c478bd9Sstevel@tonic-gate 	nfslog_diropargs rna_to;
2517c478bd9Sstevel@tonic-gate };
2527c478bd9Sstevel@tonic-gate typedef struct nfslog_rnmargs nfslog_rnmargs;
2537c478bd9Sstevel@tonic-gate 
2547c478bd9Sstevel@tonic-gate struct nfslog_linkargs {
2557c478bd9Sstevel@tonic-gate 	fhandle la_from;
2567c478bd9Sstevel@tonic-gate 	nfslog_diropargs la_to;
2577c478bd9Sstevel@tonic-gate };
2587c478bd9Sstevel@tonic-gate typedef struct nfslog_linkargs nfslog_linkargs;
2597c478bd9Sstevel@tonic-gate 
2607c478bd9Sstevel@tonic-gate struct nfslog_symlinkargs {
2617c478bd9Sstevel@tonic-gate 	nfslog_diropargs sla_from;
2627c478bd9Sstevel@tonic-gate 	char *sla_tnm;
2637c478bd9Sstevel@tonic-gate 	nfslog_sattr sla_sa;
2647c478bd9Sstevel@tonic-gate };
2657c478bd9Sstevel@tonic-gate typedef struct nfslog_symlinkargs nfslog_symlinkargs;
2667c478bd9Sstevel@tonic-gate 
2677c478bd9Sstevel@tonic-gate struct nfslog_rddirargs {
2687c478bd9Sstevel@tonic-gate 	fhandle rda_fh;
2697c478bd9Sstevel@tonic-gate 	uint32_t rda_offset;
2707c478bd9Sstevel@tonic-gate 	uint32_t rda_count;
2717c478bd9Sstevel@tonic-gate };
2727c478bd9Sstevel@tonic-gate typedef struct nfslog_rddirargs nfslog_rddirargs;
2737c478bd9Sstevel@tonic-gate 
2747c478bd9Sstevel@tonic-gate struct nfslog_rdok {
2757c478bd9Sstevel@tonic-gate 	uint32_t rdok_offset;
2767c478bd9Sstevel@tonic-gate 	uint32_t rdok_size;
2777c478bd9Sstevel@tonic-gate 	bool_t rdok_eof;
2787c478bd9Sstevel@tonic-gate };
2797c478bd9Sstevel@tonic-gate typedef struct nfslog_rdok nfslog_rdok;
2807c478bd9Sstevel@tonic-gate 
2817c478bd9Sstevel@tonic-gate struct nfslog_rddirres {
2827c478bd9Sstevel@tonic-gate 	nfsstat rd_status;
2837c478bd9Sstevel@tonic-gate 	union {
2847c478bd9Sstevel@tonic-gate 		nfslog_rdok rd_ok;
2857c478bd9Sstevel@tonic-gate 	} nfslog_rddirres_u;
2867c478bd9Sstevel@tonic-gate };
2877c478bd9Sstevel@tonic-gate typedef struct nfslog_rddirres nfslog_rddirres;
2887c478bd9Sstevel@tonic-gate 
2897c478bd9Sstevel@tonic-gate struct nfslog_diropargs3 {
2907c478bd9Sstevel@tonic-gate 	nfs_fh3 dir;
2917c478bd9Sstevel@tonic-gate 	char *name;
2927c478bd9Sstevel@tonic-gate };
2937c478bd9Sstevel@tonic-gate typedef struct nfslog_diropargs3 nfslog_diropargs3;
2947c478bd9Sstevel@tonic-gate 
2957c478bd9Sstevel@tonic-gate struct nfslog_LOOKUP3res {
2967c478bd9Sstevel@tonic-gate 	nfsstat3 status;
2977c478bd9Sstevel@tonic-gate 	union {
2987c478bd9Sstevel@tonic-gate 		nfs_fh3 object;
2997c478bd9Sstevel@tonic-gate 	} nfslog_LOOKUP3res_u;
3007c478bd9Sstevel@tonic-gate };
3017c478bd9Sstevel@tonic-gate typedef struct nfslog_LOOKUP3res nfslog_LOOKUP3res;
3027c478bd9Sstevel@tonic-gate 
3037c478bd9Sstevel@tonic-gate struct nfslog_createhow3 {
3047c478bd9Sstevel@tonic-gate 	createmode3 mode;
3057c478bd9Sstevel@tonic-gate 	union {
3067c478bd9Sstevel@tonic-gate 		set_size3 size;
3077c478bd9Sstevel@tonic-gate 	} nfslog_createhow3_u;
3087c478bd9Sstevel@tonic-gate };
3097c478bd9Sstevel@tonic-gate typedef struct nfslog_createhow3 nfslog_createhow3;
3107c478bd9Sstevel@tonic-gate 
3117c478bd9Sstevel@tonic-gate struct nfslog_CREATE3args {
3127c478bd9Sstevel@tonic-gate 	nfslog_diropargs3 where;
3137c478bd9Sstevel@tonic-gate 	nfslog_createhow3 how;
3147c478bd9Sstevel@tonic-gate };
3157c478bd9Sstevel@tonic-gate typedef struct nfslog_CREATE3args nfslog_CREATE3args;
3167c478bd9Sstevel@tonic-gate 
3177c478bd9Sstevel@tonic-gate struct nfslog_CREATE3resok {
3187c478bd9Sstevel@tonic-gate 	post_op_fh3 obj;
3197c478bd9Sstevel@tonic-gate };
3207c478bd9Sstevel@tonic-gate typedef struct nfslog_CREATE3resok nfslog_CREATE3resok;
3217c478bd9Sstevel@tonic-gate 
3227c478bd9Sstevel@tonic-gate struct nfslog_CREATE3res {
3237c478bd9Sstevel@tonic-gate 	nfsstat3 status;
3247c478bd9Sstevel@tonic-gate 	union {
3257c478bd9Sstevel@tonic-gate 		nfslog_CREATE3resok ok;
3267c478bd9Sstevel@tonic-gate 	} nfslog_CREATE3res_u;
3277c478bd9Sstevel@tonic-gate };
3287c478bd9Sstevel@tonic-gate typedef struct nfslog_CREATE3res nfslog_CREATE3res;
3297c478bd9Sstevel@tonic-gate 
3307c478bd9Sstevel@tonic-gate struct nfslog_SETATTR3args {
3317c478bd9Sstevel@tonic-gate 	nfs_fh3 object;
3327c478bd9Sstevel@tonic-gate 	set_size3 size;
3337c478bd9Sstevel@tonic-gate };
3347c478bd9Sstevel@tonic-gate typedef struct nfslog_SETATTR3args nfslog_SETATTR3args;
3357c478bd9Sstevel@tonic-gate 
3367c478bd9Sstevel@tonic-gate struct nfslog_READLINK3res {
3377c478bd9Sstevel@tonic-gate 	nfsstat3 status;
3387c478bd9Sstevel@tonic-gate 	union {
3397c478bd9Sstevel@tonic-gate 		char *data;
3407c478bd9Sstevel@tonic-gate 	} nfslog_READLINK3res_u;
3417c478bd9Sstevel@tonic-gate };
3427c478bd9Sstevel@tonic-gate typedef struct nfslog_READLINK3res nfslog_READLINK3res;
3437c478bd9Sstevel@tonic-gate 
3447c478bd9Sstevel@tonic-gate struct nfslog_READ3args {
3457c478bd9Sstevel@tonic-gate 	nfs_fh3 file;
3467c478bd9Sstevel@tonic-gate 	offset3 offset;
3477c478bd9Sstevel@tonic-gate 	count3 count;
3487c478bd9Sstevel@tonic-gate };
3497c478bd9Sstevel@tonic-gate typedef struct nfslog_READ3args nfslog_READ3args;
3507c478bd9Sstevel@tonic-gate 
3517c478bd9Sstevel@tonic-gate struct nfslog_READ3resok {
3527c478bd9Sstevel@tonic-gate 	size3 filesize;
3537c478bd9Sstevel@tonic-gate 	count3 count;
3547c478bd9Sstevel@tonic-gate 	bool_t eof;
3557c478bd9Sstevel@tonic-gate 	uint32_t size;
3567c478bd9Sstevel@tonic-gate };
3577c478bd9Sstevel@tonic-gate typedef struct nfslog_READ3resok nfslog_READ3resok;
3587c478bd9Sstevel@tonic-gate 
3597c478bd9Sstevel@tonic-gate struct nfslog_READ3res {
3607c478bd9Sstevel@tonic-gate 	nfsstat3 status;
3617c478bd9Sstevel@tonic-gate 	union {
3627c478bd9Sstevel@tonic-gate 		nfslog_READ3resok ok;
3637c478bd9Sstevel@tonic-gate 	} nfslog_READ3res_u;
3647c478bd9Sstevel@tonic-gate };
3657c478bd9Sstevel@tonic-gate typedef struct nfslog_READ3res nfslog_READ3res;
3667c478bd9Sstevel@tonic-gate 
3677c478bd9Sstevel@tonic-gate struct nfslog_WRITE3args {
3687c478bd9Sstevel@tonic-gate 	nfs_fh3 file;
3697c478bd9Sstevel@tonic-gate 	offset3 offset;
3707c478bd9Sstevel@tonic-gate 	count3 count;
3717c478bd9Sstevel@tonic-gate 	stable_how stable;
3727c478bd9Sstevel@tonic-gate };
3737c478bd9Sstevel@tonic-gate typedef struct nfslog_WRITE3args nfslog_WRITE3args;
3747c478bd9Sstevel@tonic-gate 
3757c478bd9Sstevel@tonic-gate struct nfslog_WRITE3resok {
3767c478bd9Sstevel@tonic-gate 	size3 filesize;
3777c478bd9Sstevel@tonic-gate 	count3 count;
3787c478bd9Sstevel@tonic-gate 	stable_how committed;
3797c478bd9Sstevel@tonic-gate };
3807c478bd9Sstevel@tonic-gate typedef struct nfslog_WRITE3resok nfslog_WRITE3resok;
3817c478bd9Sstevel@tonic-gate 
3827c478bd9Sstevel@tonic-gate struct nfslog_WRITE3res {
3837c478bd9Sstevel@tonic-gate 	nfsstat3 status;
3847c478bd9Sstevel@tonic-gate 	union {
3857c478bd9Sstevel@tonic-gate 		nfslog_WRITE3resok ok;
3867c478bd9Sstevel@tonic-gate 	} nfslog_WRITE3res_u;
3877c478bd9Sstevel@tonic-gate };
3887c478bd9Sstevel@tonic-gate typedef struct nfslog_WRITE3res nfslog_WRITE3res;
3897c478bd9Sstevel@tonic-gate 
3907c478bd9Sstevel@tonic-gate struct nfslog_MKDIR3args {
3917c478bd9Sstevel@tonic-gate 	nfslog_diropargs3 where;
3927c478bd9Sstevel@tonic-gate };
3937c478bd9Sstevel@tonic-gate typedef struct nfslog_MKDIR3args nfslog_MKDIR3args;
3947c478bd9Sstevel@tonic-gate 
3957c478bd9Sstevel@tonic-gate struct nfslog_MKDIR3res {
3967c478bd9Sstevel@tonic-gate 	nfsstat3 status;
3977c478bd9Sstevel@tonic-gate 	union {
3987c478bd9Sstevel@tonic-gate 		post_op_fh3 obj;
3997c478bd9Sstevel@tonic-gate 	} nfslog_MKDIR3res_u;
4007c478bd9Sstevel@tonic-gate };
4017c478bd9Sstevel@tonic-gate typedef struct nfslog_MKDIR3res nfslog_MKDIR3res;
4027c478bd9Sstevel@tonic-gate 
4037c478bd9Sstevel@tonic-gate struct nfslog_SYMLINK3args {
4047c478bd9Sstevel@tonic-gate 	nfslog_diropargs3 where;
4057c478bd9Sstevel@tonic-gate 	char *symlink_data;
4067c478bd9Sstevel@tonic-gate };
4077c478bd9Sstevel@tonic-gate typedef struct nfslog_SYMLINK3args nfslog_SYMLINK3args;
4087c478bd9Sstevel@tonic-gate 
4097c478bd9Sstevel@tonic-gate struct nfslog_SYMLINK3res {
4107c478bd9Sstevel@tonic-gate 	nfsstat3 status;
4117c478bd9Sstevel@tonic-gate 	union {
4127c478bd9Sstevel@tonic-gate 		post_op_fh3 obj;
4137c478bd9Sstevel@tonic-gate 	} nfslog_SYMLINK3res_u;
4147c478bd9Sstevel@tonic-gate };
4157c478bd9Sstevel@tonic-gate typedef struct nfslog_SYMLINK3res nfslog_SYMLINK3res;
4167c478bd9Sstevel@tonic-gate 
4177c478bd9Sstevel@tonic-gate struct nfslog_MKNOD3args {
4187c478bd9Sstevel@tonic-gate 	nfslog_diropargs3 where;
4197c478bd9Sstevel@tonic-gate 	ftype3 type;
4207c478bd9Sstevel@tonic-gate };
4217c478bd9Sstevel@tonic-gate typedef struct nfslog_MKNOD3args nfslog_MKNOD3args;
4227c478bd9Sstevel@tonic-gate 
4237c478bd9Sstevel@tonic-gate struct nfslog_MKNOD3res {
4247c478bd9Sstevel@tonic-gate 	nfsstat3 status;
4257c478bd9Sstevel@tonic-gate 	union {
4267c478bd9Sstevel@tonic-gate 		post_op_fh3 obj;
4277c478bd9Sstevel@tonic-gate 	} nfslog_MKNOD3res_u;
4287c478bd9Sstevel@tonic-gate };
4297c478bd9Sstevel@tonic-gate typedef struct nfslog_MKNOD3res nfslog_MKNOD3res;
4307c478bd9Sstevel@tonic-gate 
4317c478bd9Sstevel@tonic-gate struct nfslog_REMOVE3args {
4327c478bd9Sstevel@tonic-gate 	nfslog_diropargs3 object;
4337c478bd9Sstevel@tonic-gate };
4347c478bd9Sstevel@tonic-gate typedef struct nfslog_REMOVE3args nfslog_REMOVE3args;
4357c478bd9Sstevel@tonic-gate 
4367c478bd9Sstevel@tonic-gate struct nfslog_RMDIR3args {
4377c478bd9Sstevel@tonic-gate 	nfslog_diropargs3 object;
4387c478bd9Sstevel@tonic-gate };
4397c478bd9Sstevel@tonic-gate typedef struct nfslog_RMDIR3args nfslog_RMDIR3args;
4407c478bd9Sstevel@tonic-gate 
4417c478bd9Sstevel@tonic-gate struct nfslog_RENAME3args {
4427c478bd9Sstevel@tonic-gate 	nfslog_diropargs3 from;
4437c478bd9Sstevel@tonic-gate 	nfslog_diropargs3 to;
4447c478bd9Sstevel@tonic-gate };
4457c478bd9Sstevel@tonic-gate typedef struct nfslog_RENAME3args nfslog_RENAME3args;
4467c478bd9Sstevel@tonic-gate 
4477c478bd9Sstevel@tonic-gate struct nfslog_LINK3args {
4487c478bd9Sstevel@tonic-gate 	nfs_fh3 file;
4497c478bd9Sstevel@tonic-gate 	nfslog_diropargs3 link;
4507c478bd9Sstevel@tonic-gate };
4517c478bd9Sstevel@tonic-gate typedef struct nfslog_LINK3args nfslog_LINK3args;
4527c478bd9Sstevel@tonic-gate 
4537c478bd9Sstevel@tonic-gate struct nfslog_READDIRPLUS3args {
4547c478bd9Sstevel@tonic-gate 	nfs_fh3 dir;
4557c478bd9Sstevel@tonic-gate 	count3 dircount;
4567c478bd9Sstevel@tonic-gate 	count3 maxcount;
4577c478bd9Sstevel@tonic-gate };
4587c478bd9Sstevel@tonic-gate typedef struct nfslog_READDIRPLUS3args nfslog_READDIRPLUS3args;
4597c478bd9Sstevel@tonic-gate 
4607c478bd9Sstevel@tonic-gate struct nfslog_entryplus3 {
4617c478bd9Sstevel@tonic-gate 	post_op_fh3 name_handle;
4627c478bd9Sstevel@tonic-gate 	char *name;
4637c478bd9Sstevel@tonic-gate 	struct nfslog_entryplus3 *nextentry;
4647c478bd9Sstevel@tonic-gate };
4657c478bd9Sstevel@tonic-gate typedef struct nfslog_entryplus3 nfslog_entryplus3;
4667c478bd9Sstevel@tonic-gate 
4677c478bd9Sstevel@tonic-gate struct nfslog_dirlistplus3 {
4687c478bd9Sstevel@tonic-gate 	nfslog_entryplus3 *entries;
4697c478bd9Sstevel@tonic-gate 	bool_t eof;
4707c478bd9Sstevel@tonic-gate };
4717c478bd9Sstevel@tonic-gate typedef struct nfslog_dirlistplus3 nfslog_dirlistplus3;
4727c478bd9Sstevel@tonic-gate 
4737c478bd9Sstevel@tonic-gate struct nfslog_READDIRPLUS3resok {
4747c478bd9Sstevel@tonic-gate 	nfslog_dirlistplus3 reply;
4757c478bd9Sstevel@tonic-gate };
4767c478bd9Sstevel@tonic-gate typedef struct nfslog_READDIRPLUS3resok nfslog_READDIRPLUS3resok;
4777c478bd9Sstevel@tonic-gate 
4787c478bd9Sstevel@tonic-gate struct nfslog_READDIRPLUS3res {
4797c478bd9Sstevel@tonic-gate 	nfsstat3 status;
4807c478bd9Sstevel@tonic-gate 	union {
4817c478bd9Sstevel@tonic-gate 		nfslog_READDIRPLUS3resok ok;
4827c478bd9Sstevel@tonic-gate 	} nfslog_READDIRPLUS3res_u;
4837c478bd9Sstevel@tonic-gate };
4847c478bd9Sstevel@tonic-gate typedef struct nfslog_READDIRPLUS3res nfslog_READDIRPLUS3res;
4857c478bd9Sstevel@tonic-gate 
4867c478bd9Sstevel@tonic-gate struct nfslog_COMMIT3args {
4877c478bd9Sstevel@tonic-gate 	nfs_fh3 file;
4887c478bd9Sstevel@tonic-gate 	offset3 offset;
4897c478bd9Sstevel@tonic-gate 	count3 count;
4907c478bd9Sstevel@tonic-gate };
4917c478bd9Sstevel@tonic-gate typedef struct nfslog_COMMIT3args nfslog_COMMIT3args;
4927c478bd9Sstevel@tonic-gate 
4937c478bd9Sstevel@tonic-gate /* the xdr functions */
4947c478bd9Sstevel@tonic-gate #ifndef _KERNEL
4957c478bd9Sstevel@tonic-gate 
4967c478bd9Sstevel@tonic-gate extern bool_t xdr_nfsstat(XDR *, nfsstat *);
4977c478bd9Sstevel@tonic-gate extern bool_t xdr_uint64(XDR *, uint64 *);
4987c478bd9Sstevel@tonic-gate extern bool_t xdr_uint32(XDR *, uint32 *);
4997c478bd9Sstevel@tonic-gate extern bool_t xdr_fhandle(XDR *, fhandle_t *);
5007c478bd9Sstevel@tonic-gate extern bool_t xdr_nfs_fh3(XDR *, nfs_fh3 *);
5017c478bd9Sstevel@tonic-gate extern bool_t xdr_nfsstat3(XDR *, nfsstat3 *);
5027c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_buffer_header(XDR *, nfslog_buffer_header *);
5037c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_request_record(XDR *, nfslog_request_record *);
5047c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_sharefsargs(XDR *, nfslog_sharefsargs *);
5057c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_sharefsres(XDR *, nfslog_sharefsres *);
5067c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_getfhargs(XDR *, nfslog_getfhargs *);
5077c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_diropargs(XDR *, nfslog_diropargs *);
5087c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_diropres(XDR *, nfslog_diropres *);
5097c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_nfsreadargs(XDR *, nfslog_nfsreadargs *);
5107c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rdresult(XDR *, nfslog_rdresult *);
5117c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_writeargs(XDR *, nfslog_writeargs *);
5127c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_writeresult(XDR *, nfslog_writeresult *);
5137c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_createargs(XDR *, nfslog_createargs *);
5147c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_setattrargs(XDR *, nfslog_setattrargs *);
5157c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rdlnres(XDR *, nfslog_rdlnres *);
5167c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rnmargs(XDR *, nfslog_rnmargs *);
5177c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_linkargs(XDR *, nfslog_linkargs *);
5187c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_symlinkargs(XDR *, nfslog_symlinkargs *);
5197c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rddirargs(XDR *, nfslog_rddirargs *);
5207c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rddirres(XDR *, nfslog_rddirres *);
5217c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_diropargs3(XDR *, nfslog_diropargs3 *);
5227c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_LOOKUP3res(XDR *, nfslog_LOOKUP3res *);
5237c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_CREATE3args(XDR *, nfslog_CREATE3args *);
5247c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_CREATE3res(XDR *, nfslog_CREATE3res *);
5257c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_SETATTR3args(XDR *, nfslog_SETATTR3args *);
5267c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READLINK3res(XDR *, nfslog_READLINK3res *);
5277c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READ3args(XDR *, nfslog_READ3args *);
5287c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READ3res(XDR *, nfslog_READ3res *);
5297c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_WRITE3args(XDR *, nfslog_WRITE3args *);
5307c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_WRITE3res(XDR *, nfslog_WRITE3res *);
5317c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_MKDIR3args(XDR *, nfslog_MKDIR3args *);
5327c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_MKDIR3res(XDR *, nfslog_MKDIR3res *);
5337c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_SYMLINK3args(XDR *, nfslog_SYMLINK3args *);
5347c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_SYMLINK3res(XDR *, nfslog_SYMLINK3res *);
5357c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_MKNOD3args(XDR *, nfslog_MKNOD3args *);
5367c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_MKNOD3res(XDR *, nfslog_MKNOD3res *);
5377c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_REMOVE3args(XDR *, nfslog_REMOVE3args *);
5387c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_RMDIR3args(XDR *, nfslog_RMDIR3args *);
5397c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_RENAME3args(XDR *, nfslog_RENAME3args *);
5407c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_LINK3args(XDR *, nfslog_LINK3args *);
5417c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READDIRPLUS3args(XDR *, nfslog_READDIRPLUS3args *);
5427c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READDIRPLUS3res(XDR *, nfslog_READDIRPLUS3res *);
5437c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_COMMIT3args(XDR *, nfslog_COMMIT3args *);
5447c478bd9Sstevel@tonic-gate 
5457c478bd9Sstevel@tonic-gate #else /* !_KERNEL */
5467c478bd9Sstevel@tonic-gate 
5477c478bd9Sstevel@tonic-gate extern bool_t xdr_nfsstat(XDR *, nfsstat *);
5487c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_nfsreadargs(XDR *, nfslog_nfsreadargs *);
5497c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_sharefsres(XDR *, nfslog_sharefsres *);
5507c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_sharefsargs(XDR *, struct exportinfo *);
5517c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_getfhargs(XDR *, nfslog_getfhargs *);
5527c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_diropargs(XDR *, struct nfsdiropargs *);
5537c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_drok(XDR *, struct nfsdrok *);
5547c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_diropres(XDR *, struct nfsdiropres *);
5557c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_getattrres(XDR *, struct nfsattrstat *);
5567c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rrok(XDR *, struct nfsrrok *);
5577c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rdresult(XDR *, struct nfsrdresult *);
5587c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_writeargs(XDR *, struct nfswriteargs *);
5597c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_writeresult(XDR *, struct nfsattrstat *);
5607c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_createargs(XDR *, struct nfscreatargs *);
5617c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_sattr(XDR *, struct nfssattr *);
5627c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_setattrargs(XDR *, struct nfssaargs *);
5637c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rdlnres(XDR *, struct nfsrdlnres *);
5647c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rnmargs(XDR *, struct nfsrnmargs *);
5657c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_symlinkargs(XDR *, struct nfsslargs *);
5667c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_statfs(XDR *, struct nfsstatfs *);
5677c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_linkargs(XDR *, struct nfslinkargs *);
5687c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rddirargs(XDR *, struct nfsrddirargs *);
5697c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rdok(XDR *, struct nfsrdok *);
5707c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rddirres(XDR *, struct nfsrddirres *);
5717c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_diropargs3(XDR *, diropargs3 *);
5727c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_LOOKUP3res(XDR *, LOOKUP3res *);
5737c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_createhow3(XDR *, createhow3 *);
5747c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_CREATE3args(XDR *, CREATE3args *);
5757c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_CREATE3resok(XDR *, CREATE3resok *);
5767c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_CREATE3res(XDR *, CREATE3res *);
5777c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_GETATTR3res(XDR *, GETATTR3res *);
5787c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_ACCESS3args(XDR *, ACCESS3args *);
5797c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_ACCESS3res(XDR *, ACCESS3res *);
5807c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_SETATTR3args(XDR *, SETATTR3args *);
5817c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_SETATTR3res(XDR *, SETATTR3res *);
5827c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READLINK3res(XDR *, READLINK3res *);
5837c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READ3args(XDR *, READ3args *);
5847c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READ3resok(XDR *, READ3resok *);
5857c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READ3res(XDR *, READ3res *);
5867c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READ3resok(XDR *, READ3resok *);
5877c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READ3res(XDR *, READ3res *);
5887c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_WRITE3args(XDR *, WRITE3args *);
5897c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_WRITE3resok(XDR *, WRITE3resok *);
5907c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_WRITE3res(XDR *, WRITE3res *);
5917c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_MKDIR3args(XDR *, MKDIR3args *);
5927c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_MKDIR3res(XDR *, MKDIR3res *);
5937c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_SYMLINK3args(XDR *, SYMLINK3args *);
5947c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_SYMLINK3res(XDR *, SYMLINK3res *);
5957c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_MKNOD3args(XDR *, MKNOD3args *);
5967c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_MKNOD3res(XDR *, MKNOD3res *);
5977c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_REMOVE3args(XDR *, REMOVE3args *);
5987c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_REMOVE3res(XDR *, REMOVE3res *);
5997c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_RMDIR3args(XDR *, RMDIR3args *);
6007c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_RMDIR3res(XDR *, RMDIR3res *);
6017c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_RENAME3args(XDR *, RENAME3args *);
6027c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_RENAME3res(XDR *, RENAME3res *);
6037c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_LINK3args(XDR *, LINK3args *);
6047c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_LINK3res(XDR *, LINK3res *);
6057c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READDIR3args(XDR *, READDIR3args *);
6067c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READDIR3res(XDR *, READDIR3res *);
6077c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_FSSTAT3args(XDR *, FSSTAT3args *);
6087c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_FSSTAT3res(XDR *, FSSTAT3res *);
6097c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_FSINFO3args(XDR *, FSINFO3args *);
6107c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_FSINFO3res(XDR *, FSINFO3res *);
6117c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_PATHCONF3args(XDR *, PATHCONF3args *);
6127c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_PATHCONF3res(XDR *, PATHCONF3res *);
6137c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_COMMIT3args(XDR *, COMMIT3args *);
6147c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_COMMIT3res(XDR *, COMMIT3res *);
6157c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READDIRPLUS3args(XDR *, READDIRPLUS3args *);
6167c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READDIRPLUS3res(XDR *, READDIRPLUS3res *);
6177c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_request_record(XDR *,	struct exportinfo *,
6187c478bd9Sstevel@tonic-gate 			struct svc_req *, cred_t *, struct netbuf *,
6197c478bd9Sstevel@tonic-gate 			unsigned int, unsigned int);
6207c478bd9Sstevel@tonic-gate 
6217c478bd9Sstevel@tonic-gate 
6227c478bd9Sstevel@tonic-gate #endif /* !_KERNEL */
6237c478bd9Sstevel@tonic-gate 
6247c478bd9Sstevel@tonic-gate #ifdef _KERNEL
6257c478bd9Sstevel@tonic-gate 
6267c478bd9Sstevel@tonic-gate /*
6277c478bd9Sstevel@tonic-gate  * Used to direct nfslog_write_record() on its behavior of
6287c478bd9Sstevel@tonic-gate  * writing log entries
6297c478bd9Sstevel@tonic-gate  */
6307c478bd9Sstevel@tonic-gate #define	NFSLOG_ALL_BUFFERS	1
6317c478bd9Sstevel@tonic-gate #define	NFSLOG_ONE_BUFFER	2
6327c478bd9Sstevel@tonic-gate 
6337c478bd9Sstevel@tonic-gate /* Sizes of the various memory allocations for encoding records */
6347c478bd9Sstevel@tonic-gate #define	NFSLOG_SMALL_RECORD_SIZE 512
6357c478bd9Sstevel@tonic-gate #define	NFSLOG_SMALL_REC_NAME	"nfslog_small_rec"
6367c478bd9Sstevel@tonic-gate #define	NFSLOG_MEDIUM_RECORD_SIZE 8192
6377c478bd9Sstevel@tonic-gate #define	NFSLOG_MEDIUM_REC_NAME	"nfslog_medium_rec"
6387c478bd9Sstevel@tonic-gate #define	NFSLOG_LARGE_RECORD_SIZE 32768
6397c478bd9Sstevel@tonic-gate #define	NFSLOG_LARGE_REC_NAME	"nfslog_large_rec"
6407c478bd9Sstevel@tonic-gate 
6417c478bd9Sstevel@tonic-gate /*
6427c478bd9Sstevel@tonic-gate  * Functions used for interaction with nfs logging
6437c478bd9Sstevel@tonic-gate  */
6447c478bd9Sstevel@tonic-gate extern bool_t	xdr_nfslog_buffer_header(XDR *, nfslog_buffer_header *);
6457c478bd9Sstevel@tonic-gate 
6467c478bd9Sstevel@tonic-gate extern void	nfslog_share_record(struct exportinfo *exi, cred_t *cr);
6477c478bd9Sstevel@tonic-gate extern void	nfslog_unshare_record(struct exportinfo *exi, cred_t *cr);
6487c478bd9Sstevel@tonic-gate extern void	nfslog_getfh(struct exportinfo *, fhandle *, char *,
6497c478bd9Sstevel@tonic-gate 		enum uio_seg, cred_t *);
6507c478bd9Sstevel@tonic-gate 
6517c478bd9Sstevel@tonic-gate extern void	nfslog_init();
6527c478bd9Sstevel@tonic-gate extern int	nfslog_setup(struct exportinfo *);
6537c478bd9Sstevel@tonic-gate extern void	nfslog_disable(struct exportinfo *);
6547c478bd9Sstevel@tonic-gate /*PRINTFLIKE2*/
6557c478bd9Sstevel@tonic-gate extern void	nfslog_dprint(const int, const char *fmt, ...)
6567c478bd9Sstevel@tonic-gate 	__KPRINTFLIKE(2);
6577c478bd9Sstevel@tonic-gate extern void	*nfslog_record_alloc(struct exportinfo *, int,
6587c478bd9Sstevel@tonic-gate 		void **, int);
6597c478bd9Sstevel@tonic-gate extern void	nfslog_record_free(void *, void *, size_t);
660*0dfe541eSEvan Layton extern struct	exportinfo *nfslog_get_exi(nfs_export_t *, struct exportinfo *,
6617c478bd9Sstevel@tonic-gate 		struct svc_req *, caddr_t, unsigned int *);
6627c478bd9Sstevel@tonic-gate extern void	nfslog_write_record(struct exportinfo *, struct svc_req *,
6637c478bd9Sstevel@tonic-gate 		caddr_t, caddr_t, cred_t *, struct netbuf *, unsigned int,
6647c478bd9Sstevel@tonic-gate 		unsigned int);
6657c478bd9Sstevel@tonic-gate 
6667c478bd9Sstevel@tonic-gate extern struct log_buffer *nfslog_buffer_list;
6677c478bd9Sstevel@tonic-gate 
6687c478bd9Sstevel@tonic-gate /*
6697c478bd9Sstevel@tonic-gate  * Logging debug macro; expands to nothing for non-debug kernels.
6707c478bd9Sstevel@tonic-gate  */
6717c478bd9Sstevel@tonic-gate #ifndef DEBUG
6727c478bd9Sstevel@tonic-gate #define	LOGGING_DPRINT(x)
6737c478bd9Sstevel@tonic-gate #else
6747c478bd9Sstevel@tonic-gate #define	LOGGING_DPRINT(x)	nfslog_dprint x
6757c478bd9Sstevel@tonic-gate #endif
6767c478bd9Sstevel@tonic-gate 
6777c478bd9Sstevel@tonic-gate #endif
6787c478bd9Sstevel@tonic-gate 
6797c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
6807c478bd9Sstevel@tonic-gate }
6817c478bd9Sstevel@tonic-gate #endif
6827c478bd9Sstevel@tonic-gate 
6837c478bd9Sstevel@tonic-gate #endif	/* _NFS_LOG_H */
684