17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
545916cd2Sjpk  * Common Development and Distribution License (the "License").
645916cd2Sjpk  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
228f775e0aSJan Friedel  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_SYSTOKEN_H
277c478bd9Sstevel@tonic-gate #define	_SYSTOKEN_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #ifdef __cplusplus
307c478bd9Sstevel@tonic-gate extern "C" {
317c478bd9Sstevel@tonic-gate #endif
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #include "sysplugin.h"
347c478bd9Sstevel@tonic-gate #include <bsm/adt.h>
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate /*
377c478bd9Sstevel@tonic-gate  * parse_context -- doc and cur are for XML input, chunk and
387c478bd9Sstevel@tonic-gate  * remaining for "plain text input, i.e., the traditiona
397c478bd9Sstevel@tonic-gate  * output from praudit
407c478bd9Sstevel@tonic-gate  */
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate struct parse_context {
437c478bd9Sstevel@tonic-gate 	adr_t		adr;	/* input buffer pointers */
448f775e0aSJan Friedel 	uint64_t	id;	/* message sequence number */
457c478bd9Sstevel@tonic-gate 	tosyslog_t	out;	/* output data */
467c478bd9Sstevel@tonic-gate };
477c478bd9Sstevel@tonic-gate typedef struct parse_context parse_context_t;
487c478bd9Sstevel@tonic-gate 
497c478bd9Sstevel@tonic-gate #define	AU_TEXT_NAME	" text "
507c478bd9Sstevel@tonic-gate 
517c478bd9Sstevel@tonic-gate #ifdef useless
527c478bd9Sstevel@tonic-gate /*
537c478bd9Sstevel@tonic-gate  * the following *_ar_token() functions parallel the *_token()(
547c478bd9Sstevel@tonic-gate  * functions defined in praudit/toktable.h
557c478bd9Sstevel@tonic-gate  */
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate /*
587c478bd9Sstevel@tonic-gate  * These tokens are the same for all versions of Solaris
597c478bd9Sstevel@tonic-gate  */
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate /*
627c478bd9Sstevel@tonic-gate  * Control tokens
637c478bd9Sstevel@tonic-gate  */
647c478bd9Sstevel@tonic-gate 
657c478bd9Sstevel@tonic-gate extern void	file_token(adr_t *, uint64_t, uint64_t);
667c478bd9Sstevel@tonic-gate extern void	trailer_token(adr_t *, parse_context_t *);
677c478bd9Sstevel@tonic-gate extern void	header_token(adr_t *, parse_context_t *);
687c478bd9Sstevel@tonic-gate extern void	header32_ex_token(adr_t *, parse_context_t *);
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate /*
717c478bd9Sstevel@tonic-gate  * Data tokens
727c478bd9Sstevel@tonic-gate  */
737c478bd9Sstevel@tonic-gate 
747c478bd9Sstevel@tonic-gate extern void	arbitrary_data_token(adr_t *, parse_context_t *);
75103b2b15Sgww extern void	fmri_token(adr_t *, parse_context_t *);
767c478bd9Sstevel@tonic-gate extern void	s5_IPC_token(adr_t *, parse_context_t *);
777c478bd9Sstevel@tonic-gate extern void	path_token(adr_t *, parse_context_t *);
787c478bd9Sstevel@tonic-gate extern void	subject32_token();
797c478bd9Sstevel@tonic-gate extern void	process32_token();
807c478bd9Sstevel@tonic-gate extern void	return_value32_token();
817c478bd9Sstevel@tonic-gate extern void	text_token(adr_t *, parse_context_t *);
827c478bd9Sstevel@tonic-gate extern void	opaque_token(adr_t *, parse_context_t *);
837c478bd9Sstevel@tonic-gate extern void	ip_addr_token();
847c478bd9Sstevel@tonic-gate extern void	ip_token(adr_t *, parse_context_t *);
857c478bd9Sstevel@tonic-gate extern void	iport_token(adr_t *, parse_context_t *);
867c478bd9Sstevel@tonic-gate extern void	argument32_token();
877c478bd9Sstevel@tonic-gate extern void	socket_token();
887c478bd9Sstevel@tonic-gate extern void	sequence_token(adr_t *, parse_context_t *);
897c478bd9Sstevel@tonic-gate 
907c478bd9Sstevel@tonic-gate /*
917c478bd9Sstevel@tonic-gate  * Modifier tokens
927c478bd9Sstevel@tonic-gate  */
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate extern void	acl_token(adr_t *, parse_context_t *);
957c478bd9Sstevel@tonic-gate extern void	attribute_token(adr_t *, parse_context_t *);
967c478bd9Sstevel@tonic-gate extern void	s5_IPC_perm_token(adr_t *, parse_context_t *);
977c478bd9Sstevel@tonic-gate extern void	group_token();
98a13cf099Sgww extern void	label_token(adr_t *, parse_context_t *);
997c478bd9Sstevel@tonic-gate extern void	privilege_token(adr_t *, parse_context_t *);
1007c478bd9Sstevel@tonic-gate extern void	useofpriv_token(adr_t *, parse_context_t *);
101*d2a70789SRichard Lowe extern void	secflags_token(adr_t *, parse_context_t *);
1027c478bd9Sstevel@tonic-gate extern void	zonename_token(adr_t *, parse_context_t *);
1037c478bd9Sstevel@tonic-gate extern void	liaison_token(adr_t *, parse_context_t *);
1047c478bd9Sstevel@tonic-gate extern void	newgroup_token(adr_t *, parse_context_t *);
1057c478bd9Sstevel@tonic-gate extern void	exec_args_token(adr_t *, parse_context_t *);
1067c478bd9Sstevel@tonic-gate extern void	exec_env_token(adr_t *, parse_context_t *);
1077c478bd9Sstevel@tonic-gate extern void	attribute32_token(adr_t *, parse_context_t *);
1087c478bd9Sstevel@tonic-gate extern void	useofauth_token(adr_t *, parse_context_t *);
109047f6e6fSgww extern void	user_token(adr_t *, parse_context_t *);
1107c478bd9Sstevel@tonic-gate 
1117c478bd9Sstevel@tonic-gate /*
1127c478bd9Sstevel@tonic-gate  * X windows tokens
1137c478bd9Sstevel@tonic-gate  */
1147c478bd9Sstevel@tonic-gate 
1157c478bd9Sstevel@tonic-gate extern void	xatom_token(adr_t *, parse_context_t *);
1167c478bd9Sstevel@tonic-gate extern void	xselect_token(adr_t *, parse_context_t *);
1177c478bd9Sstevel@tonic-gate extern void	xcolormap_token(adr_t *, parse_context_t *);
1187c478bd9Sstevel@tonic-gate extern void	xcursor_token(adr_t *, parse_context_t *);
1197c478bd9Sstevel@tonic-gate extern void	xfont_token(adr_t *, parse_context_t *);
1207c478bd9Sstevel@tonic-gate extern void	xgc_token(adr_t *, parse_context_t *);
1217c478bd9Sstevel@tonic-gate extern void	xpixmap_token(adr_t *, parse_context_t *);
1227c478bd9Sstevel@tonic-gate extern void	xproperty_token(adr_t *, parse_context_t *);
1237c478bd9Sstevel@tonic-gate extern void	xwindow_token(adr_t *, parse_context_t *);
1247c478bd9Sstevel@tonic-gate extern void	xclient_token(adr_t *, parse_context_t *);
1257c478bd9Sstevel@tonic-gate 
1267c478bd9Sstevel@tonic-gate /*
1277c478bd9Sstevel@tonic-gate  * Command tokens
1287c478bd9Sstevel@tonic-gate  */
1297c478bd9Sstevel@tonic-gate 
1307c478bd9Sstevel@tonic-gate extern void	cmd_token(adr_t *, parse_context_t *);
1317c478bd9Sstevel@tonic-gate extern void	exit_token(adr_t *, parse_context_t *);
1327c478bd9Sstevel@tonic-gate 
1337c478bd9Sstevel@tonic-gate /*
1347c478bd9Sstevel@tonic-gate  * Miscellaneous tokens
1357c478bd9Sstevel@tonic-gate  */
1367c478bd9Sstevel@tonic-gate 
1377c478bd9Sstevel@tonic-gate extern void	host_token(adr_t *, parse_context_t *);
1387c478bd9Sstevel@tonic-gate 
1397c478bd9Sstevel@tonic-gate /*
1407c478bd9Sstevel@tonic-gate  * Solaris64 tokens
1417c478bd9Sstevel@tonic-gate  */
1427c478bd9Sstevel@tonic-gate 
1437c478bd9Sstevel@tonic-gate extern void	argument64_token(adr_t *, parse_context_t *);
1447c478bd9Sstevel@tonic-gate extern void	return64_token(adr_t *, parse_context_t *);
1457c478bd9Sstevel@tonic-gate extern void	attribute64_token(adr_t *, parse_context_t *);
1467c478bd9Sstevel@tonic-gate extern void	header64_token(adr_t *, parse_context_t *);
1477c478bd9Sstevel@tonic-gate extern void	subject64_token(adr_t *, parse_context_t *);
1487c478bd9Sstevel@tonic-gate extern void	process64_token(adr_t *, parse_context_t *);
1497c478bd9Sstevel@tonic-gate extern void	file64_token(adr_t *, parse_context_t *);
1507c478bd9Sstevel@tonic-gate 
1517c478bd9Sstevel@tonic-gate /*
1527c478bd9Sstevel@tonic-gate  * Extended network address tokens
1537c478bd9Sstevel@tonic-gate  */
1547c478bd9Sstevel@tonic-gate 
1557c478bd9Sstevel@tonic-gate extern void	header64_ex_token();
1567c478bd9Sstevel@tonic-gate extern void	subject32_ex_token();
1577c478bd9Sstevel@tonic-gate extern void	process32_ex_token();
1587c478bd9Sstevel@tonic-gate extern void	subject64_ex_token(adr_t *, parse_context_t *);
1597c478bd9Sstevel@tonic-gate extern void	process64_ex_token(adr_t *, parse_context_t *);
1607c478bd9Sstevel@tonic-gate extern void	ip_addr_ex_token(adr_t *, parse_context_t *);
1617c478bd9Sstevel@tonic-gate extern void	socket_ex_token(adr_t *, parse_context_t *);
162047f6e6fSgww extern void	tid_token(adr_t *, parse_context_t *);
1637c478bd9Sstevel@tonic-gate #endif
1647c478bd9Sstevel@tonic-gate 
1657c478bd9Sstevel@tonic-gate #ifdef __cplusplus
1667c478bd9Sstevel@tonic-gate }
1677c478bd9Sstevel@tonic-gate #endif
1687c478bd9Sstevel@tonic-gate 
1697c478bd9Sstevel@tonic-gate #endif	/* _SYSTOKEN_H */
170