[netfilter-cvslog] r7480 - trunk/iptables
kaber at trash.net
kaber at trash.net
Mon Apr 14 08:51:33 CEST 2008
Author: kaber at trash.net
Date: 2008-04-14 08:51:33 +0200 (Mon, 14 Apr 2008)
New Revision: 7480
Modified:
trunk/iptables/ip6tables-restore.c
trunk/iptables/ip6tables-save.c
trunk/iptables/ip6tables.c
trunk/iptables/iptables-restore.c
trunk/iptables/iptables-save.c
trunk/iptables/iptables.c
Log:
[PATCH 4/8] iptables: use C99 lists for struct options
Modified: trunk/iptables/ip6tables-restore.c
===================================================================
--- trunk/iptables/ip6tables-restore.c 2008-04-14 06:50:56 UTC (rev 7479)
+++ trunk/iptables/ip6tables-restore.c 2008-04-14 06:51:33 UTC (rev 7480)
@@ -29,15 +29,15 @@
static int binary = 0, counters = 0, verbose = 0, noflush = 0;
/* Keeping track of external matches and targets. */
-static struct option options[] = {
- { "binary", 0, 0, 'b' },
- { "counters", 0, 0, 'c' },
- { "verbose", 0, 0, 'v' },
- { "test", 0, 0, 't' },
- { "help", 0, 0, 'h' },
- { "noflush", 0, 0, 'n'},
- { "modprobe", 1, 0, 'M'},
- { 0 }
+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'},
+ {.name = "help", .has_arg = false, .val = 'h'},
+ {.name = "noflush", .has_arg = false, .val = 'n'},
+ {.name = "modprobe", .has_arg = true, .val = 'M'},
+ {NULL},
};
static void print_usage(const char *name, const char *version) __attribute__((noreturn));
Modified: trunk/iptables/ip6tables-save.c
===================================================================
--- trunk/iptables/ip6tables-save.c 2008-04-14 06:50:56 UTC (rev 7479)
+++ trunk/iptables/ip6tables-save.c 2008-04-14 06:51:33 UTC (rev 7480)
@@ -24,12 +24,12 @@
static int show_binary = 0, show_counters = 0;
-static struct option options[] = {
- { "binary", 0, 0, 'b' },
- { "counters", 0, 0, 'c' },
- { "dump", 0, 0, 'd' },
- { "table", 1, 0, 't' },
- { 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'},
+ {NULL},
};
Modified: trunk/iptables/ip6tables.c
===================================================================
--- trunk/iptables/ip6tables.c 2008-04-14 06:50:56 UTC (rev 7479)
+++ trunk/iptables/ip6tables.c 2008-04-14 06:51:33 UTC (rev 7480)
@@ -101,36 +101,36 @@
= { 'n', 's', 'd', 'p', 'j', 'v', 'x', 'i', 'o', '0', 'c'};
static struct option original_opts[] = {
- { "append", 1, 0, 'A' },
- { "delete", 1, 0, 'D' },
- { "insert", 1, 0, 'I' },
- { "replace", 1, 0, 'R' },
- { "list", 2, 0, 'L' },
- { "flush", 2, 0, 'F' },
- { "zero", 2, 0, 'Z' },
- { "new-chain", 1, 0, 'N' },
- { "delete-chain", 2, 0, 'X' },
- { "rename-chain", 1, 0, 'E' },
- { "policy", 1, 0, 'P' },
- { "source", 1, 0, 's' },
- { "destination", 1, 0, 'd' },
- { "src", 1, 0, 's' }, /* synonym */
- { "dst", 1, 0, 'd' }, /* synonym */
- { "protocol", 1, 0, 'p' },
- { "in-interface", 1, 0, 'i' },
- { "jump", 1, 0, 'j' },
- { "table", 1, 0, 't' },
- { "match", 1, 0, 'm' },
- { "numeric", 0, 0, 'n' },
- { "out-interface", 1, 0, 'o' },
- { "verbose", 0, 0, 'v' },
- { "exact", 0, 0, 'x' },
- { "version", 0, 0, 'V' },
- { "help", 2, 0, 'h' },
- { "line-numbers", 0, 0, '0' },
- { "modprobe", 1, 0, 'M' },
- { "set-counters", 1, 0, 'c' },
- { 0 }
+ {.name = "append", .has_arg = 1, .val = 'A'},
+ {.name = "delete", .has_arg = 1, .val = 'D'},
+ {.name = "insert", .has_arg = 1, .val = 'I'},
+ {.name = "replace", .has_arg = 1, .val = 'R'},
+ {.name = "list", .has_arg = 2, .val = 'L'},
+ {.name = "flush", .has_arg = 2, .val = 'F'},
+ {.name = "zero", .has_arg = 2, .val = 'Z'},
+ {.name = "new-chain", .has_arg = 1, .val = 'N'},
+ {.name = "delete-chain", .has_arg = 2, .val = 'X'},
+ {.name = "rename-chain", .has_arg = 1, .val = 'E'},
+ {.name = "policy", .has_arg = 1, .val = 'P'},
+ {.name = "source", .has_arg = 1, .val = 's'},
+ {.name = "destination", .has_arg = 1, .val = 'd'},
+ {.name = "src", .has_arg = 1, .val = 's'}, /* synonym */
+ {.name = "dst", .has_arg = 1, .val = 'd'}, /* synonym */
+ {.name = "protocol", .has_arg = 1, .val = 'p'},
+ {.name = "in-interface", .has_arg = 1, .val = 'i'},
+ {.name = "jump", .has_arg = 1, .val = 'j'},
+ {.name = "table", .has_arg = 1, .val = 't'},
+ {.name = "match", .has_arg = 1, .val = 'm'},
+ {.name = "numeric", .has_arg = 0, .val = 'n'},
+ {.name = "out-interface", .has_arg = 1, .val = 'o'},
+ {.name = "verbose", .has_arg = 0, .val = 'v'},
+ {.name = "exact", .has_arg = 0, .val = 'x'},
+ {.name = "version", .has_arg = 0, .val = 'V'},
+ {.name = "help", .has_arg = 2, .val = 'h'},
+ {.name = "line-numbers", .has_arg = 0, .val = '0'},
+ {.name = "modprobe", .has_arg = 1, .val = 'M'},
+ {.name = "set-counters", .has_arg = 1, .val = 'c'},
+ {NULL},
};
/* we need this for ip6tables-restore. ip6tables-restore.c sets line to the
Modified: trunk/iptables/iptables-restore.c
===================================================================
--- trunk/iptables/iptables-restore.c 2008-04-14 06:50:56 UTC (rev 7479)
+++ trunk/iptables/iptables-restore.c 2008-04-14 06:51:33 UTC (rev 7480)
@@ -26,16 +26,16 @@
static int binary = 0, counters = 0, verbose = 0, noflush = 0;
/* Keeping track of external matches and targets. */
-static struct option options[] = {
- { "binary", 0, 0, 'b' },
- { "counters", 0, 0, 'c' },
- { "verbose", 0, 0, 'v' },
- { "test", 0, 0, 't' },
- { "help", 0, 0, 'h' },
- { "noflush", 0, 0, 'n'},
- { "modprobe", 1, 0, 'M'},
- { "table", 1, 0, 'T'},
- { 0 }
+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'},
+ {.name = "help", .has_arg = false, .val = 'h'},
+ {.name = "noflush", .has_arg = false, .val = 'n'},
+ {.name = "modprobe", .has_arg = true, .val = 'M'},
+ {.name = "table", .has_arg = true, .val = 'T'},
+ {NULL},
};
static void print_usage(const char *name, const char *version) __attribute__((noreturn));
Modified: trunk/iptables/iptables-save.c
===================================================================
--- trunk/iptables/iptables-save.c 2008-04-14 06:50:56 UTC (rev 7479)
+++ trunk/iptables/iptables-save.c 2008-04-14 06:51:33 UTC (rev 7480)
@@ -23,12 +23,12 @@
static int show_binary = 0, show_counters = 0;
-static struct option options[] = {
- { "binary", 0, 0, 'b' },
- { "counters", 0, 0, 'c' },
- { "dump", 0, 0, 'd' },
- { "table", 1, 0, 't' },
- { 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'},
+ {NULL},
};
#define IP_PARTS_NATIVE(n) \
Modified: trunk/iptables/iptables.c
===================================================================
--- trunk/iptables/iptables.c 2008-04-14 06:50:56 UTC (rev 7479)
+++ trunk/iptables/iptables.c 2008-04-14 06:51:33 UTC (rev 7480)
@@ -99,38 +99,38 @@
= { 'n', 's', 'd', 'p', 'j', 'v', 'x', 'i', 'o', 'f', '0', 'c'};
static struct option original_opts[] = {
- { "append", 1, NULL, 'A' },
- { "delete", 1, NULL, 'D' },
- { "insert", 1, NULL, 'I' },
- { "replace", 1, NULL, 'R' },
- { "list", 2, NULL, 'L' },
- { "flush", 2, NULL, 'F' },
- { "zero", 2, NULL, 'Z' },
- { "new-chain", 1, NULL, 'N' },
- { "delete-chain", 2, NULL, 'X' },
- { "rename-chain", 1, NULL, 'E' },
- { "policy", 1, NULL, 'P' },
- { "source", 1, NULL, 's' },
- { "destination", 1, NULL, 'd' },
- { "src", 1, NULL, 's' }, /* synonym */
- { "dst", 1, NULL, 'd' }, /* synonym */
- { "protocol", 1, NULL, 'p' },
- { "in-interface", 1, NULL, 'i' },
- { "jump", 1, NULL, 'j' },
- { "table", 1, NULL, 't' },
- { "match", 1, NULL, 'm' },
- { "numeric", 0, NULL, 'n' },
- { "out-interface", 1, NULL, 'o' },
- { "verbose", 0, NULL, 'v' },
- { "exact", 0, NULL, 'x' },
- { "fragments", 0, NULL, 'f' },
- { "version", 0, NULL, 'V' },
- { "help", 2, NULL, 'h' },
- { "line-numbers", 0, NULL, '0' },
- { "modprobe", 1, NULL, 'M' },
- { "set-counters", 1, NULL, 'c' },
- { "goto", 1, NULL, 'g' },
- { }
+ {.name = "append", .has_arg = 1, .val = 'A'},
+ {.name = "delete", .has_arg = 1, .val = 'D'},
+ {.name = "insert", .has_arg = 1, .val = 'I'},
+ {.name = "replace", .has_arg = 1, .val = 'R'},
+ {.name = "list", .has_arg = 2, .val = 'L'},
+ {.name = "flush", .has_arg = 2, .val = 'F'},
+ {.name = "zero", .has_arg = 2, .val = 'Z'},
+ {.name = "new-chain", .has_arg = 1, .val = 'N'},
+ {.name = "delete-chain", .has_arg = 2, .val = 'X'},
+ {.name = "rename-chain", .has_arg = 1, .val = 'E'},
+ {.name = "policy", .has_arg = 1, .val = 'P'},
+ {.name = "source", .has_arg = 1, .val = 's'},
+ {.name = "destination", .has_arg = 1, .val = 'd'},
+ {.name = "src", .has_arg = 1, .val = 's'}, /* synonym */
+ {.name = "dst", .has_arg = 1, .val = 'd'}, /* synonym */
+ {.name = "protocol", .has_arg = 1, .val = 'p'},
+ {.name = "in-interface", .has_arg = 1, .val = 'i'},
+ {.name = "jump", .has_arg = 1, .val = 'j'},
+ {.name = "table", .has_arg = 1, .val = 't'},
+ {.name = "match", .has_arg = 1, .val = 'm'},
+ {.name = "numeric", .has_arg = 0, .val = 'n'},
+ {.name = "out-interface", .has_arg = 1, .val = 'o'},
+ {.name = "verbose", .has_arg = 0, .val = 'v'},
+ {.name = "exact", .has_arg = 0, .val = 'x'},
+ {.name = "fragments", .has_arg = 0, .val = 'f'},
+ {.name = "version", .has_arg = 0, .val = 'V'},
+ {.name = "help", .has_arg = 2, .val = 'h'},
+ {.name = "line-numbers", .has_arg = 0, .val = '0'},
+ {.name = "modprobe", .has_arg = 1, .val = 'M'},
+ {.name = "set-counters", .has_arg = 1, .val = 'c'},
+ {.name = "goto", .has_arg = 1, .val = 'g'},
+ {NULL},
};
/* we need this for iptables-restore. iptables-restore.c sets line to the
More information about the netfilter-cvslog
mailing list