]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
extensions: collapse data variables to use multi-reg calls
authorJan Engelhardt <jengelh@medozas.de>
Thu, 25 Jun 2009 18:12:12 +0000 (20:12 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Fri, 26 Jun 2009 19:13:10 +0000 (21:13 +0200)
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 files changed:
extensions/libipt_addrtype.c
extensions/libxt_CONNMARK.c
extensions/libxt_MARK.c
extensions/libxt_TOS.c
extensions/libxt_connlimit.c
extensions/libxt_connmark.c
extensions/libxt_conntrack.c
extensions/libxt_hashlimit.c
extensions/libxt_iprange.c
extensions/libxt_mark.c
extensions/libxt_multiport.c
extensions/libxt_owner.c
extensions/libxt_policy.c
extensions/libxt_string.c
extensions/libxt_tos.c

index ecd51b510c2e72b71f9a31a524fedd00e94669c4..cda7051893d452bfcfd7f541ceec8dafa3844939 100644 (file)
@@ -323,38 +323,38 @@ static const struct option addrtype_opts_v1[] = {
        { .name = NULL }
 };
 
-static struct xtables_match addrtype_mt_reg_v0 = {
-       .name           = "addrtype",
-       .version        = XTABLES_VERSION,
-       .family         = NFPROTO_IPV4,
-       .size           = XT_ALIGN(sizeof(struct ipt_addrtype_info)),
-       .userspacesize  = XT_ALIGN(sizeof(struct ipt_addrtype_info)),
-       .help           = addrtype_help_v0,
-       .parse          = addrtype_parse_v0,
-       .final_check    = addrtype_check_v0,
-       .print          = addrtype_print_v0,
-       .save           = addrtype_save_v0,
-       .extra_opts     = addrtype_opts_v0,
-};
-
-static struct xtables_match addrtype_mt_reg_v1 = {
-       .name           = "addrtype",
-       .version        = XTABLES_VERSION,
-       .family         = NFPROTO_IPV4,
-       .size           = XT_ALIGN(sizeof(struct ipt_addrtype_info_v1)),
-       .userspacesize  = XT_ALIGN(sizeof(struct ipt_addrtype_info_v1)),
-       .help           = addrtype_help_v1,
-       .parse          = addrtype_parse_v1,
-       .final_check    = addrtype_check_v1,
-       .print          = addrtype_print_v1,
-       .save           = addrtype_save_v1,
-       .extra_opts     = addrtype_opts_v1,
-       .revision       = 1,
+static struct xtables_match addrtype_mt_reg[] = {
+       {
+               .name          = "addrtype",
+               .version       = XTABLES_VERSION,
+               .family        = NFPROTO_IPV4,
+               .size          = XT_ALIGN(sizeof(struct ipt_addrtype_info)),
+               .userspacesize = XT_ALIGN(sizeof(struct ipt_addrtype_info)),
+               .help          = addrtype_help_v0,
+               .parse         = addrtype_parse_v0,
+               .final_check   = addrtype_check_v0,
+               .print         = addrtype_print_v0,
+               .save          = addrtype_save_v0,
+               .extra_opts    = addrtype_opts_v0,
+       },
+       {
+               .name          = "addrtype",
+               .revision      = 1,
+               .version       = XTABLES_VERSION,
+               .family        = NFPROTO_IPV4,
+               .size          = XT_ALIGN(sizeof(struct ipt_addrtype_info_v1)),
+               .userspacesize = XT_ALIGN(sizeof(struct ipt_addrtype_info_v1)),
+               .help          = addrtype_help_v1,
+               .parse         = addrtype_parse_v1,
+               .final_check   = addrtype_check_v1,
+               .print         = addrtype_print_v1,
+               .save          = addrtype_save_v1,
+               .extra_opts    = addrtype_opts_v1,
+       },
 };
 
 
 void _init(void) 
 {
-       xtables_register_match(&addrtype_mt_reg_v0);
-       xtables_register_match(&addrtype_mt_reg_v1);
+       xtables_register_matches(addrtype_mt_reg, ARRAY_SIZE(addrtype_mt_reg));
 }
index 5e9c37486844e670c5fbda30d6395b9fbc58dd12..3cf62f07ebb294540e6affe7b978d46f3d0c1c02 100644 (file)
@@ -398,40 +398,40 @@ connmark_tg_save(const void *ip, const struct xt_entry_target *target)
        }
 }
 
-static struct xtables_target connmark_target = {
-       .family         = NFPROTO_UNSPEC,
-       .name           = "CONNMARK",
-       .revision       = 0,
-       .version        = XTABLES_VERSION,
-       .size           = XT_ALIGN(sizeof(struct xt_connmark_target_info)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_connmark_target_info)),
-       .help           = CONNMARK_help,
-       .init           = CONNMARK_init,
-       .parse          = CONNMARK_parse,
-       .final_check    = connmark_tg_check,
-       .print          = CONNMARK_print,
-       .save           = CONNMARK_save,
-       .extra_opts     = CONNMARK_opts,
-};
-
-static struct xtables_target connmark_tg_reg = {
-       .version        = XTABLES_VERSION,
-       .name           = "CONNMARK",
-       .revision       = 1,
-       .family         = NFPROTO_UNSPEC,
-       .size           = XT_ALIGN(sizeof(struct xt_connmark_tginfo1)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_connmark_tginfo1)),
-       .help           = connmark_tg_help,
-       .init           = connmark_tg_init,
-       .parse          = connmark_tg_parse,
-       .final_check    = connmark_tg_check,
-       .print          = connmark_tg_print,
-       .save           = connmark_tg_save,
-       .extra_opts     = connmark_tg_opts,
+static struct xtables_target connmark_tg_reg[] = {
+       {
+               .family        = NFPROTO_UNSPEC,
+               .name          = "CONNMARK",
+               .revision      = 0,
+               .version       = XTABLES_VERSION,
+               .size          = XT_ALIGN(sizeof(struct xt_connmark_target_info)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_connmark_target_info)),
+               .help          = CONNMARK_help,
+               .init          = CONNMARK_init,
+               .parse         = CONNMARK_parse,
+               .final_check   = connmark_tg_check,
+               .print         = CONNMARK_print,
+               .save          = CONNMARK_save,
+               .extra_opts    = CONNMARK_opts,
+       },
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "CONNMARK",
+               .revision      = 1,
+               .family        = NFPROTO_UNSPEC,
+               .size          = XT_ALIGN(sizeof(struct xt_connmark_tginfo1)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_connmark_tginfo1)),
+               .help          = connmark_tg_help,
+               .init          = connmark_tg_init,
+               .parse         = connmark_tg_parse,
+               .final_check   = connmark_tg_check,
+               .print         = connmark_tg_print,
+               .save          = connmark_tg_save,
+               .extra_opts    = connmark_tg_opts,
+       },
 };
 
 void _init(void)
 {
-       xtables_register_target(&connmark_target);
-       xtables_register_target(&connmark_tg_reg);
+       xtables_register_targets(connmark_tg_reg, ARRAY_SIZE(connmark_tg_reg));
 }
index cab052bac3acf37d0b468836104350e1556b9fe5..f6a2c5c1bc30db320f7e1db29edafe5697bbcbe0 100644 (file)
@@ -277,54 +277,52 @@ static void mark_tg_save(const void *ip, const struct xt_entry_target *target)
        printf("--set-xmark 0x%x/0x%x ", info->mark, info->mask);
 }
 
-static struct xtables_target mark_target_v0 = {
-       .family         = NFPROTO_UNSPEC,
-       .name           = "MARK",
-       .version        = XTABLES_VERSION,
-       .revision       = 0,
-       .size           = XT_ALIGN(sizeof(struct xt_mark_target_info)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_mark_target_info)),
-       .help           = MARK_help,
-       .parse          = MARK_parse_v0,
-       .final_check    = MARK_check,
-       .print          = MARK_print_v0,
-       .save           = MARK_save_v0,
-       .extra_opts     = MARK_opts,
-};
-
-static struct xtables_target mark_target_v1 = {
-       .family         = NFPROTO_IPV4,
-       .name           = "MARK",
-       .version        = XTABLES_VERSION,
-       .revision       = 1,
-       .size           = XT_ALIGN(sizeof(struct xt_mark_target_info_v1)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_mark_target_info_v1)),
-       .help           = MARK_help,
-       .parse          = MARK_parse_v1,
-       .final_check    = MARK_check,
-       .print          = MARK_print_v1,
-       .save           = MARK_save_v1,
-       .extra_opts     = MARK_opts,
-};
-
-static struct xtables_target mark_tg_reg_v2 = {
-       .version       = XTABLES_VERSION,
-       .name          = "MARK",
-       .revision      = 2,
-       .family        = NFPROTO_UNSPEC,
-       .size          = XT_ALIGN(sizeof(struct xt_mark_tginfo2)),
-       .userspacesize = XT_ALIGN(sizeof(struct xt_mark_tginfo2)),
-       .help          = mark_tg_help,
-       .parse         = mark_tg_parse,
-       .final_check   = mark_tg_check,
-       .print         = mark_tg_print,
-       .save          = mark_tg_save,
-       .extra_opts    = mark_tg_opts,
+static struct xtables_target mark_tg_reg[] = {
+       {
+               .family        = NFPROTO_UNSPEC,
+               .name          = "MARK",
+               .version       = XTABLES_VERSION,
+               .revision      = 0,
+               .size          = XT_ALIGN(sizeof(struct xt_mark_target_info)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_mark_target_info)),
+               .help          = MARK_help,
+               .parse         = MARK_parse_v0,
+               .final_check   = MARK_check,
+               .print         = MARK_print_v0,
+               .save          = MARK_save_v0,
+               .extra_opts    = MARK_opts,
+       },
+       {
+               .family        = NFPROTO_IPV4,
+               .name          = "MARK",
+               .version       = XTABLES_VERSION,
+               .revision      = 1,
+               .size          = XT_ALIGN(sizeof(struct xt_mark_target_info_v1)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_mark_target_info_v1)),
+               .help          = MARK_help,
+               .parse         = MARK_parse_v1,
+               .final_check   = MARK_check,
+               .print         = MARK_print_v1,
+               .save          = MARK_save_v1,
+               .extra_opts    = MARK_opts,
+       },
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "MARK",
+               .revision      = 2,
+               .family        = NFPROTO_UNSPEC,
+               .size          = XT_ALIGN(sizeof(struct xt_mark_tginfo2)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_mark_tginfo2)),
+               .help          = mark_tg_help,
+               .parse         = mark_tg_parse,
+               .final_check   = mark_tg_check,
+               .print         = mark_tg_print,
+               .save          = mark_tg_save,
+               .extra_opts    = mark_tg_opts,
+       },
 };
 
 void _init(void)
 {
-       xtables_register_target(&mark_target_v0);
-       xtables_register_target(&mark_target_v1);
-       xtables_register_target(&mark_tg_reg_v2);
+       xtables_register_targets(mark_tg_reg, ARRAY_SIZE(mark_tg_reg));
 }
index e6382e14f961451374c3f5aa9534ad342ceacb49..bf751a4ec64aff71f55597b7618cfb3bb46ca969 100644 (file)
@@ -205,38 +205,38 @@ static void tos_tg_save(const void *ip, const struct xt_entry_target *target)
        printf("--set-tos 0x%02x/0x%02x ", info->tos_value, info->tos_mask);
 }
 
-static struct xtables_target tos_tg_reg_v0 = {
-       .version       = XTABLES_VERSION,
-       .name          = "TOS",
-       .revision      = 0,
-       .family        = NFPROTO_IPV4,
-       .size          = XT_ALIGN(sizeof(struct xt_tos_target_info)),
-       .userspacesize = XT_ALIGN(sizeof(struct xt_tos_target_info)),
-       .help          = tos_tg_help_v0,
-       .parse         = tos_tg_parse_v0,
-       .final_check   = tos_tg_check,
-       .print         = tos_tg_print_v0,
-       .save          = tos_tg_save_v0,
-       .extra_opts    = tos_tg_opts_v0,
-};
-
-static struct xtables_target tos_tg_reg = {
-       .version       = XTABLES_VERSION,
-       .name          = "TOS",
-       .revision      = 1,
-       .family        = NFPROTO_UNSPEC,
-       .size          = XT_ALIGN(sizeof(struct xt_tos_target_info)),
-       .userspacesize = XT_ALIGN(sizeof(struct xt_tos_target_info)),
-       .help          = tos_tg_help,
-       .parse         = tos_tg_parse,
-       .final_check   = tos_tg_check,
-       .print         = tos_tg_print,
-       .save          = tos_tg_save,
-       .extra_opts    = tos_tg_opts,
+static struct xtables_target tos_tg_reg[] = {
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "TOS",
+               .revision      = 0,
+               .family        = NFPROTO_IPV4,
+               .size          = XT_ALIGN(sizeof(struct xt_tos_target_info)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_tos_target_info)),
+               .help          = tos_tg_help_v0,
+               .parse         = tos_tg_parse_v0,
+               .final_check   = tos_tg_check,
+               .print         = tos_tg_print_v0,
+               .save          = tos_tg_save_v0,
+               .extra_opts    = tos_tg_opts_v0,
+       },
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "TOS",
+               .revision      = 1,
+               .family        = NFPROTO_UNSPEC,
+               .size          = XT_ALIGN(sizeof(struct xt_tos_target_info)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_tos_target_info)),
+               .help          = tos_tg_help,
+               .parse         = tos_tg_parse,
+               .final_check   = tos_tg_check,
+               .print         = tos_tg_print,
+               .save          = tos_tg_save,
+               .extra_opts    = tos_tg_opts,
+       },
 };
 
 void _init(void)
 {
-       xtables_register_target(&tos_tg_reg_v0);
-       xtables_register_target(&tos_tg_reg);
+       xtables_register_targets(tos_tg_reg, ARRAY_SIZE(tos_tg_reg));
 }
index 403e7e6f9470610b22890a492ba1b733cefd0282..1698561d52f4602f8b4410f288b0b8a3c09e3e08 100644 (file)
@@ -179,38 +179,38 @@ static void connlimit_save6(const void *ip, const struct xt_entry_match *match)
               count_bits6(info->v6_mask));
 }
 
-static struct xtables_match connlimit_match = {
-       .name          = "connlimit",
-       .family        = NFPROTO_IPV4,
-       .version       = XTABLES_VERSION,
-       .size          = XT_ALIGN(sizeof(struct xt_connlimit_info)),
-       .userspacesize = offsetof(struct xt_connlimit_info, data),
-       .help          = connlimit_help,
-       .init          = connlimit_init,
-       .parse         = connlimit_parse4,
-       .final_check   = connlimit_check,
-       .print         = connlimit_print4,
-       .save          = connlimit_save4,
-       .extra_opts    = connlimit_opts,
-};
-
-static struct xtables_match connlimit_match6 = {
-       .name          = "connlimit",
-       .family        = NFPROTO_IPV6,
-       .version       = XTABLES_VERSION,
-       .size          = XT_ALIGN(sizeof(struct xt_connlimit_info)),
-       .userspacesize = offsetof(struct xt_connlimit_info, data),
-       .help          = connlimit_help,
-       .init          = connlimit_init,
-       .parse         = connlimit_parse6,
-       .final_check   = connlimit_check,
-       .print         = connlimit_print6,
-       .save          = connlimit_save6,
-       .extra_opts    = connlimit_opts,
+static struct xtables_match connlimit_mt_reg[] = {
+       {
+               .name          = "connlimit",
+               .family        = NFPROTO_IPV4,
+               .version       = XTABLES_VERSION,
+               .size          = XT_ALIGN(sizeof(struct xt_connlimit_info)),
+               .userspacesize = offsetof(struct xt_connlimit_info, data),
+               .help          = connlimit_help,
+               .init          = connlimit_init,
+               .parse         = connlimit_parse4,
+               .final_check   = connlimit_check,
+               .print         = connlimit_print4,
+               .save          = connlimit_save4,
+               .extra_opts    = connlimit_opts,
+       },
+       {
+               .name          = "connlimit",
+               .family        = NFPROTO_IPV6,
+               .version       = XTABLES_VERSION,
+               .size          = XT_ALIGN(sizeof(struct xt_connlimit_info)),
+               .userspacesize = offsetof(struct xt_connlimit_info, data),
+               .help          = connlimit_help,
+               .init          = connlimit_init,
+               .parse         = connlimit_parse6,
+               .final_check   = connlimit_check,
+               .print         = connlimit_print6,
+               .save          = connlimit_save6,
+               .extra_opts    = connlimit_opts,
+       },
 };
 
 void _init(void)
 {
-       xtables_register_match(&connlimit_match);
-       xtables_register_match(&connlimit_match6);
+       xtables_register_matches(connlimit_mt_reg, ARRAY_SIZE(connlimit_mt_reg));
 }
index db7c3a1979b353dd9c76f6331ff4c67e3ee3d15d..48c10b5d2c419818bac8ea0185f4faae3a4245dd 100644 (file)
@@ -163,38 +163,38 @@ connmark_mt_save(const void *ip, const struct xt_entry_match *match)
        print_mark(info->mark, info->mask);
 }
 
-static struct xtables_match connmark_mt_reg_v0 = {
-       .family         = NFPROTO_UNSPEC,
-       .name           = "connmark",
-       .revision       = 0,
-       .version        = XTABLES_VERSION,
-       .size           = XT_ALIGN(sizeof(struct xt_connmark_info)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_connmark_info)),
-       .help           = connmark_mt_help,
-       .parse          = connmark_parse,
-       .final_check    = connmark_mt_check,
-       .print          = connmark_print,
-       .save           = connmark_save,
-       .extra_opts     = connmark_mt_opts,
-};
-
-static struct xtables_match connmark_mt_reg = {
-       .version        = XTABLES_VERSION,
-       .name           = "connmark",
-       .revision       = 1,
-       .family         = NFPROTO_UNSPEC,
-       .size           = XT_ALIGN(sizeof(struct xt_connmark_mtinfo1)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_connmark_mtinfo1)),
-       .help           = connmark_mt_help,
-       .parse          = connmark_mt_parse,
-       .final_check    = connmark_mt_check,
-       .print          = connmark_mt_print,
-       .save           = connmark_mt_save,
-       .extra_opts     = connmark_mt_opts,
+static struct xtables_match connmark_mt_reg[] = {
+       {
+               .family        = NFPROTO_UNSPEC,
+               .name          = "connmark",
+               .revision      = 0,
+               .version       = XTABLES_VERSION,
+               .size          = XT_ALIGN(sizeof(struct xt_connmark_info)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_connmark_info)),
+               .help          = connmark_mt_help,
+               .parse         = connmark_parse,
+               .final_check   = connmark_mt_check,
+               .print         = connmark_print,
+               .save          = connmark_save,
+               .extra_opts    = connmark_mt_opts,
+       },
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "connmark",
+               .revision      = 1,
+               .family        = NFPROTO_UNSPEC,
+               .size          = XT_ALIGN(sizeof(struct xt_connmark_mtinfo1)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_connmark_mtinfo1)),
+               .help          = connmark_mt_help,
+               .parse         = connmark_mt_parse,
+               .final_check   = connmark_mt_check,
+               .print         = connmark_mt_print,
+               .save          = connmark_mt_save,
+               .extra_opts    = connmark_mt_opts,
+       },
 };
 
 void _init(void)
 {
-       xtables_register_match(&connmark_mt_reg_v0);
-       xtables_register_match(&connmark_mt_reg);
+       xtables_register_matches(connmark_mt_reg, ARRAY_SIZE(connmark_mt_reg));
 }
index 96ea3ec5722444aa388145e3f181d9b5fa6fe0ad..edcaaa8804f87d67109492870c0befa8282db555 100644 (file)
@@ -1034,54 +1034,52 @@ static void conntrack_mt6_save(const void *ip,
        conntrack_dump((const void *)match->data, "--", NFPROTO_IPV6, true);
 }
 
-static struct xtables_match conntrack_match = {
-       .version       = XTABLES_VERSION,
-       .name          = "conntrack",
-       .revision      = 0,
-       .family        = NFPROTO_IPV4,
-       .size          = XT_ALIGN(sizeof(struct xt_conntrack_info)),
-       .userspacesize = XT_ALIGN(sizeof(struct xt_conntrack_info)),
-       .help          = conntrack_mt_help,
-       .parse         = conntrack_parse,
-       .final_check   = conntrack_mt_check,
-       .print         = conntrack_print,
-       .save          = conntrack_save,
-       .extra_opts    = conntrack_mt_opts_v0,
-};
-
-static struct xtables_match conntrack_mt_reg = {
-       .version       = XTABLES_VERSION,
-       .name          = "conntrack",
-       .revision      = 1,
-       .family        = NFPROTO_IPV4,
-       .size          = XT_ALIGN(sizeof(struct xt_conntrack_mtinfo1)),
-       .userspacesize = XT_ALIGN(sizeof(struct xt_conntrack_mtinfo1)),
-       .help          = conntrack_mt_help,
-       .parse         = conntrack_mt4_parse,
-       .final_check   = conntrack_mt_check,
-       .print         = conntrack_mt_print,
-       .save          = conntrack_mt_save,
-       .extra_opts    = conntrack_mt_opts,
-};
-
-static struct xtables_match conntrack_mt6_reg = {
-       .version       = XTABLES_VERSION,
-       .name          = "conntrack",
-       .revision      = 1,
-       .family        = NFPROTO_IPV6,
-       .size          = XT_ALIGN(sizeof(struct xt_conntrack_mtinfo1)),
-       .userspacesize = XT_ALIGN(sizeof(struct xt_conntrack_mtinfo1)),
-       .help          = conntrack_mt_help,
-       .parse         = conntrack_mt6_parse,
-       .final_check   = conntrack_mt_check,
-       .print         = conntrack_mt6_print,
-       .save          = conntrack_mt6_save,
-       .extra_opts    = conntrack_mt_opts,
+static struct xtables_match conntrack_mt_reg[] = {
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "conntrack",
+               .revision      = 0,
+               .family        = NFPROTO_IPV4,
+               .size          = XT_ALIGN(sizeof(struct xt_conntrack_info)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_conntrack_info)),
+               .help          = conntrack_mt_help,
+               .parse         = conntrack_parse,
+               .final_check   = conntrack_mt_check,
+               .print         = conntrack_print,
+               .save          = conntrack_save,
+               .extra_opts    = conntrack_mt_opts_v0,
+       },
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "conntrack",
+               .revision      = 1,
+               .family        = NFPROTO_IPV4,
+               .size          = XT_ALIGN(sizeof(struct xt_conntrack_mtinfo1)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_conntrack_mtinfo1)),
+               .help          = conntrack_mt_help,
+               .parse         = conntrack_mt4_parse,
+               .final_check   = conntrack_mt_check,
+               .print         = conntrack_mt_print,
+               .save          = conntrack_mt_save,
+               .extra_opts    = conntrack_mt_opts,
+       },
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "conntrack",
+               .revision      = 1,
+               .family        = NFPROTO_IPV6,
+               .size          = XT_ALIGN(sizeof(struct xt_conntrack_mtinfo1)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_conntrack_mtinfo1)),
+               .help          = conntrack_mt_help,
+               .parse         = conntrack_mt6_parse,
+               .final_check   = conntrack_mt_check,
+               .print         = conntrack_mt6_print,
+               .save          = conntrack_mt6_save,
+               .extra_opts    = conntrack_mt_opts,
+       },
 };
 
 void _init(void)
 {
-       xtables_register_match(&conntrack_match);
-       xtables_register_match(&conntrack_mt_reg);
-       xtables_register_match(&conntrack_mt6_reg);
+       xtables_register_matches(conntrack_mt_reg, ARRAY_SIZE(conntrack_mt_reg));
 }
index 9d8c86aabcad4f4eb9388fa58219c2764b2b7fb3..cdb407ab6e3c115b76c6a717fc4904b832dc7ae2 100644 (file)
@@ -659,57 +659,55 @@ hashlimit_mt6_save(const void *ip, const struct xt_entry_match *match)
        hashlimit_mt_save(info, 128);
 }
 
-static struct xtables_match hashlimit_match = {
-       .family         = NFPROTO_UNSPEC,
-       .name           = "hashlimit",
-       .version        = XTABLES_VERSION,
-       .revision       = 0,
-       .size           = XT_ALIGN(sizeof(struct xt_hashlimit_info)),
-       .userspacesize  = offsetof(struct xt_hashlimit_info, hinfo),
-       .help           = hashlimit_help,
-       .init           = hashlimit_init,
-       .parse          = hashlimit_parse,
-       .final_check    = hashlimit_check,
-       .print          = hashlimit_print,
-       .save           = hashlimit_save,
-       .extra_opts     = hashlimit_opts,
-};
-
-static struct xtables_match hashlimit_mt_reg = {
-       .version        = XTABLES_VERSION,
-       .name           = "hashlimit",
-       .revision       = 1,
-       .family         = NFPROTO_IPV4,
-       .size           = XT_ALIGN(sizeof(struct xt_hashlimit_mtinfo1)),
-       .userspacesize  = offsetof(struct xt_hashlimit_mtinfo1, hinfo),
-       .help           = hashlimit_mt_help,
-       .init           = hashlimit_mt4_init,
-       .parse          = hashlimit_mt4_parse,
-       .final_check    = hashlimit_mt_check,
-       .print          = hashlimit_mt4_print,
-       .save           = hashlimit_mt4_save,
-       .extra_opts     = hashlimit_mt_opts,
-};
-
-static struct xtables_match hashlimit_mt6_reg = {
-       .version        = XTABLES_VERSION,
-       .name           = "hashlimit",
-       .revision       = 1,
-       .family         = NFPROTO_IPV6,
-       .size           = XT_ALIGN(sizeof(struct xt_hashlimit_mtinfo1)),
-       .userspacesize  = offsetof(struct xt_hashlimit_mtinfo1, hinfo),
-       .help           = hashlimit_mt_help,
-       .init           = hashlimit_mt6_init,
-       .parse          = hashlimit_mt6_parse,
-       .final_check    = hashlimit_mt_check,
-       .print          = hashlimit_mt6_print,
-       .save           = hashlimit_mt6_save,
-       .extra_opts     = hashlimit_mt_opts,
+static struct xtables_match hashlimit_mt_reg[] = {
+       {
+               .family        = NFPROTO_UNSPEC,
+               .name          = "hashlimit",
+               .version       = XTABLES_VERSION,
+               .revision      = 0,
+               .size          = XT_ALIGN(sizeof(struct xt_hashlimit_info)),
+               .userspacesize = offsetof(struct xt_hashlimit_info, hinfo),
+               .help          = hashlimit_help,
+               .init          = hashlimit_init,
+               .parse         = hashlimit_parse,
+               .final_check   = hashlimit_check,
+               .print         = hashlimit_print,
+               .save          = hashlimit_save,
+               .extra_opts    = hashlimit_opts,
+       },
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "hashlimit",
+               .revision      = 1,
+               .family        = NFPROTO_IPV4,
+               .size          = XT_ALIGN(sizeof(struct xt_hashlimit_mtinfo1)),
+               .userspacesize = offsetof(struct xt_hashlimit_mtinfo1, hinfo),
+               .help          = hashlimit_mt_help,
+               .init          = hashlimit_mt4_init,
+               .parse         = hashlimit_mt4_parse,
+               .final_check   = hashlimit_mt_check,
+               .print         = hashlimit_mt4_print,
+               .save          = hashlimit_mt4_save,
+               .extra_opts    = hashlimit_mt_opts,
+       },
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "hashlimit",
+               .revision      = 1,
+               .family        = NFPROTO_IPV6,
+               .size          = XT_ALIGN(sizeof(struct xt_hashlimit_mtinfo1)),
+               .userspacesize = offsetof(struct xt_hashlimit_mtinfo1, hinfo),
+               .help          = hashlimit_mt_help,
+               .init          = hashlimit_mt6_init,
+               .parse         = hashlimit_mt6_parse,
+               .final_check   = hashlimit_mt_check,
+               .print         = hashlimit_mt6_print,
+               .save          = hashlimit_mt6_save,
+               .extra_opts    = hashlimit_mt_opts,
+       },
 };
 
 void _init(void)
 {
-       xtables_register_match(&hashlimit_match);
-       xtables_register_match(&hashlimit_mt_reg);
-       xtables_register_match(&hashlimit_mt6_reg);
+       xtables_register_matches(hashlimit_mt_reg, ARRAY_SIZE(hashlimit_mt_reg));
 }
index bc5b2aeb2bd660e89929c3132d6a724a88464736..7b3ccc2b2578741cf959cfbe7aabf38f8f9807f2 100644 (file)
@@ -344,54 +344,52 @@ static void iprange_mt6_save(const void *ip, const struct xt_entry_match *match)
        }
 }
 
-static struct xtables_match iprange_match = {
-       .version       = XTABLES_VERSION,
-       .name          = "iprange",
-       .revision      = 0,
-       .family        = NFPROTO_IPV4,
-       .size          = XT_ALIGN(sizeof(struct ipt_iprange_info)),
-       .userspacesize = XT_ALIGN(sizeof(struct ipt_iprange_info)),
-       .help          = iprange_mt_help,
-       .parse         = iprange_parse,
-       .final_check   = iprange_mt_check,
-       .print         = iprange_print,
-       .save          = iprange_save,
-       .extra_opts    = iprange_mt_opts,
-};
-
-static struct xtables_match iprange_mt_reg = {
-       .version        = XTABLES_VERSION,
-       .name           = "iprange",
-       .revision       = 1,
-       .family         = NFPROTO_IPV4,
-       .size           = XT_ALIGN(sizeof(struct xt_iprange_mtinfo)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_iprange_mtinfo)),
-       .help           = iprange_mt_help,
-       .parse          = iprange_mt4_parse,
-       .final_check    = iprange_mt_check,
-       .print          = iprange_mt4_print,
-       .save           = iprange_mt4_save,
-       .extra_opts     = iprange_mt_opts,
-};
-
-static struct xtables_match iprange_mt6_reg = {
-       .version        = XTABLES_VERSION,
-       .name           = "iprange",
-       .revision       = 1,
-       .family         = NFPROTO_IPV6,
-       .size           = XT_ALIGN(sizeof(struct xt_iprange_mtinfo)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_iprange_mtinfo)),
-       .help           = iprange_mt_help,
-       .parse          = iprange_mt6_parse,
-       .final_check    = iprange_mt_check,
-       .print          = iprange_mt6_print,
-       .save           = iprange_mt6_save,
-       .extra_opts     = iprange_mt_opts,
+static struct xtables_match iprange_mt_reg[] = {
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "iprange",
+               .revision      = 0,
+               .family        = NFPROTO_IPV4,
+               .size          = XT_ALIGN(sizeof(struct ipt_iprange_info)),
+               .userspacesize = XT_ALIGN(sizeof(struct ipt_iprange_info)),
+               .help          = iprange_mt_help,
+               .parse         = iprange_parse,
+               .final_check   = iprange_mt_check,
+               .print         = iprange_print,
+               .save          = iprange_save,
+               .extra_opts    = iprange_mt_opts,
+       },
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "iprange",
+               .revision      = 1,
+               .family        = NFPROTO_IPV4,
+               .size          = XT_ALIGN(sizeof(struct xt_iprange_mtinfo)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_iprange_mtinfo)),
+               .help          = iprange_mt_help,
+               .parse         = iprange_mt4_parse,
+               .final_check   = iprange_mt_check,
+               .print         = iprange_mt4_print,
+               .save          = iprange_mt4_save,
+               .extra_opts    = iprange_mt_opts,
+       },
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "iprange",
+               .revision      = 1,
+               .family        = NFPROTO_IPV6,
+               .size          = XT_ALIGN(sizeof(struct xt_iprange_mtinfo)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_iprange_mtinfo)),
+               .help          = iprange_mt_help,
+               .parse         = iprange_mt6_parse,
+               .final_check   = iprange_mt_check,
+               .print         = iprange_mt6_print,
+               .save          = iprange_mt6_save,
+               .extra_opts    = iprange_mt_opts,
+       },
 };
 
 void _init(void)
 {
-       xtables_register_match(&iprange_match);
-       xtables_register_match(&iprange_mt_reg);
-       xtables_register_match(&iprange_mt6_reg);
+       xtables_register_matches(iprange_mt_reg, ARRAY_SIZE(iprange_mt_reg));
 }
index 6f8cc57066d8cbc3777dbc63673192787d86354b..fc3d6466edbea3b30988c6b0b518c2f068dd221f 100644 (file)
@@ -143,38 +143,38 @@ mark_save(const void *ip, const struct xt_entry_match *match)
        print_mark(info->mark, info->mask);
 }
 
-static struct xtables_match mark_match = {
-       .family         = NFPROTO_UNSPEC,
-       .name           = "mark",
-       .revision       = 0,
-       .version        = XTABLES_VERSION,
-       .size           = XT_ALIGN(sizeof(struct xt_mark_info)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_mark_info)),
-       .help           = mark_mt_help,
-       .parse          = mark_parse,
-       .final_check    = mark_mt_check,
-       .print          = mark_print,
-       .save           = mark_save,
-       .extra_opts     = mark_mt_opts,
-};
-
-static struct xtables_match mark_mt_reg = {
-       .version        = XTABLES_VERSION,
-       .name           = "mark",
-       .revision       = 1,
-       .family         = NFPROTO_UNSPEC,
-       .size           = XT_ALIGN(sizeof(struct xt_mark_mtinfo1)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_mark_mtinfo1)),
-       .help           = mark_mt_help,
-       .parse          = mark_mt_parse,
-       .final_check    = mark_mt_check,
-       .print          = mark_mt_print,
-       .save           = mark_mt_save,
-       .extra_opts     = mark_mt_opts,
+static struct xtables_match mark_mt_reg[] = {
+       {
+               .family        = NFPROTO_UNSPEC,
+               .name          = "mark",
+               .revision      = 0,
+               .version       = XTABLES_VERSION,
+               .size          = XT_ALIGN(sizeof(struct xt_mark_info)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_mark_info)),
+               .help          = mark_mt_help,
+               .parse         = mark_parse,
+               .final_check   = mark_mt_check,
+               .print         = mark_print,
+               .save          = mark_save,
+               .extra_opts    = mark_mt_opts,
+       },
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "mark",
+               .revision      = 1,
+               .family        = NFPROTO_UNSPEC,
+               .size          = XT_ALIGN(sizeof(struct xt_mark_mtinfo1)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_mark_mtinfo1)),
+               .help          = mark_mt_help,
+               .parse         = mark_mt_parse,
+               .final_check   = mark_mt_check,
+               .print         = mark_mt_print,
+               .save          = mark_mt_save,
+               .extra_opts    = mark_mt_opts,
+       },
 };
 
 void _init(void)
 {
-       xtables_register_match(&mark_match);
-       xtables_register_match(&mark_mt_reg);
+       xtables_register_matches(mark_mt_reg, ARRAY_SIZE(mark_mt_reg));
 }
index 9959a20e6fadeb93deff25eb1789f7832dcca28a..d9b6e74136829ba12eebf148b87f9cd0288fe442 100644 (file)
@@ -509,71 +509,67 @@ static void multiport_save6_v1(const void *ip_void,
        __multiport_save_v1(match, ip->proto);
 }
 
-static struct xtables_match multiport_match = {
-       .family         = NFPROTO_IPV4,
-       .name           = "multiport",
-       .revision       = 0,
-       .version        = XTABLES_VERSION,
-       .size           = XT_ALIGN(sizeof(struct xt_multiport)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_multiport)),
-       .help           = multiport_help,
-       .parse          = multiport_parse,
-       .final_check    = multiport_check,
-       .print          = multiport_print,
-       .save           = multiport_save,
-       .extra_opts     = multiport_opts,
-};
-
-static struct xtables_match multiport_match6 = {
-       .family         = NFPROTO_IPV6,
-       .name           = "multiport",
-       .revision       = 0,
-       .version        = XTABLES_VERSION,
-       .size           = XT_ALIGN(sizeof(struct xt_multiport)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_multiport)),
-       .help           = multiport_help,
-       .parse          = multiport_parse6,
-       .final_check    = multiport_check,
-       .print          = multiport_print6,
-       .save           = multiport_save6,
-       .extra_opts     = multiport_opts,
-};
-
-static struct xtables_match multiport_match_v1 = {
-       .family         = NFPROTO_IPV4,
-       .name           = "multiport",
-       .version        = XTABLES_VERSION,
-       .revision       = 1,
-       .size           = XT_ALIGN(sizeof(struct xt_multiport_v1)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_multiport_v1)),
-       .help           = multiport_help_v1,
-       .parse          = multiport_parse_v1,
-       .final_check    = multiport_check,
-       .print          = multiport_print_v1,
-       .save           = multiport_save_v1,
-       .extra_opts     = multiport_opts,
-};
-
-static struct xtables_match multiport_match6_v1 = {
-       .family         = NFPROTO_IPV6,
-       .name           = "multiport",
-       .version        = XTABLES_VERSION,
-       .revision       = 1,
-       .size           = XT_ALIGN(sizeof(struct xt_multiport_v1)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_multiport_v1)),
-       .help           = multiport_help_v1,
-       .parse          = multiport_parse6_v1,
-       .final_check    = multiport_check,
-       .print          = multiport_print6_v1,
-       .save           = multiport_save6_v1,
-       .extra_opts     = multiport_opts,
+static struct xtables_match multiport_mt_reg[] = {
+       {
+               .family        = NFPROTO_IPV4,
+               .name          = "multiport",
+               .revision      = 0,
+               .version       = XTABLES_VERSION,
+               .size          = XT_ALIGN(sizeof(struct xt_multiport)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_multiport)),
+               .help          = multiport_help,
+               .parse         = multiport_parse,
+               .final_check   = multiport_check,
+               .print         = multiport_print,
+               .save          = multiport_save,
+               .extra_opts    = multiport_opts,
+       },
+       {
+               .family        = NFPROTO_IPV6,
+               .name          = "multiport",
+               .revision      = 0,
+               .version       = XTABLES_VERSION,
+               .size          = XT_ALIGN(sizeof(struct xt_multiport)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_multiport)),
+               .help          = multiport_help,
+               .parse         = multiport_parse6,
+               .final_check   = multiport_check,
+               .print         = multiport_print6,
+               .save          = multiport_save6,
+               .extra_opts    = multiport_opts,
+       },
+       {
+               .family        = NFPROTO_IPV4,
+               .name          = "multiport",
+               .version       = XTABLES_VERSION,
+               .revision      = 1,
+               .size          = XT_ALIGN(sizeof(struct xt_multiport_v1)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_multiport_v1)),
+               .help          = multiport_help_v1,
+               .parse         = multiport_parse_v1,
+               .final_check   = multiport_check,
+               .print         = multiport_print_v1,
+               .save          = multiport_save_v1,
+               .extra_opts    = multiport_opts,
+       },
+       {
+               .family        = NFPROTO_IPV6,
+               .name          = "multiport",
+               .version       = XTABLES_VERSION,
+               .revision      = 1,
+               .size          = XT_ALIGN(sizeof(struct xt_multiport_v1)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_multiport_v1)),
+               .help          = multiport_help_v1,
+               .parse         = multiport_parse6_v1,
+               .final_check   = multiport_check,
+               .print         = multiport_print6_v1,
+               .save          = multiport_save6_v1,
+               .extra_opts    = multiport_opts,
+       },
 };
 
 void
 _init(void)
 {
-       xtables_register_match(&multiport_match);
-       xtables_register_match(&multiport_match6);
-       xtables_register_match(&multiport_match_v1);
-       xtables_register_match(&multiport_match6_v1);
+       xtables_register_matches(multiport_mt_reg, ARRAY_SIZE(multiport_mt_reg));
 }
index f1d6b4ab0712af010b58eebdbf17bc99d5cb1808..25441384443885d130125f16cfd17161c5a8909e 100644 (file)
@@ -533,54 +533,52 @@ static void owner_mt_save(const void *ip, const struct xt_entry_match *match)
        owner_mt_print_item(info, "--gid-owner",      XT_OWNER_GID,    false);
 }
 
-static struct xtables_match owner_mt_reg_v0 = {
-       .version       = XTABLES_VERSION,
-       .name          = "owner",
-       .revision      = 0,
-       .family        = NFPROTO_IPV4,
-       .size          = XT_ALIGN(sizeof(struct ipt_owner_info)),
-       .userspacesize = XT_ALIGN(sizeof(struct ipt_owner_info)),
-       .help          = owner_mt_help_v0,
-       .parse         = owner_mt_parse_v0,
-       .final_check   = owner_mt_check,
-       .print         = owner_mt_print_v0,
-       .save          = owner_mt_save_v0,
-       .extra_opts    = owner_mt_opts_v0,
-};
-
-static struct xtables_match owner_mt6_reg_v0 = {
-       .version       = XTABLES_VERSION,
-       .name          = "owner",
-       .revision      = 0,
-       .family        = NFPROTO_IPV6,
-       .size          = XT_ALIGN(sizeof(struct ip6t_owner_info)),
-       .userspacesize = XT_ALIGN(sizeof(struct ip6t_owner_info)),
-       .help          = owner_mt6_help_v0,
-       .parse         = owner_mt6_parse_v0,
-       .final_check   = owner_mt_check,
-       .print         = owner_mt6_print_v0,
-       .save          = owner_mt6_save_v0,
-       .extra_opts    = owner_mt6_opts_v0,
-};
-
-static struct xtables_match owner_mt_reg = {
-       .version       = XTABLES_VERSION,
-       .name          = "owner",
-       .revision      = 1,
-       .family        = NFPROTO_UNSPEC,
-       .size          = XT_ALIGN(sizeof(struct xt_owner_match_info)),
-       .userspacesize = XT_ALIGN(sizeof(struct xt_owner_match_info)),
-       .help          = owner_mt_help,
-       .parse         = owner_mt_parse,
-       .final_check   = owner_mt_check,
-       .print         = owner_mt_print,
-       .save          = owner_mt_save,
-       .extra_opts    = owner_mt_opts,
+static struct xtables_match owner_mt_reg[] = {
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "owner",
+               .revision      = 0,
+               .family        = NFPROTO_IPV4,
+               .size          = XT_ALIGN(sizeof(struct ipt_owner_info)),
+               .userspacesize = XT_ALIGN(sizeof(struct ipt_owner_info)),
+               .help          = owner_mt_help_v0,
+               .parse         = owner_mt_parse_v0,
+               .final_check   = owner_mt_check,
+               .print         = owner_mt_print_v0,
+               .save          = owner_mt_save_v0,
+               .extra_opts    = owner_mt_opts_v0,
+       },
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "owner",
+               .revision      = 0,
+               .family        = NFPROTO_IPV6,
+               .size          = XT_ALIGN(sizeof(struct ip6t_owner_info)),
+               .userspacesize = XT_ALIGN(sizeof(struct ip6t_owner_info)),
+               .help          = owner_mt6_help_v0,
+               .parse         = owner_mt6_parse_v0,
+               .final_check   = owner_mt_check,
+               .print         = owner_mt6_print_v0,
+               .save          = owner_mt6_save_v0,
+               .extra_opts    = owner_mt6_opts_v0,
+       },
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "owner",
+               .revision      = 1,
+               .family        = NFPROTO_UNSPEC,
+               .size          = XT_ALIGN(sizeof(struct xt_owner_match_info)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_owner_match_info)),
+               .help          = owner_mt_help,
+               .parse         = owner_mt_parse,
+               .final_check   = owner_mt_check,
+               .print         = owner_mt_print,
+               .save          = owner_mt_save,
+               .extra_opts    = owner_mt_opts,
+       },
 };
 
 void _init(void)
 {
-       xtables_register_match(&owner_mt_reg_v0);
-       xtables_register_match(&owner_mt6_reg_v0);
-       xtables_register_match(&owner_mt_reg);
+       xtables_register_matches(owner_mt_reg, ARRAY_SIZE(owner_mt_reg));
 }
index d17b1bbc5fea15d06f3312d85c0e95b531af8138..858eaaad067f656888c5dc6e8456d3134eeb01dd 100644 (file)
@@ -478,36 +478,36 @@ static void policy6_save(const void *ip, const struct xt_entry_match *match)
        }
 }
 
-static struct xtables_match policy_mt_reg = {
-       .name           = "policy",
-       .version        = XTABLES_VERSION,
-       .family         = NFPROTO_IPV4,
-       .size           = XT_ALIGN(sizeof(struct xt_policy_info)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_policy_info)),
-       .help           = policy_help,
-       .parse          = policy4_parse,
-       .final_check    = policy_check,
-       .print          = policy4_print,
-       .save           = policy4_save,
-       .extra_opts     = policy_opts,
-};
-
-static struct xtables_match policy_mt6_reg = {
-       .name           = "policy",
-       .version        = XTABLES_VERSION,
-       .family         = NFPROTO_IPV6,
-       .size           = XT_ALIGN(sizeof(struct xt_policy_info)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_policy_info)),
-       .help           = policy_help,
-       .parse          = policy6_parse,
-       .final_check    = policy_check,
-       .print          = policy6_print,
-       .save           = policy6_save,
-       .extra_opts     = policy_opts,
+static struct xtables_match policy_mt_reg[] = {
+       {
+               .name          = "policy",
+               .version       = XTABLES_VERSION,
+               .family        = NFPROTO_IPV4,
+               .size          = XT_ALIGN(sizeof(struct xt_policy_info)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_policy_info)),
+               .help          = policy_help,
+               .parse         = policy4_parse,
+               .final_check   = policy_check,
+               .print         = policy4_print,
+               .save          = policy4_save,
+               .extra_opts    = policy_opts,
+       },
+       {
+               .name          = "policy",
+               .version       = XTABLES_VERSION,
+               .family        = NFPROTO_IPV6,
+               .size          = XT_ALIGN(sizeof(struct xt_policy_info)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_policy_info)),
+               .help          = policy_help,
+               .parse         = policy6_parse,
+               .final_check   = policy_check,
+               .print         = policy6_print,
+               .save          = policy6_save,
+               .extra_opts    = policy_opts,
+       },
 };
 
 void _init(void)
 {
-       xtables_register_match(&policy_mt_reg);
-       xtables_register_match(&policy_mt6_reg);
+       xtables_register_matches(policy_mt_reg, ARRAY_SIZE(policy_mt_reg));
 }
index 18e3ed258fac4eb7aefcdb07fadd0f8ba769a946..62c3a97a61ff18b15c67b67615331277ee00308b 100644 (file)
@@ -350,40 +350,40 @@ static void string_save(const void *ip, const struct xt_entry_match *match)
 }
 
 
-static struct xtables_match string_match = {
-    .name              = "string",
-    .revision          = 0,
-    .family            = NFPROTO_UNSPEC,
-    .version           = XTABLES_VERSION,
-    .size              = XT_ALIGN(sizeof(struct xt_string_info)),
-    .userspacesize     = offsetof(struct xt_string_info, config),
-    .help              = string_help,
-    .init              = string_init,
-    .parse             = string_parse,
-    .final_check       = string_check,
-    .print             = string_print,
-    .save              = string_save,
-    .extra_opts                = string_opts,
-};
-
-static struct xtables_match string_match_v1 = {
-    .name              = "string",
-    .revision          = 1,
-    .family            = NFPROTO_UNSPEC,
-    .version           = XTABLES_VERSION,
-    .size              = XT_ALIGN(sizeof(struct xt_string_info)),
-    .userspacesize     = offsetof(struct xt_string_info, config),
-    .help              = string_help,
-    .init              = string_init,
-    .parse             = string_parse,
-    .final_check       = string_check,
-    .print             = string_print,
-    .save              = string_save,
-    .extra_opts                = string_opts,
+static struct xtables_match string_mt_reg[] = {
+       {
+               .name          = "string",
+               .revision      = 0,
+               .family        = NFPROTO_UNSPEC,
+               .version       = XTABLES_VERSION,
+               .size          = XT_ALIGN(sizeof(struct xt_string_info)),
+               .userspacesize = offsetof(struct xt_string_info, config),
+               .help          = string_help,
+               .init          = string_init,
+               .parse         = string_parse,
+               .final_check   = string_check,
+               .print         = string_print,
+               .save          = string_save,
+               .extra_opts    = string_opts,
+       },
+       {
+               .name          = "string",
+               .revision      = 1,
+               .family        = NFPROTO_UNSPEC,
+               .version       = XTABLES_VERSION,
+               .size          = XT_ALIGN(sizeof(struct xt_string_info)),
+               .userspacesize = offsetof(struct xt_string_info, config),
+               .help          = string_help,
+               .init          = string_init,
+               .parse         = string_parse,
+               .final_check   = string_check,
+               .print         = string_print,
+               .save          = string_save,
+               .extra_opts    = string_opts,
+       },
 };
 
 void _init(void)
 {
-       xtables_register_match(&string_match);
-       xtables_register_match(&string_match_v1);
+       xtables_register_matches(string_mt_reg, ARRAY_SIZE(string_mt_reg));
 }
index 1f7b2cd0d015029cde8aabc6fb4b7fd53a416a4e..0a81f4617a5cc8b4348dc185cb7eab12646018b4 100644 (file)
@@ -137,38 +137,38 @@ static void tos_mt_save(const void *ip, const struct xt_entry_match *match)
        printf("--tos 0x%02x/0x%02x ", info->tos_value, info->tos_mask);
 }
 
-static struct xtables_match tos_mt_reg_v0 = {
-       .version       = XTABLES_VERSION,
-       .name          = "tos",
-       .family        = NFPROTO_IPV4,
-       .revision      = 0,
-       .size          = XT_ALIGN(sizeof(struct ipt_tos_info)),
-       .userspacesize = XT_ALIGN(sizeof(struct ipt_tos_info)),
-       .help          = tos_mt_help,
-       .parse         = tos_mt_parse_v0,
-       .final_check   = tos_mt_check,
-       .print         = tos_mt_print_v0,
-       .save          = tos_mt_save_v0,
-       .extra_opts    = tos_mt_opts,
-};
-
-static struct xtables_match tos_mt_reg = {
-       .version       = XTABLES_VERSION,
-       .name          = "tos",
-       .family        = NFPROTO_UNSPEC,
-       .revision      = 1,
-       .size          = XT_ALIGN(sizeof(struct xt_tos_match_info)),
-       .userspacesize = XT_ALIGN(sizeof(struct xt_tos_match_info)),
-       .help          = tos_mt_help,
-       .parse         = tos_mt_parse,
-       .final_check   = tos_mt_check,
-       .print         = tos_mt_print,
-       .save          = tos_mt_save,
-       .extra_opts    = tos_mt_opts,
+static struct xtables_match tos_mt_reg[] = {
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "tos",
+               .family        = NFPROTO_IPV4,
+               .revision      = 0,
+               .size          = XT_ALIGN(sizeof(struct ipt_tos_info)),
+               .userspacesize = XT_ALIGN(sizeof(struct ipt_tos_info)),
+               .help          = tos_mt_help,
+               .parse         = tos_mt_parse_v0,
+               .final_check   = tos_mt_check,
+               .print         = tos_mt_print_v0,
+               .save          = tos_mt_save_v0,
+               .extra_opts    = tos_mt_opts,
+       },
+       {
+               .version       = XTABLES_VERSION,
+               .name          = "tos",
+               .family        = NFPROTO_UNSPEC,
+               .revision      = 1,
+               .size          = XT_ALIGN(sizeof(struct xt_tos_match_info)),
+               .userspacesize = XT_ALIGN(sizeof(struct xt_tos_match_info)),
+               .help          = tos_mt_help,
+               .parse         = tos_mt_parse,
+               .final_check   = tos_mt_check,
+               .print         = tos_mt_print,
+               .save          = tos_mt_save,
+               .extra_opts    = tos_mt_opts,
+       },
 };
 
 void _init(void)
 {
-       xtables_register_match(&tos_mt_reg_v0);
-       xtables_register_match(&tos_mt_reg);
+       xtables_register_matches(tos_mt_reg, ARRAY_SIZE(tos_mt_reg));
 }