diff options
author | Patrick McHardy <kaber@trash.net> | 2006-01-09 19:44:36 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-10 15:54:34 -0500 |
commit | 9d28026b7ec0f3e2a407d5c03fcb37d0b59d1add (patch) | |
tree | 843faa49147685abdf7a8fa7b7f810e67d1fe95b /net/ipv4 | |
parent | c07bc1ffbdc14312b214b56fa39f4a4ab1406b8e (diff) |
[NETFILTER]: Remove unused function from NAT protocol helpers
->print and ->print_range are not used (and apparently never were).
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/ip_nat_proto_gre.c | 38 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_nat_proto_icmp.c | 34 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_nat_proto_tcp.c | 36 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_nat_proto_udp.c | 36 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_nat_proto_unknown.c | 16 |
5 files changed, 0 insertions, 160 deletions
diff --git a/net/ipv4/netfilter/ip_nat_proto_gre.c b/net/ipv4/netfilter/ip_nat_proto_gre.c index f7cad7cf1aec..6c4899d8046a 100644 --- a/net/ipv4/netfilter/ip_nat_proto_gre.c +++ b/net/ipv4/netfilter/ip_nat_proto_gre.c | |||
@@ -151,42 +151,6 @@ gre_manip_pkt(struct sk_buff **pskb, | |||
151 | return 1; | 151 | return 1; |
152 | } | 152 | } |
153 | 153 | ||
154 | /* print out a nat tuple */ | ||
155 | static unsigned int | ||
156 | gre_print(char *buffer, | ||
157 | const struct ip_conntrack_tuple *match, | ||
158 | const struct ip_conntrack_tuple *mask) | ||
159 | { | ||
160 | unsigned int len = 0; | ||
161 | |||
162 | if (mask->src.u.gre.key) | ||
163 | len += sprintf(buffer + len, "srckey=0x%x ", | ||
164 | ntohl(match->src.u.gre.key)); | ||
165 | |||
166 | if (mask->dst.u.gre.key) | ||
167 | len += sprintf(buffer + len, "dstkey=0x%x ", | ||
168 | ntohl(match->src.u.gre.key)); | ||
169 | |||
170 | return len; | ||
171 | } | ||
172 | |||
173 | /* print a range of keys */ | ||
174 | static unsigned int | ||
175 | gre_print_range(char *buffer, const struct ip_nat_range *range) | ||
176 | { | ||
177 | if (range->min.gre.key != 0 | ||
178 | || range->max.gre.key != 0xFFFF) { | ||
179 | if (range->min.gre.key == range->max.gre.key) | ||
180 | return sprintf(buffer, "key 0x%x ", | ||
181 | ntohl(range->min.gre.key)); | ||
182 | else | ||
183 | return sprintf(buffer, "keys 0x%u-0x%u ", | ||
184 | ntohl(range->min.gre.key), | ||
185 | ntohl(range->max.gre.key)); | ||
186 | } else | ||
187 | return 0; | ||
188 | } | ||
189 | |||
190 | /* nat helper struct */ | 154 | /* nat helper struct */ |
191 | static struct ip_nat_protocol gre = { | 155 | static struct ip_nat_protocol gre = { |
192 | .name = "GRE", | 156 | .name = "GRE", |
@@ -194,8 +158,6 @@ static struct ip_nat_protocol gre = { | |||
194 | .manip_pkt = gre_manip_pkt, | 158 | .manip_pkt = gre_manip_pkt, |
195 | .in_range = gre_in_range, | 159 | .in_range = gre_in_range, |
196 | .unique_tuple = gre_unique_tuple, | 160 | .unique_tuple = gre_unique_tuple, |
197 | .print = gre_print, | ||
198 | .print_range = gre_print_range, | ||
199 | #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ | 161 | #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ |
200 | defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) | 162 | defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) |
201 | .range_to_nfattr = ip_nat_port_range_to_nfattr, | 163 | .range_to_nfattr = ip_nat_port_range_to_nfattr, |
diff --git a/net/ipv4/netfilter/ip_nat_proto_icmp.c b/net/ipv4/netfilter/ip_nat_proto_icmp.c index 938719043999..31a3f4ccb99c 100644 --- a/net/ipv4/netfilter/ip_nat_proto_icmp.c +++ b/net/ipv4/netfilter/ip_nat_proto_icmp.c | |||
@@ -74,38 +74,6 @@ icmp_manip_pkt(struct sk_buff **pskb, | |||
74 | return 1; | 74 | return 1; |
75 | } | 75 | } |
76 | 76 | ||
77 | static unsigned int | ||
78 | icmp_print(char *buffer, | ||
79 | const struct ip_conntrack_tuple *match, | ||
80 | const struct ip_conntrack_tuple *mask) | ||
81 | { | ||
82 | unsigned int len = 0; | ||
83 | |||
84 | if (mask->src.u.icmp.id) | ||
85 | len += sprintf(buffer + len, "id=%u ", | ||
86 | ntohs(match->src.u.icmp.id)); | ||
87 | |||
88 | if (mask->dst.u.icmp.type) | ||
89 | len += sprintf(buffer + len, "type=%u ", | ||
90 | ntohs(match->dst.u.icmp.type)); | ||
91 | |||
92 | if (mask->dst.u.icmp.code) | ||
93 | len += sprintf(buffer + len, "code=%u ", | ||
94 | ntohs(match->dst.u.icmp.code)); | ||
95 | |||
96 | return len; | ||
97 | } | ||
98 | |||
99 | static unsigned int | ||
100 | icmp_print_range(char *buffer, const struct ip_nat_range *range) | ||
101 | { | ||
102 | if (range->min.icmp.id != 0 || range->max.icmp.id != 0xFFFF) | ||
103 | return sprintf(buffer, "id %u-%u ", | ||
104 | ntohs(range->min.icmp.id), | ||
105 | ntohs(range->max.icmp.id)); | ||
106 | else return 0; | ||
107 | } | ||
108 | |||
109 | struct ip_nat_protocol ip_nat_protocol_icmp = { | 77 | struct ip_nat_protocol ip_nat_protocol_icmp = { |
110 | .name = "ICMP", | 78 | .name = "ICMP", |
111 | .protonum = IPPROTO_ICMP, | 79 | .protonum = IPPROTO_ICMP, |
@@ -113,8 +81,6 @@ struct ip_nat_protocol ip_nat_protocol_icmp = { | |||
113 | .manip_pkt = icmp_manip_pkt, | 81 | .manip_pkt = icmp_manip_pkt, |
114 | .in_range = icmp_in_range, | 82 | .in_range = icmp_in_range, |
115 | .unique_tuple = icmp_unique_tuple, | 83 | .unique_tuple = icmp_unique_tuple, |
116 | .print = icmp_print, | ||
117 | .print_range = icmp_print_range, | ||
118 | #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ | 84 | #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ |
119 | defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) | 85 | defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) |
120 | .range_to_nfattr = ip_nat_port_range_to_nfattr, | 86 | .range_to_nfattr = ip_nat_port_range_to_nfattr, |
diff --git a/net/ipv4/netfilter/ip_nat_proto_tcp.c b/net/ipv4/netfilter/ip_nat_proto_tcp.c index 1d381bf68574..a3d14079eba6 100644 --- a/net/ipv4/netfilter/ip_nat_proto_tcp.c +++ b/net/ipv4/netfilter/ip_nat_proto_tcp.c | |||
@@ -136,40 +136,6 @@ tcp_manip_pkt(struct sk_buff **pskb, | |||
136 | return 1; | 136 | return 1; |
137 | } | 137 | } |
138 | 138 | ||
139 | static unsigned int | ||
140 | tcp_print(char *buffer, | ||
141 | const struct ip_conntrack_tuple *match, | ||
142 | const struct ip_conntrack_tuple *mask) | ||
143 | { | ||
144 | unsigned int len = 0; | ||
145 | |||
146 | if (mask->src.u.tcp.port) | ||
147 | len += sprintf(buffer + len, "srcpt=%u ", | ||
148 | ntohs(match->src.u.tcp.port)); | ||
149 | |||
150 | |||
151 | if (mask->dst.u.tcp.port) | ||
152 | len += sprintf(buffer + len, "dstpt=%u ", | ||
153 | ntohs(match->dst.u.tcp.port)); | ||
154 | |||
155 | return len; | ||
156 | } | ||
157 | |||
158 | static unsigned int | ||
159 | tcp_print_range(char *buffer, const struct ip_nat_range *range) | ||
160 | { | ||
161 | if (range->min.tcp.port != 0 || range->max.tcp.port != 0xFFFF) { | ||
162 | if (range->min.tcp.port == range->max.tcp.port) | ||
163 | return sprintf(buffer, "port %u ", | ||
164 | ntohs(range->min.tcp.port)); | ||
165 | else | ||
166 | return sprintf(buffer, "ports %u-%u ", | ||
167 | ntohs(range->min.tcp.port), | ||
168 | ntohs(range->max.tcp.port)); | ||
169 | } | ||
170 | else return 0; | ||
171 | } | ||
172 | |||
173 | struct ip_nat_protocol ip_nat_protocol_tcp = { | 139 | struct ip_nat_protocol ip_nat_protocol_tcp = { |
174 | .name = "TCP", | 140 | .name = "TCP", |
175 | .protonum = IPPROTO_TCP, | 141 | .protonum = IPPROTO_TCP, |
@@ -177,8 +143,6 @@ struct ip_nat_protocol ip_nat_protocol_tcp = { | |||
177 | .manip_pkt = tcp_manip_pkt, | 143 | .manip_pkt = tcp_manip_pkt, |
178 | .in_range = tcp_in_range, | 144 | .in_range = tcp_in_range, |
179 | .unique_tuple = tcp_unique_tuple, | 145 | .unique_tuple = tcp_unique_tuple, |
180 | .print = tcp_print, | ||
181 | .print_range = tcp_print_range, | ||
182 | #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ | 146 | #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ |
183 | defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) | 147 | defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) |
184 | .range_to_nfattr = ip_nat_port_range_to_nfattr, | 148 | .range_to_nfattr = ip_nat_port_range_to_nfattr, |
diff --git a/net/ipv4/netfilter/ip_nat_proto_udp.c b/net/ipv4/netfilter/ip_nat_proto_udp.c index c4906e1aa24a..ec6053fdc867 100644 --- a/net/ipv4/netfilter/ip_nat_proto_udp.c +++ b/net/ipv4/netfilter/ip_nat_proto_udp.c | |||
@@ -122,40 +122,6 @@ udp_manip_pkt(struct sk_buff **pskb, | |||
122 | return 1; | 122 | return 1; |
123 | } | 123 | } |
124 | 124 | ||
125 | static unsigned int | ||
126 | udp_print(char *buffer, | ||
127 | const struct ip_conntrack_tuple *match, | ||
128 | const struct ip_conntrack_tuple *mask) | ||
129 | { | ||
130 | unsigned int len = 0; | ||
131 | |||
132 | if (mask->src.u.udp.port) | ||
133 | len += sprintf(buffer + len, "srcpt=%u ", | ||
134 | ntohs(match->src.u.udp.port)); | ||
135 | |||
136 | |||
137 | if (mask->dst.u.udp.port) | ||
138 | len += sprintf(buffer + len, "dstpt=%u ", | ||
139 | ntohs(match->dst.u.udp.port)); | ||
140 | |||
141 | return len; | ||
142 | } | ||
143 | |||
144 | static unsigned int | ||
145 | udp_print_range(char *buffer, const struct ip_nat_range *range) | ||
146 | { | ||
147 | if (range->min.udp.port != 0 || range->max.udp.port != 0xFFFF) { | ||
148 | if (range->min.udp.port == range->max.udp.port) | ||
149 | return sprintf(buffer, "port %u ", | ||
150 | ntohs(range->min.udp.port)); | ||
151 | else | ||
152 | return sprintf(buffer, "ports %u-%u ", | ||
153 | ntohs(range->min.udp.port), | ||
154 | ntohs(range->max.udp.port)); | ||
155 | } | ||
156 | else return 0; | ||
157 | } | ||
158 | |||
159 | struct ip_nat_protocol ip_nat_protocol_udp = { | 125 | struct ip_nat_protocol ip_nat_protocol_udp = { |
160 | .name = "UDP", | 126 | .name = "UDP", |
161 | .protonum = IPPROTO_UDP, | 127 | .protonum = IPPROTO_UDP, |
@@ -163,8 +129,6 @@ struct ip_nat_protocol ip_nat_protocol_udp = { | |||
163 | .manip_pkt = udp_manip_pkt, | 129 | .manip_pkt = udp_manip_pkt, |
164 | .in_range = udp_in_range, | 130 | .in_range = udp_in_range, |
165 | .unique_tuple = udp_unique_tuple, | 131 | .unique_tuple = udp_unique_tuple, |
166 | .print = udp_print, | ||
167 | .print_range = udp_print_range, | ||
168 | #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ | 132 | #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ |
169 | defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) | 133 | defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) |
170 | .range_to_nfattr = ip_nat_port_range_to_nfattr, | 134 | .range_to_nfattr = ip_nat_port_range_to_nfattr, |
diff --git a/net/ipv4/netfilter/ip_nat_proto_unknown.c b/net/ipv4/netfilter/ip_nat_proto_unknown.c index f0099a646a0b..3bf049517246 100644 --- a/net/ipv4/netfilter/ip_nat_proto_unknown.c +++ b/net/ipv4/netfilter/ip_nat_proto_unknown.c | |||
@@ -46,26 +46,10 @@ unknown_manip_pkt(struct sk_buff **pskb, | |||
46 | return 1; | 46 | return 1; |
47 | } | 47 | } |
48 | 48 | ||
49 | static unsigned int | ||
50 | unknown_print(char *buffer, | ||
51 | const struct ip_conntrack_tuple *match, | ||
52 | const struct ip_conntrack_tuple *mask) | ||
53 | { | ||
54 | return 0; | ||
55 | } | ||
56 | |||
57 | static unsigned int | ||
58 | unknown_print_range(char *buffer, const struct ip_nat_range *range) | ||
59 | { | ||
60 | return 0; | ||
61 | } | ||
62 | |||
63 | struct ip_nat_protocol ip_nat_unknown_protocol = { | 49 | struct ip_nat_protocol ip_nat_unknown_protocol = { |
64 | .name = "unknown", | 50 | .name = "unknown", |
65 | /* .me isn't set: getting a ref to this cannot fail. */ | 51 | /* .me isn't set: getting a ref to this cannot fail. */ |
66 | .manip_pkt = unknown_manip_pkt, | 52 | .manip_pkt = unknown_manip_pkt, |
67 | .in_range = unknown_in_range, | 53 | .in_range = unknown_in_range, |
68 | .unique_tuple = unknown_unique_tuple, | 54 | .unique_tuple = unknown_unique_tuple, |
69 | .print = unknown_print, | ||
70 | .print_range = unknown_print_range | ||
71 | }; | 55 | }; |