UNION NFT_PIPAPO_MAP_BUCKET(9)
π 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 tonβ Number of rules (in next field) this rule maps totoβ 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,toandnare your besties and they tell you where to go and how many rules live there. if there's NO next field,esteps 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:
- Kernel file
./net/netfilter/nft_set_pipapo.hstruct nft_pipapo_field(9) struct nft_pipapo_scratch(9)struct nft_pipapo_match(9)struct nft_pipapo(9)struct nft_pipapo_elem(9)pipapo_and_field_buckets_4bit(9)pipapo_and_field_buckets_8bit(9)pipapo_estimate_size(9)pipapo_resmap_init(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms