xref: /aosp_15_r20/external/selinux/libsepol/include/sepol/handle.h (revision 2d543d20722ada2425b5bdab9d0d1d29470e7bba)
1*2d543d20SAndroid Build Coastguard Worker #ifndef _SEPOL_HANDLE_H_
2*2d543d20SAndroid Build Coastguard Worker #define _SEPOL_HANDLE_H_
3*2d543d20SAndroid Build Coastguard Worker 
4*2d543d20SAndroid Build Coastguard Worker #ifdef __cplusplus
5*2d543d20SAndroid Build Coastguard Worker extern "C" {
6*2d543d20SAndroid Build Coastguard Worker #endif
7*2d543d20SAndroid Build Coastguard Worker 
8*2d543d20SAndroid Build Coastguard Worker struct sepol_handle;
9*2d543d20SAndroid Build Coastguard Worker typedef struct sepol_handle sepol_handle_t;
10*2d543d20SAndroid Build Coastguard Worker 
11*2d543d20SAndroid Build Coastguard Worker /* Create and return a sepol handle. */
12*2d543d20SAndroid Build Coastguard Worker sepol_handle_t *sepol_handle_create(void);
13*2d543d20SAndroid Build Coastguard Worker 
14*2d543d20SAndroid Build Coastguard Worker /* Get whether or not dontaudits will be disabled, same values as
15*2d543d20SAndroid Build Coastguard Worker  * specified by set_disable_dontaudit. This value reflects the state
16*2d543d20SAndroid Build Coastguard Worker  * your system will be set to upon commit, not necessarily its
17*2d543d20SAndroid Build Coastguard Worker  * current state.*/
18*2d543d20SAndroid Build Coastguard Worker int sepol_get_disable_dontaudit(sepol_handle_t * sh);
19*2d543d20SAndroid Build Coastguard Worker 
20*2d543d20SAndroid Build Coastguard Worker /* Set whether or not to disable dontaudits, 0 is default and does
21*2d543d20SAndroid Build Coastguard Worker  * not disable dontaudits, 1 disables them */
22*2d543d20SAndroid Build Coastguard Worker void sepol_set_disable_dontaudit(sepol_handle_t * sh, int disable_dontaudit);
23*2d543d20SAndroid Build Coastguard Worker 
24*2d543d20SAndroid Build Coastguard Worker /* Set whether module_expand() should consume the base policy passed in.
25*2d543d20SAndroid Build Coastguard Worker  * This should reduce the amount of memory required to expand the policy. */
26*2d543d20SAndroid Build Coastguard Worker void sepol_set_expand_consume_base(sepol_handle_t * sh, int consume_base);
27*2d543d20SAndroid Build Coastguard Worker 
28*2d543d20SAndroid Build Coastguard Worker /* Destroy a sepol handle. */
29*2d543d20SAndroid Build Coastguard Worker void sepol_handle_destroy(sepol_handle_t *);
30*2d543d20SAndroid Build Coastguard Worker 
31*2d543d20SAndroid Build Coastguard Worker /* Get whether or not needless unused branch of tunables would be preserved */
32*2d543d20SAndroid Build Coastguard Worker int sepol_get_preserve_tunables(sepol_handle_t * sh);
33*2d543d20SAndroid Build Coastguard Worker 
34*2d543d20SAndroid Build Coastguard Worker /* Set whether or not to preserve the needless unused branch of tunables,
35*2d543d20SAndroid Build Coastguard Worker  * 0 is default and discard such branch, 1 preserves them */
36*2d543d20SAndroid Build Coastguard Worker void sepol_set_preserve_tunables(sepol_handle_t * sh, int preserve_tunables);
37*2d543d20SAndroid Build Coastguard Worker 
38*2d543d20SAndroid Build Coastguard Worker #ifdef __cplusplus
39*2d543d20SAndroid Build Coastguard Worker }
40*2d543d20SAndroid Build Coastguard Worker #endif
41*2d543d20SAndroid Build Coastguard Worker 
42*2d543d20SAndroid Build Coastguard Worker #endif
43