git: 91aa9bf0ae16 - main - libsysdecode : add attribute parsing for PFNL_CMD_GET_LIMIT
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 10 Aug 2026 14:34:18 UTC
The branch main has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=91aa9bf0ae169fafe4c5ec8578d28733d2fab85c
commit 91aa9bf0ae169fafe4c5ec8578d28733d2fab85c
Author: Ishan Agrawal <iagrawal9990@gmail.com>
AuthorDate: 2026-08-08 05:39:48 +0000
Commit: Kristof Provost <kp@FreeBSD.org>
CommitDate: 2026-08-10 14:33:31 +0000
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
---
lib/libsysdecode/netlink.c | 10 ++++++++++
1 file changed, 10 insertions(+)
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);