| 1 |
#ifndef _SEPOL_IBENDPORT_RECORD_H_ |
| 2 |
#define _SEPOL_IBENDPORT_RECORD_H_ |
| 3 |
|
| 4 |
#include <stddef.h> |
| 5 |
#include <sepol/context_record.h> |
| 6 |
#include <sepol/handle.h> |
| 7 |
|
| 8 |
#ifdef __cplusplus |
| 9 |
extern "C" { |
| 10 |
#endif |
| 11 |
|
| 12 |
struct sepol_ibendport; |
| 13 |
struct sepol_ibendport_key; |
| 14 |
typedef struct sepol_ibendport sepol_ibendport_t; |
| 15 |
typedef struct sepol_ibendport_key sepol_ibendport_key_t; |
| 16 |
|
| 17 |
extern int sepol_ibendport_compare(const sepol_ibendport_t *ibendport, |
| 18 |
const sepol_ibendport_key_t *key); |
| 19 |
|
| 20 |
extern int sepol_ibendport_compare2(const sepol_ibendport_t *ibendport, |
| 21 |
const sepol_ibendport_t *ibendport2); |
| 22 |
|
| 23 |
extern int sepol_ibendport_key_create(sepol_handle_t *handle, |
| 24 |
const char *ibdev_name, |
| 25 |
int port, |
| 26 |
sepol_ibendport_key_t **key_ptr); |
| 27 |
|
| 28 |
extern void sepol_ibendport_key_unpack(const sepol_ibendport_key_t *key, |
| 29 |
const char **ibdev_name, |
| 30 |
int *port); |
| 31 |
|
| 32 |
extern int sepol_ibendport_alloc_ibdev_name(sepol_handle_t *handle, |
| 33 |
char **ibdev_name); |
| 34 |
|
| 35 |
extern int sepol_ibendport_key_extract(sepol_handle_t *handle, |
| 36 |
const sepol_ibendport_t *ibendport, |
| 37 |
sepol_ibendport_key_t **key_ptr); |
| 38 |
|
| 39 |
extern void sepol_ibendport_key_free(sepol_ibendport_key_t *key); |
| 40 |
|
| 41 |
extern void sepol_ibendport_set_port(sepol_ibendport_t *ibendport, int port); |
| 42 |
|
| 43 |
extern int sepol_ibendport_get_port(const sepol_ibendport_t *ibendport); |
| 44 |
|
| 45 |
extern int sepol_ibendport_get_ibdev_name(sepol_handle_t *handle, |
| 46 |
const sepol_ibendport_t *ibendport, |
| 47 |
char **ibdev_name); |
| 48 |
|
| 49 |
extern int sepol_ibendport_set_ibdev_name(sepol_handle_t *handle, |
| 50 |
sepol_ibendport_t *ibendport, |
| 51 |
const char *ibdev_name); |
| 52 |
|
| 53 |
extern sepol_context_t *sepol_ibendport_get_con(const sepol_ibendport_t *ibendport); |
| 54 |
|
| 55 |
extern int sepol_ibendport_set_con(sepol_handle_t *handle, |
| 56 |
sepol_ibendport_t *ibendport, |
| 57 |
sepol_context_t *con); |
| 58 |
|
| 59 |
extern int sepol_ibendport_create(sepol_handle_t *handle, |
| 60 |
sepol_ibendport_t **ibendport_ptr); |
| 61 |
|
| 62 |
extern int sepol_ibendport_clone(sepol_handle_t *handle, |
| 63 |
const sepol_ibendport_t *ibendport, |
| 64 |
sepol_ibendport_t **ibendport_ptr); |
| 65 |
|
| 66 |
extern void sepol_ibendport_free(sepol_ibendport_t *ibendport); |
| 67 |
|
| 68 |
#ifdef __cplusplus |
| 69 |
} |
| 70 |
#endif |
| 71 |
|
| 72 |
#endif |