• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Authors: Karl MacMillan <kmacmillan@tresys.com>
2  *
3  * A set of utility functions that aid policy decision when dealing
4  * with hierarchal namespaces.
5  *
6  * Copyright (C) 2006 Tresys Technology, LLC
7  *
8  *  This library is free software; you can redistribute it and/or
9  *  modify it under the terms of the GNU Lesser General Public
10  *  License as published by the Free Software Foundation; either
11  *  version 2.1 of the License, or (at your option) any later version.
12  *
13  *  This library is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  *  Lesser General Public License for more details.
17  *
18  *  You should have received a copy of the GNU Lesser General Public
19  *  License along with this library; if not, write to the Free Software
20  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21  */
22 
23 #ifndef __SEPOL_UTIL_H__
24 #define __SEPOL_UTIL_H__
25 
26 #include <sepol/policydb/policydb.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 extern int add_i_to_a(uint32_t i, uint32_t * cnt, uint32_t ** a);
33 
34 extern char *sepol_av_to_string(policydb_t * policydbp, uint32_t tclass,
35 				sepol_access_vector_t av);
36 
37 char *sepol_extended_perms_to_string(avtab_extended_perms_t *xperms);
38 
39 /*
40  * The tokenize function may be used to
41  * replace sscanf
42  */
43 extern int tokenize(char *line_buf, char delim, int num_args, ...);
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 
49 #endif
50