1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate #ifndef _NFS_LOG_H 28*7c478bd9Sstevel@tonic-gate #define _NFS_LOG_H 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*7c478bd9Sstevel@tonic-gate 32*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 33*7c478bd9Sstevel@tonic-gate extern "C" { 34*7c478bd9Sstevel@tonic-gate #endif 35*7c478bd9Sstevel@tonic-gate 36*7c478bd9Sstevel@tonic-gate #include <nfs/nfs.h> 37*7c478bd9Sstevel@tonic-gate #include <nfs/export.h> 38*7c478bd9Sstevel@tonic-gate #include <rpc/rpc.h> 39*7c478bd9Sstevel@tonic-gate 40*7c478bd9Sstevel@tonic-gate #define LOG_MODE 0600 /* open log with these permissions */ 41*7c478bd9Sstevel@tonic-gate #define LOG_INPROG_STRING "_log_in_process" 42*7c478bd9Sstevel@tonic-gate 43*7c478bd9Sstevel@tonic-gate /* 44*7c478bd9Sstevel@tonic-gate * Definition of dummy program for logging special non-nfs reqs 45*7c478bd9Sstevel@tonic-gate */ 46*7c478bd9Sstevel@tonic-gate #define NFSLOG_PROGRAM ((rpcprog_t)42) 47*7c478bd9Sstevel@tonic-gate #define NFSLOG_VERSION ((rpcvers_t)1) 48*7c478bd9Sstevel@tonic-gate 49*7c478bd9Sstevel@tonic-gate #define NFSLOG_VERSMIN ((rpcvers_t)1) 50*7c478bd9Sstevel@tonic-gate #define NFSLOG_VERSMAX ((rpcvers_t)1) 51*7c478bd9Sstevel@tonic-gate 52*7c478bd9Sstevel@tonic-gate #define NFSLOG_NULL ((rpcproc_t)0) 53*7c478bd9Sstevel@tonic-gate #define NFSLOG_SHARE ((rpcproc_t)1) 54*7c478bd9Sstevel@tonic-gate #define NFSLOG_UNSHARE ((rpcproc_t)2) 55*7c478bd9Sstevel@tonic-gate #define NFSLOG_LOOKUP ((rpcproc_t)3) 56*7c478bd9Sstevel@tonic-gate #define NFSLOG_GETFH ((rpcproc_t)4) 57*7c478bd9Sstevel@tonic-gate 58*7c478bd9Sstevel@tonic-gate /* 59*7c478bd9Sstevel@tonic-gate * Version of the on disk log file 60*7c478bd9Sstevel@tonic-gate */ 61*7c478bd9Sstevel@tonic-gate #define NFSLOG_BUF_VERSION ((rpcvers_t)2) 62*7c478bd9Sstevel@tonic-gate 63*7c478bd9Sstevel@tonic-gate #define NFSLOG_BUF_VERSMIN ((rpcvers_t)1) 64*7c478bd9Sstevel@tonic-gate #define NFSLOG_BUF_VERSMAX ((rpcvers_t)2) 65*7c478bd9Sstevel@tonic-gate /* 66*7c478bd9Sstevel@tonic-gate * Contents of the on disk log file header 67*7c478bd9Sstevel@tonic-gate * 68*7c478bd9Sstevel@tonic-gate * Note: This is the structure for older version 1 buffers, and does not 69*7c478bd9Sstevel@tonic-gate * adequately support large buffer files, as the offset is 32 bit. Newer 70*7c478bd9Sstevel@tonic-gate * buffer files are written using version 2 buffer header (below) which 71*7c478bd9Sstevel@tonic-gate * has a 64 bit offset. However, because existing buffers continue to use 72*7c478bd9Sstevel@tonic-gate * the old header format, the daemon xdr code can read and write either format. 73*7c478bd9Sstevel@tonic-gate * This definition below is not explicitely used anywhere in the code, 74*7c478bd9Sstevel@tonic-gate * but is implicitely used by the daemon xdr code. For that reason, it 75*7c478bd9Sstevel@tonic-gate * is kept here for information purpose only. 76*7c478bd9Sstevel@tonic-gate */ 77*7c478bd9Sstevel@tonic-gate struct nfslog_buffer_header_1 { 78*7c478bd9Sstevel@tonic-gate uint32_t bh_length; /* Length of this header */ 79*7c478bd9Sstevel@tonic-gate uint32_t bh_version; /* Version of buffer contents */ 80*7c478bd9Sstevel@tonic-gate uint32_t bh_flags; /* Optional flags field */ 81*7c478bd9Sstevel@tonic-gate uint32_t bh_offset; /* offset within file to begin */ 82*7c478bd9Sstevel@tonic-gate timestruc32_t bh_timestamp; /* When the buffer was created */ 83*7c478bd9Sstevel@tonic-gate }; 84*7c478bd9Sstevel@tonic-gate typedef struct nfslog_buffer_header_1 nfslog_buffer_header_1; 85*7c478bd9Sstevel@tonic-gate 86*7c478bd9Sstevel@tonic-gate /* 87*7c478bd9Sstevel@tonic-gate * For the current version 2, which supports largefiles 88*7c478bd9Sstevel@tonic-gate */ 89*7c478bd9Sstevel@tonic-gate struct nfslog_buffer_header_2 { 90*7c478bd9Sstevel@tonic-gate uint32_t bh_length; /* Length of this header */ 91*7c478bd9Sstevel@tonic-gate rpcvers_t bh_version; /* Version of buffer contents */ 92*7c478bd9Sstevel@tonic-gate u_offset_t bh_offset; /* offset within file to begin */ 93*7c478bd9Sstevel@tonic-gate uint32_t bh_flags; /* Optional flags field */ 94*7c478bd9Sstevel@tonic-gate timestruc32_t bh_timestamp; /* When the buffer was created */ 95*7c478bd9Sstevel@tonic-gate }; 96*7c478bd9Sstevel@tonic-gate typedef struct nfslog_buffer_header_2 nfslog_buffer_header_2; 97*7c478bd9Sstevel@tonic-gate 98*7c478bd9Sstevel@tonic-gate typedef struct nfslog_buffer_header_2 nfslog_buffer_header; 99*7c478bd9Sstevel@tonic-gate 100*7c478bd9Sstevel@tonic-gate /* bh_flags values */ 101*7c478bd9Sstevel@tonic-gate #define NFSLOG_BH_OFFSET_OVERFLOW 1 /* version 1 bh_offset */ 102*7c478bd9Sstevel@tonic-gate 103*7c478bd9Sstevel@tonic-gate /* 104*7c478bd9Sstevel@tonic-gate * For each record written to the log file, this struct is used 105*7c478bd9Sstevel@tonic-gate * as the logical header; it will be XDR encoded to be written to the file. 106*7c478bd9Sstevel@tonic-gate * 107*7c478bd9Sstevel@tonic-gate * Note: if the buffer file becomes large enough, the rh_rec_id may 108*7c478bd9Sstevel@tonic-gate * wrap around. This situation is appropriately handled by the daemon however. 109*7c478bd9Sstevel@tonic-gate */ 110*7c478bd9Sstevel@tonic-gate struct nfslog_record_header { 111*7c478bd9Sstevel@tonic-gate uint32_t rh_reclen; /* Length of entire record */ 112*7c478bd9Sstevel@tonic-gate uint32_t rh_rec_id; /* unique id for this log */ 113*7c478bd9Sstevel@tonic-gate rpcprog_t rh_prognum; /* Program number */ 114*7c478bd9Sstevel@tonic-gate rpcproc_t rh_procnum; /* Procedure number */ 115*7c478bd9Sstevel@tonic-gate rpcvers_t rh_version; /* Version number */ 116*7c478bd9Sstevel@tonic-gate uint32_t rh_auth_flavor; /* Auth flavor of RPC request */ 117*7c478bd9Sstevel@tonic-gate timestruc32_t rh_timestamp; /* time stamp of the request */ 118*7c478bd9Sstevel@tonic-gate uid_t rh_uid; /* uid of requestor as per RPC */ 119*7c478bd9Sstevel@tonic-gate gid_t rh_gid; /* gid of requestor as per RPC */ 120*7c478bd9Sstevel@tonic-gate }; 121*7c478bd9Sstevel@tonic-gate typedef struct nfslog_record_header nfslog_record_header; 122*7c478bd9Sstevel@tonic-gate 123*7c478bd9Sstevel@tonic-gate /* 124*7c478bd9Sstevel@tonic-gate * For each record written to the log file, this is the logical 125*7c478bd9Sstevel@tonic-gate * structure of the record; it will be XDR encoded and written to 126*7c478bd9Sstevel@tonic-gate * the file. 127*7c478bd9Sstevel@tonic-gate */ 128*7c478bd9Sstevel@tonic-gate struct nfslog_request_record { 129*7c478bd9Sstevel@tonic-gate nfslog_record_header re_header; /* Header as defined above */ 130*7c478bd9Sstevel@tonic-gate char *re_principal_name; /* Principal name of caller */ 131*7c478bd9Sstevel@tonic-gate char *re_netid; /* Netid used for request */ 132*7c478bd9Sstevel@tonic-gate char *re_tag; /* Log buffer tag for file system */ 133*7c478bd9Sstevel@tonic-gate struct netbuf re_ipaddr; /* Requestors ip address */ 134*7c478bd9Sstevel@tonic-gate caddr_t re_rpc_arg; /* RPC arguments and response */ 135*7c478bd9Sstevel@tonic-gate caddr_t re_rpc_res; 136*7c478bd9Sstevel@tonic-gate }; 137*7c478bd9Sstevel@tonic-gate typedef struct nfslog_request_record nfslog_request_record; 138*7c478bd9Sstevel@tonic-gate 139*7c478bd9Sstevel@tonic-gate /* 140*7c478bd9Sstevel@tonic-gate * From this point forward, the definitions represent the arguments 141*7c478bd9Sstevel@tonic-gate * and results of each possible RPC that can be logged. These 142*7c478bd9Sstevel@tonic-gate * may have been trimmed in content from the real RPC arguments 143*7c478bd9Sstevel@tonic-gate * and results to save space. 144*7c478bd9Sstevel@tonic-gate */ 145*7c478bd9Sstevel@tonic-gate typedef fhandle_t fhandle; 146*7c478bd9Sstevel@tonic-gate 147*7c478bd9Sstevel@tonic-gate struct nfslog_sharefsargs { 148*7c478bd9Sstevel@tonic-gate int sh_flags; 149*7c478bd9Sstevel@tonic-gate uint32_t sh_anon; 150*7c478bd9Sstevel@tonic-gate char *sh_path; 151*7c478bd9Sstevel@tonic-gate fhandle sh_fh_buf; 152*7c478bd9Sstevel@tonic-gate }; 153*7c478bd9Sstevel@tonic-gate typedef struct nfslog_sharefsargs nfslog_sharefsargs; 154*7c478bd9Sstevel@tonic-gate 155*7c478bd9Sstevel@tonic-gate typedef nfsstat nfslog_sharefsres; 156*7c478bd9Sstevel@tonic-gate 157*7c478bd9Sstevel@tonic-gate struct nfslog_getfhargs { 158*7c478bd9Sstevel@tonic-gate fhandle gfh_fh_buf; 159*7c478bd9Sstevel@tonic-gate char *gfh_path; 160*7c478bd9Sstevel@tonic-gate }; 161*7c478bd9Sstevel@tonic-gate typedef struct nfslog_getfhargs nfslog_getfhargs; 162*7c478bd9Sstevel@tonic-gate 163*7c478bd9Sstevel@tonic-gate struct nfslog_diropargs { 164*7c478bd9Sstevel@tonic-gate fhandle da_fhandle; 165*7c478bd9Sstevel@tonic-gate char *da_name; 166*7c478bd9Sstevel@tonic-gate }; 167*7c478bd9Sstevel@tonic-gate typedef struct nfslog_diropargs nfslog_diropargs; 168*7c478bd9Sstevel@tonic-gate 169*7c478bd9Sstevel@tonic-gate struct nfslog_drok { 170*7c478bd9Sstevel@tonic-gate fhandle drok_fhandle; 171*7c478bd9Sstevel@tonic-gate }; 172*7c478bd9Sstevel@tonic-gate typedef struct nfslog_drok nfslog_drok; 173*7c478bd9Sstevel@tonic-gate 174*7c478bd9Sstevel@tonic-gate struct nfslog_diropres { 175*7c478bd9Sstevel@tonic-gate nfsstat dr_status; 176*7c478bd9Sstevel@tonic-gate union { 177*7c478bd9Sstevel@tonic-gate nfslog_drok dr_ok; 178*7c478bd9Sstevel@tonic-gate } nfslog_diropres_u; 179*7c478bd9Sstevel@tonic-gate }; 180*7c478bd9Sstevel@tonic-gate typedef struct nfslog_diropres nfslog_diropres; 181*7c478bd9Sstevel@tonic-gate 182*7c478bd9Sstevel@tonic-gate typedef struct nfsreadargs nfslog_nfsreadargs; 183*7c478bd9Sstevel@tonic-gate 184*7c478bd9Sstevel@tonic-gate struct nfslog_rrok { 185*7c478bd9Sstevel@tonic-gate uint32_t filesize; 186*7c478bd9Sstevel@tonic-gate uint32_t rrok_count; 187*7c478bd9Sstevel@tonic-gate }; 188*7c478bd9Sstevel@tonic-gate typedef struct nfslog_rrok nfslog_rrok; 189*7c478bd9Sstevel@tonic-gate 190*7c478bd9Sstevel@tonic-gate struct nfslog_rdresult { 191*7c478bd9Sstevel@tonic-gate nfsstat r_status; 192*7c478bd9Sstevel@tonic-gate union { 193*7c478bd9Sstevel@tonic-gate nfslog_rrok r_ok; 194*7c478bd9Sstevel@tonic-gate } nfslog_rdresult_u; 195*7c478bd9Sstevel@tonic-gate }; 196*7c478bd9Sstevel@tonic-gate typedef struct nfslog_rdresult nfslog_rdresult; 197*7c478bd9Sstevel@tonic-gate 198*7c478bd9Sstevel@tonic-gate struct nfslog_writeargs { 199*7c478bd9Sstevel@tonic-gate fhandle waargs_fhandle; 200*7c478bd9Sstevel@tonic-gate uint32_t waargs_begoff; 201*7c478bd9Sstevel@tonic-gate uint32_t waargs_offset; 202*7c478bd9Sstevel@tonic-gate uint32_t waargs_totcount; 203*7c478bd9Sstevel@tonic-gate uint32_t waargs_count; 204*7c478bd9Sstevel@tonic-gate }; 205*7c478bd9Sstevel@tonic-gate typedef struct nfslog_writeargs nfslog_writeargs; 206*7c478bd9Sstevel@tonic-gate 207*7c478bd9Sstevel@tonic-gate struct nfslog_writeresult { 208*7c478bd9Sstevel@tonic-gate nfsstat wr_status; 209*7c478bd9Sstevel@tonic-gate union { 210*7c478bd9Sstevel@tonic-gate uint32_t wr_size; 211*7c478bd9Sstevel@tonic-gate } nfslog_writeresult_u; 212*7c478bd9Sstevel@tonic-gate }; 213*7c478bd9Sstevel@tonic-gate typedef struct nfslog_writeresult nfslog_writeresult; 214*7c478bd9Sstevel@tonic-gate 215*7c478bd9Sstevel@tonic-gate struct nfslog_sattr { 216*7c478bd9Sstevel@tonic-gate uint32_t sa_mode; 217*7c478bd9Sstevel@tonic-gate uint32_t sa_uid; 218*7c478bd9Sstevel@tonic-gate uint32_t sa_gid; 219*7c478bd9Sstevel@tonic-gate uint32_t sa_size; 220*7c478bd9Sstevel@tonic-gate nfs2_timeval sa_atime; 221*7c478bd9Sstevel@tonic-gate nfs2_timeval sa_mtime; 222*7c478bd9Sstevel@tonic-gate }; 223*7c478bd9Sstevel@tonic-gate typedef struct nfslog_sattr nfslog_sattr; 224*7c478bd9Sstevel@tonic-gate 225*7c478bd9Sstevel@tonic-gate struct nfslog_createargs { 226*7c478bd9Sstevel@tonic-gate nfslog_sattr ca_sa; 227*7c478bd9Sstevel@tonic-gate nfslog_diropargs ca_da; 228*7c478bd9Sstevel@tonic-gate }; 229*7c478bd9Sstevel@tonic-gate typedef struct nfslog_createargs nfslog_createargs; 230*7c478bd9Sstevel@tonic-gate 231*7c478bd9Sstevel@tonic-gate struct nfslog_setattrargs { 232*7c478bd9Sstevel@tonic-gate fhandle saa_fh; 233*7c478bd9Sstevel@tonic-gate nfslog_sattr saa_sa; 234*7c478bd9Sstevel@tonic-gate }; 235*7c478bd9Sstevel@tonic-gate typedef struct nfslog_setattrargs nfslog_setattrargs; 236*7c478bd9Sstevel@tonic-gate 237*7c478bd9Sstevel@tonic-gate struct nfslog_rdlnres { 238*7c478bd9Sstevel@tonic-gate nfsstat rl_status; 239*7c478bd9Sstevel@tonic-gate union { 240*7c478bd9Sstevel@tonic-gate char *rl_ok; 241*7c478bd9Sstevel@tonic-gate } nfslog_rdlnres_u; 242*7c478bd9Sstevel@tonic-gate }; 243*7c478bd9Sstevel@tonic-gate typedef struct nfslog_rdlnres nfslog_rdlnres; 244*7c478bd9Sstevel@tonic-gate 245*7c478bd9Sstevel@tonic-gate struct nfslog_rnmargs { 246*7c478bd9Sstevel@tonic-gate nfslog_diropargs rna_from; 247*7c478bd9Sstevel@tonic-gate nfslog_diropargs rna_to; 248*7c478bd9Sstevel@tonic-gate }; 249*7c478bd9Sstevel@tonic-gate typedef struct nfslog_rnmargs nfslog_rnmargs; 250*7c478bd9Sstevel@tonic-gate 251*7c478bd9Sstevel@tonic-gate struct nfslog_linkargs { 252*7c478bd9Sstevel@tonic-gate fhandle la_from; 253*7c478bd9Sstevel@tonic-gate nfslog_diropargs la_to; 254*7c478bd9Sstevel@tonic-gate }; 255*7c478bd9Sstevel@tonic-gate typedef struct nfslog_linkargs nfslog_linkargs; 256*7c478bd9Sstevel@tonic-gate 257*7c478bd9Sstevel@tonic-gate struct nfslog_symlinkargs { 258*7c478bd9Sstevel@tonic-gate nfslog_diropargs sla_from; 259*7c478bd9Sstevel@tonic-gate char *sla_tnm; 260*7c478bd9Sstevel@tonic-gate nfslog_sattr sla_sa; 261*7c478bd9Sstevel@tonic-gate }; 262*7c478bd9Sstevel@tonic-gate typedef struct nfslog_symlinkargs nfslog_symlinkargs; 263*7c478bd9Sstevel@tonic-gate 264*7c478bd9Sstevel@tonic-gate struct nfslog_rddirargs { 265*7c478bd9Sstevel@tonic-gate fhandle rda_fh; 266*7c478bd9Sstevel@tonic-gate uint32_t rda_offset; 267*7c478bd9Sstevel@tonic-gate uint32_t rda_count; 268*7c478bd9Sstevel@tonic-gate }; 269*7c478bd9Sstevel@tonic-gate typedef struct nfslog_rddirargs nfslog_rddirargs; 270*7c478bd9Sstevel@tonic-gate 271*7c478bd9Sstevel@tonic-gate struct nfslog_rdok { 272*7c478bd9Sstevel@tonic-gate uint32_t rdok_offset; 273*7c478bd9Sstevel@tonic-gate uint32_t rdok_size; 274*7c478bd9Sstevel@tonic-gate bool_t rdok_eof; 275*7c478bd9Sstevel@tonic-gate }; 276*7c478bd9Sstevel@tonic-gate typedef struct nfslog_rdok nfslog_rdok; 277*7c478bd9Sstevel@tonic-gate 278*7c478bd9Sstevel@tonic-gate struct nfslog_rddirres { 279*7c478bd9Sstevel@tonic-gate nfsstat rd_status; 280*7c478bd9Sstevel@tonic-gate union { 281*7c478bd9Sstevel@tonic-gate nfslog_rdok rd_ok; 282*7c478bd9Sstevel@tonic-gate } nfslog_rddirres_u; 283*7c478bd9Sstevel@tonic-gate }; 284*7c478bd9Sstevel@tonic-gate typedef struct nfslog_rddirres nfslog_rddirres; 285*7c478bd9Sstevel@tonic-gate 286*7c478bd9Sstevel@tonic-gate struct nfslog_diropargs3 { 287*7c478bd9Sstevel@tonic-gate nfs_fh3 dir; 288*7c478bd9Sstevel@tonic-gate char *name; 289*7c478bd9Sstevel@tonic-gate }; 290*7c478bd9Sstevel@tonic-gate typedef struct nfslog_diropargs3 nfslog_diropargs3; 291*7c478bd9Sstevel@tonic-gate 292*7c478bd9Sstevel@tonic-gate struct nfslog_LOOKUP3res { 293*7c478bd9Sstevel@tonic-gate nfsstat3 status; 294*7c478bd9Sstevel@tonic-gate union { 295*7c478bd9Sstevel@tonic-gate nfs_fh3 object; 296*7c478bd9Sstevel@tonic-gate } nfslog_LOOKUP3res_u; 297*7c478bd9Sstevel@tonic-gate }; 298*7c478bd9Sstevel@tonic-gate typedef struct nfslog_LOOKUP3res nfslog_LOOKUP3res; 299*7c478bd9Sstevel@tonic-gate 300*7c478bd9Sstevel@tonic-gate struct nfslog_createhow3 { 301*7c478bd9Sstevel@tonic-gate createmode3 mode; 302*7c478bd9Sstevel@tonic-gate union { 303*7c478bd9Sstevel@tonic-gate set_size3 size; 304*7c478bd9Sstevel@tonic-gate } nfslog_createhow3_u; 305*7c478bd9Sstevel@tonic-gate }; 306*7c478bd9Sstevel@tonic-gate typedef struct nfslog_createhow3 nfslog_createhow3; 307*7c478bd9Sstevel@tonic-gate 308*7c478bd9Sstevel@tonic-gate struct nfslog_CREATE3args { 309*7c478bd9Sstevel@tonic-gate nfslog_diropargs3 where; 310*7c478bd9Sstevel@tonic-gate nfslog_createhow3 how; 311*7c478bd9Sstevel@tonic-gate }; 312*7c478bd9Sstevel@tonic-gate typedef struct nfslog_CREATE3args nfslog_CREATE3args; 313*7c478bd9Sstevel@tonic-gate 314*7c478bd9Sstevel@tonic-gate struct nfslog_CREATE3resok { 315*7c478bd9Sstevel@tonic-gate post_op_fh3 obj; 316*7c478bd9Sstevel@tonic-gate }; 317*7c478bd9Sstevel@tonic-gate typedef struct nfslog_CREATE3resok nfslog_CREATE3resok; 318*7c478bd9Sstevel@tonic-gate 319*7c478bd9Sstevel@tonic-gate struct nfslog_CREATE3res { 320*7c478bd9Sstevel@tonic-gate nfsstat3 status; 321*7c478bd9Sstevel@tonic-gate union { 322*7c478bd9Sstevel@tonic-gate nfslog_CREATE3resok ok; 323*7c478bd9Sstevel@tonic-gate } nfslog_CREATE3res_u; 324*7c478bd9Sstevel@tonic-gate }; 325*7c478bd9Sstevel@tonic-gate typedef struct nfslog_CREATE3res nfslog_CREATE3res; 326*7c478bd9Sstevel@tonic-gate 327*7c478bd9Sstevel@tonic-gate struct nfslog_SETATTR3args { 328*7c478bd9Sstevel@tonic-gate nfs_fh3 object; 329*7c478bd9Sstevel@tonic-gate set_size3 size; 330*7c478bd9Sstevel@tonic-gate }; 331*7c478bd9Sstevel@tonic-gate typedef struct nfslog_SETATTR3args nfslog_SETATTR3args; 332*7c478bd9Sstevel@tonic-gate 333*7c478bd9Sstevel@tonic-gate struct nfslog_READLINK3res { 334*7c478bd9Sstevel@tonic-gate nfsstat3 status; 335*7c478bd9Sstevel@tonic-gate union { 336*7c478bd9Sstevel@tonic-gate char *data; 337*7c478bd9Sstevel@tonic-gate } nfslog_READLINK3res_u; 338*7c478bd9Sstevel@tonic-gate }; 339*7c478bd9Sstevel@tonic-gate typedef struct nfslog_READLINK3res nfslog_READLINK3res; 340*7c478bd9Sstevel@tonic-gate 341*7c478bd9Sstevel@tonic-gate struct nfslog_READ3args { 342*7c478bd9Sstevel@tonic-gate nfs_fh3 file; 343*7c478bd9Sstevel@tonic-gate offset3 offset; 344*7c478bd9Sstevel@tonic-gate count3 count; 345*7c478bd9Sstevel@tonic-gate }; 346*7c478bd9Sstevel@tonic-gate typedef struct nfslog_READ3args nfslog_READ3args; 347*7c478bd9Sstevel@tonic-gate 348*7c478bd9Sstevel@tonic-gate struct nfslog_READ3resok { 349*7c478bd9Sstevel@tonic-gate size3 filesize; 350*7c478bd9Sstevel@tonic-gate count3 count; 351*7c478bd9Sstevel@tonic-gate bool_t eof; 352*7c478bd9Sstevel@tonic-gate uint32_t size; 353*7c478bd9Sstevel@tonic-gate }; 354*7c478bd9Sstevel@tonic-gate typedef struct nfslog_READ3resok nfslog_READ3resok; 355*7c478bd9Sstevel@tonic-gate 356*7c478bd9Sstevel@tonic-gate struct nfslog_READ3res { 357*7c478bd9Sstevel@tonic-gate nfsstat3 status; 358*7c478bd9Sstevel@tonic-gate union { 359*7c478bd9Sstevel@tonic-gate nfslog_READ3resok ok; 360*7c478bd9Sstevel@tonic-gate } nfslog_READ3res_u; 361*7c478bd9Sstevel@tonic-gate }; 362*7c478bd9Sstevel@tonic-gate typedef struct nfslog_READ3res nfslog_READ3res; 363*7c478bd9Sstevel@tonic-gate 364*7c478bd9Sstevel@tonic-gate struct nfslog_WRITE3args { 365*7c478bd9Sstevel@tonic-gate nfs_fh3 file; 366*7c478bd9Sstevel@tonic-gate offset3 offset; 367*7c478bd9Sstevel@tonic-gate count3 count; 368*7c478bd9Sstevel@tonic-gate stable_how stable; 369*7c478bd9Sstevel@tonic-gate }; 370*7c478bd9Sstevel@tonic-gate typedef struct nfslog_WRITE3args nfslog_WRITE3args; 371*7c478bd9Sstevel@tonic-gate 372*7c478bd9Sstevel@tonic-gate struct nfslog_WRITE3resok { 373*7c478bd9Sstevel@tonic-gate size3 filesize; 374*7c478bd9Sstevel@tonic-gate count3 count; 375*7c478bd9Sstevel@tonic-gate stable_how committed; 376*7c478bd9Sstevel@tonic-gate }; 377*7c478bd9Sstevel@tonic-gate typedef struct nfslog_WRITE3resok nfslog_WRITE3resok; 378*7c478bd9Sstevel@tonic-gate 379*7c478bd9Sstevel@tonic-gate struct nfslog_WRITE3res { 380*7c478bd9Sstevel@tonic-gate nfsstat3 status; 381*7c478bd9Sstevel@tonic-gate union { 382*7c478bd9Sstevel@tonic-gate nfslog_WRITE3resok ok; 383*7c478bd9Sstevel@tonic-gate } nfslog_WRITE3res_u; 384*7c478bd9Sstevel@tonic-gate }; 385*7c478bd9Sstevel@tonic-gate typedef struct nfslog_WRITE3res nfslog_WRITE3res; 386*7c478bd9Sstevel@tonic-gate 387*7c478bd9Sstevel@tonic-gate struct nfslog_MKDIR3args { 388*7c478bd9Sstevel@tonic-gate nfslog_diropargs3 where; 389*7c478bd9Sstevel@tonic-gate }; 390*7c478bd9Sstevel@tonic-gate typedef struct nfslog_MKDIR3args nfslog_MKDIR3args; 391*7c478bd9Sstevel@tonic-gate 392*7c478bd9Sstevel@tonic-gate struct nfslog_MKDIR3res { 393*7c478bd9Sstevel@tonic-gate nfsstat3 status; 394*7c478bd9Sstevel@tonic-gate union { 395*7c478bd9Sstevel@tonic-gate post_op_fh3 obj; 396*7c478bd9Sstevel@tonic-gate } nfslog_MKDIR3res_u; 397*7c478bd9Sstevel@tonic-gate }; 398*7c478bd9Sstevel@tonic-gate typedef struct nfslog_MKDIR3res nfslog_MKDIR3res; 399*7c478bd9Sstevel@tonic-gate 400*7c478bd9Sstevel@tonic-gate struct nfslog_SYMLINK3args { 401*7c478bd9Sstevel@tonic-gate nfslog_diropargs3 where; 402*7c478bd9Sstevel@tonic-gate char *symlink_data; 403*7c478bd9Sstevel@tonic-gate }; 404*7c478bd9Sstevel@tonic-gate typedef struct nfslog_SYMLINK3args nfslog_SYMLINK3args; 405*7c478bd9Sstevel@tonic-gate 406*7c478bd9Sstevel@tonic-gate struct nfslog_SYMLINK3res { 407*7c478bd9Sstevel@tonic-gate nfsstat3 status; 408*7c478bd9Sstevel@tonic-gate union { 409*7c478bd9Sstevel@tonic-gate post_op_fh3 obj; 410*7c478bd9Sstevel@tonic-gate } nfslog_SYMLINK3res_u; 411*7c478bd9Sstevel@tonic-gate }; 412*7c478bd9Sstevel@tonic-gate typedef struct nfslog_SYMLINK3res nfslog_SYMLINK3res; 413*7c478bd9Sstevel@tonic-gate 414*7c478bd9Sstevel@tonic-gate struct nfslog_MKNOD3args { 415*7c478bd9Sstevel@tonic-gate nfslog_diropargs3 where; 416*7c478bd9Sstevel@tonic-gate ftype3 type; 417*7c478bd9Sstevel@tonic-gate }; 418*7c478bd9Sstevel@tonic-gate typedef struct nfslog_MKNOD3args nfslog_MKNOD3args; 419*7c478bd9Sstevel@tonic-gate 420*7c478bd9Sstevel@tonic-gate struct nfslog_MKNOD3res { 421*7c478bd9Sstevel@tonic-gate nfsstat3 status; 422*7c478bd9Sstevel@tonic-gate union { 423*7c478bd9Sstevel@tonic-gate post_op_fh3 obj; 424*7c478bd9Sstevel@tonic-gate } nfslog_MKNOD3res_u; 425*7c478bd9Sstevel@tonic-gate }; 426*7c478bd9Sstevel@tonic-gate typedef struct nfslog_MKNOD3res nfslog_MKNOD3res; 427*7c478bd9Sstevel@tonic-gate 428*7c478bd9Sstevel@tonic-gate struct nfslog_REMOVE3args { 429*7c478bd9Sstevel@tonic-gate nfslog_diropargs3 object; 430*7c478bd9Sstevel@tonic-gate }; 431*7c478bd9Sstevel@tonic-gate typedef struct nfslog_REMOVE3args nfslog_REMOVE3args; 432*7c478bd9Sstevel@tonic-gate 433*7c478bd9Sstevel@tonic-gate struct nfslog_RMDIR3args { 434*7c478bd9Sstevel@tonic-gate nfslog_diropargs3 object; 435*7c478bd9Sstevel@tonic-gate }; 436*7c478bd9Sstevel@tonic-gate typedef struct nfslog_RMDIR3args nfslog_RMDIR3args; 437*7c478bd9Sstevel@tonic-gate 438*7c478bd9Sstevel@tonic-gate struct nfslog_RENAME3args { 439*7c478bd9Sstevel@tonic-gate nfslog_diropargs3 from; 440*7c478bd9Sstevel@tonic-gate nfslog_diropargs3 to; 441*7c478bd9Sstevel@tonic-gate }; 442*7c478bd9Sstevel@tonic-gate typedef struct nfslog_RENAME3args nfslog_RENAME3args; 443*7c478bd9Sstevel@tonic-gate 444*7c478bd9Sstevel@tonic-gate struct nfslog_LINK3args { 445*7c478bd9Sstevel@tonic-gate nfs_fh3 file; 446*7c478bd9Sstevel@tonic-gate nfslog_diropargs3 link; 447*7c478bd9Sstevel@tonic-gate }; 448*7c478bd9Sstevel@tonic-gate typedef struct nfslog_LINK3args nfslog_LINK3args; 449*7c478bd9Sstevel@tonic-gate 450*7c478bd9Sstevel@tonic-gate struct nfslog_READDIRPLUS3args { 451*7c478bd9Sstevel@tonic-gate nfs_fh3 dir; 452*7c478bd9Sstevel@tonic-gate count3 dircount; 453*7c478bd9Sstevel@tonic-gate count3 maxcount; 454*7c478bd9Sstevel@tonic-gate }; 455*7c478bd9Sstevel@tonic-gate typedef struct nfslog_READDIRPLUS3args nfslog_READDIRPLUS3args; 456*7c478bd9Sstevel@tonic-gate 457*7c478bd9Sstevel@tonic-gate struct nfslog_entryplus3 { 458*7c478bd9Sstevel@tonic-gate post_op_fh3 name_handle; 459*7c478bd9Sstevel@tonic-gate char *name; 460*7c478bd9Sstevel@tonic-gate struct nfslog_entryplus3 *nextentry; 461*7c478bd9Sstevel@tonic-gate }; 462*7c478bd9Sstevel@tonic-gate typedef struct nfslog_entryplus3 nfslog_entryplus3; 463*7c478bd9Sstevel@tonic-gate 464*7c478bd9Sstevel@tonic-gate struct nfslog_dirlistplus3 { 465*7c478bd9Sstevel@tonic-gate nfslog_entryplus3 *entries; 466*7c478bd9Sstevel@tonic-gate bool_t eof; 467*7c478bd9Sstevel@tonic-gate }; 468*7c478bd9Sstevel@tonic-gate typedef struct nfslog_dirlistplus3 nfslog_dirlistplus3; 469*7c478bd9Sstevel@tonic-gate 470*7c478bd9Sstevel@tonic-gate struct nfslog_READDIRPLUS3resok { 471*7c478bd9Sstevel@tonic-gate nfslog_dirlistplus3 reply; 472*7c478bd9Sstevel@tonic-gate }; 473*7c478bd9Sstevel@tonic-gate typedef struct nfslog_READDIRPLUS3resok nfslog_READDIRPLUS3resok; 474*7c478bd9Sstevel@tonic-gate 475*7c478bd9Sstevel@tonic-gate struct nfslog_READDIRPLUS3res { 476*7c478bd9Sstevel@tonic-gate nfsstat3 status; 477*7c478bd9Sstevel@tonic-gate union { 478*7c478bd9Sstevel@tonic-gate nfslog_READDIRPLUS3resok ok; 479*7c478bd9Sstevel@tonic-gate } nfslog_READDIRPLUS3res_u; 480*7c478bd9Sstevel@tonic-gate }; 481*7c478bd9Sstevel@tonic-gate typedef struct nfslog_READDIRPLUS3res nfslog_READDIRPLUS3res; 482*7c478bd9Sstevel@tonic-gate 483*7c478bd9Sstevel@tonic-gate struct nfslog_COMMIT3args { 484*7c478bd9Sstevel@tonic-gate nfs_fh3 file; 485*7c478bd9Sstevel@tonic-gate offset3 offset; 486*7c478bd9Sstevel@tonic-gate count3 count; 487*7c478bd9Sstevel@tonic-gate }; 488*7c478bd9Sstevel@tonic-gate typedef struct nfslog_COMMIT3args nfslog_COMMIT3args; 489*7c478bd9Sstevel@tonic-gate 490*7c478bd9Sstevel@tonic-gate /* the xdr functions */ 491*7c478bd9Sstevel@tonic-gate #ifndef _KERNEL 492*7c478bd9Sstevel@tonic-gate 493*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfsstat(XDR *, nfsstat *); 494*7c478bd9Sstevel@tonic-gate extern bool_t xdr_uint64(XDR *, uint64 *); 495*7c478bd9Sstevel@tonic-gate extern bool_t xdr_uint32(XDR *, uint32 *); 496*7c478bd9Sstevel@tonic-gate extern bool_t xdr_fhandle(XDR *, fhandle_t *); 497*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfs_fh3(XDR *, nfs_fh3 *); 498*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfsstat3(XDR *, nfsstat3 *); 499*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_buffer_header(XDR *, nfslog_buffer_header *); 500*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_request_record(XDR *, nfslog_request_record *); 501*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_sharefsargs(XDR *, nfslog_sharefsargs *); 502*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_sharefsres(XDR *, nfslog_sharefsres *); 503*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_getfhargs(XDR *, nfslog_getfhargs *); 504*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_diropargs(XDR *, nfslog_diropargs *); 505*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_diropres(XDR *, nfslog_diropres *); 506*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_nfsreadargs(XDR *, nfslog_nfsreadargs *); 507*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rdresult(XDR *, nfslog_rdresult *); 508*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_writeargs(XDR *, nfslog_writeargs *); 509*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_writeresult(XDR *, nfslog_writeresult *); 510*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_createargs(XDR *, nfslog_createargs *); 511*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_setattrargs(XDR *, nfslog_setattrargs *); 512*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rdlnres(XDR *, nfslog_rdlnres *); 513*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rnmargs(XDR *, nfslog_rnmargs *); 514*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_linkargs(XDR *, nfslog_linkargs *); 515*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_symlinkargs(XDR *, nfslog_symlinkargs *); 516*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rddirargs(XDR *, nfslog_rddirargs *); 517*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rddirres(XDR *, nfslog_rddirres *); 518*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_diropargs3(XDR *, nfslog_diropargs3 *); 519*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_LOOKUP3res(XDR *, nfslog_LOOKUP3res *); 520*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_CREATE3args(XDR *, nfslog_CREATE3args *); 521*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_CREATE3res(XDR *, nfslog_CREATE3res *); 522*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_SETATTR3args(XDR *, nfslog_SETATTR3args *); 523*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READLINK3res(XDR *, nfslog_READLINK3res *); 524*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READ3args(XDR *, nfslog_READ3args *); 525*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READ3res(XDR *, nfslog_READ3res *); 526*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_WRITE3args(XDR *, nfslog_WRITE3args *); 527*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_WRITE3res(XDR *, nfslog_WRITE3res *); 528*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_MKDIR3args(XDR *, nfslog_MKDIR3args *); 529*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_MKDIR3res(XDR *, nfslog_MKDIR3res *); 530*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_SYMLINK3args(XDR *, nfslog_SYMLINK3args *); 531*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_SYMLINK3res(XDR *, nfslog_SYMLINK3res *); 532*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_MKNOD3args(XDR *, nfslog_MKNOD3args *); 533*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_MKNOD3res(XDR *, nfslog_MKNOD3res *); 534*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_REMOVE3args(XDR *, nfslog_REMOVE3args *); 535*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_RMDIR3args(XDR *, nfslog_RMDIR3args *); 536*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_RENAME3args(XDR *, nfslog_RENAME3args *); 537*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_LINK3args(XDR *, nfslog_LINK3args *); 538*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READDIRPLUS3args(XDR *, nfslog_READDIRPLUS3args *); 539*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READDIRPLUS3res(XDR *, nfslog_READDIRPLUS3res *); 540*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_COMMIT3args(XDR *, nfslog_COMMIT3args *); 541*7c478bd9Sstevel@tonic-gate 542*7c478bd9Sstevel@tonic-gate #else /* !_KERNEL */ 543*7c478bd9Sstevel@tonic-gate 544*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfsstat(XDR *, nfsstat *); 545*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_nfsreadargs(XDR *, nfslog_nfsreadargs *); 546*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_sharefsres(XDR *, nfslog_sharefsres *); 547*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_sharefsargs(XDR *, struct exportinfo *); 548*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_getfhargs(XDR *, nfslog_getfhargs *); 549*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_diropargs(XDR *, struct nfsdiropargs *); 550*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_drok(XDR *, struct nfsdrok *); 551*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_diropres(XDR *, struct nfsdiropres *); 552*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_getattrres(XDR *, struct nfsattrstat *); 553*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rrok(XDR *, struct nfsrrok *); 554*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rdresult(XDR *, struct nfsrdresult *); 555*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_writeargs(XDR *, struct nfswriteargs *); 556*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_writeresult(XDR *, struct nfsattrstat *); 557*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_createargs(XDR *, struct nfscreatargs *); 558*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_sattr(XDR *, struct nfssattr *); 559*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_setattrargs(XDR *, struct nfssaargs *); 560*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rdlnres(XDR *, struct nfsrdlnres *); 561*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rnmargs(XDR *, struct nfsrnmargs *); 562*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_symlinkargs(XDR *, struct nfsslargs *); 563*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_statfs(XDR *, struct nfsstatfs *); 564*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_linkargs(XDR *, struct nfslinkargs *); 565*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rddirargs(XDR *, struct nfsrddirargs *); 566*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rdok(XDR *, struct nfsrdok *); 567*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_rddirres(XDR *, struct nfsrddirres *); 568*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_diropargs3(XDR *, diropargs3 *); 569*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_LOOKUP3res(XDR *, LOOKUP3res *); 570*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_createhow3(XDR *, createhow3 *); 571*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_CREATE3args(XDR *, CREATE3args *); 572*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_CREATE3resok(XDR *, CREATE3resok *); 573*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_CREATE3res(XDR *, CREATE3res *); 574*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_GETATTR3res(XDR *, GETATTR3res *); 575*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_ACCESS3args(XDR *, ACCESS3args *); 576*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_ACCESS3res(XDR *, ACCESS3res *); 577*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_SETATTR3args(XDR *, SETATTR3args *); 578*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_SETATTR3res(XDR *, SETATTR3res *); 579*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READLINK3res(XDR *, READLINK3res *); 580*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READ3args(XDR *, READ3args *); 581*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READ3resok(XDR *, READ3resok *); 582*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READ3res(XDR *, READ3res *); 583*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READ3resok(XDR *, READ3resok *); 584*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READ3res(XDR *, READ3res *); 585*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_WRITE3args(XDR *, WRITE3args *); 586*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_WRITE3resok(XDR *, WRITE3resok *); 587*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_WRITE3res(XDR *, WRITE3res *); 588*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_MKDIR3args(XDR *, MKDIR3args *); 589*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_MKDIR3res(XDR *, MKDIR3res *); 590*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_SYMLINK3args(XDR *, SYMLINK3args *); 591*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_SYMLINK3res(XDR *, SYMLINK3res *); 592*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_MKNOD3args(XDR *, MKNOD3args *); 593*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_MKNOD3res(XDR *, MKNOD3res *); 594*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_REMOVE3args(XDR *, REMOVE3args *); 595*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_REMOVE3res(XDR *, REMOVE3res *); 596*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_RMDIR3args(XDR *, RMDIR3args *); 597*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_RMDIR3res(XDR *, RMDIR3res *); 598*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_RENAME3args(XDR *, RENAME3args *); 599*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_RENAME3res(XDR *, RENAME3res *); 600*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_LINK3args(XDR *, LINK3args *); 601*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_LINK3res(XDR *, LINK3res *); 602*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READDIR3args(XDR *, READDIR3args *); 603*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READDIR3res(XDR *, READDIR3res *); 604*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_FSSTAT3args(XDR *, FSSTAT3args *); 605*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_FSSTAT3res(XDR *, FSSTAT3res *); 606*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_FSINFO3args(XDR *, FSINFO3args *); 607*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_FSINFO3res(XDR *, FSINFO3res *); 608*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_PATHCONF3args(XDR *, PATHCONF3args *); 609*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_PATHCONF3res(XDR *, PATHCONF3res *); 610*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_COMMIT3args(XDR *, COMMIT3args *); 611*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_COMMIT3res(XDR *, COMMIT3res *); 612*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READDIRPLUS3args(XDR *, READDIRPLUS3args *); 613*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_READDIRPLUS3res(XDR *, READDIRPLUS3res *); 614*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_request_record(XDR *, struct exportinfo *, 615*7c478bd9Sstevel@tonic-gate struct svc_req *, cred_t *, struct netbuf *, 616*7c478bd9Sstevel@tonic-gate unsigned int, unsigned int); 617*7c478bd9Sstevel@tonic-gate 618*7c478bd9Sstevel@tonic-gate 619*7c478bd9Sstevel@tonic-gate #endif /* !_KERNEL */ 620*7c478bd9Sstevel@tonic-gate 621*7c478bd9Sstevel@tonic-gate #ifdef _KERNEL 622*7c478bd9Sstevel@tonic-gate 623*7c478bd9Sstevel@tonic-gate /* 624*7c478bd9Sstevel@tonic-gate * Used to direct nfslog_write_record() on its behavior of 625*7c478bd9Sstevel@tonic-gate * writing log entries 626*7c478bd9Sstevel@tonic-gate */ 627*7c478bd9Sstevel@tonic-gate #define NFSLOG_ALL_BUFFERS 1 628*7c478bd9Sstevel@tonic-gate #define NFSLOG_ONE_BUFFER 2 629*7c478bd9Sstevel@tonic-gate 630*7c478bd9Sstevel@tonic-gate /* Sizes of the various memory allocations for encoding records */ 631*7c478bd9Sstevel@tonic-gate #define NFSLOG_SMALL_RECORD_SIZE 512 632*7c478bd9Sstevel@tonic-gate #define NFSLOG_SMALL_REC_NAME "nfslog_small_rec" 633*7c478bd9Sstevel@tonic-gate #define NFSLOG_MEDIUM_RECORD_SIZE 8192 634*7c478bd9Sstevel@tonic-gate #define NFSLOG_MEDIUM_REC_NAME "nfslog_medium_rec" 635*7c478bd9Sstevel@tonic-gate #define NFSLOG_LARGE_RECORD_SIZE 32768 636*7c478bd9Sstevel@tonic-gate #define NFSLOG_LARGE_REC_NAME "nfslog_large_rec" 637*7c478bd9Sstevel@tonic-gate 638*7c478bd9Sstevel@tonic-gate /* 639*7c478bd9Sstevel@tonic-gate * Functions used for interaction with nfs logging 640*7c478bd9Sstevel@tonic-gate */ 641*7c478bd9Sstevel@tonic-gate extern bool_t xdr_nfslog_buffer_header(XDR *, nfslog_buffer_header *); 642*7c478bd9Sstevel@tonic-gate 643*7c478bd9Sstevel@tonic-gate extern void nfslog_share_record(struct exportinfo *exi, cred_t *cr); 644*7c478bd9Sstevel@tonic-gate extern void nfslog_unshare_record(struct exportinfo *exi, cred_t *cr); 645*7c478bd9Sstevel@tonic-gate extern void nfslog_getfh(struct exportinfo *, fhandle *, char *, 646*7c478bd9Sstevel@tonic-gate enum uio_seg, cred_t *); 647*7c478bd9Sstevel@tonic-gate 648*7c478bd9Sstevel@tonic-gate extern void nfslog_init(); 649*7c478bd9Sstevel@tonic-gate extern int nfslog_setup(struct exportinfo *); 650*7c478bd9Sstevel@tonic-gate extern void nfslog_disable(struct exportinfo *); 651*7c478bd9Sstevel@tonic-gate /*PRINTFLIKE2*/ 652*7c478bd9Sstevel@tonic-gate extern void nfslog_dprint(const int, const char *fmt, ...) 653*7c478bd9Sstevel@tonic-gate __KPRINTFLIKE(2); 654*7c478bd9Sstevel@tonic-gate extern void *nfslog_record_alloc(struct exportinfo *, int, 655*7c478bd9Sstevel@tonic-gate void **, int); 656*7c478bd9Sstevel@tonic-gate extern void nfslog_record_free(void *, void *, size_t); 657*7c478bd9Sstevel@tonic-gate extern struct exportinfo *nfslog_get_exi(struct exportinfo *, 658*7c478bd9Sstevel@tonic-gate struct svc_req *, caddr_t, unsigned int *); 659*7c478bd9Sstevel@tonic-gate extern void nfslog_write_record(struct exportinfo *, struct svc_req *, 660*7c478bd9Sstevel@tonic-gate caddr_t, caddr_t, cred_t *, struct netbuf *, unsigned int, 661*7c478bd9Sstevel@tonic-gate unsigned int); 662*7c478bd9Sstevel@tonic-gate 663*7c478bd9Sstevel@tonic-gate extern struct log_buffer *nfslog_buffer_list; 664*7c478bd9Sstevel@tonic-gate 665*7c478bd9Sstevel@tonic-gate /* 666*7c478bd9Sstevel@tonic-gate * Logging debug macro; expands to nothing for non-debug kernels. 667*7c478bd9Sstevel@tonic-gate */ 668*7c478bd9Sstevel@tonic-gate #ifndef DEBUG 669*7c478bd9Sstevel@tonic-gate #define LOGGING_DPRINT(x) 670*7c478bd9Sstevel@tonic-gate #else 671*7c478bd9Sstevel@tonic-gate #define LOGGING_DPRINT(x) nfslog_dprint x 672*7c478bd9Sstevel@tonic-gate #endif 673*7c478bd9Sstevel@tonic-gate 674*7c478bd9Sstevel@tonic-gate #endif 675*7c478bd9Sstevel@tonic-gate 676*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 677*7c478bd9Sstevel@tonic-gate } 678*7c478bd9Sstevel@tonic-gate #endif 679*7c478bd9Sstevel@tonic-gate 680*7c478bd9Sstevel@tonic-gate #endif /* _NFS_LOG_H */ 681