diff options
author | Phil Sutter <phil@nwl.cc> | 2024-10-01 12:59:29 +0200 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2025-09-30 23:02:32 +0200 |
commit | f30eae26d813e54897caa1def6501d662dd79228 (patch) | |
tree | 4623427758b9224d3ecbc6cd0f65d141d5f017b3 /include | |
parent | eb8fb569c501dc088dc950061369102687f8d2a5 (diff) |
Support simple (suffix) wildcards in NFTNL_{CHAIN,FLOWTABLE}_DEVICES
identified by NFTA_DEVICE_PREFIX attribute. Add helpers converting to
and from the human-readable asterisk-suffix notation.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netfilter/nf_tables.h | 2 | ||||
-rw-r--r-- | include/utils.h | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/netfilter/nf_tables.h b/include/linux/netfilter/nf_tables.h index 2beb30b..8e0eb83 100644 --- a/include/linux/netfilter/nf_tables.h +++ b/include/linux/netfilter/nf_tables.h @@ -1784,10 +1784,12 @@ enum nft_synproxy_attributes { * enum nft_device_attributes - nf_tables device netlink attributes * * @NFTA_DEVICE_NAME: name of this device (NLA_STRING) + * @NFTA_DEVICE_PREFIX: device name prefix, a simple wildcard (NLA_STRING) */ enum nft_devices_attributes { NFTA_DEVICE_UNSPEC, NFTA_DEVICE_NAME, + NFTA_DEVICE_PREFIX, __NFTA_DEVICE_MAX }; #define NFTA_DEVICE_MAX (__NFTA_DEVICE_MAX - 1) diff --git a/include/utils.h b/include/utils.h index 247d99d..5a3379f 100644 --- a/include/utils.h +++ b/include/utils.h @@ -83,4 +83,9 @@ int nftnl_fprintf(FILE *fpconst, const void *obj, uint32_t cmd, uint32_t type, int nftnl_set_str_attr(const char **dptr, uint32_t *flags, uint16_t attr, const void *data, uint32_t data_len); +struct nlattr; + +void nftnl_attr_put_ifname(struct nlmsghdr *nlh, const char *ifname); +char *nftnl_attr_get_ifname(const struct nlattr *attr); + #endif |