diff options
author | Patrick McHardy <kaber@trash.net> | 2006-04-06 21:18:09 (GMT) |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-04-10 05:25:40 (GMT) |
commit | bce8032ef3cc58170ab3550e9e271dba7b4c4764 (patch) | |
tree | 13dbdf12a6c567c3292daad4604eb55f7abd167e /net/netfilter/core.c | |
parent | a0aed49bdb2bbb4234789f241cffb607fd2e213d (diff) | |
download | linux-bce8032ef3cc58170ab3550e9e271dba7b4c4764.tar.xz |
[NETFILTER]: Introduce infrastructure for address family specific operations
Change the queue rerouter intrastructure to a generic usable
infrastructure for address family specific operations as a base for
some cleanups.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter/core.c')
-rw-r--r-- | net/netfilter/core.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/net/netfilter/core.c b/net/netfilter/core.c index 645d621..8455a32 100644 --- a/net/netfilter/core.c +++ b/net/netfilter/core.c @@ -27,6 +27,29 @@ #include "nf_internals.h" +static DEFINE_SPINLOCK(afinfo_lock); + +struct nf_afinfo *nf_afinfo[NPROTO]; +EXPORT_SYMBOL(nf_afinfo); + +int nf_register_afinfo(struct nf_afinfo *afinfo) +{ + spin_lock(&afinfo_lock); + rcu_assign_pointer(nf_afinfo[afinfo->family], afinfo); + spin_unlock(&afinfo_lock); + return 0; +} +EXPORT_SYMBOL_GPL(nf_register_afinfo); + +void nf_unregister_afinfo(struct nf_afinfo *afinfo) +{ + spin_lock(&afinfo_lock); + rcu_assign_pointer(nf_afinfo[afinfo->family], NULL); + spin_unlock(&afinfo_lock); + synchronize_rcu(); +} +EXPORT_SYMBOL_GPL(nf_unregister_afinfo); + /* In this code, we can be waiting indefinitely for userspace to * service a packet if a hook returns NF_QUEUE. We could keep a count * of skbuffs queued for userspace, and not deregister a hook unless |