X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PlanetLabConf%2Fbwlimit.php;h=850e864ad361ae7616f1218a3976c33981dcc4d5;hb=e9b0065a02763ed6ba0d6499c8d4fc723eb3a410;hp=3e3cbc968d49a59a38aff7645ec046cece1b8891;hpb=9f7f2642744c095e9610214e1210c576501724ab;p=nodeconfig.git diff --git a/PlanetLabConf/bwlimit.php b/PlanetLabConf/bwlimit.php index 3e3cbc9..850e864 100755 --- a/PlanetLabConf/bwlimit.php +++ b/PlanetLabConf/bwlimit.php @@ -13,10 +13,10 @@ require_once 'plc_api.php'; global $adm; // Look up the node -$nodenetworks = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR'])); -if (!empty($nodenetworks)) { - if ($nodenetworks[0]['bwlimit'] !== NULL) { - $rate = $nodenetworks[0]['bwlimit']; +$interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR'])); +if (!empty($interfaces)) { + if ($interfaces[0]['bwlimit'] !== NULL) { + $rate = $interfaces[0]['bwlimit']; if ($rate >= 1000000000 && ($rate % 1000000000) == 0) { printf("%.0fgbit", ($rate / 1000000000.)); } elseif ($rate >= 1000000 && ($rate % 1000000) == 0) { @@ -31,4 +31,4 @@ if (!empty($nodenetworks)) { } } -?> \ No newline at end of file +?>