Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
NG_DEVICE(4)	       FreeBSD Kernel Interfaces Manual		  NG_DEVICE(4)

NAME
     ng_device -- device netgraph node type

SYNOPSIS
     #include <netgraph/ng_device.h>

DESCRIPTION
     A device node is both a netgraph node and a system	device interface.
     When a device node	is created, a new device entry appears which is	acces-
     sible via the regular file	operators such as open(2), close(2), read(2),
     write(2), etc.

     The first node is created as /dev/ngd0, subsequent	nodes are /dev/ngd1,
     /dev/ngd2,	etc.

HOOKS
     A device node has a single	hook with an arbitrary name.  All data coming
     in	over the hook will be presented	to the device for read(2).  All	data
     coming in from the	device entry by	write(2) will be forwarded to the
     hook.

CONTROL	MESSAGES
     The device	node supports the generic control messages, plus the follow-
     ing:

     NGM_DEVICE_GET_DEVNAME
	  Returns the device name corresponding	to the node.

     NGM_DEVICE_ETHERALIGN
	  Apply	the system ETHER_ALIGN offset to mbufs sent out	the node's
	  hook,	if running on an architecture that requires strict alignment.
	  Use this option when the data	being injected via the device node ul-
	  timately ends	up being fed into the protocol stack as	ethernet pack-
	  ets (e.g., via an ng_eiface(4) node).

SHUTDOWN
     This node shuts down upon receipt of a NGM_SHUTDOWN control message, or
     upon hook disconnection.  The associated device entry is removed and be-
     comes available for use by	future device nodes.

SEE ALSO
     netgraph(4), ngctl(8)

HISTORY
     The device	node type was first implemented	in FreeBSD 5.0.

AUTHORS
     Mark Santcroos <marks@ripe.net>
     Gleb Smirnoff <glebius@FreeBSD.org>

FreeBSD	13.0		       November	8, 2021			  FreeBSD 13.0

NAME | SYNOPSIS | DESCRIPTION | HOOKS | CONTROL MESSAGES | SHUTDOWN | SEE ALSO | HISTORY | AUTHORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=ng_device&sektion=4&manpath=FreeBSD+13.1-RELEASE+and+Ports>

home | help