Lines Matching refs:handle
7 #include "handle.h"
14 static int node_from_record(sepol_handle_t * handle,
30 if (sepol_node_get_addr_bytes(handle, data, &addr_buf, &addr_bsize) < 0)
32 if (sepol_node_get_mask_bytes(handle, data, &mask_buf, &mask_bsize) < 0)
47 ERR(handle, "unsupported protocol %u", proto);
56 if (context_from_record(handle, policydb, &tmp_con,
68 ERR(handle, "out of memory");
79 ERR(handle, "could not create node structure");
83 static int node_to_record(sepol_handle_t * handle,
93 if (sepol_node_create(handle, &tmp_record) < 0)
101 if (sepol_node_set_addr_bytes(handle, tmp_record,
106 if (sepol_node_set_mask_bytes(handle, tmp_record,
113 if (sepol_node_set_addr_bytes(handle, tmp_record,
118 if (sepol_node_set_mask_bytes(handle, tmp_record,
125 ERR(handle, "unsupported protocol %u", proto);
129 if (context_to_record(handle, policydb, con, &tmp_con) < 0)
132 if (sepol_node_set_con(handle, tmp_record, tmp_con) < 0)
140 ERR(handle, "could not convert node to record");
147 extern int sepol_node_count(sepol_handle_t * handle __attribute__ ((unused)),
165 handle = NULL;
170 int sepol_node_exists(sepol_handle_t * handle,
216 ERR(handle, "unsupported protocol %u", proto);
224 ERR(handle, "could not check if node %s/%s (%s) exists",
230 int sepol_node_query(sepol_handle_t * handle,
254 if (node_to_record(handle, policydb,
273 if (node_to_record(handle, policydb,
282 ERR(handle, "unsupported protocol %u", proto);
289 ERR(handle, "could not query node %s/%s (%s)",
296 int sepol_node_modify(sepol_handle_t * handle,
309 if (node_from_record(handle, policydb, &node, data) < 0)
329 ERR(handle, "unsupported protocol %u", proto);
336 ERR(handle, "could not load node %s/%s (%s)",
345 int sepol_node_iterate(sepol_handle_t * handle,
358 if (node_to_record(handle, policydb, c, SEPOL_PROTO_IP4, &node)
377 if (node_to_record(handle, policydb, c, SEPOL_PROTO_IP6, &node)
397 ERR(handle, "could not iterate over nodes");