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 -- 2.43.0