From: Peter Warasin <peter@endian.com>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH 1/3] iptables-edit: iptables-edit: adds --table to iptables-restore
Date: Mon, 05 Nov 2007 01:13:53 +0100 [thread overview]
Message-ID: <472E6041.7090601@endian.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 113 bytes --]
--
:: e n d i a n
:: open source - open minds
:: peter warasin
:: http://www.endian.com :: peter@endian.com
[-- Attachment #2: iptables-edit-p1.patch --]
[-- Type: text/x-patch, Size: 1711 bytes --]
adds --table to iptables-restore which allows to restore only the
supplied table
Signed-off-by: Peter Warasin <peter@endian.com>
---
iptables-restore.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
Index: iptables-restore.c
===================================================================
--- iptables-restore.c.orig
+++ iptables-restore.c
@@ -33,6 +33,7 @@
{ "help", 0, 0, 'h' },
{ "noflush", 0, 0, 'n'},
{ "modprobe", 1, 0, 'M'},
+ { "table", 1, 0, 'T'},
{ 0 }
};
@@ -47,6 +48,7 @@
" [ --test ]\n"
" [ --help ]\n"
" [ --noflush ]\n"
+ " [ --table=<TABLE> ]\n"
" [ --modprobe=<command>]\n", name);
exit(1);
@@ -123,6 +125,7 @@
FILE *in;
const char *modprobe = 0;
int in_table = 0, testing = 0;
+ const char *tablename = 0;
program_name = "iptables-restore";
program_version = IPTABLES_VERSION;
@@ -136,7 +139,7 @@
init_extensions();
#endif
- while ((c = getopt_long(argc, argv, "bcvthnM:", options, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, "bcvthnM:T:", options, NULL)) != -1) {
switch (c) {
case 'b':
binary = 1;
@@ -160,6 +163,9 @@
case 'M':
modprobe = optarg;
break;
+ case 'T':
+ tablename = optarg;
+ break;
}
}
@@ -212,6 +218,8 @@
strncpy(curtable, table, IPT_TABLE_MAXNAMELEN);
curtable[IPT_TABLE_MAXNAMELEN] = '\0';
+ if (tablename && (strcmp(tablename, table) != 0))
+ continue;
if (handle)
iptc_free(&handle);
@@ -438,6 +446,8 @@
free_argv();
}
+ if (tablename && (strcmp(tablename, curtable) != 0))
+ continue;
if (!ret) {
fprintf(stderr, "%s: line %u failed\n",
program_name, line);
[-- Attachment #3: peter.vcf --]
[-- Type: text/x-vcard, Size: 279 bytes --]
begin:vcard
fn:Peter Warasin
n:;Peter Warasin
org:Endian GmbH/Srl
adr:;;Pillhof 47;Frangart/Frangarto;BZ;I-39010;Italien/Italia
email;internet:peter@endian.com
tel;work:+39 0471 631763
tel;fax:+39 0471 631764
x-mozilla-html:FALSE
url:http://www.endian.com
version:2.1
end:vcard
next reply other threads:[~2007-11-05 0:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-05 0:13 Peter Warasin [this message]
2007-11-06 0:12 ` [PATCH 1/3] iptables-edit: iptables-edit: adds --table to iptables-restore Patrick McHardy
2007-11-07 10:52 ` Jan Engelhardt
2007-11-07 13:44 ` Peter Warasin
2007-11-07 16:41 ` Jan Engelhardt
2007-11-07 18:15 ` Peter Warasin
2007-11-07 18:34 ` Jan Engelhardt
2007-11-07 19:11 ` Peter Warasin
2007-11-07 19:27 ` Jan Engelhardt
2007-11-07 19:50 ` Peter Warasin
2007-11-07 20:42 ` Jan Engelhardt
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=472E6041.7090601@endian.com \
--to=peter@endian.com \
--cc=netfilter-devel@vger.kernel.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.