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