Skip to content

Commit

Permalink
https://telecominfraproject.atlassian.net/browse/WIFI-12868
Browse files Browse the repository at this point in the history
Signed-off-by: stephb9959 <[email protected]>
  • Loading branch information
stephb9959 committed Aug 31, 2023
1 parent 7edbdb7 commit e6da06e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/RADIUS_proxy_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,18 +508,24 @@ namespace OpenWifi {

void RADIUS_proxy_server::ParseServerList(const GWObjects::RadiusProxyServerConfig &Config,
std::vector<Destination> &V4,

std::vector<Destination> &V6, bool setAsDefault) {
uint64_t TotalV4 = 0, TotalV6 = 0;

std::cout << __LINE__ << std::endl;
for (const auto &server : Config.servers) {
Poco::Net::IPAddress a;
std::cout << __LINE__ << std::endl;
if (!Poco::Net::IPAddress::tryParse(server.ip, a)) {
std::cout << __LINE__ << std::endl;
poco_error(Logger(), fmt::format("RADIUS-PARSE Config: server address {} is nto a "
"valid address in v4 or v6. Entry skipped.",
server.ip));
continue;
}
std::cout << __LINE__ << std::endl;
auto S = Poco::Net::SocketAddress(fmt::format("{}:{}", server.ip, server.port));
std::cout << __LINE__ << std::endl;
Destination D{.Addr = S,
.state = 0,
.step = 0,
Expand All @@ -533,20 +539,26 @@ namespace OpenWifi {
.useRADSEC = server.radsec,
.realms = server.radsecRealms,
.secret = server.secret };
std::cout << __LINE__ << std::endl;

if (setAsDefault && D.useRADSEC)
DefaultIsRADSEC_ = true;

std::cout << __LINE__ << std::endl;
if (S.family() == Poco::Net::IPAddress::IPv4) {
std::cout << __LINE__ << std::endl;
TotalV4 += server.weight;
V4.push_back(D);
} else {
std::cout << __LINE__ << std::endl;
TotalV6 += server.weight;
V6.push_back(D);
}
}

std::cout << __LINE__ << std::endl;
for (auto &i : V4) {
std::cout << __LINE__ << std::endl;
if (TotalV4 == 0) {
i.step = 1000;
} else {
Expand All @@ -555,6 +567,7 @@ namespace OpenWifi {
}

for (auto &i : V6) {
std::cout << __LINE__ << std::endl;
if (TotalV6 == 0) {
i.step = 1000;
} else {
Expand Down

0 comments on commit e6da06e

Please sign in to comment.