diff options
author | Renato Botelho <garga@FreeBSD.org> | 2015-02-05 10:02:24 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2015-02-05 20:10:15 -0200 |
commit | 07cf2c4b20230ddedee1bf9dddc1e7cd407385f5 (patch) | |
tree | 44d40561519e0018ad586bb1449e107c9ae431f3 /config/rate/bandwidth_by_ip.php | |
parent | e526e4aa28867b7743b0e76993f5f6bebd15bc1b (diff) | |
download | pfsense-packages-07cf2c4b20230ddedee1bf9dddc1e7cd407385f5.tar.gz pfsense-packages-07cf2c4b20230ddedee1bf9dddc1e7cd407385f5.tar.bz2 pfsense-packages-07cf2c4b20230ddedee1bf9dddc1e7cd407385f5.zip |
Packages repo cleanup:
- Drop support for pfSense < 2
- Remove archive/, old files can be reached using git
- Remove old and unused packages
- Move stale files from config subdir to a package subdir
Diffstat (limited to 'config/rate/bandwidth_by_ip.php')
-rw-r--r-- | config/rate/bandwidth_by_ip.php | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/config/rate/bandwidth_by_ip.php b/config/rate/bandwidth_by_ip.php deleted file mode 100644 index 8d9a9246..00000000 --- a/config/rate/bandwidth_by_ip.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - * - * - * - * - * - */ - -require_once('guiconfig.inc'); -require_once('interfaces.inc'); -require_once('pfsense-utils.inc'); -require_once('util.inc'); - -$listedIPs = ""; - -//get interface IP and break up into an array -$interface = $_GET['if']; -$real_interface = convert_friendly_interface_to_real_interface_name($interface); -$intip = find_interface_ip($real_interface); -$intip = explode (".", $intip); - -//use class A subnet to make sure we capture all traffic on specified interface -$intsubnet = $intip[0] . ".0.0.0/8"; - -exec("rate -i {$real_interface} -nlq 1 -A -c {$intsubnet}", $listedIPs); - -unset($bandwidthinfo); -unset($receivebytesarray); -unset($transmitbytesarray); - -$someinfo = false; -for ($x=2; $x<12; $x++){ - - $bandwidthinfo = $listedIPs[$x]; - - // echo $bandwidthinfo; - $emptyinfocounter = 1; - if ($bandwidthinfo != "") { - $splitinfo = explode ("|",$bandwidthinfo); - $receivebytesarray = explode(" ",$splitinfo[0]); - //print IP of host; - echo $receivebytesarray[0] . ";"; - - //skip empty array elements until first element found with data - while ($receivebytesarray[$emptyinfocounter] == "") - { - $emptyinfocounter++; - } - //print received bytes for host - echo $receivebytesarray[$emptyinfocounter] . ";"; - - $transmitbytesarray = explode(" ",$splitinfo[1]); - - $emptyinfocounter = 1; - - //skip empty array elements until first element found with data - while ($transmitbytesarray[$emptyinfocounter] == "") - { - $emptyinfocounter++; - } - //print transmitted bytes for host - echo $transmitbytesarray[$emptyinfocounter] . "|"; - - //mark that we collected information - $someinfo = true; - } -} - - -//no bandwidth usage found -if ($someinfo == false) - echo "no info"; - -?> |