NG_HOLE(4)

πŸ’– ng_hole β€” netgraph discard node type πŸ’–

okay bestie, so this is ng_hole, from the Kernel Interfaces Manual, section 4 🫢 it's a whole node type in the netgraph universe, and honestly? its whole personality is "receives stuff, says nothing, keeps it cute" ✨


🌸 SYNOPSIS 🌸

#include <sys/types.h>
#include <netgraph/ng_hole.h>

like yes, you gotta include those two, no skipping πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

The hole node type silently discards all data and control messages it receives. Not a peep. Not a single one. Everything you send it just… poof πŸ«₯

And the way that this type is used for testing and debugging? iconic. it's literally the void in node form, main character energy but make it empty πŸ’€


πŸŽ€ HOOKS πŸŽ€

A ng_hole node accepts any request to connect, regardless of the hook name β€” as long as the name is unique ✨

so like, name your hook whatever you want, it's not picky, it's just not gonna let two hooks share a name. boundaries, we love to see it πŸ‘‘


✨ CONTROL MESSAGES ✨

This node type supports the generic control messages, plus these lil cuties below πŸ’–

  • NGM_HOLE_GET_STATS (getstats) β€” This command takes an ASCII string argument, the hook name, and returns the statistics associated with the hook as a struct ng_hole_hookstat. πŸ“Š giving you the receipts fr fr
  • NGM_HOLE_CLR_STATS (clrstats) β€” This command takes an ASCII string argument, the hook name, and clears the statistics associated with the hook. 🧹 fresh slate, no cap
  • NGM_HOLE_GETCLR_STATS (getclrstats) β€” This command is identical to NGM_HOLE_GET_STATS, except that the statistics are also atomically cleared. πŸ”₯ grab 'em and wipe 'em in one go, obsessed

πŸ’œ SHUTDOWN πŸ’œ

This node shuts down upon receipt of a NGM_SHUTDOWN control message, or when all hooks have been disconnected. πŸ‘‹

it's giving "leave me alone and I'll leave" honestly. no hooks, no node. periodt.

🌈 SEE ALSO 🌈

iykyk, go read the whole fam 🫢


⭐ HISTORY ⭐

The ng_hole node type was implemented in FreeBSD 4.0. a true vintage queen πŸ‘‘


πŸ‘‘ AUTHORS πŸ‘‘

Julian Elischer <julian@FreeBSD.org> β€” ty bestie for this one πŸ’–


and that's the whole page, bestie!! 🌸 this version was chillin' with the Debian crew, dated May 19, 2004, and it lives at NG_HOLE(4) πŸŽ€ slay, go forth and discard πŸ’…βœ¨

πŸ“¦ where this page comes from