nlmsg(3)

πŸ“¦
version 1.0.5 Β· 4 versions
, in ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

okay so bestie, welcome to nlmsg, the Netlink message helper functions from the libnetfilter_queue manual, section 3 (that's the library functions section, iykyk). this is a lil' page, only two functions, but they're lowkey doing the Lord's work. let's get into it ✨


🌸 NAME 🌸

nlmsg β€” Netlink message helper functions. that's it, that's the whole vibe. two little helpers that make Netlink messages behave. πŸ¦‹


✨ SYNOPSIS ✨

πŸŽ€ Functions πŸŽ€

here's the lineup, no notes:

int nfq_nlmsg_parse (const struct nlmsghdr *nlh, struct nlattr **attr)
struct nlmsghdr * nfq_nlmsg_put (char *buf, int type, uint32_t queue_num)

two baddies. one parses, one puts. balance. 🌈


πŸ’… Detailed Description πŸ’…

so like, the detailed description section is literally just the function documentation chilling below it. no extra lore. the real content is in the functions themselves, so let's go 🫢


πŸ‘‘ Function Documentation πŸ‘‘

⭐ int nfq_nlmsg_parse (const struct nlmsghdr * nlh, struct nlattr ** attr)

nfq_nlmsg_parse β€” it sets packet attributes from a netlink message. like, you hand it the message, it fills in your attribute array. main character energy fr fr. πŸ’«

Parameters

  • nlh β€” Pointer to netlink message. yes bestie, that message.
  • attr β€” Pointer to array of attributes to set. it's gonna write into this one, so have it ready. πŸ™ˆ

Returns

  • MNL_CB_OK on success πŸ’š β€” slay.
  • MNL_CB_ERROR if any error occurs 😭 β€” not slay, but at least you know.
Definition at line 269 of file nlmsg.c. πŸ“ noted, bestie, don't lose it.

⭐ struct nlmsghdr * nfq_nlmsg_put (char * buf, int type, uint32_t queue_num)

nfq_nlmsg_put β€” it converts a memory buffer into a Netlink buffer. glow-up but for bytes. ✨

Parameters

  • *buf β€” Pointer to memory buffer. the before picture. πŸŽ€
  • type β€” Either NFQNL_MSG_CONFIG or NFQNL_MSG_VERDICT. pick one, bestie, those are your two options, no cap. πŸ¦‹
  • queue_num β€” Queue number. the queue in question. πŸ’œ

Returns

  • Pointer to netlink message. that's the after picture. iconic. πŸ‘‘
Definition at line 283 of file nlmsg.c. πŸ“ second bookmark, you're welcome.

🌸 Author 🌸

Generated automatically by Doxygen for libnetfilter_queue from the source code. so technically Doxygen wrote this, I just gave it a makeover. πŸ’…


and that's the whole page, bestie!! this is from libnetfilter_queue, Version 1.0.5, and it's the nlmsg(3) page in the library functions manual β€” dated right there with that version, so if you're reading this, you're on 1.0.5 era. go forth and parse those netlink messages, you absolute legend πŸ«Άβœ¨πŸ’–πŸŽ€πŸ¦‹πŸŒΈ