Project

General

Profile

Download (3.25 KB) Statistics
| Branch: | Tag: | Revision:
1 438d04f6 Scott Ullrich
<?php
2
/* $Id$ */
3
/*
4
    diag_pf_info.php
5
    Copyright (C) 2010 Scott Ullrich
6 dd447bde Jim Thompson
    Copyright (C) 2013-2014 Electric Sheep Fencing, LP
7 438d04f6 Scott Ullrich
    All rights reserved.
8
9
    Redistribution and use in source and binary forms, with or without
10
    modification, are permitted provided that the following conditions are met:
11
12
    1. Redistributions of source code must retain the above copyright notice,
13
       this list of conditions and the following disclaimer.
14
15
    2. Redistributions in binary form must reproduce the above copyright
16
       notice, this list of conditions and the following disclaimer in the
17
       documentation and/or other materials provided with the distribution.
18
19
    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
    AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
    AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
23
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
    POSSIBILITY OF SUCH DAMAGE.
29
*/
30
31
/*
32
	pfSense_BUILDER_BINARIES:	/usr/bin/top
33
	pfSense_MODULE:	system
34
*/
35
36
##|+PRIV
37 7997ed44 Renato Botelho
##|*IDENT=page-diagnostics-pf-info
38
##|*NAME=Diagnostics: pfInfo
39
##|*DESCR=Allows access to the 'Diagnostics: pfInfo' page
40
##|*MATCH=diag_pf_info.php*
41 438d04f6 Scott Ullrich
##|-PRIV
42
43
require("guiconfig.inc");
44
45 79992f17 Scott Ullrich
$pgtitle = gettext("Diagnostics: pfInfo");
46 438d04f6 Scott Ullrich
47
if($_REQUEST['getactivity']) {
48
	$text = `/sbin/pfctl -vvsi`;
49
	$text .= "<p/>";
50 7fd51c68 Scott Ullrich
	$text .= `/sbin/pfctl -vvsm`;
51
	$text .= "<p/>";
52
	$text .= `/sbin/pfctl -vvst`;
53
	$text .= "<p/>";
54 438d04f6 Scott Ullrich
	$text .= `/sbin/pfctl -vvsI`;
55
	echo $text;
56
	exit;
57
}
58
59
include("head.inc");
60
61
?>
62
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
63 7442b5c6 Colin Fleming
<?php include("fbegin.inc"); ?>
64 438d04f6 Scott Ullrich
<script type="text/javascript">
65 1cbbef94 Warren Baker
jQuery(document).ready(function() {setTimeout('getpfinfo()', 5000);});
66 7442b5c6 Colin Fleming
//<![CDATA[
67 1cbbef94 Warren Baker
	function getpfinfo() {
68
		jQuery.ajax({
69
			type: "POST",
70
			url: "/diag_pf_info.php",
71
			data: 'getactivity=yes',
72
			async: false,
73
			complete: activitycallback
74
		});
75 438d04f6 Scott Ullrich
	}
76
	function activitycallback(transport) {
77 7442b5c6 Colin Fleming
		jQuery('#pfactivitydiv').html('<font face="Courier" size="2"><pre style="text-align:left;">' + transport.responseText  + '<\/pre><\/font>');
78 1cbbef94 Warren Baker
		setTimeout('getpfinfo()', 2000);
79 438d04f6 Scott Ullrich
	}
80 7442b5c6 Colin Fleming
//]]>
81 438d04f6 Scott Ullrich
</script>
82 7442b5c6 Colin Fleming
<div id="maincontent">
83 438d04f6 Scott Ullrich
<?php
84
	if($savemsg) {
85 7442b5c6 Colin Fleming
		echo "<div id=\"savemsg\">";
86 438d04f6 Scott Ullrich
		print_info_box($savemsg);
87
		echo "</div>";	
88
	}
89
	if ($input_errors)
90
		print_input_errors($input_errors);
91
?>
92 7442b5c6 Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="diag pf info">
93 438d04f6 Scott Ullrich
  <tr>
94
    <td>
95 7442b5c6 Colin Fleming
	<table id="backuptable" class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0" summary="tabcont">
96 438d04f6 Scott Ullrich
		<tr>
97 7442b5c6 Colin Fleming
			<td align="center">
98
				<table summary="results">
99 438d04f6 Scott Ullrich
					<tr><td>
100 7442b5c6 Colin Fleming
						<div id="pfactivitydiv">
101
							<?=gettext("Gathering PF information, please wait...");?>
102 438d04f6 Scott Ullrich
						</div>
103
					</td></tr>
104
				</table>
105
			</td>
106
		</tr>
107
	</table>
108
    </td>
109
  </tr>
110
</table>
111 7442b5c6 Colin Fleming
</div>
112 438d04f6 Scott Ullrich
<?php include("fend.inc"); ?>
113
</body>
114 7997ed44 Renato Botelho
</html>