16cd6a6acSopenharmony_ci/* Authors: Karl MacMillan <kmacmillan@tresys.com>
26cd6a6acSopenharmony_ci *
36cd6a6acSopenharmony_ci * A set of utility functions that aid policy decision when dealing
46cd6a6acSopenharmony_ci * with hierarchal namespaces.
56cd6a6acSopenharmony_ci *
66cd6a6acSopenharmony_ci * Copyright (C) 2006 Tresys Technology, LLC
76cd6a6acSopenharmony_ci *
86cd6a6acSopenharmony_ci *  This library is free software; you can redistribute it and/or
96cd6a6acSopenharmony_ci *  modify it under the terms of the GNU Lesser General Public
106cd6a6acSopenharmony_ci *  License as published by the Free Software Foundation; either
116cd6a6acSopenharmony_ci *  version 2.1 of the License, or (at your option) any later version.
126cd6a6acSopenharmony_ci *
136cd6a6acSopenharmony_ci *  This library is distributed in the hope that it will be useful,
146cd6a6acSopenharmony_ci *  but WITHOUT ANY WARRANTY; without even the implied warranty of
156cd6a6acSopenharmony_ci *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
166cd6a6acSopenharmony_ci *  Lesser General Public License for more details.
176cd6a6acSopenharmony_ci *
186cd6a6acSopenharmony_ci *  You should have received a copy of the GNU Lesser General Public
196cd6a6acSopenharmony_ci *  License along with this library; if not, write to the Free Software
206cd6a6acSopenharmony_ci *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
216cd6a6acSopenharmony_ci */
226cd6a6acSopenharmony_ci
236cd6a6acSopenharmony_ci#ifndef __SEPOL_UTIL_H__
246cd6a6acSopenharmony_ci#define __SEPOL_UTIL_H__
256cd6a6acSopenharmony_ci
266cd6a6acSopenharmony_ci#include <sepol/policydb/policydb.h>
276cd6a6acSopenharmony_ci
286cd6a6acSopenharmony_ci#ifdef __cplusplus
296cd6a6acSopenharmony_ciextern "C" {
306cd6a6acSopenharmony_ci#endif
316cd6a6acSopenharmony_ci
326cd6a6acSopenharmony_ciextern int add_i_to_a(uint32_t i, uint32_t * cnt, uint32_t ** a);
336cd6a6acSopenharmony_ci
346cd6a6acSopenharmony_ciextern char *sepol_av_to_string(policydb_t * policydbp, uint32_t tclass,
356cd6a6acSopenharmony_ci				sepol_access_vector_t av);
366cd6a6acSopenharmony_ci
376cd6a6acSopenharmony_cichar *sepol_extended_perms_to_string(avtab_extended_perms_t *xperms);
386cd6a6acSopenharmony_ci
396cd6a6acSopenharmony_ci/*
406cd6a6acSopenharmony_ci * The tokenize function may be used to
416cd6a6acSopenharmony_ci * replace sscanf
426cd6a6acSopenharmony_ci */
436cd6a6acSopenharmony_ciextern int tokenize(char *line_buf, char delim, int num_args, ...);
446cd6a6acSopenharmony_ci
456cd6a6acSopenharmony_ci#ifdef __cplusplus
466cd6a6acSopenharmony_ci}
476cd6a6acSopenharmony_ci#endif
486cd6a6acSopenharmony_ci
496cd6a6acSopenharmony_ci#endif
50