Lines Matching refs:port

53 /* Create a low level port structure from
57 ocontext_t ** port, const sepol_port_t * data)
76 tmp_port->u.port.protocol = tmp_proto;
79 tmp_port->u.port.low_port = low;
80 tmp_port->u.port.high_port = high;
81 if (tmp_port->u.port.low_port > tmp_port->u.port.high_port) {
82 ERR(handle, "low port %d exceeds high port %d",
83 tmp_port->u.port.low_port, tmp_port->u.port.high_port);
96 *port = tmp_port;
109 ERR(handle, "could not create port structure for range %u:%u (%s)",
116 ocontext_t * port, sepol_port_t ** record)
119 int proto = port->u.port.protocol;
120 int low = port->u.port.low_port;
121 int high = port->u.port.high_port;
122 context_struct_t *con = &port->context[0];
149 ERR(handle, "could not convert port range %u - %u (%s) "
174 /* Check if a port exists */
193 int proto2 = c->u.port.protocol;
194 int low2 = c->u.port.low_port;
195 int high2 = c->u.port.high_port;
207 ERR(handle, "could not check if port range %u - %u (%s) exists",
212 /* Query a port */
231 int proto2 = c->u.port.protocol;
232 int low2 = c->u.port.low_port;
233 int high2 = c->u.port.high_port;
246 ERR(handle, "could not query port range %u - %u (%s)",
252 /* Load a port into policy */
259 ocontext_t *port = NULL;
270 if (port_from_record(handle, policydb, &port, data) < 0)
274 port->next = policydb->ocontexts[OCON_PORT];
275 policydb->ocontexts[OCON_PORT] = port;
280 ERR(handle, "could not load port range %u - %u (%s)",
282 if (port != NULL) {
283 context_destroy(&port->context[0]);
284 free(port);
291 int (*fn) (const sepol_port_t * port,
297 sepol_port_t *port = NULL;
303 if (port_to_record(handle, policydb, c, &port) < 0)
307 status = fn(port, arg);
311 sepol_port_free(port);
312 port = NULL;
323 sepol_port_free(port);