Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master to Release #331

Merged
merged 55 commits into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
6b49c68
https://telecominfraproject.atlassian.net/browse/WIFI-12868
stephb9959 Sep 1, 2023
caf1ec9
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 13, 2023
92f14f5
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 13, 2023
8f34181
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 13, 2023
ec0f2ae
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 13, 2023
bc8f714
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 13, 2023
32f0945
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 13, 2023
797165f
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
d7b5d7f
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
cf811a5
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
c66ab90
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
99c037b
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
bc38160
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
8718bb8
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
15f938f
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
c2012bc
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
1a6fb2a
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
b83b15d
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
396462c
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
eeac584
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
cb276b3
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
bdcb1ae
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
45ba1d9
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
1d294c8
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
7790cde
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
52fa1ac
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
904d034
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 14, 2023
98db7f1
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 15, 2023
fcc765c
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 15, 2023
06af6eb
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 15, 2023
8150daa
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 15, 2023
2542635
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 15, 2023
ebc4fd6
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 15, 2023
960640c
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 15, 2023
1c6022c
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 15, 2023
09b50cd
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 15, 2023
625ace2
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 15, 2023
1b33470
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 15, 2023
33884c8
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 15, 2023
eae8945
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 15, 2023
6ba3c6d
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 15, 2023
780cf3e
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 15, 2023
8952213
https://telecominfraproject.atlassian.net/browse/WIFI-7831
stephb9959 Sep 15, 2023
84e4a20
https://telecominfraproject.atlassian.net/browse/WIFI-12945
stephb9959 Sep 18, 2023
9235495
https://telecominfraproject.atlassian.net/browse/WIFI-12945
stephb9959 Sep 20, 2023
78015d2
https://telecominfraproject.atlassian.net/browse/WIFI-12954
stephb9959 Sep 22, 2023
2f45a69
https://telecominfraproject.atlassian.net/browse/WIFI-12954
stephb9959 Sep 22, 2023
4a4c771
https://telecominfraproject.atlassian.net/browse/WIFI-12954
stephb9959 Sep 22, 2023
3227883
https://telecominfraproject.atlassian.net/browse/WIFI-12954
stephb9959 Sep 22, 2023
598a151
https://telecominfraproject.atlassian.net/browse/WIFI-12954
stephb9959 Sep 22, 2023
bc04d0b
https://telecominfraproject.atlassian.net/browse/WIFI-12954
stephb9959 Sep 22, 2023
4f1fa18
https://telecominfraproject.atlassian.net/browse/WIFI-12954
stephb9959 Sep 22, 2023
e5a22a1
https://telecominfraproject.atlassian.net/browse/WIFI-12954
stephb9959 Sep 23, 2023
b5a0c96
https://telecominfraproject.atlassian.net/browse/WIFI-12954
stephb9959 Sep 23, 2023
5cd421a
https://telecominfraproject.atlassian.net/browse/WIFI-12954
stephb9959 Sep 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
string(REGEX REPLACE "\n$" "" GIT_HASH "${GIT_HASH}")
endif()

add_definitions(-DTIP_GATEWAY_SERVICE="1" -DPOCO_LOG_DEBUG="1")
add_definitions(-DTIP_GATEWAY_SERVICE="1" -DPOCO_LOG_DEBUG="1" -DBOOST_NO_CXX98_FUNCTION_BASE=1)

find_package(OpenSSL REQUIRED)
find_package(ZLIB REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
26
20 changes: 20 additions & 0 deletions openapi/owgw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,26 @@ components:
$ref: '#/components/schemas/RadiusProxyServerConfig'
coaConfig:
$ref: '#/components/schemas/RadiusProxyServerConfig'
radsecPoolType:
type: string
enum:
- generic
- orion
- globalreach
default:
generic
poolProxyIp:
type: string
description: This is the fake IP for the entire pool
example:
- These addresses must match the addresses in the AP configuration and must start with 0.0
- 0.0.0.1
- 0.0.1.1
radsecPoolKeepAlive:
type: integer
description: The keep alive value in seconds. Usually 30s or less.
format: int64
default: 25

RadiusProxyPoolList:
type: object
Expand Down
11 changes: 3 additions & 8 deletions src/AP_WS_Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,7 @@ namespace OpenWifi {
Details.set(uCentralProtocol::TIMESTAMP, Utils::Now());
Details.set(uCentralProtocol::UUID,uuid);
Disconnect.set(uCentralProtocol::DISCONNECTION, Details);
Poco::JSON::Stringifier Stringify;
std::ostringstream OS;
Stringify.condense(Disconnect, OS);
KafkaManager()->PostMessage(KafkaTopics::CONNECTION, SerialNumber, std::make_shared<std::string>(OS.str()));
KafkaManager()->PostMessage(KafkaTopics::CONNECTION, SerialNumber, Disconnect);
} catch (...) {
}
}
Expand Down Expand Up @@ -725,10 +722,8 @@ namespace OpenWifi {
PingDetails.set(uCentralProtocol::UUID, uuid_);
PingDetails.set("locale", State_.locale);
PingObject.set(uCentralProtocol::PING, PingDetails);
Poco::JSON::Stringifier Stringify;
std::ostringstream OS;
Stringify.condense(PingObject, OS);
KafkaManager()->PostMessage(KafkaTopics::CONNECTION, SerialNumber_, std::make_shared<std::string>(OS.str()));
poco_trace(Logger_,fmt::format("Sending PING for {}", SerialNumber_));
KafkaManager()->PostMessage(KafkaTopics::CONNECTION, SerialNumber_,PingObject);
}
return;
} break;
Expand Down
6 changes: 1 addition & 5 deletions src/AP_WS_Process_alarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ namespace OpenWifi {

if (ParamsObj->has(uCentralProtocol::SERIAL) && ParamsObj->has(uCentralProtocol::DATA)) {
if (KafkaManager()->Enabled()) {
auto Data = ParamsObj->get(uCentralProtocol::DATA);
Poco::JSON::Stringifier Stringify;
std::ostringstream OS;
Stringify.condense(ParamsObj, OS);
KafkaManager()->PostMessage(KafkaTopics::ALERTS, SerialNumber_, std::make_shared<std::string>(OS.str()));
KafkaManager()->PostMessage(KafkaTopics::ALERTS, SerialNumber_, *ParamsObj);
}
}
}
Expand Down
14 changes: 3 additions & 11 deletions src/AP_WS_Process_connect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ namespace OpenWifi {
Event.set("type", "device.firmware_change");
Event.set("timestamp", Utils::Now());
Event.set("payload", EventDetails);
std::ostringstream OS;
Event.stringify(OS);
KafkaManager()->PostMessage(KafkaTopics::DEVICE_EVENT_QUEUE, SerialNumber, std::make_shared<std::string>(OS.str()));
KafkaManager()->PostMessage(KafkaTopics::DEVICE_EVENT_QUEUE, SerialNumber, Event);
}
}

Expand All @@ -51,9 +49,7 @@ namespace OpenWifi {
Event.set("type", "device.not_provisioned");
Event.set("timestamp", Utils::Now());
Event.set("payload", EventDetails);
std::ostringstream OS;
Event.stringify(OS);
KafkaManager()->PostMessage(KafkaTopics::DEVICE_EVENT_QUEUE, SerialNumber, std::make_shared<std::string>(OS.str()));
KafkaManager()->PostMessage(KafkaTopics::DEVICE_EVENT_QUEUE, SerialNumber, Event);
}
}

Expand Down Expand Up @@ -285,15 +281,11 @@ namespace OpenWifi {
GWWebSocketNotifications::DeviceConnected(Notification);

if (KafkaManager()->Enabled()) {
Poco::JSON::Stringifier Stringify;

ParamsObj->set(uCentralProtocol::CONNECTIONIP, CId_);
ParamsObj->set("locale", State_.locale);
ParamsObj->set(uCentralProtocol::TIMESTAMP, Utils::Now());
ParamsObj->set(uCentralProtocol::UUID, uuid_);
std::ostringstream OS;
Stringify.condense(ParamsObj, OS);
KafkaManager()->PostMessage(KafkaTopics::CONNECTION, SerialNumber_, std::make_shared<std::string>(OS.str()));
KafkaManager()->PostMessage(KafkaTopics::CONNECTION, SerialNumber_, *ParamsObj);
}
} else {
poco_warning(
Expand Down
5 changes: 1 addition & 4 deletions src/AP_WS_Process_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@ namespace OpenWifi {
FullEvent.set("type", EventType);
FullEvent.set("timestamp", EventTimeStamp);
FullEvent.set("payload", EventPayload);

std::ostringstream OS;
FullEvent.stringify(OS);
KafkaManager()->PostMessage(KafkaTopics::DEVICE_EVENT_QUEUE, SerialNumber_,
std::make_shared<std::string>(OS.str()));
FullEvent);
}
}
} catch (const Poco::Exception &E) {
Expand Down
6 changes: 1 addition & 5 deletions src/AP_WS_Process_healthcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ namespace OpenWifi {

SetLastHealthCheck(Check);
if (KafkaManager()->Enabled()) {
Poco::JSON::Stringifier Stringify;
std::ostringstream OS;
ParamsObj->set("timestamp", Utils::Now());
Stringify.condense(ParamsObj, OS);
KafkaManager()->PostMessage(KafkaTopics::HEALTHCHECK, SerialNumber_, std::make_shared<std::string>(OS.str()));
KafkaManager()->PostMessage(KafkaTopics::HEALTHCHECK, SerialNumber_, *ParamsObj);
}
} else {
poco_warning(Logger_, fmt::format("HEALTHCHECK({}): Missing parameter", CId_));
Expand Down
5 changes: 1 addition & 4 deletions src/AP_WS_Process_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ namespace OpenWifi {
State_.Associations_5G, State_.Associations_6G);

if (KafkaManager()->Enabled()) {
Poco::JSON::Stringifier Stringify;
std::ostringstream OS;
Stringify.condense(ParamsObj, OS);
KafkaManager()->PostMessage(KafkaTopics::STATE, SerialNumber_, std::make_shared<std::string>(OS.str()));
KafkaManager()->PostMessage(KafkaTopics::STATE, SerialNumber_, *ParamsObj);
}

GWWebSocketNotifications::SingleDevice_t N;
Expand Down
4 changes: 2 additions & 2 deletions src/AP_WS_Process_telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace OpenWifi {
std::ostringstream SS;
Payload->stringify(SS);
auto now = Utils::Now();
auto KafkaPayload = std::make_shared<std::string>(SS.str());
auto KafkaPayload = SS.str();
if (ParamsObj->has("adhoc")) {
KafkaManager()->PostMessage(KafkaTopics::DEVICE_TELEMETRY, SerialNumber_,
KafkaPayload);
Expand All @@ -39,7 +39,7 @@ namespace OpenWifi {
// std::endl;
TelemetryWebSocketPackets_++;
State_.websocketPackets = TelemetryWebSocketPackets_;
TelemetryStream()->NotifyEndPoint(SerialNumberInt_, *KafkaPayload);
TelemetryStream()->NotifyEndPoint(SerialNumberInt_, KafkaPayload);
} else {
StopWebSocketTelemetry(CommandManager()->Next_RPC_ID());
}
Expand Down
6 changes: 1 addition & 5 deletions src/AP_WS_Process_wifiscan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ namespace OpenWifi {

if (ParamsObj->has(uCentralProtocol::SERIAL) && ParamsObj->has(uCentralProtocol::DATA)) {
if (KafkaManager()->Enabled()) {
auto Data = ParamsObj->get(uCentralProtocol::DATA);
Poco::JSON::Stringifier Stringify;
std::ostringstream OS;
Stringify.condense(ParamsObj, OS);
KafkaManager()->PostMessage(KafkaTopics::WIFISCAN, SerialNumber_, std::make_shared<std::string>(OS.str()));
KafkaManager()->PostMessage(KafkaTopics::WIFISCAN, SerialNumber_, *ParamsObj);
}
}
}
Expand Down
5 changes: 1 addition & 4 deletions src/AP_WS_Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,7 @@ namespace OpenWifi {
FullEvent.set("timestamp", now);
FullEvent.set("payload", KafkaNotification);

std::ostringstream OS;
FullEvent.stringify(OS);
KafkaManager()->PostMessage(KafkaTopics::DEVICE_EVENT_QUEUE, "system",
std::make_shared<std::string>(OS.str()));
KafkaManager()->PostMessage(KafkaTopics::DEVICE_EVENT_QUEUE, "system", FullEvent);
}

void AP_WS_Server::Stop() {
Expand Down
5 changes: 1 addition & 4 deletions src/GWKafkaEvents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ namespace OpenWifi {
Event.set("type", type_);
Event.set("timestamp", timestamp_);
Event.set("payload", payload_);
std::ostringstream OS;
Event.stringify(OS);
auto payload = std::make_shared<std::string>(OS.str());
KafkaManager()->PostMessage(KafkaTopics::DEVICE_EVENT_QUEUE, Utils::IntToSerialNumber(serialNumber_), payload);
KafkaManager()->PostMessage(KafkaTopics::DEVICE_EVENT_QUEUE, Utils::IntToSerialNumber(serialNumber_), Event);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/RADIUS_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ namespace OpenWifi::RADIUS {

inline void AddAttribute(unsigned char attr, uint8_t len, const unsigned char *data) {
P_.attributes[AttributesLen_++] = attr;
P_.attributes[AttributesLen_++] = len;
P_.attributes[AttributesLen_++] = len+2;
memcpy(&P_.attributes[AttributesLen_], data, len);
AttributesLen_ += len;
}
Expand Down
55 changes: 31 additions & 24 deletions src/RADIUS_proxy_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ namespace OpenWifi {
for (const auto &entry : pool.authConfig.servers) {
if (entry.radsec) {
RADSECservers_[Poco::Net::SocketAddress(entry.ip, 0)] =
std::make_unique<RADSEC_server>(*RadiusReactor_, entry);
std::make_unique<RADSEC_server>(*RadiusReactor_, entry, pool);
}
}
}
Expand Down Expand Up @@ -208,7 +208,7 @@ namespace OpenWifi {
}
P.Evaluate(ReceiveSize);

if(P.PacketTypeInt()==OpenWifi::RADIUS::Access_Accept) {
if(Logger().trace()) {
P.Log(std::cout);
}
auto SerialNumber = P.ExtractSerialNumberFromProxyState();
Expand Down Expand Up @@ -419,10 +419,12 @@ namespace OpenWifi {
Destination = "0.0.0.0:0";
}

P.Log(std::cout);
if(Logger().trace()) {
P.Log(std::cout);
}

if(Destination.empty()) {
std::cout << "No destination in CoA. Dropped." << std::endl;
poco_warning(Logger(),fmt::format("{}: CoA packet does not have a valid destination.", serialNumber));
return;
}

Expand Down Expand Up @@ -468,8 +470,8 @@ namespace OpenWifi {

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

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

for (const auto &server : Config.servers) {
Expand All @@ -493,7 +495,8 @@ namespace OpenWifi {
.useAsDefault = setAsDefault,
.useRADSEC = server.radsec,
.realms = server.radsecRealms,
.secret = server.secret };
.secret = server.secret,
.poolProxyIp = poolProxyIp};

if (setAsDefault && D.useRADSEC)
DefaultIsRADSEC_ = true;
Expand Down Expand Up @@ -542,11 +545,11 @@ namespace OpenWifi {
for (const auto &pool : RPC.pools) {
RadiusPool NewPool;
ParseServerList(pool.authConfig, NewPool.AuthV4, NewPool.AuthV6,
pool.useByDefault);
pool.useByDefault, pool.poolProxyIp);
ParseServerList(pool.acctConfig, NewPool.AcctV4, NewPool.AcctV6,
pool.useByDefault);
pool.useByDefault, pool.poolProxyIp);
ParseServerList(pool.coaConfig, NewPool.CoaV4, NewPool.CoaV6,
pool.useByDefault);
pool.useByDefault, pool.poolProxyIp);
Pools_.push_back(NewPool);
}
} else {
Expand Down Expand Up @@ -650,29 +653,36 @@ namespace OpenWifi {
}

auto isAddressInPool = [&](const std::vector<Destination> &D, bool &UseRADSEC) -> bool {
for (const auto &entry : D)
for (const auto &entry : D) {
if (!entry.poolProxyIp.empty() &&
entry.poolProxyIp == RequestedAddress.host().toString()) {
UseRADSEC = entry.useRADSEC;
return true;
}
if (entry.Addr.host() == RequestedAddress.host()) {
UseRADSEC = entry.useRADSEC;
return true;
}
}
return false;
};

for (auto &i : Pools_) {
for (auto &pool : Pools_) {
// try and match the pool's address to the destination
switch (rtype) {
case radius_type::coa: {
if (isAddressInPool((IsV4 ? i.CoaV4 : i.CoaV6), UseRADSEC)) {
return ChooseAddress(IsV4 ? i.CoaV4 : i.CoaV6, RequestedAddress, Secret);
if (isAddressInPool((IsV4 ? pool.CoaV4 : pool.CoaV6), UseRADSEC)) {
return ChooseAddress(IsV4 ? pool.CoaV4 : pool.CoaV6, RequestedAddress, Secret);
}
} break;
case radius_type::auth: {
if (isAddressInPool((IsV4 ? i.AuthV4 : i.AuthV6), UseRADSEC)) {
return ChooseAddress(IsV4 ? i.AuthV4 : i.AuthV6, RequestedAddress, Secret);
if (isAddressInPool((IsV4 ? pool.AuthV4 : pool.AuthV6), UseRADSEC)) {
return ChooseAddress(IsV4 ? pool.AuthV4 : pool.AuthV6, RequestedAddress, Secret);
}
} break;
case radius_type::acct: {
if (isAddressInPool((IsV4 ? i.AcctV4 : i.AcctV6), UseRADSEC)) {
return ChooseAddress(IsV4 ? i.AcctV4 : i.AcctV6, RequestedAddress, Secret);
if (isAddressInPool((IsV4 ? pool.AcctV4 : pool.AcctV6), UseRADSEC)) {
return ChooseAddress(IsV4 ? pool.AcctV4 : pool.AcctV6, RequestedAddress, Secret);
}
} break;
}
Expand All @@ -689,11 +699,8 @@ namespace OpenWifi {

if (Pool.size() == 1) {
Secret = Pool[0].secret;
return Pool[0].Addr;
}

if(Pool.empty()) {
std::cout << __LINE__ << std::endl;
auto A = Pool[0].Addr;
return A;
}

if (Pool[0].strategy == "weighted") {
Expand Down Expand Up @@ -739,7 +746,7 @@ namespace OpenWifi {
}

if (!found) {
return OriginalAddress;
// return OriginalAddress;
}

Pool[index].state += 1;
Expand Down
6 changes: 4 additions & 2 deletions src/RADIUS_proxy_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ namespace OpenWifi {
bool useRADSEC = false;
std::vector<std::string> realms;
std::string secret;
std::string poolProxyIp;
};

inline bool Continue() const { return Running_ && Enabled_ && !Pools_.empty(); }
Expand Down Expand Up @@ -107,8 +108,9 @@ namespace OpenWifi {
Poco::Net::SocketAddress Route(radius_type rtype, const Poco::Net::SocketAddress &A,
const RADIUS::RadiusPacket &P, bool &UseRADSEC, std::string &secret);
void ParseServerList(const GWObjects::RadiusProxyServerConfig &Config,
std::vector<Destination> &V4, std::vector<Destination> &V6,
bool setAsDefault);
std::vector<Destination> &V4,
std::vector<Destination> &V6, bool setAsDefault,
const std::string &poolProxyIp);
static Poco::Net::SocketAddress
ChooseAddress(std::vector<Destination> &Pool,
const Poco::Net::SocketAddress &OriginalAddress, std::string &Secret);
Expand Down
Loading
Loading