1 /* Copyright (C) 2005 Red Hat, Inc. */
2 
3 #ifndef _SEMANAGE_IFACE_RECORD_H_
4 #define _SEMANAGE_IFACE_RECORD_H_
5 
6 #include <semanage/context_record.h>
7 #include <semanage/handle.h>
8 
9 #ifndef _SEMANAGE_IFACE_DEFINED_
10 struct semanage_iface;
11 struct semanage_iface_key;
12 typedef struct semanage_iface semanage_iface_t;
13 typedef struct semanage_iface_key semanage_iface_key_t;
14 #define _SEMANAGE_IFACE_DEFINED_
15 #endif
16 
17 /* Key */
18 extern int semanage_iface_compare(const semanage_iface_t * iface,
19 				  const semanage_iface_key_t * key);
20 
21 extern int semanage_iface_compare2(const semanage_iface_t * iface,
22 				   const semanage_iface_t * iface2);
23 
24 extern int semanage_iface_key_create(semanage_handle_t * handle,
25 				     const char *name,
26 				     semanage_iface_key_t ** key_ptr);
27 
28 extern int semanage_iface_key_extract(semanage_handle_t * handle,
29 				      const semanage_iface_t * iface,
30 				      semanage_iface_key_t ** key_ptr);
31 
32 extern void semanage_iface_key_free(semanage_iface_key_t * key);
33 
34 /* Name */
35 extern const char *semanage_iface_get_name(const semanage_iface_t * iface);
36 
37 extern int semanage_iface_set_name(semanage_handle_t * handle,
38 				   semanage_iface_t * iface, const char *name);
39 
40 /* Context */
41 extern semanage_context_t *semanage_iface_get_ifcon(const semanage_iface_t *
42 						    iface);
43 
44 extern int semanage_iface_set_ifcon(semanage_handle_t * handle,
45 				    semanage_iface_t * iface,
46 				    semanage_context_t * con);
47 
48 extern semanage_context_t *semanage_iface_get_msgcon(const semanage_iface_t *
49 						     iface);
50 
51 extern int semanage_iface_set_msgcon(semanage_handle_t * handle,
52 				     semanage_iface_t * iface,
53 				     semanage_context_t * con);
54 
55 /* Create/Clone/Destroy */
56 extern int semanage_iface_create(semanage_handle_t * handle,
57 				 semanage_iface_t ** iface_ptr);
58 
59 extern int semanage_iface_clone(semanage_handle_t * handle,
60 				const semanage_iface_t * iface,
61 				semanage_iface_t ** iface_ptr);
62 
63 extern void semanage_iface_free(semanage_iface_t * iface);
64 
65 #endif
66