__skb_flow_dissect(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __skb_flow_dissect(9) πŸ’…

okay bestie, welcome to the Kernel API Manual, and the function we're about to dissect (ha, get it) is __skb_flow_dissect. and before you ask β€” yes, the name starts with underscores, yes that's a whole vibe, and yes you still have to type them all. no cap. 🫢


✨ NAME ✨

__skb_flow_dissect β€” extract the flow_keys struct and return it. that's literally it. that's the whole job. it gives you the struct. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

bool __skb_flow_dissect (const struct net *net , const struct sk_buff
*skb , struct flow_dissector *flow_dissector , void *target_container ,
const void *data , __be16 proto , int nhoff , int hlen , unsigned int
flags );

like, nine arguments. nine. she's high-maintenance but she's worth it, i promise πŸ’œ


🌸 ARGUMENTS 🌸

okay so every single one of these, one by one, no skipping, we don't do that here:

  • net β€” the associated network namespace. and if it's NULL? it gets derived from skb instead. self-sufficient queen behavior πŸ‘‘
  • skb β€” the sk_buff we're extracting the flow from. you can pass NULL here, but only if you've specified everything else. like, she can be absent, but only if the rest of the squad shows up πŸ™ˆ
  • flow_dissector β€” the list of keys to dissect. this is the whole to-do list, basically πŸ“‹
  • target_container β€” the target structure where the dissected values get put. the drop-off spot. the lil home for your results 🏠
  • data β€” raw buffer pointer to the packet. if it's NULL, we use skb->data instead ✨
  • proto β€” the protocol for which to get the flow. if data is NULL, we use skb->protocol πŸ¦‹
  • nhoff β€” the network header offset. if data is NULL, we use skb_network_offset(skb) πŸ“
  • hlen β€” the packet header length. if data is NULL, we use skb_headlen(skb) πŸ“
  • flags β€” the flags that control the dissection process, e.g. FLOW_DISSECTOR_F_STOP_AT_ENCAP. these are the settings, the knobs, the little dials that change the whole mood πŸŽ›οΈ

🌈 DESCRIPTION 🌈

so the way that this works is: the function will try to retrieve individual keys into the target specified by flow_dissector β€” and it'll pull them from either the skbuff or a raw buffer specified by the rest parameters. either/or, bestie, it's flexible like that πŸ’…

⚠️ real talk though: the caller must take care of zeroing target container memory. that's on you, not on her. she is not doing your homework. not me forgetting to zero and then debugging for three hours 😭

πŸ”₯ SEE ALSO πŸ”₯

the extended universe, aka go read these too:


okay that's the whole page, mwah πŸ’– this one's coming to you live from ./net/core, dated October 2026, and it's filed under __skb_flow_dissect(9) forever and always. go dissect some flows, you've got this 🧚 ⭐

πŸ“¦ where this page comes from