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