diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2008-10-08 05:35:00 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2008-10-08 05:35:00 -0400 |
commit | 7e9c6eeb136a46dfd941852803b3a9dd78939b69 (patch) | |
tree | 441776a1c5b750f0e11b56e87b9804144d0b72ae /include | |
parent | 079aa88fe7172b7650c7cf2c0bc01662bafea236 (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.h | 14 |
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 | ||
55 | enum { | ||
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 | |||
55 | union nf_inet_addr { | 65 | union 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[]; | |||
138 | extern struct ctl_path nf_net_ipv4_netfilter_sysctl_path[]; | 148 | extern struct ctl_path nf_net_ipv4_netfilter_sysctl_path[]; |
139 | #endif /* CONFIG_SYSCTL */ | 149 | #endif /* CONFIG_SYSCTL */ |
140 | 150 | ||
141 | extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; | 151 | extern struct list_head nf_hooks[NFPROTO_NUMPROTO][NF_MAX_HOOKS]; |
142 | 152 | ||
143 | int nf_hook_slow(u_int8_t pf, unsigned int hook, struct sk_buff *skb, | 153 | int 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 | ||
250 | extern const struct nf_afinfo *nf_afinfo[NPROTO]; | 260 | extern const struct nf_afinfo *nf_afinfo[NFPROTO_NUMPROTO]; |
251 | static inline const struct nf_afinfo *nf_get_afinfo(unsigned short family) | 261 | static 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]); |