Commit 267d589a authored by Ad Schellevis's avatar Ad Schellevis

remove getVolume from captive portal radius (non functional)

related to https://github.com/opnsense/core/issues/162
parent 7e3188f3
......@@ -159,11 +159,10 @@ function RADIUS_ACCOUNTING_STOP($ruleno,$username,$sessionid,$start_time,$radius
$radiusvendor = $config['captiveportal'][$cpzone]['radiusvendor'] ? $config['captiveportal'][$cpzone]['radiusvendor'] : null;
$stop_time = (empty($stop_time)) ? time() : $stop_time;
$session_time = $stop_time - $start_time;
$volume = getVolume($clientip, $clientmac);
$volume['input_bytes_radius'] = remainder($volume['input_bytes']);
$volume['input_gigawords'] = gigawords($volume['input_bytes']);
$volume['output_bytes_radius'] = remainder($volume['output_bytes']);
$volume['output_gigawords'] = gigawords($volume['output_bytes']);
$volume['input_bytes_radius'] = remainder(0);
$volume['input_gigawords'] = gigawords(0);
$volume['output_bytes_radius'] = remainder(0);
$volume['output_gigawords'] = gigawords(0);
switch($radiusvendor) {
......
......@@ -1141,53 +1141,6 @@ function captiveportal_free_dn_ruleno($ruleno) {
}
/**
* This function will calculate the traffic produced by a client
* based on its firewall rule
*
* Point of view: NAS
*
* Input means: from the client
* Output means: to the client
*
*/
function getVolume($ip, $mac = NULL) {
global $config, $cpzone;
$reverse = empty($config['captiveportal'][$cpzone]['reverseacct']) ? false : true;
$volume = array();
// Initialize vars properly, since we don't want NULL vars
$volume['input_pkts'] = $volume['input_bytes'] = $volume['output_pkts'] = $volume['output_bytes'] = 0 ;
$ipfw = pfSense_ipfw_getTablestats($cpzone, 1, $ip, $mac);
if (is_array($ipfw)) {
if ($reverse) {
$volume['output_pkts'] = $ipfw['packets'];
$volume['output_bytes'] = $ipfw['bytes'];
}
else {
$volume['input_pkts'] = $ipfw['packets'];
$volume['input_bytes'] = $ipfw['bytes'];
}
}
$ipfw = pfSense_ipfw_getTablestats($cpzone, 2, $ip);
if (is_array($ipfw)) {
if ($reverse) {
$volume['input_pkts'] = $ipfw['packets'];
$volume['input_bytes'] = $ipfw['bytes'];
}
else {
$volume['output_pkts'] = $ipfw['packets'];
$volume['output_bytes'] = $ipfw['bytes'];
}
}
return $volume;
}
/**
* Get the NAS-IP-Address based on the current wan address
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment