| =gettext("Packet capture");?> |
-
-
- | =gettext("Interface");?> |
-
+ |
+
+ | =gettext("Interface");?> |
+
+
+
+
=gettext("Select the interface on which to capture traffic.");?>
- |
+
-
- | =gettext("Host Address");?> |
-
-
- =gettext("This value is either the Source or Destination IP address. The packet capture will look for this address in either field.");?>
- =gettext("This value can be a domain name or IP address.");?>
+ |
+ | =gettext("Address Family");?> |
+
+
+ =gettext("Select the type of traffic to be captured, either Any, IPv4 only or IPv6 only.");?>
+ |
+
+
+ | =gettext("Host Address");?> |
+
+
+ =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.");?>
+ =gettext("This value can be a domain name or IP address, or subnet in CIDR notation.");?>
=gettext("If you leave this field blank, all packets on the specified interface will be captured.");?>
|
- | =gettext("Port");?> |
-
-
+ | =gettext("Port");?> |
+
+
=gettext("The port can be either the source or destination port. The packet capture will look for this port in either field.");?>
=gettext("Leave blank if you do not want to filter by port.");?>
|
- | =gettext("Packet Length");?> |
-
-
+ | =gettext("Packet Length");?> |
+
+
=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.");?>
|
- | =gettext("Count");?> |
-
-
+ | =gettext("Count");?> |
+
+
=gettext("This is the number of packets the packet capture will grab. Default value is 100.") . " " . gettext("Enter 0 (zero) for no count limit.");?>
|
- | =gettext("Level of Detail");?> |
-
- |
- | =gettext("Reverse DNS Lookup");?> |
-
+ | =gettext("Reverse DNS Lookup");?> |
+
>
=gettext("This check box will cause the packet capture to perform a reverse DNS lookup associated with all IP addresses.");?>
=gettext("Note");?>: =gettext("This option can cause delays for large packet captures.");?>
|
- | |
-
+ | |
+
";
- else {
- echo " ";
- }
+ else {
+ echo " ";
+ }
if (file_exists($fp.$fn) and $processisrunning != true) {
echo "";
echo " (" . gettext("The packet capture file was last updated:") . " " . date("F jS, Y g:i:s a.", filemtime($fp.$fn)) . ")";
}
?>
- |
+
@@ -219,36 +231,37 @@ include("fbegin.inc");
echo "";
if ($processisrunning == true)
echo("" . gettext("Packet Capture is running.") . " ");
-
- if ($do_tcpdump) {
- if ($port != "") {
- $searchport = "and port ".$port;
- if($host <> "")
- $searchport = "and port ".$port;
- else
- $searchport = "port ".$port;
- } else {
- $searchport = "";
- }
+ if ($do_tcpdump) {
+ $matches = array();
- if ($host != "") {
- $searchhost = "host " . $host;
+ if (($fam == "ip6") || ($fam == "ip"))
+ $matches[] = $fam;
+
+ if ($port != "")
+ $matches[] = "port ".$port;
+
+ if ($host != "") {
+ if (is_ipaddr($host))
+ $matches[] = "host " . $host;
+ elseif (is_subnet($host))
+ $matches[] = "net " . $host;
+ }
+
+ if ($count != "0" ) {
+ $searchcount = "-c " . $count;
} else {
- $searchhost = "";
- }
- if ($count != "0" ) {
- $searchcount = "-c " . $count;
- } else {
- $searchcount = "";
- }
+ $searchcount = "";
+ }
$selectedif = convert_friendly_interface_to_real_interface_name($selectedif);
-
+
if ($action == gettext("Start")) {
+ $matchstr = implode($matches, " and ");
echo("" . gettext("Packet Capture is running.") . " ");
- mwexec_bg ("/usr/sbin/tcpdump -i $selectedif $searchcount -s $packetlength -w $fp$fn $searchhost $searchport");
- } else {
+ mwexec_bg ("/usr/sbin/tcpdump -i $selectedif $searchcount -s $packetlength -w $fp$fn $matchstr");
+ echo "/usr/sbin/tcpdump -i $selectedif $searchcount -s $packetlength -w $fp$fn $matchstr";
+ } else {
//action = stop
echo("" . gettext("Packet Capture stopped.") . "
" . gettext("Packets Captured:") . " ");
?>
@@ -273,6 +286,6 @@ include("fbegin.inc");
|
-