*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->FreeBSD man pages -> ng_device (4)              



NAME    [Toc]    [Back]

     ng_device -- device netgraph node type

SYNOPSIS    [Toc]    [Back]

     #include <netgraph/ng_device.h>

DESCRIPTION    [Toc]    [Back]

     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 accessible
 via the regular file operators such as open(2), close(2), read(2),
     write(2), etc.

     The first node is created as /dev/ngd0, all subsequent nodes /dev/ngd1,
     /dev/ngd2, etc.  The only way a device node can be created is by a connection
 to the main device node by another type of netgraph(4) node.

     When a node is shut down, the corresponding device is removed and the
     device name becomes available for reuse by future device nodes.

     A device node has a single hook to which it connects to the requesting
     netgraph(4) node.	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.

HOOKS    [Toc]    [Back]

     The device node has no named hooks.  There is one hook which is used for
     all interactions.	This is the hook created by the calling node.

CONTROL MESSAGES    [Toc]    [Back]

     The device node supports no special control messages.  All incoming messages
 from the hook will be returned to the sender.  Additionally the
     node accepts ioctl(2)s from the device entry.  These will be encapsulated
     into netgraph(4) messages and send out to the hook.

SHUTDOWN    [Toc]    [Back]

     This node shuts down upon receipt of a NGM_SHUTDOWN control message.  The
     associated interface is removed and becomes available for use by future
     device nodes.

     Unlike most other node types, a device node does not go away when all
     hooks have been disconnected; rather, an explicit NGM_SHUTDOWN control
     message is required.

SEE ALSO    [Toc]    [Back]

     netgraph(4), ngctl(8)

HISTORY    [Toc]    [Back]

     The device node type was first implemented in FreeBSD 5.0.

AUTHORS    [Toc]    [Back]

     Mark Santcroos <marks@ripe.net>

FreeBSD 5.2.1			 June 15, 2002			 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
ng_uni FreeBSD netgraph UNI node type
ng_UI FreeBSD UI netgraph node type
ng_atm FreeBSD netgraph ATM node type
ng_ppp FreeBSD PPP protocol netgraph node type
ng_sscop FreeBSD netgraph SSCOP node type
ng_sscfu FreeBSD netgraph SSCF at the UNI node type
ng_echo FreeBSD netgraph echo node type
ng_tee FreeBSD netgraph ``tee'' node type
ng_hole FreeBSD netgraph discard node type
ng_ether FreeBSD Ethernet netgraph node type
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service