summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_conntrack.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2016-07-24 12:45:53 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2016-07-25 17:24:55 +0200
commit7a0992da44cfb6cab0ccd1beadcf326df8773552 (patch)
tree121e927b4171f4aacfafc268fb4104ab90b4ea2a /extensions/libxt_conntrack.c
parentd89e5c0c84778a4effa40f69dbd3a68d0ec284fc (diff)
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 <pablo@netfilter.org>
Diffstat (limited to 'extensions/libxt_conntrack.c')
-rw-r--r--extensions/libxt_conntrack.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/extensions/libxt_conntrack.c b/extensions/libxt_conntrack.c
index 4f3853c0..72c52200 100644
--- a/extensions/libxt_conntrack.c
+++ b/extensions/libxt_conntrack.c
@@ -1182,10 +1182,11 @@ static void state_xlate_print(struct xt_xlate *xl, unsigned int statemask)
}
}
-static int state_xlate(const void *ip, const struct xt_entry_match *match,
- struct xt_xlate *xl, int numeric)
+static int state_xlate(struct xt_xlate *xl,
+ const struct xt_xlate_mt_params *params)
{
- const struct xt_conntrack_mtinfo3 *sinfo = (const void *)match->data;
+ const struct xt_conntrack_mtinfo3 *sinfo =
+ (const void *)params->match->data;
xt_xlate_add(xl, "ct state %s", sinfo->invert_flags & XT_CONNTRACK_STATE ?
"!= " : "");
@@ -1230,12 +1231,12 @@ static void addr_xlate_print(struct xt_xlate *xl,
}
}
-static int _conntrack3_mt_xlate(const void *ip,
- const struct xt_entry_match *match,
- struct xt_xlate *xl, int numeric,
+static int _conntrack3_mt_xlate(struct xt_xlate *xl,
+ const struct xt_xlate_mt_params *params,
int family)
{
- const struct xt_conntrack_mtinfo3 *sinfo = (const void *)match->data;
+ const struct xt_conntrack_mtinfo3 *sinfo =
+ (const void *)params->match->data;
char *space = "";
if (sinfo->match_flags & XT_CONNTRACK_DIRECTION) {
@@ -1383,18 +1384,16 @@ static int _conntrack3_mt_xlate(const void *ip,
return 1;
}
-static int conntrack3_mt4_xlate(const void *ip,
- const struct xt_entry_match *match,
- struct xt_xlate *xl, int numeric)
+static int conntrack3_mt4_xlate(struct xt_xlate *xl,
+ const struct xt_xlate_mt_params *params)
{
- return _conntrack3_mt_xlate(ip, match, xl, numeric, NFPROTO_IPV4);
+ return _conntrack3_mt_xlate(xl, params, NFPROTO_IPV4);
}
-static int conntrack3_mt6_xlate(const void *ip,
- const struct xt_entry_match *match,
- struct xt_xlate *xl, int numeric)
+static int conntrack3_mt6_xlate(struct xt_xlate *xl,
+ const struct xt_xlate_mt_params *params)
{
- return _conntrack3_mt_xlate(ip, match, xl, numeric, NFPROTO_IPV6);
+ return _conntrack3_mt_xlate(xl, params, NFPROTO_IPV6);
}
static struct xtables_match conntrack_mt_reg[] = {