mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Added Radius acct fields in acct stop request (#8120)
This commit is contained in:
parent
8051475c9a
commit
16010e01e7
7 changed files with 65 additions and 26 deletions
|
|
@ -31,6 +31,7 @@ sendHTTPContentTypeHeader('application/json')
|
|||
connectivity = "reject"
|
||||
username: "905395124063",
|
||||
password: "XXX",
|
||||
terminateCause: "1"
|
||||
},
|
||||
["192.168.2.221/32@0"] = {
|
||||
group = "staff",
|
||||
|
|
@ -90,10 +91,12 @@ for member, info in pairs(_POST["associations"] or {}) do
|
|||
res["associations"][member]["status_msg"] = "Failure adding member, maybe bad member MAC or IP"
|
||||
end
|
||||
elseif info["connectivity"] == "reject" then
|
||||
-- To check radius termination cause see https://datatracker.ietf.org/doc/html/rfc2866#section-5.10
|
||||
local terminate_cause = info["terminateCause"] or 3 -- Lost service
|
||||
s:bind_member(member, host_pools.DEFAULT_POOL_ID)
|
||||
res["associations"][member]["status"] = "OK"
|
||||
interface.select(tostring(interface.getFirstInterfaceId()))
|
||||
radius_handler.accountingStop(member)
|
||||
radius_handler.accountingStop(member, terminate_cause)
|
||||
interface.select("-1") -- System Interface
|
||||
else
|
||||
res["associations"][member]["status"] = "ERROR"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue