From 7a0992da44cfb6cab0ccd1beadcf326df8773552 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 24 Jul 2016 12:45:53 +0200 Subject: src: introduce struct xt_xlate_{mt,tg}_params This structure is an extensible containers of parameters, so we don't need to propagate interface updates in every extension file in case we need to add new parameters in the future. Signed-off-by: Pablo Neira Ayuso --- include/xtables.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/xtables.h b/include/xtables.h index 48be5140..9701612a 100644 --- a/include/xtables.h +++ b/include/xtables.h @@ -207,6 +207,18 @@ enum xtables_ext_flags { struct xt_xlate; +struct xt_xlate_mt_params { + const void *ip; + const struct xt_entry_match *match; + int numeric; +}; + +struct xt_xlate_tg_params { + const void *ip; + const struct xt_entry_target *target; + int numeric; +}; + /* Include file for additions: new matches and targets. */ struct xtables_match { @@ -272,8 +284,8 @@ struct xtables_match const struct xt_option_entry *x6_options; /* Translate iptables to nft */ - int (*xlate)(const void *ip, const struct xt_entry_match *match, - struct xt_xlate *xl, int numeric); + int (*xlate)(struct xt_xlate *xl, + const struct xt_xlate_mt_params *params); /* Size of per-extension instance extra "global" scratch space */ size_t udata_size; @@ -353,8 +365,8 @@ struct xtables_target const struct xt_option_entry *x6_options; /* Translate iptables to nft */ - int (*xlate)(const void *ip, const struct xt_entry_target *target, - struct xt_xlate *xl, int numeric); + int (*xlate)(struct xt_xlate *xl, + const struct xt_xlate_tg_params *params); size_t udata_size; -- cgit v1.2.3