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 2010 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 *
25 * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
26 */
27
28 #ifndef _AUDITRD_H
29 #define _AUDITRD_H
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 /*
36 * Global data for auditreduce
37 */
38
39 /*
40 * Message selection options
41 */
42 unsigned short m_type; /* 'm' message type */
43 gid_t m_groupr; /* 'g' group-id */
44 gid_t m_groupe; /* 'f' effective group-id */
45 uid_t m_usera; /* 'u' user id */
46 uid_t m_usere; /* 'e' effective user-id */
47 uid_t m_userr; /* 'r' real user-id */
48 au_asid_t m_sid; /* 's' session-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 m_range_t *m_label; /* 'l' mandatory label range */
54 int flags;
55 int checkflags;
56 int socket_flag;
57 int ip_type;
58 uchar_t ip_ipv6[16]; /* ipv6 type object */
59 int obj_flag; /* 'o' object type */
60 int obj_id; /* object identifier */
61 gid_t obj_group; /* object group */
62 uid_t obj_owner; /* object owner */
63 int subj_id; /* subject identifier */
64 char ipc_type; /* 'o' object type - tell what type of IPC */
65 scf_pattern_t fmri; /* 'o' fmri value */
66 uid_t obj_user; /* 'o' user value */
67 char *wsid; /* 'o' wsid value */
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 *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 */