diff options
| author | Ishan Agrawal <iagrawal9990@gmail.com> | 2026-08-08 05:39:48 +0000 |
|---|---|---|
| committer | Kristof Provost <kp@FreeBSD.org> | 2026-08-10 14:33:31 +0000 |
| commit | 91aa9bf0ae169fafe4c5ec8578d28733d2fab85c (patch) | |
| tree | 6bf27d0fec1ae5c135022d197145af4125f49a66 | |
| parent | 1d926be8824a8cbf620dc12a5f9fe5623930bfd0 (diff) | |
libsysdecode : add attribute parsing for PFNL_CMD_GET_LIMIT
Signed-off-by: Ishan Agrawal <iagrawal9990@gmail.com>
Sponsored-by: Google LLC (GSoC 2026)
Reviewed by: kp
| -rw-r--r-- | lib/libsysdecode/netlink.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libsysdecode/netlink.c b/lib/libsysdecode/netlink.c index 1d6200980c9e..b8c657b1b4e1 100644 --- a/lib/libsysdecode/netlink.c +++ b/lib/libsysdecode/netlink.c @@ -237,6 +237,12 @@ nl_decode_attrs_raw(FILE *fp, const struct nlattr *nla_head, size_t len, fprintf(fp, "}"); } +static const struct nlattr_decoder nla_d_set_limit[] = { + { .type = PF_LI_INDEX, .attr_name = "index", .cb = nlattr_decode_uint32 }, + { .type = PF_LI_LIMIT, .attr_name = "limit", .cb = nlattr_decode_uint32 }, +}; +NL_DECLARE_ATTR_DECODER(set_limit_decoder, nla_d_set_limit); + static const struct nlattr_decoder nla_d_addr_wrap[] = { { .type = PF_AT_ADDR, .attr_name = "addr", .cb = nlattr_decode_in6_addr }, { .type = PF_AT_MASK, .attr_name = "mask", .cb = nlattr_decode_in6_addr }, @@ -307,6 +313,10 @@ sysdecode_netlink_pf(FILE *fp, const struct genlmsghdr *genl, size_t nlm_len) ((const char *)genl + sizeof(struct genlmsghdr)); switch (cmd) { + case PFNL_CMD_GET_LIMIT: + nl_decode_attrs_raw(fp, nla, nlm_len, + set_limit_decoder.decoders, set_limit_decoder.count); + break; case PFNL_CMD_GET_ADDR: nl_decode_attrs_raw(fp, nla, nlm_len, addr_decoder.decoders, addr_decoder.count); |
