netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* iptables-restore: remove unused --binary flag
@ 2008-12-24 19:32 Jan Engelhardt
  2008-12-24 19:32 ` iptables-save: restore indent after last change Jan Engelhardt
  2008-12-30 11:08 ` iptables-restore: remove unused --binary flag Pablo Neira Ayuso
  0 siblings, 2 replies; 8+ messages in thread
From: Jan Engelhardt @ 2008-12-24 19:32 UTC (permalink / raw)
  To: kaber; +Cc: Netfilter Developer Mailing List

commit 67f4e55f28abf2f666c0a0aa874d9421e91d6184
Author: Jan Engelhardt <jengelh@medozas.de>
Date:   Wed Dec 24 20:30:47 2008 +0100

iptables-restore: remove unused --binary flag

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 ip6tables-restore.c |    7 +------
 iptables-restore.c  |    7 +------
 iptables-save.c     |   12 ++----------
 3 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/ip6tables-restore.c b/ip6tables-restore.c
index 01bccf7..0920760 100644
--- a/ip6tables-restore.c
+++ b/ip6tables-restore.c
@@ -26,11 +26,10 @@
 #define DEBUGP(x, args...)
 #endif
 
-static int binary = 0, counters = 0, verbose = 0, noflush = 0;
+static int counters = 0, verbose = 0, noflush = 0;
 
 /* Keeping track of external matches and targets.  */
 static const struct option options[] = {
-	{.name = "binary",   .has_arg = false, .val = 'b'},
 	{.name = "counters", .has_arg = false, .val = 'c'},
 	{.name = "verbose",  .has_arg = false, .val = 'v'},
 	{.name = "test",     .has_arg = false, .val = 't'},
@@ -45,7 +44,6 @@ static void print_usage(const char *name, const char *version) __attribute__((no
 static void print_usage(const char *name, const char *version)
 {
 	fprintf(stderr, "Usage: %s [-b] [-c] [-v] [-t] [-h]\n"
-			"	   [ --binary ]\n"
 			"	   [ --counters ]\n"
 			"	   [ --verbose ]\n"
 			"	   [ --test ]\n"
@@ -144,9 +142,6 @@ int main(int argc, char *argv[])
 
 	while ((c = getopt_long(argc, argv, "bcvthnM:", options, NULL)) != -1) {
 		switch (c) {
-			case 'b':
-				binary = 1;
-				break;
 			case 'c':
 				counters = 1;
 				break;
diff --git a/iptables-restore.c b/iptables-restore.c
index 4ea9306..04b83b4 100644
--- a/iptables-restore.c
+++ b/iptables-restore.c
@@ -23,11 +23,10 @@
 #define DEBUGP(x, args...)
 #endif
 
-static int binary = 0, counters = 0, verbose = 0, noflush = 0;
+static int counters = 0, verbose = 0, noflush = 0;
 
 /* Keeping track of external matches and targets.  */
 static const struct option options[] = {
-	{.name = "binary",   .has_arg = false, .val = 'b'},
 	{.name = "counters", .has_arg = false, .val = 'c'},
 	{.name = "verbose",  .has_arg = false, .val = 'v'},
 	{.name = "test",     .has_arg = false, .val = 't'},
@@ -43,7 +42,6 @@ static void print_usage(const char *name, const char *version) __attribute__((no
 static void print_usage(const char *name, const char *version)
 {
 	fprintf(stderr, "Usage: %s [-b] [-c] [-v] [-t] [-h]\n"
-			"	   [ --binary ]\n"
 			"	   [ --counters ]\n"
 			"	   [ --verbose ]\n"
 			"	   [ --test ]\n"
@@ -146,9 +144,6 @@ main(int argc, char *argv[])
 
 	while ((c = getopt_long(argc, argv, "bcvthnM:T:", options, NULL)) != -1) {
 		switch (c) {
-			case 'b':
-				binary = 1;
-				break;
 			case 'c':
 				counters = 1;
 				break;
diff --git a/iptables-save.c b/iptables-save.c
index 6252c0b..dce9185 100644
--- a/iptables-save.c
+++ b/iptables-save.c
@@ -21,10 +21,9 @@
 #include <dlfcn.h>
 #endif
 
-static int show_binary = 0, show_counters = 0;
+static int show_counters = 0;
 
 static const struct option options[] = {
-	{.name = "binary",   .has_arg = false, .val = 'b'},
 	{.name = "counters", .has_arg = false, .val = 'c'},
 	{.name = "dump",     .has_arg = false, .val = 'd'},
 	{.name = "table",    .has_arg = true,  .val = 't'},
@@ -70,7 +69,7 @@ static int do_output(const char *tablename)
 		exit_error(OTHER_PROBLEM, "Can't initialize: %s\n",
 			   iptc_strerror(errno));
 
-	if (!show_binary) {
+	{
 		time_t now = time(NULL);
 
 		printf("# Generated by iptables-save v%s on %s",
@@ -111,9 +110,6 @@ static int do_output(const char *tablename)
 		now = time(NULL);
 		printf("COMMIT\n");
 		printf("# Completed on %s", ctime(&now));
-	} else {
-		/* Binary, huh?  OK. */
-		exit_error(OTHER_PROBLEM, "Binary NYI\n");
 	}
 
 	iptc_free(h);
@@ -154,10 +150,6 @@ main(int argc, char *argv[])
 
 	while ((c = getopt_long(argc, argv, "bcdt:", options, NULL)) != -1) {
 		switch (c) {
-		case 'b':
-			show_binary = 1;
-			break;
-
 		case 'c':
 			show_counters = 1;
 			break;


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

* iptables-save: restore indent after last change
  2008-12-24 19:32 iptables-restore: remove unused --binary flag Jan Engelhardt
@ 2008-12-24 19:32 ` Jan Engelhardt
  2008-12-30 11:13   ` Pablo Neira Ayuso
  2008-12-30 11:08 ` iptables-restore: remove unused --binary flag Pablo Neira Ayuso
  1 sibling, 1 reply; 8+ messages in thread
From: Jan Engelhardt @ 2008-12-24 19:32 UTC (permalink / raw)
  To: kaber; +Cc: Netfilter Developer Mailing List

parent 67f4e55f28abf2f666c0a0aa874d9421e91d6184
commit 5c79c4fa98e35426b836d468e80c3c5e7466ad8b
Author: Jan Engelhardt <jengelh@medozas.de>
Date:   Wed Dec 24 20:32:26 2008 +0100

iptables-save: restore indent after last change

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 iptables-save.c |   67 +++++++++++++++++++++-------------------------
 1 files changed, 31 insertions(+), 36 deletions(-)

diff --git a/iptables-save.c b/iptables-save.c
index dce9185..ea52377 100644
--- a/iptables-save.c
+++ b/iptables-save.c
@@ -60,6 +60,7 @@ static int do_output(const char *tablename)
 {
 	struct iptc_handle *h;
 	const char *chain = NULL;
+	time_t now;
 
 	if (!tablename)
 		return for_each_table(&do_output);
@@ -69,49 +70,43 @@ static int do_output(const char *tablename)
 		exit_error(OTHER_PROBLEM, "Can't initialize: %s\n",
 			   iptc_strerror(errno));
 
-	{
-		time_t now = time(NULL);
-
-		printf("# Generated by iptables-save v%s on %s",
-		       XTABLES_VERSION, ctime(&now));
-		printf("*%s\n", tablename);
-
-		/* Dump out chain names first,
-		 * thereby preventing dependency conflicts */
-		for (chain = iptc_first_chain(h);
-		     chain;
-		     chain = iptc_next_chain(h)) {
-
-			printf(":%s ", chain);
-			if (iptc_builtin(chain, h)) {
-				struct ipt_counters count;
-				printf("%s ",
-				       iptc_get_policy(chain, &count, h));
-				printf("[%llu:%llu]\n", (unsigned long long)count.pcnt, (unsigned long long)count.bcnt);
-			} else {
-				printf("- [0:0]\n");
-			}
-		}
+	now = time(NULL);
 
+	printf("# Generated by iptables-save v%s on %s",
+	       XTABLES_VERSION, ctime(&now));
+	printf("*%s\n", tablename);
 
-		for (chain = iptc_first_chain(h);
-		     chain;
-		     chain = iptc_next_chain(h)) {
-			const struct ipt_entry *e;
+	/* Dump out chain names first,
+	 * thereby preventing dependency conflicts */
+	for (chain = iptc_first_chain(h); chain != NULL;
+	     chain = iptc_next_chain(h)) {
 
-			/* Dump out rules */
-			e = iptc_first_rule(chain, h);
-			while(e) {
-				print_rule(e, h, chain, show_counters);
-				e = iptc_next_rule(e, h);
-			}
+		printf(":%s ", chain);
+		if (iptc_builtin(chain, h)) {
+			struct ipt_counters count;
+			printf("%s ", iptc_get_policy(chain, &count, h));
+			printf("[%llu:%llu]\n", (unsigned long long)count.pcnt, (unsigned long long)count.bcnt);
+		} else {
+			printf("- [0:0]\n");
 		}
+	}
+
+	for (chain = iptc_first_chain(h); chain != NULL;
+	     chain = iptc_next_chain(h)) {
+		const struct ipt_entry *e;
 
-		now = time(NULL);
-		printf("COMMIT\n");
-		printf("# Completed on %s", ctime(&now));
+		/* Dump out rules */
+		e = iptc_first_rule(chain, h);
+		while (e) {
+			print_rule(e, h, chain, show_counters);
+			e = iptc_next_rule(e, h);
+		}
 	}
 
+	now = time(NULL);
+	printf("COMMIT\n");
+	printf("# Completed on %s", ctime(&now));
+
 	iptc_free(h);
 
 	return 1;

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

* Re: iptables-restore: remove unused --binary flag
  2008-12-24 19:32 iptables-restore: remove unused --binary flag Jan Engelhardt
  2008-12-24 19:32 ` iptables-save: restore indent after last change Jan Engelhardt
@ 2008-12-30 11:08 ` Pablo Neira Ayuso
  2009-01-19 20:20   ` Jan Engelhardt
  1 sibling, 1 reply; 8+ messages in thread
From: Pablo Neira Ayuso @ 2008-12-30 11:08 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: kaber, Netfilter Developer Mailing List

Jan Engelhardt wrote:
> commit 67f4e55f28abf2f666c0a0aa874d9421e91d6184
> Author: Jan Engelhardt <jengelh@medozas.de>
> Date:   Wed Dec 24 20:30:47 2008 +0100
> 
> iptables-restore: remove unused --binary flag
> 
> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
> ---
>  ip6tables-restore.c |    7 +------
>  iptables-restore.c  |    7 +------
>  iptables-save.c     |   12 ++----------
>  3 files changed, 4 insertions(+), 22 deletions(-)
> 
> diff --git a/ip6tables-restore.c b/ip6tables-restore.c
> index 01bccf7..0920760 100644
> --- a/ip6tables-restore.c
> +++ b/ip6tables-restore.c
> @@ -26,11 +26,10 @@
>  #define DEBUGP(x, args...)
>  #endif
>  
> -static int binary = 0, counters = 0, verbose = 0, noflush = 0;
> +static int counters = 0, verbose = 0, noflush = 0;
>  
>  /* Keeping track of external matches and targets.  */
>  static const struct option options[] = {
> -	{.name = "binary",   .has_arg = false, .val = 'b'},
>  	{.name = "counters", .has_arg = false, .val = 'c'},
>  	{.name = "verbose",  .has_arg = false, .val = 'v'},
>  	{.name = "test",     .has_arg = false, .val = 't'},
> @@ -45,7 +44,6 @@ static void print_usage(const char *name, const char *version) __attribute__((no
>  static void print_usage(const char *name, const char *version)
>  {
>  	fprintf(stderr, "Usage: %s [-b] [-c] [-v] [-t] [-h]\n"
> -			"	   [ --binary ]\n"
>  			"	   [ --counters ]\n"
>  			"	   [ --verbose ]\n"
>  			"	   [ --test ]\n"
> @@ -144,9 +142,6 @@ int main(int argc, char *argv[])
>  
>  	while ((c = getopt_long(argc, argv, "bcvthnM:", options, NULL)) != -1) {
>  		switch (c) {
> -			case 'b':
> -				binary = 1;
> -				break;

I doubt that someone is using this option, anyhow I think that it would
be better to output a warning message to stderr that says "-b is
deprecated, fix your scripts". Later, we can remove it.

-- 
"Los honestos son inadaptados sociales" -- Les Luthiers

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

* Re: iptables-save: restore indent after last change
  2008-12-24 19:32 ` iptables-save: restore indent after last change Jan Engelhardt
@ 2008-12-30 11:13   ` Pablo Neira Ayuso
  2008-12-30 11:28     ` Jan Engelhardt
  0 siblings, 1 reply; 8+ messages in thread
From: Pablo Neira Ayuso @ 2008-12-30 11:13 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: kaber, Netfilter Developer Mailing List

Jan Engelhardt wrote:
> parent 67f4e55f28abf2f666c0a0aa874d9421e91d6184
> commit 5c79c4fa98e35426b836d468e80c3c5e7466ad8b
> Author: Jan Engelhardt <jengelh@medozas.de>
> Date:   Wed Dec 24 20:32:26 2008 +0100
> 
> iptables-save: restore indent after last change

patching file iptables-save.c
Hunk #1 succeeded at 61 (offset 1 line).
Hunk #2 FAILED at 71.
1 out of 2 hunks FAILED -- saving rejects to file iptables-save.c.rej

Weird, this patch does not apply.

-- 
"Los honestos son inadaptados sociales" -- Les Luthiers

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

* Re: iptables-save: restore indent after last change
  2008-12-30 11:13   ` Pablo Neira Ayuso
@ 2008-12-30 11:28     ` Jan Engelhardt
  0 siblings, 0 replies; 8+ messages in thread
From: Jan Engelhardt @ 2008-12-30 11:28 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: kaber, Netfilter Developer Mailing List

On Tuesday 2008-12-30 12:13, Pablo Neira Ayuso wrote:

>Jan Engelhardt wrote:
>> parent 67f4e55f28abf2f666c0a0aa874d9421e91d6184
>> commit 5c79c4fa98e35426b836d468e80c3c5e7466ad8b
>> Author: Jan Engelhardt <jengelh@medozas.de>
>> Date:   Wed Dec 24 20:32:26 2008 +0100
>> 
>> iptables-save: restore indent after last change

It depended on the previous.

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

* Re: iptables-restore: remove unused --binary flag
  2008-12-30 11:08 ` iptables-restore: remove unused --binary flag Pablo Neira Ayuso
@ 2009-01-19 20:20   ` Jan Engelhardt
  2009-01-21  8:06     ` Patrick McHardy
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Engelhardt @ 2009-01-19 20:20 UTC (permalink / raw)
  To: kaber; +Cc: pablo, Netfilter Developer Mailing List


On Tuesday 2008-12-30 12:08, Pablo Neira Ayuso wrote:
>Jan Engelhardt wrote:
>> Author: Jan Engelhardt <jengelh@medozas.de>
>> Date:   Wed Dec 24 20:30:47 2008 +0100
>> 
>> iptables-restore: remove unused --binary flag
>> 
>
>I doubt that someone is using this option, anyhow I think that it would
>be better to output a warning message to stderr that says "-b is
>deprecated, fix your scripts". Later, we can remove it.

Requesting comments from Patrick.

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

* Re: iptables-restore: remove unused --binary flag
  2009-01-19 20:20   ` Jan Engelhardt
@ 2009-01-21  8:06     ` Patrick McHardy
  2009-01-22 19:51       ` Jan Engelhardt
  0 siblings, 1 reply; 8+ messages in thread
From: Patrick McHardy @ 2009-01-21  8:06 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: pablo, Netfilter Developer Mailing List

Jan Engelhardt wrote:
> On Tuesday 2008-12-30 12:08, Pablo Neira Ayuso wrote:
>> Jan Engelhardt wrote:
>>> Author: Jan Engelhardt <jengelh@medozas.de>
>>> Date:   Wed Dec 24 20:30:47 2008 +0100
>>>
>>> iptables-restore: remove unused --binary flag
>>>
>> I doubt that someone is using this option, anyhow I think that it would
>> be better to output a warning message to stderr that says "-b is
>> deprecated, fix your scripts". Later, we can remove it.
> 
> Requesting comments from Patrick.

Both is fine with me, although I don't see a compelling reason against
taking the safe route.

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

* Re: iptables-restore: remove unused --binary flag
  2009-01-21  8:06     ` Patrick McHardy
@ 2009-01-22 19:51       ` Jan Engelhardt
  0 siblings, 0 replies; 8+ messages in thread
From: Jan Engelhardt @ 2009-01-22 19:51 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: pablo, Netfilter Developer Mailing List


On Wednesday 2009-01-21 09:06, Patrick McHardy wrote:
>>>>
>>>> iptables-restore: remove unused --binary flag
>>>>
>>> I doubt that someone is using this option, anyhow I think that it would
>>> be better to output a warning message to stderr that says "-b is
>>> deprecated, fix your scripts". Later, we can remove it.
>>
>> Requesting comments from Patrick.
>
> Both is fine with me, although I don't see a compelling reason against
> taking the safe route.
>
Then I pick the option to just nuke it.

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

end of thread, other threads:[~2009-01-22 19:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-24 19:32 iptables-restore: remove unused --binary flag Jan Engelhardt
2008-12-24 19:32 ` iptables-save: restore indent after last change Jan Engelhardt
2008-12-30 11:13   ` Pablo Neira Ayuso
2008-12-30 11:28     ` Jan Engelhardt
2008-12-30 11:08 ` iptables-restore: remove unused --binary flag Pablo Neira Ayuso
2009-01-19 20:20   ` Jan Engelhardt
2009-01-21  8:06     ` Patrick McHardy
2009-01-22 19:51       ` Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).