From f2a77520693f0a6dd1df1f87be4b81913961c1f5 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 25 Jun 2009 20:12:12 +0200 Subject: extensions: collapse data variables to use multi-reg calls Signed-off-by: Jan Engelhardt --- extensions/libxt_tos.c | 60 +++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'extensions/libxt_tos.c') diff --git a/extensions/libxt_tos.c b/extensions/libxt_tos.c index 1f7b2cd0..0a81f461 100644 --- a/extensions/libxt_tos.c +++ b/extensions/libxt_tos.c @@ -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)); } -- cgit v1.2.3