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