NG_HUB(4)

πŸ’– NG_HUB β€” packet distribution netgraph node type πŸ’–

okay bestie, sit down, hydrate, and let me tell you about ng_hub(4) from the Kernel Interfaces Manual section 4. it's a whole vibe and honestly? underrated. πŸ¦‹


✨ SYNOPSIS ✨

#include <netgraph/ng_hub.h>

🌸 DESCRIPTION 🌸

so the hub node type is literally just the simplest lil mechanism for spreading packets across several links. that's it. that's the whole personality. πŸŽ€

packets that come in on any of the hooks get forwarded out the other hooks. and the packets? untouched. not altered in any way. no glow-up, no edits, no notes. it's giving "pass it along, I'm just the messenger" main character energy. πŸ‘‘


πŸͺ HOOKS πŸͺ

a hub node accepts any request to connect β€” doesn't matter what you named the hook, it's not picky β€” as long as the name is unique. that's the only rule. one of a kind only, periodt. πŸ’…


πŸ“¨ CONTROL MESSAGES πŸ“¨

this node supports all the generic control messages (iykyk), plus this one:

  • NGM_HUB_SET_PERSISTENT (setpersistent) β€” this command sets the persistent flag on the node. and it takes no arguments. that's it. no receipts, no extra credit, no nothing. ✨

πŸ›‘ SHUTDOWN πŸ›‘

this node shuts down when:

  • it receives a NGM_SHUTDOWN control message, or
  • all of its hooks have been disconnected. bye bestie! πŸ‘‹

but here's the tea 🍡 β€” setting the persistent flag via a NGM_HUB_SET_PERSISTENT control message disables that automatic node shutdown when the last hook gets disconnected. so it just... stays. iconic. πŸ”₯


πŸ‘€ SEE ALSO πŸ‘€


πŸ“œ HISTORY πŸ“œ

the ng_hub node type appeared in FreeBSD 5.3. vintage, but make it timeless. 🧚


πŸ‘‘ AUTHORS πŸ‘‘

Ruslan Ermilov <ru@FreeBSD.org>


ngl if you made it this far you're lowkey a netgraph girlie now. no cap. 🫢

and that's a wrap! this page is from the <strong>Debian</strong> crew, dated <strong>May 5, 2010</strong> β€” yeah, it's been serving since before some of y'all were born. πŸ’€πŸ’– stay connected, stay unique with those hook names, mwah! πŸ“πŸŒˆ

πŸ“¦ where this page comes from