Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

nghook(8) [freebsd man page]

NGHOOK(8)						    BSD System Manager's Manual 						 NGHOOK(8)

nghook -- 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 omit- ted, ``debug'' is assumed. 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 argu- ments as its arguments. Before executing, the program 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. The nghook utility exits when EOF is detected on standard input in this case. The options are as follows: -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 sig- nal. -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
netgraph(3), netgraph(4), ngctl(8) 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. AUTHORS
Archie Cobbs <> BUGS
Although all input is read in unbuffered mode, there is no way to control the packetization of the input. If the node sends a response to a message (specified by -m), this response is lost. BSD
October 24, 2003 BSD

Check Out this Related Man Page

NG_GIF(4)						   BSD Kernel Interfaces Manual 						 NG_GIF(4)

ng_gif -- generic tunnel interface netgraph node type SYNOPSIS
#include <netgraph/ng_gif.h> DESCRIPTION
The ng_gif netgraph node type allows gif(4) interfaces to interact with the netgraph(4) networking subsystem. Once the ng_gif module is loaded in the kernel, a node is automatically created for each gif(4) interface in the system. Each node will attempt to name itself with the same name as the associated interface. All ng_gif nodes are persistent for as long as the interface itself exists. Two hooks are supported: lower and orphans. The hook name divert may be used as an alias for lower, and is provided for compatibility with ng_ether(4). In reality the two names represent the same hook. The lower hook is a connection to the raw gif(4) device. When connected, all incoming packets are diverted out this hook. Writing to this hook results in a raw encapsulated packet being transmitted by the device. Normal outgoing packets are not affected by lower being con- nected. The orphans hook is equivalent to lower, except that only unrecognized packets (that would otherwise be discarded) are written to the hook, and normal incoming traffic is unaffected. At most one of orphans and lower may be connected at any time. In all cases, frames are raw packets with the address family of the packet attached to the front. When no hooks are connected, packets flow normally upwards and downwards. HOOKS
This node type supports the following hooks: lower Connection to the lower device link layer. orphans Like lower, but only receives unrecognized packets. CONTROL MESSAGES
This node type supports only the generic control messages. EXAMPLES
This command dumps all unrecognized packets received by the gif0 interface to standard output decoded in hex and ASCII: nghook -a gif0: orphans SEE ALSO
gif(4), netgraph(4), netintro(4), ifconfig(8), ngctl(8), nghook(8) AUTHORS
Brooks Davis <> BSD
September 18, 2001 BSD
Man Page