From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Shivani Bhardwaj <shivanib134@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] extensions: libxt_helper: Add translation to nft
Date: Wed, 23 Dec 2015 11:01:58 +0100 [thread overview]
Message-ID: <20151223100158.GA1952@salvia> (raw)
In-Reply-To: <20151223095347.GA5866@gmail.com>
On Wed, Dec 23, 2015 at 03:23:47PM +0530, Shivani Bhardwaj wrote:
> Add translation for helper module to nftables.
>
> Examples:
>
> $ sudo iptables-translate -A FORWARD -m helper --helper sip
> nft add rule ip filter FORWARD ct helper \"sip\" counter
>
> $ sudo iptables-translate -A FORWARD -m helper ! --helper ftp
> nft add rule ip filter FORWARD ct helper != \"ftp\" counter
>
> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
> ---
> extensions/libxt_helper.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/extensions/libxt_helper.c b/extensions/libxt_helper.c
> index c9f9435..5f1d8b1 100644
> --- a/extensions/libxt_helper.c
> +++ b/extensions/libxt_helper.c
> @@ -45,6 +45,19 @@ static void helper_save(const void *ip, const struct xt_entry_match *match)
> xtables_save_string(info->name);
> }
>
> +static int helper_xlate(const struct xt_entry_match *match,
> + struct xt_buf *buf, int numeric)
> +{
> + const struct xt_helper_info *info = (const void *)match->data;
> +
> + xt_buf_add(buf, "ct helper");
> +
> + xt_buf_add(buf, "%s \\\"%s\\\" ",
> + info->invert ? " !=" : "", info->name);
You can place this in one single call of xt_buf_add(), right?
next prev parent reply other threads:[~2015-12-23 10:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 9:53 [PATCH] extensions: libxt_helper: Add translation to nft Shivani Bhardwaj
2015-12-23 10:01 ` Pablo Neira Ayuso [this message]
2015-12-23 10:02 ` Shivani Bhardwaj
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=20151223100158.GA1952@salvia \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=shivanib134@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.