summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2011-10-27 10:24:45 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2011-10-28 21:26:12 +0200
commit2e6ef28ed043cce4dfc268f9d40f06815d636021 (patch)
tree3a5542f0ea105aa06dcff1dabae48d8f1a0d4092 /tools
parente765483c24b6107ee2def813f229685e01e297cf (diff)
downloadconnman-2e6ef28ed043cce4dfc268f9d40f06815d636021.tar.gz
connman-2e6ef28ed043cce4dfc268f9d40f06815d636021.tar.bz2
connman-2e6ef28ed043cce4dfc268f9d40f06815d636021.zip
tools: Code preparation for iptable-test option handling
Diffstat (limited to 'tools')
-rw-r--r--tools/iptables-test.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/tools/iptables-test.c b/tools/iptables-test.c
index 133c4f96..a29a1a00 100644
--- a/tools/iptables-test.c
+++ b/tools/iptables-test.c
@@ -1203,6 +1203,30 @@ err:
return NULL;
}
+static struct option connman_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 connman_iptables_globals = {
+ .option_offset = 0,
+ .opts = connman_iptables_opts,
+ .orig_opts = connman_iptables_opts,
+};
+
static struct xtables_target *prepare_target(struct connman_iptables *table,
char *target_name)
{
@@ -1268,30 +1292,6 @@ static struct xtables_target *prepare_target(struct connman_iptables *table,
return xt_t;
}
-static struct option connman_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 connman_iptables_globals = {
- .option_offset = 0,
- .opts = connman_iptables_opts,
- .orig_opts = connman_iptables_opts,
-};
-
int main(int argc, char *argv[])
{
struct connman_iptables *table;