16cd6a6acSopenharmony_ci#ifndef _SEPOL_HANDLE_H_ 26cd6a6acSopenharmony_ci#define _SEPOL_HANDLE_H_ 36cd6a6acSopenharmony_ci 46cd6a6acSopenharmony_ci#ifdef __cplusplus 56cd6a6acSopenharmony_ciextern "C" { 66cd6a6acSopenharmony_ci#endif 76cd6a6acSopenharmony_ci 86cd6a6acSopenharmony_cistruct sepol_handle; 96cd6a6acSopenharmony_citypedef struct sepol_handle sepol_handle_t; 106cd6a6acSopenharmony_ci 116cd6a6acSopenharmony_ci/* Create and return a sepol handle. */ 126cd6a6acSopenharmony_cisepol_handle_t *sepol_handle_create(void); 136cd6a6acSopenharmony_ci 146cd6a6acSopenharmony_ci/* Get whether or not dontaudits will be disabled, same values as 156cd6a6acSopenharmony_ci * specified by set_disable_dontaudit. This value reflects the state 166cd6a6acSopenharmony_ci * your system will be set to upon commit, not necessarily its 176cd6a6acSopenharmony_ci * current state.*/ 186cd6a6acSopenharmony_ciint sepol_get_disable_dontaudit(sepol_handle_t * sh); 196cd6a6acSopenharmony_ci 206cd6a6acSopenharmony_ci/* Set whether or not to disable dontaudits, 0 is default and does 216cd6a6acSopenharmony_ci * not disable dontaudits, 1 disables them */ 226cd6a6acSopenharmony_civoid sepol_set_disable_dontaudit(sepol_handle_t * sh, int disable_dontaudit); 236cd6a6acSopenharmony_ci 246cd6a6acSopenharmony_ci/* Set whether module_expand() should consume the base policy passed in. 256cd6a6acSopenharmony_ci * This should reduce the amount of memory required to expand the policy. */ 266cd6a6acSopenharmony_civoid sepol_set_expand_consume_base(sepol_handle_t * sh, int consume_base); 276cd6a6acSopenharmony_ci 286cd6a6acSopenharmony_ci/* Destroy a sepol handle. */ 296cd6a6acSopenharmony_civoid sepol_handle_destroy(sepol_handle_t *); 306cd6a6acSopenharmony_ci 316cd6a6acSopenharmony_ci/* Get whether or not needless unused branch of tunables would be preserved */ 326cd6a6acSopenharmony_ciint sepol_get_preserve_tunables(sepol_handle_t * sh); 336cd6a6acSopenharmony_ci 346cd6a6acSopenharmony_ci/* Set whether or not to preserve the needless unused branch of tunables, 356cd6a6acSopenharmony_ci * 0 is default and discard such branch, 1 preserves them */ 366cd6a6acSopenharmony_civoid sepol_set_preserve_tunables(sepol_handle_t * sh, int preserve_tunables); 376cd6a6acSopenharmony_ci 386cd6a6acSopenharmony_ci#ifdef __cplusplus 396cd6a6acSopenharmony_ci} 406cd6a6acSopenharmony_ci#endif 416cd6a6acSopenharmony_ci 426cd6a6acSopenharmony_ci#endif 43