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 January 19, 1999 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. When an 50.Nm iface 51node is created, a new interface appears which is accessible via 52.Xr ifconfig 8 . 53.Nm Iface 54node interfaces are named 55.Dv ng0 , 56.Dv ng1 , 57etc. 58When a node is shutdown, the corresponding interface is removed 59and the interface name becomes available for reuse by future 60.Nm iface 61nodes; new nodes always take the first unused interface. 62The node itself is assigned the same name as its interface, unless the name 63already exists, in which case the node remains unnamed. 64.Pp 65An 66.Nm iface 67node has a single hook corresponding to each supported protocol. 68Packets transmitted via the interface flow out the corresponding 69protocol-specific hook. 70Similarly, packets received on a hook appear on the interface as 71packets received into the corresponding protocol stack. 72The currently supported protocols are IP, IPv6, AppleTalk, IPX, ATM, 73NATM, and NS. 74.Pp 75An 76.Nm iface 77node be configured as a point-to-point interface or a broadcast interface. 78The configuration can only be changed when the interface is down. 79The default mode is point-to-point. 80.Pp 81.Nm Iface 82nodes support the Berkeley Packet Filter (BPF). 83.Sh HOOKS 84This node type supports the following hooks: 85.Pp 86.Bl -tag -width foobar 87.It Dv inet 88Transmission and reception of IP packets. 89.It Dv inet6 90Transmission and reception of IPv6 packets. 91.It Dv atalk 92Transmission and reception of AppleTalk packets. 93.It Dv ipx 94Transmission and reception of IPX packets. 95.It Dv atm 96Transmission and reception of ATM packets. 97.It Dv natm 98Transmission and reception of NATM packets. 99.It Dv ns 100Transmission and reception of NS packets. 101.El 102.Sh CONTROL MESSAGES 103This node type supports the generic control messages, plus the following: 104.Bl -tag -width foo 105.It Dv NGM_IFACE_GET_IFNAME 106Returns the name of the interface corresponding to this node in a 107.Dv "struct ng_iface_ifname" : 108.Bd -literal -offset 4n 109struct ng_iface_ifname { 110 char ngif_name[NG_IFACE_IFACE_NAME_MAX + 1]; 111}; 112.Ed 113.It Dv NGM_IFACE_POINT2POINT 114Set the interface to point-to-point mode. 115The interface must not currently be up. 116.It Dv NGM_IFACE_BROADCAST 117Set the interface to broadcast mode. 118The interface must not currently be up. 119.It Dv NGM_CISCO_GET_IPADDR 120This message is defined by the 121.Xr ng_cisco 4 122node type; see 123.Xr ng_cisco 4 124for a description. 125.El 126.Sh SHUTDOWN 127This node shuts down upon receipt of a 128.Dv NGM_SHUTDOWN 129control message. The associated interface is removed and becomes available 130for use by future 131.Nm iface 132nodes. 133.Pp 134Unlike most other node types, an 135.Nm iface 136node does 137.Em not 138go away when all hooks have been disconnected; rather, and explicit 139.Dv NGM_SHUTDOWN 140control message is required. 141.Sh SEE ALSO 142.Xr bpf 4 , 143.Xr netgraph 4 , 144.Xr ng_cisco 4 , 145.Xr ifconfig 8 , 146.Xr ngctl 8 147.Sh HISTORY 148The 149.Nm iface 150node type was implemented in 151.Fx 4.0 . 152.Sh AUTHORS 153.An Archie Cobbs Aq archie@FreeBSD.org 154