All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Pilcher <arequipeno@gmail.com>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: RFD - Exposing netfilter types?
Date: Tue, 16 Dec 2025 10:05:25 -0600	[thread overview]
Message-ID: <75e0de0a-14da-415b-b336-ae84fc896be1@gmail.com> (raw)
In-Reply-To: <aUCBAau7DREw8YmD@strlen.de>

On 12/15/25 3:43 PM, Florian Westphal wrote:
> Ian Pilcher <arequipeno@gmail.com> wrote:
>> Recently, I asked what I thought would be a simple question.  How should
>> Presumably, this is why the NFTA_SET_KEY_TYPE values that correspond to
>> simple types aren't in any public header.  Instead, those values, along
>> with all of the logic associated with complex types seem to exist solely
>> within the nftables user-space utility (nft).
> 
> Yes.  Note that the type info is only used for formatting the data.
> Its not used by the kernel and its not relevant for matching.

Yup.  I understand that this is totally a user-space/informational
thing.

>> Is there any reason that the type-related stuff that's currently in nft
>> shouldn't be broken out into a separate library that other applications
>> could also use?
> 
> Whats the use case?

My immediate use case is really simple.  I just want to verify that a
set (identified type table & name) holds either IPv4 or IPv6 addresses.
Obviously, there's no need for a library for this, as I only need the
values of TYPE_IPADDR and TYPE_IP6ADDR.

For more complicated uses, it actually looks like libnftables can be
used.  (I was not aware that the nftables package actually includes a
shared library until I stumbled on it just now.)  I will say that it
might be nice to have an API that doesn't require using the JSON
interface, for programs that are using the netlink inteface more
directly (e.g. via libnftnl).

Overall, however, it looks like libnftables basically addresses the use
cases that I was thinking of.

Thanks!

-- 
========================================================================
If your user interface is intuitive in retrospect ... it isn't intuitive
========================================================================

      reply	other threads:[~2025-12-16 16:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-12 20:13 RFD - Exposing netfilter types? Ian Pilcher
2025-12-15 21:43 ` Florian Westphal
2025-12-16 16:05   ` Ian Pilcher [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=75e0de0a-14da-415b-b336-ae84fc896be1@gmail.com \
    --to=arequipeno@gmail.com \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.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.