All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]    Less printf() calls for libip6t_esp.c
@ 2003-08-12 18:08 Stephane Ouellette
  2003-08-23 18:42 ` Harald Welte
  0 siblings, 1 reply; 2+ messages in thread
From: Stephane Ouellette @ 2003-08-12 18:08 UTC (permalink / raw)
  To: Harald Welte; +Cc: netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 137 bytes --]

Harald,

    this attached patch contains C99 initializers and printf() 
simplifications fo libip6t_esp.c.

    Please apply.

Stephane


[-- Attachment #2: libip6t_esp.c.patch --]
[-- Type: text/plain, Size: 1664 bytes --]

--- netfilter.orig/userspace/extensions/libip6t_esp.c	Wed May 29 09:08:16 2002
+++ netfilter/userspace/extensions/libip6t_esp.c	Mon Aug 11 21:57:45 2003
@@ -19,8 +19,8 @@
 }
 
 static struct option opts[] = {
-	{ "espspi", 1, 0, '1' },
-	{0}
+	{ .name = "espspi", .has_arg = 1, .flag = 0, .val = '1' },
+	{ .name = 0 }
 };
 
 static u_int32_t
@@ -29,7 +29,7 @@
 	unsigned long int spi;
 	char* ep;
 
-	spi =  strtoul(spistr,&ep,0) ;
+	spi = strtoul(spistr, &ep, 0);
 
 	if ( spistr == ep ) {
 		exit_error(PARAMETER_PROBLEM,
@@ -117,17 +117,10 @@
 	const char *inv = invert ? "!" : "";
 
 	if (min != 0 || max != 0xFFFFFFFF || invert) {
-		printf("%s", name);
-		if (min == max) {
-			printf(":%s", inv);
-			printf("%u", min);
-		} else {
-			printf("s:%s", inv);
-			printf("%u",min);
-			printf(":");
-			printf("%u",max);
-		}
-		printf(" ");
+		if (min == max)
+			printf("%s:%s%u ", name, inv, min);
+		else
+			printf("%ss:%s%u:%u ", name, inv, min, max);
 	}
 }
 
@@ -168,19 +161,18 @@
 }
 
 static
-struct ip6tables_match esp
-= { NULL,
-    "esp",
-    IPTABLES_VERSION,
-    IP6T_ALIGN(sizeof(struct ip6t_esp)),
-    IP6T_ALIGN(sizeof(struct ip6t_esp)),
-    &help,
-    &init,
-    &parse,
-    &final_check,
-    &print,
-    &save,
-    opts
+struct ip6tables_match esp = {
+	.name          = "esp",
+	.version       = IPTABLES_VERSION,
+	.size          = IP6T_ALIGN(sizeof(struct ip6t_esp)),
+	.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_esp)),
+	.help          = &help,
+	.init          = &init,
+	.parse         = &parse,
+	.final_check   = &final_check,
+	.print         = &print,
+	.save          = &save,
+	.extra_opts    = opts
 };
 
 void

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH]    Less printf() calls for libip6t_esp.c
  2003-08-12 18:08 [PATCH] Less printf() calls for libip6t_esp.c Stephane Ouellette
@ 2003-08-23 18:42 ` Harald Welte
  0 siblings, 0 replies; 2+ messages in thread
From: Harald Welte @ 2003-08-23 18:42 UTC (permalink / raw)
  To: Stephane Ouellette; +Cc: netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 903 bytes --]

On Tue, Aug 12, 2003 at 02:08:12PM -0400, Stephane Ouellette wrote:
> Harald,
> 
>    this attached patch contains C99 initializers and printf() 
> simplifications fo libip6t_esp.c.

Thanks!

Sorry for the late reply, but first was the netfilter developer summit
in Budapest, and then our project's server was down - so I didn't really
have the time to take care of your patches. Please don't misunderstand
this as lack of interest in your contributions.

They are now all applied.

>    Please apply.
> Stephane

-- 
- Harald Welte <laforge@netfilter.org>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-08-23 18:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-12 18:08 [PATCH] Less printf() calls for libip6t_esp.c Stephane Ouellette
2003-08-23 18:42 ` Harald Welte

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.