__longest_prefix_match(9)
π 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 tonode. 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
- 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