1 /* Copyright (C) 2005 Red Hat, Inc. */
2 
3 struct semanage_iface;
4 struct semanage_iface_key;
5 typedef struct semanage_iface_key record_key_t;
6 typedef struct semanage_iface record_t;
7 #define DBASE_RECORD_DEFINED
8 
9 #include "iface_internal.h"
10 #include "handle.h"
11 #include "database.h"
12 
semanage_iface_query(semanage_handle_t * handle,const semanage_iface_key_t * key,semanage_iface_t ** response)13 int semanage_iface_query(semanage_handle_t * handle,
14 			 const semanage_iface_key_t * key,
15 			 semanage_iface_t ** response)
16 {
17 
18 	dbase_config_t *dconfig = semanage_iface_dbase_policy(handle);
19 	return dbase_query(handle, dconfig, key, response);
20 }
21 
semanage_iface_exists(semanage_handle_t * handle,const semanage_iface_key_t * key,int * response)22 int semanage_iface_exists(semanage_handle_t * handle,
23 			  const semanage_iface_key_t * key, int *response)
24 {
25 
26 	dbase_config_t *dconfig = semanage_iface_dbase_policy(handle);
27 	return dbase_exists(handle, dconfig, key, response);
28 }
29 
semanage_iface_count(semanage_handle_t * handle,unsigned int * response)30 int semanage_iface_count(semanage_handle_t * handle, unsigned int *response)
31 {
32 
33 	dbase_config_t *dconfig = semanage_iface_dbase_policy(handle);
34 	return dbase_count(handle, dconfig, response);
35 }
36 
semanage_iface_iterate(semanage_handle_t * handle,int (* handler)(const semanage_iface_t * record,void * varg),void * handler_arg)37 int semanage_iface_iterate(semanage_handle_t * handle,
38 			   int (*handler) (const semanage_iface_t * record,
39 					   void *varg), void *handler_arg)
40 {
41 
42 	dbase_config_t *dconfig = semanage_iface_dbase_policy(handle);
43 	return dbase_iterate(handle, dconfig, handler, handler_arg);
44 }
45 
semanage_iface_list(semanage_handle_t * handle,semanage_iface_t *** records,unsigned int * count)46 int semanage_iface_list(semanage_handle_t * handle,
47 			semanage_iface_t *** records, unsigned int *count)
48 {
49 
50 	dbase_config_t *dconfig = semanage_iface_dbase_policy(handle);
51 	return dbase_list(handle, dconfig, records, count);
52 }
53