Lines Matching refs:node
12 /* Create a low level node structure from
16 ocontext_t ** node, const sepol_node_t * data)
39 memcpy(&tmp_node->u.node.addr, addr_buf, addr_bsize);
40 memcpy(&tmp_node->u.node.mask, mask_buf, mask_bsize);
64 *node = tmp_node;
79 ERR(handle, "could not create node structure");
85 ocontext_t * node, int proto, sepol_node_t ** record)
88 context_struct_t *con = &node->context[0];
102 (const char *)&node->u.node.addr,
107 (const char *)&node->u.node.mask,
114 (const char *)&node->u.node6.addr,
119 (const char *)&node->u.node6.mask,
140 ERR(handle, "could not convert node to record");
169 /* Check if a node exists */
188 unsigned int *addr2 = &c->u.node.addr;
189 unsigned int *mask2 = &c->u.node.mask;
224 ERR(handle, "could not check if node %s/%s (%s) exists",
229 /* Query a node */
248 unsigned int *addr2 = &c->u.node.addr;
249 unsigned int *mask2 = &c->u.node.mask;
289 ERR(handle, "could not query node %s/%s (%s)",
295 /* Load a node into policy */
302 ocontext_t *node = NULL;
309 if (node_from_record(handle, policydb, &node, data) < 0)
317 node->next = policydb->ocontexts[OCON_NODE];
318 policydb->ocontexts[OCON_NODE] = node;
324 node->next = policydb->ocontexts[OCON_NODE6];
325 policydb->ocontexts[OCON_NODE6] = node;
336 ERR(handle, "could not load node %s/%s (%s)",
338 if (node != NULL) {
339 context_destroy(&node->context[0]);
340 free(node);
347 int (*fn) (const sepol_node_t * node,
353 sepol_node_t *node = NULL;
358 if (node_to_record(handle, policydb, c, SEPOL_PROTO_IP4, &node)
363 status = fn(node, arg);
367 sepol_node_free(node);
368 node = NULL;
377 if (node_to_record(handle, policydb, c, SEPOL_PROTO_IP6, &node)
382 status = fn(node, arg);
386 sepol_node_free(node);
387 node = NULL;
398 sepol_node_free(node);