Merge from vendor branch NTPD:
[dragonfly.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: src/share/man/man4/ng_iface.4,v 1.13.2.1 2001/12/21 09:00:51 ru Exp $
36 .\" $DragonFly: src/share/man/man4/ng_iface.4,v 1.2 2003/06/17 04:36:59 dillon Exp $
37 .\" $Whistle: ng_iface.8,v 1.5 1999/01/25 23:46:26 archie Exp $
38 .\"
39 .Dd January 19, 1999
40 .Dt NG_IFACE 4
41 .Os
42 .Sh NAME
43 .Nm ng_iface
44 .Nd interface netgraph node type
45 .Sh SYNOPSIS
46 .In netgraph/ng_iface.h
47 .Sh DESCRIPTION
48 An
49 .Nm iface
50 node is both a netgraph node and a system networking interface.  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, IPv6, AppleTalk, IPX, ATM,
74 NATM, and NS.
75 .Pp
76 An
77 .Nm iface
78 node be configured as a point-to-point interface or a broadcast interface.
79 The configuration can only be changed when the interface is down.
80 The default mode is point-to-point.
81 .Pp
82 .Nm Iface
83 nodes support the Berkeley Packet Filter (BPF).
84 .Sh HOOKS
85 This node type supports the following hooks:
86 .Pp
87 .Bl -tag -width foobar
88 .It Dv inet
89 Transmission and reception of IP packets.
90 .It Dv inet6
91 Transmission and reception of IPv6 packets.
92 .It Dv atalk
93 Transmission and reception of AppleTalk packets.
94 .It Dv ipx
95 Transmission and reception of IPX packets.
96 .It Dv atm
97 Transmission and reception of ATM packets.
98 .It Dv natm
99 Transmission and reception of NATM packets.
100 .It Dv ns
101 Transmission and reception of NS packets.
102 .El
103 .Sh CONTROL MESSAGES
104 This node type supports the generic control messages, plus the following:
105 .Bl -tag -width foo
106 .It Dv NGM_IFACE_GET_IFNAME
107 Returns the name of the interface corresponding to this node in a
108 .Dv "struct ng_iface_ifname" :
109 .Bd -literal -offset 4n
110 struct ng_iface_ifname {
111   char  ngif_name[NG_IFACE_IFACE_NAME_MAX + 1];
112 };
113 .Ed
114 .It Dv NGM_IFACE_POINT2POINT
115 Set the interface to point-to-point mode.
116 The interface must not currently be up.
117 .It Dv NGM_IFACE_BROADCAST
118 Set the interface to broadcast mode.
119 The interface must not currently be up.
120 .It Dv NGM_CISCO_GET_IPADDR
121 This message is defined by the
122 .Xr ng_cisco 4
123 node type; see
124 .Xr ng_cisco 4
125 for a description.
126 .El
127 .Sh SHUTDOWN
128 This node shuts down upon receipt of a
129 .Dv NGM_SHUTDOWN
130 control message.  The associated interface is removed and becomes available
131 for use by future
132 .Nm iface
133 nodes.
134 .Pp
135 Unlike most other node types, an
136 .Nm iface
137 node does
138 .Em not
139 go away when all hooks have been disconnected; rather, and explicit
140 .Dv NGM_SHUTDOWN
141 control message is required.
142 .Sh SEE ALSO
143 .Xr bpf 4 ,
144 .Xr netgraph 4 ,
145 .Xr ng_cisco 4 ,
146 .Xr ifconfig 8 ,
147 .Xr ngctl 8
148 .Sh HISTORY
149 The
150 .Nm iface
151 node type was implemented in
152 .Fx 4.0 .
153 .Sh AUTHORS
154 .An Archie Cobbs Aq archie@FreeBSD.org