From 786cd81da0b78475800644d7c4ae0e2d20b87480 Mon Sep 17 00:00:00 2001 From: Scott Dale Date: Sat, 12 May 2007 02:12:20 +0000 Subject: add option for no count, correct host field --- usr/local/www/diag_packet_capture.php | 43 +++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 17 deletions(-) (limited to 'usr') diff --git a/usr/local/www/diag_packet_capture.php b/usr/local/www/diag_packet_capture.php index d1f4043..573c54f 100644 --- a/usr/local/www/diag_packet_capture.php +++ b/usr/local/www/diag_packet_capture.php @@ -134,38 +134,39 @@ include("head.inc"); ?> -
Select the interface the traffic will be passing through. Typically this will be the WAN interface. +
Select the interface the traffic will be passing through. Typically this will be the WAN interface. Host Address -
This value is either the Source or Destination IP address. The packet capture will look for this address in either field. -
This value can be a domain name or IP address. +
This value is either the Source or Destination IP address. The packet capture will look for this address in either field. +
This value can be a domain name or IP address. +
If you leave this field blank all packets on the specified interface will be captured. Port -
The port can be either the source or destination port. The packet capture will look for this port in either field. -
Leave blank if you do not want to the capture to filter by port. +
The port can be either the source or destination port. The packet capture will look for this port in either field. +
Leave blank if you do not want to the capture to filter by port. Packet Length -
The Packet length is the number of bytes the packet will capture for each payload. Default value is 1500. -
This value should be the same as the MTU of the Interface selected above. +
The Packet length is the number of bytes the packet will capture for each payload. Default value is 1500. +
This value should be the same as the MTU of the Interface selected above. Count -
This is the number of packets the packet capture will grab. Default value is 100. +
This is the number of packets the packet capture will grab. Default value is 100.
Enter 0 (zero) for no count limit. Level of Detail @@ -176,14 +177,14 @@ include("head.inc"); ?> -
This is the level of detail that will be displayed after hitting 'Stop' when the packets have been captured.
Note: This option does not affect the level of detail when downloading the packet capture. +
This is the level of detail that will be displayed after hitting 'Stop' when the packets have been captured.
Note: This option does not affect the level of detail when downloading the packet capture. Reverse DNS Lookup > -
This check box will cause the packet capture to perform a reverse DNS lookup associated with all IP addresses. -
Note: This option can be CPU intensive for large packet captures. +
This check box will cause the packet capture to perform a reverse DNS lookup associated with all IP addresses. +
Note: This option can be CPU intensive for large packet captures. @@ -233,27 +234,35 @@ include("head.inc"); ?> if ($host != "") { - $searchhost = " host " . $host; + $searchhost = "host " . $host; } else { $searchhost = ""; - } + } + if ($count != "0" ) + { + $searchcount = "-c " . $count; + } + else + { + $searchcount = ""; + } $selectedif = convert_friendly_interface_to_real_interface_name($selectedif); if ($processisrunning) - echo("Packet Capture is running.
"); + echo("Packet Capture is running.
"); if ($action == "Start") { - echo("Packet Capture is running.
"); - mwexec_bg ("/usr/sbin/tcpdump -i $selectedif -v -c $count -s $packetlength -w $fn $searchhost $searchport"); + echo("Packet Capture is running.
"); + mwexec_bg ("/usr/sbin/tcpdump -i $selectedif $searchcount -s $packetlength -w $fn $searchhost $searchport"); } else //action = stop { - echo("Packet Capture stopped.

Packets Captured:

"); + echo("Packet Capture stopped.

Packets Captured:

"); ?>