summaryrefslogtreecommitdiff
path: root/src/iptables.c
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2011-10-27 10:26:30 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2011-10-28 21:34:27 +0200
commitcde720fb5b3d98e3a9bb10e9ba234e5cb7025e4a (patch)
tree0d9a442fe99930876014c29cd96188f1d6c19ff6 /src/iptables.c
parent45dc769c96c758d63401aeb8cb42cba87179020b (diff)
downloadconnman-cde720fb5b3d98e3a9bb10e9ba234e5cb7025e4a.tar.gz
connman-cde720fb5b3d98e3a9bb10e9ba234e5cb7025e4a.tar.bz2
connman-cde720fb5b3d98e3a9bb10e9ba234e5cb7025e4a.zip
iptables: Code preparation for option handling
Diffstat (limited to 'src/iptables.c')
-rw-r--r--src/iptables.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/iptables.c b/src/iptables.c
index 68219eef..eef91c18 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -1213,6 +1213,30 @@ err:
return NULL;
}
+static struct option iptables_opts[] = {
+ {.name = "append", .has_arg = 1, .val = 'A'},
+ {.name = "delete", .has_arg = 1, .val = 'D'},
+ {.name = "flush-chain", .has_arg = 1, .val = 'F'},
+ {.name = "insert", .has_arg = 1, .val = 'I'},
+ {.name = "list", .has_arg = 2, .val = 'L'},
+ {.name = "new-chain", .has_arg = 1, .val = 'N'},
+ {.name = "delete-chain", .has_arg = 1, .val = 'X'},
+ {.name = "destination", .has_arg = 1, .val = 'd'},
+ {.name = "in-interface", .has_arg = 1, .val = 'i'},
+ {.name = "jump", .has_arg = 1, .val = 'j'},
+ {.name = "match", .has_arg = 1, .val = 'm'},
+ {.name = "out-interface", .has_arg = 1, .val = 'o'},
+ {.name = "source", .has_arg = 1, .val = 's'},
+ {.name = "table", .has_arg = 1, .val = 't'},
+ {NULL},
+};
+
+struct xtables_globals iptables_globals = {
+ .option_offset = 0,
+ .opts = iptables_opts,
+ .orig_opts = iptables_opts,
+};
+
static struct xtables_target *prepare_target(struct connman_iptables *table,
char *target_name)
{
@@ -1278,30 +1302,6 @@ static struct xtables_target *prepare_target(struct connman_iptables *table,
return xt_t;
}
-static struct option iptables_opts[] = {
- {.name = "append", .has_arg = 1, .val = 'A'},
- {.name = "delete", .has_arg = 1, .val = 'D'},
- {.name = "flush-chain", .has_arg = 1, .val = 'F'},
- {.name = "insert", .has_arg = 1, .val = 'I'},
- {.name = "list", .has_arg = 2, .val = 'L'},
- {.name = "new-chain", .has_arg = 1, .val = 'N'},
- {.name = "delete-chain", .has_arg = 1, .val = 'X'},
- {.name = "destination", .has_arg = 1, .val = 'd'},
- {.name = "in-interface", .has_arg = 1, .val = 'i'},
- {.name = "jump", .has_arg = 1, .val = 'j'},
- {.name = "match", .has_arg = 1, .val = 'm'},
- {.name = "out-interface", .has_arg = 1, .val = 'o'},
- {.name = "source", .has_arg = 1, .val = 's'},
- {.name = "table", .has_arg = 1, .val = 't'},
- {NULL},
-};
-
-struct xtables_globals iptables_globals = {
- .option_offset = 0,
- .opts = iptables_opts,
- .orig_opts = iptables_opts,
-};
-
static int iptables_command(int argc, char *argv[])
{
struct connman_iptables *table;