Compare commits

...

10 Commits

Author SHA1 Message Date
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
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
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
4 changed files with 127 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.13)
project(owprov VERSION 3.0.2)
project(owprov VERSION 3.1.0)
set(CMAKE_CXX_STANDARD 17)

2
build
View File

@@ -1 +1 @@
23
1

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,7 +107,16 @@ namespace OpenWifi {
NewMessage.partition(0);
NewMessage.payload(Msg->Payload());
Producer.produce(NewMessage);
Producer.flush();
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);
}
}
} catch (const cppkafka::HandleException &E) {
poco_warning(Logger_,
@@ -117,8 +126,13 @@ namespace OpenWifi {
} catch (...) {
poco_error(Logger_, "std::exception");
}
if (Queue_.size() == 0) {
// message queue is empty, flush all previously sent messages
Producer.flush();
}
Note = Queue_.waitDequeueNotification();
}
Producer.flush();
poco_information(Logger_, "Stopped...");
}
@@ -324,4 +338,4 @@ namespace OpenWifi {
partitions.front().get_partition()));
}
} // namespace OpenWifi
} // namespace OpenWifi