xref: /titanic_51/usr/src/cmd/auditreduce/auditrd.h (revision 8eea8e29cc4374d1ee24c25a07f45af132db3499)
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 2003 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 time_t	m_after;		/* 'a' after a time */
50 time_t	m_before;		/* 'b' before a time */
51 audit_state_t mask;		/* used with m_class */
52 char	*zonename;		/* 'z' zonename */
53 #ifdef	TSOL
54 brange_t m_slabel;		/* 's' sensitivity label range */
55 #endif	/* TSOL */
56 int	flags;
57 int	checkflags;
58 int	socket_flag;
59 int	ip_type;
60 int	ip_ipv6[4];		/* ipv6 type object */
61 int	obj_flag;		/* 'o' object type */
62 int	obj_id;			/* object identifier */
63 gid_t	obj_group;		/* object group */
64 uid_t	obj_owner;		/* object owner */
65 int	subj_id;		/* subject identifier  */
66 char	ipc_type;		/* 'o' object type - tell what type of IPC */
67 
68 /*
69  * File selection options
70  */
71 char	*f_machine;		/* 'M' machine (suffix) type */
72 char	*f_root;		/* 'R' audit root */
73 char	*f_server;		/* 'S' server */
74 char	*f_outfile;		/* 'W' output file */
75 static char	*f_outtemp;	/* 'W' temporary file name */
76 int	f_all;			/* 'A' all records from a file */
77 int	f_complete;		/* 'C' only completed files */
78 int	f_delete;		/* 'D' delete when done */
79 int	f_quiet;		/* 'Q' sshhhh! */
80 int	f_verbose;		/* 'V' verbose */
81 int	f_stdin;		/* '-' read from stdin */
82 int	f_cmdline;		/* files specified on the command line */
83 int	new_mode;		/* 'N' new object selection mode */
84 
85 /*
86  * Global error reporting
87  */
88 char	*error_str;		/* current error message */
89 char	errbuf[256];		/* for creating error messages with sprintf */
90 char	*ar = "auditreduce:";
91 static int	root_pid;	/* remember original process's pid */
92 
93 /*
94  * Global control blocks
95  */
96 audit_pcb_t *audit_pcbs; /* ptr to array of pcbs that hold files (fcbs) */
97 
98 int	pcbsize;		/* size of audit_pcb[] */
99 int	pcbnum;		/* number of pcbs in audit_pcb[] that are active */
100 
101 /*
102  * Time values
103  */
104 time_t f_start;		/* time of first record written */
105 time_t f_end;		/* time of last record written */
106 time_t time_now;	/* time the program began */
107 
108 /*
109  * Global counting vars
110  */
111 int	filenum;		/* number of files to process */
112 
113 /*
114  * Global variable, class of current record being processed.
115  */
116 int global_class;
117 
118 #ifdef __cplusplus
119 }
120 #endif
121 
122 #endif	/* _AUDITRD_H */
123