Project

General

Profile

Download (4.12 KB) Statistics
| Branch: | Tag: | Revision:
1
#!/usr/local/bin/php
2
<?php 
3
/*
4
	diag_resetstate.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6
	
7
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9
	
10
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12
	
13
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15
	
16
	2. Redistributions in binary form must reproduce the above copyright
17
	   notice, this list of conditions and the following disclaimer in the
18
	   documentation and/or other materials provided with the distribution.
19
	
20
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
	POSSIBILITY OF SUCH DAMAGE.
30
*/
31

    
32
require("guiconfig.inc");
33

    
34
if ($_POST) {
35

    
36
	$savemsg = "";
37
	if ($_POST['nattable']) {
38
		filter_flush_nat_table();
39
		$savemsg = "The NAT table has been flushed successfully.";
40
	}
41
	if ($_POST['statetable']) {
42
		filter_flush_state_table();
43
		if ($savemsg)
44
			$savemsg .= " ";
45
		$savemsg .= "The state table has been flushed successfully.";
46
	}
47
}
48
?>
49
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
50
<html>
51
<head>
52
<title><?=gentitle("Diagnostics: Reset state");?></title>
53
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
54
<link href="gui.css" rel="stylesheet" type="text/css">
55
</head>
56

    
57
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
58
<?php include("fbegin.inc"); ?>
59
      <p class="pgtitle">Diagnostics: Reset state</p>
60
<?php if ($input_errors) print_input_errors($input_errors); ?>
61
<?php if ($savemsg) print_info_box($savemsg); ?>
62
            <form action="diag_resetstate.php" method="post" name="iform" id="iform">
63
              <table width="100%" border="0" cellpadding="6" cellspacing="0">
64
                <tr> 
65
                  <td width="22%" valign="top" class="vtable">&nbsp;</td>
66
                  <td width="78%" class="vtable"> <p> 
67
                      <input name="nattable" type="checkbox" id="nattable" value="yes" checked>
68
                      <strong>NAT table</strong><br>
69
                      <input name="statetable" type="checkbox" id="statetable" value="yes" checked>
70
                      <strong>Firewall state table</strong><br>
71
                      <span class="vexpl"><br>
72
                      Resetting the state tables will remove all entries from 
73
                      the corresponding tables. This means that all open connections 
74
                      will be broken and will have to be re-established. This 
75
                      may be necessary after making substantial changes to the 
76
                      firewall and/or NAT rules, especially if there are IP protocol 
77
                      mappings (e.g. for PPTP or IPv6) with open connections.<br>
78
                      <br>
79
                      </span><span class="vexpl">The firewall will normally leave 
80
                      the state tables intact when changing rules.<br>
81
                      <br>
82
                      NOTE: If you reset the firewall state table, the browser 
83
                      session may appear to be hung after clicking &quot;Reset&quot;. 
84
                      Simply refresh the page to continue.</span></p>
85
                    </td>
86
				</tr>
87
                <tr> 
88
                  <td width="22%" valign="top">&nbsp;</td>
89
                  <td width="78%"> 
90
                    <input name="Submit" type="submit" class="formbtn" value="Reset"> 
91
                  </td>
92
                </tr>
93
              </table>
94
</form>
95
<?php include("fend.inc"); ?>
96
</body>
97
</html>
(12-12/86)