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

  man pages->FreeBSD man pages -> ng_ether (4)              
Title
Content
Arch
Section
 

NG_ETHER(4)

Contents


NAME    [Toc]    [Back]

     ng_ether -- Ethernet netgraph node type

SYNOPSIS    [Toc]    [Back]

     #include <netgraph/ng_ether.h>

DESCRIPTION    [Toc]    [Back]

     The ng_ether netgraph node type allows Ethernet interfaces to interact
     with the netgraph(4) networking subsystem.  Once the ng_ether module is
     loaded in the kernel, a node is automatically created for each Ethernet
     interface in the system.  Each node will attempt to name itself with the
     same name as the associated interface.  All ng_ether nodes are persistent
     for as long as the interface itself exists.

     Three hooks are supported: lower, upper, and orphans.  The hook name
     divert may be used as an alias for lower, and is provided for backward
     compatibility.  In reality the two names represent the same hook.

     The lower hook is a connection to the raw Ethernet device.  When connected,
 all incoming packets are diverted out this hook.  Writing to this
     hook results in a raw Ethernet frame being transmitted by the device.
     Normal outgoing packets are not affected by lower being connected.

     The upper hook is a connection to the upper protocol layers.  When connected,
 all outgoing packets are diverted out this hook.  Writing to this
     hook results in a raw Ethernet frame being received by the kernel just as
     if it had come in over the wire.  Normal incoming packets are not
     affected by upper being connected.

     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 Ethernet frames with the standard 14 byte
     Ethernet header (but no checksum).

     When no hooks are connected, upper and lower are in effect connected
     together, so that packets flow normally upwards and downwards.

HOOKS    [Toc]    [Back]

     This node type supports the following hooks:

     lower    Connection to the lower device link layer.

     upper    Connection to the upper protocol layers.

     orphans  Like lower, but only receives unrecognized packets.

CONTROL MESSAGES    [Toc]    [Back]

     This node type supports the generic control messages, plus the following:

     NGM_ETHER_GET_IFNAME
	  Returns the name of the associated interface as a NUL-terminated
	  ASCII string.  Normally this is the same as the name of the node.

     NGM_ETHER_GET_IFINDEX
	  Returns the global index of the associated interface as a 32 bit
	  integer.

     NGM_ETHER_GET_ENADDR
	  Returns the device's unique six byte Ethernet address.

     NGM_ETHER_SET_ENADDR
	  Sets the device's unique six byte Ethernet address.  This control
	  message is equivalent to using the SIOCSIFLLADDR ioctl(2) system
	  call.

     NGM_ETHER_SET_PROMISC
	  Enable or disable promiscuous mode.  This message includes a single
	  32 bit integer flag that enables or disables promiscuous mode on the
	  interface.

     NGM_ETHER_GET_PROMISC
	  Get the current value of the node's promiscuous flag.  The returned
	  value is always either one or zero.  Note that this flag reflects
	  the node's own promiscuous setting and does not necessarily reflect
	  the promiscuous state of the actual interface, which can be affected
	  by other means (e.g., bpf(4)).

     NGM_ETHER_SET_AUTOSRC
	  Sets the automatic source address override flag.  This message
	  includes a single 32 bit integer flag that causes all outgoing packets
 to have their source Ethernet address field overwritten with the
	  device's unique Ethernet address.  If this flag is set to zero, the
	  source address in outgoing packets is not modified.  The default
	  setting for this flag is enabled.

     NGM_ETHER_GET_AUTOSRC
	  Get the current value of the node's source address override flag.
	  The returned value is always either one or zero.

SHUTDOWN    [Toc]    [Back]

     This node is persistent for as long as the interface exists.  Upon
     receipt of a NGM_SHUTDOWN control message, all hooks are disconnected,
     promiscuous mode is disabled, and the source address override flag is
     reenabled, but the node is not removed.  If the interface itself is
     detached (e.g., because of PCCARD removal), the node disappears as well.

EXAMPLES    [Toc]    [Back]

     This command dumps all unrecognized packets received by the fxp0 interface
 to standard output decoded in hex and ASCII:

	   nghook -a fxp0: orphans

     This command sends the contents of foo.pkt out the interface fxp0:

	   cat foo.pkt | nghook fxp0: orphans

     These commands insert an ng_tee(4) node between the lower and upper protocol
 layers, which can be used for tracing packet flow, statistics,
     etc.:

	   ngctl mkpeer fxp0: tee lower right
	   ngctl connect fxp0: lower upper left

BUGS    [Toc]    [Back]

     The automatic KLD module loading mechanism that works for most other netgraph
 node types does not work for the ng_ether node type, because
     ng_ether nodes are not created on demand; instead, they are created when
     Ethernet interfaces are attached or when the KLD is first loaded.	Therefore,
 if the KLD is not statically compiled into the kernel, it is necessary
 to load the KLD manually in order to bring the ng_ether nodes into
     existence.

SEE ALSO    [Toc]    [Back]

      
      
     arp(4), netgraph(4), netintro(4), ifconfig(8), ngctl(8), nghook(8)

AUTHORS    [Toc]    [Back]

     Julian Elischer <[email protected]>
     Archie Cobbs <[email protected]>


FreeBSD 5.2.1			 June 26, 2000			 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
ng_bridge FreeBSD Ethernet bridging netgraph node type
ng_UI FreeBSD UI netgraph node type
ng_atm FreeBSD netgraph ATM node type
ng_uni FreeBSD netgraph UNI node type
ng_ip_input FreeBSD netgraph IP input node type
ng_ppp FreeBSD PPP protocol netgraph node type
ng_device FreeBSD device netgraph node type
ng_rfc1490 FreeBSD RFC 1490 netgraph node type
ng_socket FreeBSD netgraph socket node type
ng_tee FreeBSD netgraph ``tee'' node type
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service