1#ifndef _SEPOL_CONTEXT_RECORD_H_
2#define _SEPOL_CONTEXT_RECORD_H_
3
4#include <sepol/handle.h>
5
6struct sepol_context;
7typedef struct sepol_context sepol_context_t;
8
9/* We don't need a key, because the context is never stored
10 * in a data collection by itself */
11
12/* User */
13extern const char *sepol_context_get_user(const sepol_context_t * con);
14
15extern int sepol_context_set_user(sepol_handle_t * handle,
16				  sepol_context_t * con, const char *user);
17
18/* Role */
19extern const char *sepol_context_get_role(const sepol_context_t * con);
20
21extern int sepol_context_set_role(sepol_handle_t * handle,
22				  sepol_context_t * con, const char *role);
23
24/* Type */
25extern const char *sepol_context_get_type(const sepol_context_t * con);
26
27extern int sepol_context_set_type(sepol_handle_t * handle,
28				  sepol_context_t * con, const char *type);
29
30/* MLS */
31extern const char *sepol_context_get_mls(const sepol_context_t * con);
32
33extern int sepol_context_set_mls(sepol_handle_t * handle,
34				 sepol_context_t * con, const char *mls_range);
35
36/* Create/Clone/Destroy */
37extern int sepol_context_create(sepol_handle_t * handle,
38				sepol_context_t ** con_ptr);
39
40extern int sepol_context_clone(sepol_handle_t * handle,
41			       const sepol_context_t * con,
42			       sepol_context_t ** con_ptr);
43
44extern void sepol_context_free(sepol_context_t * con);
45
46/* Parse to/from string */
47extern int sepol_context_from_string(sepol_handle_t * handle,
48				     const char *str, sepol_context_t ** con);
49
50extern int sepol_context_to_string(sepol_handle_t * handle,
51				   const sepol_context_t * con, char **str_ptr);
52
53#endif
54