pipapo_insert(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 pipapo_insert β€” nftables pipapo 9 πŸ’…

okay bestie, welcome to the Kernel API Manual page for pipapo_insert ✨ lowkey one of the little worker functions that makes nftables pipapo sets actually function. this is the pipapo_insert(9) page, and honestly? she's short but she EATS πŸ“


✨ SYNOPSIS ✨

int pipapo_insert (struct nft_pipapo_field *f , const uint8_t *k , int
mask_bits );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • f β€” the field that's holding the lookup table. she's the main character here, the container you're inserting into πŸŽ€
  • k β€” the input key you're classifying with, without nftables padding. no extra stuffing, just the raw key fr fr 🫢
  • mask_bits β€” the length of the mask. if you're doing a non-ranged entry, this matches the field length exactly. keep that in mind, it's giving precision πŸ’…

🌈 DESCRIPTION 🌈

so what does she do? pipapo_insert puts a brand new rule reference into the lookup buckets that correspond to k and mask_bits. that's it. that's the whole vibe ✨

like, you hand her a key and a mask length, she finds the right buckets, and she drops the new rule reference in there. no cap, that's the entire job πŸ‘‘


πŸ’€ RETURN πŸ’€

  • 1 on success β€” one rule inserted, we love to see it, slay πŸ’–
  • a negative error code on failure β€” not the vibe, something went wrong 😭
ngl, 1 on success is a little unusual but that's what she returns, so don't @ me 🫢

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./net/netfilter/nft_set_pipapo.c Theory of Operation(9), pipapo_refill(9), pipapo_get_slow(9), pipapo_get(9), nft_pipapo_lookup(9), nft_pipapo_get(9), pipapo_realloc_mt(9), lt_calculate_size(9), pipapo_resize(9), pipapo_bucket_set(9), pipapo_lt_4b_to_8b(9), pipapo_lt_8b_to_4b(9), pipapo_lt_bits_adjust(9), pipapo_step_diff(9), pipapo_step_after_end(9), pipapo_base_sum(9), pipapo_expand(9), pipapo_map(9), pipapo_free_scratch(9), pipapo_realloc_scratch(9), pipapo_maybe_clone(9), nft_pipapo_insert(9), pipapo_clone(9), pipapo_rules_same_key(9), pipapo_unmap(9), pipapo_drop(9), pipapo_gc_scan(9), pipapo_gc_queue(9), pipapo_free_fields(9), pipapo_reclaim_match(9), nft_pipapo_commit(9), nft_pipapo_activate(9), nft_pipapo_deactivate(9), nft_pipapo_flush(9), pipapo_get_boundaries(9), pipapo_match_field(9), nft_pipapo_remove(9), nft_pipapo_do_walk(9), nft_pipapo_walk(9), nft_pipapo_privsize(9), nft_pipapo_estimate(9), nft_pipapo_init(9), nft_set_pipapo_match_destroy(9), nft_pipapo_destroy(9), nft_pipapo_gc_init(9)

like, that's a whole friend group and they're all iconic in their own way, go read them too πŸ§šπŸ’œ


and that's the page!! πŸŽ€ brought to you from ./net/netfilter πŸ’«, dated October 2026 ⭐ β€” mwah, ily, go insert some rules responsibly πŸ˜­πŸ’–

πŸ“¦ where this page comes from