Project

General

Profile

Download (5.54 KB) Statistics
| Branch: | Tag: | Revision:

univnautes / usr / local / www / diag_resetstate.php @ a1b66bec

1
<?php
2
/* $Id$ */
3
/*
4
	diag_resetstate.php
5
	Copyright (C) 2004-2009 Scott Ullrich
6
	All rights reserved.
7

    
8
	originally part of m0n0wall (http://m0n0.ch/wall)
9
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
	All rights reserved.
11

    
12
	Redistribution and use in source and binary forms, with or without
13
	modification, are permitted provided that the following conditions are met:
14

    
15
	1. Redistributions of source code must retain the above copyright notice,
16
	   this list of conditions and the following disclaimer.
17

    
18
	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

    
22
	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
/*
35
	pfSense_MODULE:	filter
36
*/
37

    
38
##|+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
require("guiconfig.inc");
46
require_once("filter.inc");
47

    
48
if ($_POST) {
49
	$savemsg = "";
50
	if ($_POST['statetable']) {
51
		filter_flush_state_table();
52
		if ($savemsg)
53
			$savemsg .= " ";
54
		$savemsg .= gettext("The state table has been flushed successfully.");
55
	}
56
	if ($_POST['sourcetracking']) {
57
		mwexec("/sbin/pfctl -F Sources");
58
		if ($savemsg)
59
			$savemsg .= " <br />";
60
		$savemsg .= gettext("The source tracking table has been flushed successfully.");
61
	}
62
}
63

    
64
$pgtitle = array(gettext("Diagnostics"), gettext("Reset state"));
65
include("head.inc");
66

    
67
?>
68
<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
        <form action="diag_resetstate.php" method="post" name="iform" id="iform">
73
	<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="reset states">
74
	<tr><td>
75
	<?php
76
		$tab_array = array();
77
		$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
		display_top_tabs($tab_array);
82
	?>
83
	</td></tr>
84
	<tr><td class="tabcont">
85
	    
86
              <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
87
                <tr>
88
                  <td width="22%" valign="top" class="vtable">&nbsp;</td>
89
                  <td width="78%" class="vtable"> <p>
90
                      <input name="statetable" type="checkbox" id="statetable" value="yes" checked="checked" />
91
                      <strong><?= gettext("Firewall state table"); ?></strong><br />
92
                      <span class="vexpl"><br />
93
                      <?=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
                      "mappings (e.g. for PPTP or IPv6) with open connections."); ?><br />
99
                      <br />
100
                      </span><span class="vexpl"><?=gettext("The firewall will normally leave " .
101
                      "the state tables intact when changing rules."); ?><br />
102
                      <br />
103
                      <?=gettext("NOTE: If you reset the firewall state table, the browser " .
104
                      "session may appear to be hung after clicking &quot;Reset&quot;. " .
105
                      "Simply refresh the page to continue."); ?></span></p>
106
                    </td>
107
				</tr>
108
		<?php if (isset($config['system']['lb_use_sticky'])): ?>
109
		<tr>
110
			<td width="22%" valign="top" class="vtable">&nbsp;</td>
111
			<td width="78%" class="vtable"><p>
112
			<input name="sourcetracking" type="checkbox" id="sourcetracking" value="yes" checked="checked" />
113
			<strong><?= gettext("Firewall Source Tracking"); ?></strong><br />
114
			<span class="vexpl"><br />
115
			<?=gettext("Resetting the source tracking table will remove all source/destination associations. " .
116
			"This means that the \"sticky\" source/destination association " .
117
			"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
			</p>
121
			</td>
122
		</tr>
123
		<?php endif; ?>
124
                <tr>
125
                  <td width="22%" valign="top">&nbsp;</td>
126
                  <td width="78%">
127
                    <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Reset"); ?>" />
128
                  </td>
129
                </tr>
130
              </table>
131
	 </td></tr>
132
	</table>
133
</form>
134
<?php include("fend.inc"); ?>
135
</body>
136
</html>
(44-44/256)