stephb9959
2023-04-03 12:26:22 -07:00
parent f408a44898
commit c8a65d6137
3 changed files with 6 additions and 2 deletions

View File

@@ -265,6 +265,7 @@ namespace OpenWifi {
P.PacketType(RADCMD_DISCON_REQ);
P.Identifier(std::rand() & 0x00ff);
P.Size_=0;
P.AppendAttribute(RADIUS::AUTH_USERNAME, session->userName);
P.AppendAttribute(RADIUS::NAS_IP, (std::uint32_t)(0x7f000001));
P.AppendAttribute(RADIUS::CALLING_STATION_ID, session->callingStationId);

View File

@@ -487,7 +487,10 @@ namespace OpenWifi::RADIUS {
return *this;
}
explicit RadiusPacket() = default;
explicit RadiusPacket() {
memset(&P_,0,sizeof(P_));
Size_ = AttributeOffset;
};
unsigned char *Buffer() { return (unsigned char *)&P_; }
[[nodiscard]] uint16_t BufferLen() const { return sizeof(P_); }

View File

@@ -860,7 +860,7 @@ radiusaps() {
radiuscoadm() {
payload="$(printf '{ "accountingSessionId": "%s", "accountingMultiSessionId": "%s" , "callingStationId": "%s" }' "$2" "$3" "$4" )"
curl ${FLAGS} -X PUT "https://${OWGW}/api/v1/radiusSessions/$1" \
curl ${FLAGS} -X PUT "https://${OWGW}/api/v1/radiusSessions/$1?operation=coadm" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${token}" \