xref: /titanic_52/usr/src/cmd/auditreduce/auditr.h (revision bdfc6d18da790deeec2e0eb09c625902defe2498)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1987 - 2000 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef _AUDITR_H
28 #define	_AUDITR_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include <sys/types.h>
37 #include <stdio.h>
38 #include <sys/types.h>
39 
40 #include <grp.h>
41 #include <pwd.h>
42 #include <signal.h>
43 #include <string.h>
44 #include <values.h>
45 
46 #include <dirent.h>
47 #include <sys/errno.h>
48 #include <sys/file.h>
49 #include <sys/param.h>
50 #include <sys/stat.h>
51 #include <sys/socket.h>
52 #include <sys/wait.h>
53 #include <sys/time.h>
54 #include <tzfile.h>
55 #include <sys/resource.h>
56 #include <netdb.h>
57 #include <unistd.h>
58 #include <libgen.h>
59 #include <stdlib.h>
60 
61 #include <bsm/audit.h>
62 #include <bsm/audit_record.h>
63 #include <bsm/libbsm.h>
64 
65 #include "auditrt.h"
66 
67 /*
68  * Flags for on/off code.
69  * The release setting would be 0 0 0 1.
70  */
71 #define	AUDIT_PROC_TRACE	0	/* process trace code */
72 #define	AUDIT_FILE		0	/* file trace code (use -V also) */
73 #define	AUDIT_REC		0	/* record trace code (very verbose) */
74 #define	AUDIT_RENAME		1	/* rename output file w/time stamps */
75 
76 #define	TRUE	1
77 #define	FALSE	0
78 
79 #define	FM_ALLDIR	1	/* f_mode in o.c - all dirs in this dir */
80 #define	FM_ALLFILE	0	/* f_mode in o.c - all audit files in dir */
81 
82 #define	MAXFILELEN	(MAXPATHLEN+MAXNAMLEN+1)
83 
84 /*
85  * Initial size of a record buffer.
86  * Never smaller than (2 * sizeof (short)).
87  * If a buffer is too small for the record being read then the
88  * current buffer is freed and a large-enough one is allocated.
89  */
90 #define	AUDITBUFSIZE	512	/* size of default record buffer */
91 
92 /*
93  * Controls size of audit_pcbs[] array.
94  * INITSIZE is the initial allocation for the array.
95  * INC is the growth jump when the array becomes too small.
96  */
97 #define	PCB_INITSIZE	100
98 #define	PCB_INC		50
99 
100 
101 /*
102  * Memory allocation functions.
103  * audit calloc that checks for NULL return
104  */
105 extern void	*a_calloc(int, size_t);
106 
107 /*
108  * Statistical reporting for error conditions.
109  */
110 extern void	audit_stats(void);
111 extern int	errno;
112 
113 #ifdef	__cplusplus
114 }
115 #endif
116 
117 #endif /* _AUDITR_H */
118