xref: /onnv-gate/usr/src/cmd/fs.d/nfs/lib/nfslog_config.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Copyright (c) 1999 by Sun Microsystems, Inc.
24*0Sstevel@tonic-gate  * All rights reserved.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate #ifndef _NFS_NFSLOG_CONFIG_H
28*0Sstevel@tonic-gate #define	_NFS_NFSLOG_CONFIG_H
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate /*
33*0Sstevel@tonic-gate  * Internal configuration file API for NFS logging.
34*0Sstevel@tonic-gate  *
35*0Sstevel@tonic-gate  * Warning: This code is likely to change drastically in future releases.
36*0Sstevel@tonic-gate  */
37*0Sstevel@tonic-gate 
38*0Sstevel@tonic-gate #ifdef __cplusplus
39*0Sstevel@tonic-gate extern "C" {
40*0Sstevel@tonic-gate #endif
41*0Sstevel@tonic-gate 
42*0Sstevel@tonic-gate #ifndef LINTHAPPY
43*0Sstevel@tonic-gate #define	LINTHAPPY
44*0Sstevel@tonic-gate #endif
45*0Sstevel@tonic-gate 
46*0Sstevel@tonic-gate #define	MAX_LINESZ		4096
47*0Sstevel@tonic-gate 
48*0Sstevel@tonic-gate #define	NFSL_CONFIG_FILE_PATH	"/etc/nfs/nfslog.conf"
49*0Sstevel@tonic-gate #define	DEFAULTTAG		"global"
50*0Sstevel@tonic-gate #define	DEFAULTRAWTAG		"global-raw"
51*0Sstevel@tonic-gate #define	DEFAULTDIR		"/var/nfs"
52*0Sstevel@tonic-gate #define	BUFFERPATH		"nfslog_workbuffer"
53*0Sstevel@tonic-gate #define	FHPATH			"fhtable"
54*0Sstevel@tonic-gate #define	LOGPATH			"nfslog"
55*0Sstevel@tonic-gate 
56*0Sstevel@tonic-gate enum translog_format {
57*0Sstevel@tonic-gate 	TRANSLOG_BASIC, TRANSLOG_EXTENDED
58*0Sstevel@tonic-gate };
59*0Sstevel@tonic-gate 
60*0Sstevel@tonic-gate /*
61*0Sstevel@tonic-gate  * This struct is used to get or set the logging state for a filesystem.
62*0Sstevel@tonic-gate  * Using a single struct like this is okay for for releases where it's
63*0Sstevel@tonic-gate  * private, but it's questionable as a
64*0Sstevel@tonic-gate  * public API, because of extensibility and binary compatibility issues.
65*0Sstevel@tonic-gate  *
66*0Sstevel@tonic-gate  * Relative paths are interpreted relative to the root of the exported
67*0Sstevel@tonic-gate  * directory tree.
68*0Sstevel@tonic-gate  */
69*0Sstevel@tonic-gate typedef struct nfsl_config {
70*0Sstevel@tonic-gate 	uint_t			nc_flags;
71*0Sstevel@tonic-gate 	char			*nc_name;	/* tag or "global" */
72*0Sstevel@tonic-gate 	char			*nc_defaultdir;
73*0Sstevel@tonic-gate 	char			*nc_logpath;
74*0Sstevel@tonic-gate 	char			*nc_fhpath;
75*0Sstevel@tonic-gate 	char			*nc_bufferpath;
76*0Sstevel@tonic-gate 	char			*nc_rpclogpath;
77*0Sstevel@tonic-gate 	enum translog_format	nc_logformat;
78*0Sstevel@tonic-gate 	void			*nc_elfcookie;	/* for rpclogfile processing */
79*0Sstevel@tonic-gate 	void			*nc_transcookie; /* for logfile processing */
80*0Sstevel@tonic-gate 	struct nfsl_config	*nc_next;
81*0Sstevel@tonic-gate } nfsl_config_t;
82*0Sstevel@tonic-gate 
83*0Sstevel@tonic-gate #define	NC_UPDATED		0x001	/* set when an existing entry is */
84*0Sstevel@tonic-gate 					/* modified after detecting changes */
85*0Sstevel@tonic-gate 					/* in the configuration file. */
86*0Sstevel@tonic-gate 					/* Not set on creation of entry. */
87*0Sstevel@tonic-gate 
88*0Sstevel@tonic-gate #define	NC_NOTAG_PRINTED	0x002	/* 'missing tag' syslogged */
89*0Sstevel@tonic-gate 
90*0Sstevel@tonic-gate extern boolean_t	nfsl_errs_to_syslog;
91*0Sstevel@tonic-gate 
92*0Sstevel@tonic-gate extern int	nfsl_getconfig_list(nfsl_config_t **listpp);
93*0Sstevel@tonic-gate extern int	nfsl_checkconfig_list(nfsl_config_t **listpp, boolean_t *);
94*0Sstevel@tonic-gate extern void	nfsl_freeconfig_list(nfsl_config_t **listpp);
95*0Sstevel@tonic-gate extern nfsl_config_t *nfsl_findconfig(nfsl_config_t *, char *, int *);
96*0Sstevel@tonic-gate #ifndef	LINTHAPPY
97*0Sstevel@tonic-gate extern void	nfsl_printconfig_list(nfsl_config_t *config);
98*0Sstevel@tonic-gate #endif
99*0Sstevel@tonic-gate 
100*0Sstevel@tonic-gate #ifdef __cplusplus
101*0Sstevel@tonic-gate }
102*0Sstevel@tonic-gate #endif
103*0Sstevel@tonic-gate 
104*0Sstevel@tonic-gate #endif /* _NFS_NFSLOG_CONFIG_H */
105