All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira <pablo@eurodev.net>
To: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Cc: Patrick McHardy <kaber@trash.net>
Subject: [PATCH 2/2] use C99 structure initialization in nat helpers
Date: Sun, 06 Mar 2005 23:41:26 +0100	[thread overview]
Message-ID: <422B8716.9010804@eurodev.net> (raw)

[-- 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
 };

             reply	other threads:[~2005-03-06 22:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-06 22:41 Pablo Neira [this message]
2005-03-06 23:12 ` [PATCH 2/2] use C99 structure initialization in nat helpers Patrick McHardy
2005-03-06 23:34   ` Pablo Neira
2005-03-07  1:11     ` Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=422B8716.9010804@eurodev.net \
    --to=pablo@eurodev.net \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.