Interfaces
Here's interfaces done exactly the same way as ports.
Todo:
- must decide on the length parameter - probably drop that
- must decide what to do with shadowing/override, which could be useful for both ports and interfaces.
This patch depends on:
libsepol-1.1-context.diff
include/sepol/interfaces.h +28 -0
@@ -0,0 +1,28 @@ +#include <sepol/policydb.h> +#include <sepol/context.h> + +/* High level representation of an interface */ +typedef struct sepol_iface { +const char * name; +sepol_ctxinfo_t netif_con; +sepol_ctxinfo_t netmsg_con; +}sepol_iface_t ; + +/* Create a low level interface structure from +* a high level representation */ +extern int sepol_iface_create ( +policydb_t * policydb, +ocontext_t ** iface, +sepol_iface_t * data); + +/* Get the current context mapping for this interface */ +extern int sepol_iface_get_context ( +policydb_t * policydb, +sepol_iface_t * data, +char ** ifcon_str,size_t * ifcon_str_len, +char ** msgcon_str,size_t * msgcon_str_len); + +/* Load an interface into policy */ +extern int sepol_iface_load ( +policydb_t * policydb, +sepol_iface_t * data);
src/interfaces.c +130 -0
130 lines not on this page · raw message