Skip to content

Support wildcard netdev hooks and events

Phil Sutter netfilter-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4include: utils.h needs errno.hinclude/utils.h+1 -00 replies
2/4utils: Add helpers for interface name wildcardsinclude/utils.h src/chain.c src/flowtable.c +1 more+50 -100 replies
3/4utils: Introduce nftnl_parse_str_attr()include/utils.h src/chain.c src/expr/dynset.c +12 more+106 -1710 replies
4/4device: Introduce nftnl_deviceinclude/libnftnl/Makefile.am include/libnftnl/device.h include/linux/netfilter/nf_tables.h +3 more+212 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [libnftnl PATCH 0/4] Support wildcard netdev hooks and events

This series is the first step of enabling support for name-based and wildcard interface hooks in user space. A following series for nftables depends on this one.

Patch 1 is fallout, noticed when checking for minimal #include statements in a new source file.

Patch 2 introduces helpers to convert wildcards from user representation ("eth*") to kernel ("eth" len 3) and back. Note that nftables does not use the serialization part of this since it needs the offsets for location information.

Patch 3 introduces a helper I wrote for the code in patch 4, but puts it into a common spot for use in many source files.

Patch 4 finally implements deserialization for NFT_MSG_(NEW|DEL)DEV payloads. This is a bit of pointless overhead since nftables will use it in monitor code only, but I didn't want to bypass the standard integration entirely and fiddle with libmnl in there directly.

Phil Sutter (4):
include: utils.h needs errno.h
utils: Add helpers for interface name wildcards
utils: Introduce nftnl_parse_str_attr()
device: Introduce nftnl_device

 include/libnftnl/Makefile.am        |   1 +
 include/libnftnl/device.h           |  39 +++++++
 include/linux/netfilter/nf_tables.h |   8 ++
 include/utils.h                     |   8 ++
 src/Makefile.am                     |   1 +
 src/chain.c                         |  49 ++++-----
 src/device.c                        | 153 ++++++++++++++++++++++++++++
 src/expr/dynset.c                   |  12 +--
 src/expr/flow_offload.c             |  12 +--
 src/expr/log.c                      |  13 +--
 src/expr/lookup.c                   |  12 +--
 src/expr/objref.c                   |  18 ++--
 src/flowtable.c                     |  34 +++----
 src/libnftnl.map                    |  10 ++
 src/object.c                        |  14 ++-
 src/rule.c                          |  22 ++--
 src/set.c                           |  22 ++--
 src/set_elem.c                      |  38 +++----
 src/table.c                         |  11 +-
 src/trace.c                         |  28 ++---
 src/utils.c                         |  45 ++++++++
 21 files changed, 369 insertions(+), 181 deletions(-)
 create mode 100644 include/libnftnl/device.h
 create mode 100644 src/device.c
Signature · 1 line
2.43.0