Lines Matching defs:port

3  * Network port table
60 * sel_netport_hashfn - Hashing function for the port table
61 * @pnum: port number
64 * This is the hashing function for the port table, it returns the bucket
65 * number for the given port.
74 * sel_netport_find - Search for a port record
76 * @pnum: port
79 * Search the network port table and return the matching record. If an entry
86 struct sel_netport *port;
89 list_for_each_entry_rcu(port, &sel_netport_hash[idx].list, list)
90 if (port->psec.port == pnum && port->psec.protocol == protocol)
91 return port;
97 * sel_netport_insert - Insert a new port into the table
98 * @port: the new port record
101 * Add a new port record to the network address hash table.
104 static void sel_netport_insert(struct sel_netport *port)
110 idx = sel_netport_hashfn(port->psec.port);
111 list_add_rcu(&port->list, &sel_netport_hash[idx].list);
128 * @pnum: port
129 * @sid: port SID
132 * This function determines the SID of a network port by querying the security
133 * policy. The result is added to the network port table to speedup future
140 struct sel_netport *port;
144 port = sel_netport_find(protocol, pnum);
145 if (port != NULL) {
146 *sid = port->psec.sid;
156 new->psec.port = pnum;
165 pr_warn("SELinux: failure in %s(), unable to determine network port label\n",
171 * sel_netport_sid - Lookup the SID of a network port
173 * @pnum: port
174 * @sid: port SID
177 * This function determines the SID of a network port using the fastest method
178 * possible. First the port table is queried, but if an entry can't be found
185 struct sel_netport *port;
188 port = sel_netport_find(protocol, pnum);
189 if (port != NULL) {
190 *sid = port->psec.sid;
200 * sel_netport_flush - Flush the entire network port table
209 struct sel_netport *port, *port_tmp;
213 list_for_each_entry_safe(port, port_tmp,
215 list_del_rcu(&port->list);
216 kfree_rcu(port, rcu);