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