]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
all: consistent syntax use in struct option
authorJan Engelhardt <jengelh@medozas.de>
Fri, 23 Jul 2010 19:16:14 +0000 (21:16 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Fri, 23 Jul 2010 19:25:43 +0000 (21:25 +0200)
Try to inhibit copypasting old stuff.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
88 files changed:
extensions/libip6t_HL.c
extensions/libip6t_LOG.c
extensions/libip6t_REJECT.c
extensions/libip6t_ah.c
extensions/libip6t_dst.c
extensions/libip6t_frag.c
extensions/libip6t_hbh.c
extensions/libip6t_hl.c
extensions/libip6t_icmp6.c
extensions/libip6t_ipv6header.c
extensions/libip6t_mh.c
extensions/libip6t_rt.c
extensions/libipt_CLUSTERIP.c
extensions/libipt_DNAT.c
extensions/libipt_ECN.c
extensions/libipt_LOG.c
extensions/libipt_MASQUERADE.c
extensions/libipt_NETMAP.c
extensions/libipt_REDIRECT.c
extensions/libipt_REJECT.c
extensions/libipt_SAME.c
extensions/libipt_SNAT.c
extensions/libipt_TTL.c
extensions/libipt_ULOG.c
extensions/libipt_addrtype.c
extensions/libipt_ah.c
extensions/libipt_ecn.c
extensions/libipt_icmp.c
extensions/libipt_realm.c
extensions/libipt_ttl.c
extensions/libxt_CHECKSUM.c
extensions/libxt_CLASSIFY.c
extensions/libxt_CONNMARK.c
extensions/libxt_CONNSECMARK.c
extensions/libxt_CT.c
extensions/libxt_DSCP.c
extensions/libxt_IDLETIMER.c
extensions/libxt_LED.c
extensions/libxt_MARK.c
extensions/libxt_NFLOG.c
extensions/libxt_NFQUEUE.c
extensions/libxt_RATEEST.c
extensions/libxt_SECMARK.c
extensions/libxt_SET.c
extensions/libxt_TCPMSS.c
extensions/libxt_TCPOPTSTRIP.c
extensions/libxt_TOS.c
extensions/libxt_TPROXY.c
extensions/libxt_cluster.c
extensions/libxt_comment.c
extensions/libxt_connbytes.c
extensions/libxt_connlimit.c
extensions/libxt_connmark.c
extensions/libxt_conntrack.c
extensions/libxt_cpu.c
extensions/libxt_dccp.c
extensions/libxt_dscp.c
extensions/libxt_esp.c
extensions/libxt_hashlimit.c
extensions/libxt_helper.c
extensions/libxt_iprange.c
extensions/libxt_ipvs.c
extensions/libxt_length.c
extensions/libxt_limit.c
extensions/libxt_mac.c
extensions/libxt_mark.c
extensions/libxt_multiport.c
extensions/libxt_osf.c
extensions/libxt_owner.c
extensions/libxt_physdev.c
extensions/libxt_pkttype.c
extensions/libxt_policy.c
extensions/libxt_quota.c
extensions/libxt_rateest.c
extensions/libxt_recent.c
extensions/libxt_sctp.c
extensions/libxt_set.c
extensions/libxt_state.c
extensions/libxt_statistic.c
extensions/libxt_string.c
extensions/libxt_tcp.c
extensions/libxt_tcpmss.c
extensions/libxt_time.c
extensions/libxt_tos.c
extensions/libxt_u32.c
extensions/libxt_udp.c
extensions/tos_values.c
include/xtables.h.in

index bff0611114a68a22caf066cdf1a722c96a00ebe4..eeab0c93075e7a931e98381a5b30366943c22074 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <getopt.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -131,10 +132,10 @@ static void HL_print(const void *ip, const struct xt_entry_target *target,
 }
 
 static const struct option HL_opts[] = {
-       { "hl-set", 1, NULL, '1' },
-       { "hl-dec", 1, NULL, '2' },
-       { "hl-inc", 1, NULL, '3' },
-       { .name = NULL }
+       {.name = "hl-set", .has_arg = true, .val = '1'},
+       {.name = "hl-dec", .has_arg = true, .val = '2'},
+       {.name = "hl-inc", .has_arg = true, .val = '3'},
+       XT_GETOPT_TABLEEND,
 };
 
 static struct xtables_target hl_tg6_reg = {
index ff9edc68bdbe492e4c0e90903a2c36926665f3d7..727ce6a3dc13e44110eb23c18fad5c5263b2fd75 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to ip6tables to add LOG support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -30,14 +31,14 @@ static void LOG_help(void)
 }
 
 static const struct option LOG_opts[] = {
-       { .name = "log-level",        .has_arg = 1, .val = '!' },
-       { .name = "log-prefix",       .has_arg = 1, .val = '#' },
-       { .name = "log-tcp-sequence", .has_arg = 0, .val = '1' },
-       { .name = "log-tcp-options",  .has_arg = 0, .val = '2' },
-       { .name = "log-ip-options",   .has_arg = 0, .val = '3' },
-       { .name = "log-uid",          .has_arg = 0, .val = '4' },
-       { .name = "log-macdecode",    .has_arg = 0, .val = '5' },
-       { .name = NULL }
+       {.name = "log-level",        .has_arg = true,  .val = '!'},
+       {.name = "log-prefix",       .has_arg = true,  .val = '#'},
+       {.name = "log-tcp-sequence", .has_arg = false, .val = '1'},
+       {.name = "log-tcp-options",  .has_arg = false, .val = '2'},
+       {.name = "log-ip-options",   .has_arg = false, .val = '3'},
+       {.name = "log-uid",          .has_arg = false, .val = '4'},
+       {.name = "log-macdecode",    .has_arg = false, .val = '5'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void LOG_init(struct xt_entry_target *t)
index b8195d7f91009ea2037ef87e3226b48f3345f144..94d269426939f1193c054e317653281bc47b80de 100644 (file)
@@ -5,6 +5,7 @@
  * ported to IPv6 by Harald Welte <laforge@gnumonks.org>
  *
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -61,8 +62,8 @@ static void REJECT_help(void)
 }
 
 static const struct option REJECT_opts[] = {
-       { "reject-with", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "reject-with", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void REJECT_init(struct xt_entry_target *t)
index 285704c0392706ac196396e40395dce1e4badd64..41c538532dd176f401510a10e98d89908c001cb2 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to ip6tables to add AH support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -18,10 +19,10 @@ static void ah_help(void)
 }
 
 static const struct option ah_opts[] = {
-       { .name = "ahspi", .has_arg = 1, .val = '1' },
-       { .name = "ahlen", .has_arg = 1, .val = '2' },
-       { .name = "ahres", .has_arg = 0, .val = '3' },
-       { .name = NULL }
+       {.name = "ahspi", .has_arg = true,  .val = '1'},
+       {.name = "ahlen", .has_arg = true,  .val = '2'},
+       {.name = "ahres", .has_arg = false, .val = '3'},
+       XT_GETOPT_TABLEEND,
 };
 
 static u_int32_t
index 72df6ad0147f7fbfab231ba06b769050b54e24fb..9e4875ee2865a8c12cd5ea8c827b3c8775dcddc3 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to ip6tables to add Dst header support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -22,10 +23,10 @@ IP6T_OPTS_OPTSNR);
 }
 
 static const struct option dst_opts[] = {
-       { .name = "dst-len",        .has_arg = 1, .val = '1' },
-       { .name = "dst-opts",       .has_arg = 1, .val = '2' },
-       { .name = "dst-not-strict", .has_arg = 1, .val = '3' },
-       { .name = NULL }
+       {.name = "dst-len",        .has_arg = true, .val = '1'},
+       {.name = "dst-opts",       .has_arg = true, .val = '2'},
+       {.name = "dst-not-strict", .has_arg = true, .val = '3'},
+       XT_GETOPT_TABLEEND,
 };
 
 static u_int32_t
index 5a280cc1e6fabf4a687afe17bf43f243a2f446cb..dd23cda6509268c8f09632cc3c7f2524de8c87fc 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to ip6tables to add Fragmentation header support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -21,13 +22,13 @@ static void frag_help(void)
 }
 
 static const struct option frag_opts[] = {
-       { .name = "fragid",    .has_arg = 1, .val = '1' },
-       { .name = "fraglen",   .has_arg = 1, .val = '2' },
-       { .name = "fragres",   .has_arg = 0, .val = '3' },
-       { .name = "fragfirst", .has_arg = 0, .val = '4' },
-       { .name = "fragmore",  .has_arg = 0, .val = '5' },
-       { .name = "fraglast",  .has_arg = 0, .val = '6' },
-       { .name = NULL }
+       {.name = "fragid",    .has_arg = true,  .val = '1'},
+       {.name = "fraglen",   .has_arg = true,  .val = '2'},
+       {.name = "fragres",   .has_arg = false, .val = '3'},
+       {.name = "fragfirst", .has_arg = false, .val = '4'},
+       {.name = "fragmore",  .has_arg = false, .val = '5'},
+       {.name = "fraglast",  .has_arg = false, .val = '6'},
+       XT_GETOPT_TABLEEND,
 };
 
 static u_int32_t
index 520ec9ed584546a41b51460c6cc953660c2548a0..cddd615f7018a1c0564a9a5cc0ccf51e81e7f9cc 100644 (file)
@@ -25,10 +25,10 @@ IP6T_OPTS_OPTSNR);
 }
 
 static const struct option hbh_opts[] = {
-       { "hbh-len", 1, NULL, '1' },
-       { "hbh-opts", 1, NULL, '2' },
-       { "hbh-not-strict", 1, NULL, '3' },
-       { .name = NULL }
+       {.name = "hbh-len",        .has_arg = true, .val = '1'},
+       {.name = "hbh-opts",       .has_arg = true, .val = '2'},
+       {.name = "hbh-not-strict", .has_arg = true, .val = '3'},
+       XT_GETOPT_TABLEEND,
 };
 
 static u_int32_t
index 09589b1917757851067dca407844cdec0457f2dc..6e58250ccf2f17466c1b7ffb3ae32d6fa309de38 100644 (file)
@@ -5,7 +5,7 @@
  * This program is released under the terms of GNU GPL
  * Cleanups by Stephane Ouellette <ouellettes@videotron.ca>
  */
-
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -116,11 +116,11 @@ static void hl_save(const void *ip, const struct xt_entry_match *match)
 }
 
 static const struct option hl_opts[] = {
-       { .name = "hl",    .has_arg = 1, .val = '2' },
-       { .name = "hl-eq", .has_arg = 1, .val = '2' },
-       { .name = "hl-lt", .has_arg = 1, .val = '3' },
-       { .name = "hl-gt", .has_arg = 1, .val = '4' },
-       { .name = NULL }
+       {.name = "hl",    .has_arg = true, .val = '2'},
+       {.name = "hl-eq", .has_arg = true, .val = '2'},
+       {.name = "hl-lt", .has_arg = true, .val = '3'},
+       {.name = "hl-gt", .has_arg = true, .val = '4'},
+       XT_GETOPT_TABLEEND,
 };
 
 static struct xtables_match hl_mt6_reg = {
index fb321b3beab7f6a94f7780f4de37b123fa294236..b8a6ec920f392d6ca7c6eba3fef2c61b9d160ae9 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to ip6tables to add ICMP support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -84,8 +85,8 @@ static void icmp6_help(void)
 }
 
 static const struct option icmp6_opts[] = {
-       { "icmpv6-type", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "icmpv6-type", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void
index af1f5ef6fe90e874f1fcfdfc5ad8036dda23ddda..d6ce248c246ed7dfd890bd5ae7e85ffda0809f16 100644 (file)
@@ -6,6 +6,7 @@ on whether they contain certain headers */
 
 #include <getopt.h>
 #include <xtables.h>
+#include <stdbool.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -140,9 +141,9 @@ static void ipv6header_help(void)
 }
 
 static const struct option ipv6header_opts[] = {
-       { "header", 1, NULL, '1' },
-       { "soft", 0, NULL, '2' },
-       { .name = NULL }
+       {.name = "header", .has_arg = true,  .val = '1'},
+       {.name = "soft",   .has_arg = false, .val = '2'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void ipv6header_init(struct xt_entry_match *m)
index 95cd65d1ea0c0659c553a97b4445eae4467e8404..54dd8c684b54e03d77a6697feb07373522094716 100644 (file)
@@ -11,6 +11,7 @@
  *
  * Based on libip6t_{icmpv6,udp}.c
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -216,8 +217,8 @@ static void mh_save(const void *ip, const struct xt_entry_match *match)
 }
 
 static const struct option mh_opts[] = {
-       { "mh-type", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "mh-type", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static struct xtables_match mh_mt6_reg = {
index a04023df9d65109c6d2cc905974cdc3f1f4eea76..f1a50eb86f3e53677670f75339e3c3b047c26642 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to ip6tables to add Routing header support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -28,13 +29,13 @@ IP6T_RT_HOPS);
 }
 
 static const struct option rt_opts[] = {
-       { "rt-type", 1, NULL, '1' },
-       { "rt-segsleft", 1, NULL, '2' },
-       { "rt-len", 1, NULL, '3' },
-       { "rt-0-res", 0, NULL, '4' },
-       { "rt-0-addrs", 1, NULL, '5' },
-       { "rt-0-not-strict", 0, NULL, '6' },
-       { .name = NULL }
+       {.name = "rt-type",         .has_arg = true,  .val = '1'},
+       {.name = "rt-segsleft",     .has_arg = true,  .val = '2'},
+       {.name = "rt-len",          .has_arg = true,  .val = '3'},
+       {.name = "rt-0-res",        .has_arg = false, .val = '4'},
+       {.name = "rt-0-addrs",      .has_arg = true,  .val = '5'},
+       {.name = "rt-0-not-strict", .has_arg = false, .val = '6'},
+       XT_GETOPT_TABLEEND,
 };
 
 static u_int32_t
index 279aacff4b5cff2cf46a2b7939baea1ff9c8ccf3..492eefc32c091444d23e4922c011eedb8d8ac64e 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Development of this code was funded by SuSE AG, http://www.suse.com/
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -41,13 +42,13 @@ static void CLUSTERIP_help(void)
 #define PARAM_HASHINIT 0x0020
 
 static const struct option CLUSTERIP_opts[] = {
-       { "new", 0, NULL, '1' },
-       { "hashmode", 1, NULL, '2' },
-       { "clustermac", 1, NULL, '3' },
-       { "total-nodes", 1, NULL, '4' },
-       { "local-node", 1, NULL, '5' },
-       { "hash-init", 1, NULL, '6' },
-       { .name = NULL }
+       {.name = "new",         .has_arg = false, .val = '1'},
+       {.name = "hashmode",    .has_arg = true,  .val = '2'},
+       {.name = "clustermac",  .has_arg = true,  .val = '3'},
+       {.name = "total-nodes", .has_arg = true,  .val = '4'},
+       {.name = "local-node",  .has_arg = true,  .val = '5'},
+       {.name = "hash-init",   .has_arg = true,  .val = '6'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void
index 57c5888b0254c6cb346665f4c40b5057dafd7b82..7afe241aa4a219dff14945dcf0214537b38aaeaa 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add destination-NAT support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -31,10 +32,10 @@ static void DNAT_help(void)
 }
 
 static const struct option DNAT_opts[] = {
-       { "to-destination", 1, NULL, '1' },
-       { "random", 0, NULL, '2' },
-       { "persistent", 0, NULL, '3' },
-       { .name = NULL }
+       {.name = "to-destination", .has_arg = true,  .val = '1'},
+       {.name = "random",         .has_arg = false, .val = '2'},
+       {.name = "persistent",     .has_arg = false, .val = '3'},
+       XT_GETOPT_TABLEEND,
 };
 
 static struct ipt_natinfo *
index bf1f8a5a4c5474601a1ee650f1996bc024a6c258..75ea01142e6c9c105ea8dc47a6159f657244ccce 100644 (file)
@@ -8,6 +8,7 @@
  *
  * $Id$
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -32,11 +33,11 @@ static void ECN_help(void)
 
 
 static const struct option ECN_opts[] = {
-       { "ecn-tcp-remove", 0, NULL, 'F' },
-       { "ecn-tcp-cwr", 1, NULL, 'G' },
-       { "ecn-tcp-ece", 1, NULL, 'H' },
-       { "ecn-ip-ect", 1, NULL, '9' },
-       { .name = NULL }
+       {.name = "ecn-tcp-remove", .has_arg = false, .val = 'F'},
+       {.name = "ecn-tcp-cwr",    .has_arg = true,  .val = 'G'},
+       {.name = "ecn-tcp-ece",    .has_arg = true,  .val = 'H'},
+       {.name = "ecn-ip-ect",     .has_arg = true,  .val = '9'},
+       XT_GETOPT_TABLEEND,
 };
 
 static int ECN_parse(int c, char **argv, int invert, unsigned int *flags,
index 73c8f32d050c6b883b0c343dca909545f0988cbd..0c4127173aa8f644a2ebde496de1d8c7393cdf10 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add LOG support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -30,14 +31,14 @@ static void LOG_help(void)
 }
 
 static const struct option LOG_opts[] = {
-       { .name = "log-level",        .has_arg = 1, .val = '!' },
-       { .name = "log-prefix",       .has_arg = 1, .val = '#' },
-       { .name = "log-tcp-sequence", .has_arg = 0, .val = '1' },
-       { .name = "log-tcp-options",  .has_arg = 0, .val = '2' },
-       { .name = "log-ip-options",   .has_arg = 0, .val = '3' },
-       { .name = "log-uid",          .has_arg = 0, .val = '4' },
-       { .name = "log-macdecode",    .has_arg = 0, .val = '5' },
-       { .name = NULL }
+       {.name = "log-level",        .has_arg = true,  .val = '!'},
+       {.name = "log-prefix",       .has_arg = true,  .val = '#'},
+       {.name = "log-tcp-sequence", .has_arg = false, .val = '1'},
+       {.name = "log-tcp-options",  .has_arg = false, .val = '2'},
+       {.name = "log-ip-options",   .has_arg = false, .val = '3'},
+       {.name = "log-uid",          .has_arg = false, .val = '4'},
+       {.name = "log-macdecode",    .has_arg = false, .val = '5'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void LOG_init(struct xt_entry_target *t)
index 3386ff34ca08291a254157f41aaf6eadbb57cb7f..b6bbd605d96d3a6229bc607acd886bad9f242567 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add masquerade support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -20,9 +21,9 @@ static void MASQUERADE_help(void)
 }
 
 static const struct option MASQUERADE_opts[] = {
-       { "to-ports", 1, NULL, '1' },
-       { "random", 0, NULL, '2' },
-       { .name = NULL }
+       {.name = "to-ports", .has_arg = true,  .val = '1'},
+       {.name = "random",   .has_arg = false, .val = '2'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void MASQUERADE_init(struct xt_entry_target *t)
index b05022b047975ab5adeeb6e3fd658ba365cc5607..09262baae0ea898331c2845598a6b18aff33236c 100644 (file)
@@ -1,7 +1,7 @@
 /* Shared library add-on to iptables to add static NAT support.
    Author: Svenning Soerensen <svenning@post5.tele.dk>
 */
-
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -13,8 +13,8 @@
 #define MODULENAME "NETMAP"
 
 static const struct option NETMAP_opts[] = {
-       { "to", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "to", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void NETMAP_help(void)
index 324d0ebf8486730df0193332f90a0292ea95f81a..940603a9a613a6f4f3d4b1b94166d105aa41796b 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add redirect support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -22,9 +23,9 @@ static void REDIRECT_help(void)
 }
 
 static const struct option REDIRECT_opts[] = {
-       { "to-ports", 1, NULL, '1' },
-       { "random", 0, NULL, '2' },
-       { .name = NULL }
+       {.name = "to-ports", .has_arg = true,  .val = '1'},
+       {.name = "random",   .has_arg = false, .val = '2'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void REDIRECT_init(struct xt_entry_target *t)
index 85d9e53fa99c695e5d8381299499ebe5b22c9d8a..8c08dd0c7ca4305baf3384fe757d994fc772ea71 100644 (file)
@@ -2,6 +2,7 @@
  *
  * (C) 2000 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -76,8 +77,8 @@ static void REJECT_help(void)
 }
 
 static const struct option REJECT_opts[] = {
-       { "reject-with", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "reject-with", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void REJECT_init(struct xt_entry_target *t)
index ed02ef9503c131e78c7dd66867e6710e88109a3d..5fb1b5b282785e224df908a16e3e2acb5d5e2197 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add simple non load-balancing SNAT support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -25,10 +26,10 @@ static void SAME_help(void)
 }
 
 static const struct option SAME_opts[] = {
-       { "to", 1, NULL, '1' },
-       { "nodst", 0, NULL, '2'},
-       { "random", 0, NULL, '3' },
-       { .name = NULL }
+       {.name = "to",     .has_arg = true,  .val = '1'},
+       {.name = "nodst",  .has_arg = false, .val = '2'},
+       {.name = "random", .has_arg = false, .val = '3'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void SAME_init(struct xt_entry_target *t)
index f7c93d8123854c4e021150ec47854947c648b186..1075c793cdb73da4287a97e9b1eb490c8cbcf275 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add source-NAT support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -31,10 +32,10 @@ static void SNAT_help(void)
 }
 
 static const struct option SNAT_opts[] = {
-       { "to-source", 1, NULL, '1' },
-       { "random", 0, NULL, '2' },
-       { "persistent", 0, NULL, '3' },
-       { .name = NULL }
+       {.name = "to-source",  .has_arg = true,  .val = '1'},
+       {.name = "random",     .has_arg = false, .val = '2'},
+       {.name = "persistent", .has_arg = false, .val = '3'},
+       XT_GETOPT_TABLEEND,
 };
 
 static struct ipt_natinfo *
index 4db9bbe948697ea3ca039d6f323a560cc1c98380..2e0c2338a44fa39cfe72a9f997b1a4be2a065f80 100644 (file)
@@ -5,6 +5,7 @@
  *
  * This program is distributed under the terms of GNU GPL
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -131,10 +132,10 @@ static void TTL_print(const void *ip, const struct xt_entry_target *target,
 }
 
 static const struct option TTL_opts[] = {
-       { "ttl-set", 1, NULL, '1' },
-       { "ttl-dec", 1, NULL, '2' },
-       { "ttl-inc", 1, NULL, '3' },
-       { .name = NULL }
+       {.name = "ttl-set", .has_arg = true, .val = '1'},
+       {.name = "ttl-dec", .has_arg = true, .val = '2'},
+       {.name = "ttl-inc", .has_arg = true, .val = '3'},
+       XT_GETOPT_TABLEEND,
 };
 
 static struct xtables_target ttl_tg_reg = {
index 4d009b7582c773a3df9c074fc15ededda4768bf1..46928c34b18e1806bffe51e614cb4553f4ad7b69 100644 (file)
@@ -9,6 +9,7 @@
  * 
  * libipt_ULOG.c,v 1.7 2001/01/30 11:55:02 laforge Exp
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -42,11 +43,11 @@ static void ULOG_help(void)
 }
 
 static const struct option ULOG_opts[] = {
-       {"ulog-nlgroup", 1, NULL, '!'},
-       {"ulog-prefix", 1, NULL, '#'},
-       {"ulog-cprange", 1, NULL, 'A'},
-       {"ulog-qthreshold", 1, NULL, 'B'},
-       { .name = NULL }
+       {.name = "ulog-nlgroup",    .has_arg = true, .val = '!'},
+       {.name = "ulog-prefix",     .has_arg = true, .val = '#'},
+       {.name = "ulog-cprange",    .has_arg = true, .val = 'A'},
+       {.name = "ulog-qthreshold", .has_arg = true, .val = 'B'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void ULOG_init(struct xt_entry_target *t)
index ad63dcf71f0e59640cb1850086596ffa4afdcb3e..9391b4e6c47cde1b6ab47a35668c0b7e8becaa0d 100644 (file)
@@ -1,7 +1,7 @@
 /* Shared library add-on to iptables to add addrtype matching support 
  * 
  * This program is released under the terms of GNU GPL */
-
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -304,23 +304,23 @@ static void addrtype_save_v1(const void *ip, const struct xt_entry_match *match)
 }
 
 static const struct option addrtype_opts[] = {
-       { "src-type", 1, NULL, '1' },
-       { "dst-type", 1, NULL, '2' },
-       { .name = NULL }
+       {.name = "src-type", .has_arg = true, .val = '1'},
+       {.name = "dst-type", .has_arg = true, .val = '2'},
+       XT_GETOPT_TABLEEND,
 };
 
 static const struct option addrtype_opts_v0[] = {
-       { "src-type", 1, NULL, '1' },
-       { "dst-type", 1, NULL, '2' },
-       { .name = NULL }
+       {.name = "src-type", .has_arg = true, .val = '1'},
+       {.name = "dst-type", .has_arg = true, .val = '2'},
+       XT_GETOPT_TABLEEND,
 };
 
 static const struct option addrtype_opts_v1[] = {
-       { "src-type", 1, NULL, '1' },
-       { "dst-type", 1, NULL, '2' },
-       { "limit-iface-in", 0, NULL, '3' },
-       { "limit-iface-out", 0, NULL, '4' },
-       { .name = NULL }
+       {.name = "src-type",        .has_arg = true,  .val = '1'},
+       {.name = "dst-type",        .has_arg = true,  .val = '2'},
+       {.name = "limit-iface-in",  .has_arg = false, .val = '3'},
+       {.name = "limit-iface-out", .has_arg = false, .val = '4'},
+       XT_GETOPT_TABLEEND,
 };
 
 static struct xtables_match addrtype_mt_reg[] = {
index 170cd8b9b4af7b3e54c17a063f5eb9006351edb7..58ed6d157e596e3fdfb94a595a140a31cd22d41f 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add AH support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -17,8 +18,8 @@ static void ah_help(void)
 }
 
 static const struct option ah_opts[] = {
-       { "ahspi", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "ahspi", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static u_int32_t
index ec3ff2da1b96fe1ebb4fbb7deb814f700d3bb84c..3f1fc3bd6b304ad7cdd6b4efa518b94fd3bc647a 100644 (file)
@@ -7,6 +7,7 @@
  * libipt_ecn.c borrowed heavily from libipt_dscp.c
  *
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -25,10 +26,10 @@ static void ecn_help(void)
 }
 
 static const struct option ecn_opts[] = {
-       { .name = "ecn-tcp-cwr", .has_arg = 0, .val = 'F' },
-       { .name = "ecn-tcp-ece", .has_arg = 0, .val = 'G' },
-       { .name = "ecn-ip-ect",  .has_arg = 1, .val = 'H' },
-       { .name = NULL }
+       {.name = "ecn-tcp-cwr", .has_arg = false, .val = 'F'},
+       {.name = "ecn-tcp-ece", .has_arg = false, .val = 'G'},
+       {.name = "ecn-ip-ect",  .has_arg = true,  .val = 'H'},
+       XT_GETOPT_TABLEEND,
 };
 
 static int ecn_parse(int c, char **argv, int invert, unsigned int *flags,
index 37b2fdcde612cf85a77d69b173d44d01eb5c3936..28985b9485c0853dca68bbb83f925bdab7595be9 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add ICMP support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -108,8 +109,8 @@ static void icmp_help(void)
 }
 
 static const struct option icmp_opts[] = {
-       { "icmp-type", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "icmp-type", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void 
index cd4b324bbbaddadf9f738c42da0d16b0a380da9b..1d4854643a8c407a03d6f8406c2e4f3e3f22af78 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add realm matching support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -23,8 +24,8 @@ static void realm_help(void)
 }
 
 static const struct option realm_opts[] = {
-       { "realm", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "realm", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 struct realmname { 
index e2fbcd5bd560006c7567a68f8eb9bc2b0241e7e8..34d0f23599c44ea62c6f7ad886a938638d5faebd 100644 (file)
@@ -4,7 +4,7 @@
  * $Id$
  *
  * This program is released under the terms of GNU GPL */
-
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -139,11 +139,11 @@ static void ttl_save(const void *ip, const struct xt_entry_match *match)
 }
 
 static const struct option ttl_opts[] = {
-       { "ttl", 1, NULL, '2' },
-       { "ttl-eq", 1, NULL, '2'},
-       { "ttl-lt", 1, NULL, '3'},
-       { "ttl-gt", 1, NULL, '4'},
-       { .name = NULL }
+       {.name = "ttl",    .has_arg = true, .val = '2'},
+       {.name = "ttl-eq", .has_arg = true, .val = '2'},
+       {.name = "ttl-lt", .has_arg = true, .val = '3'},
+       {.name = "ttl-gt", .has_arg = true, .val = '4'},
+       XT_GETOPT_TABLEEND,
 };
 
 static struct xtables_match ttl_mt_reg = {
index 9a24443b5dc95f30e964dfad8aeb388a03dd3aa8..101a54caef1336554878af4d152099558ba80879 100644 (file)
@@ -8,6 +8,7 @@
  *
  * libxt_CHECKSUM.c borrowed some bits from libipt_ECN.c
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -24,8 +25,8 @@ static void CHECKSUM_help(void)
 }
 
 static const struct option CHECKSUM_opts[] = {
-       { "checksum-fill", 0, NULL, 'F' },
-       { .name = NULL }
+       {.name = "checksum-fill", .has_arg = false, .val = 'F'},
+       XT_GETOPT_TABLEEND,
 };
 
 static int CHECKSUM_parse(int c, char **argv, int invert, unsigned int *flags,
index 82b8f4e0f98d10e1fa260aea47f2ecc25de3460a..ab5127c33e2fa0182455c217bc92c97d0ed7c1a3 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add CLASSIFY target support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -19,8 +20,8 @@ CLASSIFY_help(void)
 }
 
 static const struct option CLASSIFY_opts[] = {
-       { "set-class", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "set-class", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static int CLASSIFY_string_to_priority(const char *s, unsigned int *p)
index 6aba5f3cfb1d3d74ba2fa6fec636df7072b7701f..6772877534948ffca8588b4927dde7ca3cb75a86 100644 (file)
@@ -19,6 +19,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -49,11 +50,11 @@ static void CONNMARK_help(void)
 }
 
 static const struct option CONNMARK_opts[] = {
-       { "set-mark", 1, NULL, '1' },
-       { "save-mark", 0, NULL, '2' },
-       { "restore-mark", 0, NULL, '3' },
-       { "mask", 1, NULL, '4' },
-       { .name = NULL }
+       {.name = "set-mark",     .has_arg = true,  .val = '1'},
+       {.name = "save-mark",    .has_arg = false, .val = '2'},
+       {.name = "restore-mark", .has_arg = false, .val = '3'},
+       {.name = "mask",         .has_arg = true,  .val = '4'},
+       XT_GETOPT_TABLEEND,
 };
 
 static const struct option connmark_tg_opts[] = {
@@ -67,7 +68,7 @@ static const struct option connmark_tg_opts[] = {
        {.name = "ctmask",        .has_arg = true,  .val = 'c'},
        {.name = "nfmask",        .has_arg = true,  .val = 'n'},
        {.name = "mask",          .has_arg = true,  .val = 'm'},
-       {.name = NULL},
+       XT_GETOPT_TABLEEND,
 };
 
 static void connmark_tg_help(void)
index d95339f39c3b100c0450e7a6592a35df602cc9dd..8df23639bb1da5fe8558528b092ba1b0fba9b89d 100644 (file)
@@ -5,6 +5,7 @@
  *
  * Copyright (C) 2006 Red Hat, Inc., James Morris <jmorris@redhat.com>
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -23,9 +24,9 @@ static void CONNSECMARK_help(void)
 }
 
 static const struct option CONNSECMARK_opts[] = {
-       { "save", 0, NULL, '1' },
-       { "restore", 0, NULL, '2' },
-       { .name = NULL }
+       {.name = "save",    .has_arg = false, .val = '1'},
+       {.name = "restore", .has_arg = false, .val = '2'},
+       XT_GETOPT_TABLEEND,
 };
 
 static int
index 6be6ea0566b595d358f02a0531734264e52c4c48..8952b757ba924b574cc6bc7796c0a778376f73a1 100644 (file)
@@ -1,3 +1,4 @@
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -28,12 +29,12 @@ enum ct_options {
 };
 
 static const struct option ct_opts[] = {
-       { "notrack",    0, NULL, CT_OPT_NOTRACK },
-       { "helper",     1, NULL, CT_OPT_HELPER },
-       { "ctevents",   1, NULL, CT_OPT_CTEVENTS },
-       { "expevents",  1, NULL, CT_OPT_EXPEVENTS },
-       { "zone",       1, NULL, CT_OPT_ZONE },
-       { .name = NULL },
+       {.name = "notrack",     .has_arg = false, .val = CT_OPT_NOTRACK},
+       {.name = "helper",      .has_arg = true,  .val = CT_OPT_HELPER},
+       {.name = "ctevents",    .has_arg = true,  .val = CT_OPT_CTEVENTS},
+       {.name = "expevents",   .has_arg = true,  .val = CT_OPT_EXPEVENTS},
+       {.name = "zone",        .has_arg = true,  .val = CT_OPT_ZONE},
+       XT_GETOPT_TABLEEND,
 };
 
 struct event_tbl {
index 82ac10c3a215cfcce6eee14fd1913eb29a1b4e18..9a69824814284ccc6ee31b8798d89d9a39a49486 100644 (file)
@@ -9,6 +9,7 @@
  *
  * --set-class added by Iain Barnes
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -38,9 +39,9 @@ static void DSCP_help(void)
 }
 
 static const struct option DSCP_opts[] = {
-       { "set-dscp", 1, NULL, 'F' },
-       { "set-dscp-class", 1, NULL, 'G' },
-       { .name = NULL }
+       {.name = "set-dscp",       .has_arg = true, .val = 'F'},
+       {.name = "set-dscp-class", .has_arg = true, .val = 'G'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void
index c931d0eeea0361d390c76271c9b40a1b993d008c..12573a4fe432d6bdf3284281aa930abb203372fc 100644 (file)
@@ -20,7 +20,7 @@
  * 02110-1301 USA
  *
  */
-
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -36,9 +36,9 @@ enum {
 };
 
 static const struct option idletimer_tg_opts[] = {
-       { .name = "timeout", .has_arg = true, .flag = 0, .val = 't' },
-       { .name = "label",   .has_arg = true, .flag = 0, .val = 'l' },
-       { .name = NULL }
+       {.name = "timeout", .has_arg = true, .val = 't'},
+       {.name = "label",   .has_arg = true, .val = 'l'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void idletimer_tg_help(void)
index af0e091eef8d7f6ddef589a5222620dc4bf00a93..ca1b6ed449998fc2031320f07df82545c06405c6 100644 (file)
@@ -9,7 +9,7 @@
  * published by the Free Software Foundation.
  *
  */
-
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -24,7 +24,7 @@ static const struct option LED_opts[] = {
        {.name = "led-trigger-id",   .has_arg = true,  .val = 'i'},
        {.name = "led-delay",        .has_arg = true,  .val = 'd'},
        {.name = "led-always-blink", .has_arg = false, .val = 'a'},
-       {.name = NULL},
+       XT_GETOPT_TABLEEND,
 };
 
 static void LED_help(void)
index dbfc7c0c96d3154572b5256cf26cbfab6c393c53..39996d0ace506fb5365ffb3036e112962a89a20e 100644 (file)
@@ -40,10 +40,10 @@ static void MARK_help(void)
 }
 
 static const struct option MARK_opts[] = {
-       { "set-mark", 1, NULL, '1' },
-       { "and-mark", 1, NULL, '2' },
-       { "or-mark", 1, NULL, '3' },
-       { .name = NULL }
+       {.name = "set-mark", .has_arg = true, .val = '1'},
+       {.name = "and-mark", .has_arg = true, .val = '2'},
+       {.name = "or-mark",  .has_arg = true, .val = '3'},
+       XT_GETOPT_TABLEEND,
 };
 
 static const struct option mark_tg_opts[] = {
@@ -52,7 +52,7 @@ static const struct option mark_tg_opts[] = {
        {.name = "and-mark",  .has_arg = true, .val = '&'},
        {.name = "or-mark",   .has_arg = true, .val = '|'},
        {.name = "xor-mark",  .has_arg = true, .val = '^'},
-       { .name = NULL }
+       XT_GETOPT_TABLEEND,
 };
 
 static void mark_tg_help(void)
index e2185d5a0d25c1c0b01e9d1fcb052e73acf2b783..2cf279ad9f4f0010c32f39514aa713b0e985d9a6 100644 (file)
@@ -1,3 +1,4 @@
+#include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -15,11 +16,11 @@ enum {
 };
 
 static const struct option NFLOG_opts[] = {
-       { "nflog-group",     1, NULL, NFLOG_GROUP },
-       { "nflog-prefix",    1, NULL, NFLOG_PREFIX },
-       { "nflog-range",     1, NULL, NFLOG_RANGE },
-       { "nflog-threshold", 1, NULL, NFLOG_THRESHOLD },
-       { .name = NULL }
+       {.name = "nflog-group",     .has_arg = true, .val = NFLOG_GROUP},
+       {.name = "nflog-prefix",    .has_arg = true, .val = NFLOG_PREFIX},
+       {.name = "nflog-range",     .has_arg = true, .val = NFLOG_RANGE},
+       {.name = "nflog-threshold", .has_arg = true, .val = NFLOG_THRESHOLD},
+       XT_GETOPT_TABLEEND,
 };
 
 static void NFLOG_help(void)
index 2d9d98ab0a5ca67ac91f579ba45e111467efa85b..e412153a96a89f3befde7dcbe367566bfe54ffc8 100644 (file)
@@ -5,6 +5,7 @@
  * This program is distributed under the terms of GNU GPL v2, 1991
  *
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -31,9 +32,9 @@ static void NFQUEUE_help_v1(void)
 }
 
 static const struct option NFQUEUE_opts[] = {
-       { "queue-num", 1, NULL, 'F' },
-       { "queue-balance", 1, NULL, 'B' },
-       { .name = NULL }
+       {.name = "queue-num",     .has_arg = true, .val = 'F'},
+       {.name = "queue-balance", .has_arg = true, .val = 'B'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void exit_badqueue(const char *s)
index 4b7831ff6f430f61815e5ff9f1de68f61044752f..d89f818490e85094d8cdfa70a83254dcda9ff63e 100644 (file)
@@ -1,3 +1,4 @@
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -31,10 +32,10 @@ enum RATEEST_options {
 };
 
 static const struct option RATEEST_opts[] = {
-       { "rateest-name",       1, NULL, RATEEST_OPT_NAME },
-       { "rateest-interval",   1, NULL, RATEEST_OPT_INTERVAL },
-       { "rateest-ewmalog",    1, NULL, RATEEST_OPT_EWMALOG },
-       { .name = NULL },
+       {.name = "rateest-name",     .has_arg = true, .val = RATEEST_OPT_NAME},
+       {.name = "rateest-interval", .has_arg = true, .val = RATEEST_OPT_INTERVAL},
+       {.name = "rateest-ewmalog",  .has_arg = true, .val = RATEEST_OPT_EWMALOG},
+       XT_GETOPT_TABLEEND,
 };
 
 /* Copied from iproute */
index 2152b6fcd3aee3d5653cbc41bfff6238c1dcf251..9e231eee7594377892eb6098d8fedef26bc93642 100644 (file)
@@ -5,6 +5,7 @@
  *
  * Copyright (C) 2006 Red Hat, Inc., James Morris <jmorris@redhat.com>
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -22,8 +23,8 @@ static void SECMARK_help(void)
 }
 
 static const struct option SECMARK_opts[] = {
-       { "selctx", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "selctx", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static int SECMARK_parse(int c, char **argv, int invert, unsigned int *flags,
index f6386a9ef1949f3d78c5b4b190378755a022dbd4..c05811e6a28b48d6e74bcdec5a5f9f4183d52499 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 /* Shared library add-on to iptables to add IP set mangling target. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -32,9 +33,9 @@ set_target_help(void)
 }
 
 static const struct option set_target_opts[] = {
-       { .name = "add-set", .has_arg = true, .val = '1'},
-       { .name = "del-set", .has_arg = true, .val = '2'},
-       { .name = NULL }
+       {.name = "add-set", .has_arg = true, .val = '1'},
+       {.name = "del-set", .has_arg = true, .val = '2'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void
index ac9e2d0d054eced2169750cf5ff36e61d7c8a12d..b24789a2b673305540280cfcb5335c8c15b1654e 100644 (file)
@@ -2,6 +2,7 @@
  *
  * Copyright (c) 2000 Marc Boucher
 */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -36,9 +37,9 @@ static void TCPMSS_help6(void)
 }
 
 static const struct option TCPMSS_opts[] = {
-       { "set-mss", 1, NULL, '1' },
-       { "clamp-mss-to-pmtu", 0, NULL, '2' },
-       { .name = NULL }
+       {.name = "set-mss",           .has_arg = true,  .val = '1'},
+       {.name = "clamp-mss-to-pmtu", .has_arg = false, .val = '2'},
+       XT_GETOPT_TABLEEND,
 };
 
 static int __TCPMSS_parse(int c, char **argv, int invert, unsigned int *flags,
index a063d0d93193d4546e0ed937d8450de4e652611a..66ab46d26e8548ebe4731299f3c2e276e4d8718d 100644 (file)
@@ -28,7 +28,7 @@ struct tcp_optionmap {
 
 static const struct option tcpoptstrip_tg_opts[] = {
        {.name = "strip-options", .has_arg = true, .val = 's'},
-       { .name = NULL }
+       XT_GETOPT_TABLEEND,
 };
 
 static const struct tcp_optionmap tcp_optionmap[] = {
@@ -38,7 +38,7 @@ static const struct tcp_optionmap tcp_optionmap[] = {
        {"sack",           "Selective ACK",        TCPOPT_SACK},
        {"timestamp",      "Timestamp",            TCPOPT_TIMESTAMP},
        {"md5",            "MD5 signature",        TCPOPT_MD5SIG},
-       { .name = NULL }
+       XT_GETOPT_TABLEEND,
 };
 
 static void tcpoptstrip_tg_help(void)
index dc60cc081cb2e8dc574762a2b9630e3120f3eafe..9575c05054e64e83b00f2ca37396cd854d988aa0 100644 (file)
@@ -5,6 +5,7 @@
  * Contact: Jan Engelhardt <jengelh@computergmbh.de>
  */
 #include <getopt.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -24,7 +25,7 @@ enum {
 
 static const struct option tos_tg_opts_v0[] = {
        {.name = "set-tos", .has_arg = true, .val = '='},
-       { .name = NULL }
+       XT_GETOPT_TABLEEND,
 };
 
 static const struct option tos_tg_opts[] = {
@@ -32,7 +33,7 @@ static const struct option tos_tg_opts[] = {
        {.name = "and-tos", .has_arg = true, .val = '&'},
        {.name = "or-tos",  .has_arg = true, .val = '|'},
        {.name = "xor-tos", .has_arg = true, .val = '^'},
-       { .name = NULL }
+       XT_GETOPT_TABLEEND,
 };
 
 static void tos_tg_help_v0(void)
index d410c52b643ca344692ae0a8cab9404d83fbc71c..cd0b50a65d6e0d21541c8523153698481a9a0d2a 100644 (file)
 #include <linux/netfilter/xt_TPROXY.h>
 
 static const struct option tproxy_tg_opts[] = {
-       { .name = "on-port", .has_arg = 1, .val = '1'},
-       { .name = "on-ip", .has_arg = 1, .val = '2'},
-       { .name = "tproxy-mark", .has_arg = 1, .val = '3'},
-       {NULL},
+       {.name = "on-port",     .has_arg = true, .val = '1'},
+       {.name = "on-ip",       .has_arg = true, .val = '2'},
+       {.name = "tproxy-mark", .has_arg = true, .val = '3'},
+       XT_GETOPT_TABLEEND,
 };
 
 enum {
index ea5d9fb40dc5a389973985253be0e5a22254b578..15910455c71427cd873e972c905c989d62cc5d2f 100644 (file)
@@ -5,6 +5,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -38,11 +39,11 @@ enum {
 };
 
 static const struct option cluster_opts[] = {
-       { "cluster-total-nodes",        1, NULL, CLUSTER_OPT_TOTAL_NODES },
-       { "cluster-local-node",         1, NULL, CLUSTER_OPT_LOCAL_NODE },
-       { "cluster-local-nodemask",     1, NULL, CLUSTER_OPT_NODE_MASK },
-       { "cluster-hash-seed",          1, NULL, CLUSTER_OPT_HASH_SEED },
-       { .name = NULL }
+       {.name = "cluster-total-nodes",    .has_arg = true, .val = CLUSTER_OPT_TOTAL_NODES},
+       {.name = "cluster-local-node",     .has_arg = true, .val = CLUSTER_OPT_LOCAL_NODE},
+       {.name = "cluster-local-nodemask", .has_arg = true, .val = CLUSTER_OPT_NODE_MASK},
+       {.name = "cluster-hash-seed",      .has_arg = true, .val = CLUSTER_OPT_HASH_SEED},
+       XT_GETOPT_TABLEEND,
 };
 
 static int 
index 0068a6e4f0cb18cf9d23fcf0f25e365f27c3e5f8..a9325a5d3583003993cabd6ebcad098a32b6ae5a 100644 (file)
@@ -6,6 +6,7 @@
  *     2004-05-12: Brad Fisher <brad@info-link.net>
  *         Port to patch-o-matic-ng
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -22,8 +23,8 @@ static void comment_help(void)
 }
 
 static const struct option comment_opts[] = {
-       { "comment", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "comment", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void
index 5ebdd340fbe60b202c9510b694928be6c2da07ea..2e20862d9278de9c9a13ca82e0dbc4552790f205 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add byte tracking support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -18,10 +19,10 @@ static void connbytes_help(void)
 }
 
 static const struct option connbytes_opts[] = {
-       { "connbytes", 1, NULL, '1' },
-       { "connbytes-dir", 1, NULL, '2' },
-       { "connbytes-mode", 1, NULL, '3' },
-       { .name = NULL }
+       {.name = "connbytes",      .has_arg = true, .val = '1'},
+       {.name = "connbytes-dir",  .has_arg = true, .val = '2'},
+       {.name = "connbytes-mode", .has_arg = true, .val = '3'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void
index a2159158ab68b7dcfac0e7e3b5ad154877dd0884..b01d3012c4467f0d4b703df02725cfc995aecbe3 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add connection limit support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -18,9 +19,9 @@ static void connlimit_help(void)
 }
 
 static const struct option connlimit_opts[] = {
-       {"connlimit-above", 1, NULL, 'A'},
-       {"connlimit-mask",  1, NULL, 'M'},
-       { .name = NULL }
+       {.name = "connlimit-above", .has_arg = true, .val = 'A'},
+       {.name = "connlimit-mask",  .has_arg = true, .val = 'M'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void connlimit_init(struct xt_entry_match *match)
index 38aa5630d37a8f7fe3d99adced84d1a7dbe31260..6bb26894d40c13070e29cdcf3e8a204e0401d199 100644 (file)
@@ -19,6 +19,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -46,7 +47,7 @@ static void connmark_mt_help(void)
 
 static const struct option connmark_mt_opts[] = {
        {.name = "mark", .has_arg = true, .val = '1'},
-       { .name = NULL }
+       XT_GETOPT_TABLEEND,
 };
 
 static int
index 5557d3ea822364728be8af6de9004ea8d6b27f5c..6c4a9cd15e211a02468331972e807253c66eee80 100644 (file)
@@ -88,7 +88,7 @@ static const struct option conntrack_mt_opts_v0[] = {
        {.name = "ctrepldst", .has_arg = true, .val = '6'},
        {.name = "ctstatus",  .has_arg = true, .val = '7'},
        {.name = "ctexpire",  .has_arg = true, .val = '8'},
-       { .name = NULL }
+       XT_GETOPT_TABLEEND,
 };
 
 static const struct option conntrack_mt_opts[] = {
index 66b9d831120eb03fdaebea8230a4d642a299acd4..ee0299605f1705e292d912d6f2200a6d5c167f78 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add CPU match support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -15,8 +16,8 @@ static void cpu_help(void)
 }
 
 static const struct option cpu_opts[] = {
-       { "cpu", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "cpu", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void
index 8d0b13a268f3a67ba7a114f4dc488d4b938accd5..104f46faa9bccbc5535812e5019aa122fbd8b6fb 100644 (file)
@@ -5,6 +5,7 @@
  * This program is distributed under the terms of GNU GPL v2, 1991
  *
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -43,13 +44,13 @@ static void dccp_help(void)
 }
 
 static const struct option dccp_opts[] = {
-       { .name = "source-port", .has_arg = 1, .val = '1' },
-       { .name = "sport", .has_arg = 1, .val = '1' },
-       { .name = "destination-port", .has_arg = 1, .val = '2' },
-       { .name = "dport", .has_arg = 1, .val = '2' },
-       { .name = "dccp-types", .has_arg = 1, .val = '3' },
-       { .name = "dccp-option", .has_arg = 1, .val = '4' },
-       { .name = NULL }
+       {.name = "source-port",      .has_arg = true, .val = '1'},
+       {.name = "sport",            .has_arg = true, .val = '1'},
+       {.name = "destination-port", .has_arg = true, .val = '2'},
+       {.name = "dport",            .has_arg = true, .val = '2'},
+       {.name = "dccp-types",       .has_arg = true, .val = '3'},
+       {.name = "dccp-option",      .has_arg = true, .val = '4'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void
index 1569f7d41ecb637afbbc0973dd39733ca7ee8c92..4f81f2f12aaf19eefa4904e7d56a0543bd5139c3 100644 (file)
@@ -12,6 +12,7 @@
  * http://www.iana.org/assignments/dscp-registry
  *
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -38,9 +39,9 @@ static void dscp_help(void)
 }
 
 static const struct option dscp_opts[] = {
-       { "dscp", 1, NULL, 'F' },
-       { "dscp-class", 1, NULL, 'G' },
-       { .name = NULL }
+       {.name = "dscp",       .has_arg = true, .val = 'F'},
+       {.name = "dscp-class", .has_arg = true, .val = 'G'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void
index 18218f476e423a723a0fce1c09948125832fbf42..070a6a45a97a0fb3e2a25dfaf70d02eb8659af0f 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add ESP support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -19,8 +20,8 @@ static void esp_help(void)
 }
 
 static const struct option esp_opts[] = {
-       { "espspi", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "espspi", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static u_int32_t
index 7442dfcf77e8b85adac1e087b341a761b1a9c5c4..fbf19d2b262ab093098cf1d28fab5d12fe806bca 100644 (file)
@@ -67,15 +67,15 @@ static void hashlimit_mt_help(void)
 }
 
 static const struct option hashlimit_opts[] = {
-       { "hashlimit", 1, NULL, '%' },
-       { "hashlimit-burst", 1, NULL, '$' },
-       { "hashlimit-htable-size", 1, NULL, '&' },
-       { "hashlimit-htable-max", 1, NULL, '*' },
-       { "hashlimit-htable-gcinterval", 1, NULL, '(' },
-       { "hashlimit-htable-expire", 1, NULL, ')' },
-       { "hashlimit-mode", 1, NULL, '_' },
-       { "hashlimit-name", 1, NULL, '"' },
-       { .name = NULL }
+       {.name = "hashlimit",                   .has_arg = true, .val = '%'},
+       {.name = "hashlimit-burst",             .has_arg = true, .val = '$'},
+       {.name = "hashlimit-htable-size",       .has_arg = true, .val = '&'},
+       {.name = "hashlimit-htable-max",        .has_arg = true, .val = '*'},
+       {.name = "hashlimit-htable-gcinterval", .has_arg = true, .val = '('},
+       {.name = "hashlimit-htable-expire",     .has_arg = true, .val = ')'},
+       {.name = "hashlimit-mode",              .has_arg = true, .val = '_'},
+       {.name = "hashlimit-name",              .has_arg = true, .val = '"'},
+       XT_GETOPT_TABLEEND,
 };
 
 static const struct option hashlimit_mt_opts[] = {
@@ -91,7 +91,7 @@ static const struct option hashlimit_mt_opts[] = {
        {.name = "hashlimit-htable-expire",     .has_arg = true, .val = ')'},
        {.name = "hashlimit-mode",              .has_arg = true, .val = '_'},
        {.name = "hashlimit-name",              .has_arg = true, .val = '"'},
-       {},
+       XT_GETOPT_TABLEEND,
 };
 
 static
index 35b5f152b857038a617ff628e571e063c8af1a50..e9551bc7a4022142cf8b7410c349dd5025a50c04 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add related packet matching support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -16,8 +17,8 @@ static void helper_help(void)
 }
 
 static const struct option helper_opts[] = {
-       { "helper", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "helper", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static int
index 55a2f84b0a8ca45e1d306a3e98c9e2023a09879d..6b511b564925662802636c10bfc3f652bded03bc 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add IP range matching support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -39,7 +40,7 @@ static void iprange_mt_help(void)
 static const struct option iprange_mt_opts[] = {
        {.name = "src-range", .has_arg = true, .val = '1'},
        {.name = "dst-range", .has_arg = true, .val = '2'},
-       { .name = NULL }
+       XT_GETOPT_TABLEEND,
 };
 
 static void
index 6843551c792ee9b24a441fdd7ea0de1cb43cf3f4..493d975a209cb6d637700812b8949e10eaefb762 100644 (file)
@@ -11,6 +11,7 @@
 #include <errno.h>
 #include <getopt.h>
 #include <netdb.h>
+#include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -26,7 +27,7 @@ static const struct option ipvs_mt_opts[] = {
        { .name = "vdir",     .has_arg = true,  .val = '4' },
        { .name = "vmethod",  .has_arg = true,  .val = '5' },
        { .name = "vportctl", .has_arg = true,  .val = '6' },
-       { .name = NULL }
+       XT_GETOPT_TABLEEND,
 };
 
 static void ipvs_mt_help(void)
index 96e8b6cd8e7daf90e8dc8c30a03bf525ca3c8cfd..aeba52f9cae253c3101e08e62757050d7a211906 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add packet length matching support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -17,8 +18,8 @@ static void length_help(void)
 }
   
 static const struct option length_opts[] = {
-       { "length", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "length", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static u_int16_t
index c836303c6d65cda88e7dd12c9051a52fac94d2f7..3f94e2165e48859628eda2d7bc2ced0e5b472e04 100644 (file)
@@ -3,7 +3,7 @@
  * Jérôme de Vivie   <devivie@info.enserb.u-bordeaux.fr>
  * Hervé Eychenne    <rv@wallfire.org>
  */
-
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -29,9 +29,9 @@ XT_LIMIT_BURST);
 }
 
 static const struct option limit_opts[] = {
-       { "limit", 1, NULL, '%' },
-       { "limit-burst", 1, NULL, '$' },
-       { .name = NULL }
+       {.name = "limit",       .has_arg = true, .val = '%'},
+       {.name = "limit-burst", .has_arg = true, .val = '$'},
+       XT_GETOPT_TABLEEND,
 };
 
 static
index 00996a0c5ce93ca1349ac6121e98be6cf810690a..eb074676bcf0976b47a6a89eada61bc396f08cac 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add MAC address support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -21,8 +22,8 @@ static void mac_help(void)
 }
 
 static const struct option mac_opts[] = {
-       { "mac-source", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "mac-source", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void
index 8013c9a14579959f815a0b66e96b1dfa6d0fc151..a2bc4f893ab1d5f47307429d6c90be0f5c84fc45 100644 (file)
@@ -27,7 +27,7 @@ static void mark_mt_help(void)
 
 static const struct option mark_mt_opts[] = {
        {.name = "mark", .has_arg = true, .val = '1'},
-       { .name = NULL }
+       XT_GETOPT_TABLEEND,
 };
 
 static int mark_mt_parse(int c, char **argv, int invert, unsigned int *flags,
index e8a0dab593e3c6dacfc19d20b6ec3fae21a6ca1f..5b823b62ee297bd429eaf7f43716423700e8687b 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add multiple TCP port support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -44,12 +45,12 @@ static void multiport_help_v1(void)
 }
 
 static const struct option multiport_opts[] = {
-       { "source-ports", 1, NULL, '1' },
-       { "sports", 1, NULL, '1' }, /* synonym */
-       { "destination-ports", 1, NULL, '2' },
-       { "dports", 1, NULL, '2' }, /* synonym */
-       { "ports", 1, NULL, '3' },
-       { .name = NULL }
+       {.name = "source-ports",      .has_arg = true, .val = '1'},
+       {.name = "sports",            .has_arg = true, .val = '1'}, /* synonym */
+       {.name = "destination-ports", .has_arg = true, .val = '2'},
+       {.name = "dports",            .has_arg = true, .val = '2'}, /* synonym */
+       {.name = "ports",             .has_arg = true, .val = '3'},
+       XT_GETOPT_TABLEEND,
 };
 
 static char *
index 07b86e40433956cf67c16ae680792b4f721e72e9..66c23b4db5b31d9f15d61ea5642800a7fc4b84ad 100644 (file)
@@ -20,7 +20,7 @@
 /*
  * xtables interface for OS fingerprint matching module.
  */
-
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -54,10 +54,10 @@ static void osf_help(void)
 
 
 static const struct option osf_opts[] = {
-       { .name = "genre",      .has_arg = true, .val = '1' },
-       { .name = "ttl",        .has_arg = true, .val = '2' },
-       { .name = "log",        .has_arg = true, .val = '3' },
-       { .name = NULL }
+       {.name = "genre", .has_arg = true, .val = '1'},
+       {.name = "ttl",   .has_arg = true, .val = '2'},
+       {.name = "log",   .has_arg = true, .val = '3'},
+       XT_GETOPT_TABLEEND,
 };
 
 
index b595d972a5abdaf2868cecb3b1394e333c18af02..4015f13721c23da507c5bdc26d542b88b82fc7eb 100644 (file)
@@ -113,7 +113,7 @@ static const struct option owner_mt_opts_v0[] = {
 #ifdef IPT_OWNER_COMM
        {.name = "cmd-owner", .has_arg = true, .val = 'c'},
 #endif
-       { .name = NULL }
+       XT_GETOPT_TABLEEND,
 };
 
 static const struct option owner_mt6_opts_v0[] = {
@@ -121,14 +121,14 @@ static const struct option owner_mt6_opts_v0[] = {
        {.name = "gid-owner", .has_arg = true, .val = 'g'},
        {.name = "pid-owner", .has_arg = true, .val = 'p'},
        {.name = "sid-owner", .has_arg = true, .val = 's'},
-       { .name = NULL }
+       XT_GETOPT_TABLEEND,
 };
 
 static const struct option owner_mt_opts[] = {
        {.name = "uid-owner",     .has_arg = true,  .val = 'u'},
        {.name = "gid-owner",     .has_arg = true,  .val = 'g'},
        {.name = "socket-exists", .has_arg = false, .val = 'k'},
-       { .name = NULL }
+       XT_GETOPT_TABLEEND,
 };
 
 static int
index 5382ab60d26246496a9243e767c793f0faaa325b..d92df9e0d4916f239789868ad9c7b719d390d18a 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add bridge port matching support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -24,12 +25,12 @@ static void physdev_help(void)
 }
 
 static const struct option physdev_opts[] = {
-       { "physdev-in", 1, NULL, '1' },
-       { "physdev-out", 1, NULL, '2' },
-       { "physdev-is-in", 0, NULL, '3' },
-       { "physdev-is-out", 0, NULL, '4' },
-       { "physdev-is-bridged", 0, NULL, '5' },
-       { .name = NULL }
+       {.name = "physdev-in",         .has_arg = true,  .val = '1'},
+       {.name = "physdev-out",        .has_arg = true,  .val = '2'},
+       {.name = "physdev-is-in",      .has_arg = false, .val = '3'},
+       {.name = "physdev-is-out",     .has_arg = false, .val = '4'},
+       {.name = "physdev-is-bridged", .has_arg = false, .val = '5'},
+       XT_GETOPT_TABLEEND,
 };
 
 static int
index cd83e730a6e619fef0dd752542d1f12b82e2388c..d4025913802bdd88920636a6733ccd36b6f19b16 100644 (file)
@@ -4,6 +4,7 @@
  *
  * Michal Ludvig <michal@logix.cz>
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -61,8 +62,8 @@ static void pkttype_help(void)
 }
 
 static const struct option pkttype_opts[] = {
-       {"pkt-type", 1, NULL, '1'},
-       { .name = NULL }
+       {.name = "pkt-type", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void parse_pkttype(const char *pkttype, struct xt_pkttype_info *info)
index a87ddd896572f5fa3aa517712791e0199f23e2e0..3ddb3ec74bd3e8ac46897b94090dcff21891804d 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add policy support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -42,53 +43,55 @@ static const struct option policy_opts[] =
 {
        {
                .name           = "dir",
-               .has_arg        = 1,
+               .has_arg        = true,
                .val            = '1',
        },
        {
                .name           = "pol",
-               .has_arg        = 1,
+               .has_arg        = true,
                .val            = '2',
        },
        {
                .name           = "strict",
+               .has_arg        = false,
                .val            = '3'
        },
        {
                .name           = "reqid",
-               .has_arg        = 1,
+               .has_arg        = true,
                .val            = '4',
        },
        {
                .name           = "spi",
-               .has_arg        = 1,
+               .has_arg        = true,
                .val            = '5'
        },
        {
                .name           = "tunnel-src",
-               .has_arg        = 1,
+               .has_arg        = true,
                .val            = '6'
        },
        {
                .name           = "tunnel-dst",
-               .has_arg        = 1,
+               .has_arg        = true,
                .val            = '7'
        },
        {
                .name           = "proto",
-               .has_arg        = 1,
+               .has_arg        = true,
                .val            = '8'
        },
        {
                .name           = "mode",
-               .has_arg        = 1,
+               .has_arg        = true,
                .val            = '9'
        },
        {
                .name           = "next",
+               .has_arg        = false,
                .val            = 'a'
        },
-       { .name = NULL }
+       XT_GETOPT_TABLEEND,
 };
 
 static int parse_direction(char *s)
index ac7c686e284e3abfeb88683abebb5cb59c5f8f35..b6bab93a9e7c897678d70f1da3bf0f6b6c61d6da 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Sam Johnston <samj@samj.net>
  */
+#include <stdbool.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -12,8 +13,8 @@
 #include <linux/netfilter/xt_quota.h>
 
 static const struct option quota_opts[] = {
-       {"quota", 1, NULL, '1'},
-       { .name = NULL }
+       {.name = "quota", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void quota_help(void)
index ad0884e788aee683cbb071f0879cf17e85ffe2e4..6aefb5c3f76d247d1f12e1b8224a806ed0ed325c 100644 (file)
@@ -1,3 +1,4 @@
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -40,20 +41,20 @@ enum rateest_options {
 };
 
 static const struct option rateest_opts[] = {
-       { "rateest1",           1, NULL, OPT_RATEEST1 },
-       { "rateest",            1, NULL, OPT_RATEEST1 }, /* alias for absolute mode */
-       { "rateest2",           1, NULL, OPT_RATEEST2 },
-       { "rateest-bps1",       0, NULL, OPT_RATEEST_BPS1 },
-       { "rateest-pps1",       0, NULL, OPT_RATEEST_PPS1 },
-       { "rateest-bps2",       0, NULL, OPT_RATEEST_BPS2 },
-       { "rateest-pps2",       0, NULL, OPT_RATEEST_PPS2 },
-       { "rateest-bps",        0, NULL, OPT_RATEEST_BPS2 }, /* alias for absolute mode */
-       { "rateest-pps",        0, NULL, OPT_RATEEST_PPS2 }, /* alias for absolute mode */
-       { "rateest-delta",      0, NULL, OPT_RATEEST_DELTA },
-       { "rateest-lt",         0, NULL, OPT_RATEEST_LT },
-       { "rateest-gt",         0, NULL, OPT_RATEEST_GT },
-       { "rateest-eq",         0, NULL, OPT_RATEEST_EQ },
-       { .name = NULL }
+       {.name = "rateest1",      .has_arg = true,  .val = OPT_RATEEST1},
+       {.name = "rateest",       .has_arg = true,  .val = OPT_RATEEST1}, /* alias for absolute mode */
+       {.name = "rateest2",      .has_arg = true,  .val = OPT_RATEEST2},
+       {.name = "rateest-bps1",  .has_arg = false, .val = OPT_RATEEST_BPS1},
+       {.name = "rateest-pps1",  .has_arg = false, .val = OPT_RATEEST_PPS1},
+       {.name = "rateest-bps2",  .has_arg = false, .val = OPT_RATEEST_BPS2},
+       {.name = "rateest-pps2",  .has_arg = false, .val = OPT_RATEEST_PPS2},
+       {.name = "rateest-bps",   .has_arg = false, .val = OPT_RATEEST_BPS2}, /* alias for absolute mode */
+       {.name = "rateest-pps",   .has_arg = false, .val = OPT_RATEEST_PPS2}, /* alias for absolute mode */
+       {.name = "rateest-delta", .has_arg = false, .val = OPT_RATEEST_DELTA},
+       {.name = "rateest-lt",    .has_arg = false, .val = OPT_RATEEST_LT},
+       {.name = "rateest-gt",    .has_arg = false, .val = OPT_RATEEST_GT},
+       {.name = "rateest-eq",    .has_arg = false, .val = OPT_RATEEST_EQ},
+       XT_GETOPT_TABLEEND,
 };
 
 /* Copied from iproute. See http://physics.nist.gov/cuu/Units/binary.html */
@@ -79,7 +80,7 @@ static const struct rate_suffix {
        { "GBps",       8000000000. },
        { "TiBps",      8.*1024.*1024.*1024.*1024. },
        { "TBps",       8000000000000. },
-       { .name = NULL }
+       XT_GETOPT_TABLEEND,
 };
 
 static int
index ecc17ad4a40b45159157d4be1a75e6148038fd66..41faeb6128a6aaa23ef09232c3984a2d3134903f 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add recent matching support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
 #include <linux/netfilter/xt_recent.h>
 
 static const struct option recent_opts[] = {
-       { .name = "set",      .has_arg = 0, .val = 201 },
-       { .name = "rcheck",   .has_arg = 0, .val = 202 },
-       { .name = "update",   .has_arg = 0, .val = 203 },
-       { .name = "seconds",  .has_arg = 1, .val = 204 },
-       { .name = "hitcount", .has_arg = 1, .val = 205 },
-       { .name = "remove",   .has_arg = 0, .val = 206 },
-       { .name = "rttl",     .has_arg = 0, .val = 207 },
-       { .name = "name",     .has_arg = 1, .val = 208 },
-       { .name = "rsource",  .has_arg = 0, .val = 209 },
-       { .name = "rdest",    .has_arg = 0, .val = 210 },
-       { .name = NULL }
+       {.name = "set",      .has_arg = false, .val = 201},
+       {.name = "rcheck",   .has_arg = false, .val = 202},
+       {.name = "update",   .has_arg = false, .val = 203},
+       {.name = "seconds",  .has_arg = true,  .val = 204},
+       {.name = "hitcount", .has_arg = true,  .val = 205},
+       {.name = "remove",   .has_arg = false, .val = 206},
+       {.name = "rttl",     .has_arg = false, .val = 207},
+       {.name = "name",     .has_arg = true,  .val = 208},
+       {.name = "rsource",  .has_arg = false, .val = 209},
+       {.name = "rdest",    .has_arg = false, .val = 210},
+       XT_GETOPT_TABLEEND,
 };
 
 static void recent_help(void)
index d321fb8ade9d23bc4ed323090c2279d2bf953005..80406f76d29d3512e44c3ab29f8fa0386855772d 100644 (file)
@@ -7,6 +7,7 @@
  * libipt_ecn.c borrowed heavily from libipt_dscp.c
  *
  */
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -55,12 +56,12 @@ static void sctp_help(void)
 }
 
 static const struct option sctp_opts[] = {
-       { .name = "source-port", .has_arg = 1, .val = '1' },
-       { .name = "sport", .has_arg = 1, .val = '1' },
-       { .name = "destination-port", .has_arg = 1, .val = '2' },
-       { .name = "dport", .has_arg = 1, .val = '2' },
-       { .name = "chunk-types", .has_arg = 1, .val = '3' },
-       { .name = NULL }
+       {.name = "source-port",      .has_arg = true, .val = '1'},
+       {.name = "sport",            .has_arg = true, .val = '1'},
+       {.name = "destination-port", .has_arg = true, .val = '2'},
+       {.name = "dport",            .has_arg = true, .val = '2'},
+       {.name = "chunk-types",      .has_arg = true, .val = '3'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void
index 75fa3c278a47226a2c12a75972b37dac70ab30a4..594e2d4f0c242f62dcd657247523a2623fb90de9 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 /* Shared library add-on to iptables to add IP set matching. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -32,9 +33,9 @@ set_help(void)
 }
 
 static const struct option set_opts[] = {
-       { .name = "match-set", .has_arg = true, .val = '1'},
-       { .name = "set",       .has_arg = true, .val = '2'},
-       { .name = NULL }
+       {.name = "match-set", .has_arg = true, .val = '1'},
+       {.name = "set",       .has_arg = true, .val = '2'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void
index d8159e57e1db755fd6242c879ba25fc5f5c5a17e..40643335c0e63223badb2f24c6a0da06cc7b86ed 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add state tracking support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -22,8 +23,8 @@ state_help(void)
 }
 
 static const struct option state_opts[] = {
-       { "state", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "state", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static int
index 913aa2c783f75f384fbdafd3d628ba4be576b877..94f291344bee3d0237f76c337e72a1f4c40c2950 100644 (file)
@@ -1,3 +1,4 @@
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -21,11 +22,11 @@ static void statistic_help(void)
 }
 
 static const struct option statistic_opts[] = {
-       { "mode", 1, NULL, '1' },
-       { "probability", 1, NULL, '2' },
-       { "every", 1, NULL, '3' },
-       { "packet", 1, NULL, '4' },
-       { .name = NULL }
+       {.name = "mode",        .has_arg = true, .val = '1'},
+       {.name = "probability", .has_arg = true, .val = '2'},
+       {.name = "every",       .has_arg = true, .val = '3'},
+       {.name = "packet",      .has_arg = true, .val = '4'},
+       XT_GETOPT_TABLEEND,
 };
 
 static struct xt_statistic_info *global_info;
index df6302e811e980b7fc0c85a6c1d12a82286ec54b..a6c58813b9de71353b9abdff72a8c2f0671fd75e 100644 (file)
@@ -21,6 +21,7 @@
  *             ipt_string_info.
  */
 #define _GNU_SOURCE 1
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -44,13 +45,13 @@ static void string_help(void)
 }
 
 static const struct option string_opts[] = {
-       { "from", 1, NULL, '1' },
-       { "to", 1, NULL, '2' },
-       { "algo", 1, NULL, '3' },
-       { "string", 1, NULL, '4' },
-       { "hex-string", 1, NULL, '5' },
-       { "icase", 0, NULL, '6' },
-       { .name = NULL }
+       {.name = "from",       .has_arg = true,  .val = '1'},
+       {.name = "to",         .has_arg = true,  .val = '2'},
+       {.name = "algo",       .has_arg = true,  .val = '3'},
+       {.name = "string",     .has_arg = true,  .val = '4'},
+       {.name = "hex-string", .has_arg = true,  .val = '5'},
+       {.name = "icase",      .has_arg = false, .val = '6'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void string_init(struct xt_entry_match *m)
index 75551d79bcb6f29ccbc63dd0e7a10c2725a6aa28..26e533c0b453ce531fa96c9b3d04df34f1487666 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add TCP support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -26,14 +27,14 @@ static void tcp_help(void)
 }
 
 static const struct option tcp_opts[] = {
-       { "source-port", 1, NULL, '1' },
-       { "sport", 1, NULL, '1' }, /* synonym */
-       { "destination-port", 1, NULL, '2' },
-       { "dport", 1, NULL, '2' }, /* synonym */
-       { "syn", 0, NULL, '3' },
-       { "tcp-flags", 1, NULL, '4' },
-       { "tcp-option", 1, NULL, '5' },
-       { .name = NULL }
+       {.name = "source-port",      .has_arg = true,  .val = '1'},
+       {.name = "sport",            .has_arg = true,  .val = '1'}, /* synonym */
+       {.name = "destination-port", .has_arg = true,  .val = '2'},
+       {.name = "dport",            .has_arg = true,  .val = '2'}, /* synonym */
+       {.name = "syn",              .has_arg = false, .val = '3'},
+       {.name = "tcp-flags",        .has_arg = true,  .val = '4'},
+       {.name = "tcp-option",       .has_arg = true,  .val = '5'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void
index b54a890e7b4343f8a0a75d18ba826b60aefb6ab0..110c60dabbcd86416cba39ad7281e29326d5635a 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add tcp MSS matching support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -17,8 +18,8 @@ static void tcpmss_help(void)
 }
 
 static const struct option tcpmss_opts[] = {
-       { "mss", 1, NULL, '1' },
-       { .name = NULL }
+       {.name = "mss", .has_arg = true, .val = '1'},
+       XT_GETOPT_TABLEEND,
 };
 
 static u_int16_t
index 098fc9c9d4d5fe764b4862edfb7c382deb2124ee..9f12266b4538eff5f4880ba8d466ed996eced89d 100644 (file)
@@ -38,15 +38,15 @@ static const char *const week_days[] = {
 };
 
 static const struct option time_opts[] = {
-       {"datestart", true,  NULL, 'D'},
-       {"datestop",  true,  NULL, 'E'},
-       {"timestart", true,  NULL, 'X'},
-       {"timestop",  true,  NULL, 'Y'},
-       {"weekdays",  true,  NULL, 'w'},
-       {"monthdays", true,  NULL, 'm'},
-       {"localtz",   false, NULL, 'l'},
-       {"utc",       false, NULL, 'u'},
-       { .name = NULL }
+       {.name = "datestart", .has_arg = true,  .val = 'D'},
+       {.name = "datestop",  .has_arg = true,  .val = 'E'},
+       {.name = "timestart", .has_arg = true,  .val = 'X'},
+       {.name = "timestop",  .has_arg = true,  .val = 'Y'},
+       {.name = "weekdays",  .has_arg = true,  .val = 'w'},
+       {.name = "monthdays", .has_arg = true,  .val = 'm'},
+       {.name = "localtz",   .has_arg = false, .val = 'l'},
+       {.name = "utc",       .has_arg = false, .val = 'u'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void time_help(void)
index 6b8cd89f26a38ba3cfacb9d7a9ea57a802c05efd..f78594ac382ffc3b32df17ad197f0fd49bdb7436 100644 (file)
@@ -26,7 +26,7 @@ enum {
 
 static const struct option tos_mt_opts[] = {
        {.name = "tos", .has_arg = true, .val = 't'},
-       { .name = NULL }
+       XT_GETOPT_TABLEEND,
 };
 
 static void tos_mt_help(void)
index 9a61c8a5101a34b92fc6dbf8c5585415a46c1e46..67e606834d6e4122894922bfede57d622f6d8af9 100644 (file)
@@ -15,6 +15,7 @@
 #include <errno.h>
 #include <getopt.h>
 #include <netdb.h>
+#include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -23,8 +24,8 @@
 #include <linux/netfilter/xt_u32.h>
 
 static const struct option u32_opts[] = {
-       {"u32", 1, NULL, 'u'},
-       { .name = NULL }
+       {.name = "u32", .has_arg = true, .val = 'u'},
+       XT_GETOPT_TABLEEND,
 };
 
 static void u32_help(void)
index 135e7af7b0fe4c76a569d8670cc92bf1a04613e7..3006c04ef0f47ae39fa6d3c1fec44e1cfaa75320 100644 (file)
@@ -1,4 +1,5 @@
 /* Shared library add-on to iptables to add UDP support. */
+#include <stdbool.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -21,11 +22,11 @@ static void udp_help(void)
 }
 
 static const struct option udp_opts[] = {
-       { "source-port", 1, NULL, '1' },
-       { "sport", 1, NULL, '1' }, /* synonym */
-       { "destination-port", 1, NULL, '2' },
-       { "dport", 1, NULL, '2' }, /* synonym */
-       { .name = NULL }
+       {.name = "source-port",      .has_arg = true, .val = '1'},
+       {.name = "sport",            .has_arg = true, .val = '1'}, /* synonym */
+       {.name = "destination-port", .has_arg = true, .val = '2'},
+       {.name = "dport",            .has_arg = true, .val = '2'}, /* synonym */
+       XT_GETOPT_TABLEEND,
 };
 
 static void
index e8f1563cd9575b358dc7f758623fb0dc928d95e3..10add198a7467461b483c594e6ceaf85ac3e5f55 100644 (file)
@@ -20,7 +20,7 @@ static const struct tos_symbol_info {
        {IPTOS_RELIABILITY, "Maximize-Reliability"},
        {IPTOS_MINCOST,     "Minimize-Cost"},
        {IPTOS_NORMALSVC,   "Normal-Service"},
-       { .name = NULL }
+       {},
 };
 
 /*
index 2d7df322b365ce8b04da72c971fcf0fb328362e1..9e47c2d2f4dbdee0d84b458391268ffdb5696875 100644 (file)
@@ -199,6 +199,8 @@ struct xtables_globals
        void (*exit_err)(enum xtables_exittype status, const char *msg, ...) __attribute__((noreturn, format(printf,2,3)));
 };
 
+#define XT_GETOPT_TABLEEND {NULL}
+
 #ifdef __cplusplus
 extern "C" {
 #endif