summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-01-11 16:41:12 -0500
committerjim-p <jimp@pfsense.org>2012-01-11 16:41:12 -0500
commitfd8774c085e47af5f4aa6349aac3de11c305f4c1 (patch)
tree8b60116ee6f14a119a8ce56206ce837d084ccc60 /usr/local
parentb397879f2b2fcdee978839eb4ec7dace8a7fd39e (diff)
downloadpfsense-fd8774c085e47af5f4aa6349aac3de11c305f4c1.zip
pfsense-fd8774c085e47af5f4aa6349aac3de11c305f4c1.tar.gz
Add some protocol filtering capability to the packet capture page
Diffstat (limited to 'usr/local')
-rw-r--r--usr/local/www/diag_packet_capture.php25
1 files changed, 24 insertions, 1 deletions
diff --git a/usr/local/www/diag_packet_capture.php b/usr/local/www/diag_packet_capture.php
index 07294b4..54e22c2 100644
--- a/usr/local/www/diag_packet_capture.php
+++ b/usr/local/www/diag_packet_capture.php
@@ -47,6 +47,9 @@ $fn = "packetcapture.cap";
$snaplen = 0;//default packet length
$count = 100;//default number of packets to capture
+$fams = array('ip', 'ip6');
+$protos = array('icmp', 'icmp6', 'tcp', 'udp', 'arp', 'vrrp', 'esp');
+
if ($_POST) {
$do_tcpdump = true;
$host = $_POST['host'];
@@ -56,6 +59,7 @@ if ($_POST) {
$port = $_POST['port'];
$detail = $_POST['detail'];
$fam = $_POST['fam'];
+ $proto = $_POST['proto'];
conf_mount_rw();
@@ -153,6 +157,22 @@ include("fbegin.inc");
</td>
</tr>
<tr>
+ <td width="17%" valign="top" class="vncellreq"><?=gettext("Protocol");?></td>
+ <td width="83%" class="vtable">
+ <select name="proto">
+ <option value="">Any</option>
+ <option value="icmp" <?php if ($proto == "icmp") echo "selected"; ?>>ICMP</option>
+ <option value="icmp6" <?php if ($proto == "icmp6") echo "selected"; ?>>ICMPv6</option>
+ <option value="tcp" <?php if ($proto == "tcp") echo "selected"; ?>>TCP</option>
+ <option value="udp" <?php if ($proto == "udp") echo "selected"; ?>>UDP</option>
+ <option value="arp" <?php if ($proto == "arp") echo "selected"; ?>>ARP</option>
+ <option value="vrrp" <?php if ($proto == "vrrp") echo "selected"; ?>>VRRP (CARP)</option>
+ <option value="esp" <?php if ($proto == "esp") echo "selected"; ?>>ESP</option>
+ </select>
+ <br/><?=gettext("Select the protocol to capture, or Any.");?>
+ </td>
+ </tr>
+ <tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Host Address");?></td>
<td width="83%" class="vtable">
<input name="host" type="text" class="formfld host" id="host" size="20" value="<?=htmlspecialchars($host);?>">
@@ -242,9 +262,12 @@ include("fbegin.inc");
if ($do_tcpdump) {
$matches = array();
- if (($fam == "ip6") || ($fam == "ip"))
+ if (in_array($fam, $fams))
$matches[] = $fam;
+ if (in_array($proto, $protos))
+ $matches[] = $proto;
+
if ($port != "")
$matches[] = "port ".$port;
OpenPOWER on IntegriCloud