tb_tunnel_event(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… tb_tunnel_event(9)

okay so this is a page from the Kernel API Manual β€” it's tb_tunnel_event(9), and bestie, it's a tiny little function with a big job: telling userspace that something happened in the tunnel world. let's get into it πŸŽ€


✨ NAME ✨

tb_tunnel_event β€” notify userspace about a tunneling event

like, it's the messenger. it does not tunnel. it just tells people about tunneling. main character energy of the announcement, not the event πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

void tb_tunnel_event (struct tb *tb , enum tb_tunnel_event event , enum
       tb_tunnel_type type , const struct tb_port *src_port , const struct
       tb_port *dst_port );

five arguments, returns nothing (void), it's giving "I just do the thing and leave" 😌


🌸 ARGUMENTS 🌸

  • tb β€” the domain where the event occurred. like, the whole neighborhood 🏘️
  • event β€” the event that happened. the actual tea β˜•
  • type β€” the type of the tunnel in question. what kind of tunnel we're talking about here πŸš‡
  • src_port β€” the tunnel source port. can be NULL (it's allowed to not know, no pressure) πŸ™ˆ
  • dst_port β€” the tunnel destination port. also can be NULL (same vibe) 🫢

⭐ DESCRIPTION ⭐

so what it does is, it notifies userspace about a tunneling event in the domain. and here's the iconic part: the tunnel does not need to exist. fr fr. that's not a bug, that's the whole point β€” for example, the tunnel was not activated because there is not enough bandwidth 😭 so we still wanna tell userspace "hey, this was a thing that could've happened," and this function is how we do it.

now the detail work, and this is the bit you gotta remember:

  • if src_port and dst_port are given β†’ it fills in the full TUNNEL_DETAILS environment variable πŸ”₯ full send, all the details
  • otherwise β†’ it uses the shorter one, which is just the tunnel type πŸ“

that's it. that's the whole function. short, sweet, slays, periodt πŸ‘‘


🌈 SEE ALSO 🌈

kernel file ./drivers/thunderbolt/tunnel.c β€” and the whole tunnel girlie friend group:


and that's the page!! sourced from ./drivers/thunderbolt, dated October 2026 β€” go read the source bestie, it's right there, and it's literally only a few lines πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from