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