xref: /freebsd/share/man/man4/ng_ipfw.4 (revision 61e21613)
1.\" Copyright (c) 2005 Gleb Smirnoff
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
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.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.Dd March 2, 2010
26.Dt NG_IPFW 4
27.Os
28.Sh NAME
29.Nm ng_ipfw
30.Nd interface between netgraph and IP firewall
31.Sh SYNOPSIS
32.In netinet/ip_var.h
33.In netgraph/ng_ipfw.h
34.Sh DESCRIPTION
35The
36.Nm ipfw
37node implements interface between
38.Xr ipfw 4
39and
40.Xr netgraph 4
41subsystems.
42.Sh HOOKS
43The
44.Nm ipfw
45node supports an arbitrary number of hooks,
46which must be named using only numeric characters.
47.Sh OPERATION
48Once the
49.Nm
50module is loaded into the kernel, a single node named
51.Va ipfw
52is automatically created.
53No more
54.Nm ipfw
55nodes can be created.
56Once destroyed, the only way to recreate the node is to reload the
57.Nm
58module.
59.Pp
60Packets can be injected into
61.Xr netgraph 4
62using either the
63.Cm netgraph
64or
65.Cm ngtee
66commands of the
67.Xr ipfw 8
68utility.
69These commands require a numeric cookie to be supplied as an argument.
70Packets are sent out of the hook whose name equals the cookie value.
71If no hook matches, packets are discarded.
72Packets injected via the
73.Cm netgraph
74command are tagged with
75.Vt "struct ipfw_rule_ref" .
76This tag contains information that helps the packet to re-enter
77.Xr ipfw 4
78processing, should the packet come back from
79.Xr netgraph 4
80to
81.Xr ipfw 4 .
82.Pp
83Packets received by a node from
84.Xr netgraph 4
85subsystem must be tagged with
86.Vt "struct ipfw_rule_ref"
87tag.
88Packets re-enter IP firewall processing at the next rule.
89If no tag is supplied, packets are discarded.
90.Sh CONTROL MESSAGES
91This node type supports only the generic control messages.
92.Sh SHUTDOWN
93This node shuts down upon receipt of a
94.Dv NGM_SHUTDOWN
95control message.
96Do not do this, since the new
97.Nm ipfw
98node can only be created by reloading the
99.Nm
100module.
101.Sh SEE ALSO
102.Xr ipfw 4 ,
103.Xr netgraph 4 ,
104.Xr ipfw 8 ,
105.Xr mbuf_tags 9
106.Sh HISTORY
107The
108.Nm ipfw
109node type was implemented in
110.Fx 6.0 .
111.Sh AUTHORS
112The
113.Nm ipfw
114node was written by
115.An Gleb Smirnoff Aq Mt glebius@FreeBSD.org .
116