1.\" Copyright (c) 1999-2001, Vitaly V Belekhov 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice unmodified, this list of conditions, and the following 9.\" disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" SUCH DAMAGE. 25.\" 26.\" $FreeBSD$ 27.\" 28.Dd March 9, 2004 29.Dt NG_EIFACE 4 30.Os 31.Sh NAME 32.Nm ng_eiface 33.Nd "generic Ethernet interface netgraph node type" 34.Sh SYNOPSIS 35.In netgraph/ng_eiface.h 36.Sh DESCRIPTION 37The 38.Vt eiface 39netgraph node implements the generic Ethernet interface. 40When 41.Vt eiface 42node is created, a new interface appears which is accessible via 43.Xr ifconfig 8 . 44These interfaces are named 45.Dq Li ngeth0 , 46.Dq Li ngeth1 , 47etc. 48When a node is shut down, the corresponding interface is removed, 49and the interface name becomes available for reuse by future 50.Vt eiface 51nodes. 52New nodes always take the first unused interface. 53.Sh HOOKS 54An 55.Vt eiface 56node has a single hook named 57.Va ether , 58which should be connected to the 59Ethernet downstream, for example, to the 60.Xr ng_vlan 4 61node. 62Packets transmitted via the interface flow out this hook. 63Similarly, packets received on the hook go to the protocol stack as 64packets received by any real Ethernet interface. 65.Sh CONTROL MESSAGES 66This node type supports the generic control messages, plus the following: 67.Bl -tag -width indent 68.It Dv NGM_EIFACE_SET 69Set link-level address of the interface. 70Requires 71.Vt "struct ether_addr" 72as an argument. 73This message also has an 74.Tn ASCII 75version, called 76.Dq Li set , 77which requires as an argument an 78.Tn ASCII 79string consisting of 6 colon-separated hex digits. 80.It Dv NGM_EIFACE_GET_IFNAME 81Return the name of the associated interface as a 82.Dv NUL Ns -terminated 83.Tn ASCII 84string. 85.It Dv NGM_EIFACE_GET_IFADDRS 86Return the list of link-level addresses associated with the node. 87.El 88.Sh SHUTDOWN 89This node shuts down upon receipt of a 90.Dv NGM_SHUTDOWN 91control message. 92The associated interface is removed and its name becomes 93available for reuse by future 94.Vt eiface 95nodes. 96.Pp 97Unlike most other node types, an 98.Vt eiface 99node does 100.Em not 101go away when all hooks have been disconnected; rather, and explicit 102.Dv NGM_SHUTDOWN 103control message is required. 104.Sh SEE ALSO 105.Xr netgraph 4 , 106.Xr ng_ether 4 , 107.Xr ng_iface 4 , 108.Xr ng_vlan 4 , 109.Xr ifconfig 8 , 110.Xr ngctl 8 111.Sh HISTORY 112The 113.Vt eiface 114node type was implemented in 115.Fx 4.6 . 116.Sh AUTHORS 117.An -nosplit 118The 119.Vt eiface 120node type was written by 121.An Vitaly V Belekhov . 122This manual page was written by 123.An Gleb Smirnoff . 124