summaryrefslogtreecommitdiffstats
path: root/iptables.c
diff options
context:
space:
mode:
authorJamal Hadi Salim <hadi@cyberus.ca>2009-02-11 13:03:34 +0100
committerPatrick McHardy <kaber@trash.net>2009-02-11 13:03:34 +0100
commit4dcdc9b3f8f42eb3b5a1d12e1b3d2fc1e2675725 (patch)
tree0b5de7caba3187728582de15e2a13feced3b3dec /iptables.c
parent40a8343d3ad0cdbc3a7e69c8d970ad75807c29ed (diff)
libxtables: Make ip6tables, iptables and iptables-xml use xtables_globals
convert ip6tables, iptables and iptables-xml to use xtables_globals/xtables_set_params() Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'iptables.c')
-rw-r--r--iptables.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/iptables.c b/iptables.c
index f1a5d33e..e8bed877 100644
--- a/iptables.c
+++ b/iptables.c
@@ -145,6 +145,14 @@ int line = -1;
static struct option *opts = original_opts;
static unsigned int global_option_offset = 0;
+struct xtables_globals iptables_globals = {
+ .option_offset = 0,
+ .program_version = IPTABLES_VERSION,
+ .program_name = "iptables",
+ .opts = original_opts,
+ .exit_error = exit_error,
+};
+
/* Table of legal combinations of commands and options. If any of the
* given commands make an option legal, that option is legal (applies to
* CMD_LIST and CMD_ZERO only).
@@ -1393,6 +1401,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
demand-load a protocol. */
opterr = 0;
+ xtables_set_params(&iptables_globals);
while ((c = getopt_long(argc, argv,
"-A:D:R:I:L::S::M:F::Z::N:X::E:P:Vh::o:p:s:d:j:i:fbvnt:m:xc:g:",
opts, NULL)) != -1) {