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