Lines Matching defs:port

3  * Network port table
61 * sel_netport_hashfn - Hashing function for the port table
62 * @pnum: port number
65 * This is the hashing function for the port table, it returns the bucket
66 * number for the given port.
75 * sel_netport_find - Search for a port record
77 * @port: pnum
80 * Search the network port table and return the matching record. If an entry
87 struct sel_netport *port;
90 list_for_each_entry_rcu(port, &sel_netport_hash[idx].list, list)
91 if (port->psec.port == pnum && port->psec.protocol == protocol)
92 return port;
98 * sel_netport_insert - Insert a new port into the table
99 * @port: the new port record
102 * Add a new port record to the network address hash table.
105 static void sel_netport_insert(struct sel_netport *port)
111 idx = sel_netport_hashfn(port->psec.port);
112 list_add_rcu(&port->list, &sel_netport_hash[idx].list);
129 * @pnum: port
130 * @sid: port SID
133 * This function determines the SID of a network port by querying the security
134 * policy. The result is added to the network port table to speedup future
141 struct sel_netport *port;
145 port = sel_netport_find(protocol, pnum);
146 if (port != NULL) {
147 *sid = port->psec.sid;
157 new->psec.port = pnum;
166 pr_warn("SELinux: failure in %s(), unable to determine network port label\n",
172 * sel_netport_sid - Lookup the SID of a network port
174 * @pnum: port
175 * @sid: port SID
178 * This function determines the SID of a network port using the fastest method
179 * possible. First the port table is queried, but if an entry can't be found
186 struct sel_netport *port;
189 port = sel_netport_find(protocol, pnum);
190 if (port != NULL) {
191 *sid = port->psec.sid;
201 * sel_netport_flush - Flush the entire network port table
210 struct sel_netport *port, *port_tmp;
214 list_for_each_entry_safe(port, port_tmp,
216 list_del_rcu(&port->list);
217 kfree_rcu(port, rcu);