1 /* Copyright (C) 2017 Mellanox Technologies Inc. */
2
3 struct semanage_ibpkey;
4 struct semanage_ibpkey_key;
5 typedef struct semanage_ibpkey_key record_key_t;
6 typedef struct semanage_ibpkey record_t;
7 #define DBASE_RECORD_DEFINED
8
9 #include "ibpkey_internal.h"
10 #include "handle.h"
11 #include "database.h"
12
semanage_ibpkey_query(semanage_handle_t * handle,const semanage_ibpkey_key_t * key,semanage_ibpkey_t ** response)13 int semanage_ibpkey_query(semanage_handle_t *handle,
14 const semanage_ibpkey_key_t *key,
15 semanage_ibpkey_t **response)
16 {
17 dbase_config_t *dconfig = semanage_ibpkey_dbase_policy(handle);
18
19 return dbase_query(handle, dconfig, key, response);
20 }
21
semanage_ibpkey_exists(semanage_handle_t * handle,const semanage_ibpkey_key_t * key,int * response)22 int semanage_ibpkey_exists(semanage_handle_t *handle,
23 const semanage_ibpkey_key_t *key, int *response)
24 {
25 dbase_config_t *dconfig = semanage_ibpkey_dbase_policy(handle);
26
27 return dbase_exists(handle, dconfig, key, response);
28 }
29
semanage_ibpkey_count(semanage_handle_t * handle,unsigned int * response)30 int semanage_ibpkey_count(semanage_handle_t *handle, unsigned int *response)
31 {
32 dbase_config_t *dconfig = semanage_ibpkey_dbase_policy(handle);
33
34 return dbase_count(handle, dconfig, response);
35 }
36
semanage_ibpkey_iterate(semanage_handle_t * handle,int (* handler)(const semanage_ibpkey_t * record,void * varg),void * handler_arg)37 int semanage_ibpkey_iterate(semanage_handle_t *handle,
38 int (*handler)(const semanage_ibpkey_t *record,
39 void *varg), void *handler_arg)
40 {
41 dbase_config_t *dconfig = semanage_ibpkey_dbase_policy(handle);
42
43 return dbase_iterate(handle, dconfig, handler, handler_arg);
44 }
45
semanage_ibpkey_list(semanage_handle_t * handle,semanage_ibpkey_t *** records,unsigned int * count)46 int semanage_ibpkey_list(semanage_handle_t *handle,
47 semanage_ibpkey_t ***records, unsigned int *count)
48 {
49 dbase_config_t *dconfig = semanage_ibpkey_dbase_policy(handle);
50
51 return dbase_list(handle, dconfig, records, count);
52 }
53