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 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 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 59An 60.Nm 61node has a single hook corresponding to each supported protocol. 62Packets transmitted via the interface flow out the corresponding 63protocol-specific hook. 64Similarly, packets received on a hook appear on the interface as 65packets received in the corresponding protocol. 66.Pp 67The currently supported protocols are IP, IPX, AppleTalk, and NS. 68In the KLD module, only support for IP is compiled in by default. 69.Pp 70An 71.Nm 72node supports the Berkeley Packet Filter (BPF). 73.Sh HOOKS 74This node type supports the following hooks: 75.Pp 76.Bl -tag -width foobar 77.It Dv inet 78Transmission and reception of IP packets. 79.It Dv ipx 80Transmission and reception of IPX packets. 81.It Dv atalk 82Transmission and reception of AppleTalk packets. 83.It Dv ns 84Transmission and reception of NS packets. 85.El 86.Sh CONTROL MESSAGES 87This node type supports the generic control messages, plus the following: 88.Bl -tag -width foo 89.It Dv NGM_IFACE_GET_IFNAME 90Returns the name of the interface corresponding to this node in a 91.Dv "struct ng_iface_ifname" : 92.Bd -literal -offset 4n 93struct ng_iface_ifname { 94 char ngif_name[NG_IFACE_IFACE_NAME_MAX + 1]; 95}; 96.Ed 97.It Dv NGM_IFACE_GET_IFADDRS 98Returns the list of addresses associated with this interface. 99The list is returned in the same format as the 100.Dv SIOCGIFCONF 101.Fn ioctl . 102.It Dv NGM_CISCO_GET_IPADDR 103This message is defined by the 104.Xr ng_cisco 8 105node type; see 106.Xr ng_cisco 8 107for a description. 108.El 109.Sh SHUTDOWN 110Because it is currently not possible to remove a system networking 111interface in 112.Fx , 113.Nm 114nodes are 115.Em persistent. 116That is, once created they are never destroyed. 117The receipt of a 118.Dv NGM_SHUTDOWN 119control message disconnects all hooks but does not remove the node. 120.Sh SEE ALSO 121.Xr bpf 4 , 122.Xr netgraph 4 , 123.Xr ifconfig 8 , 124.Xr ng_cisco 8 , 125.Xr ng_ppp 8 , 126.Xr ng_rfc1490 8 , 127.Xr ngctl 8 . 128.Sh HISTORY 129The 130.Nm 131node type was implemented in 132.Fx 4.0 . 133.Sh AUTHORS 134.An Archie Cobbs Aq archie@whistle.com 135