1/*
2 * Copyright 2011 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_RESOLVE_AST_H_
31#define CIL_RESOLVE_AST_H_
32
33#include <stdint.h>
34
35#include "cil_internal.h"
36#include "cil_tree.h"
37
38int cil_resolve_classorder(struct cil_tree_node *current, void *extra_args);
39int cil_resolve_classperms(struct cil_tree_node *current, struct cil_classperms *cp, void *extra_args);
40int cil_resolve_classpermissionset(struct cil_tree_node *current, struct cil_classpermissionset *cps, void *extra_args);
41int cil_resolve_classperms_list(struct cil_tree_node *current, struct cil_list *cp_list, void *extra_args);
42int cil_resolve_avrule(struct cil_tree_node *current, void *extra_args);
43int cil_resolve_type_rule(struct cil_tree_node *current, void *extra_args);
44int cil_resolve_typeattributeset(struct cil_tree_node *current, void *extra_args);
45int cil_resolve_typealias(struct cil_tree_node *current, void *extra_args);
46int cil_resolve_typebounds(struct cil_tree_node *current, void *extra_args);
47int cil_resolve_typepermissive(struct cil_tree_node *current, void *extra_args);
48int cil_resolve_nametypetransition(struct cil_tree_node *current, void *extra_args);
49int cil_resolve_rangetransition(struct cil_tree_node *current, void *extra_args);
50int cil_resolve_classcommon(struct cil_tree_node *current, void *extra_args);
51int cil_resolve_classmapping(struct cil_tree_node *current, void *extra_args);
52int cil_resolve_userrole(struct cil_tree_node *current, void *extra_args);
53int cil_resolve_userlevel(struct cil_tree_node *current, void *extra_args);
54int cil_resolve_userrange(struct cil_tree_node *current, void *extra_args);
55int cil_resolve_userbounds(struct cil_tree_node *current, void *extra_args);
56int cil_resolve_userprefix(struct cil_tree_node *current, void *extra_args);
57int cil_resolve_selinuxuser(struct cil_tree_node *current, void *extra_args);
58int cil_resolve_roletype(struct cil_tree_node *current, void *extra_args);
59int cil_resolve_roletransition(struct cil_tree_node *current, void *extra_args);
60int cil_resolve_roleallow(struct cil_tree_node *current, void *extra_args);
61int cil_resolve_roleattributeset(struct cil_tree_node *current, void *extra_args);
62int cil_resolve_rolebounds(struct cil_tree_node *current, void *extra_args);
63int cil_resolve_sensalias(struct cil_tree_node *current, void *extra_args);
64int cil_resolve_catalias(struct cil_tree_node *current, void *extra_args);
65int cil_resolve_catorder(struct cil_tree_node *current, void *extra_args);
66int cil_resolve_sensitivityorder(struct cil_tree_node *current, void *extra_args);
67int cil_resolve_cat_list(struct cil_tree_node *current, struct cil_list *cat_list, struct cil_list *res_cat_list, void *extra_args);
68int cil_resolve_catset(struct cil_tree_node *current, struct cil_catset *catset, void *extra_args);
69int cil_resolve_senscat(struct cil_tree_node *current, void *extra_args);
70int cil_resolve_level(struct cil_tree_node *current, struct cil_level *level, void *extra_args);
71int cil_resolve_levelrange(struct cil_tree_node *current, struct cil_levelrange *levelrange, void *extra_args);
72int cil_resolve_constrain(struct cil_tree_node *current, void *extra_args);
73int cil_resolve_validatetrans(struct cil_tree_node *current, void *extra_args);
74int cil_resolve_context(struct cil_tree_node *current, struct cil_context *context, void *extra_args);
75int cil_resolve_filecon(struct cil_tree_node *current, void *extra_args);
76int cil_resolve_portcon(struct cil_tree_node *current, void *extra_args);
77int cil_resolve_genfscon(struct cil_tree_node *current, void *extra_args);
78int cil_resolve_nodecon(struct cil_tree_node *current, void *extra_args);
79int cil_resolve_netifcon(struct cil_tree_node *current, void *extra_args);
80int cil_resolve_pirqcon(struct cil_tree_node *current, void *extra_args);
81int cil_resolve_iomemcon(struct cil_tree_node *current, void *extra_args);
82int cil_resolve_ioportcon(struct cil_tree_node *current, void *extra_args);
83int cil_resolve_pcidevicecon(struct cil_tree_node *current, void *extra_args);
84int cil_resolve_fsuse(struct cil_tree_node *current, void *extra_args);
85int cil_resolve_sidcontext(struct cil_tree_node *current, void *extra_args);
86int cil_resolve_sidorder(struct cil_tree_node *current, void *extra_args);
87int cil_resolve_blockinherit(struct cil_tree_node *current, void *extra_args);
88int cil_resolve_in(struct cil_tree_node *current, void *extra_args);
89int cil_resolve_call1(struct cil_tree_node *current, void *extra_args);
90int cil_resolve_call2(struct cil_tree_node *, void *extra_args);
91int cil_resolve_name_call_args(struct cil_call *call, char *name, enum cil_sym_index sym_index, struct cil_symtab_datum **datum);
92int cil_resolve_expr(enum cil_flavor expr_type, struct cil_list *str_expr, struct cil_list **datum_expr, struct cil_tree_node *parent, void *extra_args);
93int cil_resolve_boolif(struct cil_tree_node *current, void *extra_args);
94int cil_evaluate_expr(struct cil_list *datum_expr, uint16_t *result);
95int cil_resolve_tunif(struct cil_tree_node *current, void *extra_args);
96
97int cil_resolve_ast(struct cil_db *db, struct cil_tree_node *current);
98int cil_resolve_name(struct cil_tree_node *ast_node, char *name, enum cil_sym_index sym_index, void *extra_args, struct cil_symtab_datum **datum);
99
100#endif /* CIL_RESOLVE_AST_H_ */
101