xref: /freebsd/share/man/man4/ng_iface.4 (revision dda5b39711dab90ae1c5624bdd6ff7453177df31)
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 October 28, 2005
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
47An
48.Nm iface
49node is both a netgraph node and a system networking interface.
50When an
51.Nm iface
52node is created, a new interface appears which is accessible via
53.Xr ifconfig 8 .
54.Nm Iface
55node interfaces are named
56.Dv ng0 ,
57.Dv ng1 ,
58etc.
59When a node is shutdown, the corresponding interface is removed
60and the interface name becomes available for reuse by future
61.Nm iface
62nodes; new nodes always take the first unused interface.
63The node itself is assigned the same name as its interface, unless the name
64already exists, in which case the node remains unnamed.
65.Pp
66An
67.Nm iface
68node has a single hook corresponding to each supported protocol.
69Packets transmitted via the interface flow out the corresponding
70protocol-specific hook.
71Similarly, packets received on a hook appear on the interface as
72packets received into the corresponding protocol stack.
73The currently supported protocols are IP, IPv6, AppleTalk, ATM,
74NATM, and NS.
75.Pp
76An
77.Nm iface
78node can be configured as a point-to-point interface or a broadcast interface.
79The configuration can only be changed when the interface is down.
80The default mode is point-to-point.
81.Pp
82.Nm Iface
83nodes support the Berkeley Packet Filter (BPF).
84.Sh HOOKS
85This node type supports the following hooks:
86.Bl -tag -width ".Va inet6"
87.It Va inet
88Transmission and reception of IP packets.
89.It Va inet6
90Transmission and reception of IPv6 packets.
91.It Va atalk
92Transmission and reception of AppleTalk packets.
93.It Va atm
94Transmission and reception of ATM packets.
95.It Va natm
96Transmission and reception of NATM packets.
97.It Va ns
98Transmission and reception of NS packets.
99.El
100.Sh CONTROL MESSAGES
101This node type supports the generic control messages, plus the following:
102.Bl -tag -width foo
103.It Dv NGM_IFACE_GET_IFNAME Pq Ic getifname
104Returns the name of the associated interface as a
105.Dv NUL Ns -terminated
106.Tn ASCII
107string.
108Normally this is the same as the name of the node.
109.It Dv NGM_IFACE_GET_IFINDEX Pq Ic getifindex
110Returns the global index of the associated interface as a 32 bit integer.
111.It Dv NGM_IFACE_POINT2POINT Pq Ic point2point
112Set the interface to point-to-point mode.
113The interface must not currently be up.
114.It Dv NGM_IFACE_BROADCAST Pq Ic broadcast
115Set the interface to broadcast mode.
116The interface must not currently be up.
117.It Dv NGM_CISCO_GET_IPADDR Pq Ic getipaddr
118This message is defined by the
119.Xr ng_cisco 4
120node type; see
121.Xr ng_cisco 4
122for a description.
123.El
124.Sh SHUTDOWN
125This node shuts down upon receipt of a
126.Dv NGM_SHUTDOWN
127control message.
128The associated interface is removed and becomes available
129for use by future
130.Nm iface
131nodes.
132.Pp
133Unlike most other node types, an
134.Nm iface
135node does
136.Em not
137go away when all hooks have been disconnected; rather, and explicit
138.Dv NGM_SHUTDOWN
139control message is required.
140.Sh ALTQ Support
141The
142.Nm
143interface supports ALTQ bandwidth management feature.
144However,
145.Nm
146is a special case, since it is not a physical interface with limited bandwidth.
147One should not turn ALTQ on
148.Nm
149if the latter corresponds to some tunneled connection, e.g.\& PPPoE or PPTP.
150In this case, ALTQ should be configured on the interface that is used to
151transmit the encapsulated packets.
152In case when your graph ends up with some kind of serial line, either
153synchronous or modem, the
154.Nm
155is the right place to turn ALTQ on.
156.Sh SEE ALSO
157.Xr altq 4 ,
158.Xr bpf 4 ,
159.Xr netgraph 4 ,
160.Xr ng_cisco 4 ,
161.Xr ifconfig 8 ,
162.Xr ngctl 8
163.Sh HISTORY
164The
165.Nm iface
166node type was implemented in
167.Fx 4.0 .
168.Sh AUTHORS
169.An Archie Cobbs Aq archie@FreeBSD.org
170