xref: /titanic_44/usr/src/cmd/praudit/toktable.h (revision fb3fb4f3d76d55b64440afd0af72775dfad3bd1d)
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 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_TOKTABLE_H
28 #define	_TOKTABLE_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * Solaris Audit Token Table.
38  */
39 
40 typedef struct token_desc {
41 	char	*t_name;	/* name of the token */
42 	char	*t_tagname;	/* tag name */
43 	int	(*func)();	/* token processing function */
44 	short	t_type;		/* token or tag type */
45 } token_desc_t;
46 
47 
48 #define	NOFUNC		(int (*)())0
49 
50 #define	MAXTOKEN	0xff
51 
52 extern token_desc_t tokentable[];
53 
54 /*
55  * Tag types -
56  *
57  *	attribute:	an attribute:
58  *			xxx="..."
59  *
60  *	element:	a simple element:
61  *			<xxx> ... </xxx>
62  *
63  *	enclosed:	a self contained element, optionally with attributes:
64  *			<xxx a="" b="" ... />
65  *
66  *	extended:	an element with attributes:
67  *			<xxx a="" b="" ...> ... </xxx>
68  */
69 #define	T_ATTRIBUTE	1	/* attribute */
70 #define	T_ELEMENT	2	/* element */
71 #define	T_ENCLOSED	3	/* enclosed element */
72 #define	T_EXTENDED	4	/* extended element */
73 #define	T_UNKNOWN	99	/* huh... */
74 
75 /*
76  * Define the kinds of tags
77  */
78 enum tagnum_t { TAG_INVALID = MAXTOKEN,
79 	TAG_UID,
80 	TAG_GID,
81 	TAG_RUID,
82 	TAG_RGID,
83 	TAG_AUID,
84 	TAG_PID,
85 	TAG_SID,
86 	TAG_TID32,
87 	TAG_TID64,
88 	TAG_TID32_EX,
89 	TAG_TID64_EX,
90 	TAG_EVMOD,
91 	TAG_TOKVERS,
92 	TAG_EVTYPE,
93 	TAG_ISO,
94 	TAG_ERRVAL,
95 	TAG_RETVAL,
96 	TAG_SETTYPE,
97 	TAG_GROUPID,
98 	TAG_XID,
99 	TAG_XCUID,
100 	TAG_XSELTEXT,
101 	TAG_XSELTYPE,
102 	TAG_XSELDATA,
103 	TAG_ARGNUM,
104 	TAG_ARGVAL32,
105 	TAG_ARGVAL64,
106 	TAG_ARGDESC,
107 	TAG_MODE,
108 	TAG_FSID,
109 	TAG_NODEID32,
110 	TAG_NODEID64,
111 	TAG_DEVICE32,
112 	TAG_DEVICE64,
113 	TAG_SEQNUM,			/* with sequence token */
114 	TAG_ARGV,			/* with cmd token */
115 	TAG_ARGE,			/* with cmd token */
116 	TAG_ARG,			/* with exec_args token */
117 	TAG_ENV,			/* with exec_env token */
118 	TAG_XAT,			/* with attr_path token */
119 	TAG_RESULT,			/* with use_of_privilege token */
120 	TAG_CUID,			/* with IPC_perm token */
121 	TAG_CGID,			/* with IPC_perm token */
122 	TAG_SEQ,			/* with IPC_perm token */
123 	TAG_KEY,			/* with IPC_perm token */
124 	TAG_IPVERS,			/* with ip token */
125 	TAG_IPSERV,			/* with ip token */
126 	TAG_IPLEN,			/* with ip token */
127 	TAG_IPID,			/* with ip token */
128 	TAG_IPOFFS,			/* with ip token */
129 	TAG_IPTTL,			/* with ip token */
130 	TAG_IPPROTO,			/* with ip token */
131 	TAG_IPCKSUM,			/* with ip token */
132 	TAG_IPSRC,			/* with ip token */
133 	TAG_IPDEST,			/* with ip token */
134 	TAG_ACLTYPE,			/* with acl token */
135 	TAG_ACLVAL,			/* with acl token */
136 	TAG_SOCKTYPE,			/* with socket token */
137 	TAG_SOCKPORT,			/* with socket token */
138 	TAG_SOCKADDR,			/* with socket token */
139 	TAG_SOCKEXDOM,			/* with socket_ex token */
140 	TAG_SOCKEXTYPE,			/* with socket_ex token */
141 	TAG_SOCKEXLPORT,		/* with socket_ex token */
142 	TAG_SOCKEXLADDR,		/* with socket_ex token */
143 	TAG_SOCKEXFPORT,		/* with socket_ex token */
144 	TAG_SOCKEXFADDR,		/* with socket_ex token */
145 	TAG_IPCTYPE,			/* with IPC token */
146 	TAG_IPCID,			/* with IPC token */
147 	TAG_ARBPRINT,			/* with arbitrary (data) token */
148 	TAG_ARBTYPE,			/* with arbitrary (data) token */
149 	TAG_ARBCOUNT,			/* with arbitrary (data) token */
150 	TAG_HOSTID,			/* with extended header token */
151 	TAG_ZONENAME,			/* with zonename token */
152 	TAG_TID_TYPE,			/* with tid token */
153 	TAG_IP,				/* with tid token, type=ip */
154 	TAG_IP_LOCAL,			/* with tid token, type=ip */
155 	TAG_IP_REMOTE,			/* with tid token, type=ip */
156 	TAG_IP_ADR,			/* with tid token, type=ip */
157 	MAXTAG
158 };
159 
160 
161 /*
162  * These tokens are the same for all versions of Solaris
163  */
164 
165 /*
166  * Control tokens
167  */
168 
169 extern int	file_token();
170 extern int	trailer_token();
171 extern int	header_token();
172 extern int	header32_ex_token();
173 
174 /*
175  * Data tokens
176  */
177 
178 extern int	arbitrary_data_token();
179 extern int	s5_IPC_token();
180 extern int	path_token();
181 extern int	path_attr_token();
182 extern int	subject32_token();
183 extern int	process32_token();
184 extern int	return_value32_token();
185 extern int	text_token();
186 extern int	opaque_token();
187 extern int	ip_addr_token();
188 extern int	ip_token();
189 extern int	iport_token();
190 extern int	argument32_token();
191 extern int	socket_token();
192 extern int	sequence_token();
193 extern int	zonename_token();
194 
195 /*
196  * Modifier tokens
197  */
198 
199 extern int	acl_token();
200 extern int	attribute_token();
201 extern int	s5_IPC_perm_token();
202 extern int	group_token();
203 extern int 	ilabel_token();
204 extern int	slabel_token();
205 extern int	clearance_token();
206 extern int	privilege_token();
207 extern int	useofpriv_token();
208 extern int	liaison_token();
209 extern int	newgroup_token();
210 extern int	exec_args_token();
211 extern int	exec_env_token();
212 extern int	attribute32_token();
213 extern int	useofauth_token();
214 
215 /*
216  * X windows tokens
217  */
218 
219 extern int	xatom_token();
220 extern int	xselect_token();
221 extern int	xcolormap_token();
222 extern int	xcursor_token();
223 extern int	xfont_token();
224 extern int	xgc_token();
225 extern int	xpixmap_token();
226 extern int	xproperty_token();
227 extern int	xwindow_token();
228 extern int	xclient_token();
229 
230 /*
231  * Command tokens
232  */
233 
234 extern int	cmd_token();
235 extern int	exit_token();
236 
237 /*
238  * Miscellaneous tokens
239  */
240 
241 extern int	host_token();
242 
243 /*
244  * Solaris64 tokens
245  */
246 
247 extern int	argument64_token();
248 extern int	return_value64_token();
249 extern int	attribute64_token();
250 extern int	header64_token();
251 extern int	subject64_token();
252 extern int	process64_token();
253 extern int	file64_token();
254 
255 /*
256  * Extended network address tokens
257  */
258 
259 extern int	header64_ex_token();
260 extern int	subject32_ex_token();
261 extern int	process32_ex_token();
262 extern int	subject64_ex_token();
263 extern int	process64_ex_token();
264 extern int	ip_addr_ex_token();
265 extern int	socket_ex_token();
266 extern int	tid_token();
267 
268 #ifdef __cplusplus
269 }
270 #endif
271 
272 #endif	/* _TOKTABLE_H */
273