{0}
};
-/* Initialize the match. */
-static void
-init(struct ipt_entry_match *m, unsigned int *nfcache)
-{
- *nfcache |= NFC_IP_TOS;
-}
-
static void
parse_tos(const unsigned char *s, struct ipt_tos_info *info)
{
switch (c) {
case '1':
+ /* Ensure that `--tos' haven't been used yet. */
+ if (*flags == 1)
+ exit_error(PARAMETER_PROBLEM,
+ "tos match: only use --tos once!");
+
check_inverse(optarg, &invert, &optind, 0);
parse_tos(argv[optind-1], tosinfo);
if (invert)
print_tos(info->tos, 0);
}
-static
-struct iptables_match tos
-= { NULL,
- "tos",
- IPTABLES_VERSION,
- IPT_ALIGN(sizeof(struct ipt_tos_info)),
- IPT_ALIGN(sizeof(struct ipt_tos_info)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+static struct iptables_match tos = {
+ .next = NULL,
+ .name = "tos",
+ .version = IPTABLES_VERSION,
+ .size = IPT_ALIGN(sizeof(struct ipt_tos_info)),
+ .userspacesize = IPT_ALIGN(sizeof(struct ipt_tos_info)),
+ .help = &help,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts
};
void _init(void)