UNION NFT_PIPAPO_MAP_BUCKET(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… union nft_pipapo_map_bucket(9) β€” the kernel API manual, but make it make sense

okay bestie so this is a page straight out of the Kernel API Manual (the union nft_pipapo_map_bucket(9) one, yes the whole name, i know), and it's lowkey one of those tiny little structures that's doing a LOT of heavy lifting behind the scenes in nftables pipapo set lookups. she's a union, she's a bucket, she's in the mapping table, and she ate. let's get into it 🫢


✨ NAME ✨

union nft_pipapo_map_bucket β€” literally just "Bucket of mapping table". that's her whole job description and she's iconic for it πŸ’…


🌸 SYNOPSIS 🌸

so the shape of her is this, exactly this, no notes:

union nft_pipapo_map_bucket {
    struct {
  #if BITS_PER_LONG == 64;
      static_assert(NFT_PIPAPO_MAP_TOBITS <= 32);
      u32 to;
      static_assert(NFT_PIPAPO_MAP_NBITS <= 32);
      u32 n;
  #else;
      unsigned long to:NFT_PIPAPO_MAP_TOBITS;
      unsigned long  n:NFT_PIPAPO_MAP_NBITS;
  #endif;
    };
    struct nft_pipapo_elem *e;
 };

like, notice the #if BITS_PER_LONG == 64 branch? on a 64-bit machine she keeps it simple with plain u32 fields and static_asserts to prove they fit. on anything else she switches to bitfields. main character energy in BOTH configurations, fr fr ✨


πŸŽ€ Members πŸŽ€

time for the cast list, and yes there's some doubling up in here, that's just how the page is written, don't come for me 😭

  • {unnamed_struct} β€” anonymous. literally no name. mysterious. unknown. she simply exists πŸ•΅οΈ
  • to β€” First rule number (in next field) this rule maps to
  • n β€” Number of rules (in next field) this rule maps to
  • to β€” First rule number (in next field) this rule maps to (yes, again β€” the page lists it twice, so i'm listing it twice πŸ’€)
  • n β€” Number of rules (in next field) this rule maps to (and again 🫠)
  • e β€” If there's no next field, pointer to element this rule maps to
so the vibe is: if there IS a next field, to and n are your besties and they tell you where to go and how many rules live there. if there's NO next field, e steps up and points straight at the element. one or the other, she's a union after all πŸ’–

πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, bestie, they're all in the same friend group:


and that's the whole page, no cap 🌈

signing off from ./net/netfilter β€” the source, the whole source, and nothing but the source β€” dated October 2026, with union nft_pipapo_map_bucket(9) living in the footer where she belongs. slay πŸ’œπŸŽ€βœ¨

πŸ“¦ where this page comes from