xref: /titanic_50/usr/src/cmd/auditreduce/auditrd.h (revision afd1ac7b1c9a8cdf273c865aa5e9a14620341443)
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 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_AUDITRD_H
28 #define	_AUDITRD_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * Global data for auditreduce
38  */
39 
40 /*
41  * Message selection options
42  */
43 unsigned short	m_type;		/* 'm' message type */
44 gid_t	m_groupr;		/* 'g' group-id */
45 gid_t	m_groupe;		/* 'f' effective group-id */
46 uid_t	m_usera;		/* 'u' user id */
47 uid_t	m_usere;		/* 'e' effective user-id */
48 uid_t	m_userr;		/* 'r' real user-id */
49 au_asid_t m_sid;		/* 's' session-id */
50 time_t	m_after;		/* 'a' after a time */
51 time_t	m_before;		/* 'b' before a time */
52 audit_state_t mask;		/* used with m_class */
53 char	*zonename;		/* 'z' zonename */
54 #ifdef	TSOL
55 brange_t m_label;		/* 'l' mandatory label range */
56 #endif	/* TSOL */
57 int	flags;
58 int	checkflags;
59 int	socket_flag;
60 int	ip_type;
61 int	ip_ipv6[4];		/* ipv6 type object */
62 int	obj_flag;		/* 'o' object type */
63 int	obj_id;			/* object identifier */
64 gid_t	obj_group;		/* object group */
65 uid_t	obj_owner;		/* object owner */
66 int	subj_id;		/* subject identifier  */
67 char	ipc_type;		/* 'o' object type - tell what type of IPC */
68 
69 /*
70  * File selection options
71  */
72 char	*f_machine;		/* 'M' machine (suffix) type */
73 char	*f_root;		/* 'R' audit root */
74 char	*f_server;		/* 'S' server */
75 char	*f_outfile;		/* 'W' output file */
76 static char	*f_outtemp;	/* 'W' temporary file name */
77 int	f_all;			/* 'A' all records from a file */
78 int	f_complete;		/* 'C' only completed files */
79 int	f_delete;		/* 'D' delete when done */
80 int	f_quiet;		/* 'Q' sshhhh! */
81 int	f_verbose;		/* 'V' verbose */
82 int	f_stdin;		/* '-' read from stdin */
83 int	f_cmdline;		/* files specified on the command line */
84 int	new_mode;		/* 'N' new object selection mode */
85 
86 /*
87  * Global error reporting
88  */
89 char	*error_str;		/* current error message */
90 char	errbuf[256];		/* for creating error messages with sprintf */
91 char	*ar = "auditreduce:";
92 static int	root_pid;	/* remember original process's pid */
93 
94 /*
95  * Global control blocks
96  */
97 audit_pcb_t *audit_pcbs; /* ptr to array of pcbs that hold files (fcbs) */
98 
99 int	pcbsize;		/* size of audit_pcb[] */
100 int	pcbnum;		/* number of pcbs in audit_pcb[] that are active */
101 
102 /*
103  * Time values
104  */
105 time_t f_start;		/* time of first record written */
106 time_t f_end;		/* time of last record written */
107 time_t time_now;	/* time the program began */
108 
109 /*
110  * Global counting vars
111  */
112 int	filenum;		/* number of files to process */
113 
114 /*
115  * Global variable, class of current record being processed.
116  */
117 int global_class;
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #endif	/* _AUDITRD_H */
124