From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: phil@nwl.cc
Subject: [PATCH libnftnl 0/3] add description infrastructure
Date: Thu, 20 Jan 2022 01:03:59 +0100 [thread overview]
Message-ID: <20220120000402.916332-1-pablo@netfilter.org> (raw)
Hi Phil,
This is my proposal to address the snprintf data printing depending on
the arch. The idea is to add description objects that can be used to
build the userdata area as well as to parse the userdata to create the
description object.
This is revisiting 6e48df5329ea ("src: add "typeof" build/parse/print
support") in nftables which adds build and parse userdata callbacks to
expression in libnftables. My proposal is to move this to libnftnl.
This allows to consolidate codebase to address two different usecases:
- you can pass the description object to the snprintf function.
- it provides helpers to build and to parse the userdata area. The
userdata TLV attributes do not need to be exposed through
libnftnl/udata.h anymore, instead users can just rely on these helper
functions.
The userdata area has been extended with new attributes, but it is still
incomplete since it does not allow to represent a concatenation.
Note that this will also allow us to deprecate NFTA_SET_DATA_TYPE at
some point (this netlink attribute represents a concatenation using 6
bits of the 32-bit integer, hence limiting concatenations to 5
components at this stage).
I'm afraid we'll also have to keep the existing userdata attributes
added by 6e48df5329ea in nftables for a little while (at least the
parser functions), so nftables does not break on updates since my
userdata TLV coming in this patchset for libnftnl is different than the
one available at 6e48df5329ea.
Please also note that nftables needs to be updated to use this
infrastructure.
My proposal follows a longer route but it will allow to addressing a
number of existing shortcomings in the set infrastrcture.
This is compile-tested only.
Pablo Neira Ayuso (3):
desc: add expression description
desc: add datatype description
desc: add set description
include/Makefile.am | 1 +
include/desc.h | 50 +++
include/expr_ops.h | 11 +
include/internal.h | 1 +
include/libnftnl/Makefile.am | 1 +
include/libnftnl/desc.h | 107 +++++++
include/libnftnl/udata.h | 18 +-
src/Makefile.am | 1 +
src/desc.c | 598 +++++++++++++++++++++++++++++++++++
src/expr/payload.c | 81 +++++
src/expr_ops.c | 13 +
11 files changed, 875 insertions(+), 7 deletions(-)
create mode 100644 include/desc.h
create mode 100644 include/libnftnl/desc.h
create mode 100644 src/desc.c
--
2.30.2
next reply other threads:[~2022-01-20 0:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-20 0:03 Pablo Neira Ayuso [this message]
2022-01-20 0:04 ` [PATCH libnftnl 1/3] desc: add expression description Pablo Neira Ayuso
2022-01-20 0:04 ` [PATCH libnftnl 2/3] desc: add datatype description Pablo Neira Ayuso
2022-01-20 0:04 ` [PATCH libnftnl 3/3] desc: add set description Pablo Neira Ayuso
2022-03-10 11:31 ` Phil Sutter
2022-03-10 23:24 ` Pablo Neira Ayuso
2022-03-11 14:03 ` Phil Sutter
2022-03-10 11:35 ` [PATCH libnftnl 0/3] add description infrastructure Phil Sutter
2022-03-10 23:28 ` Pablo Neira Ayuso
2022-04-06 11:06 ` Phil Sutter
2022-04-06 11:57 ` Pablo Neira Ayuso
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=20220120000402.916332-1-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=phil@nwl.cc \
/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.