mirror of
https://github.com/openwrt/packages.git
synced 2026-01-10 11:44:48 +00:00
bandwidthd: update to 2.0.1-34, sqlite support and SMTP tracking
Addition of sqlite storage Tracking of SMTP traffic instead of P2P traffic Based on NethServer bandwidthd implementation Signed-off-by: Jean-Michel lacroix <lacroix@lepine-lacroix.info>
This commit is contained in:
54
utils/bandwidthd/files/phphtdocs/include.php
Normal file
54
utils/bandwidthd/files/phphtdocs/include.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
define("INT_DAILY", 60*60*24*2);
|
||||
define("INT_WEEKLY", 60*60*24*8);
|
||||
define("INT_MONTHLY", 60*60*24*35);
|
||||
define("INT_YEARLY", 60*60*24*400);
|
||||
|
||||
define("XOFFSET", 90);
|
||||
define("YOFFSET", 45);
|
||||
|
||||
require("config.conf");
|
||||
|
||||
function ConnectDb()
|
||||
{
|
||||
global $db_connect_string;
|
||||
|
||||
$db = pg_pconnect($db_connect_string);
|
||||
if (!$db)
|
||||
{
|
||||
printf("DB Error, could not connect to database");
|
||||
exit(1);
|
||||
}
|
||||
return($db);
|
||||
}
|
||||
|
||||
function fmtb($kbytes)
|
||||
{
|
||||
$Max = 1024;
|
||||
$Output = $kbytes;
|
||||
$Suffix = 'K';
|
||||
|
||||
if ($Output > $Max)
|
||||
{
|
||||
$Output /= 1024;
|
||||
$Suffix = 'M';
|
||||
}
|
||||
|
||||
if ($Output > $Max)
|
||||
{
|
||||
$Output /= 1024;
|
||||
$Suffix = 'G';
|
||||
}
|
||||
|
||||
if ($Output > $Max)
|
||||
{
|
||||
$Output /= 1024;
|
||||
$Suffix = 'T';
|
||||
}
|
||||
|
||||
return(sprintf("<td align=right><tt>%.1f%s</td>", $Output, $Suffix));
|
||||
}
|
||||
|
||||
$starttime = time();
|
||||
set_time_limit(300);
|
||||
?>
|
||||
Reference in New Issue
Block a user