netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laura Garcia <nevola@gmail.com>
To: "Serguei Bezverkhi (sbezverk)" <sbezverk@cisco.com>
Cc: "netfilter-devel@vger.kernel.org" <netfilter-devel@vger.kernel.org>
Subject: Re: nftables and set with interval
Date: Thu, 8 Aug 2019 15:18:36 +0200	[thread overview]
Message-ID: <CAF90-WhmQ3s2dhVSqHX0woC6eVXBNja3Qnm6Ma0HhHLozU3zSg@mail.gmail.com> (raw)
In-Reply-To: <554E4490-524C-48D3-834A-F98F3D15D807@cisco.com>

On Thu, Aug 8, 2019 at 1:56 PM Serguei Bezverkhi (sbezverk)
<sbezverk@cisco.com> wrote:
>
> Hello,
>
> I am developing golang nftables libraryI am debugging nftables set with elements defining intervals. I compare what gets generated by nfl command and strace of my code.
>
> Based on the output of this command:
>
> sudo nft --debug all add rule ipv4table ipv4chain-1  ip daddr { 192.16.0.0/16, 10.16.0.0/16 } return
>
> It seems nft sets up NFTNL_SET_KEY_TYPE  (0x4) as 0x2 and I cannot find anywhere what it means.
> {{nla_len=8, nla_type=0x4}, "\x00\x00\x00\x02"},
>
> When I decode strace generated for my code, it always gets set to x01
> {{nla_len=8, nla_type=0x4}, "\x00\x00\x00\x01"},
>

Hi, are you interacting directly with netlink?
Did you consider using the higher level library libnftables instead?

Cheers.

  reply	other threads:[~2019-08-08 13:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-08 11:47 nftables and set with interval Serguei Bezverkhi (sbezverk)
2019-08-08 13:18 ` Laura Garcia [this message]
2019-08-08 13:32   ` Serguei Bezverkhi (sbezverk)
2019-08-08 16:08   ` Serguei Bezverkhi (sbezverk)

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=CAF90-WhmQ3s2dhVSqHX0woC6eVXBNja3Qnm6Ma0HhHLozU3zSg@mail.gmail.com \
    --to=nevola@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=sbezverk@cisco.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).