xref: /freebsd/share/man/man4/ng_eiface.4 (revision cab6a39d7b343596a5823e65c0f7b426551ec22d)
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.\" $FreeBSD$
26.\"
27.Dd May 14, 2019
28.Dt NG_EIFACE 4
29.Os
30.Sh NAME
31.Nm ng_eiface
32.Nd "generic Ethernet interface netgraph node type"
33.Sh SYNOPSIS
34.In netgraph/ng_eiface.h
35.Sh DESCRIPTION
36The
37.Vt eiface
38netgraph node implements the generic Ethernet interface.
39When an
40.Vt eiface
41node is created, a new interface appears which is accessible via
42.Xr ifconfig 8 .
43These interfaces are named
44.Dq Li ngeth0 ,
45.Dq Li ngeth1 ,
46etc.
47When a node is shut down, the corresponding interface is removed,
48and the interface name becomes available for reuse by future
49.Vt eiface
50nodes.
51New nodes always take the first unused interface.
52.Sh HOOKS
53An
54.Vt eiface
55node has a single hook named
56.Va ether ,
57which should be connected to the
58Ethernet downstream, for example, to the
59.Xr ng_vlan 4
60node.
61Packets transmitted via the interface flow out this hook.
62Similarly, packets received on the hook go to the protocol stack as
63packets received by any real Ethernet interface.
64.Sh CONTROL MESSAGES
65This node type supports the generic control messages, plus the following:
66.Bl -tag -width foo
67.It Dv NGM_EIFACE_SET Pq Ic set
68Set link-level address of the interface.
69Requires
70.Vt "struct ether_addr"
71as an argument.
72This message also has an
73.Tn ASCII
74version, called
75.Dq Li set ,
76which requires as an argument an
77.Tn ASCII
78string consisting of 6 colon-separated hex digits.
79.It Dv NGM_EIFACE_GET_IFNAME Pq Ic getifname
80Return the name of the associated interface as a
81.Dv NULL Ns -terminated
82.Tn ASCII
83string.
84.It Dv NGM_EIFACE_GET_IFADDRS
85Return the list of link-level addresses associated with the node.
86.El
87.Sh SHUTDOWN
88This node shuts down upon receipt of a
89.Dv NGM_SHUTDOWN
90control message.
91The associated interface is removed and its name becomes
92available for reuse by future
93.Vt eiface
94nodes.
95.Pp
96Unlike most other node types, an
97.Vt eiface
98node does
99.Em not
100go away when all hooks have been disconnected; rather, an explicit
101.Dv NGM_SHUTDOWN
102control message is required.
103.Sh SEE ALSO
104.Xr netgraph 4 ,
105.Xr ng_ether 4 ,
106.Xr ng_iface 4 ,
107.Xr ng_vlan 4 ,
108.Xr ifconfig 8 ,
109.Xr ngctl 8
110.Sh HISTORY
111The
112.Vt eiface
113node type was implemented in
114.Fx 4.6 .
115.Sh AUTHORS
116.An -nosplit
117The
118.Vt eiface
119node type was written by
120.An Vitaly V Belekhov .
121This manual page was written by
122.An Gleb Smirnoff .
123