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