1 |
4d875b4f
|
Scott Ullrich
|
<?php
|
2 |
b46bfcf5
|
Bill Marquette
|
/* $Id$ */
|
3 |
5b237745
|
Scott Ullrich
|
/*
|
4 |
|
|
diag_resetstate.php
|
5 |
13d193c2
|
Scott Ullrich
|
Copyright (C) 2004-2009 Scott Ullrich
|
6 |
4d875b4f
|
Scott Ullrich
|
All rights reserved.
|
7 |
|
|
|
8 |
f64b0b8e
|
Phil Davis
|
originally part of m0n0wall (http://m0n0.ch/wall)
|
9 |
5b237745
|
Scott Ullrich
|
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
10 |
|
|
All rights reserved.
|
11 |
4d875b4f
|
Scott Ullrich
|
|
12 |
5b237745
|
Scott Ullrich
|
Redistribution and use in source and binary forms, with or without
|
13 |
|
|
modification, are permitted provided that the following conditions are met:
|
14 |
4d875b4f
|
Scott Ullrich
|
|
15 |
5b237745
|
Scott Ullrich
|
1. Redistributions of source code must retain the above copyright notice,
|
16 |
|
|
this list of conditions and the following disclaimer.
|
17 |
4d875b4f
|
Scott Ullrich
|
|
18 |
5b237745
|
Scott Ullrich
|
2. Redistributions in binary form must reproduce the above copyright
|
19 |
|
|
notice, this list of conditions and the following disclaimer in the
|
20 |
|
|
documentation and/or other materials provided with the distribution.
|
21 |
4d875b4f
|
Scott Ullrich
|
|
22 |
5b237745
|
Scott Ullrich
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
23 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
24 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
25 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
26 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
27 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
29 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
30 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
31 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
32 |
|
|
*/
|
33 |
|
|
|
34 |
13d193c2
|
Scott Ullrich
|
/*
|
35 |
|
|
pfSense_MODULE: filter
|
36 |
|
|
*/
|
37 |
|
|
|
38 |
6b07c15a
|
Matthew Grooms
|
##|+PRIV
|
39 |
|
|
##|*IDENT=page-diagnostics-resetstate
|
40 |
|
|
##|*NAME=Diagnostics: Reset state page
|
41 |
|
|
##|*DESCR=Allow access to the 'Diagnostics: Reset state' page.
|
42 |
|
|
##|*MATCH=diag_resetstate.php*
|
43 |
|
|
##|-PRIV
|
44 |
|
|
|
45 |
5b237745
|
Scott Ullrich
|
require("guiconfig.inc");
|
46 |
ec08d983
|
Ermal Lu?i
|
require_once("filter.inc");
|
47 |
5b237745
|
Scott Ullrich
|
|
48 |
|
|
if ($_POST) {
|
49 |
|
|
$savemsg = "";
|
50 |
|
|
if ($_POST['statetable']) {
|
51 |
|
|
filter_flush_state_table();
|
52 |
|
|
if ($savemsg)
|
53 |
|
|
$savemsg .= " ";
|
54 |
f8ec8de4
|
Renato Botelho
|
$savemsg .= gettext("The state table has been flushed successfully.");
|
55 |
5b237745
|
Scott Ullrich
|
}
|
56 |
f4c2d976
|
jim-p
|
if ($_POST['sourcetracking']) {
|
57 |
|
|
mwexec("/sbin/pfctl -F Sources");
|
58 |
|
|
if ($savemsg)
|
59 |
8cd558b6
|
ayvis
|
$savemsg .= " <br />";
|
60 |
f4c2d976
|
jim-p
|
$savemsg .= gettext("The source tracking table has been flushed successfully.");
|
61 |
|
|
}
|
62 |
5b237745
|
Scott Ullrich
|
}
|
63 |
|
|
|
64 |
f8ec8de4
|
Renato Botelho
|
$pgtitle = array(gettext("Diagnostics"), gettext("Reset state"));
|
65 |
b63695db
|
Scott Ullrich
|
include("head.inc");
|
66 |
|
|
|
67 |
|
|
?>
|
68 |
5b237745
|
Scott Ullrich
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
69 |
|
|
<?php include("fbegin.inc"); ?>
|
70 |
|
|
<?php if ($input_errors) print_input_errors($input_errors); ?>
|
71 |
|
|
<?php if ($savemsg) print_info_box($savemsg); ?>
|
72 |
15953ad5
|
Scott Ullrich
|
<form action="diag_resetstate.php" method="post" name="iform" id="iform">
|
73 |
a2b16c0c
|
Colin Fleming
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="reset states">
|
74 |
15953ad5
|
Scott Ullrich
|
<tr><td>
|
75 |
|
|
<?php
|
76 |
|
|
$tab_array = array();
|
77 |
f4c2d976
|
jim-p
|
$tab_array[] = array(gettext("States"), false, "diag_dump_states.php");
|
78 |
|
|
if (isset($config['system']['lb_use_sticky']))
|
79 |
|
|
$tab_array[] = array(gettext("Source Tracking"), false, "diag_dump_states_sources.php");
|
80 |
|
|
$tab_array[] = array(gettext("Reset States"), true, "diag_resetstate.php");
|
81 |
15953ad5
|
Scott Ullrich
|
display_top_tabs($tab_array);
|
82 |
|
|
?>
|
83 |
|
|
</td></tr>
|
84 |
a2b16c0c
|
Colin Fleming
|
<tr><td class="tabcont">
|
85 |
15953ad5
|
Scott Ullrich
|
|
86 |
a2b16c0c
|
Colin Fleming
|
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
|
87 |
4d875b4f
|
Scott Ullrich
|
<tr>
|
88 |
5b237745
|
Scott Ullrich
|
<td width="22%" valign="top" class="vtable"> </td>
|
89 |
4d875b4f
|
Scott Ullrich
|
<td width="78%" class="vtable"> <p>
|
90 |
a2b16c0c
|
Colin Fleming
|
<input name="statetable" type="checkbox" id="statetable" value="yes" checked="checked" />
|
91 |
8cd558b6
|
ayvis
|
<strong><?= gettext("Firewall state table"); ?></strong><br />
|
92 |
|
|
<span class="vexpl"><br />
|
93 |
f8ec8de4
|
Renato Botelho
|
<?=gettext("Resetting the state tables will remove all entries from " .
|
94 |
|
|
"the corresponding tables. This means that all open connections " .
|
95 |
|
|
"will be broken and will have to be re-established. This " .
|
96 |
|
|
"may be necessary after making substantial changes to the " .
|
97 |
|
|
"firewall and/or NAT rules, especially if there are IP protocol " .
|
98 |
8cd558b6
|
ayvis
|
"mappings (e.g. for PPTP or IPv6) with open connections."); ?><br />
|
99 |
|
|
<br />
|
100 |
f8ec8de4
|
Renato Botelho
|
</span><span class="vexpl"><?=gettext("The firewall will normally leave " .
|
101 |
8cd558b6
|
ayvis
|
"the state tables intact when changing rules."); ?><br />
|
102 |
|
|
<br />
|
103 |
f8ec8de4
|
Renato Botelho
|
<?=gettext("NOTE: If you reset the firewall state table, the browser " .
|
104 |
|
|
"session may appear to be hung after clicking "Reset". " .
|
105 |
|
|
"Simply refresh the page to continue."); ?></span></p>
|
106 |
5b237745
|
Scott Ullrich
|
</td>
|
107 |
|
|
</tr>
|
108 |
f4c2d976
|
jim-p
|
<?php if (isset($config['system']['lb_use_sticky'])): ?>
|
109 |
|
|
<tr>
|
110 |
|
|
<td width="22%" valign="top" class="vtable"> </td>
|
111 |
|
|
<td width="78%" class="vtable"><p>
|
112 |
a2b16c0c
|
Colin Fleming
|
<input name="sourcetracking" type="checkbox" id="sourcetracking" value="yes" checked="checked" />
|
113 |
8cd558b6
|
ayvis
|
<strong><?= gettext("Firewall Source Tracking"); ?></strong><br />
|
114 |
|
|
<span class="vexpl"><br />
|
115 |
f4c2d976
|
jim-p
|
<?=gettext("Resetting the source tracking table will remove all source/destination associations. " .
|
116 |
|
|
"This means that the \"sticky\" source/destination association " .
|
117 |
8cd558b6
|
ayvis
|
"will be cleared for all clients."); ?><br />
|
118 |
|
|
<br />
|
119 |
|
|
</span><span class="vexpl"><?=gettext("This does not clear active connection states, only source tracking."); ?><br />
|
120 |
f4c2d976
|
jim-p
|
</p>
|
121 |
|
|
</td>
|
122 |
|
|
</tr>
|
123 |
|
|
<?php endif; ?>
|
124 |
4d875b4f
|
Scott Ullrich
|
<tr>
|
125 |
5b237745
|
Scott Ullrich
|
<td width="22%" valign="top"> </td>
|
126 |
4d875b4f
|
Scott Ullrich
|
<td width="78%">
|
127 |
a2b16c0c
|
Colin Fleming
|
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Reset"); ?>" />
|
128 |
5b237745
|
Scott Ullrich
|
</td>
|
129 |
|
|
</tr>
|
130 |
|
|
</table>
|
131 |
15953ad5
|
Scott Ullrich
|
</td></tr>
|
132 |
|
|
</table>
|
133 |
5b237745
|
Scott Ullrich
|
</form>
|
134 |
|
|
<?php include("fend.inc"); ?>
|
135 |
|
|
</body>
|
136 |
|
|
</html>
|