NG_TEE(4)
π NG_TEE β the netgraph "tee" node type π
okay bestie, gather round, because we're talking about ng_tee, which lives in the Kernel Interfaces Manual (that's section 4, for the girlies keeping score). it's a netgraph node type and it's literally the netgraph version of the tee(1) command you already know and love. no cap. π«Ά
β¨ SYNOPSIS β¨
#include <sys/types.h>
#include <netgraph/ng_tee.h>
πΈ DESCRIPTION πΈ
so here's the vibe: a tee node does exactly what tee(1) does, but for netgraph. it's the "let me peek at what's going on here" node. it's giving debugging. it's giving snooping on a connection between two netgraph nodes. obsessed. π
every tee node has four hooks: right, left, right2left, and left2right. let's break it down:
- anything that comes in on
rightgets sent unmodified to bothleftandright2left. two copies, one original, no edits. π - same energy for the other side: anything that comes in on
leftgets sent unmodified to bothrightandleft2right.
and plot twist, packets can <em>also</em> come in the other way! if you receive something on right2left, it gets forwarded unchanged out right. if you receive something on left2right, it gets forwarded unchanged out left. it's a whole bidirectional situation and she handles it. π
π HOOKS π
this node type supports these hooks, bestie:
rightβ the connection to the node on the right. πleftβ the connection to the node on the left. πright2leftβ the tap for right-to-left traffic. πleft2rightβ the tap for left-to-right traffic. π
π CONTROL MESSAGES π
she takes all the generic control messages, plus these two iconic extras:
NGM_TEE_GET_STATS(getstats) β get the stats, returned as astruct ng_tee_stats. numbers! data! we love to see it. πNGM_TEE_CLR_STATS(clrstats) β clear the stats. reset era. β¨
π SHUTDOWN π
this node shuts down when it gets an NGM_SHUTDOWN control message, or when all hooks have been disconnected.
but here's the cute part π₯Ί β if both the right and left hooks are present, the node removes itself from the chain gently, connecting right and left together. she bows out and makes sure nobody gets dropped on the way out. main character exit, fr fr. π
π SEE ALSO π
π HISTORY π
the ng_tee node type was implemented in FreeBSD 4.0. a legend since day one. π
π«Ά AUTHORS π«Ά
Julian Elischer <julian@FreeBSD.org> β thank you for your service, king. π
and that's the whole page, bestie!! π this version came to you from the Debian folks, dated May 28, 2004 β so yes, she's been iconic for a minute. go snoop on some traffic responsibly. mwah. πβ¨π¦
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1996-1999 Whistle Communications, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms