/* sepolicy.h - Header for magiskpolicy non-public APIs */ #ifndef _SEPOLICY_H #define _SEPOLICY_H #define ALL NULL #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "vector.h" // 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) // Global policydb policydb_t *policy; // sepolicy manipulation functions int load_policy(const char *filename); int dump_policy(const char *filename); 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); #endif