1 /*Copyright (C) 2005 Red Hat, Inc. */ 2 3 #ifndef _SEMANAGE_IBENDPORT_RECORD_H_ 4 #define _SEMANAGE_IBENDPORT_RECORD_H_ 5 6 #include <semanage/context_record.h> 7 #include <semanage/handle.h> 8 #include <stddef.h> 9 10 #ifndef _SEMANAGE_IBENDPORT_DEFINED_ 11 struct semanage_ibendport; 12 struct semanage_ibendport_key; 13 typedef struct semanage_ibendport semanage_ibendport_t; 14 typedef struct semanage_ibendport_key semanage_ibendport_key_t; 15 #define _SEMANAGE_IBENDPORT_DEFINED_ 16 #endif 17 18 extern int semanage_ibendport_compare(const semanage_ibendport_t *ibendport, 19 const semanage_ibendport_key_t *key); 20 21 extern int semanage_ibendport_compare2(const semanage_ibendport_t *ibendport, 22 const semanage_ibendport_t *ibendport2); 23 24 extern int semanage_ibendport_key_create(semanage_handle_t *handle, 25 const char *ibdev_name, 26 int port, 27 semanage_ibendport_key_t **key_ptr); 28 29 extern int semanage_ibendport_key_extract(semanage_handle_t *handle, 30 const semanage_ibendport_t *ibendport, 31 semanage_ibendport_key_t **key_ptr); 32 33 extern void semanage_ibendport_key_free(semanage_ibendport_key_t *key); 34 35 extern int semanage_ibendport_get_ibdev_name(semanage_handle_t *handle, 36 const semanage_ibendport_t *ibendport, 37 char **ibdev_name_ptr); 38 39 extern int semanage_ibendport_set_ibdev_name(semanage_handle_t *handle, 40 semanage_ibendport_t *ibendport, 41 const char *ibdev_name); 42 43 extern int semanage_ibendport_get_port(const semanage_ibendport_t *ibendport); 44 45 extern void semanage_ibendport_set_port(semanage_ibendport_t *ibendport, int port); 46 47 extern semanage_context_t *semanage_ibendport_get_con(const semanage_ibendport_t *ibendport); 48 49 extern int semanage_ibendport_set_con(semanage_handle_t *handle, 50 semanage_ibendport_t *ibendport, 51 semanage_context_t *con); 52 53 extern int semanage_ibendport_create(semanage_handle_t *handle, 54 semanage_ibendport_t **ibendport_ptr); 55 56 extern int semanage_ibendport_clone(semanage_handle_t *handle, 57 const semanage_ibendport_t *ibendport, 58 semanage_ibendport_t **ibendport_ptr); 59 60 extern void semanage_ibendport_free(semanage_ibendport_t *ibendport); 61 62 #endif 63