1a6086278SArchie Cobbs.\" Copyright (c) 2000 Whistle Communications, Inc. 2a6086278SArchie Cobbs.\" All rights reserved. 3a6086278SArchie Cobbs.\" 4a6086278SArchie Cobbs.\" Subject to the following obligations and disclaimer of warranty, use and 5a6086278SArchie Cobbs.\" redistribution of this software, in source or object code forms, with or 6a6086278SArchie Cobbs.\" without modifications are expressly permitted by Whistle Communications; 7a6086278SArchie Cobbs.\" provided, however, that: 8a6086278SArchie Cobbs.\" 1. Any and all reproductions of the source or object code must include the 9a6086278SArchie Cobbs.\" copyright notice above and the following disclaimer of warranties; and 10a6086278SArchie Cobbs.\" 2. No rights are granted, in any manner or form, to use Whistle 11a6086278SArchie Cobbs.\" Communications, Inc. trademarks, including the mark "WHISTLE 12a6086278SArchie Cobbs.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as 13a6086278SArchie Cobbs.\" such appears in the above copyright notice or in the software. 14a6086278SArchie Cobbs.\" 15a6086278SArchie Cobbs.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND 16a6086278SArchie Cobbs.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO 17a6086278SArchie Cobbs.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, 18a6086278SArchie Cobbs.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF 19a6086278SArchie Cobbs.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. 20a6086278SArchie Cobbs.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY 21a6086278SArchie Cobbs.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS 22a6086278SArchie Cobbs.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. 23a6086278SArchie Cobbs.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES 24a6086278SArchie Cobbs.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING 25a6086278SArchie Cobbs.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 26a6086278SArchie Cobbs.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR 27a6086278SArchie Cobbs.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 28a6086278SArchie Cobbs.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29a6086278SArchie Cobbs.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30a6086278SArchie Cobbs.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 31a6086278SArchie Cobbs.\" OF SUCH DAMAGE. 32a6086278SArchie Cobbs.\" 33a6086278SArchie Cobbs.\" Author: Archie Cobbs <archie@whistle.com> 34a6086278SArchie Cobbs.\" 35a6086278SArchie Cobbs.\" $FreeBSD$ 36a6086278SArchie Cobbs.\" 37a6086278SArchie Cobbs.Dd January 25, 2000 38a6086278SArchie Cobbs.Dt NG_ETHER 8 39a6086278SArchie Cobbs.Os FreeBSD 40a6086278SArchie Cobbs.Sh NAME 41a6086278SArchie Cobbs.Nm ng_ether 42a6086278SArchie Cobbs.Nd Ethernet netgraph node type 43a6086278SArchie Cobbs.Sh SYNOPSIS 44a6086278SArchie Cobbs.Fd #include <netgraph/ng_ether.h> 45a6086278SArchie Cobbs.Sh DESCRIPTION 46a6086278SArchie CobbsThe 47a6086278SArchie Cobbs.Nm ether 48a6086278SArchie Cobbsnetgraph node type allows Ethernet interfaces to interact with 49a6086278SArchie Cobbsthe 50a6086278SArchie Cobbs.Xr netgraph 4 51a6086278SArchie Cobbsnetworking subsystem. The kernel must be compiled with 52a6086278SArchie Cobbs.Bd -literal 53a6086278SArchie Cobbs options NETGRAPH 54a6086278SArchie Cobbs.Ed 55a6086278SArchie Cobbs.Pp 56a6086278SArchie Cobbsfor this functionality to be enabled. 57a6086278SArchie CobbsThis causes a netgraph node to be automatically created for each Ethernet 58a6086278SArchie Cobbsinterface in the system. The node will have a name equal to 59a6086278SArchie Cobbsthe name of the interface, and it will be persistent. 60a6086278SArchie Cobbs.Pp 61a6086278SArchie CobbsThe Ethernet interface continues to function normally until a connection 62a6086278SArchie Cobbsis made to one of the two supported hooks, 63a6086278SArchie Cobbs.Dv orphans 64a6086278SArchie Cobbsor 65a6086278SArchie Cobbs.Dv divert . 66a6086278SArchie CobbsThe 67a6086278SArchie Cobbs.Dv orphans 68a6086278SArchie Cobbshook is used to receive Ethernet frames received by the device and 69a6086278SArchie Cobbshaving an unknown or unsupported Ethertype. 70a6086278SArchie CobbsThe 71a6086278SArchie Cobbs.Dv divert 72a6086278SArchie Cobbshook is used to divert 73a6086278SArchie Cobbs.Em all 74a6086278SArchie CobbsEthernet frames received by the device; the interface will otherwise 75a6086278SArchie Cobbsappear to go silent until this hook is disconnected. 76a6086278SArchie Cobbs.Pp 77a6086278SArchie CobbsEither hook may be used to transmit Ethernet frames by transmitting packets 78a6086278SArchie Cobbsto the hook. In all cases, frames are raw Ethernet frames with the standard 79a6086278SArchie Cobbs14 byte Ethernet header (but no checksum). 80a6086278SArchie Cobbs.Sh HOOKS 81a6086278SArchie CobbsThis node type supports the following hooks: 82a6086278SArchie Cobbs.Pp 83a6086278SArchie Cobbs.Bl -tag -width orphans 84a6086278SArchie Cobbs.It Dv orphans 85a6086278SArchie CobbsThis hook transmits Ethernet frames received by the device and 86a6086278SArchie Cobbshaving an unknown or unsupported Ethertype. Frames received on 87a6086278SArchie Cobbsthis hook are written as-is out on the wire. 88a6086278SArchie Cobbs.It Dv divert 89a6086278SArchie CobbsWhen connected, this hook transmits all Ethernet frames received by the device. 90a6086278SArchie CobbsFrames received on this hook are written as-is out on the wire. 91a6086278SArchie Cobbs.El 92a6086278SArchie Cobbs.Sh CONTROL MESSAGES 93a6086278SArchie CobbsThis node type supports only the generic control messages. 94a6086278SArchie Cobbs.Sh SHUTDOWN 95a6086278SArchie CobbsThis node is persistent. Upon receipt of a 96a6086278SArchie Cobbs.Dv NGM_SHUTDOWN 97a6086278SArchie Cobbscontrol message, all hooks are disconnected. 98a6086278SArchie Cobbs.Sh EXAMPLE 99a6086278SArchie CobbsThis command will dump all packets received by the 100a6086278SArchie Cobbs.Dv fxp0 101a6086278SArchie Cobbsinterface to standard output as decoded hex and ASCII: 102a6086278SArchie Cobbs.Bl -literal 103a6086278SArchie Cobbs 104a6086278SArchie Cobbs nghook -a fxp0: divert 105a6086278SArchie Cobbs.El 106a6086278SArchie Cobbs.Sh SEE ALSO 107a6086278SArchie Cobbs.Xr arp 4 , 108a6086278SArchie Cobbs.Xr netgraph 4 , 109a6086278SArchie Cobbs.Xr netintro 4 , 110a6086278SArchie Cobbs.Xr ifconfig 8 , 111a6086278SArchie Cobbs.Xr nghook 8 , 112a6086278SArchie Cobbs.Xr ngctl 8 113a6086278SArchie Cobbs.Sh AUTHOR 114d905b0b6SMike Pritchard.An Julian Elischer Aq julian@FreeBSD.org 115