All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][COSMETIC]  libip6t_fuzzy.c
@ 2003-08-12 17:45 Stephane Ouellette
  0 siblings, 0 replies; only message in thread
From: Stephane Ouellette @ 2003-08-12 17:45 UTC (permalink / raw)
  To: Harald Welte; +Cc: netfilter-devel

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

Harald,

   this patch includes:

1- Indentation fixes,
2- Reduce the number of calls to printf(),
3- C99 initializers.

Please apply.

Stephane.


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

--- netfilter.orig/userspace/extensions/libip6t_fuzzy.c	Sat Jun 14 10:08:53 2003
+++ netfilter/userspace/extensions/libip6t_fuzzy.c	Mon Aug 11 22:16:27 2003
@@ -34,9 +34,9 @@
 };
 
 static struct option opts[] = {
-	{ "lower-limit", 1 , 0 , '1' } ,
-	{ "upper-limit", 1 , 0 , '2' } ,
-	{ 0 }
+	{ .name = "lower-limit", .has_arg = 1, .flag = 0, .val = '1' },
+	{ .name = "upper-limit", .has_arg = 1, .flag = 0, .val = '2' },
+	{ .name = 0 }
 };
 
 /* Initialize data structures */
@@ -64,8 +64,8 @@
       unsigned int *nfcache,
       struct ip6t_entry_match **match)
 {
-
-struct ip6t_fuzzy_info *fuzzyinfo = (struct ip6t_fuzzy_info *)(*match)->data;
+	struct ip6t_fuzzy_info *fuzzyinfo =
+		(struct ip6t_fuzzy_info *)(*match)->data;
 
 	u_int32_t num;
 
@@ -99,7 +99,7 @@
 	if (string_to_number(optarg,1,MAXFUZZYRATE,&num) == -1 || num < 1)
 		exit_error(PARAMETER_PROBLEM,"BAD --upper-limit");
 
-		fuzzyinfo->maximum_rate = num ;
+		fuzzyinfo->maximum_rate = num;
 
 		*flags |= IP6T_FUZZY_OPT_MAXIMUM;
 
@@ -123,8 +123,8 @@
 	const struct ip6t_fuzzy_info *fuzzyinfo
 		= (const struct ip6t_fuzzy_info *)match->data;
 
-	printf(" fuzzy: lower limit = %u pps - upper limit = %u pps ",fuzzyinfo->minimum_rate,fuzzyinfo->maximum_rate);
-
+	printf(" fuzzy: lower limit = %u pps - upper limit = %u pps ",
+		fuzzyinfo->minimum_rate, fuzzyinfo->maximum_rate);
 }
 
 /* Saves the union ip6t_targinfo in parsable form to stdout. */
@@ -134,24 +134,22 @@
 	const struct ip6t_fuzzy_info *fuzzyinfo
 		= (const struct ip6t_fuzzy_info *)match->data;
 
-	printf("--lower-limit %u ",fuzzyinfo->minimum_rate);
-	printf("--upper-limit %u ",fuzzyinfo->maximum_rate);
-
+	printf("--lower-limit %u --upper-limit %u ",
+		fuzzyinfo->minimum_rate, fuzzyinfo->maximum_rate);
 }
 
-struct ip6tables_match fuzzy_match
-= { NULL,
-    "fuzzy",
-    IPTABLES_VERSION,
-    IP6T_ALIGN(sizeof(struct ip6t_fuzzy_info)),
-    IP6T_ALIGN(sizeof(struct ip6t_fuzzy_info)),
-    &help,
-    &init,
-    &parse,
-    &final_check,
-    &print,
-    &save,
-    opts
+struct ip6tables_match fuzzy_match = {
+	.name          = "fuzzy",
+	.version       = IPTABLES_VERSION,
+	.size          = IP6T_ALIGN(sizeof(struct ip6t_fuzzy_info)),
+	.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_fuzzy_info)),
+	.help          = &help,
+	.init          = &init,
+	.parse         = &parse,
+	.final_check   = &final_check,
+	.print         = &print,
+	.save          = &save,
+	.extra_opts    = opts
 };
 
 void _init(void)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-08-12 17:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-12 17:45 [PATCH][COSMETIC] libip6t_fuzzy.c Stephane Ouellette

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.