Home | History | Annotate | Download | only in sepol
      1 #ifndef _SEPOL_IBENDPORTS_H_
      2 #define _SEPOL_IBENDPORTS_H_
      3 
      4 #include <sepol/handle.h>
      5 #include <sepol/policydb.h>
      6 #include <sepol/ibendport_record.h>
      7 
      8 #ifdef __cplusplus
      9 extern "C" {
     10 #endif
     11 
     12 /* Return the number of ibendports */
     13 extern int sepol_ibendport_count(sepol_handle_t *handle,
     14 				 const sepol_policydb_t *p,
     15 				 unsigned int *response);
     16 
     17 /* Check if a ibendport exists */
     18 extern int sepol_ibendport_exists(sepol_handle_t *handle,
     19 				  const sepol_policydb_t *policydb,
     20 				  const sepol_ibendport_key_t *key, int *response);
     21 
     22 /* Query a ibendport - returns the ibendport, or NULL if not found */
     23 extern int sepol_ibendport_query(sepol_handle_t *handle,
     24 				 const sepol_policydb_t *policydb,
     25 				 const sepol_ibendport_key_t *key,
     26 				 sepol_ibendport_t **response);
     27 
     28 /* Modify a ibendport, or add it, if the key is not found */
     29 extern int sepol_ibendport_modify(sepol_handle_t *handle,
     30 				  sepol_policydb_t *policydb,
     31 				  const sepol_ibendport_key_t *key,
     32 				  const sepol_ibendport_t *data);
     33 
     34 /* Iterate the ibendports
     35  * The handler may return:
     36  * -1 to signal an error condition,
     37  * 1 to signal successful exit
     38  * 0 to signal continue
     39  */
     40 extern int sepol_ibendport_iterate(sepol_handle_t *handle,
     41 				   const sepol_policydb_t *policydb,
     42 				   int (*fn)(const sepol_ibendport_t *ibendport,
     43 					     void *fn_arg), void *arg);
     44 
     45 
     46 #ifdef __cplusplus
     47 }
     48 #endif
     49 
     50 #endif
     51