From 866e8caab3c18c5a65bb428521db378e198f4c9a Mon Sep 17 00:00:00 2001 From: jim-p Date: Sat, 13 Jun 2009 22:58:40 -0400 Subject: Add rate package, courtesy of Scott Dale --- config/rate/bandwidth_by_ip.php | 77 +++++++++++ config/rate/rate.inc | 29 ++++ config/rate/rate.xml | 74 ++++++++++ config/rate/status_graph.php | 291 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 471 insertions(+) create mode 100644 config/rate/bandwidth_by_ip.php create mode 100644 config/rate/rate.inc create mode 100644 config/rate/rate.xml create mode 100644 config/rate/status_graph.php (limited to 'config/rate') diff --git a/config/rate/bandwidth_by_ip.php b/config/rate/bandwidth_by_ip.php new file mode 100644 index 00000000..3fd01a61 --- /dev/null +++ b/config/rate/bandwidth_by_ip.php @@ -0,0 +1,77 @@ + diff --git a/config/rate/rate.inc b/config/rate/rate.inc new file mode 100644 index 00000000..3a2f13a9 --- /dev/null +++ b/config/rate/rate.inc @@ -0,0 +1,29 @@ + \ No newline at end of file diff --git a/config/rate/rate.xml b/config/rate/rate.xml new file mode 100644 index 00000000..f60fc92f --- /dev/null +++ b/config/rate/rate.xml @@ -0,0 +1,74 @@ + + + + + + . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + ]]> + + Per-IP Realtime Bandwidth Rate Monitor + FreeBSD rate-0.9 package + Currently there are no FAQ items provided. + rate + 0.9 + Rate + /usr/local/pkg/dashboard.inc + + /usr/local/pkg/ + 077 + http://www.pfsense.com/packages/config/rate/rate.inc + + + /usr/local/pkg/ + 077 + http://www.pfsense.com/packages/config/rate/bandwidth_by_ip.php + + + /usr/local/pkg/ + 077 + http://www.pfsense.com/packages/config/rate/status_graph.php + + + + rate_install(); + + + rate_deinstall(); + + diff --git a/config/rate/status_graph.php b/config/rate/status_graph.php new file mode 100644 index 00000000..12a9fd39 --- /dev/null +++ b/config/rate/status_graph.php @@ -0,0 +1,291 @@ +. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +##|+PRIV +##|*IDENT=page-status-trafficgraph +##|*NAME=Status: Traffic Graph page +##|*DESCR=Allow access to the 'Status: Traffic Graph' page. +##|*MATCH=status_graph.php* +##|-PRIV + + + +require("guiconfig.inc"); + +if ($_POST['width']) + $width = $_POST['width']; +else + $width = "100%"; + +if ($_POST['height']) + $height = $_POST['height']; +else + $height = "200"; + + +if ($_GET['if']) + $curif = $_GET['if']; +else + $curif = "wan"; + +$pgtitle = array("Status","Traffic Graph"); + +include("head.inc"); + +?> + + + + + + + + + 'WAN', 'lan' => 'LAN'); + +for($j = 1; isset($config['interfaces']['opt' . $j]); $j++) { + if(isset($config['interfaces']['opt' . $j]['enable'])) + $ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr']; +} +if((isset($config['ipsec']['enable'])) || (isset($config['ipsec']['mobileclients']['enable']))) { + $ifdescrs['ipsec'] = "IPSEC"; +} + +/* link the ipsec interface magically */ +if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable'])) + $ifdescrs['enc0'] = "IPsec"; + +?> +
+Interface: + +
+

Note: the Adobe SVG Viewer, Firefox 1.5 or later or other browser supporting SVG is required to view the graph. +

+
+

+

+
+ + + Your browser does not support the type SVG! You need to either use Firefox or download the Adobe SVG plugin. + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Host IPBandwidth InBandwidth Out
+
+
+ + + + + + -- cgit v1.2.3