Compare commits

...

30 Commits

Author SHA1 Message Date
TIP Automation User
1d8df22092 Chg: update image tag in helm values to v4.1.0 2025-09-08 18:52:32 +00:00
TIP Automation User
d109c0cd7e Chg: update image tag in helm values to v4.1.0-RC1 2025-08-28 12:12:28 +00:00
Carsten Schafer
8b06a65d5b Merge pull request #118 from Telecominfraproject/WIFI-13821-bump-versions
WIFI-13821 version set to 4.1.0
2025-08-01 08:58:18 -04:00
Carsten Schafer
3e7c72831f version set to 4.1.0
Signed-off-by: Carsten Schafer <Carsten.Schafer@kinarasystems.com>
2025-08-01 08:26:29 -04:00
i-chvets
069b60a6c6 Merge pull request #116 from Telecominfraproject/fix_improve_exeception_handling
Exception handling improvement.
2025-05-16 10:06:34 -04:00
Ivan Chvets
1832d2c1cb Merge branch 'main' of github.com:Telecominfraproject/wlan-cloud-owprov into fix_improve_exeception_handling 2025-05-02 10:58:26 -04:00
i-chvets
0ef1dad4dc Merge pull request #117 from Telecominfraproject/fix_ci
fix: Updated CI with ubuntu-latest.
2025-05-02 10:57:21 -04:00
Ivan Chvets
d001c44a81 fix: Updated CI with ubuntu-latest.
Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
2025-05-02 10:22:09 -04:00
Ivan Chvets
fe6023b18d Exception handling improvement. Details in: https://telecominfraproject.atlassian.net/browse/WIFI-14038
Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
2025-05-01 17:49:04 -04:00
Carsten Schafer
1bd1cf0af6 Merge pull request #114 from Telecominfraproject/version_update
fix: release 3.2.1 version update
2024-12-04 12:16:33 -05:00
Ivan Chvets
6ce0f2fb51 fix: release 3.2.1 version update
https://telecominfraproject.atlassian.net/browse/WIFI-14165

Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
2024-12-04 12:09:27 -05:00
i-chvets
020ff8641a Merge pull request #112 from kerwinma-git/WIFI-14257-fix-can-not-get-the-correct-deviceTypes-from-AppServiceRegistery
WIFI-14257: fix can not get corrent deviceTypes from AppServiceRegistry
2024-12-02 10:53:22 -05:00
MBW
342c6900ef WIFI-14257: fix can not get corrent deviceTypes from AppServiceRegistry
Signed-off-by: MBW <mbwofmbw@foxmail.com>
2024-11-06 19:04:37 +08:00
i-chvets
a549024a29 Merge pull request #109 from Telecominfraproject/version_update
WIFI-14165: release 3.2 version update
2024-09-30 10:22:20 -04:00
Ivan Chvets
6f84eeb901 fix: release 3.2 version update
https://telecominfraproject.atlassian.net/browse/WIFI-14165

Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
2024-09-30 09:58:38 -04:00
i-chvets
c44dabe2f3 Merge pull request #99 from kinarasystems/wifi_13539_feat_push_config
WIFI-13541 Feat: Auto push config on venue change and capabilities message.
2024-09-18 10:04:30 -04:00
i-chvets
c78888372c Merge pull request #106 from Telecominfraproject/WIFI-13597-fix-kafka-producer-using-poll
WIFI-13857: fix: modified code to use flush() when internal queue is not loaded
2024-06-19 16:51:50 -04:00
Ivan Chvets
4ae0b99f55 fix: modified code to use flush() when internal queue is not loaded
https://telecominfraproject.atlassian.net/browse/WIFI-13597

NOTE: This is port of https://github.com/Telecominfraproject/wlan-cloud-ucentralgw/pull/362

Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
2024-06-19 16:26:56 -04:00
i-chvets
41e172be25 Merge pull request #105 from Telecominfraproject/WIFI-13597-fix-kafka-producer-using-poll
fix: added flush() for proper shutdown
2024-06-18 12:03:50 -04:00
Ivan Chvets
d7e05eac60 fix: added flush() for proper shutdown
https://telecominfraproject.atlassian.net/browse/WIFI-13597

Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
2024-06-18 10:44:47 -04:00
i-chvets
fd25e19095 Merge pull request #104 from Telecominfraproject/WIFI-13597-fix-kafka-producer-using-poll
WIFI-13597: fix: modified kafka manager to use poll in producer
2024-06-13 14:35:34 -04:00
Ivan Chvets
3b8a8bafff fix: modified kafka manager to use poll in producer
https://telecominfraproject.atlassian.net/browse/WIFI-13597

NOTE: This fix is port of https://github.com/Telecominfraproject/wlan-cloud-ucentralgw/pull/360

Summary of changes:
- Modified code in KafkaManager to use poll instead of flush for every
  messages sent. flush is used only on empty internal notification queue
  in idle times.

Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
2024-06-13 09:47:29 -04:00
Stephane Bourque
20785d82ce Merge pull request #103 from Telecominfraproject/WIFI-13808
https://telecominfraproject.atlassian.net/browse/WIFI-13808
2024-06-06 08:11:20 -07:00
stephb9959
1327b29d7b https://telecominfraproject.atlassian.net/browse/WIFI-13808
Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
2024-06-06 07:59:57 -07:00
i-chvets
226cd3e9e9 Merge pull request #102 from Telecominfraproject/WIFI-431-fix-update-internal-schema-validation
fix: modified code to use proper fingerprint defintion
2024-06-06 10:21:01 -04:00
Ivan Chvets
de512f0e2c fix: modified code to use final as default for fingerprint mode
https://telecominfraproject.atlassian.net/browse/WIFI-431

Summary of changes:
- Modified code to use `final` as default value for fingerprint mode.

Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
2024-06-05 11:12:15 -04:00
Ivan Chvets
7a845e2f8c fix: modified code to use proper fingerprint defintion
https://telecominfraproject.atlassian.net/browse/WIFI-431

NOTE: This port of https://github.com/Telecominfraproject/wlan-cloud-ucentralgw/pull/355

Summary of changes:
- Modified code to use proper definition of fingerprint service.

Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
2024-06-04 13:04:06 -04:00
i-chvets
b0f925a7c0 Merge pull request #101 from Telecominfraproject/WIFI-12748-feat-schema-update-afc-support
ucentral schema update: added afc support
2024-05-29 10:11:55 -04:00
Ivan Chvets
984c8fafac ucentral schema update: added afc support
https://telecominfraproject.atlassian.net/browse/WIFI-12748

NOTE: This commit is a port of https://github.com/Telecominfraproject/wlan-cloud-ucentralgw/pull/350

Update to internal schema in the gateway code is required to ensure code is in-sync with schema version on Github.

- Added section to enabled AFC configuration
- Additional updates listed below.

The following updates to schema are also included in this PR:

fix bss color handling
da090931f0

drop ports.duplex support
35da0a1cd0

add support for device fingerprinting
cb1c18db70

Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
2024-05-27 16:48:23 -04:00
Adam Capparelli
da23ff1192 Auto push config on venue change and capabilities message. (#9)
Signed-off-by: Adam Capparelli <adam.capparelli@mail.utoronto.ca>
Co-authored-by: Adam Capparelli <adam.capparelli@mail.utoronto.ca>
2024-03-21 16:01:32 -04:00
10 changed files with 184 additions and 40 deletions

View File

@@ -21,7 +21,7 @@ defaults:
jobs:
docker:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
DOCKER_REGISTRY_URL: tip-tip-wlan-cloud-ucentral.jfrog.io
DOCKER_REGISTRY_USERNAME: ucentral

View File

@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.13)
project(owprov VERSION 3.0.2)
project(owprov VERSION 4.1.0)
set(CMAKE_CXX_STANDARD 17)
@@ -242,4 +242,3 @@ target_link_libraries(owprov PUBLIC
CppKafka::cppkafka
resolv
fmt::fmt)

2
build
View File

@@ -1 +1 @@
23
1

View File

@@ -9,7 +9,7 @@ fullnameOverride: ""
images:
owprov:
repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owprov
tag: main
tag: v4.1.0
pullPolicy: Always
# regcred:
# registry: tip-tip-wlan-cloud-ucentral.jfrog.io

View File

@@ -5,6 +5,7 @@
#include "AutoDiscovery.h"
#include "Poco/JSON/Parser.h"
#include "StorageService.h"
#include "Tasks/VenueConfigUpdater.h"
#include "framework/KafkaManager.h"
#include "framework/KafkaTopics.h"
#include "framework/ow_constants.h"
@@ -107,6 +108,11 @@ namespace OpenWifi {
if (!SerialNumber.empty() && Connected) {
StorageService()->InventoryDB().CreateFromConnection(
SerialNumber, ConnectedIP, Compatible, Locale, isConnection);
// Now that the entry has been created, we can try to push a config if
// the connection was a capabilities message.
if (isConnection){
ComputeAndPushConfig(SerialNumber, Compatible, Logger());
}
}
}
} catch (const Poco::Exception &E) {

View File

@@ -14,28 +14,13 @@
#include "RESTAPI/RESTAPI_db_helpers.h"
#include "SerialNumberCache.h"
#include "StorageService.h"
#include "Tasks/VenueConfigUpdater.h"
#include "framework/utils.h"
#include "sdks/SDK_gw.h"
#include "sdks/SDK_sec.h"
namespace OpenWifi {
void GetRejectedLines(const Poco::JSON::Object::Ptr &Response, Types::StringVec &Warnings) {
try {
if (Response->has("results")) {
auto Results = Response->get("results").extract<Poco::JSON::Object::Ptr>();
auto Status = Results->get("status").extract<Poco::JSON::Object::Ptr>();
auto Rejected = Status->getArray("rejected");
std::transform(
Rejected->begin(), Rejected->end(), std::back_inserter(Warnings),
[](auto i) -> auto { return i.toString(); });
// for(const auto &i:*Rejected)
// Warnings.push_back(i.toString());
}
} catch (...) {
}
}
void RESTAPI_inventory_handler::DoGet() {
ProvObjects::InventoryTag Existing;
@@ -314,6 +299,8 @@ namespace OpenWifi {
return NotFound();
}
std::string previous_venue = Existing.venue;
auto RemoveSubscriber = GetParameter("removeSubscriber");
if (!RemoveSubscriber.empty()) {
if (Existing.subscriber == RemoveSubscriber) {
@@ -471,6 +458,13 @@ namespace OpenWifi {
SDK::GW::Device::SetOwnerShip(this, SerialNumber, Existing.entity, Existing.venue,
Existing.subscriber);
// Attempt an automatic config push when the venue is set and different than what is
// in DB.
poco_information(Logger(), fmt::format("New Venue {} Old Venue {}", NewObject.venue, previous_venue));
if (!NewObject.venue.empty() && NewObject.venue != previous_venue) {
ComputeAndPushConfig(SerialNumber, NewObject.deviceType, Logger());
}
ProvObjects::InventoryTag NewObjectCreated;
DB_.GetRecord("id", Existing.info.id, NewObjectCreated);
Poco::JSON::Object Answer;

View File

@@ -28,6 +28,42 @@ namespace OpenWifi {
}
}
[[maybe_unused]] static void ComputeAndPushConfig(const std::string &SerialNumber, const std::string &DeviceType, Poco::Logger &Logger) {
/*
Generic Helper to compute a device's config and push it down to the device.
*/
poco_information(Logger, fmt::format("Attempting to push venue config for device {}", SerialNumber));
auto DeviceConfig = std::make_shared<APConfig>(SerialNumber,
DeviceType, Logger, false);
auto Configuration = Poco::makeShared<Poco::JSON::Object>();
try {
if (DeviceConfig->Get(Configuration)) {
std::ostringstream OS;
Configuration->stringify(OS);
auto Response = Poco::makeShared<Poco::JSON::Object>();
poco_debug(Logger,
fmt::format("{}: Pushing configuration.", SerialNumber));
if (SDK::GW::Device::Configure(nullptr, SerialNumber, Configuration,
Response)) {
Logger.debug(
fmt::format("{}: Configuration pushed.", SerialNumber));
poco_information(Logger,
fmt::format("{}: Updated.", SerialNumber));
} else {
poco_information(Logger,
fmt::format("{}: Not updated.", SerialNumber));
}
} else {
poco_debug(Logger,
fmt::format("{}: Configuration is bad.", SerialNumber));
}
} catch (...) {
poco_debug(Logger,
fmt::format("{}: Configuration is bad (caused an exception).",
SerialNumber));
}
}
class VenueDeviceConfigUpdater : public Poco::Runnable {
public:
VenueDeviceConfigUpdater(const std::string &UUID, const std::string &venue, Poco::Logger &L)

View File

@@ -67,9 +67,9 @@ namespace OpenWifi {
bool Get(const char *key, std::vector<std::string> &Value) {
if(Registry_->has(key) && !Registry_->isNull(key) && Registry_->isArray(key)) {
auto Arr = Registry_->get(key);
for(const auto &v:Arr) {
Value.emplace_back(v);
auto pArr = Registry_->getArray(key);
for(const auto &v : *pArr) {
Value.emplace_back(v.toString());
}
return true;
}
@@ -91,4 +91,4 @@ namespace OpenWifi {
inline auto AppServiceRegistry() { return AppServiceRegistry::instance(); }
} // namespace OpenWifi
} // namespace OpenWifi

View File

@@ -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,42 @@ static std::string DefaultAPSchema = R"foo(
}
}
},
"service.fingerprint": {
"description": "This section can be used to configure device fingerprinting.",
"type": "object",
"properties": {
"mode": {
"description": "Enable this option if you would like to enable the MDNS server on the unit.",
"type": "string",
"enum": [
"polled",
"final",
"raw-data"
],
"default": "final"
},
"minimum-age": {
"description": "The minimum age a fingerprint must have before it is reported.",
"type": "number",
"default": 60
},
"maximum-age": {
"description": "The age at which fingerprints get flushed from the local state.",
"type": "number",
"default": 60
},
"periodicity": {
"description": "This value defines the period at which entries get reported.",
"type": "number",
"default": 600
},
"allow-wan": {
"description": "Allow fingerprinting devices found on the WAN port.",
"type": "boolean",
"default": false
}
}
},
"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 +3862,9 @@ static std::string DefaultAPSchema = R"foo(
},
"rrm": {
"$ref": "#/$defs/service.rrm"
},
"fingerprint": {
"$ref": "#/$defs/service.fingerprint"
}
}
},

View File

@@ -107,6 +107,19 @@ namespace OpenWifi {
NewMessage.partition(0);
NewMessage.payload(Msg->Payload());
Producer.produce(NewMessage);
if (Queue_.size() < 100) {
// use flush when internal queue is lightly loaded, i.e. flush after each
// message
Producer.flush();
}
else {
// use poll when internal queue is loaded to allow messages to be sent in
// batches
Producer.poll((std::chrono::milliseconds) 0);
}
}
if (Queue_.size() == 0) {
// message queue is empty, flush all previously sent messages
Producer.flush();
}
} catch (const cppkafka::HandleException &E) {
@@ -119,6 +132,7 @@ namespace OpenWifi {
}
Note = Queue_.waitDequeueNotification();
}
Producer.flush();
poco_information(Logger_, "Stopped...");
}
@@ -324,4 +338,4 @@ namespace OpenWifi {
partitions.front().get_partition()));
}
} // namespace OpenWifi
} // namespace OpenWifi