Lines Matching defs:port
39 /* Create a low level port structure from
43 ocontext_t ** port, const sepol_port_t * data)
62 tmp_port->u.port.protocol = tmp_proto;
64 /* Port range */
65 tmp_port->u.port.low_port = low;
66 tmp_port->u.port.high_port = high;
67 if (tmp_port->u.port.low_port > tmp_port->u.port.high_port) {
68 ERR(handle, "low port %d exceeds high port %d",
69 tmp_port->u.port.low_port, tmp_port->u.port.high_port);
82 *port = tmp_port;
95 ERR(handle, "could not create port structure for range %u:%u (%s)",
102 ocontext_t * port, sepol_port_t ** record)
105 int proto = port->u.port.protocol;
106 int low = port->u.port.low_port;
107 int high = port->u.port.high_port;
108 context_struct_t *con = &port->context[0];
135 ERR(handle, "could not convert port range %u - %u (%s) "
161 /* Check if a port exists */
180 int proto2 = c->u.port.protocol;
181 int low2 = c->u.port.low_port;
182 int high2 = c->u.port.high_port;
194 ERR(handle, "could not check if port range %u - %u (%s) exists",
199 /* Query a port */
218 int proto2 = c->u.port.protocol;
219 int low2 = c->u.port.low_port;
220 int high2 = c->u.port.high_port;
233 ERR(handle, "could not query port range %u - %u (%s)",
239 /* Load a port into policy */
246 ocontext_t *port = NULL;
257 if (port_from_record(handle, policydb, &port, data) < 0)
261 port->next = policydb->ocontexts[OCON_PORT];
262 policydb->ocontexts[OCON_PORT] = port;
267 ERR(handle, "could not load port range %u - %u (%s)",
269 if (port != NULL) {
270 context_destroy(&port->context[0]);
271 free(port);
278 int (*fn) (const sepol_port_t * port,
284 sepol_port_t *port = NULL;
290 if (port_to_record(handle, policydb, c, &port) < 0)
294 status = fn(port, arg);
298 sepol_port_free(port);
299 port = NULL;
310 sepol_port_free(port);