git: 91aa9bf0ae16 - main - libsysdecode : add attribute parsing for PFNL_CMD_GET_LIMIT

Kristof Provost <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a79e16a.249db.74faad19__45974.0073348925$1786372490$gmane$org@gitrepo.freebsd.org>
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=91aa9bf0ae169fafe4c5ec8578d28733d2fab85c

commit 91aa9bf0ae169fafe4c5ec8578d28733d2fab85c
Author:     Ishan Agrawal <[email protected]>
AuthorDate: 2026-08-08 05:39:48 +0000
Commit:     Kristof Provost <[email protected]>
CommitDate: 2026-08-10 14:33:31 +0000

    libsysdecode : add attribute parsing for PFNL_CMD_GET_LIMIT
    
    Signed-off-by:  Ishan Agrawal <[email protected]>
    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);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.