1 /* Copyright (C) 2005 Red Hat, Inc. */ 2 3 #ifndef _SEMANAGE_CONTEXT_RECORD_H_ 4 #define _SEMANAGE_CONTEXT_RECORD_H_ 5 6 #include <semanage/handle.h> 7 8 #ifndef _SEMANAGE_CONTEXT_DEFINED_ 9 struct semanage_context; 10 typedef struct semanage_context semanage_context_t; 11 #define _SEMANAGE_CONTEXT_DEFINED_ 12 #endif 13 14 /* User */ 15 extern const char *semanage_context_get_user(const semanage_context_t * con); 16 17 extern int semanage_context_set_user(semanage_handle_t * handle, 18 semanage_context_t * con, 19 const char *user); 20 21 /* Role */ 22 extern const char *semanage_context_get_role(const semanage_context_t * con); 23 24 extern int semanage_context_set_role(semanage_handle_t * handle, 25 semanage_context_t * con, 26 const char *role); 27 28 /* Type */ 29 extern const char *semanage_context_get_type(const semanage_context_t * con); 30 31 extern int semanage_context_set_type(semanage_handle_t * handle, 32 semanage_context_t * con, 33 const char *type); 34 35 /* MLS */ 36 extern const char *semanage_context_get_mls(const semanage_context_t * con); 37 38 extern int semanage_context_set_mls(semanage_handle_t * handle, 39 semanage_context_t * con, 40 const char *mls_range); 41 42 /* Create/Clone/Destroy */ 43 extern int semanage_context_create(semanage_handle_t * handle, 44 semanage_context_t ** con_ptr); 45 46 extern int semanage_context_clone(semanage_handle_t * handle, 47 const semanage_context_t * con, 48 semanage_context_t ** con_ptr); 49 50 extern void semanage_context_free(semanage_context_t * con); 51 52 /* Parse to/from string */ 53 extern int semanage_context_from_string(semanage_handle_t * handle, 54 const char *str, 55 semanage_context_t ** con); 56 57 extern int semanage_context_to_string(semanage_handle_t * handle, 58 const semanage_context_t * con, 59 char **str_ptr); 60 61 #endif 62