All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gargi Sharma <gs051095@gmail.com>
To: Florian Westphal <fw@strlen.de>
Cc: gsoc2013@lists.netfilter.org,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	netfilter-devel@vger.kernel.org
Subject: Re: [RFC] extensions: libxt_TOS: Add translation to nft
Date: Tue, 28 Mar 2017 22:53:05 +0530	[thread overview]
Message-ID: <CAOCi2DFLTJ=UvnsWep7c4vtMtBJZB=iZQzUJ35iVVX+CBaD2GQ@mail.gmail.com> (raw)
In-Reply-To: <20170328155207.GA18679@breakpoint.cc>

On Tue, Mar 28, 2017 at 9:22 PM, Florian Westphal <fw@strlen.de> wrote:
> Gargi Sharma <gs051095@gmail.com> wrote:
>> Add translation for TOS to nftables.
>>
>> Examples:
>>
>> $ iptables-translate -t mangle -A PREROUTING -p TCP --dport 22 -j TOS --set-tos 0x10
>> nft add rule ip mangle PREROUTING tcp dport 22 counter --set-tos 0x10/0xff
>>
>> $ iptables-translate -A PREROUTING -t mangle -p tcp --sport ftp-data -j TOS --set-tos 0x02/0x10
>> nft add rule ip mangle PREROUTING tcp sport 20 counter --set-tos 0x02/0x10
>
> You did not test this :-/
>
Sorry! I realised this after sending this patch.

> nft add rule ip mangle PREROUTING tcp sport 20 counter --set-tos 0x02/0x10
> nft: unrecognized option '--set-tos'
>
> besides, there is no TOS support in nftables.
> Please look at xt_DSCP.c and the xlate function there.
>
>From what I gather, the first 6 bits are used for DSCP and the last 2 for ecn.
Should I write both dscp and ecn equivalent for the TOS specified?

Thanks,
Gargi
> You could rewrite -j TOS iptables rules to their corresponding dscp
> eqivalent in some cases at least.

      reply	other threads:[~2017-03-28 17:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-28 15:46 [RFC] extensions: libxt_TOS: Add translation to nft Gargi Sharma
2017-03-28 15:52 ` Florian Westphal
2017-03-28 17:23   ` Gargi Sharma [this message]

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='CAOCi2DFLTJ=UvnsWep7c4vtMtBJZB=iZQzUJ35iVVX+CBaD2GQ@mail.gmail.com' \
    --to=gs051095@gmail.com \
    --cc=fw@strlen.de \
    --cc=gsoc2013@lists.netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /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.