1.\" Copyright 2000 The Aerospace Corporation. All rights reserved. 2.\" 3.\" Redistribution and use in source and binary forms, with or without 4.\" modification, are permitted provided that the following conditions 5.\" are met: 6.\" 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions, and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions, and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. The name of The Aerospace Corporation may not be used to endorse or 13.\" promote products derived from this software. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE AEROSPACE CORPORATION "AS IS" AND 16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AEROSPACE CORPORATION BE LIABLE FOR 19.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25.\" SUCH DAMAGE. 26.\" 27.\" Author: Brooks Davis <brooks@FreeBSD.org> 28.\" 29.Dd September 18, 2001 30.Dt NG_GIF 4 31.Os 32.Sh NAME 33.Nm ng_gif 34.Nd generic tunnel interface netgraph node type 35.Sh SYNOPSIS 36.In netgraph/ng_gif.h 37.Sh DESCRIPTION 38The 39.Nm 40netgraph node type allows 41.Xr gif 4 42interfaces to interact with 43the 44.Xr netgraph 4 45networking subsystem. 46Once the 47.Nm 48module is loaded in the kernel, a node is automatically created 49for each 50.Xr gif 4 51interface in the system. 52Each node will attempt to name itself with the same name 53as the associated interface. 54All 55.Nm 56nodes are persistent for as long as the interface itself exists. 57.Pp 58Two hooks are supported: 59.Dv lower 60and 61.Dv orphans . 62The hook name 63.Dv divert 64may be used as an alias for 65.Dv lower , 66and is provided for compatibility with 67.Xr ng_ether 4 . 68In reality the two names represent the same hook. 69.Pp 70The 71.Dv lower 72hook is a connection to the raw 73.Xr gif 4 74device. 75When connected, all incoming packets are diverted out this hook. 76Writing to this hook results in a raw encapsulated packet being transmitted 77by the device. 78Normal outgoing packets are not affected by 79.Dv lower 80being connected. 81.Pp 82The 83.Dv orphans 84hook is equivalent to 85.Dv lower , 86except that only unrecognized packets (that would otherwise be discarded) 87are written to the hook, and normal incoming traffic is unaffected. 88At most one of 89.Dv orphans 90and 91.Dv lower 92may be connected at any time. 93.Pp 94In all cases, frames are raw packets with the address family of the 95packet attached to the front. 96.Pp 97When no hooks are connected, packets flow normally upwards and downwards. 98.Sh HOOKS 99This node type supports the following hooks: 100.Bl -tag -width ".Va orphans" 101.It Va lower 102Connection to the lower device link layer. 103.It Va orphans 104Like 105.Dv lower , 106but only receives unrecognized packets. 107.El 108.Sh CONTROL MESSAGES 109This node type supports only the generic control messages. 110.Sh EXAMPLES 111This command dumps all unrecognized packets received by the 112.Li gif0 113interface to standard output decoded in hex and ASCII: 114.Pp 115.Dl "nghook -a gif0: orphans" 116.Sh SEE ALSO 117.Xr gif 4 , 118.Xr netgraph 4 , 119.Xr netintro 4 , 120.Xr ifconfig 8 , 121.Xr ngctl 8 , 122.Xr nghook 8 123.Sh AUTHORS 124.An Brooks Davis Aq Mt brooks@FreeBSD.org 125