]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/ng_iface.4
disk(9): Fix a few mandoc related errors
[FreeBSD/FreeBSD.git] / share / man / man4 / ng_iface.4
1 .\" Copyright (c) 1996-1999 Whistle Communications, Inc.
2 .\" All rights reserved.
3 .\"
4 .\" Subject to the following obligations and disclaimer of warranty, use and
5 .\" redistribution of this software, in source or object code forms, with or
6 .\" without modifications are expressly permitted by Whistle Communications;
7 .\" provided, however, that:
8 .\" 1. Any and all reproductions of the source or object code must include the
9 .\"    copyright notice above and the following disclaimer of warranties; and
10 .\" 2. No rights are granted, in any manner or form, to use Whistle
11 .\"    Communications, Inc. trademarks, including the mark "WHISTLE
12 .\"    COMMUNICATIONS" on advertising, endorsements, or otherwise except as
13 .\"    such appears in the above copyright notice or in the software.
14 .\"
15 .\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
16 .\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
17 .\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
18 .\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF
19 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
20 .\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
21 .\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS
22 .\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.
23 .\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES
24 .\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING
25 .\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26 .\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
27 .\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
28 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 .\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
31 .\" OF SUCH DAMAGE.
32 .\"
33 .\" Author: Archie Cobbs <archie@FreeBSD.org>
34 .\"
35 .\" $FreeBSD$
36 .\" $Whistle: ng_iface.8,v 1.5 1999/01/25 23:46:26 archie Exp $
37 .\"
38 .Dd July 31, 2020
39 .Dt NG_IFACE 4
40 .Os
41 .Sh NAME
42 .Nm ng_iface
43 .Nd interface netgraph node type
44 .Sh SYNOPSIS
45 .In netgraph/ng_iface.h
46 .Sh DESCRIPTION
47 An
48 .Nm iface
49 node is both a netgraph node and a system networking interface.
50 When an
51 .Nm iface
52 node is created, a new interface appears which is accessible via
53 .Xr ifconfig 8 .
54 .Nm Iface
55 node interfaces are named
56 .Dv ng0 ,
57 .Dv ng1 ,
58 etc.
59 When a node is shutdown, the corresponding interface is removed
60 and the interface name becomes available for reuse by future
61 .Nm iface
62 nodes; new nodes always take the first unused interface.
63 The node itself is assigned the same name as its interface, unless the name
64 already exists, in which case the node remains unnamed.
65 .Pp
66 An
67 .Nm iface
68 node has a single hook corresponding to each supported protocol.
69 Packets transmitted via the interface flow out the corresponding
70 protocol-specific hook.
71 Similarly, packets received on a hook appear on the interface as
72 packets received into the corresponding protocol stack.
73 The currently supported protocols are IP and IPv6.
74 .Pp
75 An
76 .Nm iface
77 node can be configured as a point-to-point interface or a broadcast interface.
78 The configuration can only be changed when the interface is down.
79 The default mode is point-to-point.
80 .Pp
81 .Nm Iface
82 nodes support the Berkeley Packet Filter (BPF).
83 .Sh HOOKS
84 This node type supports the following hooks:
85 .Bl -tag -width ".Va inet6"
86 .It Va inet
87 Transmission and reception of IP packets.
88 .It Va inet6
89 Transmission and reception of IPv6 packets.
90 .El
91 .Sh CONTROL MESSAGES
92 This node type supports the generic control messages, plus the following:
93 .Bl -tag -width foo
94 .It Dv NGM_IFACE_GET_IFNAME Pq Ic getifname
95 Returns the name of the associated interface as a
96 .Dv NUL Ns -terminated
97 .Tn ASCII
98 string.
99 Normally this is the same as the name of the node.
100 .It Dv NGM_IFACE_GET_IFINDEX Pq Ic getifindex
101 Returns the global index of the associated interface as a 32 bit integer.
102 .It Dv NGM_IFACE_POINT2POINT Pq Ic point2point
103 Set the interface to point-to-point mode.
104 The interface must not currently be up.
105 .It Dv NGM_IFACE_BROADCAST Pq Ic broadcast
106 Set the interface to broadcast mode.
107 The interface must not currently be up.
108 .El
109 .Sh SHUTDOWN
110 This node shuts down upon receipt of a
111 .Dv NGM_SHUTDOWN
112 control message.
113 The associated interface is removed and becomes available
114 for use by future
115 .Nm iface
116 nodes.
117 .Pp
118 Unlike most other node types, an
119 .Nm iface
120 node does
121 .Em not
122 go away when all hooks have been disconnected; rather, and explicit
123 .Dv NGM_SHUTDOWN
124 control message is required.
125 .Sh ALTQ Support
126 The
127 .Nm
128 interface supports ALTQ bandwidth management feature.
129 However,
130 .Nm
131 is a special case, since it is not a physical interface with limited bandwidth.
132 One should not turn ALTQ on
133 .Nm
134 if the latter corresponds to some tunneled connection, e.g.\& PPPoE or PPTP.
135 In this case, ALTQ should be configured on the interface that is used to
136 transmit the encapsulated packets.
137 In case when your graph ends up with some kind of serial line, either
138 synchronous or modem, the
139 .Nm
140 is the right place to turn ALTQ on.
141 .Sh Nesting
142 .Nm
143 supports nesting, a configuration when traffic of one
144 .Nm
145 interface flows through the other.
146 The default maximum allowed nesting level is 2.
147 It can be changed at runtime setting
148 .Xr sysctl 8
149 variable
150 .Va net.graph.iface.max_nesting
151 to the desired level of nesting.
152 .Sh SEE ALSO
153 .Xr altq 4 ,
154 .Xr bpf 4 ,
155 .Xr netgraph 4 ,
156 .Xr ng_cisco 4 ,
157 .Xr ifconfig 8 ,
158 .Xr ngctl 8
159 .Xr sysctl
160 .Sh HISTORY
161 The
162 .Nm iface
163 node type was implemented in
164 .Fx 4.0 .
165 .Sh AUTHORS
166 .An Archie Cobbs Aq Mt archie@FreeBSD.org