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 /* 22*047f6e6fSgww * 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 _TOKTABLE_H 277c478bd9Sstevel@tonic-gate #define _TOKTABLE_H 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #ifdef __cplusplus 307c478bd9Sstevel@tonic-gate extern "C" { 317c478bd9Sstevel@tonic-gate #endif 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate /* 347c478bd9Sstevel@tonic-gate * Solaris Audit Token Table. 357c478bd9Sstevel@tonic-gate */ 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate typedef struct token_desc { 387c478bd9Sstevel@tonic-gate char *t_name; /* name of the token */ 397c478bd9Sstevel@tonic-gate char *t_tagname; /* tag name */ 407c478bd9Sstevel@tonic-gate int (*func)(); /* token processing function */ 417c478bd9Sstevel@tonic-gate short t_type; /* token or tag type */ 427c478bd9Sstevel@tonic-gate } token_desc_t; 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gate 457c478bd9Sstevel@tonic-gate #define NOFUNC (int (*)())0 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gate #define MAXTOKEN 0xff 487c478bd9Sstevel@tonic-gate 497c478bd9Sstevel@tonic-gate extern token_desc_t tokentable[]; 507c478bd9Sstevel@tonic-gate 517c478bd9Sstevel@tonic-gate /* 527c478bd9Sstevel@tonic-gate * Tag types - 537c478bd9Sstevel@tonic-gate * 547c478bd9Sstevel@tonic-gate * attribute: an attribute: 557c478bd9Sstevel@tonic-gate * xxx="..." 567c478bd9Sstevel@tonic-gate * 577c478bd9Sstevel@tonic-gate * element: a simple element: 587c478bd9Sstevel@tonic-gate * <xxx> ... </xxx> 597c478bd9Sstevel@tonic-gate * 607c478bd9Sstevel@tonic-gate * enclosed: a self contained element, optionally with attributes: 617c478bd9Sstevel@tonic-gate * <xxx a="" b="" ... /> 627c478bd9Sstevel@tonic-gate * 637c478bd9Sstevel@tonic-gate * extended: an element with attributes: 647c478bd9Sstevel@tonic-gate * <xxx a="" b="" ...> ... </xxx> 657c478bd9Sstevel@tonic-gate */ 667c478bd9Sstevel@tonic-gate #define T_ATTRIBUTE 1 /* attribute */ 677c478bd9Sstevel@tonic-gate #define T_ELEMENT 2 /* element */ 687c478bd9Sstevel@tonic-gate #define T_ENCLOSED 3 /* enclosed element */ 697c478bd9Sstevel@tonic-gate #define T_EXTENDED 4 /* extended element */ 707c478bd9Sstevel@tonic-gate #define T_UNKNOWN 99 /* huh... */ 717c478bd9Sstevel@tonic-gate 727c478bd9Sstevel@tonic-gate /* 737c478bd9Sstevel@tonic-gate * Define the kinds of tags 747c478bd9Sstevel@tonic-gate */ 757c478bd9Sstevel@tonic-gate enum tagnum_t { TAG_INVALID = MAXTOKEN, 767c478bd9Sstevel@tonic-gate TAG_UID, 777c478bd9Sstevel@tonic-gate TAG_GID, 787c478bd9Sstevel@tonic-gate TAG_RUID, 797c478bd9Sstevel@tonic-gate TAG_RGID, 807c478bd9Sstevel@tonic-gate TAG_AUID, 817c478bd9Sstevel@tonic-gate TAG_PID, 827c478bd9Sstevel@tonic-gate TAG_SID, 837c478bd9Sstevel@tonic-gate TAG_TID32, 847c478bd9Sstevel@tonic-gate TAG_TID64, 857c478bd9Sstevel@tonic-gate TAG_TID32_EX, 867c478bd9Sstevel@tonic-gate TAG_TID64_EX, 877c478bd9Sstevel@tonic-gate TAG_EVMOD, 887c478bd9Sstevel@tonic-gate TAG_TOKVERS, 897c478bd9Sstevel@tonic-gate TAG_EVTYPE, 907c478bd9Sstevel@tonic-gate TAG_ISO, 917c478bd9Sstevel@tonic-gate TAG_ERRVAL, 927c478bd9Sstevel@tonic-gate TAG_RETVAL, 937c478bd9Sstevel@tonic-gate TAG_SETTYPE, 947c478bd9Sstevel@tonic-gate TAG_GROUPID, 957c478bd9Sstevel@tonic-gate TAG_XID, 967c478bd9Sstevel@tonic-gate TAG_XCUID, 977c478bd9Sstevel@tonic-gate TAG_XSELTEXT, 987c478bd9Sstevel@tonic-gate TAG_XSELTYPE, 997c478bd9Sstevel@tonic-gate TAG_XSELDATA, 1007c478bd9Sstevel@tonic-gate TAG_ARGNUM, 1017c478bd9Sstevel@tonic-gate TAG_ARGVAL32, 1027c478bd9Sstevel@tonic-gate TAG_ARGVAL64, 1037c478bd9Sstevel@tonic-gate TAG_ARGDESC, 1047c478bd9Sstevel@tonic-gate TAG_MODE, 1057c478bd9Sstevel@tonic-gate TAG_FSID, 1067c478bd9Sstevel@tonic-gate TAG_NODEID32, 1077c478bd9Sstevel@tonic-gate TAG_NODEID64, 1087c478bd9Sstevel@tonic-gate TAG_DEVICE32, 1097c478bd9Sstevel@tonic-gate TAG_DEVICE64, 1107c478bd9Sstevel@tonic-gate TAG_SEQNUM, /* with sequence token */ 1117c478bd9Sstevel@tonic-gate TAG_ARGV, /* with cmd token */ 1127c478bd9Sstevel@tonic-gate TAG_ARGE, /* with cmd token */ 1137c478bd9Sstevel@tonic-gate TAG_ARG, /* with exec_args token */ 1147c478bd9Sstevel@tonic-gate TAG_ENV, /* with exec_env token */ 1157c478bd9Sstevel@tonic-gate TAG_XAT, /* with attr_path token */ 1167c478bd9Sstevel@tonic-gate TAG_RESULT, /* with use_of_privilege token */ 1177c478bd9Sstevel@tonic-gate TAG_CUID, /* with IPC_perm token */ 1187c478bd9Sstevel@tonic-gate TAG_CGID, /* with IPC_perm token */ 1197c478bd9Sstevel@tonic-gate TAG_SEQ, /* with IPC_perm token */ 1207c478bd9Sstevel@tonic-gate TAG_KEY, /* with IPC_perm token */ 1217c478bd9Sstevel@tonic-gate TAG_IPVERS, /* with ip token */ 1227c478bd9Sstevel@tonic-gate TAG_IPSERV, /* with ip token */ 1237c478bd9Sstevel@tonic-gate TAG_IPLEN, /* with ip token */ 1247c478bd9Sstevel@tonic-gate TAG_IPID, /* with ip token */ 1257c478bd9Sstevel@tonic-gate TAG_IPOFFS, /* with ip token */ 1267c478bd9Sstevel@tonic-gate TAG_IPTTL, /* with ip token */ 1277c478bd9Sstevel@tonic-gate TAG_IPPROTO, /* with ip token */ 1287c478bd9Sstevel@tonic-gate TAG_IPCKSUM, /* with ip token */ 1297c478bd9Sstevel@tonic-gate TAG_IPSRC, /* with ip token */ 1307c478bd9Sstevel@tonic-gate TAG_IPDEST, /* with ip token */ 1317c478bd9Sstevel@tonic-gate TAG_ACLTYPE, /* with acl token */ 1327c478bd9Sstevel@tonic-gate TAG_ACLVAL, /* with acl token */ 1337c478bd9Sstevel@tonic-gate TAG_SOCKTYPE, /* with socket token */ 1347c478bd9Sstevel@tonic-gate TAG_SOCKPORT, /* with socket token */ 1357c478bd9Sstevel@tonic-gate TAG_SOCKADDR, /* with socket token */ 1367c478bd9Sstevel@tonic-gate TAG_SOCKEXDOM, /* with socket_ex token */ 1377c478bd9Sstevel@tonic-gate TAG_SOCKEXTYPE, /* with socket_ex token */ 1387c478bd9Sstevel@tonic-gate TAG_SOCKEXLPORT, /* with socket_ex token */ 1397c478bd9Sstevel@tonic-gate TAG_SOCKEXLADDR, /* with socket_ex token */ 1407c478bd9Sstevel@tonic-gate TAG_SOCKEXFPORT, /* with socket_ex token */ 1417c478bd9Sstevel@tonic-gate TAG_SOCKEXFADDR, /* with socket_ex token */ 1427c478bd9Sstevel@tonic-gate TAG_IPCTYPE, /* with IPC token */ 1437c478bd9Sstevel@tonic-gate TAG_IPCID, /* with IPC token */ 1447c478bd9Sstevel@tonic-gate TAG_ARBPRINT, /* with arbitrary (data) token */ 1457c478bd9Sstevel@tonic-gate TAG_ARBTYPE, /* with arbitrary (data) token */ 1467c478bd9Sstevel@tonic-gate TAG_ARBCOUNT, /* with arbitrary (data) token */ 1477c478bd9Sstevel@tonic-gate TAG_HOSTID, /* with extended header token */ 1487c478bd9Sstevel@tonic-gate TAG_ZONENAME, /* with zonename token */ 1497c478bd9Sstevel@tonic-gate TAG_TID_TYPE, /* with tid token */ 1507c478bd9Sstevel@tonic-gate TAG_IP, /* with tid token, type=ip */ 1517c478bd9Sstevel@tonic-gate TAG_IP_LOCAL, /* with tid token, type=ip */ 1527c478bd9Sstevel@tonic-gate TAG_IP_REMOTE, /* with tid token, type=ip */ 1537c478bd9Sstevel@tonic-gate TAG_IP_ADR, /* with tid token, type=ip */ 154a7746f66Stz204579 TAG_ACEMASK, /* with ace token */ 155a7746f66Stz204579 TAG_ACEFLAGS, /* with ace token */ 156a7746f66Stz204579 TAG_ACETYPE, /* with ace token */ 157a7746f66Stz204579 TAG_ACEID, /* with ace token */ 158*047f6e6fSgww TAG_USERNAME, /* with user token */ 1597c478bd9Sstevel@tonic-gate MAXTAG 1607c478bd9Sstevel@tonic-gate }; 1617c478bd9Sstevel@tonic-gate 1627c478bd9Sstevel@tonic-gate 1637c478bd9Sstevel@tonic-gate /* 1647c478bd9Sstevel@tonic-gate * These tokens are the same for all versions of Solaris 1657c478bd9Sstevel@tonic-gate */ 1667c478bd9Sstevel@tonic-gate 1677c478bd9Sstevel@tonic-gate /* 1687c478bd9Sstevel@tonic-gate * Control tokens 1697c478bd9Sstevel@tonic-gate */ 1707c478bd9Sstevel@tonic-gate 1717c478bd9Sstevel@tonic-gate extern int file_token(); 1727c478bd9Sstevel@tonic-gate extern int trailer_token(); 1737c478bd9Sstevel@tonic-gate extern int header_token(); 1747c478bd9Sstevel@tonic-gate extern int header32_ex_token(); 1757c478bd9Sstevel@tonic-gate 1767c478bd9Sstevel@tonic-gate /* 1777c478bd9Sstevel@tonic-gate * Data tokens 1787c478bd9Sstevel@tonic-gate */ 1797c478bd9Sstevel@tonic-gate 1807c478bd9Sstevel@tonic-gate extern int arbitrary_data_token(); 181103b2b15Sgww extern int fmri_token(); 1827c478bd9Sstevel@tonic-gate extern int s5_IPC_token(); 1837c478bd9Sstevel@tonic-gate extern int path_token(); 1847c478bd9Sstevel@tonic-gate extern int path_attr_token(); 1857c478bd9Sstevel@tonic-gate extern int subject32_token(); 1867c478bd9Sstevel@tonic-gate extern int process32_token(); 1877c478bd9Sstevel@tonic-gate extern int return_value32_token(); 1887c478bd9Sstevel@tonic-gate extern int text_token(); 1897c478bd9Sstevel@tonic-gate extern int opaque_token(); 1907c478bd9Sstevel@tonic-gate extern int ip_addr_token(); 1917c478bd9Sstevel@tonic-gate extern int ip_token(); 1927c478bd9Sstevel@tonic-gate extern int iport_token(); 1937c478bd9Sstevel@tonic-gate extern int argument32_token(); 1947c478bd9Sstevel@tonic-gate extern int socket_token(); 1957c478bd9Sstevel@tonic-gate extern int sequence_token(); 1967c478bd9Sstevel@tonic-gate 1977c478bd9Sstevel@tonic-gate /* 1987c478bd9Sstevel@tonic-gate * Modifier tokens 1997c478bd9Sstevel@tonic-gate */ 2007c478bd9Sstevel@tonic-gate 2017c478bd9Sstevel@tonic-gate extern int acl_token(); 202a7746f66Stz204579 extern int ace_token(); 2037c478bd9Sstevel@tonic-gate extern int attribute_token(); 2047c478bd9Sstevel@tonic-gate extern int s5_IPC_perm_token(); 2057c478bd9Sstevel@tonic-gate extern int group_token(); 206a13cf099Sgww extern int label_token(); 2077c478bd9Sstevel@tonic-gate extern int privilege_token(); 2087c478bd9Sstevel@tonic-gate extern int useofpriv_token(); 2097c478bd9Sstevel@tonic-gate extern int liaison_token(); 2107c478bd9Sstevel@tonic-gate extern int newgroup_token(); 2117c478bd9Sstevel@tonic-gate extern int exec_args_token(); 2127c478bd9Sstevel@tonic-gate extern int exec_env_token(); 2137c478bd9Sstevel@tonic-gate extern int attribute32_token(); 2147c478bd9Sstevel@tonic-gate extern int useofauth_token(); 215*047f6e6fSgww extern int user_token(); 216*047f6e6fSgww extern int zonename_token(); 2177c478bd9Sstevel@tonic-gate 2187c478bd9Sstevel@tonic-gate /* 2197c478bd9Sstevel@tonic-gate * X windows tokens 2207c478bd9Sstevel@tonic-gate */ 2217c478bd9Sstevel@tonic-gate 2227c478bd9Sstevel@tonic-gate extern int xatom_token(); 2237c478bd9Sstevel@tonic-gate extern int xselect_token(); 2247c478bd9Sstevel@tonic-gate extern int xcolormap_token(); 2257c478bd9Sstevel@tonic-gate extern int xcursor_token(); 2267c478bd9Sstevel@tonic-gate extern int xfont_token(); 2277c478bd9Sstevel@tonic-gate extern int xgc_token(); 2287c478bd9Sstevel@tonic-gate extern int xpixmap_token(); 2297c478bd9Sstevel@tonic-gate extern int xproperty_token(); 2307c478bd9Sstevel@tonic-gate extern int xwindow_token(); 2317c478bd9Sstevel@tonic-gate extern int xclient_token(); 2327c478bd9Sstevel@tonic-gate 2337c478bd9Sstevel@tonic-gate /* 2347c478bd9Sstevel@tonic-gate * Command tokens 2357c478bd9Sstevel@tonic-gate */ 2367c478bd9Sstevel@tonic-gate 2377c478bd9Sstevel@tonic-gate extern int cmd_token(); 2387c478bd9Sstevel@tonic-gate extern int exit_token(); 2397c478bd9Sstevel@tonic-gate 2407c478bd9Sstevel@tonic-gate /* 2417c478bd9Sstevel@tonic-gate * Miscellaneous tokens 2427c478bd9Sstevel@tonic-gate */ 2437c478bd9Sstevel@tonic-gate 2447c478bd9Sstevel@tonic-gate extern int host_token(); 2457c478bd9Sstevel@tonic-gate 2467c478bd9Sstevel@tonic-gate /* 2477c478bd9Sstevel@tonic-gate * Solaris64 tokens 2487c478bd9Sstevel@tonic-gate */ 2497c478bd9Sstevel@tonic-gate 2507c478bd9Sstevel@tonic-gate extern int argument64_token(); 2517c478bd9Sstevel@tonic-gate extern int return_value64_token(); 2527c478bd9Sstevel@tonic-gate extern int attribute64_token(); 2537c478bd9Sstevel@tonic-gate extern int header64_token(); 2547c478bd9Sstevel@tonic-gate extern int subject64_token(); 2557c478bd9Sstevel@tonic-gate extern int process64_token(); 2567c478bd9Sstevel@tonic-gate extern int file64_token(); 2577c478bd9Sstevel@tonic-gate 2587c478bd9Sstevel@tonic-gate /* 2597c478bd9Sstevel@tonic-gate * Extended network address tokens 2607c478bd9Sstevel@tonic-gate */ 2617c478bd9Sstevel@tonic-gate 2627c478bd9Sstevel@tonic-gate extern int header64_ex_token(); 2637c478bd9Sstevel@tonic-gate extern int subject32_ex_token(); 2647c478bd9Sstevel@tonic-gate extern int process32_ex_token(); 2657c478bd9Sstevel@tonic-gate extern int subject64_ex_token(); 2667c478bd9Sstevel@tonic-gate extern int process64_ex_token(); 2677c478bd9Sstevel@tonic-gate extern int ip_addr_ex_token(); 2687c478bd9Sstevel@tonic-gate extern int socket_ex_token(); 2697c478bd9Sstevel@tonic-gate extern int tid_token(); 2707c478bd9Sstevel@tonic-gate 2717c478bd9Sstevel@tonic-gate #ifdef __cplusplus 2727c478bd9Sstevel@tonic-gate } 2737c478bd9Sstevel@tonic-gate #endif 2747c478bd9Sstevel@tonic-gate 2757c478bd9Sstevel@tonic-gate #endif /* _TOKTABLE_H */ 276