diff options
| author | Florian Westphal <fw@strlen.de> | 2018-12-13 10:01:34 -0500 |
|---|---|---|
| committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-12-17 17:33:31 -0500 |
| commit | 5cbabeec1eb758233b35683123de446a57852932 (patch) | |
| tree | 2e629c74877b56930af5c2893a3f2edba50d9b44 /include/net | |
| parent | faec18dbb0405c7d4dda025054511dc3a6696918 (diff) | |
netfilter: nat: remove nf_nat_l4proto struct
This removes the (now empty) nf_nat_l4proto struct, all its instances
and all the no longer needed runtime (un)register functionality.
nf_nat_need_gre() can be axed as well: the module that calls it (to
load the no-longer-existing nat_gre module) also calls other nat core
functions. GRE nat is now always available if kernel is built with it.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/netfilter/nf_nat_l3proto.h | 2 | ||||
| -rw-r--r-- | include/net/netfilter/nf_nat_l4proto.h | 31 |
2 files changed, 0 insertions, 33 deletions
diff --git a/include/net/netfilter/nf_nat_l3proto.h b/include/net/netfilter/nf_nat_l3proto.h index 1ce0980da638..d774ca0c4c5e 100644 --- a/include/net/netfilter/nf_nat_l3proto.h +++ b/include/net/netfilter/nf_nat_l3proto.h | |||
| @@ -2,13 +2,11 @@ | |||
| 2 | #ifndef _NF_NAT_L3PROTO_H | 2 | #ifndef _NF_NAT_L3PROTO_H |
| 3 | #define _NF_NAT_L3PROTO_H | 3 | #define _NF_NAT_L3PROTO_H |
| 4 | 4 | ||
| 5 | struct nf_nat_l4proto; | ||
| 6 | struct nf_nat_l3proto { | 5 | struct nf_nat_l3proto { |
| 7 | u8 l3proto; | 6 | u8 l3proto; |
| 8 | 7 | ||
| 9 | bool (*manip_pkt)(struct sk_buff *skb, | 8 | bool (*manip_pkt)(struct sk_buff *skb, |
| 10 | unsigned int iphdroff, | 9 | unsigned int iphdroff, |
| 11 | const struct nf_nat_l4proto *l4proto, | ||
| 12 | const struct nf_conntrack_tuple *target, | 10 | const struct nf_conntrack_tuple *target, |
| 13 | enum nf_nat_manip_type maniptype); | 11 | enum nf_nat_manip_type maniptype); |
| 14 | 12 | ||
diff --git a/include/net/netfilter/nf_nat_l4proto.h b/include/net/netfilter/nf_nat_l4proto.h index 7b57bd302107..95a4655bd1ad 100644 --- a/include/net/netfilter/nf_nat_l4proto.h +++ b/include/net/netfilter/nf_nat_l4proto.h | |||
| @@ -5,43 +5,12 @@ | |||
| 5 | #include <net/netfilter/nf_nat.h> | 5 | #include <net/netfilter/nf_nat.h> |
| 6 | #include <linux/netfilter/nfnetlink_conntrack.h> | 6 | #include <linux/netfilter/nfnetlink_conntrack.h> |
| 7 | 7 | ||
| 8 | struct nf_nat_range; | ||
| 9 | struct nf_nat_l3proto; | 8 | struct nf_nat_l3proto; |
| 10 | 9 | ||
| 11 | struct nf_nat_l4proto { | ||
| 12 | /* Protocol number. */ | ||
| 13 | u8 l4proto; | ||
| 14 | |||
| 15 | }; | ||
| 16 | |||
| 17 | /* Protocol registration. */ | ||
| 18 | int nf_nat_l4proto_register(u8 l3proto, const struct nf_nat_l4proto *l4proto); | ||
| 19 | void nf_nat_l4proto_unregister(u8 l3proto, | ||
| 20 | const struct nf_nat_l4proto *l4proto); | ||
| 21 | |||
| 22 | const struct nf_nat_l4proto *__nf_nat_l4proto_find(u8 l3proto, u8 l4proto); | ||
| 23 | |||
| 24 | /* Translate a packet to the target according to manip type. Return on success. */ | 10 | /* Translate a packet to the target according to manip type. Return on success. */ |
| 25 | bool nf_nat_l4proto_manip_pkt(struct sk_buff *skb, | 11 | bool nf_nat_l4proto_manip_pkt(struct sk_buff *skb, |
| 26 | const struct nf_nat_l3proto *l3proto, | 12 | const struct nf_nat_l3proto *l3proto, |
| 27 | unsigned int iphdroff, unsigned int hdroff, | 13 | unsigned int iphdroff, unsigned int hdroff, |
| 28 | const struct nf_conntrack_tuple *tuple, | 14 | const struct nf_conntrack_tuple *tuple, |
| 29 | enum nf_nat_manip_type maniptype); | 15 | enum nf_nat_manip_type maniptype); |
| 30 | |||
| 31 | /* Built-in protocols. */ | ||
| 32 | extern const struct nf_nat_l4proto nf_nat_l4proto_tcp; | ||
| 33 | extern const struct nf_nat_l4proto nf_nat_l4proto_udp; | ||
| 34 | extern const struct nf_nat_l4proto nf_nat_l4proto_icmp; | ||
| 35 | extern const struct nf_nat_l4proto nf_nat_l4proto_icmpv6; | ||
| 36 | extern const struct nf_nat_l4proto nf_nat_l4proto_unknown; | ||
| 37 | #ifdef CONFIG_NF_NAT_PROTO_DCCP | ||
| 38 | extern const struct nf_nat_l4proto nf_nat_l4proto_dccp; | ||
| 39 | #endif | ||
| 40 | #ifdef CONFIG_NF_NAT_PROTO_SCTP | ||
| 41 | extern const struct nf_nat_l4proto nf_nat_l4proto_sctp; | ||
| 42 | #endif | ||
| 43 | #ifdef CONFIG_NF_NAT_PROTO_UDPLITE | ||
| 44 | extern const struct nf_nat_l4proto nf_nat_l4proto_udplite; | ||
| 45 | #endif | ||
| 46 | |||
| 47 | #endif /*_NF_NAT_L4PROTO_H*/ | 16 | #endif /*_NF_NAT_L4PROTO_H*/ |
