mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-01 10:57:47 +00:00
uspot: accounting: remove redundant function
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
This commit is contained in:
committed by
John Crispin
parent
1e82a24192
commit
dfdf25834c
@@ -208,17 +208,7 @@ function client_remove(interface, mac, reason) {
|
|||||||
radius_stop(interface, mac, {}, true);
|
radius_stop(interface, mac, {}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function client_flush(interface, mac) {
|
function client_flush(interface, mac, reason) {
|
||||||
syslog(interface, mac, 'logoff event');
|
|
||||||
radius_stop(interface, mac, {
|
|
||||||
state: 0,
|
|
||||||
dns_state: 1,
|
|
||||||
accounting: [],
|
|
||||||
flush: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function client_timeout(interface, mac, reason) {
|
|
||||||
syslog(interface, mac, reason);
|
syslog(interface, mac, reason);
|
||||||
radius_stop(interface, mac, {
|
radius_stop(interface, mac, {
|
||||||
state: 0,
|
state: 0,
|
||||||
@@ -240,7 +230,7 @@ function accounting(interface) {
|
|||||||
for (let k, v in clients[interface]) {
|
for (let k, v in clients[interface]) {
|
||||||
if (list[k].data?.logoff) {
|
if (list[k].data?.logoff) {
|
||||||
radius_logoff(interface, k);
|
radius_logoff(interface, k);
|
||||||
client_flush(interface, k);
|
client_flush(interface, k, 'logoff event');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,14 +250,14 @@ function accounting(interface) {
|
|||||||
if (timeout && ((t - list[k].data.connect) > timeout)) {
|
if (timeout && ((t - list[k].data.connect) > timeout)) {
|
||||||
if (clients[interface][k])
|
if (clients[interface][k])
|
||||||
radius_session_time(interface, k);
|
radius_session_time(interface, k);
|
||||||
client_timeout(interface, k, 'session timeout');
|
client_flush(interface, k, 'session timeout');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (clients[interface][k].max_total) {
|
if (clients[interface][k].max_total) {
|
||||||
let total = list[k].bytes_ul + list[k].bytes_dl;
|
let total = list[k].bytes_ul + list[k].bytes_dl;
|
||||||
if (total >= clients[interface][k].max_total) {
|
if (total >= clients[interface][k].max_total) {
|
||||||
radius_session_time(interface, k);
|
radius_session_time(interface, k);
|
||||||
client_timeout(interface, k, 'max octets reached');
|
client_flush(interface, k, 'max octets reached');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user