Try to inhibit copypasting old stuff.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
*/
#include <getopt.h>
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
}
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 = {
/* Shared library add-on to ip6tables to add LOG support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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)
* ported to IPv6 by Harald Welte <laforge@gnumonks.org>
*
*/
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
}
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)
/* Shared library add-on to ip6tables to add AH support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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
/* Shared library add-on to ip6tables to add Dst header support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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
/* Shared library add-on to ip6tables to add Fragmentation header support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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
}
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
* 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>
}
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 = {
/* Shared library add-on to ip6tables to add ICMP support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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
#include <getopt.h>
#include <xtables.h>
+#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
}
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)
*
* Based on libip6t_{icmpv6,udp}.c
*/
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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 = {
/* Shared library add-on to ip6tables to add Routing header support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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
*
* 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>
#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
/* Shared library add-on to iptables to add destination-NAT support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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 *
*
* $Id$
*/
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
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,
/* Shared library add-on to iptables to add LOG support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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)
/* Shared library add-on to iptables to add masquerade support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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)
/* 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>
#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)
/* Shared library add-on to iptables to add redirect support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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)
*
* (C) 2000 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
*/
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
}
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)
/* 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>
}
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)
/* Shared library add-on to iptables to add source-NAT support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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 *
*
* This program is distributed under the terms of GNU GPL
*/
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
}
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 = {
*
* 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>
}
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)
/* 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>
}
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[] = {
/* Shared library add-on to iptables to add AH support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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
* libipt_ecn.c borrowed heavily from libipt_dscp.c
*
*/
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
}
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,
/* Shared library add-on to iptables to add ICMP support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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
/* Shared library add-on to iptables to add realm matching support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
static const struct option realm_opts[] = {
- { "realm", 1, NULL, '1' },
- { .name = NULL }
+ {.name = "realm", .has_arg = true, .val = '1'},
+ XT_GETOPT_TABLEEND,
};
struct realmname {
* $Id$
*
* This program is released under the terms of GNU GPL */
-
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
}
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 = {
*
* libxt_CHECKSUM.c borrowed some bits from libipt_ECN.c
*/
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
}
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,
/* Shared library add-on to iptables to add CLASSIFY target support. */
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
}
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)
* 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>
}
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[] = {
{.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)
*
* Copyright (C) 2006 Red Hat, Inc., James Morris <jmorris@redhat.com>
*/
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
}
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
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
};
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 {
*
* --set-class added by Iain Barnes
*/
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
}
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
* 02110-1301 USA
*
*/
-
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
};
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)
* published by the Free Software Foundation.
*
*/
-
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
{.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)
}
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[] = {
{.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)
+#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
};
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)
* This program is distributed under the terms of GNU GPL v2, 1991
*
*/
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
}
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)
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
};
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 */
*
* Copyright (C) 2006 Red Hat, Inc., James Morris <jmorris@redhat.com>
*/
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
}
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,
*/
/* Shared library add-on to iptables to add IP set mangling target. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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
*
* Copyright (c) 2000 Marc Boucher
*/
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
}
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,
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[] = {
{"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)
* Contact: Jan Engelhardt <jengelh@computergmbh.de>
*/
#include <getopt.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
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[] = {
{.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)
#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 {
* 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>
};
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
* 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>
}
static const struct option comment_opts[] = {
- { "comment", 1, NULL, '1' },
- { .name = NULL }
+ {.name = "comment", .has_arg = true, .val = '1'},
+ XT_GETOPT_TABLEEND,
};
static void
/* Shared library add-on to iptables to add byte tracking support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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
/* Shared library add-on to iptables to add connection limit support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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)
* 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>
static const struct option connmark_mt_opts[] = {
{.name = "mark", .has_arg = true, .val = '1'},
- { .name = NULL }
+ XT_GETOPT_TABLEEND,
};
static int
{.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[] = {
/* Shared library add-on to iptables to add CPU match support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
static const struct option cpu_opts[] = {
- { "cpu", 1, NULL, '1' },
- { .name = NULL }
+ {.name = "cpu", .has_arg = true, .val = '1'},
+ XT_GETOPT_TABLEEND,
};
static void
* This program is distributed under the terms of GNU GPL v2, 1991
*
*/
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
}
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
* http://www.iana.org/assignments/dscp-registry
*
*/
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
}
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
/* Shared library add-on to iptables to add ESP support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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
}
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[] = {
{.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
/* Shared library add-on to iptables to add related packet matching support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
static const struct option helper_opts[] = {
- { "helper", 1, NULL, '1' },
- { .name = NULL }
+ {.name = "helper", .has_arg = true, .val = '1'},
+ XT_GETOPT_TABLEEND,
};
static int
/* Shared library add-on to iptables to add IP range matching support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
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
#include <errno.h>
#include <getopt.h>
#include <netdb.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
{ .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)
/* Shared library add-on to iptables to add packet length matching support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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
* 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>
}
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
/* Shared library add-on to iptables to add MAC address support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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
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,
/* Shared library add-on to iptables to add multiple TCP port support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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 *
/*
* xtables interface for OS fingerprint matching module.
*/
-
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
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,
};
#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[] = {
{.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
/* Shared library add-on to iptables to add bridge port matching support. */
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
}
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
*
* Michal Ludvig <michal@logix.cz>
*/
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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)
/* Shared library add-on to iptables to add policy support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
{
{
.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)
*
* Sam Johnston <samj@samj.net>
*/
+#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#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)
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
};
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 */
{ "GBps", 8000000000. },
{ "TiBps", 8.*1024.*1024.*1024.*1024. },
{ "TBps", 8000000000000. },
- { .name = NULL }
+ XT_GETOPT_TABLEEND,
};
static int
/* 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)
* libipt_ecn.c borrowed heavily from libipt_dscp.c
*
*/
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
}
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
*/
/* Shared library add-on to iptables to add IP set matching. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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
/* Shared library add-on to iptables to add state tracking support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
static const struct option state_opts[] = {
- { "state", 1, NULL, '1' },
- { .name = NULL }
+ {.name = "state", .has_arg = true, .val = '1'},
+ XT_GETOPT_TABLEEND,
};
static int
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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;
* ipt_string_info.
*/
#define _GNU_SOURCE 1
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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)
/* Shared library add-on to iptables to add TCP support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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
/* Shared library add-on to iptables to add tcp MSS matching support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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
};
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)
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)
#include <errno.h>
#include <getopt.h>
#include <netdb.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#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)
/* Shared library add-on to iptables to add UDP support. */
+#include <stdbool.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
}
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
{IPTOS_RELIABILITY, "Maximize-Reliability"},
{IPTOS_MINCOST, "Minimize-Cost"},
{IPTOS_NORMALSVC, "Normal-Service"},
- { .name = NULL }
+ {},
};
/*
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