__longest_prefix_match(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

Hiii bestie, welcome to the Kernel API Manual β€” today's main character is __longest_prefix_match(9), and she is literally here to determine the longest prefix. No cap. πŸ’…


✨ SYNOPSIS ✨

size_t __longest_prefix_match (const struct lpm_trie *trie , const
       struct lpm_trie_node *node , const struct bpf_lpm_trie_key_u8 *key );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • trie β€” the trie to get internal sizes from. That's the whole assignment, bestie: internal sizes, extracted. πŸ’–
  • node β€” the node to operate on. This is the node having its little main-character moment. ✨
  • key β€” the key to compare to node. Yep, that's the comparison key, periodt. πŸ”‘

🌸 DESCRIPTION 🌸

Okay so the vibe is: determine the longest prefix of node that matches the bits in key. That's it, that's the plot. The function is out here doing prefix-match detective work, and honestly? Iconic. πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘

  • Kernel file ./kernel/bpf/lpm_trie.c β€” go read the source, iykyk. 🫢

Byeee bestie 🫢 this page comes from ./kernel/bpf, dated October 2026 β€” source/version and date, delivered with a little sparkle. Mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from