* [PATCH 2/2] use C99 structure initialization in nat helpers
@ 2005-03-06 22:41 Pablo Neira
2005-03-06 23:12 ` Patrick McHardy
0 siblings, 1 reply; 4+ messages in thread
From: Pablo Neira @ 2005-03-06 22:41 UTC (permalink / raw)
To: Netfilter Development Mailinglist; +Cc: Patrick McHardy
[-- Attachment #1: Type: text/plain, Size: 115 bytes --]
This patch makes nat helpers use c99 structure initialization. It
applies on top of the previous patch.
--
Pablo
[-- Attachment #2: c99-nat-proto.patch --]
[-- Type: text/x-patch, Size: 3141 bytes --]
Use C99 structure initialization for nat protocols.
Status: trivial
Signed-off-by: Pablo Neira Ayuso <pablo@eurodev.net>
ip_nat_proto_icmp.c | 16 ++++++++--------
ip_nat_proto_tcp.c | 17 +++++++++--------
ip_nat_proto_udp.c | 16 ++++++++--------
ip_nat_proto_unknown.c | 14 +++++++-------
4 files changed, 32 insertions(+), 31 deletions(-)
--- linux-2.5/net/ipv4/netfilter/ip_nat_proto_tcp.c.orig 2005-02-26 20:35:55.000000000 +0100
+++ linux-2.5/net/ipv4/netfilter/ip_nat_proto_tcp.c 2005-02-26 20:38:26.000000000 +0100
@@ -317,12 +317,13 @@ tcp_seq_adjust(struct sk_buff **pskb,
return 1;
}
-struct ip_nat_protocol ip_nat_protocol_tcp
-= { "TCP", IPPROTO_TCP,
- tcp_manip_pkt,
- tcp_in_range,
- tcp_unique_tuple,
- tcp_print,
- tcp_print_range,
- tcp_seq_adjust
+struct ip_nat_protocol ip_nat_protocol_tcp = {
+ .name = "TCP",
+ .protonum = IPPROTO_TCP,
+ .manip_pkt = tcp_manip_pkt,
+ .in_range = tcp_in_range,
+ .unique_tuple = tcp_unique_tuple,
+ .print = tcp_print,
+ .print_range = tcp_print_range,
+ .adjust = tcp_seq_adjust
};
--- linux-2.5/net/ipv4/netfilter/ip_nat_proto_udp.c.orig 2005-02-26 20:36:03.000000000 +0100
+++ linux-2.5/net/ipv4/netfilter/ip_nat_proto_udp.c 2005-02-26 20:39:41.000000000 +0100
@@ -155,12 +155,12 @@ udp_print_range(char *buffer, const stru
else return 0;
}
-struct ip_nat_protocol ip_nat_protocol_udp
-= { "UDP", IPPROTO_UDP,
- udp_manip_pkt,
- udp_in_range,
- udp_unique_tuple,
- udp_print,
- udp_print_range,
- NULL
+struct ip_nat_protocol ip_nat_protocol_udp = {
+ .name = "UDP",
+ .protonum = IPPROTO_UDP,
+ .manip_pkt = udp_manip_pkt,
+ .in_range = udp_in_range,
+ .unique_tuple = udp_unique_tuple,
+ .print = udp_print,
+ .print_range = udp_print_range
};
--- linux-2.5/net/ipv4/netfilter/ip_nat_proto_icmp.c.orig 2005-02-26 20:35:45.000000000 +0100
+++ linux-2.5/net/ipv4/netfilter/ip_nat_proto_icmp.c 2005-02-26 20:38:32.000000000 +0100
@@ -105,12 +105,12 @@ icmp_print_range(char *buffer, const str
else return 0;
}
-struct ip_nat_protocol ip_nat_protocol_icmp
-= { "ICMP", IPPROTO_ICMP,
- icmp_manip_pkt,
- icmp_in_range,
- icmp_unique_tuple,
- icmp_print,
- icmp_print_range,
- NULL
+struct ip_nat_protocol ip_nat_protocol_icmp = {
+ .name = "ICMP",
+ .protonum = IPPROTO_ICMP,
+ .manip_pkt = icmp_manip_pkt,
+ .in_range = icmp_in_range,
+ .unique_tuple = icmp_unique_tuple,
+ .print = icmp_print,
+ .print_range = icmp_print_range
};
--- linux-2.5/net/ipv4/netfilter/ip_nat_proto_unknown.c.orig 2005-02-26 20:36:14.000000000 +0100
+++ linux-2.5/net/ipv4/netfilter/ip_nat_proto_unknown.c 2005-02-26 20:41:15.000000000 +0100
@@ -61,11 +61,11 @@ unknown_print_range(char *buffer, const
}
struct ip_nat_protocol ip_nat_unknown_protocol = {
- "unknown", 0,
- unknown_manip_pkt,
- unknown_in_range,
- unknown_unique_tuple,
- unknown_print,
- unknown_print_range,
- NULL
+ .name = "unknown",
+ .protonum = 0,
+ .manip_pkt = unknown_manip_pkt,
+ .in_range = unknown_in_range,
+ .unique_tuple = unknown_unique_tuple,
+ .print = unknown_print,
+ .print_range = unknown_print_range
};
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] use C99 structure initialization in nat helpers
2005-03-06 22:41 [PATCH 2/2] use C99 structure initialization in nat helpers Pablo Neira
@ 2005-03-06 23:12 ` Patrick McHardy
2005-03-06 23:34 ` Pablo Neira
0 siblings, 1 reply; 4+ messages in thread
From: Patrick McHardy @ 2005-03-06 23:12 UTC (permalink / raw)
To: Pablo Neira; +Cc: Netfilter Development Mailinglist
Pablo Neira wrote:
> This patch makes nat helpers use c99 structure initialization. It
> applies on top of the previous patch.
Thanks, but it doesn't apply without the previous patch. Hint: Send
cleanups first in a series of patches :)
Regards
Patrick
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] use C99 structure initialization in nat helpers
2005-03-06 23:12 ` Patrick McHardy
@ 2005-03-06 23:34 ` Pablo Neira
2005-03-07 1:11 ` Patrick McHardy
0 siblings, 1 reply; 4+ messages in thread
From: Pablo Neira @ 2005-03-06 23:34 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Netfilter Development Mailinglist
[-- Attachment #1: Type: text/plain, Size: 192 bytes --]
Patrick McHardy wrote:
> Thanks, but it doesn't apply without the previous patch. Hint: Send
> cleanups first in a series of patches :)
ACK, thanks patrick, attached the new patch.
--
Pablo
[-- Attachment #2: c99.patch --]
[-- Type: text/x-patch, Size: 2673 bytes --]
===== net/ipv4/netfilter/ip_nat_proto_icmp.c 1.8 vs edited =====
--- 1.8/net/ipv4/netfilter/ip_nat_proto_icmp.c 2005-01-17 23:00:55 +01:00
+++ edited/net/ipv4/netfilter/ip_nat_proto_icmp.c 2005-03-07 00:31:35 +01:00
@@ -105,11 +105,12 @@
else return 0;
}
-struct ip_nat_protocol ip_nat_protocol_icmp
-= { "ICMP", IPPROTO_ICMP,
- icmp_manip_pkt,
- icmp_in_range,
- icmp_unique_tuple,
- icmp_print,
- icmp_print_range
+struct ip_nat_protocol ip_nat_protocol_icmp = {
+ .name = "ICMP",
+ .protonum = IPPROTO_ICMP,
+ .manip_pkt = icmp_manip_pkt,
+ .in_range = icmp_in_range,
+ .unique_tuple = icmp_unique_tuple,
+ .print = icmp_print,
+ .print_range = icmp_print_range
};
===== net/ipv4/netfilter/ip_nat_proto_tcp.c 1.11 vs edited =====
--- 1.11/net/ipv4/netfilter/ip_nat_proto_tcp.c 2005-01-31 07:21:51 +01:00
+++ edited/net/ipv4/netfilter/ip_nat_proto_tcp.c 2005-03-07 00:29:17 +01:00
@@ -168,11 +168,12 @@
else return 0;
}
-struct ip_nat_protocol ip_nat_protocol_tcp
-= { "TCP", IPPROTO_TCP,
- tcp_manip_pkt,
- tcp_in_range,
- tcp_unique_tuple,
- tcp_print,
- tcp_print_range
+struct ip_nat_protocol ip_nat_protocol_tcp = {
+ .name = "TCP",
+ .protonum = IPPROTO_TCP,
+ .manip_pkt = tcp_manip_pkt,
+ .in_range = tcp_in_range,
+ .unique_tuple = tcp_unique_tuple,
+ .print = tcp_print,
+ .print_range = tcp_print_range
};
===== net/ipv4/netfilter/ip_nat_proto_udp.c 1.9 vs edited =====
--- 1.9/net/ipv4/netfilter/ip_nat_proto_udp.c 2005-01-17 23:00:55 +01:00
+++ edited/net/ipv4/netfilter/ip_nat_proto_udp.c 2005-03-07 00:30:06 +01:00
@@ -155,11 +155,12 @@
else return 0;
}
-struct ip_nat_protocol ip_nat_protocol_udp
-= { "UDP", IPPROTO_UDP,
- udp_manip_pkt,
- udp_in_range,
- udp_unique_tuple,
- udp_print,
- udp_print_range
+struct ip_nat_protocol ip_nat_protocol_udp = {
+ .name = "UDP",
+ .protonum = IPPROTO_UDP,
+ .manip_pkt = udp_manip_pkt,
+ .in_range = udp_in_range,
+ .unique_tuple = udp_unique_tuple,
+ .print = udp_print,
+ .print_range = udp_print_range
};
===== net/ipv4/netfilter/ip_nat_proto_unknown.c 1.7 vs edited =====
--- 1.7/net/ipv4/netfilter/ip_nat_proto_unknown.c 2005-01-17 23:00:55 +01:00
+++ edited/net/ipv4/netfilter/ip_nat_proto_unknown.c 2005-03-07 00:30:49 +01:00
@@ -61,10 +61,11 @@
}
struct ip_nat_protocol ip_nat_unknown_protocol = {
- "unknown", 0,
- unknown_manip_pkt,
- unknown_in_range,
- unknown_unique_tuple,
- unknown_print,
- unknown_print_range
+ .name = "unknown",
+ .protonum = 0,
+ .manip_pkt = unknown_manip_pkt,
+ .in_range = unknown_in_range,
+ .unique_tuple = unknown_unique_tuple,
+ .print = unknown_print,
+ .print_range = unknown_print_range
};
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] use C99 structure initialization in nat helpers
2005-03-06 23:34 ` Pablo Neira
@ 2005-03-07 1:11 ` Patrick McHardy
0 siblings, 0 replies; 4+ messages in thread
From: Patrick McHardy @ 2005-03-07 1:11 UTC (permalink / raw)
To: Pablo Neira; +Cc: Netfilter Development Mailinglist
Pablo Neira wrote:
> attached the new patch.
Thanks, applied.
Regards
Patrick
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-03-07 1:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-06 22:41 [PATCH 2/2] use C99 structure initialization in nat helpers Pablo Neira
2005-03-06 23:12 ` Patrick McHardy
2005-03-06 23:34 ` Pablo Neira
2005-03-07 1:11 ` Patrick McHardy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.