4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
37 #include <nfs/export.h>
40 #define LOG_MODE 0600 /* open log with these permissions */
41 #define LOG_INPROG_STRING "_log_in_process"
44 * Definition of dummy program for logging special non-nfs reqs
46 #define NFSLOG_PROGRAM ((rpcprog_t)42)
47 #define NFSLOG_VERSION ((rpcvers_t)1)
49 #define NFSLOG_VERSMIN ((rpcvers_t)1)
50 #define NFSLOG_VERSMAX ((rpcvers_t)1)
52 #define NFSLOG_NULL ((rpcproc_t)0)
53 #define NFSLOG_SHARE ((rpcproc_t)1)
54 #define NFSLOG_UNSHARE ((rpcproc_t)2)
55 #define NFSLOG_LOOKUP ((rpcproc_t)3)
56 #define NFSLOG_GETFH ((rpcproc_t)4)
59 * Version of the on disk log file
61 #define NFSLOG_BUF_VERSION ((rpcvers_t)2)
63 #define NFSLOG_BUF_VERSMIN ((rpcvers_t)1)
64 #define NFSLOG_BUF_VERSMAX ((rpcvers_t)2)
66 * Contents of the on disk log file header
68 * Note: This is the structure for older version 1 buffers, and does not
69 * adequately support large buffer files, as the offset is 32 bit. Newer
70 * buffer files are written using version 2 buffer header (below) which
71 * has a 64 bit offset. However, because existing buffers continue to use
72 * the old header format, the daemon xdr code can read and write either format.
73 * This definition below is not explicitely used anywhere in the code,
74 * but is implicitely used by the daemon xdr code. For that reason, it
75 * is kept here for information purpose only.
77 struct nfslog_buffer_header_1
{
78 uint32_t bh_length
; /* Length of this header */
79 uint32_t bh_version
; /* Version of buffer contents */
80 uint32_t bh_flags
; /* Optional flags field */
81 uint32_t bh_offset
; /* offset within file to begin */
82 timestruc32_t bh_timestamp
; /* When the buffer was created */
84 typedef struct nfslog_buffer_header_1 nfslog_buffer_header_1
;
87 * For the current version 2, which supports largefiles
89 struct nfslog_buffer_header_2
{
90 uint32_t bh_length
; /* Length of this header */
91 rpcvers_t bh_version
; /* Version of buffer contents */
92 u_offset_t bh_offset
; /* offset within file to begin */
93 uint32_t bh_flags
; /* Optional flags field */
94 timestruc32_t bh_timestamp
; /* When the buffer was created */
96 typedef struct nfslog_buffer_header_2 nfslog_buffer_header_2
;
98 typedef struct nfslog_buffer_header_2 nfslog_buffer_header
;
100 /* bh_flags values */
101 #define NFSLOG_BH_OFFSET_OVERFLOW 1 /* version 1 bh_offset */
104 * For each record written to the log file, this struct is used
105 * as the logical header; it will be XDR encoded to be written to the file.
107 * Note: if the buffer file becomes large enough, the rh_rec_id may
108 * wrap around. This situation is appropriately handled by the daemon however.
110 struct nfslog_record_header
{
111 uint32_t rh_reclen
; /* Length of entire record */
112 uint32_t rh_rec_id
; /* unique id for this log */
113 rpcprog_t rh_prognum
; /* Program number */
114 rpcproc_t rh_procnum
; /* Procedure number */
115 rpcvers_t rh_version
; /* Version number */
116 uint32_t rh_auth_flavor
; /* Auth flavor of RPC request */
117 timestruc32_t rh_timestamp
; /* time stamp of the request */
118 uid_t rh_uid
; /* uid of requestor as per RPC */
119 gid_t rh_gid
; /* gid of requestor as per RPC */
121 typedef struct nfslog_record_header nfslog_record_header
;
124 * For each record written to the log file, this is the logical
125 * structure of the record; it will be XDR encoded and written to
128 struct nfslog_request_record
{
129 nfslog_record_header re_header
; /* Header as defined above */
130 char *re_principal_name
; /* Principal name of caller */
131 char *re_netid
; /* Netid used for request */
132 char *re_tag
; /* Log buffer tag for file system */
133 struct netbuf re_ipaddr
; /* Requestors ip address */
134 caddr_t re_rpc_arg
; /* RPC arguments and response */
137 typedef struct nfslog_request_record nfslog_request_record
;
140 * From this point forward, the definitions represent the arguments
141 * and results of each possible RPC that can be logged. These
142 * may have been trimmed in content from the real RPC arguments
143 * and results to save space.
145 typedef fhandle_t fhandle
;
147 struct nfslog_sharefsargs
{
153 typedef struct nfslog_sharefsargs nfslog_sharefsargs
;
155 typedef nfsstat nfslog_sharefsres
;
157 struct nfslog_getfhargs
{
161 typedef struct nfslog_getfhargs nfslog_getfhargs
;
163 struct nfslog_diropargs
{
167 typedef struct nfslog_diropargs nfslog_diropargs
;
170 fhandle drok_fhandle
;
172 typedef struct nfslog_drok nfslog_drok
;
174 struct nfslog_diropres
{
180 typedef struct nfslog_diropres nfslog_diropres
;
182 typedef struct nfsreadargs nfslog_nfsreadargs
;
188 typedef struct nfslog_rrok nfslog_rrok
;
190 struct nfslog_rdresult
{
196 typedef struct nfslog_rdresult nfslog_rdresult
;
198 struct nfslog_writeargs
{
199 fhandle waargs_fhandle
;
200 uint32_t waargs_begoff
;
201 uint32_t waargs_offset
;
202 uint32_t waargs_totcount
;
203 uint32_t waargs_count
;
205 typedef struct nfslog_writeargs nfslog_writeargs
;
207 struct nfslog_writeresult
{
211 } nfslog_writeresult_u
;
213 typedef struct nfslog_writeresult nfslog_writeresult
;
215 struct nfslog_sattr
{
220 nfs2_timeval sa_atime
;
221 nfs2_timeval sa_mtime
;
223 typedef struct nfslog_sattr nfslog_sattr
;
225 struct nfslog_createargs
{
227 nfslog_diropargs ca_da
;
229 typedef struct nfslog_createargs nfslog_createargs
;
231 struct nfslog_setattrargs
{
235 typedef struct nfslog_setattrargs nfslog_setattrargs
;
237 struct nfslog_rdlnres
{
243 typedef struct nfslog_rdlnres nfslog_rdlnres
;
245 struct nfslog_rnmargs
{
246 nfslog_diropargs rna_from
;
247 nfslog_diropargs rna_to
;
249 typedef struct nfslog_rnmargs nfslog_rnmargs
;
251 struct nfslog_linkargs
{
253 nfslog_diropargs la_to
;
255 typedef struct nfslog_linkargs nfslog_linkargs
;
257 struct nfslog_symlinkargs
{
258 nfslog_diropargs sla_from
;
262 typedef struct nfslog_symlinkargs nfslog_symlinkargs
;
264 struct nfslog_rddirargs
{
269 typedef struct nfslog_rddirargs nfslog_rddirargs
;
272 uint32_t rdok_offset
;
276 typedef struct nfslog_rdok nfslog_rdok
;
278 struct nfslog_rddirres
{
284 typedef struct nfslog_rddirres nfslog_rddirres
;
286 struct nfslog_diropargs3
{
290 typedef struct nfslog_diropargs3 nfslog_diropargs3
;
292 struct nfslog_LOOKUP3res
{
296 } nfslog_LOOKUP3res_u
;
298 typedef struct nfslog_LOOKUP3res nfslog_LOOKUP3res
;
300 struct nfslog_createhow3
{
304 } nfslog_createhow3_u
;
306 typedef struct nfslog_createhow3 nfslog_createhow3
;
308 struct nfslog_CREATE3args
{
309 nfslog_diropargs3 where
;
310 nfslog_createhow3 how
;
312 typedef struct nfslog_CREATE3args nfslog_CREATE3args
;
314 struct nfslog_CREATE3resok
{
317 typedef struct nfslog_CREATE3resok nfslog_CREATE3resok
;
319 struct nfslog_CREATE3res
{
322 nfslog_CREATE3resok ok
;
323 } nfslog_CREATE3res_u
;
325 typedef struct nfslog_CREATE3res nfslog_CREATE3res
;
327 struct nfslog_SETATTR3args
{
331 typedef struct nfslog_SETATTR3args nfslog_SETATTR3args
;
333 struct nfslog_READLINK3res
{
337 } nfslog_READLINK3res_u
;
339 typedef struct nfslog_READLINK3res nfslog_READLINK3res
;
341 struct nfslog_READ3args
{
346 typedef struct nfslog_READ3args nfslog_READ3args
;
348 struct nfslog_READ3resok
{
354 typedef struct nfslog_READ3resok nfslog_READ3resok
;
356 struct nfslog_READ3res
{
359 nfslog_READ3resok ok
;
362 typedef struct nfslog_READ3res nfslog_READ3res
;
364 struct nfslog_WRITE3args
{
370 typedef struct nfslog_WRITE3args nfslog_WRITE3args
;
372 struct nfslog_WRITE3resok
{
375 stable_how committed
;
377 typedef struct nfslog_WRITE3resok nfslog_WRITE3resok
;
379 struct nfslog_WRITE3res
{
382 nfslog_WRITE3resok ok
;
383 } nfslog_WRITE3res_u
;
385 typedef struct nfslog_WRITE3res nfslog_WRITE3res
;
387 struct nfslog_MKDIR3args
{
388 nfslog_diropargs3 where
;
390 typedef struct nfslog_MKDIR3args nfslog_MKDIR3args
;
392 struct nfslog_MKDIR3res
{
396 } nfslog_MKDIR3res_u
;
398 typedef struct nfslog_MKDIR3res nfslog_MKDIR3res
;
400 struct nfslog_SYMLINK3args
{
401 nfslog_diropargs3 where
;
404 typedef struct nfslog_SYMLINK3args nfslog_SYMLINK3args
;
406 struct nfslog_SYMLINK3res
{
410 } nfslog_SYMLINK3res_u
;
412 typedef struct nfslog_SYMLINK3res nfslog_SYMLINK3res
;
414 struct nfslog_MKNOD3args
{
415 nfslog_diropargs3 where
;
418 typedef struct nfslog_MKNOD3args nfslog_MKNOD3args
;
420 struct nfslog_MKNOD3res
{
424 } nfslog_MKNOD3res_u
;
426 typedef struct nfslog_MKNOD3res nfslog_MKNOD3res
;
428 struct nfslog_REMOVE3args
{
429 nfslog_diropargs3 object
;
431 typedef struct nfslog_REMOVE3args nfslog_REMOVE3args
;
433 struct nfslog_RMDIR3args
{
434 nfslog_diropargs3 object
;
436 typedef struct nfslog_RMDIR3args nfslog_RMDIR3args
;
438 struct nfslog_RENAME3args
{
439 nfslog_diropargs3 from
;
440 nfslog_diropargs3 to
;
442 typedef struct nfslog_RENAME3args nfslog_RENAME3args
;
444 struct nfslog_LINK3args
{
446 nfslog_diropargs3 link
;
448 typedef struct nfslog_LINK3args nfslog_LINK3args
;
450 struct nfslog_READDIRPLUS3args
{
455 typedef struct nfslog_READDIRPLUS3args nfslog_READDIRPLUS3args
;
457 struct nfslog_entryplus3
{
458 post_op_fh3 name_handle
;
460 struct nfslog_entryplus3
*nextentry
;
462 typedef struct nfslog_entryplus3 nfslog_entryplus3
;
464 struct nfslog_dirlistplus3
{
465 nfslog_entryplus3
*entries
;
468 typedef struct nfslog_dirlistplus3 nfslog_dirlistplus3
;
470 struct nfslog_READDIRPLUS3resok
{
471 nfslog_dirlistplus3 reply
;
473 typedef struct nfslog_READDIRPLUS3resok nfslog_READDIRPLUS3resok
;
475 struct nfslog_READDIRPLUS3res
{
478 nfslog_READDIRPLUS3resok ok
;
479 } nfslog_READDIRPLUS3res_u
;
481 typedef struct nfslog_READDIRPLUS3res nfslog_READDIRPLUS3res
;
483 struct nfslog_COMMIT3args
{
488 typedef struct nfslog_COMMIT3args nfslog_COMMIT3args
;
490 /* the xdr functions */
493 extern bool_t
xdr_nfsstat(XDR
*, nfsstat
*);
494 extern bool_t
xdr_uint64(XDR
*, uint64
*);
495 extern bool_t
xdr_uint32(XDR
*, uint32
*);
496 extern bool_t
xdr_fhandle(XDR
*, fhandle_t
*);
497 extern bool_t
xdr_nfs_fh3(XDR
*, nfs_fh3
*);
498 extern bool_t
xdr_nfsstat3(XDR
*, nfsstat3
*);
499 extern bool_t
xdr_nfslog_buffer_header(XDR
*, nfslog_buffer_header
*);
500 extern bool_t
xdr_nfslog_request_record(XDR
*, nfslog_request_record
*);
501 extern bool_t
xdr_nfslog_sharefsargs(XDR
*, nfslog_sharefsargs
*);
502 extern bool_t
xdr_nfslog_sharefsres(XDR
*, nfslog_sharefsres
*);
503 extern bool_t
xdr_nfslog_getfhargs(XDR
*, nfslog_getfhargs
*);
504 extern bool_t
xdr_nfslog_diropargs(XDR
*, nfslog_diropargs
*);
505 extern bool_t
xdr_nfslog_diropres(XDR
*, nfslog_diropres
*);
506 extern bool_t
xdr_nfslog_nfsreadargs(XDR
*, nfslog_nfsreadargs
*);
507 extern bool_t
xdr_nfslog_rdresult(XDR
*, nfslog_rdresult
*);
508 extern bool_t
xdr_nfslog_writeargs(XDR
*, nfslog_writeargs
*);
509 extern bool_t
xdr_nfslog_writeresult(XDR
*, nfslog_writeresult
*);
510 extern bool_t
xdr_nfslog_createargs(XDR
*, nfslog_createargs
*);
511 extern bool_t
xdr_nfslog_setattrargs(XDR
*, nfslog_setattrargs
*);
512 extern bool_t
xdr_nfslog_rdlnres(XDR
*, nfslog_rdlnres
*);
513 extern bool_t
xdr_nfslog_rnmargs(XDR
*, nfslog_rnmargs
*);
514 extern bool_t
xdr_nfslog_linkargs(XDR
*, nfslog_linkargs
*);
515 extern bool_t
xdr_nfslog_symlinkargs(XDR
*, nfslog_symlinkargs
*);
516 extern bool_t
xdr_nfslog_rddirargs(XDR
*, nfslog_rddirargs
*);
517 extern bool_t
xdr_nfslog_rddirres(XDR
*, nfslog_rddirres
*);
518 extern bool_t
xdr_nfslog_diropargs3(XDR
*, nfslog_diropargs3
*);
519 extern bool_t
xdr_nfslog_LOOKUP3res(XDR
*, nfslog_LOOKUP3res
*);
520 extern bool_t
xdr_nfslog_CREATE3args(XDR
*, nfslog_CREATE3args
*);
521 extern bool_t
xdr_nfslog_CREATE3res(XDR
*, nfslog_CREATE3res
*);
522 extern bool_t
xdr_nfslog_SETATTR3args(XDR
*, nfslog_SETATTR3args
*);
523 extern bool_t
xdr_nfslog_READLINK3res(XDR
*, nfslog_READLINK3res
*);
524 extern bool_t
xdr_nfslog_READ3args(XDR
*, nfslog_READ3args
*);
525 extern bool_t
xdr_nfslog_READ3res(XDR
*, nfslog_READ3res
*);
526 extern bool_t
xdr_nfslog_WRITE3args(XDR
*, nfslog_WRITE3args
*);
527 extern bool_t
xdr_nfslog_WRITE3res(XDR
*, nfslog_WRITE3res
*);
528 extern bool_t
xdr_nfslog_MKDIR3args(XDR
*, nfslog_MKDIR3args
*);
529 extern bool_t
xdr_nfslog_MKDIR3res(XDR
*, nfslog_MKDIR3res
*);
530 extern bool_t
xdr_nfslog_SYMLINK3args(XDR
*, nfslog_SYMLINK3args
*);
531 extern bool_t
xdr_nfslog_SYMLINK3res(XDR
*, nfslog_SYMLINK3res
*);
532 extern bool_t
xdr_nfslog_MKNOD3args(XDR
*, nfslog_MKNOD3args
*);
533 extern bool_t
xdr_nfslog_MKNOD3res(XDR
*, nfslog_MKNOD3res
*);
534 extern bool_t
xdr_nfslog_REMOVE3args(XDR
*, nfslog_REMOVE3args
*);
535 extern bool_t
xdr_nfslog_RMDIR3args(XDR
*, nfslog_RMDIR3args
*);
536 extern bool_t
xdr_nfslog_RENAME3args(XDR
*, nfslog_RENAME3args
*);
537 extern bool_t
xdr_nfslog_LINK3args(XDR
*, nfslog_LINK3args
*);
538 extern bool_t
xdr_nfslog_READDIRPLUS3args(XDR
*, nfslog_READDIRPLUS3args
*);
539 extern bool_t
xdr_nfslog_READDIRPLUS3res(XDR
*, nfslog_READDIRPLUS3res
*);
540 extern bool_t
xdr_nfslog_COMMIT3args(XDR
*, nfslog_COMMIT3args
*);
544 extern bool_t
xdr_nfsstat(XDR
*, nfsstat
*);
545 extern bool_t
xdr_nfslog_nfsreadargs(XDR
*, nfslog_nfsreadargs
*);
546 extern bool_t
xdr_nfslog_sharefsres(XDR
*, nfslog_sharefsres
*);
547 extern bool_t
xdr_nfslog_sharefsargs(XDR
*, struct exportinfo
*);
548 extern bool_t
xdr_nfslog_getfhargs(XDR
*, nfslog_getfhargs
*);
549 extern bool_t
xdr_nfslog_diropargs(XDR
*, struct nfsdiropargs
*);
550 extern bool_t
xdr_nfslog_drok(XDR
*, struct nfsdrok
*);
551 extern bool_t
xdr_nfslog_diropres(XDR
*, struct nfsdiropres
*);
552 extern bool_t
xdr_nfslog_getattrres(XDR
*, struct nfsattrstat
*);
553 extern bool_t
xdr_nfslog_rrok(XDR
*, struct nfsrrok
*);
554 extern bool_t
xdr_nfslog_rdresult(XDR
*, struct nfsrdresult
*);
555 extern bool_t
xdr_nfslog_writeargs(XDR
*, struct nfswriteargs
*);
556 extern bool_t
xdr_nfslog_writeresult(XDR
*, struct nfsattrstat
*);
557 extern bool_t
xdr_nfslog_createargs(XDR
*, struct nfscreatargs
*);
558 extern bool_t
xdr_nfslog_sattr(XDR
*, struct nfssattr
*);
559 extern bool_t
xdr_nfslog_setattrargs(XDR
*, struct nfssaargs
*);
560 extern bool_t
xdr_nfslog_rdlnres(XDR
*, struct nfsrdlnres
*);
561 extern bool_t
xdr_nfslog_rnmargs(XDR
*, struct nfsrnmargs
*);
562 extern bool_t
xdr_nfslog_symlinkargs(XDR
*, struct nfsslargs
*);
563 extern bool_t
xdr_nfslog_statfs(XDR
*, struct nfsstatfs
*);
564 extern bool_t
xdr_nfslog_linkargs(XDR
*, struct nfslinkargs
*);
565 extern bool_t
xdr_nfslog_rddirargs(XDR
*, struct nfsrddirargs
*);
566 extern bool_t
xdr_nfslog_rdok(XDR
*, struct nfsrdok
*);
567 extern bool_t
xdr_nfslog_rddirres(XDR
*, struct nfsrddirres
*);
568 extern bool_t
xdr_nfslog_diropargs3(XDR
*, diropargs3
*);
569 extern bool_t
xdr_nfslog_LOOKUP3res(XDR
*, LOOKUP3res
*);
570 extern bool_t
xdr_nfslog_createhow3(XDR
*, createhow3
*);
571 extern bool_t
xdr_nfslog_CREATE3args(XDR
*, CREATE3args
*);
572 extern bool_t
xdr_nfslog_CREATE3resok(XDR
*, CREATE3resok
*);
573 extern bool_t
xdr_nfslog_CREATE3res(XDR
*, CREATE3res
*);
574 extern bool_t
xdr_nfslog_GETATTR3res(XDR
*, GETATTR3res
*);
575 extern bool_t
xdr_nfslog_ACCESS3args(XDR
*, ACCESS3args
*);
576 extern bool_t
xdr_nfslog_ACCESS3res(XDR
*, ACCESS3res
*);
577 extern bool_t
xdr_nfslog_SETATTR3args(XDR
*, SETATTR3args
*);
578 extern bool_t
xdr_nfslog_SETATTR3res(XDR
*, SETATTR3res
*);
579 extern bool_t
xdr_nfslog_READLINK3res(XDR
*, READLINK3res
*);
580 extern bool_t
xdr_nfslog_READ3args(XDR
*, READ3args
*);
581 extern bool_t
xdr_nfslog_READ3resok(XDR
*, READ3resok
*);
582 extern bool_t
xdr_nfslog_READ3res(XDR
*, READ3res
*);
583 extern bool_t
xdr_nfslog_READ3resok(XDR
*, READ3resok
*);
584 extern bool_t
xdr_nfslog_READ3res(XDR
*, READ3res
*);
585 extern bool_t
xdr_nfslog_WRITE3args(XDR
*, WRITE3args
*);
586 extern bool_t
xdr_nfslog_WRITE3resok(XDR
*, WRITE3resok
*);
587 extern bool_t
xdr_nfslog_WRITE3res(XDR
*, WRITE3res
*);
588 extern bool_t
xdr_nfslog_MKDIR3args(XDR
*, MKDIR3args
*);
589 extern bool_t
xdr_nfslog_MKDIR3res(XDR
*, MKDIR3res
*);
590 extern bool_t
xdr_nfslog_SYMLINK3args(XDR
*, SYMLINK3args
*);
591 extern bool_t
xdr_nfslog_SYMLINK3res(XDR
*, SYMLINK3res
*);
592 extern bool_t
xdr_nfslog_MKNOD3args(XDR
*, MKNOD3args
*);
593 extern bool_t
xdr_nfslog_MKNOD3res(XDR
*, MKNOD3res
*);
594 extern bool_t
xdr_nfslog_REMOVE3args(XDR
*, REMOVE3args
*);
595 extern bool_t
xdr_nfslog_REMOVE3res(XDR
*, REMOVE3res
*);
596 extern bool_t
xdr_nfslog_RMDIR3args(XDR
*, RMDIR3args
*);
597 extern bool_t
xdr_nfslog_RMDIR3res(XDR
*, RMDIR3res
*);
598 extern bool_t
xdr_nfslog_RENAME3args(XDR
*, RENAME3args
*);
599 extern bool_t
xdr_nfslog_RENAME3res(XDR
*, RENAME3res
*);
600 extern bool_t
xdr_nfslog_LINK3args(XDR
*, LINK3args
*);
601 extern bool_t
xdr_nfslog_LINK3res(XDR
*, LINK3res
*);
602 extern bool_t
xdr_nfslog_READDIR3args(XDR
*, READDIR3args
*);
603 extern bool_t
xdr_nfslog_READDIR3res(XDR
*, READDIR3res
*);
604 extern bool_t
xdr_nfslog_FSSTAT3args(XDR
*, FSSTAT3args
*);
605 extern bool_t
xdr_nfslog_FSSTAT3res(XDR
*, FSSTAT3res
*);
606 extern bool_t
xdr_nfslog_FSINFO3args(XDR
*, FSINFO3args
*);
607 extern bool_t
xdr_nfslog_FSINFO3res(XDR
*, FSINFO3res
*);
608 extern bool_t
xdr_nfslog_PATHCONF3args(XDR
*, PATHCONF3args
*);
609 extern bool_t
xdr_nfslog_PATHCONF3res(XDR
*, PATHCONF3res
*);
610 extern bool_t
xdr_nfslog_COMMIT3args(XDR
*, COMMIT3args
*);
611 extern bool_t
xdr_nfslog_COMMIT3res(XDR
*, COMMIT3res
*);
612 extern bool_t
xdr_nfslog_READDIRPLUS3args(XDR
*, READDIRPLUS3args
*);
613 extern bool_t
xdr_nfslog_READDIRPLUS3res(XDR
*, READDIRPLUS3res
*);
614 extern bool_t
xdr_nfslog_request_record(XDR
*, struct exportinfo
*,
615 struct svc_req
*, cred_t
*, struct netbuf
*,
616 unsigned int, unsigned int);
619 #endif /* !_KERNEL */
624 * Used to direct nfslog_write_record() on its behavior of
625 * writing log entries
627 #define NFSLOG_ALL_BUFFERS 1
628 #define NFSLOG_ONE_BUFFER 2
630 /* Sizes of the various memory allocations for encoding records */
631 #define NFSLOG_SMALL_RECORD_SIZE 512
632 #define NFSLOG_SMALL_REC_NAME "nfslog_small_rec"
633 #define NFSLOG_MEDIUM_RECORD_SIZE 8192
634 #define NFSLOG_MEDIUM_REC_NAME "nfslog_medium_rec"
635 #define NFSLOG_LARGE_RECORD_SIZE 32768
636 #define NFSLOG_LARGE_REC_NAME "nfslog_large_rec"
639 * Functions used for interaction with nfs logging
641 extern bool_t
xdr_nfslog_buffer_header(XDR
*, nfslog_buffer_header
*);
643 extern void nfslog_share_record(struct exportinfo
*exi
, cred_t
*cr
);
644 extern void nfslog_unshare_record(struct exportinfo
*exi
, cred_t
*cr
);
645 extern void nfslog_getfh(struct exportinfo
*, fhandle
*, char *,
646 enum uio_seg
, cred_t
*);
648 extern void nfslog_init();
649 extern int nfslog_setup(struct exportinfo
*);
650 extern void nfslog_disable(struct exportinfo
*);
652 extern void nfslog_dprint(const int, const char *fmt
, ...)
654 extern void *nfslog_record_alloc(struct exportinfo
*, int,
656 extern void nfslog_record_free(void *, void *, size_t);
657 extern struct exportinfo
*nfslog_get_exi(struct exportinfo
*,
658 struct svc_req
*, caddr_t
, unsigned int *);
659 extern void nfslog_write_record(struct exportinfo
*, struct svc_req
*,
660 caddr_t
, caddr_t
, cred_t
*, struct netbuf
*, unsigned int,
663 extern struct log_buffer
*nfslog_buffer_list
;
666 * Logging debug macro; expands to nothing for non-debug kernels.
669 #define LOGGING_DPRINT(x)
671 #define LOGGING_DPRINT(x) nfslog_dprint x
680 #endif /* _NFS_LOG_H */