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