NGHOOK(8)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

✨ NAME ✨

okay so bestie, this is nghook(8) from the System Manager’s Manual β€” and it’s literally the little connector between your terminal and a netgraph(4) node. The whole mood: connect to a netgraph(4) node. πŸ’–

🌸 SYNOPSIS 🌸

nghook [-adlnSs] [-m msg] path [hookname]
nghook -e [-n] [-m msg] path hookname program [args ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

The nghook utility creates a ng_socket(4) socket type node and connects it to hook hookname of the node found at path. If hookname is omitted, "debug" is assumed. no cap πŸ’…

If the -e option is given, the third argument is interpreted as the path to a program, and this program is executed with the remaining arguments as its arguments. Before executing, the Netgraph messages specified by the -m option are sent to the node. The program is executed with its standard input (unless closed by -n) and output connected to the hook. 🫢

If the -e option is not given, all data written to standard input is sent to the node, and all data received from the node is relayed to standard output. Messages specified with -m are sent to the node before the loop is entered. In this case, the nghook utility exits when EOF is detected on standard input. 😭

The options are as follows, bestie:

πŸ’… OPTIONS πŸ’…

  • -a β€” Output each packet read in human-readable decoded ASCII form instead of raw binary.
  • -d β€” Increase the debugging verbosity level.
  • -e β€” Execute the program specified by the third argument.
  • -l β€” Loops all received data back to the hook in addition to writing it to standard output.
  • -m msg β€” Before executing the program (in -e mode), send the given ASCII control message to the node. This option may be given more than once.
  • -n β€” Do not attempt to read any data from standard input. The nghook utility will continue reading from the node until stopped by a signal.
  • -S β€” Use file descriptor 0 for output instead of the default 1.
  • -s β€” Use file descriptor 1 for input instead of the default 0.

πŸ‘€ SEE ALSO πŸ‘€

🧚 HISTORY 🧚

The netgraph system was designed and first implemented at Whistle Communications, Inc. in a version of FreeBSD 2.2 customized for the Whistle InterJet. iconic origin story, honestly πŸ’œ

πŸ‘‘ AUTHORS πŸ‘‘

Archie Cobbs <archie@whistle.com> πŸŽ€

πŸ’€ BUGS πŸ’€

Although all input is read in unbuffered mode, there is no way to control the packetization of the input. like… none. zero. the packetization is gonna do what it’s gonna do πŸ™ˆ

If the node sends a response to a message specified by -m, this response is lost. yep, lost-lost. gone. 😭


okay that’s the whole NGHOOK(8) moment, bestie β€” source/version: Debian, dated October 24, 2003. bye and slay πŸ’–βœ¨

πŸ“¦ where this page comes from