summaryrefslogtreecommitdiffstats
path: root/usr/local/www/diag_packet_capture.php
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www/diag_packet_capture.php')
-rw-r--r--usr/local/www/diag_packet_capture.php125
1 files changed, 63 insertions, 62 deletions
diff --git a/usr/local/www/diag_packet_capture.php b/usr/local/www/diag_packet_capture.php
index 71ed928..ae41a67 100644
--- a/usr/local/www/diag_packet_capture.php
+++ b/usr/local/www/diag_packet_capture.php
@@ -190,7 +190,7 @@ if ($_POST) {
$disabledns = "-n";
}
- if ($_POST['startbtn'] != "" ) {
+ if ($_POST['startbtn'] != "") {
$action = gettext("Start");
//delete previous packet capture if it exists
@@ -198,7 +198,7 @@ if ($_POST) {
unlink ($fp.$fn);
}
- } elseif ($_POST['stopbtn']!= "") {
+ } elseif ($_POST['stopbtn'] != "") {
$action = gettext("Stop");
$processes_running = trim(shell_exec("/bin/ps axw -O pid= | /usr/bin/grep tcpdump | /usr/bin/grep {$fn} | /usr/bin/egrep -v '(pflog|grep)'"));
@@ -212,7 +212,7 @@ if ($_POST) {
exec("kill $process_id");
}
- } elseif ($_POST['downloadbtn']!= "") {
+ } elseif ($_POST['downloadbtn'] != "") {
//download file
$fs = filesize($fp.$fn);
header("Content-Type: application/octet-stream");
@@ -246,98 +246,99 @@ include("fbegin.inc");
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Interface");?></td>
<td width="32%" class="vtable">
- <select name="interface">
- <?php foreach ($interfaces as $iface => $ifacename): ?>
- <option value="<?=$iface;?>" <?php if ($selectedif == $iface) echo "selected=\"selected\""; ?>>
- <?php echo $ifacename;?>
- </option>
- <?php endforeach; ?>
- </select>
- <br /><?=gettext("Select the interface on which to capture traffic.");?>
+ <select name="interface">
+ <?php foreach ($interfaces as $iface => $ifacename): ?>
+ <option value="<?=$iface;?>" <?php if ($selectedif == $iface) echo "selected=\"selected\""; ?>>
+ <?php echo $ifacename;?>
+ </option>
+ <?php endforeach; ?>
+ </select>
+ <br /><?=gettext("Select the interface on which to capture traffic.");?>
</td>
</tr>
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Promiscuous");?></td>
<td width="51%" class="vtable">
- <input name="promiscuous" type="checkbox"<?php if ($_POST['promiscuous']) echo " checked=\"checked\""; ?> />
- <br /><?=gettext("If checked, the");?> <a target="_blank" href="http://www.freebsd.org/cgi/man.cgi?query=tcpdump&amp;apropos=0&amp;sektion=0&amp;manpath=FreeBSD+8.3-stable&amp;arch=default&amp;format=html"><?= gettext("packet capture")?></a> <?= gettext("will be performed using promiscuous mode.");?>
- <br /><b><?=gettext("Note");?>: </b><?=gettext("Some network adapters do not support or work well in promiscuous mode.");?>
+ <input name="promiscuous" type="checkbox"<?php if ($_POST['promiscuous']) echo " checked=\"checked\""; ?> />
+ <br /><?=gettext("If checked, the");?> <a target="_blank" href="http://www.freebsd.org/cgi/man.cgi?query=tcpdump&amp;apropos=0&amp;sektion=0&amp;manpath=FreeBSD+8.3-stable&amp;arch=default&amp;format=html"><?= gettext("packet capture")?></a> <?= gettext("will be performed using promiscuous mode.");?>
+ <br /><b><?=gettext("Note");?>: </b><?=gettext("Some network adapters do not support or work well in promiscuous mode.");?>
</td>
</tr>
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Address Family");?></td>
<td colspan="2" width="83%" class="vtable">
- <select name="fam">
- <option value="">Any</option>
- <option value="ip" <?php if ($fam == "ip") echo "selected=\"selected\""; ?>>IPv4 Only</option>
- <option value="ip6" <?php if ($fam == "ip6") echo "selected=\"selected\""; ?>>IPv6 Only</option>
- </select>
- <br /><?=gettext("Select the type of traffic to be captured, either Any, IPv4 only or IPv6 only.");?>
+ <select name="fam">
+ <option value="">Any</option>
+ <option value="ip" <?php if ($fam == "ip") echo "selected=\"selected\""; ?>>IPv4 Only</option>
+ <option value="ip6" <?php if ($fam == "ip6") echo "selected=\"selected\""; ?>>IPv6 Only</option>
+ </select>
+ <br /><?=gettext("Select the type of traffic to be captured, either Any, IPv4 only or IPv6 only.");?>
</td>
</tr>
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Protocol");?></td>
<td colspan="2" width="83%" class="vtable">
- <select name="proto">
- <option value="">Any</option>
- <option value="icmp" <?php if ($proto == "icmp") echo "selected=\"selected\""; ?>>ICMP</option>
- <option value="!icmp" <?php if ($proto == "!icmp") echo "selected=\"selected\""; ?>>Exclude ICMP</option>
- <option value="icmp6" <?php if ($proto == "icmp6") echo "selected=\"selected\""; ?>>ICMPv6</option>
- <option value="!icmp6" <?php if ($proto == "!icmp6") echo "selected=\"selected\""; ?>>Exclude ICMPv6</option>
- <option value="tcp" <?php if ($proto == "tcp") echo "selected=\"selected\""; ?>>TCP</option>
- <option value="!tcp" <?php if ($proto == "!tcp") echo "selected=\"selected\""; ?>>Exclude TCP</option>
- <option value="udp" <?php if ($proto == "udp") echo "selected=\"selected\""; ?>>UDP</option>
- <option value="!udp" <?php if ($proto == "!udp") echo "selected=\"selected\""; ?>>Exclude UDP</option>
- <option value="arp" <?php if ($proto == "arp") echo "selected=\"selected\""; ?>>ARP</option>
- <option value="!arp" <?php if ($proto == "!arp") echo "selected=\"selected\""; ?>>Exclude ARP</option>
- <option value="carp" <?php if ($proto == "carp") echo "selected=\"selected\""; ?>>CARP (VRRP)</option>
- <option value="!carp" <?php if ($proto == "!carp") echo "selected=\"selected\""; ?>>Exclude CARP (VRRP)</option>
- <option value="esp" <?php if ($proto == "esp") echo "selected=\"selected\""; ?>>ESP</option>
- </select>
- <br /><?=gettext("Select the protocol to capture, or Any.");?>
+ <select name="proto">
+ <option value="">Any</option>
+ <option value="icmp" <?php if ($proto == "icmp") echo "selected=\"selected\""; ?>>ICMP</option>
+ <option value="!icmp" <?php if ($proto == "!icmp") echo "selected=\"selected\""; ?>>Exclude ICMP</option>
+ <option value="icmp6" <?php if ($proto == "icmp6") echo "selected=\"selected\""; ?>>ICMPv6</option>
+ <option value="!icmp6" <?php if ($proto == "!icmp6") echo "selected=\"selected\""; ?>>Exclude ICMPv6</option>
+ <option value="tcp" <?php if ($proto == "tcp") echo "selected=\"selected\""; ?>>TCP</option>
+ <option value="!tcp" <?php if ($proto == "!tcp") echo "selected=\"selected\""; ?>>Exclude TCP</option>
+ <option value="udp" <?php if ($proto == "udp") echo "selected=\"selected\""; ?>>UDP</option>
+ <option value="!udp" <?php if ($proto == "!udp") echo "selected=\"selected\""; ?>>Exclude UDP</option>
+ <option value="arp" <?php if ($proto == "arp") echo "selected=\"selected\""; ?>>ARP</option>
+ <option value="!arp" <?php if ($proto == "!arp") echo "selected=\"selected\""; ?>>Exclude ARP</option>
+ <option value="carp" <?php if ($proto == "carp") echo "selected=\"selected\""; ?>>CARP (VRRP)</option>
+ <option value="!carp" <?php if ($proto == "!carp") echo "selected=\"selected\""; ?>>Exclude CARP (VRRP)</option>
+ <option value="esp" <?php if ($proto == "esp") echo "selected=\"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 colspan="2" width="83%" class="vtable">
- <input name="host" class="formfld host" id="host" size="20" value="<?=htmlspecialchars($host);?>" />
- <br /><?=gettext("This value is either the Source or Destination IP address or subnet in CIDR notation. The packet capture will look for this address in either field.");?>
- <br /><?=gettext("Matching can be negated by preceding the value with \"!\". Multiple IP addresses or CIDR subnets may be specified. Comma (\",\") separated values perform a boolean \"and\". Separating with a pipe (\"|\") performs a boolean \"or\".");?>
- <br /><?=gettext("If you leave this field blank, all packets on the specified interface will be captured.");?>
+ <input name="host" class="formfld host" id="host" size="20" value="<?=htmlspecialchars($host);?>" />
+ <br /><?=gettext("This value is either the Source or Destination IP address or subnet in CIDR notation. The packet capture will look for this address in either field.");?>
+ <br /><?=gettext("Matching can be negated by preceding the value with \"!\". Multiple IP addresses or CIDR subnets may be specified. Comma (\",\") separated values perform a boolean \"and\". Separating with a pipe (\"|\") performs a boolean \"or\".");?>
+ <br /><?=gettext("If you leave this field blank, all packets on the specified interface will be captured.");?>
</td>
</tr>
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Port");?></td>
<td colspan="2" width="83%" class="vtable">
- <input name="port" class="formfld unknown" id="port" size="5" value="<?=$port;?>" />
- <br /><?=gettext("The port can be either the source or destination port. The packet capture will look for this port in either field.");?>
- <br /><?=gettext("Leave blank if you do not want to filter by port.");?>
+ <input name="port" class="formfld unknown" id="port" size="5" value="<?=$port;?>" />
+ <br /><?=gettext("The port can be either the source or destination port. The packet capture will look for this port in either field.");?>
+ <br /><?=gettext("Leave blank if you do not want to filter by port.");?>
</td>
</tr>
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Packet Length");?></td>
<td colspan="2" width="83%" class="vtable">
- <input name="snaplen" class="formfld unknown" id="snaplen" size="5" value="<?=$snaplen;?>" />
- <br /><?=gettext("The Packet length is the number of bytes of each packet that will be captured. Default value is 0, which will capture the entire frame regardless of its size.");?>
+ <input name="snaplen" class="formfld unknown" id="snaplen" size="5" value="<?=$snaplen;?>" />
+ <br /><?=gettext("The Packet length is the number of bytes of each packet that will be captured. Default value is 0, which will capture the entire frame regardless of its size.");?>
</td>
</tr>
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Count");?></td>
<td colspan="2" width="83%" class="vtable">
- <input name="count" class="formfld unknown" id="count" size="5" value="<?=$count;?>" />
- <br /><?=gettext("This is the number of packets the packet capture will grab. Default value is 100.") . "<br />" . gettext("Enter 0 (zero) for no count limit.");?>
+ <input name="count" class="formfld unknown" id="count" size="5" value="<?=$count;?>" />
+ <br /><?=gettext("This is the number of packets the packet capture will grab. Default value is 100.") . "<br />" . gettext("Enter 0 (zero) for no count limit.");?>
</td>
</tr>
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Level of Detail");?></td>
<td colspan="2" width="83%" class="vtable">
- <select name="detail" class="formselect" id="detail" size="1">
- <option value="normal" <?php if ($detail == "normal") echo "selected=\"selected\""; ?>><?=gettext("Normal");?></option>
- <option value="medium" <?php if ($detail == "medium") echo "selected=\"selected\""; ?>><?=gettext("Medium");?></option>
- <option value="high" <?php if ($detail == "high") echo "selected=\"selected\""; ?>><?=gettext("High");?></option>
- <option value="full" <?php if ($detail == "full") echo "selected=\"selected\""; ?>><?=gettext("Full");?></option>
- </select>
- <br /><?=gettext("This is the level of detail that will be displayed after hitting 'Stop' when the packets have been captured.") . "<br /><b>" .
+ <select name="detail" class="formselect" id="detail" size="1">
+ <option value="normal" <?php if ($detail == "normal") echo "selected=\"selected\""; ?>><?=gettext("Normal");?></option>
+ <option value="medium" <?php if ($detail == "medium") echo "selected=\"selected\""; ?>><?=gettext("Medium");?></option>
+ <option value="high" <?php if ($detail == "high") echo "selected=\"selected\""; ?>><?=gettext("High");?></option>
+ <option value="full" <?php if ($detail == "full") echo "selected=\"selected\""; ?>><?=gettext("Full");?></option>
+ </select>
+ <br />
+ <?=gettext("This is the level of detail that will be displayed after hitting 'Stop' when the packets have been captured.") . "<br /><b>" .
gettext("Note:") . "</b> " .
gettext("This option does not affect the level of detail when downloading the packet capture.");?>
</td>
@@ -345,9 +346,9 @@ include("fbegin.inc");
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Reverse DNS Lookup");?></td>
<td colspan="2" width="83%" class="vtable">
- <input name="dnsquery" type="checkbox" <?php if ($_POST['dnsquery']) echo " checked=\"checked\""; ?> />
- <br /><?=gettext("This check box will cause the packet capture to perform a reverse DNS lookup associated with all IP addresses.");?>
- <br /><b><?=gettext("Note");?>: </b><?=gettext("This option can cause delays for large packet captures.");?>
+ <input name="dnsquery" type="checkbox" <?php if ($_POST['dnsquery']) echo " checked=\"checked\""; ?> />
+ <br /><?=gettext("This check box will cause the packet capture to perform a reverse DNS lookup associated with all IP addresses.");?>
+ <br /><b><?=gettext("Note");?>: </b><?=gettext("This option can cause delays for large packet captures.");?>
</td>
</tr>
<tr>
@@ -381,7 +382,7 @@ include("fbegin.inc");
</form>
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="results">
<tr>
- <td valign="top" colspan="2">
+ <td valign="top" colspan="2">
<?php
echo "<font face=\"terminal\" size=\"2\">";
if ($processisrunning == true) {
@@ -417,7 +418,7 @@ include("fbegin.inc");
}
}
- if ($count != "0" ) {
+ if ($count != "0") {
$searchcount = "-c " . $count;
} else {
$searchcount = "";
@@ -470,8 +471,8 @@ include("fbegin.inc");
}
}
?>
- &nbsp;</font>
- </td>
+ &nbsp;</font>
+ </td>
</tr>
</table>
</td></tr>
OpenPOWER on IntegriCloud