• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2013 Tresys Technology, LLC. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  *    1. Redistributions of source code must retain the above copyright notice,
8  *       this list of conditions and the following disclaimer.
9  *
10  *    2. Redistributions in binary form must reproduce the above copyright notice,
11  *       this list of conditions and the following disclaimer in the documentation
12  *       and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY TRESYS TECHNOLOGY, LLC ``AS IS'' AND ANY EXPRESS
15  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17  * EVENT SHALL TRESYS TECHNOLOGY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  *
25  * The views and conclusions contained in the software and documentation are those
26  * of the authors and should not be interpreted as representing official policies,
27  * either expressed or implied, of Tresys Technology, LLC.
28  */
29 
30 #ifndef CIL_FLAVOR_H_
31 #define CIL_FLAVOR_H_
32 
33 /*
34 	Tree/list node types
35 */
36 #define CIL_MIN_OP_OPERANDS 1000
37 #define CIL_MIN_DECLARATIVE 2000
38 
39 enum cil_flavor {
40 	CIL_NONE = 0,
41 	CIL_ROOT,
42 	CIL_NODE,
43 	CIL_STRING,
44 	CIL_DATUM,
45 	CIL_LIST,
46 	CIL_LIST_ITEM,
47 	CIL_PARAM,
48 	CIL_ARGS,
49 	CIL_BLOCKINHERIT,
50 	CIL_BLOCKABSTRACT,
51 	CIL_IN,
52 	CIL_CALL,
53 	CIL_BOOLEANIF,
54 	CIL_TUNABLEIF,
55 	CIL_CONDBLOCK,
56 	CIL_CONDTRUE,
57 	CIL_CONDFALSE,
58 	CIL_CLASSORDER,
59 	CIL_CLASSCOMMON,
60 	CIL_CLASSMAPPING,
61 	CIL_CLASSPERMS,
62 	CIL_CLASSPERMS_SET,
63 	CIL_CLASSPERMISSIONSET,
64 	CIL_USERPREFIX,
65 	CIL_USERROLE,
66 	CIL_USERATTRIBUTESET,
67 	CIL_USERLEVEL,
68 	CIL_USERRANGE,
69 	CIL_USERBOUNDS,
70 	CIL_SELINUXUSER,
71 	CIL_SELINUXUSERDEFAULT,
72 	CIL_ROLEATTRIBUTESET,
73 	CIL_ROLETYPE,
74 	CIL_ROLEBOUNDS,
75 	CIL_TYPEATTRIBUTESET,
76 	CIL_TYPEALIASACTUAL,
77 	CIL_TYPEBOUNDS,
78 	CIL_TYPEPERMISSIVE,
79 	CIL_SENSALIASACTUAL,
80 	CIL_SENSITIVITYORDER,
81 	CIL_SENSCAT,
82 	CIL_CATALIASACTUAL,
83 	CIL_CATORDER,
84 	CIL_SIDORDER,
85 	CIL_ROLEALLOW,
86 	CIL_AVRULE,
87 	CIL_AVRULEX,
88 	CIL_ROLETRANSITION,
89 	CIL_TYPE_RULE,
90 	CIL_NAMETYPETRANSITION,
91 	CIL_RANGETRANSITION,
92 	CIL_CONSTRAIN,
93 	CIL_MLSCONSTRAIN,
94 	CIL_VALIDATETRANS,
95 	CIL_MLSVALIDATETRANS,
96 	CIL_SIDCONTEXT,
97 	CIL_FSUSE,
98 	CIL_FILECON,
99 	CIL_PORTCON,
100 	CIL_NODECON,
101 	CIL_GENFSCON,
102 	CIL_NETIFCON,
103 	CIL_PIRQCON,
104 	CIL_IOMEMCON,
105 	CIL_IOPORTCON,
106 	CIL_PCIDEVICECON,
107 	CIL_DEVICETREECON,
108 	CIL_DEFAULTUSER,
109 	CIL_DEFAULTROLE,
110 	CIL_DEFAULTTYPE,
111 	CIL_DEFAULTRANGE,
112 	CIL_HANDLEUNKNOWN,
113 	CIL_MLS,
114 
115 /*
116  *          boolean  constraint  set  catset
117  *  dom                  X
118  *  domby                X
119  *  incomp               X
120  *  eq         X         X
121  *  ne         X         X
122  *  and        X         X        X    X
123  *  not        X         X        X    X
124  *  or         X         X        X    X
125  *  xor        X                  X    X
126  *  all                           X    X
127  *  range                              X
128 */
129 	CIL_OP = CIL_MIN_OP_OPERANDS,
130 	CIL_ALL,
131 	CIL_AND,
132 	CIL_OR,
133 	CIL_XOR,
134 	CIL_NOT,
135 	CIL_EQ,
136 	CIL_NEQ,
137 	CIL_RANGE,
138 	CIL_CONS_DOM,
139 	CIL_CONS_DOMBY,
140 	CIL_CONS_INCOMP,
141 	CIL_CONS_OPERAND,
142 	CIL_CONS_U1,
143 	CIL_CONS_U2,
144 	CIL_CONS_U3,
145 	CIL_CONS_T1,
146 	CIL_CONS_T2,
147 	CIL_CONS_T3,
148 	CIL_CONS_R1,
149 	CIL_CONS_R2,
150 	CIL_CONS_R3,
151 	CIL_CONS_L1,
152 	CIL_CONS_L2,
153 	CIL_CONS_H1,
154 	CIL_CONS_H2,
155 
156 	CIL_BLOCK = CIL_MIN_DECLARATIVE,
157 	CIL_MACRO,
158 	CIL_OPTIONAL,
159 	CIL_BOOL,
160 	CIL_TUNABLE,
161 	CIL_PERM,
162 	CIL_MAP_PERM,
163 	CIL_COMMON,
164 	CIL_CLASS,
165 	CIL_MAP_CLASS,
166 	CIL_CLASSPERMISSION,
167 	CIL_USER,
168 	CIL_USERATTRIBUTE,
169 	CIL_ROLE,
170 	CIL_ROLEATTRIBUTE,
171 	CIL_TYPE,
172 	CIL_TYPEATTRIBUTE,
173 	CIL_TYPEALIAS,
174 	CIL_SENS,
175 	CIL_SENSALIAS,
176 	CIL_CAT,
177 	CIL_CATSET,
178 	CIL_CATALIAS,
179 	CIL_LEVEL,
180 	CIL_LEVELRANGE,
181 	CIL_SID,
182 	CIL_NAME,
183 	CIL_CONTEXT,
184 	CIL_IPADDR,
185 	CIL_POLICYCAP,
186 	CIL_PERMISSIONX
187 };
188 
189 
190 #endif /* CIL_FLAVOR_H_ */
191