···331331 const char *name, struct ip_set **set);332332extern void ip_set_put_byindex(struct net *net, ip_set_id_t index);333333extern const char *ip_set_name_byindex(struct net *net, ip_set_id_t index);334334-extern ip_set_id_t ip_set_nfnl_get(struct net *net, const char *name);335334extern ip_set_id_t ip_set_nfnl_get_byindex(struct net *net, ip_set_id_t index);336335extern void ip_set_nfnl_put(struct net *net, ip_set_id_t index);337336
-28
net/netfilter/ipset/ip_set_core.c
···625625 */626626627627/*628628- * Find set by name, reference it once. The reference makes sure the629629- * thing pointed to, does not go away under our feet.630630- *631631- * The nfnl mutex is used in the function.632632- */633633-ip_set_id_t634634-ip_set_nfnl_get(struct net *net, const char *name)635635-{636636- ip_set_id_t i, index = IPSET_INVALID_ID;637637- struct ip_set *s;638638- struct ip_set_net *inst = ip_set_pernet(net);639639-640640- nfnl_lock(NFNL_SUBSYS_IPSET);641641- for (i = 0; i < inst->ip_set_max; i++) {642642- s = nfnl_set(inst, i);643643- if (s != NULL && STREQ(s->name, name)) {644644- __ip_set_get(s);645645- index = i;646646- break;647647- }648648- }649649- nfnl_unlock(NFNL_SUBSYS_IPSET);650650-651651- return index;652652-}653653-EXPORT_SYMBOL_GPL(ip_set_nfnl_get);654654-655655-/*656628 * Find set by index, reference it once. The reference makes sure the657629 * thing pointed to, does not go away under our feet.658630 *