1 #ifndef _SEPOL_MODULE_H_ 2 #define _SEPOL_MODULE_H_ 3 4 #include <stddef.h> 5 #include <stdio.h> 6 #include <stdint.h> 7 8 #include <sepol/handle.h> 9 #include <sepol/policydb.h> 10 11 struct sepol_module_package; 12 typedef struct sepol_module_package sepol_module_package_t; 13 14 /* Module package public interfaces. */ 15 16 extern int sepol_module_package_create(sepol_module_package_t ** p); 17 18 extern void sepol_module_package_free(sepol_module_package_t * p); 19 20 extern char *sepol_module_package_get_file_contexts(sepol_module_package_t * p); 21 22 extern size_t sepol_module_package_get_file_contexts_len(sepol_module_package_t 23 * p); 24 25 extern int sepol_module_package_set_file_contexts(sepol_module_package_t * p, 26 char *data, size_t len); 27 28 extern char *sepol_module_package_get_seusers(sepol_module_package_t * p); 29 30 extern size_t sepol_module_package_get_seusers_len(sepol_module_package_t * p); 31 32 extern int sepol_module_package_set_seusers(sepol_module_package_t * p, 33 char *data, size_t len); 34 35 extern char *sepol_module_package_get_user_extra(sepol_module_package_t * p); 36 37 extern size_t sepol_module_package_get_user_extra_len(sepol_module_package_t * 38 p); 39 40 extern int sepol_module_package_set_user_extra(sepol_module_package_t * p, 41 char *data, size_t len); 42 43 extern char *sepol_module_package_get_netfilter_contexts(sepol_module_package_t 44 * p); 45 46 extern size_t 47 sepol_module_package_get_netfilter_contexts_len(sepol_module_package_t * p); 48 49 extern int sepol_module_package_set_netfilter_contexts(sepol_module_package_t * 50 p, char *data, 51 size_t len); 52 53 extern sepol_policydb_t *sepol_module_package_get_policy(sepol_module_package_t 54 * p); 55 56 extern int sepol_link_packages(sepol_handle_t * handle, 57 sepol_module_package_t * base, 58 sepol_module_package_t ** modules, 59 int num_modules, int verbose); 60 61 extern int sepol_module_package_read(sepol_module_package_t * mod, 62 struct sepol_policy_file *file, 63 int verbose); 64 65 extern int sepol_module_package_info(struct sepol_policy_file *file, 66 int *type, char **name, char **version); 67 68 extern int sepol_module_package_write(sepol_module_package_t * p, 69 struct sepol_policy_file *file); 70 71 /* Module linking/expanding public interfaces. */ 72 73 extern int sepol_link_modules(sepol_handle_t * handle, 74 sepol_policydb_t * base, 75 sepol_policydb_t ** modules, 76 size_t len, int verbose); 77 78 extern int sepol_expand_module(sepol_handle_t * handle, 79 sepol_policydb_t * base, 80 sepol_policydb_t * out, int verbose, int check); 81 82 #endif 83