Skip to content

Commit

Permalink
https://telecominfraproject.atlassian.net/browse/WIFI-7831
Browse files Browse the repository at this point in the history
Signed-off-by: stephb9959 <[email protected]>
  • Loading branch information
stephb9959 committed Oct 16, 2023
1 parent a5200e4 commit a0d4606
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions src/RADIUS_proxy_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,14 @@ namespace OpenWifi {
RADIUS_Destinations_.clear();
}

void RADIUS_proxy_server::RouteAndSendAccountingPacket(const std::string &Destination, const std::string &serialNumber, RADIUS::RadiusPacket &P, bool RecomputeAuthenticator, std::string & secret) {
void RADIUS_proxy_server::RouteAndSendAccountingPacket(const std::string &Destination,const std::string &serialNumber, RADIUS::RadiusPacket &P, bool RecomputeAuthenticator, std::string & secret) {
try{

// are we sending this to a pool?
auto CallingStationID = P.ExtractCallingStationID();
auto CalledStationID = P.ExtractCalledStationID();
std::uint32_t DtsIp = Utils::IPtoInt(Destination);
auto DstParts = Utils::Split(Destination, ':');
std::uint32_t DtsIp = Utils::IPtoInt(DstParts[0]);

std::cout << "ACCT-DTS: " << DtsIp << std::endl;

Expand Down Expand Up @@ -122,18 +123,14 @@ namespace OpenWifi {
ofs.close();
}

void RADIUS_proxy_server::SendAccountingData(const std::string &serialNumber,
void RADIUS_proxy_server::SendAccountingData(const std::string &Destination, const std::string &serialNumber,
const char *buffer, std::size_t size, std::string & secret) {

if (!Continue())
return;

try {
RADIUS::RadiusPacket P((unsigned char *)buffer, size);
auto Destination = P.ExtractProxyStateDestination();

std::cout << "ACCT-DTS-0: " << Destination << std::endl;

RouteAndSendAccountingPacket(Destination, serialNumber, P, false, secret);
RADIUSSessionTracker()->AddAccountingSession(Destination, serialNumber, P, secret);

Expand Down
2 changes: 1 addition & 1 deletion src/RADIUS_proxy_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace OpenWifi {
void Stop() final;
inline bool Enabled() const { return Enabled_; }

void SendAccountingData(const std::string &serialNumber, const char *buffer,
void SendAccountingData(const std::string &Destination,const std::string &serialNumber, const char *buffer,
std::size_t size, std::string & secret);
void SendAuthenticationData(const std::string &serialNumber, const char *buffer,
std::size_t size, std::string & secret);
Expand Down

0 comments on commit a0d4606

Please sign in to comment.