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@whistle.com> 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 8 40.Os FreeBSD 3 41.Sh NAME 42.Nm ng_iface 43.Nd interface netgraph node type 44.Sh SYNOPSIS 45.Fd #include <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 point-to-point interface appears which is accessible via 52.Xr ifconfig 8 . 53The new interfaces are named 54.Dv ng0 , 55.Dv ng1 , 56etc. The node is assigned the same name as its interface, unless the name 57already exists, in which case the node remains unnamed. 58.Pp 59.Nm Iface 60nodes have a single hook corresponding to each supported protocol. 61Packets transmitted via the interface flow out the corresponding 62protocol-specific hook. 63Similarly, packets received on a hook appear on the interface as 64packets received in the corresponding protocol. 65.Pp 66The currently supported protocols are IP, IPX, AppleTalk, and NS. 67In the KLD module, only support for IP is compiled in by default. 68.Pp 69.Nm Iface 70nodes support the Berkeley Packet Filter (BPF). 71In the KLD module, this support is disabled by default. 72.Sh HOOKS 73This node type supports the following hooks: 74.Pp 75.Bl -tag -width foobar 76.It Dv inet 77Transmission and reception of IP packets. 78.It Dv ipx 79Transmission and reception of IPX packets. 80.It Dv atalk 81Transmission and reception of AppleTalk packets. 82.It Dv ns 83Transmission and reception of NS packets. 84.El 85.Sh CONTROL MESSAGES 86This node type supports the generic control messages, plus the following: 87.Bl -tag -width foo 88.It Dv NGM_IFACE_GET_IFNAME 89Returns the name of the interface corresponding to this node in a 90.Dv "struct ng_iface_ifname" : 91.Bd -literal -offset 4n 92struct ng_iface_ifname { 93 char ngif_name[NG_IFACE_IFACE_NAME_MAX + 1]; 94}; 95.Ed 96.It Dv NGM_IFACE_GET_IFADDRS 97Returns the list of addresses associated with this interface. 98The list is returned in the same format as the 99.Dv SIOCGIFCONF 100ioctl(). 101.It Dv NGM_CISCO_GET_IPADDR 102This message is defined by the 103.Xr ng_cisco 8 104node type; see 105.Xr ng_cisco 8 106for a description. 107.El 108.Sh SHUTDOWN 109Because it is currenly not possible to remove a system networking 110interface in FreeBSD, 111.Nm iface 112nodes are 113.Em persistent. 114That is, once created they are never destroyed. 115The receipt of a 116.Dv NGM_SHUTDOWN 117control message disconnects all hooks but does not remove the node. 118.Sh SEE ALSO 119.Xr netgraph 4 , 120.Xr bpf 4 , 121.Xr ng_cisco 8 , 122.Xr ng_rfc1490 8 , 123.Xr ngctl 8 , 124.Xr ifconfig 8 . 125.Sh AUTHOR 126Archie Cobbs <archie@whistle.com> 127