mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw.git
synced 2025-11-02 03:37:57 +00:00
Compare commits
8 Commits
kv3.0.3
...
experiment
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d8ba1776f | ||
|
|
bf0a9c1336 | ||
|
|
03dabed878 | ||
|
|
e133a9c3ab | ||
|
|
23b33fab20 | ||
|
|
909b4c889e | ||
|
|
a04c5336d2 | ||
|
|
4df1bf985d |
@@ -20,7 +20,8 @@ namespace OpenWifi {
|
||||
class AP_WS_ReactorThreadPool {
|
||||
public:
|
||||
explicit AP_WS_ReactorThreadPool(Poco::Logger &Logger) : Logger_(Logger) {
|
||||
NumberOfThreads_ = Poco::Environment::processorCount() * 4;
|
||||
int CPUCount = (int)MicroServiceConfigGetInt("openwifi.system.cpus", Poco::Environment::processorCount());
|
||||
NumberOfThreads_ = CPUCount * 4;
|
||||
if (NumberOfThreads_ == 0)
|
||||
NumberOfThreads_ = 8;
|
||||
NumberOfThreads_ = std::min(NumberOfThreads_, (std::uint64_t) 128);
|
||||
|
||||
@@ -207,6 +207,28 @@ namespace OpenWifi {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool AP_WS_Server::Disconnect(uint64_t SerialNumber) {
|
||||
std::shared_ptr<AP_WS_Connection> Connection;
|
||||
{
|
||||
auto hashIndex = MACHash::Hash(SerialNumber);
|
||||
std::lock_guard DeviceLock(SerialNumbersMutex_[hashIndex]);
|
||||
auto DeviceHint = SerialNumbers_[hashIndex].find(SerialNumber);
|
||||
if (DeviceHint == SerialNumbers_[hashIndex].end() || DeviceHint->second == nullptr) {
|
||||
return false;
|
||||
}
|
||||
Connection = DeviceHint->second;
|
||||
SerialNumbers_[hashIndex].erase(DeviceHint);
|
||||
}
|
||||
|
||||
{
|
||||
auto H = SessionHash::Hash(Connection->State_.sessionId);
|
||||
std::lock_guard SessionLock(SessionMutex_[H]);
|
||||
Sessions_[H].erase(Connection->State_.sessionId);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AP_WS_Server::CleanupSessions() {
|
||||
|
||||
while(Running_) {
|
||||
|
||||
@@ -141,6 +141,7 @@ namespace OpenWifi {
|
||||
|
||||
bool Connected(uint64_t SerialNumber, GWObjects::DeviceRestrictions &Restrictions) const;
|
||||
bool Connected(uint64_t SerialNumber) const;
|
||||
bool Disconnect(uint64_t SerialNumber);
|
||||
bool SendFrame(uint64_t SerialNumber, const std::string &Payload) const;
|
||||
bool SendRadiusAuthenticationData(const std::string &SerialNumber,
|
||||
const unsigned char *buffer, std::size_t size);
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace OpenWifi {
|
||||
private:
|
||||
GenericScheduler() noexcept
|
||||
: SubSystemServer("Scheduler", "SCHEDULER", "scheduler"),
|
||||
Scheduler_(Poco::Environment::processorCount()*2) {
|
||||
Scheduler_(((int)std::stoi(Poco::Environment::get("GENERIC_SCHEDULER_CORES", std::to_string(Poco::Environment::processorCount()))))*2) {
|
||||
|
||||
}
|
||||
Bosma::Scheduler Scheduler_;
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
|
||||
#include "RESTAPI_device_helper.h"
|
||||
|
||||
#include "AP_WS_Server.h"
|
||||
|
||||
namespace OpenWifi {
|
||||
void RESTAPI_device_handler::DoGet() {
|
||||
std::string SerialNumber = GetBinding(RESTAPI::Protocol::SERIALNUMBER, "");
|
||||
@@ -80,6 +82,9 @@ namespace OpenWifi {
|
||||
return OK();
|
||||
|
||||
} else if (StorageService()->DeleteDevice(SerialNumber)) {
|
||||
if(AP_WS_Server()->Connected(Utils::SerialNumberToInt(SerialNumber))) {
|
||||
AP_WS_Server()->Disconnect(Utils::SerialNumberToInt(SerialNumber));
|
||||
}
|
||||
return OK();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ static const std::vector<std::string> GitJSONSchemaURLs = {
|
||||
};
|
||||
|
||||
static std::string DefaultAPSchema = R"foo(
|
||||
|
||||
{
|
||||
"$id": "https://openwrt.org/ucentral.schema.json",
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
@@ -354,14 +353,6 @@ static std::string DefaultAPSchema = R"foo(
|
||||
10000
|
||||
]
|
||||
},
|
||||
"duplex": {
|
||||
"description": "The duplex mode that shall be forced.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"half",
|
||||
"full"
|
||||
]
|
||||
},
|
||||
"enabled": {
|
||||
"description": "This allows forcing the port to down state by default.",
|
||||
"type": "boolean",
|
||||
@@ -490,7 +481,59 @@ static std::string DefaultAPSchema = R"foo(
|
||||
"bss-color": {
|
||||
"description": "This enables BSS Coloring on the PHY. setting it to 0 disables the feature 1-63 sets the color and 64 will make hostapd pick a random color.",
|
||||
"type": "integer",
|
||||
"default": 64
|
||||
"minimum": 0,
|
||||
"maximum": 64,
|
||||
"default": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"radio.he-6ghz": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"power-type": {
|
||||
"description": "This config is to set the 6 GHz Access Point type",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"indoor-power-indoor",
|
||||
"standard-power",
|
||||
"very-low-power"
|
||||
],
|
||||
"default": "very-low-power"
|
||||
},
|
||||
"controller": {
|
||||
"description": "The URL of the AFC controller that the AP shall connect to.",
|
||||
"type": "string"
|
||||
},
|
||||
"ca-certificate": {
|
||||
"description": "The CA of the server. This enables mTLS.",
|
||||
"type": "string",
|
||||
"format": "uc-base64"
|
||||
},
|
||||
"serial-number": {
|
||||
"description": "The serial number that the AP shall send to the AFC controller.",
|
||||
"type": "string"
|
||||
},
|
||||
"certificate-ids": {
|
||||
"description": "The certificate IDs that the AP shall send to the AFC controller.",
|
||||
"type": "string"
|
||||
},
|
||||
"minimum-power": {
|
||||
"description": "The minimum power that the AP shall request from to the AFC controller.",
|
||||
"type": "number"
|
||||
},
|
||||
"frequency-ranges": {
|
||||
"description": "The list of frequency ranges that the AP shall request from to the AFC controller.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"operating-classes": {
|
||||
"description": "The list of frequency ranges that the AP shall request from to the AFC controller.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -635,6 +678,9 @@ static std::string DefaultAPSchema = R"foo(
|
||||
"he-settings": {
|
||||
"$ref": "#/$defs/radio.he"
|
||||
},
|
||||
"he-6ghz-settings": {
|
||||
"$ref": "#/$defs/radio.he-6ghz"
|
||||
},
|
||||
"hostapd-iface-raw": {
|
||||
"description": "This array allows passing raw hostapd.conf lines.",
|
||||
"type": "array",
|
||||
@@ -784,8 +830,19 @@ static std::string DefaultAPSchema = R"foo(
|
||||
},
|
||||
"use-dns": {
|
||||
"description": "The DNS server sent to clients as DHCP option 6.",
|
||||
"type": "string",
|
||||
"format": "uc-ip"
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"format": "ipv4"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"format": "ipv4"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1313,8 +1370,7 @@ static std::string DefaultAPSchema = R"foo(
|
||||
"domain-identifier": {
|
||||
"description": "Mobility Domain identifier (dot11FTMobilityDomainID, MDID).",
|
||||
"type": "string",
|
||||
"maxLength": 4,
|
||||
"minLength": 4,
|
||||
"format": "uc-mobility",
|
||||
"examples": [
|
||||
"abcd"
|
||||
]
|
||||
@@ -3701,6 +3757,10 @@ static std::string DefaultAPSchema = R"foo(
|
||||
}
|
||||
}
|
||||
},
|
||||
"service.fingerprint": {
|
||||
"description": "This section option enables fingerprinting.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"service": {
|
||||
"description": "This section describes all of the services that may be present on the AP. Each service is then referenced via its name inside an interface, ssid, ...",
|
||||
"type": "object",
|
||||
@@ -3770,6 +3830,9 @@ static std::string DefaultAPSchema = R"foo(
|
||||
},
|
||||
"rrm": {
|
||||
"$ref": "#/$defs/service.rrm"
|
||||
},
|
||||
"fingerprint": {
|
||||
"$ref": "#/$defs/service.fingerprint"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenWifi {
|
||||
void reinitialize(Poco::Util::Application &self) override;
|
||||
|
||||
inline static ConfigurationType GetType(const std::string &type) {
|
||||
std::string Type = Poco::toUpper(type);
|
||||
std::string Type = Poco::toLower(type);
|
||||
if (Type == Platforms::AP)
|
||||
return ConfigurationType::AP;
|
||||
if (Type == Platforms::SWITCH)
|
||||
|
||||
Reference in New Issue
Block a user