1/* Authors: Jason Tang <jtang@tresys.com>
2 *	    Joshua Brindle <jbrindle@tresys.com>
3 *          Karl MacMillan <kmacmillan@tresys.com>
4 *
5 * A set of utility functions that aid policy decision when dealing
6 * with hierarchal items.
7 *
8 * Copyright (C) 2005 Tresys Technology, LLC
9 *
10 *  This library is free software; you can redistribute it and/or
11 *  modify it under the terms of the GNU Lesser General Public
12 *  License as published by the Free Software Foundation; either
13 *  version 2.1 of the License, or (at your option) any later version.
14 *
15 *  This library is distributed in the hope that it will be useful,
16 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 *  Lesser General Public License for more details.
19 *
20 *  You should have received a copy of the GNU Lesser General Public
21 *  License along with this library; if not, write to the Free Software
22 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23 */
24
25#ifndef _SEPOL_POLICYDB_HIERARCHY_H_
26#define _SEPOL_POLICYDB_HIERARCHY_H_
27
28#include <sepol/policydb/avtab.h>
29#include <sepol/policydb/policydb.h>
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35extern int hierarchy_add_bounds(sepol_handle_t *handle, policydb_t *p);
36
37extern void bounds_destroy_bad(avtab_ptr_t cur);
38extern int bounds_check_type(sepol_handle_t *handle, policydb_t *p, uint32_t child,
39			     uint32_t parent, avtab_ptr_t *bad, int *numbad);
40
41extern int bounds_check_users(sepol_handle_t *handle, policydb_t *p);
42extern int bounds_check_roles(sepol_handle_t *handle, policydb_t *p);
43extern int bounds_check_types(sepol_handle_t *handle, policydb_t *p);
44
45extern int hierarchy_check_constraints(sepol_handle_t * handle, policydb_t * p);
46
47#ifdef __cplusplus
48}
49#endif
50
51#endif
52