From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: pablombg@gmail.com
Subject: [PATCH nft] xt: use struct xt_xlate_{mt,tg}_params
Date: Sun, 24 Jul 2016 12:55:51 +0200 [thread overview]
Message-ID: <1469357751-17414-1-git-send-email-pablo@netfilter.org> (raw)
Adapt this code to the new interface that introduces
struct xt_xlate_{mt,tg}_params.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/xt.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/xt.c b/src/xt.c
index afcc836..0777d9c 100644
--- a/src/xt.c
+++ b/src/xt.c
@@ -35,9 +35,14 @@ void xt_stmt_xlate(const struct stmt *stmt)
if (stmt->xt.match == NULL && stmt->xt.opts) {
printf("%s", stmt->xt.opts);
} else if (stmt->xt.match->xlate) {
- stmt->xt.match->xlate(stmt->xt.entry,
- stmt->xt.match->m, xl, 0);
- printf("%s", xt_xlate_get(xl));
+ struct xt_xlate_mt_params params = {
+ .ip = stmt->xt.entry,
+ .match = stmt->xt.match->m,
+ .numeric = 0,
+ };
+
+ stmt->xt.match->xlate(xl, ¶ms);
+ printf("%s", xt_xlate_get(xl));
} else if (stmt->xt.match->print) {
printf("#");
stmt->xt.match->print(&stmt->xt.entry,
@@ -49,8 +54,13 @@ void xt_stmt_xlate(const struct stmt *stmt)
if (stmt->xt.target == NULL && stmt->xt.opts) {
printf("%s", stmt->xt.opts);
} else if (stmt->xt.target->xlate) {
- stmt->xt.target->xlate(stmt->xt.entry,
- stmt->xt.target->t, xl, 0);
+ struct xt_xlate_tg_params params = {
+ .ip = stmt->xt.entry,
+ .target = stmt->xt.target->t,
+ .numeric = 0,
+ };
+
+ stmt->xt.target->xlate(xl, ¶ms);
printf("%s", xt_xlate_get(xl));
} else if (stmt->xt.target->print) {
printf("#");
--
2.1.4
reply other threads:[~2016-07-24 10:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1469357751-17414-1-git-send-email-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablombg@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).