nodes.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef _SEPOL_NODES_H_
  2. #define _SEPOL_NODES_H_
  3. #include <sepol/handle.h>
  4. #include <sepol/policydb.h>
  5. #include <sepol/node_record.h>
  6. /* Return the number of nodes */
  7. extern int sepol_node_count(sepol_handle_t * handle,
  8. const sepol_policydb_t * p, unsigned int *response);
  9. /* Check if a node exists */
  10. extern int sepol_node_exists(sepol_handle_t * handle,
  11. const sepol_policydb_t * policydb,
  12. const sepol_node_key_t * key, int *response);
  13. /* Query a node - returns the node, or NULL if not found */
  14. extern int sepol_node_query(sepol_handle_t * handle,
  15. const sepol_policydb_t * policydb,
  16. const sepol_node_key_t * key,
  17. sepol_node_t ** response);
  18. /* Modify a node, or add it, if the key is not found */
  19. extern int sepol_node_modify(sepol_handle_t * handle,
  20. sepol_policydb_t * policydb,
  21. const sepol_node_key_t * key,
  22. const sepol_node_t * data);
  23. /* Iterate the nodes
  24. * The handler may return:
  25. * -1 to signal an error condition,
  26. * 1 to signal successful exit
  27. * 0 to signal continue */
  28. extern int sepol_node_iterate(sepol_handle_t * handle,
  29. const sepol_policydb_t * policydb,
  30. int (*fn) (const sepol_node_t * node,
  31. void *fn_arg), void *arg);
  32. #endif