aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-03-20 10:15:47 -0400
committerPatrick McHardy <kaber@trash.net>2008-04-14 05:15:46 -0400
commit937e0dfd87a8b7946a17161664500fba93eb13fd (patch)
tree2dae4611ca2fc22d8973dcf0dfbed315de70ff86 /include
parent544473c1664f3a688be949ac078bdee6f4afeef1 (diff)
[NETFILTER]: nf_nat: add helpers for common NAT protocol operations
Add generic ->in_range and ->unique_tuple ops to avoid duplicating them again and again for future NAT modules and save a few bytes of text: net/ipv4/netfilter/nf_nat_proto_tcp.c: tcp_in_range | -62 (removed) tcp_unique_tuple | -259 # 271 -> 12, # inlines: 1 -> 0, size inlines: 7 -> 0 2 functions changed, 321 bytes removed net/ipv4/netfilter/nf_nat_proto_udp.c: udp_in_range | -62 (removed) udp_unique_tuple | -259 # 271 -> 12, # inlines: 1 -> 0, size inlines: 7 -> 0 2 functions changed, 321 bytes removed net/ipv4/netfilter/nf_nat_proto_gre.c: gre_in_range | -62 (removed) 1 function changed, 62 bytes removed vmlinux: 5 functions changed, 704 bytes removed Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/netfilter/nf_nat_protocol.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net/netfilter/nf_nat_protocol.h b/include/net/netfilter/nf_nat_protocol.h
index 4aa0edbb5b96..fa06f6d0de54 100644
--- a/include/net/netfilter/nf_nat_protocol.h
+++ b/include/net/netfilter/nf_nat_protocol.h
@@ -62,6 +62,17 @@ extern int init_protocols(void) __init;
62extern void cleanup_protocols(void); 62extern void cleanup_protocols(void);
63extern const struct nf_nat_protocol *find_nat_proto(u_int16_t protonum); 63extern const struct nf_nat_protocol *find_nat_proto(u_int16_t protonum);
64 64
65extern int nf_nat_proto_in_range(const struct nf_conntrack_tuple *tuple,
66 enum nf_nat_manip_type maniptype,
67 const union nf_conntrack_man_proto *min,
68 const union nf_conntrack_man_proto *max);
69
70extern int nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple,
71 const struct nf_nat_range *range,
72 enum nf_nat_manip_type maniptype,
73 const struct nf_conn *ct,
74 u_int16_t *rover);
75
65extern int nf_nat_port_range_to_nlattr(struct sk_buff *skb, 76extern int nf_nat_port_range_to_nlattr(struct sk_buff *skb,
66 const struct nf_nat_range *range); 77 const struct nf_nat_range *range);
67extern int nf_nat_port_nlattr_to_range(struct nlattr *tb[], 78extern int nf_nat_port_nlattr_to_range(struct nlattr *tb[],