interfaces.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef __SEPOL_INTERFACES_H_
  2. #define __SEPOL_INTERFACES_H_
  3. #include <sepol/policydb.h>
  4. #include <sepol/iface_record.h>
  5. #include <sepol/handle.h>
  6. /* Return the number of interfaces */
  7. extern int sepol_iface_count(sepol_handle_t * handle,
  8. const sepol_policydb_t * policydb,
  9. unsigned int *response);
  10. /* Check if an interface exists */
  11. extern int sepol_iface_exists(sepol_handle_t * handle,
  12. const sepol_policydb_t * policydb,
  13. const sepol_iface_key_t * key, int *response);
  14. /* Query an interface - returns the interface,
  15. * or NULL if not found */
  16. extern int sepol_iface_query(sepol_handle_t * handle,
  17. const sepol_policydb_t * policydb,
  18. const sepol_iface_key_t * key,
  19. sepol_iface_t ** response);
  20. /* Modify an interface, or add it, if the key
  21. * is not found */
  22. extern int sepol_iface_modify(sepol_handle_t * handle,
  23. sepol_policydb_t * policydb,
  24. const sepol_iface_key_t * key,
  25. const sepol_iface_t * data);
  26. /* Iterate the interfaces
  27. * The handler may return:
  28. * -1 to signal an error condition,
  29. * 1 to signal successful exit
  30. * 0 to signal continue */
  31. extern int sepol_iface_iterate(sepol_handle_t * handle,
  32. const sepol_policydb_t * policydb,
  33. int (*fn) (const sepol_iface_t * iface,
  34. void *fn_arg), void *arg);
  35. #endif