xref: /titanic_41/usr/src/cmd/auditreduce/auditr.h (revision 0a47c91c895e274dd0990009919e30e984364a8b)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _AUDITR_H
27 #define	_AUDITR_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #include <sys/types.h>
36 #include <stdio.h>
37 #include <sys/types.h>
38 
39 #include <grp.h>
40 #include <pwd.h>
41 #include <signal.h>
42 #include <string.h>
43 #include <values.h>
44 
45 #include <dirent.h>
46 #include <sys/errno.h>
47 #include <sys/file.h>
48 #include <sys/param.h>
49 #include <sys/stat.h>
50 #include <sys/socket.h>
51 #include <sys/wait.h>
52 #include <sys/time.h>
53 #include <tzfile.h>
54 #include <sys/resource.h>
55 #include <netdb.h>
56 #include <unistd.h>
57 #include <libgen.h>
58 #include <stdlib.h>
59 #include <libscf_priv.h>
60 
61 #include <bsm/audit.h>
62 #include <bsm/audit_record.h>
63 #include <bsm/libbsm.h>
64 
65 #include <tsol/label.h>
66 
67 #include "auditrt.h"
68 
69 /*
70  * Flags for on/off code.
71  * The release setting would be 0 0 0 1.
72  */
73 #define	AUDIT_PROC_TRACE	0	/* process trace code */
74 #define	AUDIT_FILE		0	/* file trace code (use -V also) */
75 #define	AUDIT_REC		0	/* record trace code (very verbose) */
76 #define	AUDIT_RENAME		1	/* rename output file w/time stamps */
77 
78 #define	TRUE	1
79 #define	FALSE	0
80 
81 #define	FM_ALLDIR	1	/* f_mode in o.c - all dirs in this dir */
82 #define	FM_ALLFILE	0	/* f_mode in o.c - all audit files in dir */
83 
84 #define	MAXFILELEN	(MAXPATHLEN+MAXNAMLEN+1)
85 
86 /*
87  * Initial size of a record buffer.
88  * Never smaller than (2 * sizeof (short)).
89  * If a buffer is too small for the record being read then the
90  * current buffer is freed and a large-enough one is allocated.
91  */
92 #define	AUDITBUFSIZE	512	/* size of default record buffer */
93 
94 /*
95  * Controls size of audit_pcbs[] array.
96  * INITSIZE is the initial allocation for the array.
97  * INC is the growth jump when the array becomes too small.
98  */
99 #define	PCB_INITSIZE	100
100 #define	PCB_INC		50
101 
102 
103 /*
104  * Memory allocation functions.
105  * audit calloc that checks for NULL return
106  */
107 extern void	*a_calloc(int, size_t);
108 
109 /*
110  * Statistical reporting for error conditions.
111  */
112 extern void	audit_stats(void);
113 extern int	errno;
114 
115 #ifdef	__cplusplus
116 }
117 #endif
118 
119 #endif /* _AUDITR_H */
120