xref: /dragonfly/share/man/man4/ng_eiface.4 (revision 655933d6)
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: src/share/man/man4/ng_eiface.4,v 1.3.2.1 2005/02/03 13:49:18 ru Exp $
26.\"
27.Dd February 3, 2005
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/eiface/ng_eiface.h
35.Sh DESCRIPTION
36The
37.Vt eiface
38netgraph node implements the generic Ethernet interface.
39When
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.
59.\", for example, to the
60.\".Xr ng_vlan 4
61.\"node.
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 Pq Li 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 Pq Li getifname
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