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
26#ifndef	_SYSTOKEN_H
27#define	_SYSTOKEN_H
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include "sysplugin.h"
34#include <bsm/adt.h>
35
36/*
37 * parse_context -- doc and cur are for XML input, chunk and
38 * remaining for "plain text input, i.e., the traditiona
39 * output from praudit
40 */
41
42struct parse_context {
43	adr_t		adr;	/* input buffer pointers */
44	uint64_t	id;	/* message sequence number */
45	tosyslog_t	out;	/* output data */
46};
47typedef struct parse_context parse_context_t;
48
49#define	AU_TEXT_NAME	" text "
50
51#ifdef useless
52/*
53 * the following *_ar_token() functions parallel the *_token()(
54 * functions defined in praudit/toktable.h
55 */
56
57/*
58 * These tokens are the same for all versions of Solaris
59 */
60
61/*
62 * Control tokens
63 */
64
65extern void	file_token(adr_t *, uint64_t, uint64_t);
66extern void	trailer_token(adr_t *, parse_context_t *);
67extern void	header_token(adr_t *, parse_context_t *);
68extern void	header32_ex_token(adr_t *, parse_context_t *);
69
70/*
71 * Data tokens
72 */
73
74extern void	arbitrary_data_token(adr_t *, parse_context_t *);
75extern void	fmri_token(adr_t *, parse_context_t *);
76extern void	s5_IPC_token(adr_t *, parse_context_t *);
77extern void	path_token(adr_t *, parse_context_t *);
78extern void	subject32_token();
79extern void	process32_token();
80extern void	return_value32_token();
81extern void	text_token(adr_t *, parse_context_t *);
82extern void	opaque_token(adr_t *, parse_context_t *);
83extern void	ip_addr_token();
84extern void	ip_token(adr_t *, parse_context_t *);
85extern void	iport_token(adr_t *, parse_context_t *);
86extern void	argument32_token();
87extern void	socket_token();
88extern void	sequence_token(adr_t *, parse_context_t *);
89
90/*
91 * Modifier tokens
92 */
93
94extern void	acl_token(adr_t *, parse_context_t *);
95extern void	attribute_token(adr_t *, parse_context_t *);
96extern void	s5_IPC_perm_token(adr_t *, parse_context_t *);
97extern void	group_token();
98extern void	label_token(adr_t *, parse_context_t *);
99extern void	privilege_token(adr_t *, parse_context_t *);
100extern void	useofpriv_token(adr_t *, parse_context_t *);
101extern void	secflags_token(adr_t *, parse_context_t *);
102extern void	zonename_token(adr_t *, parse_context_t *);
103extern void	liaison_token(adr_t *, parse_context_t *);
104extern void	newgroup_token(adr_t *, parse_context_t *);
105extern void	exec_args_token(adr_t *, parse_context_t *);
106extern void	exec_env_token(adr_t *, parse_context_t *);
107extern void	attribute32_token(adr_t *, parse_context_t *);
108extern void	useofauth_token(adr_t *, parse_context_t *);
109extern void	user_token(adr_t *, parse_context_t *);
110
111/*
112 * X windows tokens
113 */
114
115extern void	xatom_token(adr_t *, parse_context_t *);
116extern void	xselect_token(adr_t *, parse_context_t *);
117extern void	xcolormap_token(adr_t *, parse_context_t *);
118extern void	xcursor_token(adr_t *, parse_context_t *);
119extern void	xfont_token(adr_t *, parse_context_t *);
120extern void	xgc_token(adr_t *, parse_context_t *);
121extern void	xpixmap_token(adr_t *, parse_context_t *);
122extern void	xproperty_token(adr_t *, parse_context_t *);
123extern void	xwindow_token(adr_t *, parse_context_t *);
124extern void	xclient_token(adr_t *, parse_context_t *);
125
126/*
127 * Command tokens
128 */
129
130extern void	cmd_token(adr_t *, parse_context_t *);
131extern void	exit_token(adr_t *, parse_context_t *);
132
133/*
134 * Miscellaneous tokens
135 */
136
137extern void	host_token(adr_t *, parse_context_t *);
138
139/*
140 * Solaris64 tokens
141 */
142
143extern void	argument64_token(adr_t *, parse_context_t *);
144extern void	return64_token(adr_t *, parse_context_t *);
145extern void	attribute64_token(adr_t *, parse_context_t *);
146extern void	header64_token(adr_t *, parse_context_t *);
147extern void	subject64_token(adr_t *, parse_context_t *);
148extern void	process64_token(adr_t *, parse_context_t *);
149extern void	file64_token(adr_t *, parse_context_t *);
150
151/*
152 * Extended network address tokens
153 */
154
155extern void	header64_ex_token();
156extern void	subject32_ex_token();
157extern void	process32_ex_token();
158extern void	subject64_ex_token(adr_t *, parse_context_t *);
159extern void	process64_ex_token(adr_t *, parse_context_t *);
160extern void	ip_addr_ex_token(adr_t *, parse_context_t *);
161extern void	socket_ex_token(adr_t *, parse_context_t *);
162extern void	tid_token(adr_t *, parse_context_t *);
163#endif
164
165#ifdef __cplusplus
166}
167#endif
168
169#endif	/* _SYSTOKEN_H */
170