Magisk/native/jni/magiskpolicy/sepolicy.h

27 lines
816 B
C
Raw Normal View History

2017-04-15 13:26:29 +02:00
/* sepolicy.h - Header for magiskpolicy non-public APIs
*/
#ifndef _SEPOLICY_H
#define _SEPOLICY_H
#include <sepol/policydb/policydb.h>
// Global policydb
extern policydb_t *policydb;
2017-04-15 13:26:29 +02:00
// hashtab traversal macro
#define hashtab_for_each(table, ptr) \
for (int _i = 0; _i < table->size; ++_i) \
for (*ptr = table->htable[_i]; *ptr != NULL; *ptr = (*ptr)->next)
// sepolicy manipulation functions
int create_domain(char *d);
int set_domain_state(char* s, int state);
int add_transition(char *s, char *t, char *c, char *d);
int add_file_transition(char *s, char *t, char *c, char *d, char* filename);
int add_typeattribute(char *domainS, char *attr);
int add_rule(char *s, char *t, char *c, char *p, int effect, int not);
2017-04-19 22:04:09 +02:00
int add_xperm_rule(char *s, char *t, char *c, char *range, int effect, int not);
2017-04-15 13:26:29 +02:00
#endif