ethnl_put_bitset32(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ethnl_put_bitset32 β€” like, the kernel API manual, bestie πŸ’…

okay so this is a page from the Kernel API Manual (section 9, the kernel devs' own little corner) and it's about ethnl_put_bitset32, which puts a bitset nest into a message. yes that's a real sentence. no I will not calm down. πŸŽ€


✨ NAME ✨

ethnl_put_bitset32 β€” put a bitset nest into a message 🫢


🌸 SYNOPSIS 🌸

int ethnl_put_bitset32 (struct sk_buff *skb , int attrtype , const u32
*val , const u32 *mask , unsigned int nbits , ethnl_string_array_t names
, bool compact );

like literally just look at it. that's the whole function signature. iconic behaviour honestly ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • skb β€” the skb that's carrying your message πŸ’Œ
  • attrtype β€” the attribute type for the bitset nest
  • val β€” the value bitmap (u32 based, bestie, u32 based)
  • mask β€” the mask bitmap (u32 based, and it's optional β€” no pressure πŸ’…)
  • nbits β€” the bit length of the bitset
  • names β€” an array of bit names (optional, again, we're chill)
  • compact β€” use the compact format for the output πŸŽ€

πŸ’– DESCRIPTION πŸ’–

so what this does is compose a nested attribute that represents a bitset. that's the whole vibe.

here's the tea though, and this part matters so listen:

  • if mask is null ➑️ a simple bitmap (bit list) gets created
  • if mask is provided ➑️ you're representing a value/mask pair

and the bit names? they're only used in verbose mode, and only when they're actually provided by the caller. so like, don't stress if you didn't bring names to the function β€” it's giving "optional for a reason" ✨


πŸ”₯ RETURN πŸ”₯

  • 0 on success πŸŽ‰
  • a negative error value on error 😭

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./net/ethtool/bitset.c (yes, the actual file, go read it iykwim) and these absolute legends:


ngl the manpage also credits ./net/ethtool as the source and slaps October 2026 on it as the date, so like… mark your calendars bestie πŸ—“οΈπŸ’€

anyway that's the whole page, you ate it, go forth and nest those bitsets πŸ’…πŸŒΈπŸ’–

πŸ“¦ where this page comes from