aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2008-10-08 05:35:00 -0400
committerPatrick McHardy <kaber@trash.net>2008-10-08 05:35:00 -0400
commit7e9c6eeb136a46dfd941852803b3a9dd78939b69 (patch)
tree441776a1c5b750f0e11b56e87b9804144d0b72ae /include
parent079aa88fe7172b7650c7cf2c0bc01662bafea236 (diff)
netfilter: Introduce NFPROTO_* constants
The netfilter subsystem only supports a handful of protocols (much less than PF_*) and even non-PF protocols like ARP and pseudo-protocols like PF_BRIDGE. By creating NFPROTO_*, we can earn a few memory savings on arrays that previously were always PF_MAX-sized and keep the pseudo-protocols to ourselves. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netfilter.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 8c83d2e23bde..bf3afb0844f7 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -52,6 +52,16 @@ enum nf_inet_hooks {
52 NF_INET_NUMHOOKS 52 NF_INET_NUMHOOKS
53}; 53};
54 54
55enum {
56 NFPROTO_UNSPEC = 0,
57 NFPROTO_IPV4 = 2,
58 NFPROTO_ARP = 3,
59 NFPROTO_BRIDGE = 7,
60 NFPROTO_IPV6 = 10,
61 NFPROTO_DECNET = 12,
62 NFPROTO_NUMPROTO,
63};
64
55union nf_inet_addr { 65union nf_inet_addr {
56 __u32 all[4]; 66 __u32 all[4];
57 __be32 ip; 67 __be32 ip;
@@ -138,7 +148,7 @@ extern struct ctl_path nf_net_netfilter_sysctl_path[];
138extern struct ctl_path nf_net_ipv4_netfilter_sysctl_path[]; 148extern struct ctl_path nf_net_ipv4_netfilter_sysctl_path[];
139#endif /* CONFIG_SYSCTL */ 149#endif /* CONFIG_SYSCTL */
140 150
141extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; 151extern struct list_head nf_hooks[NFPROTO_NUMPROTO][NF_MAX_HOOKS];
142 152
143int nf_hook_slow(u_int8_t pf, unsigned int hook, struct sk_buff *skb, 153int nf_hook_slow(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
144 struct net_device *indev, struct net_device *outdev, 154 struct net_device *indev, struct net_device *outdev,
@@ -247,7 +257,7 @@ struct nf_afinfo {
247 int route_key_size; 257 int route_key_size;
248}; 258};
249 259
250extern const struct nf_afinfo *nf_afinfo[NPROTO]; 260extern const struct nf_afinfo *nf_afinfo[NFPROTO_NUMPROTO];
251static inline const struct nf_afinfo *nf_get_afinfo(unsigned short family) 261static inline const struct nf_afinfo *nf_get_afinfo(unsigned short family)
252{ 262{
253 return rcu_dereference(nf_afinfo[family]); 263 return rcu_dereference(nf_afinfo[family]);