All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephane Ouellette <ouellettes@videotron.ca>
To: Harald Welte <laforge@netfilter.org>
Cc: netfilter-devel@lists.netfilter.org
Subject: [PATCH][COSMETIC]  libip6t_fuzzy.c
Date: Tue, 12 Aug 2003 13:45:36 -0400	[thread overview]
Message-ID: <3F3927C0.8040102@videotron.ca> (raw)

[-- 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)

                 reply	other threads:[~2003-08-12 17:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3F3927C0.8040102@videotron.ca \
    --to=ouellettes@videotron.ca \
    --cc=laforge@netfilter.org \
    --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.