xref: /freebsd/share/man/man4/ng_gif.4 (revision 2f02600abfddfc4e9f20dd384a2e729b451e16bd)
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.\" $FreeBSD$
30.\"
31.Dd September 18, 2001
32.Dt NG_GIF 4
33.Os
34.Sh NAME
35.Nm ng_gif
36.Nd generic tunnel interface netgraph node type
37.Sh SYNOPSIS
38.In netgraph/ng_gif.h
39.Sh DESCRIPTION
40The
41.Nm
42netgraph node type allows
43.Xr gif 4
44interfaces to interact with
45the
46.Xr netgraph 4
47networking subsystem.
48Once the
49.Nm
50module is loaded in the kernel, a node is automatically created
51for each
52.Xr gif 4
53interface in the system.
54Each node will attempt to name itself with the same name
55as the associated interface.
56All
57.Nm
58nodes are persistent for as long as the interface itself exists.
59.Pp
60Two hooks are supported:
61.Dv lower
62and
63.Dv orphans .
64The hook name
65.Dv divert
66may be used as an alias for
67.Dv lower ,
68and is provided for compatibility with
69.Xr ng_ether 4 .
70In reality the two names represent the same hook.
71.Pp
72The
73.Dv lower
74hook is a connection to the raw
75.Xr gif 4
76device.
77When connected, all incoming packets are diverted out this hook.
78Writing to this hook results in a raw encapsulated packet being transmitted
79by the device.
80Normal outgoing packets are not affected by
81.Dv lower
82being connected.
83.Pp
84The
85.Dv orphans
86hook is equivalent to
87.Dv lower ,
88except that only unrecognized packets (that would otherwise be discarded)
89are written to the hook, and normal incoming traffic is unaffected.
90At most one of
91.Dv orphans
92and
93.Dv lower
94may be connected at any time.
95.Pp
96In all cases, frames are raw packets with the address family of the
97packet attached to the front.
98.Pp
99When no hooks are connected, packets flow normally upwards and downwards.
100.Sh HOOKS
101This node type supports the following hooks:
102.Bl -tag -width ".Va orphans"
103.It Va lower
104Connection to the lower device link layer.
105.It Va orphans
106Like
107.Dv lower ,
108but only receives unrecognized packets.
109.El
110.Sh CONTROL MESSAGES
111This node type supports only the generic control messages.
112.Sh EXAMPLES
113This command dumps all unrecognized packets received by the
114.Li gif0
115interface to standard output decoded in hex and ASCII:
116.Pp
117.Dl "nghook -a gif0: orphans"
118.Sh SEE ALSO
119.Xr gif 4 ,
120.Xr netgraph 4 ,
121.Xr netintro 4 ,
122.Xr ifconfig 8 ,
123.Xr ngctl 8 ,
124.Xr nghook 8
125.Sh AUTHORS
126.An Brooks Davis Aq brooks@FreeBSD.org
127