1
|
<?php
|
2
|
/* $Id$ */
|
3
|
/*
|
4
|
diag_logs_filter.php
|
5
|
part of pfSesne
|
6
|
Copyright (C) 2004-2009 Scott Ullrich
|
7
|
originally based on m0n0wall (http://m0n0.ch/wall)
|
8
|
|
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-hidden-nolongerincluded
|
40
|
##|*NAME=Hidden: No longer included page
|
41
|
##|*DESCR=Allow access to the 'Hidden: No longer included' page.
|
42
|
##|*MATCH=diag_logs_filter_dynamic.php*
|
43
|
##|-PRIV
|
44
|
|
45
|
require("guiconfig.inc");
|
46
|
require_once("filter_log.inc");
|
47
|
|
48
|
$filter_logfile = "{$g['varlog_path']}/filter.log";
|
49
|
|
50
|
/* Hardcode this. AJAX doesn't do so well with large numbers */
|
51
|
$nentries = 50;
|
52
|
|
53
|
/* AJAX related routines */
|
54
|
handle_ajax($nentries, $nentries + 20);
|
55
|
|
56
|
if ($_POST['clear'])
|
57
|
clear_log_file($filter_logfile);
|
58
|
|
59
|
$filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100);
|
60
|
|
61
|
$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("Firewall (Dynamic View)"));
|
62
|
$shortcut_section = "firewall";
|
63
|
include("head.inc");
|
64
|
|
65
|
?>
|
66
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
67
|
<?php include("fbegin.inc"); ?>
|
68
|
<script type="text/javascript">
|
69
|
//<![CDATA[
|
70
|
lastsawtime = '<?php echo time(); ?>;';
|
71
|
var lines = Array();
|
72
|
var timer;
|
73
|
var updateDelay = 25500;
|
74
|
var isBusy = false;
|
75
|
var isPaused = false;
|
76
|
var nentries = <?php echo $nentries; ?>;
|
77
|
<?php
|
78
|
if(isset($config['syslog']['reverse']))
|
79
|
echo "var isReverse = true;\n";
|
80
|
else
|
81
|
echo "var isReverse = false;\n";
|
82
|
?>
|
83
|
/* Called by the AJAX updater */
|
84
|
function format_log_line(row) {
|
85
|
var i = 0;
|
86
|
var line = '<td class="listMRlr nowrap" align="center">' + row[i++] + '<\/td>';
|
87
|
while (i < 6) {
|
88
|
line += '<td class="listMRr nowrap">' + row[i++] + '<\/td>';
|
89
|
}
|
90
|
return line;
|
91
|
}
|
92
|
//]]>
|
93
|
</script>
|
94
|
<script src="/javascript/filter_log.js" type="text/javascript"></script>
|
95
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="logs filter dynamic">
|
96
|
<tr><td>
|
97
|
<?php
|
98
|
$tab_array = array();
|
99
|
$tab_array[] = array(gettext("System"), false, "diag_logs.php");
|
100
|
$tab_array[] = array(gettext("Firewall"), true, "diag_logs_filter.php");
|
101
|
$tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php");
|
102
|
$tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php");
|
103
|
$tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php");
|
104
|
$tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php");
|
105
|
$tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php");
|
106
|
$tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php");
|
107
|
$tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php");
|
108
|
$tab_array[] = array(gettext("NTP"), false, "diag_logs_ntpd.php");
|
109
|
$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
|
110
|
display_top_tabs($tab_array);
|
111
|
?>
|
112
|
</td></tr>
|
113
|
<tr><td class="tabnavtbl">
|
114
|
<?php
|
115
|
$tab_array = array();
|
116
|
$tab_array[] = array(gettext("Normal View"), false, "/diag_logs_filter.php");
|
117
|
$tab_array[] = array(gettext("Dynamic View"), true, "/diag_logs_filter_dynamic.php");
|
118
|
$tab_array[] = array(gettext("Summary View"), false, "/diag_logs_filter_summary.php");
|
119
|
display_top_tabs($tab_array);
|
120
|
?>
|
121
|
</td>
|
122
|
</tr>
|
123
|
<tr>
|
124
|
<td>
|
125
|
<div id="mainarea">
|
126
|
<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
|
127
|
<thead>
|
128
|
<tr>
|
129
|
<td colspan="6" class="listtopic">
|
130
|
<?php printf(gettext("Last %s records"),$nentries);?>; <?=gettext("Pause:");?><input style="vertical-align:middle;" type="checkbox" onclick="javascript:toggle_pause();" />
|
131
|
</td>
|
132
|
</tr>
|
133
|
<tr>
|
134
|
<td width="10%" class="listhdrr"><?=gettext("Act");?></td>
|
135
|
<td width="10%" class="listhdrr"><?=gettext("Time");?></td>
|
136
|
<td width="15%" class="listhdrr"><?=gettext("If");?></td>
|
137
|
<td width="25%" class="listhdrr"><?=gettext("Source");?></td>
|
138
|
<td width="25%" class="listhdrr"><?=gettext("Destination");?></td>
|
139
|
<td width="15%" class="listhdrr"><?=gettext("Proto");?></td>
|
140
|
</tr>
|
141
|
</thead>
|
142
|
<tbody id="filter-log-entries">
|
143
|
<?php
|
144
|
$rowIndex = 0;
|
145
|
foreach ($filterlog as $filterent):
|
146
|
$evenRowClass = $rowIndex % 2 ? " listMReven" : " listMRodd";
|
147
|
$rowIndex++;?>
|
148
|
<tr class="<?=$evenRowClass?>">
|
149
|
<td class="listMRlr nowrap" align="center">
|
150
|
<a href="#" onclick="javascript:getURL('diag_logs_filter.php?getrulenum=<?php echo "{$filterent['rulenum']},{$filterent['act']}"; ?>', outputrule);">
|
151
|
<img border="0" src="<?php echo find_action_image($filterent['act']);?>" width="11" height="11" alt="<?php echo $filterent['act'];?>" title="<?php echo $filterent['act'];?>" />
|
152
|
</a>
|
153
|
</td>
|
154
|
<td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['time']);?></td>
|
155
|
<td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['interface']);?></td>
|
156
|
<td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['src']);?></td>
|
157
|
<td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['dst']);?></td>
|
158
|
<?php
|
159
|
if ($filterent['proto'] == "TCP")
|
160
|
$filterent['proto'] .= ":{$filterent['tcpflags']}";
|
161
|
?>
|
162
|
<td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['proto']);?></td>
|
163
|
</tr>
|
164
|
<?php endforeach; ?>
|
165
|
<tr style="display:none;"><td></td></tr>
|
166
|
</tbody>
|
167
|
</table>
|
168
|
</div>
|
169
|
</td>
|
170
|
</tr>
|
171
|
</table>
|
172
|
<p><span class="vexpl"><a href="https://doc.pfsense.org/index.php/What_are_TCP_Flags%3F"><?=gettext("TCP Flags"); ?></a>: F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, C - CWR</span></p>
|
173
|
<?php include("fend.inc"); ?>
|
174
|
</body>
|
175
|
</html>
|