Lines Matching refs:handle

6 #include "handle.h"
11 static inline int sepol2ipproto(sepol_handle_t * handle, int proto)
20 ERR(handle, "unsupported protocol %u", proto);
25 static inline int ipproto2sepol(sepol_handle_t * handle, int proto)
34 ERR(handle, "invalid protocol %u " "found in policy", proto);
41 static int port_from_record(sepol_handle_t * handle,
59 tmp_proto = sepol2ipproto(handle, proto);
68 ERR(handle, "low port %d exceeds high port %d",
74 if (context_from_record(handle, policydb, &tmp_con,
86 ERR(handle, "out of memory");
95 ERR(handle, "could not create port structure for range %u:%u (%s)",
100 static int port_to_record(sepol_handle_t * handle,
114 if (sepol_port_create(handle, &tmp_record) < 0)
117 rec_proto = ipproto2sepol(handle, proto);
124 if (context_to_record(handle, policydb, con, &tmp_con) < 0)
127 if (sepol_port_set_con(handle, tmp_record, tmp_con) < 0)
135 ERR(handle, "could not convert port range %u - %u (%s) "
143 extern int sepol_port_count(sepol_handle_t * handle __attribute__ ((unused)),
157 handle = NULL;
162 int sepol_port_exists(sepol_handle_t * handle,
174 proto = sepol2ipproto(handle, proto);
194 ERR(handle, "could not check if port range %u - %u (%s) exists",
200 int sepol_port_query(sepol_handle_t * handle,
212 proto = sepol2ipproto(handle, proto);
223 if (port_to_record(handle, policydb, c, response) < 0)
233 ERR(handle, "could not query port range %u - %u (%s)",
240 int sepol_port_modify(sepol_handle_t * handle,
253 proto = sepol2ipproto(handle, proto);
257 if (port_from_record(handle, policydb, &port, data) < 0)
267 ERR(handle, "could not load port range %u - %u (%s)",
276 int sepol_port_iterate(sepol_handle_t * handle,
290 if (port_to_record(handle, policydb, c, &port) < 0)
309 ERR(handle, "could not iterate over ports");