|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| lower | Connection to the lower device link layer. |
| upper | Connection to the upper protocol layers. |
| orphans | |
| Like lower, but only receives unrecognized packets. | |
This node type supports the generic control messages, plus the following:
NGM_ETHER_GET_IFNAME(getifname) 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(getifindex) Returns the global index of the associated interface as a 32 bit integer. NGM_ETHER_GET_ENADDR(getenaddr) Returns the devices unique six byte Ethernet address. NGM_ETHER_SET_ENADDR(setenaddr) Sets the devices unique six byte Ethernet address. This control message is equivalent to using the SIOCSIFLLADDR ioctl(2) system call. NGM_ETHER_SET_PROMISC(setpromisc) Enable or disable promiscuous mode. This message includes a single 32 bit integer flag that enables or disables promiscuous mode on the interface. Any non-zero value enables promiscuous mode. NGM_ETHER_GET_PROMISC(getpromisc) Get the current value of the nodes promiscuous flag. The returned value is always either one or zero. Note that this flag reflects the nodes 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(setautosrc) 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 devices 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 disabled. NGM_ETHER_GET_AUTOSRC(getautosrc) Get the current value of the nodes source address override flag. The returned value is always either one or zero. NGM_ETHER_ADD_MULTI(addmulti) Join Ethernet multicast group. This control message is equivalent to using the SIOCADDMULTI ioctl(2) system call. NGM_ETHER_DEL_MULTI(delmulti) Leave Ethernet multicast group. This control message is equivalent to using the SIOCDELMULTI ioctl(2) system call. NGM_ETHER_DETACH(detach) Detach from underlying Ethernet interface and shut down node.
Upon receipt of the NGM_SHUTDOWN control message, all hooks are disconnected, promiscuous mode is disabled, and the source address override flag is re-enabled, but the node is not removed. Node can be shut down only using NGM_ETHER_DETACH control message. If the interface itself is detached (e.g., because of PC Card removal), the node disappears as well.
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 sample.pkt out the interface "fxp0":
cat sample.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
arp(4), netgraph(4), netintro(4), ifconfig(8), ngctl(8), nghook(8)
.An Julian Elischer Aq julian@FreeBSD.org
.An Archie Cobbs Aq archie@FreeBSD.org
The automatic KLD module loading mechanism that works for most other Netgraph node types does not work for the ether node type, because 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 ether nodes into existence.
| August 4, 2006 | NG_ETHER (4) |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.