Compare commits

...

468 Commits

Author SHA1 Message Date
Dmitry Dunaev
07ed169c08 Merge pull request #95 from Telecominfraproject/fix/wifi-9174--dep-charts-2.6
[WIFI-9174] Fix: switch from deprecated bitnami charts to mirrored ones
2022-06-03 15:48:45 +03:00
Dmitry Dunaev
f33b6c94be [WIFI-9174] Fix: switch from deprecated bitnami charts to mirrored ones
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-06-03 15:47:27 +03:00
Stephane Bourque
8ed351ad17 Merge pull request #93 from Telecominfraproject/WIFI8096
Fix: https://telecominfraproject.atlassian.net/browse/WIFI-8096
2022-05-26 23:51:20 -07:00
stephb9959
4a71be0558 Fix: https://telecominfraproject.atlassian.net/browse/WIFI-8096
Signed-off-by: Stephane Bourque <stephane.bourque@arilia.com>
2022-05-26 23:12:44 -07:00
TIP Automation User
e3375a4510 Chg: update image tag in helm values to v2.6.0-RC1 2022-05-23 12:12:39 +00:00
Dmitry Dunaev
6134c37d2b [WIFI-7555] Fix: helm path
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-05-23 15:09:38 +03:00
Johann Hoffmann
5e42202264 Enable CI for pull requests in release branches
Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2022-05-23 13:13:39 +02:00
stephb9959
2f389599f8 Radius Proxy Configuration and routing. 2022-05-22 22:23:31 -07:00
stephb9959
36b633fcb7 Radius Proxy 2022-05-20 10:20:09 -07:00
stephb9959
5a1d56399c Fixed the memory reporting in the dashboard. 2022-05-19 22:59:02 -07:00
stephb9959
8ebb92b95a Adding ability to list devices ordered by field names. 2022-05-19 22:45:29 -07:00
stephb9959
69716f50c0 Framework update. 2022-05-19 16:10:53 -07:00
stephb9959
580e4ce052 Fixing Radius Proxy Processing. 2022-05-19 00:41:23 -07:00
stephb9959
ab663be084 Fixing Radius Proxy Processing. 2022-05-18 21:45:09 -07:00
stephb9959
d5350b4283 Adding RadiusProxy processing. 2022-05-18 21:42:48 -07:00
stephb9959
873d77adf0 Adding RadiusProxy processing. 2022-05-18 21:35:11 -07:00
stephb9959
530555ff26 Adding RadiusProxy processing. 2022-05-18 15:55:50 -07:00
stephb9959
3db8892e58 Adding RadiusProxy processing. 2022-05-18 10:23:34 -07:00
stephb9959
c1ba58be6e Adding RadiusProxy processing. 2022-05-18 10:20:56 -07:00
stephb9959
0750be2d81 Adding RadiusProxy processing. 2022-05-18 10:06:59 -07:00
stephb9959
adec21906f Adding RadiusProxy processing. 2022-05-18 10:04:11 -07:00
stephb9959
80b5c6f3b5 Merge remote-tracking branch 'origin/master' 2022-05-18 09:25:30 -07:00
stephb9959
e29a7589f2 Adding RadiusProxy processing. 2022-05-18 09:24:37 -07:00
Dmitry Dunaev
8255ff3218 Merge pull request #92 from Telecominfraproject/feature/wifi-7873--iploc-support
[WIFI-7873] Add: support for ipinfo
2022-05-18 15:35:53 +03:00
Dmitry Dunaev
5b70cdfe53 [WIFI-7873] Add: support for ipinfo
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-05-18 15:35:20 +03:00
stephb9959
2e94733c8d Framework update. 2022-05-17 12:48:02 -07:00
stephb9959
3d62625cf6 Framework update. 2022-05-17 12:34:22 -07:00
stephb9959
eb0eae90b6 Hardening Kafka errors in producer when there is a kafka disconnection. 2022-05-17 12:15:18 -07:00
stephb9959
d7dc43f0de Adding command to run script. 2022-05-15 13:44:19 -07:00
stephb9959
3c6ec00695 Adding command to run script. 2022-05-13 10:09:43 -07:00
stephb9959
eb705dfeb1 Framework update. 2022-05-12 23:18:57 -07:00
stephb9959
46bd78ba15 Framework update. 2022-05-12 23:09:28 -07:00
stephb9959
e730c60ebc Only allowing root users to run scripts. 2022-05-12 12:14:14 -07:00
stephb9959
3329781bc2 Fixing: https://telecominfraproject.atlassian.net/browse/WIFI-7909 2022-05-12 12:08:52 -07:00
stephb9959
dfcc59a7b8 Fixing: https://telecominfraproject.atlassian.net/browse/WIFI-7909 2022-05-12 12:08:18 -07:00
Stephane Bourque
b72fb379cd Merge pull request #90 from Telecominfraproject/feature/WIFI-7714
test_scripts/curl: add option to stream telemetry data to Kafka
2022-05-12 12:01:26 -07:00
stephb9959
74db8cd36d Fixing: https://telecominfraproject.atlassian.net/browse/WIFI-7909 2022-05-12 11:55:43 -07:00
stephb9959
1219a70da2 Fixing: https://telecominfraproject.atlassian.net/browse/WIFI-7909 2022-05-12 11:54:40 -07:00
stephb9959
dc95a8632a Adding new script command. 2022-05-12 08:50:22 -07:00
Stephane Bourque
8b0ecb464b Remove DEBUG/Add Script
Adding scripting definition to the protocol.
2022-05-11 10:08:03 -07:00
stephb9959
9f863c1cc2 Fixes for https://telecominfraproject.atlassian.net/browse/WIFI-7851 2022-05-11 08:22:10 -07:00
stephb9959
fda6f8b2d9 Fixes for https://telecominfraproject.atlassian.net/browse/WIFI-7851 2022-05-11 08:19:19 -07:00
stephb9959
9703ed035a RTTY troubleshooting. 2022-05-11 08:17:17 -07:00
stephb9959
4117ed927a RTTY troubleshooting. 2022-05-11 08:12:30 -07:00
stephb9959
8980eaa5ba RTTY troubleshooting. 2022-05-11 08:10:11 -07:00
stephb9959
d3d1ccee81 RTTY troubleshooting. 2022-05-11 07:42:00 -07:00
stephb9959
4a0aaa8f6b RTTY troubleshooting. 2022-05-11 07:26:04 -07:00
stephb9959
85e84e0672 RTTY troubleshooting. 2022-05-11 07:23:20 -07:00
stephb9959
7d63852d94 RTTY troubleshooting. 2022-05-11 07:17:34 -07:00
stephb9959
698a2b2fcb RTTY troubleshooting. 2022-05-11 07:04:15 -07:00
stephb9959
62e1c6eb0f RTTY troubleshooting. 2022-05-11 06:59:08 -07:00
stephb9959
1a8fa724d6 RTTY troubleshooting. 2022-05-11 06:54:02 -07:00
stephb9959
b4088519cf RTTY troubleshooting. 2022-05-11 06:45:44 -07:00
Stijn Tintel
58ce304e53 test_scripts/curl: add option to stream telemetry data to Kafka
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-05-11 13:57:20 +03:00
stephb9959
9fbc77a85a RTTY troubleshooting. 2022-05-10 23:15:59 -07:00
stephb9959
623c4c43d4 RTTY troubleshooting. 2022-05-10 22:47:39 -07:00
stephb9959
63ea97b435 RTTY troubleshooting. 2022-05-10 22:34:42 -07:00
stephb9959
d9f3d92736 RTTY troubleshooting. 2022-05-10 22:20:39 -07:00
stephb9959
7fc2239e59 RTTY troubleshooting. 2022-05-10 21:36:44 -07:00
stephb9959
badfe61d6a RTTY troubleshooting. 2022-05-10 21:16:30 -07:00
stephb9959
ab57221040 RTTY troubleshooting. 2022-05-10 21:06:18 -07:00
stephb9959
5ae62b8892 RTTY troubleshooting. 2022-05-10 20:43:54 -07:00
stephb9959
c5425fc9cf RTTY troubleshooting. 2022-05-10 20:16:26 -07:00
stephb9959
dbdc14891c RTTY troubleshooting. 2022-05-10 20:11:08 -07:00
stephb9959
f4b4627c78 RTTY troubleshooting. 2022-05-10 20:10:40 -07:00
stephb9959
35dbe47571 RTTY troubleshooting. 2022-05-10 20:00:25 -07:00
stephb9959
a97337234e RTTY troubleshooting. 2022-05-10 19:54:05 -07:00
stephb9959
a87b8de6e3 RTTY troubleshooting. 2022-05-10 19:52:56 -07:00
stephb9959
949d7a54ad RTTY troubleshooting. 2022-05-10 19:46:56 -07:00
stephb9959
5a3c97a529 RTTY troubleshooting. 2022-05-10 19:32:16 -07:00
stephb9959
0772898160 RTTY troubleshooting. 2022-05-10 19:25:41 -07:00
stephb9959
638ed3f5c8 RTTY troubleshooting. 2022-05-10 19:04:43 -07:00
stephb9959
d996e9e05e RTTY troubleshooting. 2022-05-10 18:43:59 -07:00
stephb9959
58fd622980 RTTY troubleshooting. 2022-05-10 16:20:32 -07:00
stephb9959
29113ac39c RTTY troubleshooting. 2022-05-10 16:08:15 -07:00
stephb9959
f947f472b9 RTTY troubleshooting. 2022-05-10 16:06:02 -07:00
stephb9959
393763fb9e RTTY troubleshooting. 2022-05-10 15:46:50 -07:00
stephb9959
eced94910d RTTY troubleshooting. 2022-05-10 15:36:59 -07:00
stephb9959
df000f35ee RTTY troubleshooting. 2022-05-10 11:03:10 -07:00
stephb9959
24d2de568f RTTY troubleshooting. 2022-05-10 10:53:57 -07:00
stephb9959
8508396ae6 RTTY troubleshooting. 2022-05-10 10:31:13 -07:00
stephb9959
9f6d38e6b7 RTTY troubleshooting. 2022-05-10 10:20:00 -07:00
stephb9959
b8f3b9b37a Framework update. 2022-05-10 08:56:19 -07:00
stephb9959
71cdcb5909 Framework update. 2022-05-10 07:46:23 -07:00
stephb9959
e92e852dcb Merge remote-tracking branch 'origin/master' 2022-05-10 07:45:54 -07:00
stephb9959
0ac5b3a39d Adding "Content-Type: application/json" to commands for https://telecominfraproject.atlassian.net/browse/WIFI-7867 2022-05-10 07:45:45 -07:00
Johann Hoffmann
3fbf460f81 Wait for AP to connect until timeout
Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2022-05-10 10:50:24 +02:00
stephb9959
9b7db5c095 Framework Update. 2022-05-09 10:29:22 -07:00
stephb9959
eb9e88b54a Framework Update. 2022-05-09 09:58:49 -07:00
stephb9959
952b1c4562 Adding DEBUG for device. 2022-05-08 09:52:05 -07:00
stephb9959
cec50beecf Framework update. 2022-05-08 08:49:18 -07:00
stephb9959
2048107866 Error Framework migration. 2022-05-07 21:58:43 -07:00
stephb9959
2d72a15ec0 Error Framework migration. 2022-05-06 23:11:07 -07:00
stephb9959
d5c36aa2e9 Error Framework migration. 2022-05-06 23:10:40 -07:00
stephb9959
41079d9f0b Adding Notification. 2022-05-06 10:27:09 -07:00
stephb9959
a47977b029 Framework update. 2022-05-05 21:28:52 -07:00
stephb9959
e20b71181f Framework update. 2022-05-05 21:19:11 -07:00
stephb9959
4f29e5a650 WebSocket Notification Framework update 2022-05-05 20:48:16 -07:00
stephb9959
e168c7b2c7 WebSocket Notification Framework update 2022-05-05 20:28:56 -07:00
stephb9959
1f6de95f16 WebSocket Notification Framework update 2022-05-05 20:26:08 -07:00
stephb9959
96995730c6 Proper Reactor Pool sizing. 2022-05-05 19:39:51 -07:00
stephb9959
9d000ca84d Proper Reactor Pool sizing. 2022-05-05 16:52:28 -07:00
stephb9959
9af6deaec3 Proper Reactor Pool sizing. 2022-05-05 16:08:38 -07:00
stephb9959
aaa13e1e2f Proper Reactor Pool sizing. 2022-05-05 15:26:11 -07:00
stephb9959
bd0419fb0c Proper Reactor Pool sizing. 2022-05-05 15:18:13 -07:00
stephb9959
656efd0d57 Proper Reactor Pool sizing. 2022-05-05 15:11:01 -07:00
stephb9959
863ff017b0 Increasing timeout for WifiScan. 2022-05-05 09:28:40 -07:00
stephb9959
8c26cc37d7 Increasing timeout for WifiScan. 2022-05-05 07:49:50 -07:00
stephb9959
4e9c26cd04 Cleaning up extra logging. 2022-05-04 23:51:31 -07:00
stephb9959
d098bca86f Cleaning up extra logging. 2022-05-04 23:38:00 -07:00
stephb9959
9980c2b175 Cleaning up extra logging. 2022-05-04 23:32:57 -07:00
stephb9959
a52daae4a5 Cleaning up extra logging. 2022-05-04 23:27:00 -07:00
stephb9959
1d8af05302 Cleaning up extra logging. 2022-05-04 23:06:22 -07:00
stephb9959
2efccedfba Fixing trace logging. 2022-05-04 22:57:46 -07:00
stephb9959
243b615814 Fixing OUI Caching issue. 2022-05-04 22:33:38 -07:00
stephb9959
dc37bcb5ff Fixing OUI Caching issue. 2022-05-04 22:19:35 -07:00
stephb9959
edac1d6ceb Fixing OUI Caching issue. 2022-05-04 22:11:19 -07:00
stephb9959
64848d8fdd Fixing OUI Caching issue. 2022-05-04 22:01:41 -07:00
stephb9959
c874b7633d Removing unused ReactorPool 2022-05-04 21:54:46 -07:00
stephb9959
2ca85970e4 Removing unused ReactorPool 2022-05-04 21:49:05 -07:00
stephb9959
0184aa8879 Removing unused ReactorPool 2022-05-04 21:35:56 -07:00
stephb9959
ac05fe833e Removing unused ReactorPool 2022-05-04 21:31:17 -07:00
stephb9959
998a686179 Removing unused ReactorPool 2022-05-04 21:27:04 -07:00
stephb9959
288b5e207f Trace queue ageing fix. 2022-05-04 18:32:56 -07:00
stephb9959
2ec0c923c3 Trace queue ageing fix. 2022-05-04 18:06:58 -07:00
stephb9959
4c9dd0cef7 Trace queue ageing fix. 2022-05-04 14:39:15 -07:00
stephb9959
8f16abd4ff Trace fixed. 2022-05-04 14:26:51 -07:00
stephb9959
c706ea4118 Trace fixed. 2022-05-04 12:24:16 -07:00
stephb9959
9c2fef1ee4 Trace fixed. 2022-05-04 12:07:49 -07:00
stephb9959
1648acca32 Trace fixed. 2022-05-04 11:59:16 -07:00
stephb9959
c11c0281ce Trace Upload failure. 2022-05-04 11:52:23 -07:00
stephb9959
58ee7344bf Trace Upload failure. 2022-05-04 11:47:59 -07:00
stephb9959
6c9dac79d5 Trace Upload failure. 2022-05-04 11:34:04 -07:00
stephb9959
7aa284e92c Trace Upload failure. 2022-05-04 11:29:43 -07:00
stephb9959
933b41e7c1 Trace Upload failure. 2022-05-04 11:17:54 -07:00
stephb9959
a39e586bc1 Trace Upload failure. 2022-05-04 11:11:51 -07:00
stephb9959
4e81683bcd Trace Upload failure. 2022-05-04 11:05:22 -07:00
stephb9959
6a74297cb3 Trace Upload failure. 2022-05-04 11:01:12 -07:00
stephb9959
67764ec5c1 Trace Upload failure. 2022-05-04 10:55:57 -07:00
stephb9959
ebbcd99453 Trace Upload failure. 2022-05-04 10:52:00 -07:00
stephb9959
3719df39fe Trace Upload failure. 2022-05-04 10:37:02 -07:00
stephb9959
70670117a7 Trace Upload failure. 2022-05-04 10:10:56 -07:00
stephb9959
31f77b84d6 Trace Upload failure. 2022-05-04 09:53:51 -07:00
stephb9959
924e2f0775 Trace Upload failure. 2022-05-04 09:50:37 -07:00
stephb9959
cb61ce3f9e Trace Upload failure. 2022-05-04 09:49:49 -07:00
stephb9959
d97033d6cf Trace Upload failure. 2022-05-04 09:48:56 -07:00
stephb9959
c2f547da0c Trace Upload failure. 2022-05-04 09:35:07 -07:00
stephb9959
7cc60e6063 Trace Upload failure. 2022-05-04 09:19:42 -07:00
stephb9959
4f117199f0 Merge remote-tracking branch 'origin/master' 2022-05-04 09:05:05 -07:00
stephb9959
0d444c4bc9 Trace Upload failure. 2022-05-04 09:04:57 -07:00
Johann Hoffmann
87646944dd Support older releases in test_service CLI command
Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2022-05-04 17:24:33 +02:00
stephb9959
13c9633964 Trace Upload failure. 2022-05-04 08:19:36 -07:00
stephb9959
ab77f1371d Merge remote-tracking branch 'origin/master' 2022-05-04 07:55:24 -07:00
stephb9959
4ac71c4af2 Trace Upload failure. 2022-05-04 07:54:52 -07:00
Johann Hoffmann
1ca1fffa26 Add FLAGS variable in curl request
Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2022-05-04 11:34:45 +02:00
stephb9959
4e623ab182 Trace Upload failure. 2022-05-03 23:44:09 -07:00
stephb9959
fb27ea8528 Trace Upload failure. 2022-05-03 23:30:52 -07:00
stephb9959
bc20d66694 Adding proper loggin to RTTYS 2022-05-03 23:15:25 -07:00
stephb9959
beadcd50e7 Adding proper loggin to RTTYS 2022-05-03 23:05:32 -07:00
stephb9959
5d1c9b10da Adding proper loggin to RTTYS 2022-05-03 22:58:38 -07:00
stephb9959
7e877b74a7 Adding proper loggin to RTTYS 2022-05-03 22:49:41 -07:00
stephb9959
47b569aa59 Adding proper loggin to RTTYS 2022-05-03 22:45:06 -07:00
stephb9959
2afa4b64e8 Adding proper loggin to RTTYS 2022-05-03 22:35:13 -07:00
stephb9959
315bad5451 Adding proper loggin to RTTYS 2022-05-03 22:18:02 -07:00
stephb9959
c8fa1d5405 Adding proper loggin to RTTYS 2022-05-03 22:07:52 -07:00
stephb9959
40a28015bd Adding proper loggin to RTTYS 2022-05-03 22:07:00 -07:00
stephb9959
4a25b0ba99 Adding proper loggin to RTTYS 2022-05-03 21:29:33 -07:00
stephb9959
9ea7ab14df Adding proper loggin to RTTYS 2022-05-03 21:25:39 -07:00
stephb9959
aa692d9f30 Adding proper loggin to RTTYS 2022-05-03 20:56:15 -07:00
stephb9959
044d978c46 Fixing CORS issues in RTTY WebService 2022-05-03 20:05:08 -07:00
stephb9959
b767dd3aa4 Fixing CORS issues in RTTY WebService 2022-05-03 19:55:57 -07:00
stephb9959
9acbd6cef6 Framework update 2022-05-03 19:22:42 -07:00
stephb9959
a20ec0587e Framework update 2022-05-03 18:57:03 -07:00
stephb9959
28b72a6303 Framework update 2022-05-03 18:02:46 -07:00
stephb9959
9540fc9a5f Fixing command manager 2022-05-03 17:24:58 -07:00
stephb9959
18eac29b1a Fixing command manager 2022-05-03 17:09:58 -07:00
stephb9959
76b2255716 Framework Update 2022-05-03 08:38:32 -07:00
stephb9959
17377aa8bc Fix missing dates for notes on device. 2022-05-03 07:35:39 -07:00
stephb9959
d1a50fcf22 Fixing RTTYs failure to detect bad socket. 2022-05-02 23:37:08 -07:00
stephb9959
cccd8f8fbd Fixing RTTYs failure to detect bad socket. 2022-05-02 22:42:37 -07:00
stephb9959
9c37d0760d Fixing RTTYs failure to detect bad socket. 2022-05-02 22:08:06 -07:00
stephb9959
90d56197e6 Fixing RTTYs failure t odetect bad socket. 2022-05-02 21:55:11 -07:00
stephb9959
6b91065468 Fixing FileUploader for NoSecurityAPI(). 2022-05-02 21:48:53 -07:00
stephb9959
f851957523 Framework Update 2022-05-02 13:53:21 -07:00
stephb9959
ec0574bfdf Framework Update 2022-05-02 11:43:51 -07:00
stephb9959
6bc279ac32 Framework Update 2022-05-02 11:26:59 -07:00
stephb9959
1cdb5ef2e3 Framework Update 2022-05-02 10:37:48 -07:00
stephb9959
d85854a1f2 Fixing NoAPISecurity for RTTY Server 2022-05-01 21:17:29 -07:00
stephb9959
e0d6fb0bcc Fixing NoAPISecurity for RTTY Server 2022-05-01 11:10:47 -07:00
stephb9959
6e864c14a1 Fixing NoAPISecurity for RTTY Server 2022-05-01 10:35:24 -07:00
stephb9959
8e49ffa904 Fixing NoAPISecurity for RTTY Server 2022-04-30 22:42:14 -07:00
stephb9959
4db50c0ed2 Added firmware updated notification. 2022-04-30 22:32:09 -07:00
stephb9959
191611bc24 New web socket notifications. 2022-04-30 22:20:34 -07:00
stephb9959
d10541afb7 New web socket notifications. 2022-04-30 21:42:04 -07:00
stephb9959
1887878088 New web socket notifications. 2022-04-29 14:20:45 -07:00
stephb9959
de3985191a New web socket notifications. 2022-04-29 14:08:38 -07:00
stephb9959
629a615f7c Framework Update. 2022-04-28 14:12:48 -07:00
stephb9959
ec947df8a0 Framework Update. 2022-04-28 12:57:24 -07:00
stephb9959
203095a6f7 Framework Update. 2022-04-28 12:55:57 -07:00
stephb9959
f71ce62c5b Framework Update. 2022-04-28 12:52:34 -07:00
stephb9959
89680d6be7 Framework Update. 2022-04-28 12:50:57 -07:00
stephb9959
e411f4f6ac Framework Update. 2022-04-28 12:48:45 -07:00
stephb9959
bbcb23b821 Framework Update. 2022-04-28 12:44:22 -07:00
stephb9959
75dfd49067 Framework Update. 2022-04-28 12:41:46 -07:00
stephb9959
39d4423a5e Framework Update. 2022-04-28 12:37:19 -07:00
stephb9959
6238fee522 Framework Update. 2022-04-28 12:27:14 -07:00
stephb9959
e301ea7cee Cleaning up logging for RTTYS. 2022-04-27 21:05:41 -07:00
stephb9959
42aff04610 Cleaning up logging for RTTYS. 2022-04-27 16:04:07 -07:00
stephb9959
345053bdba Cleaning up logging for RTTYS. 2022-04-27 09:28:06 -07:00
stephb9959
285fd26f99 Improving device command queue. 2022-04-27 08:38:08 -07:00
stephb9959
49c393a02f Improving device command queue. 2022-04-25 09:56:57 -07:00
stephb9959
7242b7b34f Improving device command queue. 2022-04-25 09:49:06 -07:00
stephb9959
a2aad9d1fa Improving device command queue. 2022-04-23 23:06:32 -07:00
stephb9959
8a27698d2b Improving device command queue. 2022-04-23 23:01:43 -07:00
stephb9959
5fecaaf891 Improving device command queue. 2022-04-23 22:51:34 -07:00
stephb9959
8a651613c6 Improving device command queue. 2022-04-23 22:49:05 -07:00
stephb9959
23f6eb7417 Improving device command queue. 2022-04-23 22:40:12 -07:00
stephb9959
6d0e58cb0f Improving device command queue. 2022-04-23 22:36:30 -07:00
stephb9959
317bbcbcd8 Improving device command queue. 2022-04-23 22:19:18 -07:00
stephb9959
5f3f1cada2 Improving device command queue. 2022-04-23 22:17:06 -07:00
stephb9959
5b83e39c46 Improving device command queue. 2022-04-23 22:14:26 -07:00
stephb9959
9342b1ece2 Improving device command queue. 2022-04-23 22:07:16 -07:00
stephb9959
ba1ef56b1f Improving device command queue. 2022-04-23 22:06:35 -07:00
stephb9959
6bf1b1b9e1 Improving device command queue. 2022-04-23 21:56:46 -07:00
stephb9959
fc5e5804ff Framework update. 2022-04-23 16:50:36 -07:00
stephb9959
5188615006 Trying to fix https://telecominfraproject.atlassian.net/browse/WIFI-7564 2022-04-23 11:46:25 -07:00
stephb9959
89d62109f9 Fixing OUI file request too often 2022-04-22 22:18:16 -07:00
stephb9959
a539fecfb4 Framework update 2022-04-22 14:28:46 -07:00
stephb9959
19b213bb08 Fixing RTTYS 2022-04-21 23:12:54 -07:00
stephb9959
391d2df605 Fixing RTTYS 2022-04-21 23:08:47 -07:00
stephb9959
d7859ef6f2 Fixing RTTYS 2022-04-21 22:57:11 -07:00
stephb9959
386c9ac217 Fixing RTTYS 2022-04-21 22:46:01 -07:00
stephb9959
567bb7140a Fixing RTTYS 2022-04-21 22:45:55 -07:00
stephb9959
787a80eec3 Improving RTTYS 2022-04-21 22:23:19 -07:00
stephb9959
87a6b2ae3f Improving RTTYS 2022-04-21 22:20:11 -07:00
stephb9959
bc1969e5f6 Improving RTTYS 2022-04-21 22:18:01 -07:00
stephb9959
aa654510e9 Improving RTTYS 2022-04-21 22:07:01 -07:00
stephb9959
2591ce2752 Improving RTTYS 2022-04-21 22:02:19 -07:00
stephb9959
118f79864f Improving RTTYS 2022-04-21 21:58:49 -07:00
stephb9959
fb074e16c1 Improving RTTYS 2022-04-21 21:44:52 -07:00
stephb9959
a687ea64bd Improving RTTYS 2022-04-21 21:41:55 -07:00
stephb9959
f07c87d198 Improving RTTYS 2022-04-21 21:39:41 -07:00
stephb9959
f2ec7b08a7 Improving RTTYS 2022-04-21 21:27:45 -07:00
stephb9959
9f2e6c77a5 Improving RTTYS 2022-04-21 21:24:28 -07:00
stephb9959
544272c6f8 Improving RTTYS 2022-04-21 21:18:15 -07:00
stephb9959
db033d1045 Improving RTTYS 2022-04-21 21:04:44 -07:00
stephb9959
073909f735 Improving RTTYS 2022-04-21 20:45:52 -07:00
stephb9959
c6516e3ac7 Improving RTTYS 2022-04-21 20:42:33 -07:00
stephb9959
d695b6994e Improving RTTYS 2022-04-21 20:22:22 -07:00
stephb9959
0fe158fc3e Improving RTTYS 2022-04-21 20:17:00 -07:00
stephb9959
a66d8e8845 Improving RTTYS 2022-04-20 23:30:29 -07:00
stephb9959
fef479e241 Improving RTTYS 2022-04-20 23:24:38 -07:00
stephb9959
ef84384324 Improving RTTYS 2022-04-20 23:17:22 -07:00
stephb9959
cee1894716 Improving RTTYS 2022-04-20 23:13:31 -07:00
stephb9959
6e9cb56ce8 Improving RTTYS 2022-04-20 23:05:47 -07:00
stephb9959
7c2fc66f93 Improving RTTYS 2022-04-20 23:01:05 -07:00
stephb9959
794040f3c7 Improving RTTYS 2022-04-20 22:51:07 -07:00
stephb9959
9c0c5f1772 Improving RTTYS 2022-04-20 22:47:21 -07:00
stephb9959
d289c4b242 Improving RTTYS 2022-04-20 22:43:30 -07:00
stephb9959
49aeea00ff Improving RTTYS 2022-04-20 22:38:25 -07:00
stephb9959
072191fbc4 Improving RTTYS 2022-04-20 22:35:09 -07:00
stephb9959
0a4249e615 Improving RTTYS 2022-04-20 22:30:14 -07:00
stephb9959
ebaa0ea59e Improving RTTYS 2022-04-20 22:24:57 -07:00
stephb9959
f12597d72f Improving RTTYS 2022-04-20 22:14:59 -07:00
stephb9959
87bf2fb413 Improving RTTYS 2022-04-20 22:12:45 -07:00
stephb9959
ce848f6057 Improving RTTYS 2022-04-20 22:09:26 -07:00
stephb9959
031a635c2d Improving RTTYS 2022-04-20 22:06:43 -07:00
stephb9959
52d5d147fa Improving RTTYS 2022-04-20 22:02:57 -07:00
stephb9959
ff1c85cbd6 Improving RTTYS 2022-04-20 21:54:18 -07:00
stephb9959
a7d661de27 Improving RTTYS 2022-04-20 21:51:57 -07:00
stephb9959
a8db90b554 Improving RTTYS 2022-04-20 21:51:05 -07:00
stephb9959
b01f9eab33 Improving RTTYS 2022-04-20 21:45:55 -07:00
stephb9959
cb29abf914 Improving RTTYS 2022-04-20 21:34:11 -07:00
stephb9959
48f2b62cf0 Improving RTTYS 2022-04-20 21:28:23 -07:00
stephb9959
90074096fc Improving RTTYS 2022-04-20 21:23:35 -07:00
stephb9959
ecf28c596b Improving RTTYS 2022-04-20 21:22:21 -07:00
stephb9959
caf53ef6ba Improving RTTYS 2022-04-20 21:19:53 -07:00
stephb9959
318d65ea1f Improving RTTYS 2022-04-20 12:24:54 -07:00
stephb9959
e9b39b57ff Improving RTTYS 2022-04-20 12:20:38 -07:00
stephb9959
c4a7c8dab2 Improving RTTYS 2022-04-20 11:58:34 -07:00
stephb9959
6a2a8d3b8c Improving RTTYS 2022-04-20 11:53:27 -07:00
stephb9959
74eb9450f0 Improving RTTYS 2022-04-20 11:49:39 -07:00
stephb9959
8183ae6314 Improving RTTYS 2022-04-20 11:43:06 -07:00
stephb9959
7f80252bf9 Improving RTTYS 2022-04-20 11:38:44 -07:00
stephb9959
430275cbf0 Improving RTTYS 2022-04-20 11:26:50 -07:00
stephb9959
617f8a8307 Improving RTTYS 2022-04-20 11:17:01 -07:00
stephb9959
49435f1cb8 Improving RTTYS 2022-04-20 11:15:25 -07:00
stephb9959
45f19e57f3 Improving RTTYS 2022-04-20 10:42:21 -07:00
stephb9959
02fb282698 Improving RTTYS 2022-04-20 10:39:00 -07:00
stephb9959
e4becc70ca Improving RTTYS 2022-04-20 10:33:20 -07:00
stephb9959
946ccdb9dc Improving RTTYS 2022-04-20 10:28:13 -07:00
stephb9959
be6eb734fe Improving RTTYS 2022-04-20 10:24:18 -07:00
stephb9959
4c9df3e574 Improving RTTYS 2022-04-20 10:22:03 -07:00
stephb9959
6745aa425d Improving RTTYS 2022-04-20 10:10:45 -07:00
stephb9959
659f45d4ef Improving RTTYS 2022-04-20 10:01:55 -07:00
stephb9959
2939efb7b0 Improving RTTYS 2022-04-20 09:50:32 -07:00
stephb9959
909efce91a Improving RTTYS 2022-04-20 09:41:51 -07:00
stephb9959
4e81e54fe3 Improving RTTYS 2022-04-20 09:37:55 -07:00
stephb9959
af355bd5a1 Improving RTTYS 2022-04-20 09:33:15 -07:00
stephb9959
52bb4acb2e Improving RTTYS 2022-04-20 09:27:48 -07:00
stephb9959
19f1238b1c Improving RTTYS 2022-04-20 09:18:36 -07:00
stephb9959
1e397077aa Improving RTTYS 2022-04-20 09:12:02 -07:00
stephb9959
dd78d52798 Improving RTTYS 2022-04-20 09:11:23 -07:00
stephb9959
56a20e475b Improving RTTYS 2022-04-20 09:07:07 -07:00
stephb9959
313e21a461 Improving RTTYS 2022-04-20 08:55:43 -07:00
stephb9959
ff37328806 Improving RTTYS 2022-04-20 08:52:06 -07:00
stephb9959
19dfe74ada Improving RTTYS 2022-04-20 08:34:25 -07:00
stephb9959
3a8254dfda Improving RTTYS 2022-04-20 08:30:22 -07:00
stephb9959
796db4db9a Improving RTTYS 2022-04-20 08:27:18 -07:00
stephb9959
a9fa9abad3 Improving RTTYS 2022-04-20 08:17:03 -07:00
stephb9959
4e5d9020ea Improving RTTYS 2022-04-20 08:01:30 -07:00
stephb9959
86d8cdda75 Improving RTTYS 2022-04-20 07:59:22 -07:00
stephb9959
77f91d041f Improving RTTYS 2022-04-20 07:46:56 -07:00
stephb9959
446fabb372 Improving RTTYS 2022-04-20 07:41:16 -07:00
stephb9959
d7bac5d731 Improving RTTYS 2022-04-20 07:21:35 -07:00
stephb9959
98e705bba4 Improving RTTYS 2022-04-20 07:14:21 -07:00
stephb9959
fcaa9efe81 Improving RTTYS 2022-04-20 06:53:09 -07:00
stephb9959
05b9c1d85f Improving RTTYS 2022-04-20 06:47:26 -07:00
stephb9959
b7775206db Improving RTTYS 2022-04-19 23:45:01 -07:00
stephb9959
79b7104319 Improving RTTYS 2022-04-19 23:36:44 -07:00
stephb9959
71ca079c83 Improving RTTYS 2022-04-19 23:21:22 -07:00
stephb9959
d132251e36 Improving RTTYS 2022-04-19 22:25:19 -07:00
stephb9959
9d0ed5e363 Improving RTTYS 2022-04-19 22:17:08 -07:00
stephb9959
b9d8e8ef67 Improving RTTYS 2022-04-19 22:07:42 -07:00
stephb9959
347eb883ea Improving RTTYS 2022-04-19 22:00:27 -07:00
stephb9959
5dd259901c Improving RTTYS 2022-04-19 21:55:11 -07:00
stephb9959
0797c719e4 Improving RTTYS 2022-04-19 21:53:06 -07:00
stephb9959
59b183f2d2 Improving RTTYS 2022-04-19 21:45:39 -07:00
stephb9959
c3c80d07a5 Improving RTTYS 2022-04-19 21:35:04 -07:00
stephb9959
8f68d44388 Improving RTTYS 2022-04-19 21:20:32 -07:00
stephb9959
68446b7807 Improving RTTYS 2022-04-19 21:07:05 -07:00
stephb9959
36bd0a9eb0 Improving RTTYS 2022-04-19 15:29:54 -07:00
stephb9959
0ad1ccfdf1 Improving RTTYS 2022-04-19 15:14:39 -07:00
stephb9959
851dc1372c Improving RTTYS 2022-04-19 15:11:33 -07:00
stephb9959
5093a80a88 Improving RTTYS 2022-04-19 15:09:33 -07:00
stephb9959
cac3e5f6ff Improving RTTYS 2022-04-19 15:05:28 -07:00
stephb9959
0d63037a6e Improving RTTYS 2022-04-19 14:57:23 -07:00
stephb9959
5ab641aeb7 Improving RTTYS 2022-04-19 14:50:22 -07:00
stephb9959
c87074cfb5 Improving RTTYS 2022-04-19 14:42:42 -07:00
stephb9959
1bc537dade Improving RTTYS 2022-04-19 14:41:11 -07:00
stephb9959
93b24fc292 Improving RTTYS 2022-04-19 14:39:41 -07:00
stephb9959
c1f6f1d50c Improving RTTYS 2022-04-19 14:32:03 -07:00
stephb9959
067a481e4a Improving RTTYS 2022-04-19 14:28:10 -07:00
stephb9959
3086675af5 Improving RTTYS 2022-04-19 14:25:40 -07:00
stephb9959
3c22fe8af2 Improving RTTYS 2022-04-19 14:20:54 -07:00
stephb9959
9a4e834c94 Improving RTTYS 2022-04-19 14:13:51 -07:00
stephb9959
53a8f4db1f Improving RTTYS 2022-04-19 14:08:17 -07:00
stephb9959
36c381ccbf Improving RTTYS 2022-04-19 14:02:09 -07:00
stephb9959
c74807993f Improving RTTYS 2022-04-19 13:59:10 -07:00
stephb9959
a9e7e1e514 Improving RTTYS 2022-04-19 13:55:03 -07:00
stephb9959
15286d07f0 Improving RTTYS 2022-04-19 13:48:52 -07:00
stephb9959
3baeea6833 Improving RTTYS 2022-04-19 13:40:57 -07:00
stephb9959
ef8db87ee7 Improving RTTYS 2022-04-19 12:40:35 -07:00
stephb9959
4372c66e32 Improving RTTYS 2022-04-19 12:37:44 -07:00
stephb9959
bd38bb71d3 Improving RTTYS 2022-04-19 12:34:54 -07:00
stephb9959
0d0c310280 Improving RTTYS 2022-04-19 12:30:11 -07:00
stephb9959
2ca0f6ddcd Improving RTTYS 2022-04-19 12:20:57 -07:00
stephb9959
a2ad4f58ad Improving RTTYS 2022-04-19 12:16:35 -07:00
stephb9959
02d0daff14 Improving RTTYS 2022-04-19 12:12:30 -07:00
stephb9959
3c37b60f74 Improving RTTYS 2022-04-19 12:08:26 -07:00
stephb9959
6626567a5f Improving RTTYS 2022-04-19 12:04:47 -07:00
stephb9959
adc1b4c61f Improving RTTYS 2022-04-19 12:00:36 -07:00
stephb9959
2764821f21 Improving RTTYS 2022-04-19 11:57:50 -07:00
stephb9959
abd4219304 Improving RTTYS 2022-04-19 07:59:11 -07:00
stephb9959
fc8bcdecdb Improving RTTYS 2022-04-19 07:54:52 -07:00
stephb9959
82e4cd157a Improving RTTYS 2022-04-18 23:47:31 -07:00
stephb9959
29ad904c53 Merge remote-tracking branch 'origin/master' 2022-04-18 23:44:07 -07:00
stephb9959
05a069efda Improving RTTYS 2022-04-18 23:43:59 -07:00
Dmitry Dunaev
6f6f85f40b [WIFI-7555] Fix: release body workdir
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-04-18 11:13:01 +03:00
Dmitry Dunaev
5f709ac70f Merge pull request #89 from Telecominfraproject/feature/wifi-7555--add-release-workflow
[WIFI-7555] Add: Helm packaging and GitHub release step
2022-04-18 11:08:13 +03:00
stephb9959
977fca2887 Merge remote-tracking branch 'origin/master' 2022-04-14 14:27:53 -04:00
stephb9959
0bbfda3de5 Update framework. 2022-04-14 14:27:47 -04:00
Dmitry Dunaev
784795b21a [WIFI-7555] Add: Helm packaging and GitHub release step
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-04-14 15:52:33 +03:00
Dmitry Dunaev
00a1309040 Merge pull request #88 from Telecominfraproject/feature/wifi-7461--add-dev-trigger-deployment
[WIFI-7461] Add: CI step for master branch to trigger deployment of the latest version to dev instance
2022-04-12 16:51:27 +03:00
Dmitry Dunaev
db95129339 [WIFI-7461] Add: CI step for master branch to trigger deployment of the latest version to dev instance
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-04-12 15:45:56 +03:00
stephb9959
0c41105c94 Merge remote-tracking branch 'origin/master' 2022-04-10 07:27:35 -07:00
stephb9959
ccead902ec Update framework. 2022-04-10 07:27:07 -07:00
Johann Hoffmann
cf582f8899 Set default value for RTTY_ASSETS in docker-entrypoint.sh
Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2022-04-07 16:29:27 +02:00
stephb9959
3a5c1c1218 Update framework. 2022-04-06 09:44:03 -07:00
stephb9959
7e5e998265 Updated the OUI db download link 2022-04-05 10:59:39 -07:00
stephb9959
306dc49bc1 Fixing framework. 2022-04-04 07:52:41 -07:00
stephb9959
297510c2e2 Merge remote-tracking branch 'origin/master' 2022-04-03 18:39:54 -07:00
stephb9959
0ec0cea131 Fixing framework. 2022-04-03 18:39:45 -07:00
Johann Hoffmann
0cd78ad1d8 Fix syntax error
Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2022-04-01 15:15:20 +02:00
Johann Hoffmann
46c7361f55 Fix test_service command after switch to built-in RTTYS
Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2022-04-01 14:24:03 +02:00
Dmitry Dunaev
9b55ce0f45 Merge pull request #87 from Telecominfraproject/feature/wifi-7221--add-owsub-trigger-testing
[WIFI-7221] Chg: trigger-testing inputs with new services
2022-04-01 13:52:35 +03:00
Dmitry Dunaev
77c7420700 [WIFI-7221] Chg: trigger-testing inputs with new services
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-04-01 13:50:35 +03:00
stephb9959
b7e7541d7d DeviceReactor registration. 2022-03-31 07:31:54 -07:00
stephb9959
dac7b7ca93 Merge remote-tracking branch 'origin/master' 2022-03-29 15:40:39 -07:00
stephb9959
7160dbdaa7 Fixing fmt::format errors 2022-03-29 15:40:31 -07:00
Johann Hoffmann
164d8e12a3 [WIFI-7436] Switch to built-in RTTYS (#85)
* Add config options to enable built-in RTTYS

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Adapt rttys config in Helm chart

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Fix typo in config template

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2022-03-29 10:51:31 +02:00
Dmitry Dunaev
90625f5e3a [WIFI-4884] Add: more clear slack message on failure
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-03-28 12:59:35 +03:00
stephb9959
4ec83bdc59 Fixing warnings 2022-03-27 23:47:51 -07:00
stephb9959
3a1dcdb026 Fixing warnings 2022-03-27 23:47:05 -07:00
stephb9959
ed5a18805c Fixing warnings 2022-03-27 23:45:36 -07:00
stephb9959
ba9075d46e Fixing asan flags 2022-03-27 08:15:51 -07:00
stephb9959
391ebebc70 Cleaning up CMakeLists.txt 2022-03-26 08:17:36 -07:00
stephb9959
0ce355004b Sanitized 2022-03-25 20:31:16 -07:00
stephb9959
187a2c7168 Sanitized 2022-03-25 20:28:01 -07:00
stephb9959
b8a646a011 Sanitized 2022-03-25 20:26:01 -07:00
stephb9959
9cb99ef9cd Sanitized 2022-03-25 20:24:10 -07:00
stephb9959
53761649f8 Sanitized 2022-03-25 15:52:38 -07:00
stephb9959
13bbb011a9 Framework fix "}" crash 2022-03-25 07:39:18 -07:00
stephb9959
bc14a41152 Framework fix. 2022-03-24 21:13:57 -07:00
stephb9959
adacc8b3fe Framework fix. 2022-03-24 20:40:14 -07:00
stephb9959
47323d2eee Framework fix. 2022-03-24 14:40:04 -07:00
stephb9959
283f9f7bf6 Framework fix. 2022-03-24 14:23:20 -07:00
stephb9959
5895613ada Merge remote-tracking branch 'origin/master' 2022-03-24 11:56:28 -07:00
stephb9959
8b99e863eb Framework fix. 2022-03-24 11:56:20 -07:00
Dmitry Dunaev
dfb6395b30 [WIFI-4884] Add: github slack icon
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-03-24 14:23:00 +03:00
Dmitry Dunaev
64e2cba3ae Merge pull request #84 from Telecominfraproject/feature/wifi-4884--add-slack-notify-on-failure
[WIFI-4884] Add: notification step via Slack on failure in CI on master branch
2022-03-24 13:03:20 +03:00
stephb9959
6337f6e61a Change to fmt:: 2022-03-23 16:05:50 -07:00
Dmitry Dunaev
5c286f4efe [WIFI-4884] Add: notification step via Slack on failure in CI on master branch
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-03-23 15:13:21 +03:00
stephb9959
55d320b4d0 Fixing:https://telecominfraproject.atlassian.net/browse/WIFI-7433 2022-03-22 23:31:18 -07:00
stephb9959
2377497497 Fixing:https://telecominfraproject.atlassian.net/browse/WIFI-7433 2022-03-22 21:28:18 -07:00
stephb9959
ee9963ad8a Fixing:https://telecominfraproject.atlassian.net/browse/WIFI-7433 2022-03-22 21:17:15 -07:00
stephb9959
43d631ba3e Fixing:https://telecominfraproject.atlassian.net/browse/WIFI-7433 2022-03-22 14:58:02 -07:00
stephb9959
5ae2e0b945 Fixing: https://telecominfraproject.atlassian.net/browse/WIFI-7434 2022-03-22 14:00:27 -07:00
stephb9959
6f1dec06d5 Framework update: support for insecure RESTAPI for ALB support. 2022-03-21 21:40:53 -07:00
stephb9959
9fae68766c Framework update: support for insecure RESTAPI for ALB support. 2022-03-21 21:40:46 -07:00
stephb9959
eeffefb1ce Adding support for compress_sz when receiving large messages. 2022-03-19 22:02:57 -07:00
stephb9959
dced0b97cc Fixing stats message size uncompressing too large. 2022-03-18 09:28:30 -07:00
stephb9959
c4e7835a6f Fixing stats message size uncompressing too large. 2022-03-18 08:48:16 -07:00
stephb9959
7a56629478 Adjusting incoming buffer size for large stats blocks 2022-03-18 08:42:56 -07:00
stephb9959
20cf7d2484 Adjusting incoming buffer size for large stats blocks 2022-03-18 08:22:28 -07:00
stephb9959
f5d06b68a5 Adjusting incoming buffer size for large stats blocks 2022-03-18 08:15:56 -07:00
stephb9959
e213a4f71d Adjusting incoming buffer size for large stats blocks 2022-03-18 08:13:51 -07:00
stephb9959
08b1a9da4b Adjusting incoming buffer size for large stats blocks 2022-03-18 08:09:01 -07:00
stephb9959
3467b6a264 Adjusting incoming buffer size for large stats blocks 2022-03-18 08:00:05 -07:00
stephb9959
38d4c5bc79 Adjusting incoming buffer size for large stats blocks 2022-03-18 07:42:31 -07:00
stephb9959
f4a2041d09 Adjusting incoming buffer size for large stats blocks 2022-03-17 21:26:54 -07:00
stephb9959
7d25da17d1 Merge remote-tracking branch 'origin/master' 2022-03-17 21:21:32 -07:00
stephb9959
a15e47183a Adjusting incoming buffer size for large stats blocks 2022-03-17 21:21:24 -07:00
Johann Hoffmann
407f82e480 [WIFI-7229] Integrate virtual AP in Docker Compose testing workflow (#82)
* Add required input

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Change ref to master since PR was merged

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2022-03-15 13:14:22 +01:00
stephb9959
398aae824e Merge remote-tracking branch 'origin/master' 2022-03-14 10:18:29 -07:00
stephb9959
04b0446fff Adding details on some kafka messages. 2022-03-14 10:18:19 -07:00
Dmitry Dunaev
dd1a08ea91 Merge pull request #81 from Telecominfraproject/feature/wifi-7223--kafka-ssl-params
[WIFI-7223] Add: secure Kafka connection params
2022-03-09 10:06:24 +03:00
Dmitry Dunaev
1c9f710b52 [WIFI-7223] Add: secure Kafka connection params
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-03-09 10:05:46 +03:00
stephb9959
e8ef49e36f Fixing framework: OpenAPIRequestDelete 2022-03-08 14:40:40 -08:00
stephb9959
9c43176556 Fixing framework: internal external <-> mismatch. 2022-03-08 14:25:26 -08:00
stephb9959
36473cb179 Merge remote-tracking branch 'origin/master' 2022-03-03 22:37:51 -08:00
stephb9959
eac18f8fa4 Framework update 2022-03-03 22:37:42 -08:00
Dmitry Dunaev
ab40792866 Merge pull request #80 from Telecominfraproject/feature/wifi-1998--ingress-deprecation
[WIFI-1998] Add: gracefull ingress deprecation
2022-03-01 16:22:34 +03:00
Dmitry Dunaev
5a2dfdff13 [WIFI-1998] Add: gracefull ingress deprecation
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-03-01 16:14:37 +03:00
Johann Hoffmann
131d0fe76e [WIFI-6925] Explore CLI commands and virtual APs for deployment tests (#79)
* Add test_service and related functions

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Add short description for test_service

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Fix indentation

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Adapt command help

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2022-02-28 13:34:21 +01:00
stephb9959
ce10b746ba Framework update 2022-02-25 22:31:42 -08:00
stephb9959
6cefac1967 Framework update 2022-02-25 22:31:30 -08:00
stephb9959
33801c552a Framework update 2022-02-24 16:25:16 -08:00
stephb9959
7c7121e9d7 Framework update 2022-02-24 16:22:05 -08:00
stephb9959
9ce7422e88 Framework update 2022-02-24 16:14:30 -08:00
stephb9959
87808dd447 Framework update 2022-02-24 12:22:17 -08:00
stephb9959
b0e47cd937 Adding locale support on connection to support subscriber and local regulations. 2022-02-24 11:10:55 -08:00
stephb9959
46339ebfde Adding locale support on connection to support subscriber and local regulations. 2022-02-24 10:03:38 -08:00
stephb9959
962a481306 Adding locale support on connection to support subscriber and local regulations. 2022-02-24 10:00:51 -08:00
stephb9959
64fa1777c9 Adding locale support on connection to support subscriber and local regulations. 2022-02-24 09:57:28 -08:00
stephb9959
60fc22ac68 Adding locale support on connection to support subscriber and local regulations. 2022-02-24 09:52:28 -08:00
stephb9959
cf7e8e667f Adding locale support on connection to support subscriber and local regulations. 2022-02-24 09:44:31 -08:00
stephb9959
cc22fe38a0 Adding locale support on connection to support subscriber and local regulations. 2022-02-24 09:36:45 -08:00
stephb9959
a18f8ed0f7 Adding entity, subscriber, modified fields to device. 2022-02-23 09:06:02 -08:00
stephb9959
5b99a2a366 Adding entity, subscriber, modified fields to device. 2022-02-23 09:04:55 -08:00
stephb9959
09126a7562 Fixing trace: simgle duration or packets. 2022-02-23 08:17:39 -08:00
stephb9959
64a0430c28 Fixing trace: simgle duration or packets. 2022-02-21 23:23:58 -08:00
stephb9959
121f6dc95e Fixing trace: simgle duration or packets. 2022-02-21 23:17:05 -08:00
stephb9959
4b0398365b Fixing device command when devices are not connected. 2022-02-21 22:15:45 -08:00
stephb9959
2be219112a Refactor of ow includes. 2022-02-21 08:40:44 -08:00
stephb9959
972a702b32 Adding "bandwidth" for wifi scanning. 2022-02-21 08:05:50 -08:00
stephb9959
e6d510b9bb Adding Kafka SSL. 2022-02-20 10:38:32 -08:00
stephb9959
88e5416088 Move to 2.6 2022-02-10 12:13:09 -08:00
122 changed files with 11891 additions and 6733 deletions

View File

@@ -13,6 +13,7 @@ on:
pull_request:
branches:
- master
- 'release/*'
defaults:
run:
@@ -39,6 +40,16 @@ jobs:
registry_user: ucentral
registry_password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- name: Notify on failure via Slack
if: failure() && github.ref == 'refs/heads/master'
uses: rtCamp/action-slack-notify@v2
env:
SLACK_USERNAME: GitHub Actions failure notifier
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: "${{ job.status }}"
SLACK_ICON: https://raw.githubusercontent.com/quintessence/slack-icons/master/images/github-logo-slack-icon.png
SLACK_TITLE: Docker build failed for OWGW service
trigger-testing:
if: startsWith(github.ref, 'refs/pull/')
runs-on: ubuntu-latest
@@ -65,4 +76,26 @@ jobs:
workflow: ow_docker-compose.yml
token: ${{ secrets.WLAN_TESTING_PAT }}
ref: master
inputs: '{"owgw_version": "${{ github.sha }}", "owgwui_version": "${{ env.BASE_BRANCH }}", "owsec_version": "${{ env.BASE_BRANCH }}", "owfms_version": "${{ env.BASE_BRANCH }}", "owprov_version": "main", "owprovui_version": "main"}'
inputs: '{"deployment_version": "${{ env.BASE_BRANCH }}", "owgw_version": "${{ github.sha }}", "owsec_version": "${{ env.BASE_BRANCH }}", "owfms_version": "${{ env.BASE_BRANCH }}", "owprov_version": "${{ env.BASE_BRANCH }}", "owanalytics_version": "${{ env.BASE_BRANCH }}", "owsub_version": "${{ env.BASE_BRANCH }}", "microservice": "owgw"}'
trigger-deploy-to-dev:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
needs:
- docker
steps:
- name: Checkout actions repo
uses: actions/checkout@v2
with:
repository: Telecominfraproject/.github
path: github
- name: Trigger deployment of the latest version to dev instance and wait for result
uses: ./github/composite-actions/trigger-workflow-and-wait
with:
owner: Telecominfraproject
repo: wlan-testing
workflow: ucentralgw-dev-deployment.yaml
token: ${{ secrets.WLAN_TESTING_PAT }}
ref: master
inputs: '{"force_latest": "true"}'

View File

@@ -4,6 +4,7 @@ on:
pull_request:
branches:
- master
- 'release/*'
types: [ closed ]
defaults:

46
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,46 @@
name: Release chart package
on:
push:
tags:
- 'v*'
defaults:
run:
shell: bash
jobs:
helm-package:
runs-on: ubuntu-20.04
env:
HELM_REPO_URL: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
HELM_REPO_USERNAME: ucentral
steps:
- name: Checkout uCentral assembly chart repo
uses: actions/checkout@v2
with:
path: wlan-cloud-ucentralgw
- name: Build package
working-directory: wlan-cloud-ucentralgw/helm
run: |
helm plugin install https://github.com/aslafy-z/helm-git --version 0.10.0
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm dependency update
mkdir dist
helm package . -d dist
- name: Generate GitHub release body
working-directory: wlan-cloud-ucentralgw/helm
run: |
pip3 install yq -q
echo "Docker image - tip-tip-wlan-cloud-ucentral.jfrog.io/owgw:$GITHUB_REF_NAME" > release.txt
echo "Helm charted may be attached to this release" >> release.txt
echo "Deployment artifacts may be found in https://github.com/Telecominfraproject/wlan-cloud-ucentral-deploy/tree/$GITHUB_REF_NAME" >> release.txt
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
body_path: wlan-cloud-ucentralgw/helm/release.txt
files: wlan-cloud-ucentralgw/helm/dist/*

View File

@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.13)
project(owgw VERSION 2.5.0)
project(owgw VERSION 2.6.0)
set(CMAKE_CXX_STANDARD 17)
@@ -44,12 +44,9 @@ endif()
add_definitions(-DTIP_GATEWAY_SERVICE="1")
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost REQUIRED system)
find_package(OpenSSL REQUIRED)
find_package(ZLIB REQUIRED)
find_package(fmt REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(nlohmann_json_schema_validator REQUIRED)
@@ -66,6 +63,12 @@ include_directories(/usr/local/include /usr/local/opt/openssl/include src inclu
configure_file(src/ow_version.h.in ${PROJECT_SOURCE_DIR}/src/ow_version.h @ONLY)
add_compile_options(-Wall -Wextra)
if(ASAN)
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
endif()
add_executable( owgw
build
src/ow_version.h.in
@@ -74,10 +77,7 @@ add_executable( owgw
src/framework/MicroService.h
src/framework/OpenWifiTypes.h
src/framework/orm.h
src/framework/RESTAPI_errors.h
src/framework/RESTAPI_protocol.h
src/framework/StorageClass.h
src/framework/uCentral_Protocol.h
src/RESTObjects/RESTAPI_SecurityObjects.h src/RESTObjects/RESTAPI_SecurityObjects.cpp
src/RESTObjects/RESTAPI_ProvObjects.cpp src/RESTObjects/RESTAPI_ProvObjects.h
src/RESTObjects/RESTAPI_GWobjects.h src/RESTObjects/RESTAPI_GWobjects.cpp
@@ -97,7 +97,6 @@ add_executable( owgw
src/RESTAPI/RESTAPI_RPC.cpp src/RESTAPI/RESTAPI_RPC.h
src/RESTAPI/RESTAPI_deviceDashboardHandler.cpp src/RESTAPI/RESTAPI_deviceDashboardHandler.h
src/RESTAPI/RESTAPI_telemetryWebSocket.cpp src/RESTAPI/RESTAPI_telemetryWebSocket.h
src/RESTAPI/RESTAPI_webSocketServer.cpp src/RESTAPI/RESTAPI_webSocketServer.h
src/storage/storage_blacklist.cpp src/storage/storage_tables.cpp src/storage/storage_logs.cpp
src/storage/storage_command.cpp src/storage/storage_healthcheck.cpp src/storage/storage_statistics.cpp
src/storage/storage_device.cpp src/storage/storage_capabilities.cpp src/storage/storage_defconfig.cpp
@@ -117,7 +116,7 @@ add_executable( owgw
src/TelemetryStream.cpp src/TelemetryStream.h
src/framework/ConfigurationValidator.cpp src/framework/ConfigurationValidator.h
src/ConfigurationCache.h
src/CapabilitiesCache.h src/FindCountry.h src/rttys/RTTYS_server.cpp src/rttys/RTTYS_server.h src/rttys/RTTYS_device.cpp src/rttys/RTTYS_device.h src/rttys/RTTYS_ClientConnection.cpp src/rttys/RTTYS_ClientConnection.h src/rttys/RTTYS_WebServer.cpp src/rttys/RTTYS_WebServer.h src/RESTAPI/RESTAPI_device_helper.h src/SDKcalls.cpp src/SDKcalls.h src/StateUtils.cpp src/StateUtils.h src/WS_ReactorPool.h src/WS_Connection.h src/WS_Connection.cpp src/TelemetryClient.h src/TelemetryClient.cpp src/RESTAPI/RESTAPI_iptocountry_handler.cpp src/RESTAPI/RESTAPI_iptocountry_handler.h)
src/CapabilitiesCache.h src/FindCountry.h src/rttys/RTTYS_server.cpp src/rttys/RTTYS_server.h src/rttys/RTTYS_device.cpp src/rttys/RTTYS_device.h src/rttys/RTTYS_ClientConnection.cpp src/rttys/RTTYS_ClientConnection.h src/rttys/RTTYS_WebServer.cpp src/rttys/RTTYS_WebServer.h src/RESTAPI/RESTAPI_device_helper.h src/SDKcalls.cpp src/SDKcalls.h src/StateUtils.cpp src/StateUtils.h src/WS_ReactorPool.h src/WS_Connection.h src/WS_Connection.cpp src/TelemetryClient.h src/TelemetryClient.cpp src/RESTAPI/RESTAPI_iptocountry_handler.cpp src/RESTAPI/RESTAPI_iptocountry_handler.h src/framework/ow_constants.h src/GwWebSocketClient.cpp src/GwWebSocketClient.h src/framework/WebSocketClientNotifications.h src/RADIUS_proxy_server.cpp src/RADIUS_proxy_server.h src/RESTAPI/RESTAPI_radiusProxyConfig_handler.cpp src/RESTAPI/RESTAPI_radiusProxyConfig_handler.h)
if(NOT SMALL_BUILD)
@@ -128,12 +127,15 @@ INSTALL(TARGETS owgw
)
target_link_libraries(owgw PUBLIC
${Poco_LIBRARIES} ${Boost_LIBRARIES} ${ZLIB_LIBRARIES})
${Poco_LIBRARIES}
${ZLIB_LIBRARIES})
if(NOT SMALL_BUILD)
target_link_libraries(owgw PUBLIC
${MySQL_LIBRARIES} ${ZLIB_LIBRARIES}
CppKafka::cppkafka
nlohmann_json_schema_validator
fmt::fmt
)
if(UNIX AND NOT APPLE)
target_link_libraries(owgw PUBLIC PocoJSON)

View File

@@ -18,6 +18,18 @@ RUN cmake ..
RUN cmake --build . --config Release -j8
RUN cmake --build . --target install
FROM build-base AS fmtlib-build
ADD https://api.github.com/repos/fmtlib/fmt/git/refs/heads/master version.json
RUN git clone https://github.com/fmtlib/fmt /fmtlib
WORKDIR /fmtlib
RUN mkdir cmake-build
WORKDIR cmake-build
RUN cmake ..
RUN make
RUN make install
FROM build-base AS cppkafka-build
ADD https://api.github.com/repos/stephb9959/cppkafka/git/refs/heads/master version.json
@@ -55,6 +67,8 @@ COPY --from=cppkafka-build /usr/local/include /usr/local/include
COPY --from=cppkafka-build /usr/local/lib /usr/local/lib
COPY --from=json-schema-validator-build /usr/local/include /usr/local/include
COPY --from=json-schema-validator-build /usr/local/lib /usr/local/lib
COPY --from=fmtlib-build /usr/local/include /usr/local/include
COPY --from=fmtlib-build /usr/local/lib /usr/local/lib
WORKDIR /owgw
RUN mkdir cmake-build
@@ -84,6 +98,7 @@ COPY test_scripts/curl/cli /cli
COPY owgw.properties.tmpl /
COPY docker-entrypoint.sh /
COPY wait-for-postgres.sh /
COPY rtty_ui /dist/rtty_ui
RUN wget https://raw.githubusercontent.com/Telecominfraproject/wlan-cloud-ucentral-deploy/main/docker-compose/certs/restapi-ca.pem \
-O /usr/local/share/ca-certificates/restapi-ca-selfsigned.pem

View File

@@ -446,6 +446,7 @@ Controller sends this command when it needs the device to perform a WiFi Scan.
"bands" : [ "2","5","5l","5u",6" ], <optional this is a list of bands to scan: on or more bands >
"channels" : [ 1,2,3...] , <optional list of discreet channels to scan >
"verbose" : <optional boolean: true or false> (by default false),
"bandwidth" : <optional int: 20,40,80 in MHz>
"active" : 0 or 1 (to select passive or active scan)
},
"id" : <some number>
@@ -634,8 +635,41 @@ The device should answer:
}
```
#### Controller wants the device to perform a script
Controller sends this command to run a predefined script. Extreme care must be taken.
```
{ "jsonrpc" : "2.0" ,
"method" : "script" ,
"params" : {
"serial" : <serial number>,
"type" : <one of "uci", "shell", "ucode">,
"script" : <text blob containing the script>,
"timeout" : <max timeout in seconds, default is 30>,
"when" : <time when this will be performed as UTC seconds>
},
"id" : <some number>
}
```
#### `rtty server`
The device should answer:
```
{ "jsonrpc" : "2.0" ,
"result" : {
"serial" : <serial number> ,
"status" : {
"error" : <0 or the value of $? from the shell running the command>,
one of either
"result_64" : <gzipped base64 result of running the command>,
"result_sz" : <size of unzipped content>
or
"result" : <a single text blob of the result>
}
},
"id" : <same number>
}
```
### `rtty server`
More information about the [rtty server](https://github.com/zhaojh329/rtty) can be found here.
### Message compression
@@ -661,6 +695,33 @@ of the completed message. The following should how the `state` event could be co
}
```
### 'Radius Proxying'
The gateway can receive RADIUS messages from the device and forward them. It can also receive messages
on its behalf and send them to the device.
```
{
"radius" : <type, can be auth, acct, das> ,
"data" : <base 64 encoded raw RADIUS payload>
"dst" : <ip:port> as a string - optional. If this is supplied, the GW will send the data to that destination,
if not provided, the GW will use one of the radius servers it has in its configuration. This is only
valid for messages coming from the device.
}
```
The GW will include a TLV to mark the sender MAC. The RADIUS server must use the same TLV to
identify the destination for its messages.
#### Incoming RADIUS messages configuration
The GW must be configured with the following:
```asm
radius.incoming.proxy.enable = true
radius.incoming.proxy.accounting.port = 1813
radius.incoming.proxy.auth.port = 1812
radius.incoming.proxy.das.port = 1814
radius.incoming.serialnumbertlv = 127
```

2
build
View File

@@ -1 +1 @@
171
68

Binary file not shown.

View File

@@ -1,637 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6"/>
<Project>
<Option title="ucentralgw"/>
<Option makefile_is_custom="1"/>
<Option compiler="gcc"/>
<Option virtualFolders="CMake Files\;CMake Files\..\;CMake Files\..\..\;CMake Files\..\..\..\;CMake Files\..\..\..\..\;CMake Files\..\..\..\..\..\;CMake Files\..\..\..\..\..\..\;CMake Files\..\..\..\..\..\..\usr\;CMake Files\..\..\..\..\..\..\usr\local\;CMake Files\..\..\..\..\..\..\usr\local\lib\;CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\;CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Boost-1.75.0\;CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\boost_headers-1.75.0\;CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\boost_system-1.75.0\;CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\CppKafka\;CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\;CMake Files\cmake\;CMake Files\cmake-build-debug\;"/>
<Build>
<Target title="all">
<Option working_dir="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 all"/>
<CompileFile command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="install/local">
<Option working_dir="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 install/local"/>
<CompileFile command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="rebuild_cache">
<Option working_dir="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 rebuild_cache"/>
<CompileFile command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="edit_cache">
<Option working_dir="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 edit_cache"/>
<CompileFile command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="install/strip">
<Option working_dir="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 install/strip"/>
<CompileFile command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="install">
<Option working_dir="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 install"/>
<CompileFile command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="list_install_components">
<Option working_dir="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 list_install_components"/>
<CompileFile command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="ucentralgw">
<Option output="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/ucentralgw" prefix_auto="0" extension_auto="0"/>
<Option working_dir="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug"/>
<Option object_output="./"/>
<Option type="1"/>
<Option compiler="gcc"/>
<Compiler>
<Add option="-DAPP_VERSION=&quot;0.7.0&quot;"/>
<Add option="-DBUILD_NUMBER=&quot;120&quot;"/>
<Add option="-DTIP_GATEWAY_SERVICE=&quot;1&quot;"/>
<Add option="-D_DEBUG"/>
<Add option="-DPOCO_ENABLE_CPP14"/>
<Add option="-DPOCO_ENABLE_CPP11"/>
<Add option="-DPOCO_OS_FAMILY_UNIX"/>
<Add option="-DPOCO_HAVE_IPv6"/>
<Add option="-DPOCO_NO_STAT64"/>
<Add option="-DXML_DTD"/>
<Add option="-DTHREADSAFE"/>
<Add option="-DNO_TCL"/>
<Add option="-DBOOST_ALL_NO_LIB"/>
<Add directory="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src"/>
<Add directory="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/include/kafka"/>
<Add directory="/usr/local/opt/mysql-client/include"/>
<Add directory="/usr/local/include"/>
<Add directory="/usr/local/opt/openssl/include"/>
<Add directory="/usr/local/opt/mysql-client/include/mysql"/>
<Add directory="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1"/>
<Add directory="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include"/>
<Add directory="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include"/>
<Add directory="/System/Library/Frameworks"/>
<Add directory="/Library/Frameworks"/>
</Compiler>
<MakeCommands>
<Build command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 ucentralgw"/>
<CompileFile command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="ucentralgw/fast">
<Option output="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/ucentralgw" prefix_auto="0" extension_auto="0"/>
<Option working_dir="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug"/>
<Option object_output="./"/>
<Option type="1"/>
<Option compiler="gcc"/>
<Compiler>
<Add option="-DAPP_VERSION=&quot;0.7.0&quot;"/>
<Add option="-DBUILD_NUMBER=&quot;120&quot;"/>
<Add option="-DTIP_GATEWAY_SERVICE=&quot;1&quot;"/>
<Add option="-D_DEBUG"/>
<Add option="-DPOCO_ENABLE_CPP14"/>
<Add option="-DPOCO_ENABLE_CPP11"/>
<Add option="-DPOCO_OS_FAMILY_UNIX"/>
<Add option="-DPOCO_HAVE_IPv6"/>
<Add option="-DPOCO_NO_STAT64"/>
<Add option="-DXML_DTD"/>
<Add option="-DTHREADSAFE"/>
<Add option="-DNO_TCL"/>
<Add option="-DBOOST_ALL_NO_LIB"/>
<Add directory="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src"/>
<Add directory="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/include/kafka"/>
<Add directory="/usr/local/opt/mysql-client/include"/>
<Add directory="/usr/local/include"/>
<Add directory="/usr/local/opt/openssl/include"/>
<Add directory="/usr/local/opt/mysql-client/include/mysql"/>
<Add directory="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1"/>
<Add directory="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include"/>
<Add directory="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include"/>
<Add directory="/System/Library/Frameworks"/>
<Add directory="/Library/Frameworks"/>
</Compiler>
<MakeCommands>
<Build command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 ucentralgw/fast"/>
<CompileFile command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/local/bin/gmake -j16 -f &quot;/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
</Build>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/build">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/ALBHealthCheckServer.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/AuthClient.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/AuthClient.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/CentralConfig.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/CentralConfig.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/CommandChannel.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/CommandChannel.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/CommandManager.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/CommandManager.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/Daemon.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/Daemon.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/DeviceRegistry.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/DeviceRegistry.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/FileUploader.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/FileUploader.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/KafkaManager.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/KafkaManager.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/Kafka_topics.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/MicroService.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/MicroService.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/OUIServer.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/OUIServer.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/OpenAPIRequest.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/OpenAPIRequest.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_BlackList.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_BlackList.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_GWobjects.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_GWobjects.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_InternalServer.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_InternalServer.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_RPC.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_RPC.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_SecurityObjects.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_SecurityObjects.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_command.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_command.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_commands.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_commands.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_default_configuration.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_default_configuration.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_default_configurations.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_default_configurations.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_device_commandHandler.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_device_commandHandler.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_device_handler.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_device_handler.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_devices_handler.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_devices_handler.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_file.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_file.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_handler.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_handler.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_ouis.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_ouis.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_protocol.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_server.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_server.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_system_command.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_system_command.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_utils.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/RESTAPI_utils.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/StateProcessor.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/StateProcessor.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/StorageArchiver.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/StorageArchiver.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/StorageService.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/StorageService.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/SubSystemServer.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/SubSystemServer.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/Utils.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/Utils.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/WebSocketServer.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/WebSocketServer.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/storage_blacklist.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/storage_capabilities.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/storage_command.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/storage_defconfig.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/storage_device.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/storage_healthcheck.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/storage_lifetime_stats.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/storage_logs.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/storage_mysql.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/storage_pgql.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/storage_sqlite.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/storage_statistics.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/storage_tables.cpp">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/uCentralProtocol.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/src/uCentralTypes.h">
<Option target="ucentralgw"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/CMakeLists.txt">
<Option virtualFolder="CMake Files\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/BoostDetectToolset-1.75.0.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Boost-1.75.0/BoostConfig.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Boost-1.75.0\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Boost-1.75.0/BoostConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Boost-1.75.0\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/boost_headers-1.75.0/boost_headers-config-version.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\boost_headers-1.75.0\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/boost_headers-1.75.0/boost_headers-config.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\boost_headers-1.75.0\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/boost_system-1.75.0/boost_system-config-version.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\boost_system-1.75.0\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/boost_system-1.75.0/boost_system-config.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\boost_system-1.75.0\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/boost_system-1.75.0/libboost_system-variant-mt-shared.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\boost_system-1.75.0\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/boost_system-1.75.0/libboost_system-variant-mt-static.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\boost_system-1.75.0\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/boost_system-1.75.0/libboost_system-variant-shared.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\boost_system-1.75.0\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/boost_system-1.75.0/libboost_system-variant-static.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\boost_system-1.75.0\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/CppKafka/CppKafkaConfig.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\CppKafka\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/CppKafka/CppKafkaConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\CppKafka\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/CppKafka/CppKafkaTargets-noconfig.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\CppKafka\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/CppKafka/CppKafkaTargets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\CppKafka\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoConfig.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoCryptoConfig.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoCryptoConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoCryptoTargets-relwithdebinfo.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoCryptoTargets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoDataConfig.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoDataConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoDataMySQLConfig.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoDataMySQLConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoDataMySQLTargets-relwithdebinfo.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoDataMySQLTargets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoDataPostgreSQLConfig.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoDataPostgreSQLConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoDataPostgreSQLTargets-relwithdebinfo.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoDataPostgreSQLTargets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoDataSQLiteConfig.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoDataSQLiteConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoDataSQLiteTargets-relwithdebinfo.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoDataSQLiteTargets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoDataTargets-relwithdebinfo.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoDataTargets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoFoundationConfig.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoFoundationConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoFoundationTargets-relwithdebinfo.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoFoundationTargets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoJSONConfig.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoJSONConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoJSONTargets-relwithdebinfo.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoJSONTargets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoJWTConfig.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoJWTConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoJWTTargets-relwithdebinfo.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoJWTTargets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoNetConfig.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoNetConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoNetSSLConfig.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoNetSSLConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoNetSSLTargets-relwithdebinfo.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoNetSSLTargets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoNetTargets-relwithdebinfo.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoNetTargets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoUtilConfig.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoUtilConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoUtilTargets-relwithdebinfo.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoUtilTargets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoXMLConfig.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoXMLConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoXMLTargets-relwithdebinfo.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/../../../../../../usr/local/lib/cmake/Poco/PocoXMLTargets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\usr\local\lib\cmake\Poco\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake/FindMySQL.cmake">
<Option virtualFolder="CMake Files\cmake\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake/FindPostgreSQL.cmake">
<Option virtualFolder="CMake Files\cmake\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake/FindRdKafka.cmake">
<Option virtualFolder="CMake Files\cmake\"/>
</Unit>
<Unit filename="/Users/stephb/Desktop/Dropbox/clion/wlan-cloud-ucentralgw/cmake-build-debug/rdkafka_version_test.cpp">
<Option virtualFolder="CMake Files\cmake-build-debug\"/>
</Unit>
</Project>
</CodeBlocks_project_file>

View File

@@ -6,64 +6,85 @@ if [ "$SELFSIGNED_CERTS" = 'true' ]; then
fi
if [[ "$TEMPLATE_CONFIG" = 'true' && ! -f "$OWGW_CONFIG"/owgw.properties ]]; then
WEBSOCKET_HOST_ROOTCA=${WEBSOCKET_HOST_ROOTCA:-"\$OWGW_ROOT/certs/root.pem"} \
WEBSOCKET_HOST_ISSUER=${WEBSOCKET_HOST_ISSUER:-"\$OWGW_ROOT/certs/issuer.pem"} \
WEBSOCKET_HOST_CERT=${WEBSOCKET_HOST_CERT:-"\$OWGW_ROOT/certs/websocket-cert.pem"} \
WEBSOCKET_HOST_KEY=${WEBSOCKET_HOST_KEY:-"\$OWGW_ROOT/certs/websocket-key.pem"} \
WEBSOCKET_HOST_CLIENTCAS=${WEBSOCKET_HOST_CLIENTCAS:-"\$OWGW_ROOT/certs/clientcas.pem"} \
WEBSOCKET_HOST_CAS=${WEBSOCKET_HOST_CAS:-"\$OWGW_ROOT/certs/cas"} \
WEBSOCKET_HOST_PORT=${WEBSOCKET_HOST_PORT:-"15002"} \
WEBSOCKET_HOST_KEY_PASSWORD=${WEBSOCKET_HOST_KEY_PASSWORD:-"mypassword"} \
RESTAPI_HOST_ROOTCA=${RESTAPI_HOST_ROOTCA:-"\$OWGW_ROOT/certs/restapi-ca.pem"} \
RESTAPI_HOST_PORT=${RESTAPI_HOST_PORT:-"16002"} \
RESTAPI_HOST_CERT=${RESTAPI_HOST_CERT:-"\$OWGW_ROOT/certs/restapi-cert.pem"} \
RESTAPI_HOST_KEY=${RESTAPI_HOST_KEY:-"\$OWGW_ROOT/certs/restapi-key.pem"} \
RESTAPI_HOST_KEY_PASSWORD=${RESTAPI_HOST_KEY_PASSWORD:-"mypassword"} \
INTERNAL_RESTAPI_HOST_ROOTCA=${INTERNAL_RESTAPI_HOST_ROOTCA:-"\$OWGW_ROOT/certs/restapi-ca.pem"} \
INTERNAL_RESTAPI_HOST_PORT=${INTERNAL_RESTAPI_HOST_PORT:-"17002"} \
INTERNAL_RESTAPI_HOST_CERT=${INTERNAL_RESTAPI_HOST_CERT:-"\$OWGW_ROOT/certs/restapi-cert.pem"} \
INTERNAL_RESTAPI_HOST_KEY=${INTERNAL_RESTAPI_HOST_KEY:-"\$OWGW_ROOT/certs/restapi-key.pem"} \
INTERNAL_RESTAPI_HOST_KEY_PASSWORD=${INTERNAL_RESTAPI_HOST_KEY_PASSWORD:-"mypassword"} \
FILEUPLOADER_HOST_ROOTCA=${FILEUPLOADER_HOST_ROOTCA:-"\$OWGW_ROOT/certs/restapi-ca.pem"} \
FILEUPLOADER_HOST_NAME=${FILEUPLOADER_HOST_NAME:-"localhost"} \
FILEUPLOADER_HOST_PORT=${FILEUPLOADER_HOST_PORT:-"16003"} \
FILEUPLOADER_HOST_CERT=${FILEUPLOADER_HOST_CERT:-"\$OWGW_ROOT/certs/restapi-cert.pem"} \
FILEUPLOADER_HOST_KEY=${FILEUPLOADER_HOST_KEY:-"\$OWGW_ROOT/certs/restapi-key.pem"} \
FILEUPLOADER_HOST_KEY_PASSWORD=${FILEUPLOADER_HOST_KEY_PASSWORD:-"mypassword"} \
FILEUPLOADER_PATH=${FILEUPLOADER_PATH:-"\$OWGW_ROOT/uploads"} \
FILEUPLOADER_URI=${FILEUPLOADER_URI:-"https://localhost:16003"} \
SERVICE_KEY=${SERVICE_KEY:-"\$OWGW_ROOT/certs/restapi-key.pem"} \
SERVICE_KEY_PASSWORD=${SERVICE_KEY_PASSWORD:-"mypassword"} \
SYSTEM_DATA=${SYSTEM_DATA:-"\$OWGW_ROOT/data"} \
SYSTEM_URI_PRIVATE=${SYSTEM_URI_PRIVATE:-"https://localhost:17002"} \
SYSTEM_URI_PUBLIC=${SYSTEM_URI_PUBLIC:-"https://localhost:16002"} \
SYSTEM_URI_UI=${SYSTEM_URI_UI:-"http://localhost"} \
SIMULATORID=${SIMULATORID:-""} \
RTTY_ENABLED=${RTTY_ENABLED:-"false"} \
RTTY_SERVER=${RTTY_SERVER:-"localhost"} \
RTTY_PORT=${RTTY_PORT:-"5912"} \
RTTY_TOKEN=${RTTY_TOKEN:-"96181c567b4d0d98c50f127230068fa8"} \
RTTY_TIMEOUT=${RTTY_TIMEOUT:-"60"} \
RTTY_VIEWPORT=${RTTY_VIEWPORT:-"5913"} \
KAFKA_ENABLE=${KAFKA_ENABLE:-"true"} \
KAFKA_BROKERLIST=${KAFKA_BROKERLIST:-"localhost:9092"} \
STORAGE_TYPE=${STORAGE_TYPE:-"sqlite"} \
STORAGE_TYPE_POSTGRESQL_HOST=${STORAGE_TYPE_POSTGRESQL_HOST:-"localhost"} \
STORAGE_TYPE_POSTGRESQL_USERNAME=${STORAGE_TYPE_POSTGRESQL_USERNAME:-"owgw"} \
STORAGE_TYPE_POSTGRESQL_PASSWORD=${STORAGE_TYPE_POSTGRESQL_PASSWORD:-"owgw"} \
STORAGE_TYPE_POSTGRESQL_DATABASE=${STORAGE_TYPE_POSTGRESQL_DATABASE:-"owgw"} \
STORAGE_TYPE_POSTGRESQL_PORT=${STORAGE_TYPE_POSTGRESQL_PORT:-"5432"} \
STORAGE_TYPE_MYSQL_HOST=${STORAGE_TYPE_MYSQL_HOST:-"localhost"} \
STORAGE_TYPE_MYSQL_USERNAME=${STORAGE_TYPE_MYSQL_USERNAME:-"owgw"} \
STORAGE_TYPE_MYSQL_PASSWORD=${STORAGE_TYPE_MYSQL_PASSWORD:-"owgw"} \
STORAGE_TYPE_MYSQL_DATABASE=${STORAGE_TYPE_MYSQL_DATABASE:-"owgw"} \
STORAGE_TYPE_MYSQL_PORT=${STORAGE_TYPE_MYSQL_PORT:-"3306"} \
envsubst < /owgw.properties.tmpl > $OWGW_CONFIG/owgw.properties
WEBSOCKET_HOST_ROOTCA=${WEBSOCKET_HOST_ROOTCA:-"\$OWGW_ROOT/certs/root.pem"} \
WEBSOCKET_HOST_ISSUER=${WEBSOCKET_HOST_ISSUER:-"\$OWGW_ROOT/certs/issuer.pem"} \
WEBSOCKET_HOST_CERT=${WEBSOCKET_HOST_CERT:-"\$OWGW_ROOT/certs/websocket-cert.pem"} \
WEBSOCKET_HOST_KEY=${WEBSOCKET_HOST_KEY:-"\$OWGW_ROOT/certs/websocket-key.pem"} \
WEBSOCKET_HOST_CLIENTCAS=${WEBSOCKET_HOST_CLIENTCAS:-"\$OWGW_ROOT/certs/clientcas.pem"} \
WEBSOCKET_HOST_CAS=${WEBSOCKET_HOST_CAS:-"\$OWGW_ROOT/certs/cas"} \
WEBSOCKET_HOST_PORT=${WEBSOCKET_HOST_PORT:-"15002"} \
WEBSOCKET_HOST_KEY_PASSWORD=${WEBSOCKET_HOST_KEY_PASSWORD:-"mypassword"} \
RESTAPI_HOST_ROOTCA=${RESTAPI_HOST_ROOTCA:-"\$OWGW_ROOT/certs/restapi-ca.pem"} \
RESTAPI_HOST_PORT=${RESTAPI_HOST_PORT:-"16002"} \
RESTAPI_HOST_CERT=${RESTAPI_HOST_CERT:-"\$OWGW_ROOT/certs/restapi-cert.pem"} \
RESTAPI_HOST_KEY=${RESTAPI_HOST_KEY:-"\$OWGW_ROOT/certs/restapi-key.pem"} \
RESTAPI_HOST_KEY_PASSWORD=${RESTAPI_HOST_KEY_PASSWORD:-"mypassword"} \
INTERNAL_RESTAPI_HOST_ROOTCA=${INTERNAL_RESTAPI_HOST_ROOTCA:-"\$OWGW_ROOT/certs/restapi-ca.pem"} \
INTERNAL_RESTAPI_HOST_PORT=${INTERNAL_RESTAPI_HOST_PORT:-"17002"} \
INTERNAL_RESTAPI_HOST_CERT=${INTERNAL_RESTAPI_HOST_CERT:-"\$OWGW_ROOT/certs/restapi-cert.pem"} \
INTERNAL_RESTAPI_HOST_KEY=${INTERNAL_RESTAPI_HOST_KEY:-"\$OWGW_ROOT/certs/restapi-key.pem"} \
INTERNAL_RESTAPI_HOST_KEY_PASSWORD=${INTERNAL_RESTAPI_HOST_KEY_PASSWORD:-"mypassword"} \
FILEUPLOADER_HOST_ROOTCA=${FILEUPLOADER_HOST_ROOTCA:-"\$OWGW_ROOT/certs/restapi-ca.pem"} \
FILEUPLOADER_HOST_NAME=${FILEUPLOADER_HOST_NAME:-"localhost"} \
FILEUPLOADER_HOST_PORT=${FILEUPLOADER_HOST_PORT:-"16003"} \
FILEUPLOADER_HOST_CERT=${FILEUPLOADER_HOST_CERT:-"\$OWGW_ROOT/certs/restapi-cert.pem"} \
FILEUPLOADER_HOST_KEY=${FILEUPLOADER_HOST_KEY:-"\$OWGW_ROOT/certs/restapi-key.pem"} \
FILEUPLOADER_HOST_KEY_PASSWORD=${FILEUPLOADER_HOST_KEY_PASSWORD:-"mypassword"} \
FILEUPLOADER_PATH=${FILEUPLOADER_PATH:-"\$OWGW_ROOT/uploads"} \
FILEUPLOADER_URI=${FILEUPLOADER_URI:-"https://localhost:16003"} \
SERVICE_KEY=${SERVICE_KEY:-"\$OWGW_ROOT/certs/restapi-key.pem"} \
SERVICE_KEY_PASSWORD=${SERVICE_KEY_PASSWORD:-"mypassword"} \
SYSTEM_DATA=${SYSTEM_DATA:-"\$OWGW_ROOT/data"} \
SYSTEM_URI_PRIVATE=${SYSTEM_URI_PRIVATE:-"https://localhost:17002"} \
SYSTEM_URI_PUBLIC=${SYSTEM_URI_PUBLIC:-"https://localhost:16002"} \
SYSTEM_URI_UI=${SYSTEM_URI_UI:-"http://localhost"} \
SIMULATORID=${SIMULATORID:-""} \
RTTY_INTERNAL=${RTTY_INTERNAL:-"true"} \
RTTY_ENABLED=${RTTY_ENABLED:-"true"} \
RTTY_SERVER=${RTTY_SERVER:-"localhost"} \
RTTY_PORT=${RTTY_PORT:-"5912"} \
RTTY_TOKEN=${RTTY_TOKEN:-""} \
RTTY_TIMEOUT=${RTTY_TIMEOUT:-"60"} \
RTTY_VIEWPORT=${RTTY_VIEWPORT:-"5913"} \
RTTY_ASSETS=${RTTY_ASSETS:-"\$OWGW_ROOT/rtty_ui"} \
KAFKA_ENABLE=${KAFKA_ENABLE:-"true"} \
KAFKA_BROKERLIST=${KAFKA_BROKERLIST:-"localhost:9092"} \
KAFKA_SSL_CA_LOCATION=${KAFKA_SSL_CA_LOCATION:-""} \
KAFKA_SSL_CERTIFICATE_LOCATION=${KAFKA_SSL_CERTIFICATE_LOCATION:-""} \
KAFKA_SSL_KEY_LOCATION=${KAFKA_SSL_KEY_LOCATION:-""} \
KAFKA_SSL_KEY_PASSWORD=${KAFKA_SSL_KEY_PASSWORD:-""} \
STORAGE_TYPE=${STORAGE_TYPE:-"sqlite"} \
STORAGE_TYPE_POSTGRESQL_HOST=${STORAGE_TYPE_POSTGRESQL_HOST:-"localhost"} \
STORAGE_TYPE_POSTGRESQL_USERNAME=${STORAGE_TYPE_POSTGRESQL_USERNAME:-"owgw"} \
STORAGE_TYPE_POSTGRESQL_PASSWORD=${STORAGE_TYPE_POSTGRESQL_PASSWORD:-"owgw"} \
STORAGE_TYPE_POSTGRESQL_DATABASE=${STORAGE_TYPE_POSTGRESQL_DATABASE:-"owgw"} \
STORAGE_TYPE_POSTGRESQL_PORT=${STORAGE_TYPE_POSTGRESQL_PORT:-"5432"} \
STORAGE_TYPE_MYSQL_HOST=${STORAGE_TYPE_MYSQL_HOST:-"localhost"} \
STORAGE_TYPE_MYSQL_USERNAME=${STORAGE_TYPE_MYSQL_USERNAME:-"owgw"} \
STORAGE_TYPE_MYSQL_PASSWORD=${STORAGE_TYPE_MYSQL_PASSWORD:-"owgw"} \
STORAGE_TYPE_MYSQL_DATABASE=${STORAGE_TYPE_MYSQL_DATABASE:-"owgw"} \
STORAGE_TYPE_MYSQL_PORT=${STORAGE_TYPE_MYSQL_PORT:-"3306"} \
envsubst < /owgw.properties.tmpl > $OWGW_CONFIG/owgw.properties
fi
# Check if rtty_ui directory exists
export RTTY_ASSETS=$(grep 'rtty.assets' $OWGW_CONFIG/owgw.properties | awk -F '=' '{print $2}' | xargs | envsubst)
if [ -z "$RTTY_ASSETS" ]; then
export RTTY_ASSETS="$OWGW_ROOT/rtty_ui"
fi
if [[ ! -d "$(dirname $RTTY_ASSETS)" ]]; then
mkdir -p $(dirname $RTTY_ASSETS)
fi
if [[ ! -d "$RTTY_ASSETS" ]]; then
cp -r /dist/rtty_ui $RTTY_ASSETS
fi
if [ "$1" = '/openwifi/owgw' -a "$(id -u)" = '0' ]; then
if [ "$RUN_CHOWN" = 'true' ]; then
chown -R "$OWGW_USER": "$OWGW_ROOT" "$OWGW_CONFIG"
chown -R "$OWGW_USER": "$OWGW_ROOT" "$OWGW_CONFIG"
fi
exec su-exec "$OWGW_USER" "$@"
fi

View File

@@ -1,12 +1,12 @@
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
version: 10.9.2
- name: mysql
repository: https://charts.bitnami.com/bitnami
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
version: 8.8.3
- name: mariadb
repository: https://charts.bitnami.com/bitnami
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
version: 9.4.2
digest: sha256:1fdae7cbea906e41dccd8618ff9e2c68d0c684724ae27c79a12bb6089968df5c
generated: "2021-08-17T12:18:40.341427893+03:00"
digest: sha256:e9df5a5d8a0a193bfda33ea06060203aace01f0f7df9eda662a84185322c7ab5
generated: "2022-06-03T15:38:31.063022252+03:00"

View File

@@ -5,14 +5,14 @@ name: owgw
version: 0.1.0
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
version: 10.9.2
condition: postgresql.enabled
- name: mysql
repository: https://charts.bitnami.com/bitnami
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
version: 8.8.3
condition: mysql.enabled
- name: mariadb
repository: https://charts.bitnami.com/bitnami
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
version: 9.4.2
condition: mariadb.enabled

View File

@@ -30,3 +30,13 @@ Create chart name and version as used by the chart label.
{{- define "owgw.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "owgw.ingress.apiVersion" -}}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" -}}
{{- print "networking.k8s.io/v1" -}}
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}

View File

@@ -2,7 +2,7 @@
{{- range $ingress, $ingressValue := .Values.ingresses }}
{{- if $ingressValue.enabled }}
---
apiVersion: extensions/v1beta1
apiVersion: {{ include "owgw.ingress.apiVersion" $root }}
kind: Ingress
metadata:
name: {{ include "owgw.fullname" $root }}-{{ $ingress }}
@@ -36,9 +36,23 @@ spec:
paths:
{{- range $ingressValue.paths }}
- path: {{ .path }}
{{- if $root.Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
pathType: {{ .pathType | default "ImplementationSpecific" }}
{{- end }}
backend:
{{- if $root.Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
service:
name: {{ include "owgw.fullname" $root }}-{{ .serviceName }}
port:
{{- if kindIs "string" .servicePort }}
name: {{ .servicePort }}
{{- else }}
number: {{ .servicePort }}
{{- end }}
{{- else }}
serviceName: {{ include "owgw.fullname" $root }}-{{ .serviceName }}
servicePort: {{ .servicePort }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -9,7 +9,7 @@ fullnameOverride: ""
images:
owgw:
repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owgw
tag: master
tag: v2.6.0-RC1
pullPolicy: Always
# regcred:
# registry: tip-tip-wlan-cloud-ucentral.jfrog.io
@@ -40,6 +40,12 @@ services:
servicePort: 16003
targetPort: 16003
protocol: TCP
rttys:
servicePort: 5912
targetPort: 5912
rttys-view:
servicePort: 5913
targetPort: 5913
checks:
owgw:
@@ -62,6 +68,7 @@ ingresses:
- restapi.chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
serviceName: owgw
servicePort: restapi
fileuploader:
@@ -73,6 +80,7 @@ ingresses:
- fileuploader.chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
serviceName: owgw
servicePort: fileuploader
@@ -209,17 +217,20 @@ configProperties:
openwifi.devicetypes.2: IOT:esp32
oui.download.uri: https://linuxnet.ca/ieee/oui.txt
firmware.autoupdate.policy.default: auto
iptocountry.provider: ipinfo
# Callback
openwifi.callback.enable: "false"
openwifi.callback.0.local: localhost:16001
openwifi.callback.0.remote: localhost:15055
openwifi.callback.0.topics: owfws
# rtty
rtty.internal: "true"
rtty.enabled: "true"
rtty.server: localhost
rtty.port: 5912
rtty.timeout: 60
rtty.viewport: 5913
rtty.assets: $OWGW_ROOT/rtty_ui
# ALB
alb.enable: "true"
alb.port: 16102
@@ -230,6 +241,10 @@ configProperties:
openwifi.kafka.brokerlist: localhost:9092
openwifi.kafka.auto.commit: false
openwifi.kafka.queue.buffering.max.ms: 50
openwifi.kafka.ssl.ca.location: ""
openwifi.kafka.ssl.certificate.location: ""
openwifi.kafka.ssl.key.location: ""
openwifi.kafka.ssl.key.password: ""
# Storage
storage.type: sqlite # (sqlite|postgresql|mysql|odbc)
## SQLite

View File

@@ -139,6 +139,19 @@ components:
type: string
devicePassword:
type: string
subscriber:
type: string
format: uuid
entity:
type: string
format: uuid
modified:
type: integer
format: int64
locale:
type: string
minLength: 2
maxLength: 2
DeviceWithStatus:
type: object
@@ -209,6 +222,19 @@ components:
lastContact:
type: integer
format: int64
subscriber:
type: string
format: uuid
entity:
type: string
format: uuid
modified:
type: integer
format: int64
locale:
type: string
minLength: 2
maxLength: 2
DeviceList:
type: object
@@ -484,6 +510,31 @@ components:
type: integer
format: int64
ScriptRequest:
type: object
properties:
serialNumber:
type: string
timeout:
type: integer
format: int64
default: 30
type:
type: string
enum:
- uci
- ucode
- shell
script:
type: string
scriptId:
type: string
format: uuid
when:
type: integer
format: int64
default: 0
FactoryRequest:
type: object
properties:
@@ -1021,6 +1072,66 @@ components:
items:
$ref: '#/components/schemas/CapabilitiesModel'
RadiusProxyServerEntry:
type: object
properties:
name:
type: string
ip:
type: string
format: ip-addr
port:
type: integer
weight:
type: integer
RadiusProxyServerConfig:
type: object
properties:
strategy:
type: string
enum:
- random
- round_robin
- weighted
monitor:
type: boolean
default: false
monitorMethod:
type: string
enum:
- none
- https
- radius
methodParameters:
type: array
items:
type: string
servers:
type: array
items:
$ref: '#/components/schemas/RadiusProxyServerEntry'
RadiusProxyPool:
type: object
properties:
name:
type: string
description:
type: string
authConfig:
$ref: '#/components/schemas/RadiusProxyServerConfig'
acctConfig:
$ref: '#/components/schemas/RadiusProxyServerConfig'
RadiusProxyPoolList:
type: object
properties:
pools:
type: array
items:
$ref: '#/components/schemas/RadiusProxyPool'
paths:
/devices:
get:
@@ -1070,6 +1181,20 @@ paths:
name: deviceWithStatus
schema:
type: boolean
- in: query
description: return extended information
name: orderBy
schema:
type: string
example: serialNumber:a,created:d
required: false
- in: query
description: return extended information
name: orderSpec
schema:
type: boolean
default: false
required: false
responses:
200:
description: List devices
@@ -1966,6 +2091,32 @@ paths:
404:
$ref: '#/components/responses/NotFound'
/device/{serialNumber}/script:
post:
tags:
- Commands
summary: Debug a device.
operationId: debugDevice
parameters:
- in: path
name: serialNumber
schema:
type: string
required: true
requestBody:
description: Command details
content:
application/json:
schema:
$ref: '#/components/schemas/ScriptRequest'
responses:
200:
$ref: '#/components/schemas/CommandInfo'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
/device/{serialNumber}/factory:
post:
tags:
@@ -2407,6 +2558,35 @@ paths:
404:
$ref: '#/components/responses/NotFound'
/radiusProxyConfig:
get:
tags:
- RADIUSProxy
summary: Retrieve RADIUS Proxy configuration.
operationId: getRadiusProxyConfig
responses:
200:
$ref: '#/components/schemas/RadiusProxyPoolList'
403:
$ref: '#/components/responses/Unauthorized'
put:
tags:
- RADIUSProxy
summary: Modify RADIUS Proxy configuration.
operationId: modifyRadiusProxyConfig
requestBody:
description: Change RADIUS configuration pool config
content:
application/json:
schema:
$ref: '#/components/schemas/RadiusProxyPoolList'
responses:
200:
$ref: '#/components/schemas/RadiusProxyPoolList'
403:
$ref: '#/components/responses/Unauthorized'
/deviceDashboard:
get:
tags:

View File

@@ -74,7 +74,7 @@ openwifi.autoprovisioning = true
openwifi.devicetypes.0 = AP:linksys_ea8300,edgecore_eap101,linksys_e8450-ubi
openwifi.devicetypes.1 = SWITCH:edgecore_ecs4100-12ph
openwifi.devicetypes.2 = IOT:esp32
oui.download.uri = https://linuxnet.ca/ieee/oui.txt
oui.download.uri = https://standards-oui.ieee.org/oui/oui.txt
iptocountry.default = US
iptocountry.provider = ipinfo
@@ -115,6 +115,11 @@ openwifi.kafka.brokerlist = a1.arilia.com:9092
openwifi.kafka.auto.commit = false
openwifi.kafka.queue.buffering.max.ms = 50
openwifi.kafka.ssl.ca.location =
openwifi.kafka.ssl.certificate.location =
openwifi.kafka.ssl.key.location =
openwifi.kafka.ssl.key.password =
#
# This section select which form of persistence you need
# Only one selected at a time. If you select multiple, this service will die if a horrible

View File

@@ -74,19 +74,21 @@ openwifi.autoprovisioning = true
openwifi.devicetypes.0 = AP:linksys_ea8300,edgecore_eap101,linksys_e8450-ubi
openwifi.devicetypes.1 = SWITCH:edgecore_ecs4100-12ph
openwifi.devicetypes.2 = IOT:esp32
oui.download.uri = https://linuxnet.ca/ieee/oui.txt
oui.download.uri = https://standards-oui.ieee.org/oui/oui.txt
firmware.autoupdate.policy.default = auto
simulatorid = ${SIMULATORID}
#
# rtty
#
rtty.internal = ${RTTY_INTERNAL}
rtty.enabled = ${RTTY_ENABLED}
rtty.server = ${RTTY_SERVER}
rtty.port = ${RTTY_PORT}
rtty.token = ${RTTY_TOKEN}
rtty.timeout = ${RTTY_TIMEOUT}
rtty.viewport = ${RTTY_VIEWPORT}
rtty.assets = ${RTTY_ASSETS}
#############################
# Generic information for all micro services
@@ -106,6 +108,10 @@ openwifi.kafka.enable = ${KAFKA_ENABLE}
openwifi.kafka.brokerlist = ${KAFKA_BROKERLIST}
openwifi.kafka.auto.commit = false
openwifi.kafka.queue.buffering.max.ms = 50
openwifi.kafka.ssl.ca.location = ${KAFKA_SSL_CA_LOCATION}
openwifi.kafka.ssl.certificate.location = ${KAFKA_SSL_CERTIFICATE_LOCATION}
openwifi.kafka.ssl.key.location = ${KAFKA_SSL_KEY_LOCATION}
openwifi.kafka.ssl.key.password = ${KAFKA_SSL_KEY_PASSWORD}
#
# This section select which form of persistence you need

41
pcap/radius Normal file
View File

@@ -0,0 +1,41 @@
/* Frame (255 bytes) */
static const unsigned char pkt41[255] = {
0x14, 0x98, 0x77, 0x71, 0xc6, 0xe7, 0x34, 0xef, /* ..wq..4. */
0xb6, 0xaf, 0x4a, 0x5c, 0x08, 0x00, 0x45, 0x00, /* ..J\..E. */
0x00, 0xf1, 0x87, 0x50, 0x00, 0x00, 0x40, 0x11, /* ...P..@. */
0x0c, 0xdf, 0xc0, 0xa8, 0xb2, 0x1b, 0xc0, 0xa8, /* ........ */
0xb2, 0x60, 0xc3, 0xfe, 0x07, 0x14, 0x00, 0xdd, /* .`...... */
0x26, 0x63, 0x01, 0x04, 0x00, 0xd5, 0xcc, 0x29, /* &c.....) */
0x82, 0x36, 0xd6, 0x57, 0x3d, 0xa7, 0xd5, 0x62, /* .6.W=..b */
0x70, 0x12, 0x00, 0xc0, 0xf2, 0x19, 0x01, 0x03, /* p....... */
0x61, 0x1e, 0x1c, 0x33, 0x34, 0x2d, 0x45, 0x46, /* a..34-EF */
0x2d, 0x42, 0x36, 0x2d, 0x41, 0x46, 0x2d, 0x34, /* -B6-AF-4 */
0x41, 0x2d, 0x36, 0x30, 0x3a, 0x4f, 0x70, 0x65, /* A-60:Ope */
0x6e, 0x57, 0x69, 0x66, 0x69, 0x3d, 0x06, 0x00, /* nWifi=.. */
0x00, 0x00, 0x13, 0x06, 0x06, 0x00, 0x00, 0x00, /* ........ */
0x02, 0x05, 0x06, 0x00, 0x00, 0x00, 0x01, 0x1f, /* ........ */
0x13, 0x42, 0x36, 0x2d, 0x43, 0x34, 0x2d, 0x30, /* .B6-C4-0 */
0x36, 0x2d, 0x30, 0x39, 0x2d, 0x31, 0x35, 0x2d, /* 6-09-15- */
0x42, 0x37, 0x4d, 0x18, 0x43, 0x4f, 0x4e, 0x4e, /* B7M.CONN */
0x45, 0x43, 0x54, 0x20, 0x35, 0x34, 0x4d, 0x62, /* ECT 54Mb */
0x70, 0x73, 0x20, 0x38, 0x30, 0x32, 0x2e, 0x31, /* ps 802.1 */
0x31, 0x61, 0x2c, 0x12, 0x33, 0x42, 0x45, 0x44, /* 1a,.3BED */
0x37, 0x32, 0x39, 0x30, 0x44, 0x30, 0x43, 0x38, /* 7290D0C8 */
0x35, 0x36, 0x44, 0x33, 0xba, 0x06, 0x00, 0x0f, /* 56D3.... */
0xac, 0x04, 0xbb, 0x06, 0x00, 0x0f, 0xac, 0x04, /* ........ */
0xbc, 0x06, 0x00, 0x0f, 0xac, 0x05, 0xbd, 0x06, /* ........ */
0x00, 0x0f, 0xac, 0x06, 0x1a, 0x1b, 0x00, 0x00, /* ........ */
0xe6, 0x08, 0x47, 0x15, 0x01, 0x13, 0x33, 0x34, /* ..G...34 */
0x2d, 0x65, 0x66, 0x2d, 0x62, 0x36, 0x2d, 0x61, /* -ef-b6-a */
0x66, 0x2d, 0x34, 0x61, 0x2d, 0x35, 0x63, 0x0c, /* f-4a-5c. */
0x06, 0x00, 0x00, 0x05, 0x78, 0x4f, 0x08, 0x02, /* ....xO.. */
0x01, 0x00, 0x06, 0x01, 0x61, 0x50, 0x12, 0x20, /* ....aP. */
0x9c, 0xae, 0xe5, 0xe3, 0x77, 0xaf, 0x0b, 0x1b, /* ....w... */
0xaf, 0x0e, 0xb5, 0x08, 0x82, 0x9e, 0xeb /* ....... */
};
/* Reassembled EAP (6 bytes) */
static const unsigned char pkt41_1[6] = {
0x02, 0x01, 0x00, 0x06, 0x01, 0x61 /* .....a */
};

BIN
pcap/radius.pcapng Normal file

Binary file not shown.

View File

@@ -1 +1,26 @@
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>Rttys</title><link href="/css/app.0e046291.css" rel="preload" as="style"><link href="/css/chunk-vendors.b221ddbd.css" rel="preload" as="style"><link href="/js/app.79bf330a.js" rel="preload" as="script"><link href="/js/chunk-vendors.7fd2577a.js" rel="preload" as="script"><link href="/css/chunk-vendors.b221ddbd.css" rel="stylesheet"><link href="/css/app.0e046291.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but Rttys doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.7fd2577a.js"></script><script src="/js/app.79bf330a.js"></script></body></html>
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="icon" href="/favicon.ico">
<title>RTTYs</title>
<link href="/css/app.0e046291.css" rel="preload" as="style">
<link href="/css/chunk-vendors.b221ddbd.css" rel="preload" as="style">
<link href="/css/chunk-vendors.b221ddbd.css" rel="stylesheet">
<link href="/css/app.0e046291.css" rel="stylesheet">
<link href="/js/app.79bf330a.js" rel="preload" as="script">
<link href="/js/chunk-vendors.7fd2577a.js" rel="preload" as="script">
</head>
<body>
<noscript>
<strong>We're sorry but Rttys doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<script src="/js/chunk-vendors.7fd2577a.js">
</script><script src="/js/app.79bf330a.js">
</script>
</body>
</html>

View File

@@ -12,72 +12,97 @@
#include "CommandManager.h"
#include "DeviceRegistry.h"
#include "RESTObjects//RESTAPI_GWobjects.h"
#include "StorageService.h"
#include "framework/MicroService.h"
#include "framework/uCentral_Protocol.h"
#include "framework/ow_constants.h"
namespace OpenWifi {
void CommandManager::run() {
Running_ = true;
while(Running_)
{
Poco::Thread::trySleep(30000);
if(!Running_)
break;
Poco::AutoPtr<Poco::Notification> NextMsg(ResponseQueue_.waitDequeueNotification());
while(NextMsg && Running_) {
auto Resp = dynamic_cast<RPCResponseNotification*>(NextMsg.get());
std::vector<GWObjects::CommandDetails> Commands;
if(StorageService()->GetReadyToExecuteCommands(0,200,Commands))
{
for(auto & Cmd: Commands)
{
if(!Running_)
break;
try {
Poco::JSON::Parser P;
bool Sent;
Logger().information(Poco::format("Parsing: %s", Cmd.UUID));
auto Params = P.parse(Cmd.Details).extract<Poco::JSON::Object::Ptr>();
Logger().information(Poco::format("Parsed: %s", Cmd.UUID));
auto Result = PostCommandDisk( Cmd.SerialNumber,
Cmd.Command,
*Params,
Cmd.UUID,
Sent);
if(Sent) {
StorageService()->SetCommandExecuted(Cmd.UUID);
Logger().information(Poco::format("%s: Sent command '%s-%s'", Cmd.SerialNumber, Cmd.Command, Cmd.UUID));
if(Resp!= nullptr) {
const Poco::JSON::Object & Payload = Resp->Payload_;
const std::string & SerialNumber = Resp->SerialNumber_;
std::ostringstream SS;
Payload.stringify(SS);
// std::cout << SerialNumber << ": " << __LINE__ << std::endl;
// std::cout << "Got RPC Answer: " << SerialNumber << " Payload:" << SS.str() << std::endl;
Logger().debug(fmt::format("({}): RPC Response received.", SerialNumber));
if(!Payload.has(uCentralProtocol::ID)){
// std::cout << SerialNumber << ": " << __LINE__ << std::endl;
Logger().error(fmt::format("({}): Invalid RPC response.", SerialNumber));
} else {
uint64_t ID = Payload.get(uCentralProtocol::ID);
if (ID < 2) {
// std::cout << SerialNumber << ": " << __LINE__ << std::endl;
Logger().debug(fmt::format("({}): Ignoring RPC response.", SerialNumber));
} else {
auto Idx = CommandTagIndex{.Id = ID, .SerialNumber = SerialNumber};
std::lock_guard G(Mutex_);
auto RPC = OutStandingRequests_.find(Idx);
if (RPC == OutStandingRequests_.end()) {
// std::cout << SerialNumber << ": " << __LINE__ << std::endl;
Logger().warning(
fmt::format("({}): Outdated RPC {}", SerialNumber, ID));
} else {
Logger().information(Poco::format("%s: Could not send command '%s-%s'", Cmd.SerialNumber, Cmd.Command, Cmd.UUID));
// std::cout << SerialNumber << ": " << __LINE__ << std::endl;
std::chrono::duration<double, std::milli> rpc_execution_time =
std::chrono::high_resolution_clock::now() - RPC->second->submitted;
StorageService()->CommandCompleted(RPC->second->uuid, Payload,
rpc_execution_time, true);
// std::cout << SerialNumber << ": " << __LINE__ << std::endl;
if (RPC->second->rpc_entry) {
// std::cout << SerialNumber << ": " << __LINE__ << std::endl;
RPC->second->rpc_entry->set_value(Payload);
}
// std::cout << SerialNumber << ": " << __LINE__ << std::endl;
OutstandingUUIDs_.erase(RPC->second->uuid);
OutStandingRequests_.erase(Idx);
Logger().information(
fmt::format("({}): Received RPC answer {}", SerialNumber, ID));
// std::cout << SerialNumber << ": " << __LINE__ << std::endl;
}
} catch (const Poco::Exception &E) {
Logger().information(Poco::format("%s: Failed command '%s-%s'", Cmd.SerialNumber, Cmd.Command, Cmd.UUID));
Logger().log(E);
StorageService()->SetCommandExecuted(Cmd.UUID);
} catch (...) {
Logger().information(Poco::format("%s: Exception - hard fail - Failed command '%s-%s'", Cmd.SerialNumber, Cmd.Command, Cmd.UUID));
StorageService()->SetCommandExecuted(Cmd.UUID);
}
}
}
}
}
}
}
NextMsg = ResponseQueue_.waitDequeueNotification();
}
}
int CommandManager::Start() {
Logger().notice("Starting...");
ManagerThread.setStackSize(2000000);
ManagerThread.setName("CMD-MGR");
ManagerThread.start(*this);
JanitorCallback_ = std::make_unique<Poco::TimerCallback<CommandManager>>(*this,&CommandManager::onTimer);
Timer_.setStartInterval( 10000 );
Timer_.setPeriodicInterval(5 * 60 * 1000); // 1 hours
Timer_.start(*JanitorCallback_);
JanitorCallback_ = std::make_unique<Poco::TimerCallback<CommandManager>>(*this,&CommandManager::onJanitorTimer);
JanitorTimer_.setStartInterval( 10000 );
JanitorTimer_.setPeriodicInterval(10 * 60 * 1000); // 1 hours
JanitorTimer_.start(*JanitorCallback_);
CommandRunnerCallback_ = std::make_unique<Poco::TimerCallback<CommandManager>>(*this,&CommandManager::onCommandRunnerTimer);
CommandRunnerTimer_.setStartInterval( 10000 );
CommandRunnerTimer_.setPeriodicInterval(30 * 1000); // 1 hours
CommandRunnerTimer_.start(*CommandRunnerCallback_);
// RPCResponseQueue_->Readable_ += Poco::delegate(this,&CommandManager::onRPCAnswer);
// RPCResponseQueue_->Writable_ += Poco::delegate(this,&CommandManager::onRPCAnswer);
return 0;
}
void CommandManager::Stop() {
Logger().notice("Stopping...");
// RPCResponseQueue_->Readable_ -= Poco::delegate(this,&CommandManager::onRPCAnswer);
// RPCResponseQueue_->Writable_ -= Poco::delegate(this,&CommandManager::onRPCAnswer);
Running_ = false;
Timer_.stop();
JanitorTimer_.stop();
CommandRunnerTimer_.stop();
ResponseQueue_.wakeUpAll();
ManagerThread.wakeUp();
ManagerThread.join();
}
@@ -87,22 +112,69 @@ namespace OpenWifi {
ManagerThread.wakeUp();
}
void CommandManager::onTimer(Poco::Timer & timer) {
void CommandManager::onJanitorTimer([[maybe_unused]] Poco::Timer & timer) {
std::lock_guard G(Mutex_);
Logger().information("Removing expired commands: start");
auto Now = std::chrono::high_resolution_clock::now();
Logger().information(
fmt::format("Removing expired commands: start. {} outstanding-requests {} outstanding-uuids commands.",
OutStandingRequests_.size(), OutstandingUUIDs_.size() ));
auto now = std::chrono::high_resolution_clock::now();
for(auto i=OutStandingRequests_.begin();i!=OutStandingRequests_.end();) {
std::chrono::duration<double, std::milli> delta = Now - i->second->submitted;
if(delta > 120000ms) {
std::chrono::duration<double, std::milli> delta = now - i->second->submitted;
if(delta > 6000000ms) {
Logger().debug(fmt::format("{}: Timed out.", i->second->uuid));
OutstandingUUIDs_.erase(i->second->uuid);
i = OutStandingRequests_.erase(i);
} else {
++i;
}
}
Logger().information("Removing expired commands: done");
Logger().information("Removing expired commands: done.");
}
std::shared_ptr<CommandManager::promise_type_t> CommandManager::PostCommand( const std::string &SerialNumber,
void CommandManager::onCommandRunnerTimer([[maybe_unused]] Poco::Timer &timer) {
std::vector<GWObjects::CommandDetails> Commands;
if(StorageService()->GetReadyToExecuteCommands(0,200,Commands))
{
for(auto & Cmd: Commands)
{
if(!Running_)
break;
try {
{
std::lock_guard M(Mutex_);
if(OutstandingUUIDs_.find(Cmd.UUID)!=OutstandingUUIDs_.end())
continue;
}
Poco::JSON::Parser P;
bool Sent;
Logger().information(fmt::format("{}-{}: Processing.", Cmd.SerialNumber, Cmd.UUID));
auto Params = P.parse(Cmd.Details).extract<Poco::JSON::Object::Ptr>();
auto Result = PostCommandDisk( Cmd.SerialNumber,
Cmd.Command,
*Params,
Cmd.UUID,
Sent);
if(Sent) {
StorageService()->SetCommandExecuted(Cmd.UUID);
OutstandingUUIDs_.insert(Cmd.UUID);
Logger().information(fmt::format("{}-{}: Sent command {}.", Cmd.SerialNumber, Cmd.UUID, Cmd.Command));
} else {
Logger().information(fmt::format("{}-{}: Could not Send command {}.", Cmd.SerialNumber, Cmd.UUID, Cmd.Command));
}
} catch (const Poco::Exception &E) {
Logger().information(fmt::format("{}-{}: Failed command {}.", Cmd.SerialNumber, Cmd.UUID, Cmd.Command));
Logger().log(E);
StorageService()->SetCommandExecuted(Cmd.UUID);
} catch (...) {
Logger().information(fmt::format("{}-{}: Hard failed command {}.", Cmd.SerialNumber, Cmd.UUID, Cmd.Command));
StorageService()->SetCommandExecuted(Cmd.UUID);
}
}
}
}
std::shared_ptr<CommandManager::promise_type_t> CommandManager::PostCommand(const std::string &SerialNumber,
const std::string &Method,
const Poco::JSON::Object &Params,
const std::string &UUID,
@@ -134,7 +206,7 @@ namespace OpenWifi {
CompleteRPC.set(uCentralProtocol::PARAMS, Params);
Poco::JSON::Stringifier::stringify(CompleteRPC, ToSend);
Logger().information(
Poco::format("(%s): Sending command '%s', ID: %lu", SerialNumber, Method, Idx.Id));
fmt::format("{}-{}: Sending command {}, ID: {}", SerialNumber, UUID, Method, Idx.Id));
Object->submitted = std::chrono::high_resolution_clock::now();
Object->uuid = UUID;
@@ -143,7 +215,10 @@ namespace OpenWifi {
} else {
Object->rpc_entry = std::make_shared<CommandManager::promise_type_t>();
}
OutStandingRequests_[Idx] = Object;
if(!oneway_rpc) {
OutStandingRequests_[Idx] = Object;
OutstandingUUIDs_.insert(UUID);
}
}
if(DeviceRegistry()->SendFrame(SerialNumber, ToSend.str())) {
@@ -152,32 +227,4 @@ namespace OpenWifi {
}
return nullptr;
}
void CommandManager::PostCommandResult(const std::string &SerialNumber, Poco::JSON::Object::Ptr Obj) {
if(!Obj->has(uCentralProtocol::ID)){
Logger().error(Poco::format("(%s): Invalid RPC response.",SerialNumber));
return;
}
uint64_t ID = Obj->get(uCentralProtocol::ID);
if(ID<2) {
Logger().error(Poco::format("(%s): Ignoring RPC response.",SerialNumber));
return;
}
std::lock_guard G(Mutex_);
auto Idx = CommandTagIndex{.Id = ID, .SerialNumber = SerialNumber};
auto RPC = OutStandingRequests_.find(Idx);
if (RPC == OutStandingRequests_.end()) {
Logger().warning(Poco::format("(%s): Outdated RPC %lu", SerialNumber, ID));
return;
}
std::chrono::duration<double, std::milli> rpc_execution_time = std::chrono::high_resolution_clock::now() - RPC->second->submitted;
StorageService()->CommandCompleted(RPC->second->uuid, Obj, rpc_execution_time, true);
if(RPC->second->rpc_entry) {
RPC->second->rpc_entry->set_value(Obj);
}
Logger().information(Poco::format("(%s): Received RPC answer %lu", SerialNumber, ID));
}
} // namespace

View File

@@ -19,7 +19,7 @@
#include "Poco/Net/HTTPServerResponse.h"
#include "Poco/Timer.h"
#include "RESTObjects//RESTAPI_GWobjects.h"
#include "RESTObjects/RESTAPI_GWobjects.h"
#include "framework/MicroService.h"
namespace OpenWifi {
@@ -43,9 +43,23 @@ namespace OpenWifi {
return false;
}
class CommandManager : public SubSystemServer, Poco::Runnable {
class RPCResponseNotification: public Poco::Notification {
public:
RPCResponseNotification(const std::string &ser,
const Poco::JSON::Object &pl) :
SerialNumber_(ser),
Payload_(pl)
{
}
std::string SerialNumber_;
Poco::JSON::Object Payload_;
};
class CommandManager : public SubSystemServer, Poco::Runnable {
public:
typedef Poco::JSON::Object::Ptr objtype_t;
typedef Poco::JSON::Object objtype_t;
typedef std::promise<objtype_t> promise_type_t;
struct RpcObject {
std::string uuid;
@@ -53,10 +67,25 @@ namespace OpenWifi {
std::shared_ptr<promise_type_t> rpc_entry;
};
struct RPCResponse {
std::string serialNumber;
Poco::JSON::Object payload;
explicit RPCResponse(const std::string &ser, const Poco::JSON::Object &pl)
:
serialNumber(ser),
payload(pl) {
}
};
int Start() override;
void Stop() override;
void WakeUp();
void PostCommandResult(const std::string &SerialNumber, Poco::JSON::Object::Ptr Obj);
inline void PostCommandResult(const std::string &SerialNumber, const Poco::JSON::Object &Obj) {
std::lock_guard G(Mutex_);
// RPCResponseQueue_->Write(RPCResponse{.serialNumber=SerialNumber, .payload = Obj});
ResponseQueue_.enqueueNotification(new RPCResponseNotification(SerialNumber,Obj));
}
std::shared_ptr<promise_type_t> PostCommandOneWayDisk(
const std::string &SerialNumber,
@@ -120,15 +149,22 @@ namespace OpenWifi {
}
inline bool Running() const { return Running_; }
void onTimer(Poco::Timer & timer);
void onJanitorTimer(Poco::Timer & timer);
void onCommandRunnerTimer(Poco::Timer & timer);
void onRPCAnswer(bool& b);
private:
std::atomic_bool Running_ = false;
Poco::Thread ManagerThread;
uint64_t Id_=3; // do not start @1. We ignore ID=1 & 0 is illegal..
std::map<CommandTagIndex,std::shared_ptr<RpcObject>> OutStandingRequests_;
Poco::Timer Timer_;
std::set<std::string> OutstandingUUIDs_;
Poco::Timer JanitorTimer_;
std::unique_ptr<Poco::TimerCallback<CommandManager>> JanitorCallback_;
Poco::Timer CommandRunnerTimer_;
std::unique_ptr<Poco::TimerCallback<CommandManager>> CommandRunnerCallback_;
// std::unique_ptr<FIFO<RPCResponse>> RPCResponseQueue_=std::make_unique<FIFO<RPCResponse>>(100);
Poco::NotificationQueue ResponseQueue_;
std::shared_ptr<promise_type_t> PostCommand(
const std::string &SerialNumber,

View File

@@ -6,12 +6,10 @@
// Arilia Wireless Inc.
//
#include <boost/algorithm/string.hpp>
#include "Poco/Util/Application.h"
#include "Poco/Util/Option.h"
#include "Poco/Environment.h"
#include "CentralConfig.h"
#include "CommandManager.h"
#include "Daemon.h"
#include "DeviceRegistry.h"
@@ -26,6 +24,7 @@
#include "framework/MicroService.h"
#include "FindCountry.h"
#include "rttys/RTTYS_server.h"
#include "RADIUS_proxy_server.h"
namespace OpenWifi {
class Daemon *Daemon::instance() {
@@ -38,6 +37,7 @@ namespace OpenWifi {
StorageService(),
SerialNumberCache(),
ConfigurationValidator(),
WebSocketClientServer(),
OUIServer(),
FindCountryFromIP(),
DeviceRegistry(),
@@ -46,7 +46,8 @@ namespace OpenWifi {
StorageArchiver(),
TelemetryStream(),
RTTYS_server(),
WebSocketServer()
WebSocketServer(),
RADIUS_proxy_server()
});
return &instance;
}
@@ -84,14 +85,12 @@ namespace OpenWifi {
{"wallys_dr40x9","AP"}
};
void Daemon::initialize() {
void Daemon::PostInitialization([[maybe_unused]] Poco::Util::Application &self) {
AutoProvisioning_ = config().getBool("openwifi.autoprovisioning",false);
DeviceTypes_ = DefaultDeviceTypes;
}
void MicroServicePostInitialization() {
Daemon()->initialize();
}
WebSocketProcessor_ = std::make_unique<GwWebSocketClient>(logger());
}
[[nodiscard]] std::string Daemon::IdentifyDevice(const std::string & Id ) const {
for(const auto &[DeviceType,Type]:DeviceTypes_)

View File

@@ -27,14 +27,15 @@
#include "Dashboard.h"
#include "framework/MicroService.h"
#include "framework/OpenWifiTypes.h"
#include "GwWebSocketClient.h"
namespace OpenWifi {
static const char * vDAEMON_PROPERTIES_FILENAME = "owgw.properties";
static const char * vDAEMON_ROOT_ENV_VAR = "OWGW_ROOT";
static const char * vDAEMON_CONFIG_ENV_VAR = "OWGW_CONFIG";
static const char * vDAEMON_APP_NAME = uSERVICE_GATEWAY.c_str();
static const uint64_t vDAEMON_BUS_TIMER = 10000;
[[maybe_unused]] static const char * vDAEMON_PROPERTIES_FILENAME = "owgw.properties";
[[maybe_unused]] static const char * vDAEMON_ROOT_ENV_VAR = "OWGW_ROOT";
[[maybe_unused]] static const char * vDAEMON_CONFIG_ENV_VAR = "OWGW_CONFIG";
[[maybe_unused]] static const char * vDAEMON_APP_NAME = uSERVICE_GATEWAY.c_str();
[[maybe_unused]] static const uint64_t vDAEMON_BUS_TIMER = 10000;
class Daemon : public MicroService {
public:
@@ -48,17 +49,20 @@ namespace OpenWifi {
bool AutoProvisioning() const { return AutoProvisioning_ ; }
[[nodiscard]] std::string IdentifyDevice(const std::string & Compatible) const;
void initialize();
static Daemon *instance();
inline DeviceDashboard & GetDashboard() { return DB_; }
Poco::Logger & Log() { return Poco::Logger::get(AppName()); }
void PostInitialization(Poco::Util::Application &self);
private:
bool AutoProvisioning_ = false;
std::vector<std::pair<std::string,std::string>> DeviceTypes_;
DeviceDashboard DB_;
std::unique_ptr<GwWebSocketClient> WebSocketProcessor_;
};
inline Daemon * Daemon() { return Daemon::instance(); }
inline void DaemonPostInitialization(Poco::Util::Application &self) {
Daemon()->PostInitialization(self);
}
}

View File

@@ -8,7 +8,7 @@
namespace OpenWifi {
void DeviceDashboard::Create() {
uint64_t Now = std::time(nullptr);
uint64_t Now = OpenWifi::Now();
if(LastRun_==0 || (Now-LastRun_)>120) {
DB_.reset();

View File

@@ -93,7 +93,7 @@ namespace OpenWifi {
const auto & E = Devices_[SerialNumber] = std::make_shared<ConnectionEntry>();
E->WSConn_ = Ptr;
E->Conn_.LastContact = std::time(nullptr);
E->Conn_.LastContact = OpenWifi::Now();
E->Conn_.Connected = true ;
E->Conn_.UUID = 0 ;
E->Conn_.MessageCount = 0 ;
@@ -129,7 +129,41 @@ namespace OpenWifi {
try {
return Device->second->WSConn_->Send(Payload);
} catch (...) {
Logger().debug(Poco::format("Could not send data to device '%s'", SerialNumber));
Logger().debug(fmt::format("Could not send data to device '{}'", SerialNumber));
Device->second->Conn_.Address = "";
Device->second->WSConn_ = nullptr;
Device->second->Conn_.Connected = false;
Device->second->Conn_.VerifiedCertificate = GWObjects::NO_CERTIFICATE;
}
}
return false;
}
bool DeviceRegistry::SendRadiusAccountingData(const std::string & SerialNumber, const unsigned char * buffer, std::size_t size) {
std::lock_guard Guard(Mutex_);
auto Device = Devices_.find(Utils::SerialNumberToInt(SerialNumber));
if(Device!=Devices_.end() && Device->second->WSConn_!= nullptr) {
try {
return Device->second->WSConn_->SendRadiusAccountingData(buffer,size);
} catch (...) {
Logger().debug(fmt::format("Could not send data to device '{}'", SerialNumber));
Device->second->Conn_.Address = "";
Device->second->WSConn_ = nullptr;
Device->second->Conn_.Connected = false;
Device->second->Conn_.VerifiedCertificate = GWObjects::NO_CERTIFICATE;
}
}
return false;
}
bool DeviceRegistry::SendRadiusAuthenticationData(const std::string & SerialNumber, const unsigned char * buffer, std::size_t size) {
std::lock_guard Guard(Mutex_);
auto Device = Devices_.find(Utils::SerialNumberToInt(SerialNumber));
if(Device!=Devices_.end() && Device->second->WSConn_!= nullptr) {
try {
return Device->second->WSConn_->SendRadiusAuthenticationData(buffer,size);
} catch (...) {
Logger().debug(fmt::format("Could not send data to device '{}'", SerialNumber));
Device->second->Conn_.Address = "";
Device->second->WSConn_ = nullptr;
Device->second->Conn_.Connected = false;

View File

@@ -103,6 +103,9 @@ namespace OpenWifi {
return nullptr;
}
bool SendRadiusAuthenticationData(const std::string & SerialNumber, const unsigned char * buffer, std::size_t size);
bool SendRadiusAccountingData(const std::string & SerialNumber, const unsigned char * buffer, std::size_t size);
private:
inline static std::atomic_uint64_t Id_=1;
std::map<uint64_t ,std::shared_ptr<ConnectionEntry>> Devices_;

View File

@@ -13,9 +13,9 @@
#include "Poco/Net/HTTPServerParams.h"
#include "Poco/Net/HTTPServerResponse.h"
#include "Poco/DynamicAny.h"
#include "Poco/Net/HTMLForm.h"
#include "Poco/Net/PartHandler.h"
#include "Poco/Net/MessageHeader.h"
#include "Poco/Net/MultipartReader.h"
#include "Poco/CountingStream.h"
#include "Poco/StreamCopier.h"
#include "Poco/Exception.h"
@@ -41,37 +41,65 @@ namespace OpenWifi {
Path_ = "/tmp";
}
}
for(const auto & Svr: ConfigServersList_) {
std::string l{"Starting: " +
Svr.Address() + ":" + std::to_string(Svr.Port()) +
" key:" + Svr.KeyFile() +
" cert:" + Svr.CertFile()};
Logger().information(l);
if(MicroService::instance().NoAPISecurity()) {
Logger().information(fmt::format("Starting: {}:{}",Svr.Address(),Svr.Port()));
auto Sock{Svr.CreateSecureSocket(Logger())};
auto Sock{Svr.CreateSocket(Logger())};
Svr.LogCert(Logger());
if(!Svr.RootCA().empty())
Svr.LogCas(Logger());
auto Params = new Poco::Net::HTTPServerParams;
Params->setMaxThreads(16);
Params->setMaxQueued(100);
auto Params = new Poco::Net::HTTPServerParams;
Params->setMaxThreads(16);
Params->setMaxQueued(100);
if (FullName_.empty()) {
std::string TmpName =
MicroService::instance().ConfigGetString("openwifi.fileuploader.uri", "");
if (TmpName.empty()) {
FullName_ =
"https://" + Svr.Name() + ":" + std::to_string(Svr.Port()) + URI_BASE;
} else {
FullName_ = TmpName + URI_BASE;
}
Logger().information(fmt::format("Uploader URI base is '{}'", FullName_));
}
if(FullName_.empty()) {
std::string TmpName = MicroService::instance().ConfigGetString("openwifi.fileuploader.uri","");
if(TmpName.empty()) {
FullName_ =
"https://" + Svr.Name() + ":" + std::to_string(Svr.Port()) + URI_BASE;
} else {
FullName_ = TmpName + URI_BASE ;
}
Logger().information(Poco::format("Uploader URI base is '%s'", FullName_));
}
auto NewServer = std::make_unique<Poco::Net::HTTPServer>(
new FileUpLoaderRequestHandlerFactory(Logger()), Sock, Params);
NewServer->start();
Servers_.push_back(std::move(NewServer));
} else {
std::string l{"Starting: " + Svr.Address() + ":" + std::to_string(Svr.Port()) +
" key:" + Svr.KeyFile() + " cert:" + Svr.CertFile()};
Logger().information(l);
auto NewServer = std::make_unique<Poco::Net::HTTPServer>(new FileUpLoaderRequestHandlerFactory(Logger()), Pool_, Sock, Params);
NewServer->start();
Servers_.push_back(std::move(NewServer));
auto Sock{Svr.CreateSecureSocket(Logger())};
Svr.LogCert(Logger());
if (!Svr.RootCA().empty())
Svr.LogCas(Logger());
auto Params = new Poco::Net::HTTPServerParams;
Params->setMaxThreads(16);
Params->setMaxQueued(100);
if (FullName_.empty()) {
std::string TmpName =
MicroService::instance().ConfigGetString("openwifi.fileuploader.uri", "");
if (TmpName.empty()) {
FullName_ =
"https://" + Svr.Name() + ":" + std::to_string(Svr.Port()) + URI_BASE;
} else {
FullName_ = TmpName + URI_BASE;
}
Logger().information(fmt::format("Uploader URI base is '{}'", FullName_));
}
auto NewServer = std::make_unique<Poco::Net::HTTPServer>(
new FileUpLoaderRequestHandlerFactory(Logger()), Sock, Params);
NewServer->start();
Servers_.push_back(std::move(NewServer));
}
}
MaxSize_ = 1000 * MicroService::instance().ConfigGetInt("openwifi.fileuploader.maxsize", 10000);
@@ -79,7 +107,7 @@ namespace OpenWifi {
return 0;
}
void FileUploader::reinitialize(Poco::Util::Application &self) {
void FileUploader::reinitialize([[maybe_unused]] Poco::Util::Application &self) {
MicroService::instance().LoadConfigurationFile();
Logger().information("Reinitializing.");
Stop();
@@ -94,18 +122,18 @@ namespace OpenWifi {
bool FileUploader::AddUUID( const std::string & UUID) {
std::lock_guard Guard(Mutex_);
uint64_t Now = time(nullptr) ;
uint64_t now = OpenWifi::Now();
// remove old stuff...
for(auto i=OutStandingUploads_.cbegin();i!=OutStandingUploads_.end();) {
if ((Now-i->second) > (60 * 30))
OutStandingUploads_.erase(i++);
for(auto i=OutStandingUploads_.begin();i!=OutStandingUploads_.end();) {
if ((now-i->second) > (60 * 30))
i = OutStandingUploads_.erase(i);
else
++i;
}
if(!UUID.empty())
OutStandingUploads_[UUID] = Now;
OutStandingUploads_[UUID] = now;
return true;
}
@@ -121,64 +149,39 @@ namespace OpenWifi {
OutStandingUploads_.erase(UUID);
}
class FileUploaderPartHandler: public Poco::Net::PartHandler
{
public:
FileUploaderPartHandler(std::string UUID, Poco::Logger & Logger):
UUID_(std::move(UUID)),
Logger_(Logger)
{
}
void handlePart(const Poco::Net::MessageHeader& Header, std::istream& Stream) override
{
try {
Name_ = "(unnamed)";
if (Header.has("Content-Disposition")) {
std::string Disposition;
Poco::Net::NameValueCollection Parameters;
Poco::Net::MessageHeader::splitParameters(Header["Content-Disposition"],
Disposition, Parameters);
Name_ = Parameters.get("filename", "(unnamed)");
}
std::string FinalFileName = FileUploader()->Path() + "/" + UUID_;
Logger().information(Poco::format("FILE-UPLOADER: uploading trace for %s", FinalFileName));
Poco::CountingInputStream InputStream(Stream);
std::ofstream OutputStream(FinalFileName, std::ofstream::out);
Poco::StreamCopier::copyStream(InputStream, OutputStream);
Poco::File TmpFile(FinalFileName);
Length_ = TmpFile.getSize();
if (Length_ < FileUploader()->MaxSize()) {
Good_=true;
} else {
TmpFile.remove();
Error_ = "File is too large.";
}
return;
} catch (const Poco::Exception &E ) {
Logger().log(E);
Error_ = std::string("Upload caused an internal error: ") + E.what() ;
}
class FileUploaderPartHandler2 : public Poco::Net::PartHandler {
public:
FileUploaderPartHandler2(std::string Id, Poco::Logger &Logger, std::stringstream & ofs) :
Id_(std::move(Id)),
Logger_(Logger),
OutputStream_(ofs){
}
void handlePart(const Poco::Net::MessageHeader &Header, std::istream &Stream) {
FileType_ = Header.get(RESTAPI::Protocol::CONTENTTYPE, RESTAPI::Protocol::UNSPECIFIED);
if (Header.has(RESTAPI::Protocol::CONTENTDISPOSITION)) {
std::string Disposition;
Poco::Net::NameValueCollection Parameters;
Poco::Net::MessageHeader::splitParameters(Header[RESTAPI::Protocol::CONTENTDISPOSITION], Disposition, Parameters);
Name_ = Parameters.get(RESTAPI::Protocol::NAME, RESTAPI::Protocol::UNNAMED);
}
Poco::CountingInputStream InputStream(Stream);
Poco::StreamCopier::copyStream(InputStream, OutputStream_);
Length_ = OutputStream_.str().size();
}
[[nodiscard]] uint64_t Length() const { return Length_; }
[[nodiscard]] std::string &Name() { return Name_; }
[[nodiscard]] std::string &ContentType() { return FileType_; }
[[nodiscard]] uint64_t Length() const { return Length_; }
[[nodiscard]] const std::string& Name() const { return Name_; }
[[nodiscard]] bool Good() const { return Good_; }
std::string & Error() { return Error_; }
inline Poco::Logger & Logger() { return Logger_; }
private:
uint64_t Length_=0;
bool Good_=false;
std::string Name_;
std::string UUID_;
std::string Error_;
Poco::Logger & Logger_;
};
private:
uint64_t Length_ = 0;
std::string FileType_;
std::string Name_;
std::string Id_;
Poco::Logger &Logger_;
std::stringstream &OutputStream_;
inline Poco::Logger & Logger() { return Logger_; };
};
class FormRequestHandler: public Poco::Net::HTTPRequestHandler
{
@@ -189,40 +192,70 @@ namespace OpenWifi {
{
}
void handleRequest(Poco::Net::HTTPServerRequest& Request, Poco::Net::HTTPServerResponse& Response) override
{
try {
FileUploaderPartHandler partHandler(UUID_,Logger());
void handleRequest(Poco::Net::HTTPServerRequest& Request, Poco::Net::HTTPServerResponse& Response) final {
Poco::Net::HTMLForm form(Request, Request.stream(), partHandler);
const auto ContentType = Request.getContentType();
const auto Tokens = Poco::StringTokenizer(ContentType,";",Poco::StringTokenizer::TOK_TRIM);
Response.setChunkedTransferEncoding(true);
Response.setContentType("application/json");
Logger().debug(fmt::format("{}: Preparing to upload trace file.",UUID_));
Poco::JSON::Object Answer;
Poco::JSON::Object Answer;
if (partHandler.Good()) {
Answer.set("filename", UUID_);
Answer.set("error", 0);
StorageService()->AttachFileToCommand(UUID_);
} else {
Answer.set("filename", UUID_);
Answer.set("error", 13);
Answer.set("errorText", partHandler.Error() );
StorageService()->CancelWaitFile(UUID_, partHandler.Error() );
try {
if (Poco::icompare(Tokens[0], "multipart/form-data") == 0 ||
Poco::icompare(Tokens[0], "multipart/mixed") == 0) {
const auto &BoundaryTokens =
Poco::StringTokenizer(Tokens[1], "=", Poco::StringTokenizer::TOK_TRIM);
if (BoundaryTokens[0] == "boundary") {
const std::string &Boundary = BoundaryTokens[1];
Poco::Net::MultipartReader Reader(Request.stream(), Boundary);
bool Done = false;
while (!Done) {
Poco::Net::MessageHeader Hdr;
Reader.nextPart(Hdr);
const auto PartContentType = Hdr.get("Content-Type", "");
if (PartContentType == "application/octet-stream") {
std::stringstream FileContent;
Poco::StreamCopier::copyStream(Reader.stream(), FileContent);
Answer.set("filename", UUID_);
Answer.set("error", 0);
Logger().debug(fmt::format("{}: Trace file uploaded.", UUID_));
StorageService()->AttachFileDataToCommand(UUID_, FileContent);
std::ostream &ResponseStream = Response.send();
Poco::JSON::Stringifier::stringify(Answer, ResponseStream);
return;
} else {
std::stringstream OO;
Poco::StreamCopier::copyStream(Reader.stream(), OO);
}
if (!Reader.hasNextPart())
Done = true;
}
}
}
std::ostream &ResponseStream = Response.send();
Poco::JSON::Stringifier::stringify(Answer, ResponseStream);
return;
}
catch( const Poco::Exception & E )
{
Logger().warning(Poco::format("Error occurred while performing upload. Error='%s'",E.displayText()));
}
catch( ... )
{
}
}
} catch (const Poco::Exception &E) {
Logger().log(E);
} catch (...) {
Logger().debug("Exception while receiving trace file.");
}
Logger().debug(fmt::format("{}: Failed to upload trace file.",UUID_));
std::string Error{"Trace file rejected"};
StorageService()->CancelWaitFile(UUID_, Error);
Answer.set("filename", UUID_);
Answer.set("error", 13);
Answer.set("errorText", "Attached file is too large");
StorageService()->CancelWaitFile(UUID_, Error);
std::ostream &ResponseStream = Response.send();
Poco::JSON::Stringifier::stringify(Answer, ResponseStream);
}
inline Poco::Logger & Logger() { return Logger_; }
private:
std::string UUID_;
Poco::Logger & Logger_;
@@ -230,7 +263,7 @@ namespace OpenWifi {
Poco::Net::HTTPRequestHandler *FileUpLoaderRequestHandlerFactory::createRequestHandler(const Poco::Net::HTTPServerRequest & Request) {
Logger().debug(Poco::format("REQUEST(%s): %s %s", Utils::FormatIPv6(Request.clientAddress().toString()), Request.getMethod(), Request.getURI()));
Logger().debug(fmt::format("REQUEST({}): {} {}", Utils::FormatIPv6(Request.clientAddress().toString()), Request.getMethod(), Request.getURI()));
// The UUID should be after the /v1/upload/ part...
auto UUIDLocation = Request.getURI().find_first_of(URI_BASE);
@@ -246,7 +279,7 @@ namespace OpenWifi {
}
else
{
Logger().warning(Poco::format("Unknown UUID=%s",UUID));
Logger().warning(fmt::format("Unknown UUID={}",UUID));
}
}
return nullptr;

View File

@@ -37,15 +37,13 @@ namespace OpenWifi {
private:
std::vector<std::unique_ptr<Poco::Net::HTTPServer>> Servers_;
Poco::ThreadPool Pool_;
std::string FullName_;
std::map<std::string,uint64_t> OutStandingUploads_;
std::string Path_;
uint64_t MaxSize_=10000000;
explicit FileUploader() noexcept:
SubSystemServer("FileUploader", "FILE-UPLOAD", "openwifi.fileuploader"),
Pool_("FileUpLoaderPool")
SubSystemServer("FileUploader", "FILE-UPLOAD", "openwifi.fileuploader")
{
}
};

67
src/GwWebSocketClient.cpp Normal file
View File

@@ -0,0 +1,67 @@
//
// Created by stephane bourque on 2022-04-28.
//
#include "GwWebSocketClient.h"
#include "SerialNumberCache.h"
namespace OpenWifi {
GwWebSocketClient::GwWebSocketClient(Poco::Logger &Logger):
Logger_(Logger){
WebSocketClientServer()->SetProcessor(this);
}
GwWebSocketClient::~GwWebSocketClient() {
WebSocketClientServer()->SetProcessor(nullptr);
}
void GwWebSocketClient::Processor(const Poco::JSON::Object::Ptr &O, std::string &Answer, bool &Done ) {
try {
if (O->has("command")) {
auto Command = O->get("command").toString();
if (Command == "serial_number_search" && O->has("serial_prefix")) {
ws_command_serial_number_search(O,Done,Answer);
} else if (Command=="exit") {
ws_command_exit(O,Done,Answer);
} else {
ws_command_invalid(O, Done, Answer);
}
}
} catch (const Poco::Exception &E) {
Logger_.log(E);
}
}
void GwWebSocketClient::ws_command_serial_number_search(const Poco::JSON::Object::Ptr &O,
bool &Done, std::string &Answer) {
Done = false;
auto Prefix = O->get("serial_prefix").toString();
Logger().information(Poco::format("serial_number_search: %s", Prefix));
if (!Prefix.empty() && Prefix.length() < 13) {
std::vector<uint64_t> Numbers;
SerialNumberCache()->FindNumbers(Prefix, 50, Numbers);
Poco::JSON::Array Arr;
for (const auto &i : Numbers)
Arr.add(Utils::int_to_hex(i));
Poco::JSON::Object RetObj;
RetObj.set("serialNumbers", Arr);
std::ostringstream SS;
Poco::JSON::Stringifier::stringify(RetObj, SS);
Answer = SS.str();
}
}
void GwWebSocketClient::ws_command_exit([[maybe_unused]] const Poco::JSON::Object::Ptr &O, bool &Done, std::string &Answer) {
Done = true;
Answer = R"lit({ "closing" : "Goodbye! Aurevoir! Hasta la vista!" })lit";
}
void GwWebSocketClient::ws_command_invalid([[maybe_unused]] const Poco::JSON::Object::Ptr &O, bool &Done, std::string &Answer) {
Done = false;
Answer = std::string{R"lit({ "error" : "invalid command" })lit"};
}
}

23
src/GwWebSocketClient.h Normal file
View File

@@ -0,0 +1,23 @@
//
// Created by stephane bourque on 2022-04-28.
//
#pragma once
#include "framework/MicroService.h"
namespace OpenWifi {
class GwWebSocketClient : public WebSocketClientProcessor {
public:
explicit GwWebSocketClient(Poco::Logger &Logger);
virtual ~GwWebSocketClient();
virtual void Processor(const Poco::JSON::Object::Ptr &O, std::string &Answer, bool &Done );
void ws_command_serial_number_search( const Poco::JSON::Object::Ptr &O, bool &Done, std::string &Answer);
void ws_command_exit( const Poco::JSON::Object::Ptr &O, bool &Done, std::string &Answer);
void ws_command_invalid( const Poco::JSON::Object::Ptr &O, bool &Done, std::string &Answer);
private:
Poco::Logger & Logger_;
inline Poco::Logger & Logger() { return Logger_; }
};
}

View File

@@ -21,6 +21,9 @@ namespace OpenWifi {
int OUIServer::Start() {
Running_ = true;
LatestOUIFileName_ = MicroService::instance().DataDir() + "/newOUIFile.txt";
CurrentOUIFileName_ = MicroService::instance().DataDir() + "/current_oui.txt";
UpdaterCallBack_ = std::make_unique<Poco::TimerCallback<OUIServer>>(*this, &OUIServer::onTimer);
Timer_.setStartInterval(30 * 1000); // first run in 5 minutes
Timer_.setPeriodicInterval(7 * 24 * 60 * 60 * 1000);
@@ -33,7 +36,7 @@ namespace OpenWifi {
Timer_.stop();
}
void OUIServer::reinitialize(Poco::Util::Application &self) {
void OUIServer::reinitialize([[maybe_unused]] Poco::Util::Application &self) {
MicroService::instance().LoadConfigurationFile();
Logger().information("Reinitializing.");
Stop();
@@ -42,17 +45,15 @@ namespace OpenWifi {
bool OUIServer::GetFile(const std::string &FileName) {
try {
Logger().information(Poco::format("Start: Retrieving OUI file: %s",MicroService::instance().ConfigGetString("oui.download.uri")));
LastUpdate_ = OpenWifi::Now();
Logger().information(fmt::format("Start: Retrieving OUI file: {}",MicroService::instance().ConfigGetString("oui.download.uri")));
std::unique_ptr<std::istream> pStr(
Poco::URIStreamOpener::defaultOpener().open(MicroService::instance().ConfigGetString("oui.download.uri")));
std::ofstream OS;
Poco::File F(FileName);
if(F.exists())
F.remove();
OS.open(FileName);
Poco::StreamCopier::copyStream(*pStr, OS);
OS.close();
Logger().information(Poco::format("Done: Retrieving OUI file: %s",MicroService::instance().ConfigGetString("oui.download.uri")));
Logger().information(fmt::format("Done: Retrieving OUI file: {}",MicroService::instance().ConfigGetString("oui.download.uri")));
return true;
} catch (const Poco::Exception &E) {
Logger().log(E);
@@ -80,7 +81,7 @@ namespace OpenWifi {
auto MAC = Utils::SerialNumberToOUI(Tokens[0]);
if (MAC > 0) {
std::string Manufacturer;
for (auto i = 2; i < Tokens.count(); i++)
for (size_t i = 2; i < Tokens.count(); i++)
Manufacturer += Tokens[i] + " ";
auto M = Poco::trim(Manufacturer);
if (!M.empty())
@@ -96,33 +97,48 @@ namespace OpenWifi {
return false;
}
void OUIServer::onTimer(Poco::Timer & timer) {
void OUIServer::onTimer([[maybe_unused]] Poco::Timer & timer) {
if(Updating_)
return;
Updating_ = true;
// fetch data from server, if not available, just use the file we already have.
std::string LatestOUIFileName{ MicroService::instance().DataDir() + "/newOUIFile.txt"};
std::string CurrentOUIFileName{ MicroService::instance().DataDir() + "/current_oui.txt"};
Poco::File Current(CurrentOUIFileName_);
if(Current.exists()) {
if((OpenWifi::Now()-Current.getLastModified().epochTime()) < (7*24*60*60)) {
if(!Initialized_) {
if(ProcessFile(CurrentOUIFileName_, OUIs_)) {
Initialized_ = true;
Updating_=false;
Logger().information("Using cached file.");
return;
}
} else {
Updating_=false;
return;
}
}
}
OUIMap TmpOUIs;
if(GetFile(LatestOUIFileName) && ProcessFile(LatestOUIFileName, TmpOUIs)) {
if(GetFile(LatestOUIFileName_) && ProcessFile(LatestOUIFileName_, TmpOUIs)) {
std::lock_guard G(Mutex_);
OUIs_ = std::move(TmpOUIs);
LastUpdate_ = std::time(nullptr);
Poco::File F1(CurrentOUIFileName);
LastUpdate_ = OpenWifi::Now();
Poco::File F1(CurrentOUIFileName_);
if(F1.exists())
F1.remove();
Poco::File F2(LatestOUIFileName);
F2.renameTo(CurrentOUIFileName);
Logger().information(Poco::format("New OUI file %s downloaded.",LatestOUIFileName));
Poco::File F2(LatestOUIFileName_);
F2.renameTo(CurrentOUIFileName_);
Logger().information(fmt::format("New OUI file {} downloaded.",LatestOUIFileName_));
} else if(OUIs_.empty()) {
if(ProcessFile(CurrentOUIFileName, TmpOUIs)) {
LastUpdate_ = std::time(nullptr);
if(ProcessFile(CurrentOUIFileName_, TmpOUIs)) {
LastUpdate_ = OpenWifi::Now();
std::lock_guard G(Mutex_);
OUIs_ = std::move(TmpOUIs);
}
}
Initialized_=true;
Updating_ = false;
}

View File

@@ -31,12 +31,13 @@ namespace OpenWifi {
private:
uint64_t LastUpdate_ = 0 ;
bool ValidFile_=false;
bool Initialized_ = false;
OUIMap OUIs_;
std::atomic_bool Updating_=false;
std::atomic_bool Running_=false;
Poco::Timer Timer_;
std::unique_ptr<Poco::TimerCallback<OUIServer>> UpdaterCallBack_;
std::string LatestOUIFileName_,CurrentOUIFileName_;
OUIServer() noexcept:
SubSystemServer("OUIServer", "OUI-SVR", "ouiserver")

358
src/RADIUS_proxy_server.cpp Normal file
View File

@@ -0,0 +1,358 @@
//
// Created by stephane bourque on 2022-05-18.
//
#include "RADIUS_proxy_server.h"
#include "DeviceRegistry.h"
namespace OpenWifi {
const int SMALLEST_RADIUS_PACKET = 20+19+4;
const int RADIUS_BUFFER_SIZE = 2048;
const int DEFAULT_RADIUS_AUTHENTICATION_PORT = 1812;
const int DEFAULT_RADIUS_ACCOUNTING_PORT = 1813;
int RADIUS_proxy_server::Start() {
ConfigFilename_ = MicroService::instance().DataDir()+"/radius_pool_config.json";
Poco::Net::SocketAddress AuthSockAddrV4(Poco::Net::AddressFamily::IPv4,
MicroService::instance().ConfigGetInt("radius.proxy.authentication.port",DEFAULT_RADIUS_AUTHENTICATION_PORT));
AuthenticationSocketV4_ = std::make_unique<Poco::Net::DatagramSocket>(AuthSockAddrV4,true);
Poco::Net::SocketAddress AuthSockAddrV6(Poco::Net::AddressFamily::IPv6,
MicroService::instance().ConfigGetInt("radius.proxy.authentication.port",DEFAULT_RADIUS_AUTHENTICATION_PORT));
AuthenticationSocketV6_ = std::make_unique<Poco::Net::DatagramSocket>(AuthSockAddrV6,true);
Poco::Net::SocketAddress AcctSockAddrV4(Poco::Net::AddressFamily::IPv4,
MicroService::instance().ConfigGetInt("radius.proxy.accounting.port",DEFAULT_RADIUS_ACCOUNTING_PORT));
AccountingSocketV4_ = std::make_unique<Poco::Net::DatagramSocket>(AcctSockAddrV4,true);
Poco::Net::SocketAddress AcctSockAddrV6(Poco::Net::AddressFamily::IPv6,
MicroService::instance().ConfigGetInt("radius.proxy.accounting.port",DEFAULT_RADIUS_ACCOUNTING_PORT));
AccountingSocketV6_ = std::make_unique<Poco::Net::DatagramSocket>(AcctSockAddrV6,true);
AuthenticationReactor_.addEventHandler(*AuthenticationSocketV4_,Poco::NObserver<RADIUS_proxy_server, Poco::Net::ReadableNotification>(
*this, &RADIUS_proxy_server::OnAuthenticationSocketReadable));
AccountingReactor_.addEventHandler(*AccountingSocketV4_,Poco::NObserver<RADIUS_proxy_server, Poco::Net::ReadableNotification>(
*this, &RADIUS_proxy_server::OnAccountingSocketReadable));
AuthenticationReactor_.addEventHandler(*AuthenticationSocketV6_,Poco::NObserver<RADIUS_proxy_server, Poco::Net::ReadableNotification>(
*this, &RADIUS_proxy_server::OnAuthenticationSocketReadable));
AccountingReactor_.addEventHandler(*AccountingSocketV6_,Poco::NObserver<RADIUS_proxy_server, Poco::Net::ReadableNotification>(
*this, &RADIUS_proxy_server::OnAccountingSocketReadable));
AuthenticationReactorThread_.start(AuthenticationReactor_);
AccountingReactorThread_.start(AccountingReactor_);
return 0;
}
void RADIUS_proxy_server::Stop() {
AuthenticationReactor_.removeEventHandler(*AuthenticationSocketV4_,Poco::NObserver<RADIUS_proxy_server, Poco::Net::ReadableNotification>(
*this, &RADIUS_proxy_server::OnAuthenticationSocketReadable));
AccountingReactor_.removeEventHandler(*AccountingSocketV4_,Poco::NObserver<RADIUS_proxy_server, Poco::Net::ReadableNotification>(
*this, &RADIUS_proxy_server::OnAccountingSocketReadable));
AuthenticationReactor_.removeEventHandler(*AuthenticationSocketV6_,Poco::NObserver<RADIUS_proxy_server, Poco::Net::ReadableNotification>(
*this, &RADIUS_proxy_server::OnAuthenticationSocketReadable));
AccountingReactor_.removeEventHandler(*AccountingSocketV6_,Poco::NObserver<RADIUS_proxy_server, Poco::Net::ReadableNotification>(
*this, &RADIUS_proxy_server::OnAccountingSocketReadable));
AuthenticationReactor_.stop();
AuthenticationReactorThread_.join();
AccountingReactor_.stop();
AccountingReactorThread_.join();
}
std::string ExtractSerialNumber(const unsigned char *b, uint32_t s) {
std::string result;
try {
uint32_t pos=0;
while(pos<s) {
auto len = b[pos+1];
if(b[pos] != 26) {
pos += len;
continue;
}
uint32_t vendor_id = b[pos+2] * 256 * 256 * 256 + b[pos+3] * 256 * 256 + b[pos+4] * 256+ b[pos+5];
if(vendor_id!=58888) {
pos += len;
continue;
}
auto tpos0 = pos + 6;
auto tend0 = tpos0 + b[tpos0+1];
while (tpos0<tend0) {
if (b[tpos0] == 71) {
auto tpos1 = tpos0+2;
auto tlen1 = b[tpos0+1];
auto tend1 = tpos1 + tlen1;
while (tpos1 < tend1) {
if (b[tpos1] == 0x01) {
uint32_t tlen = b[tpos1 + 1] - 2;
tpos1 += 2;
while (tlen) {
if (b[tpos1] != '-') {
result += (char) b[tpos1];
}
tlen--;
tpos1++;
}
if (result.size() == 12)
return result;
return "";
} else {
tpos1 += b[tpos1+1];
}
}
} else {
tpos0 += b[tpos0 + 1];
}
}
pos += len;
}
} catch (...) {
}
return result;
}
void RADIUS_proxy_server::OnAccountingSocketReadable(const Poco::AutoPtr<Poco::Net::ReadableNotification>& pNf) {
Poco::Net::SocketAddress Sender;
unsigned char Buffer[RADIUS_BUFFER_SIZE];
auto ReceiveSize = pNf.get()->socket().impl()->receiveBytes(Buffer,sizeof(Buffer));
if(ReceiveSize<SMALLEST_RADIUS_PACKET)
return;
auto SerialNumber = ExtractSerialNumber(&Buffer[20],ReceiveSize);
Logger().information(fmt::format("Accounting Packet received for {}",SerialNumber));
std::cout << "Received an Accounting packet for :" << SerialNumber << std::endl;
DeviceRegistry()->SendRadiusAccountingData(SerialNumber,Buffer,ReceiveSize);
}
void RADIUS_proxy_server::OnAuthenticationSocketReadable(const Poco::AutoPtr<Poco::Net::ReadableNotification>& pNf) {
Poco::Net::SocketAddress Sender;
unsigned char Buffer[RADIUS_BUFFER_SIZE];
auto ReceiveSize = pNf.get()->socket().impl()->receiveBytes(Buffer,sizeof(Buffer));
if(ReceiveSize<SMALLEST_RADIUS_PACKET)
return;
auto SerialNumber = ExtractSerialNumber(&Buffer[20],ReceiveSize);
Logger().information(fmt::format("Authentication Packet received for {}",SerialNumber));
std::cout << "Received an Authentication packet for :" << SerialNumber << std::endl;
DeviceRegistry()->SendRadiusAuthenticationData(SerialNumber,Buffer,ReceiveSize);
}
void RADIUS_proxy_server::SendAccountingData(const std::string &serialNumber, const std::string &Destination,const char *buffer, std::size_t size) {
Poco::Net::SocketAddress Dst(Destination);
std::lock_guard G(Mutex_);
if(Dst.af()==Poco::Net::AddressFamily::IPv4)
AccountingSocketV4_->sendTo(buffer,(int)size,Route(Dst,AcctPoolsV4_,AcctPoolsIndexV4_));
else
AccountingSocketV6_->sendTo(buffer,(int)size,Route(Dst,AcctPoolsV6_,AcctPoolsIndexV6_));
Logger().information(fmt::format("{}: Sending Accounting Packet to {}", serialNumber, Destination));
std::cout << "Sending Accounting data to " << Destination << std::endl;
}
void RADIUS_proxy_server::SendAuthenticationData(const std::string &serialNumber, const std::string &Destination,const char *buffer, std::size_t size) {
Poco::Net::SocketAddress Dst(Destination);
std::lock_guard G(Mutex_);
if(Dst.af()==Poco::Net::AddressFamily::IPv4)
AuthenticationSocketV4_->sendTo(buffer,(int)size,Route(Dst,AuthPoolsV4_,AuthPoolsIndexV4_));
else
AuthenticationSocketV6_->sendTo(buffer,(int)size,Route(Dst,AuthPoolsV6_,AuthPoolsIndexV6_));
Logger().information(fmt::format("{}: Sending Authentication Packet to {}", serialNumber, Destination));
std::cout << "Sending Authentication data to " << Destination << std::endl;
}
void RADIUS_proxy_server::ParseServerList(const GWObjects::RadiusProxyServerConfig & Config, PoolIndexMap_t &MapV4, PoolIndexMap_t &MapV6, PoolIndexVec_t &VecV4, PoolIndexVec_t &VecV6) {
std::vector<Destination> DestsV4,DestsV6;
uint64_t TotalV4=0, TotalV6=0;
for(const auto &server:Config.servers) {
auto S = Poco::Net::SocketAddress(fmt::format("{}:{}",server.name,server.port));
Destination D{
.Addr = S,
.state = 0,
.step = 0,
.weight = server.weight,
.available = true,
.strategy = Config.strategy,
.monitor = Config. monitor,
.monitorMethod = Config.monitorMethod,
.methodParameters = Config.methodParameters
};
if(S.af()==Poco::Net::AddressFamily::IPv4) {
TotalV4 += server.weight;
DestsV4.push_back(D);
MapV4[S] = VecV4.size();
} else {
TotalV6 += server.weight;
DestsV6.push_back(D);
MapV6[S] = VecV6.size();
}
}
for(auto &i:DestsV4) {
i.step = 1000 - ((1000*i.weight)/TotalV4);
}
for(auto &i:DestsV6) {
i.step = 1000 - ((1000*i.weight)/TotalV6);
}
if(!DestsV4.empty())
VecV4.push_back(DestsV4);
if(!DestsV6.empty())
VecV6.push_back((DestsV6));
}
void RADIUS_proxy_server::ParseConfig() {
try {
Poco::File F(ConfigFilename_);
std::lock_guard G(Mutex_);
if(F.exists()) {
std::ifstream ifs(ConfigFilename_,std::ios_base::binary);
Poco::JSON::Parser P;
auto RawConfig = P.parse(ifs).extract<Poco::JSON::Object::Ptr>();
GWObjects::RadiusProxyPoolList RPC;
if(RPC.from_json(RawConfig)) {
ResetConfig();
PoolList_ = RPC;
for(const auto &pool:RPC.pools) {
ParseServerList(pool.authConfig,AuthPoolsIndexV4_, AuthPoolsIndexV6_, AuthPoolsV4_, AuthPoolsV6_);
ParseServerList(pool.acctConfig,AcctPoolsIndexV4_, AcctPoolsIndexV6_, AcctPoolsV4_, AcctPoolsV6_);
}
} else {
Logger().warning(fmt::format("Configuration file '{}' is bad.",ConfigFilename_));
}
} else {
Logger().warning(fmt::format("No configuration file '{}' exists.",ConfigFilename_));
}
} catch (const Poco::Exception &E) {
Logger().log(E);
} catch (...) {
Logger().error(fmt::format("Error while parsing configuration file '{}'",ConfigFilename_));
}
}
Poco::Net::SocketAddress RADIUS_proxy_server::Route(const Poco::Net::SocketAddress &A, PoolIndexVec_t & P, PoolIndexMap_t &M) {
std::lock_guard G(Mutex_);
if(PoolList_.pools.empty())
return A;
auto It = M.find(A);
if(It==M.end())
return A;
auto Index = It->second;
auto Pool = P[Index];
// is there anything of the same af ?
if(Pool[0].strategy=="weighted") {
bool found = false;
uint64_t cur_state = std::numeric_limits<uint64_t>::max();
std::size_t pos = 0, index = 0;
for (auto &i : Pool) {
if (!i.available) {
i.state += i.step;
continue;
}
if (i.state < cur_state) {
index = pos;
cur_state = i.state;
found = true;
}
pos++;
}
if (!found)
return A;
Pool[index].state += Pool[index].step;
return Pool[index].Addr;
} else if (Pool[0].strategy=="round_robin") {
bool found = false;
uint64_t cur_state = std::numeric_limits<uint64_t>::max();
std::size_t pos = 0, index = 0;
for (auto &i : Pool) {
if (!i.available) {
i.state += 1;
continue;
}
if (i.state < cur_state) {
index = pos;
cur_state = i.state;
found = true;
}
pos++;
}
if (!found)
return A;
Pool[index].state += 1;
return Pool[index].Addr;
} else if (Pool[0].strategy=="random") {
if(Pool.size()>1) {
return Pool[ std::rand() % Pool.size() ].Addr;
} else {
return A;
}
}
return A;
}
void RADIUS_proxy_server::SetConfig(const GWObjects::RadiusProxyPoolList &C) {
std::lock_guard G(Mutex_);
PoolList_ = C;
Poco::JSON::Object Disk;
C.to_json(Disk);
std::ofstream ofs(ConfigFilename_, std::ios_base::trunc | std::ios_base::binary );
Disk.stringify(ofs);
ofs.close();
ParseConfig();
}
void RADIUS_proxy_server::ResetConfig() {
PoolList_.pools.clear();
AuthPoolsIndexV4_.clear();
AuthPoolsIndexV6_.clear();
AcctPoolsIndexV4_.clear();
AcctPoolsIndexV6_.clear();
AuthPoolsV4_.clear();
AuthPoolsV6_.clear();
AcctPoolsV4_.clear();
AcctPoolsV6_.clear();
}
void RADIUS_proxy_server::DeleteConfig() {
std::lock_guard G(Mutex_);
try {
Poco::File F(ConfigFilename_);
if (F.exists())
F.remove();
} catch (...) {
}
ResetConfig();
}
void RADIUS_proxy_server::GetConfig(GWObjects::RadiusProxyPoolList &C) {
std::lock_guard G(Mutex_);
C = PoolList_;
}
}

82
src/RADIUS_proxy_server.h Normal file
View File

@@ -0,0 +1,82 @@
//
// Created by stephane bourque on 2022-05-18.
//
#pragma once
#include "framework/MicroService.h"
#include "Poco/Net/DatagramSocket.h"
#include "Poco/Net/SocketReactor.h"
#include "RESTObjects/RESTAPI_GWobjects.h"
namespace OpenWifi {
class RADIUS_proxy_server : public SubSystemServer {
public:
inline static auto instance() {
static auto instance_= new RADIUS_proxy_server;
return instance_;
}
int Start() final;
void Stop() final;
void OnAccountingSocketReadable(const Poco::AutoPtr<Poco::Net::ReadableNotification>& pNf);
void OnAuthenticationSocketReadable(const Poco::AutoPtr<Poco::Net::ReadableNotification>& pNf);
void SendAccountingData(const std::string &serialNumber, const std::string &Destination,const char *buffer, std::size_t size);
void SendAuthenticationData(const std::string &serialNumber, const std::string &Destination,const char *buffer, std::size_t size);
void SetConfig(const GWObjects::RadiusProxyPoolList &C);
void DeleteConfig();
void GetConfig(GWObjects::RadiusProxyPoolList &C);
struct Destination {
Poco::Net::SocketAddress Addr;
uint64_t state = 0;
uint64_t step = 0;
uint64_t weight=0;
bool available = true;
std::string strategy;
bool monitor=false;
std::string monitorMethod;
std::vector<std::string> methodParameters;
};
private:
std::unique_ptr<Poco::Net::DatagramSocket> AccountingSocketV4_;
std::unique_ptr<Poco::Net::DatagramSocket> AccountingSocketV6_;
std::unique_ptr<Poco::Net::DatagramSocket> AuthenticationSocketV4_;
std::unique_ptr<Poco::Net::DatagramSocket> AuthenticationSocketV6_;
Poco::Net::SocketReactor AccountingReactor_;
Poco::Net::SocketReactor AuthenticationReactor_;
Poco::Thread AuthenticationReactorThread_;
Poco::Thread AccountingReactorThread_;
GWObjects::RadiusProxyPoolList PoolList_;
std::string ConfigFilename_;
typedef std::map<Poco::Net::SocketAddress,uint> PoolIndexMap_t;
PoolIndexMap_t AuthPoolsIndexV4_;
PoolIndexMap_t AcctPoolsIndexV4_;
PoolIndexMap_t AuthPoolsIndexV6_;
PoolIndexMap_t AcctPoolsIndexV6_;
typedef std::vector<std::vector<Destination>> PoolIndexVec_t;
PoolIndexVec_t AuthPoolsV4_;
PoolIndexVec_t AuthPoolsV6_;
PoolIndexVec_t AcctPoolsV4_;
PoolIndexVec_t AcctPoolsV6_;
RADIUS_proxy_server() noexcept:
SubSystemServer("RADIUS-PROXY", "RADIUS-PROXY", "radius.proxy")
{
}
void ParseConfig();
void ResetConfig();
Poco::Net::SocketAddress Route(const Poco::Net::SocketAddress &A, PoolIndexVec_t & P, PoolIndexMap_t &M);
void ParseServerList(const GWObjects::RadiusProxyServerConfig & Config, PoolIndexMap_t &MapV4, PoolIndexMap_t &MapV6, PoolIndexVec_t &VecV4, PoolIndexVec_t &VecV6);
};
inline auto RADIUS_proxy_server() { return RADIUS_proxy_server::instance(); }
}

View File

@@ -1,27 +1,24 @@
//
// Created by stephane bourque on 2021-06-28.
//
#include <cctype>
#include <algorithm>
#include <iostream>
#include <iterator>
#include <future>
#include <numeric>
#include <chrono>
#include "RESTAPI_RPC.h"
#include "CommandManager.h"
#include "DeviceRegistry.h"
#include "StorageService.h"
#include "framework/uCentral_Protocol.h"
#include "framework/ow_constants.h"
namespace OpenWifi::RESTAPI_RPC {
void SetCommandStatus(GWObjects::CommandDetails &Cmd,
Poco::Net::HTTPServerRequest &Request,
Poco::Net::HTTPServerResponse &Response,
RESTAPIHandler *Handler,
OpenWifi::Storage::CommandExecutionType Status,
Poco::Logger &Logger) {
[[maybe_unused]] Poco::Net::HTTPServerRequest &Request,
[[maybe_unused]] Poco::Net::HTTPServerResponse &Response,
RESTAPIHandler *Handler,
OpenWifi::Storage::CommandExecutionType Status,
[[maybe_unused]] Poco::Logger &Logger) {
if (StorageService()->AddCommand(Cmd.SerialNumber, Cmd, Status)) {
Poco::JSON::Object RetObj;
Cmd.to_json(RetObj);
@@ -47,79 +44,100 @@ namespace OpenWifi::RESTAPI_RPC {
return;
}
Cmd.Executed = std::time(nullptr);
Cmd.Executed = OpenWifi::Now();
bool Sent;
std::chrono::time_point<std::chrono::high_resolution_clock> rpc_submitted = std::chrono::high_resolution_clock::now();
std::shared_ptr<CommandManager::promise_type_t> rpc_endpoint =
CommandManager()->PostCommand(Cmd.SerialNumber, Cmd.Command, Params, Cmd.UUID, Sent);
Logger.information(fmt::format("{}: user={} serial={}. Sent RPC request.", Cmd.Command, Cmd.SubmittedBy, Cmd.SerialNumber));
Poco::JSON::Object L;
if (Sent && rpc_endpoint!= nullptr) {
std::future<CommandManager::objtype_t> rpc_future(rpc_endpoint->get_future());
auto rpc_result = rpc_future.wait_for(WaitTimeInMs);
if (rpc_result == std::future_status::ready && rpc_future.valid()) {
if (rpc_result == std::future_status::ready) {
std::chrono::duration<double, std::milli> rpc_execution_time = std::chrono::high_resolution_clock::now() - rpc_submitted;
auto rpc_answer = rpc_future.get();
if (rpc_answer) {
if (rpc_answer->has("result") && rpc_answer->isObject("result")) {
auto ResultFields =
rpc_answer->get("result").extract<Poco::JSON::Object::Ptr>();
if (ResultFields->has("status") && ResultFields->isObject("status")) {
auto StatusInnerObj =
ResultFields->get("status").extract<Poco::JSON::Object::Ptr>();
if (StatusInnerObj->has("error"))
Cmd.ErrorCode = StatusInnerObj->get("error");
if (StatusInnerObj->has("text"))
Cmd.ErrorText = StatusInnerObj->get("text").toString();
std::stringstream ResultText;
Poco::JSON::Stringifier::stringify(rpc_answer->get("result"),
ResultText);
Cmd.Results = ResultText.str();
Cmd.Status = "completed";
Cmd.Completed = time(nullptr);
Cmd.executionTime = rpc_execution_time.count();
if (Cmd.ErrorCode && Cmd.Command == uCentralProtocol::TRACE) {
Cmd.WaitingForFile = 0;
Cmd.AttachDate = Cmd.AttachSize = 0;
Cmd.AttachType = "";
}
// Add the completed command to the database...
StorageService()->AddCommand(Cmd.SerialNumber, Cmd, Storage::COMMAND_COMPLETED);
if (ObjectToReturn) {
Handler->ReturnObject(*ObjectToReturn);
} else {
Poco::JSON::Object O;
Cmd.to_json(O);
Handler->ReturnObject(O);
}
Logger.information(Poco::format("Command(%s): completed in %8.3fms.", Cmd.UUID, Cmd.executionTime));
return;
} else {
SetCommandStatus(Cmd, Request, Response, Handler,
Storage::COMMAND_FAILED, Logger);
Logger.information(Poco::format(
"Invalid response for command '%s'. Missing status.", Cmd.UUID));
return;
if (rpc_answer.has(uCentralProtocol::RESULT) && rpc_answer.isObject(uCentralProtocol::RESULT)) {
auto ResultFields =
rpc_answer.get(uCentralProtocol::RESULT).extract<Poco::JSON::Object::Ptr>();
if (ResultFields->has(uCentralProtocol::STATUS) && ResultFields->isObject(uCentralProtocol::STATUS)) {
auto StatusInnerObj =
ResultFields->get(uCentralProtocol::STATUS).extract<Poco::JSON::Object::Ptr>();
if (StatusInnerObj->has(uCentralProtocol::ERROR))
Cmd.ErrorCode = StatusInnerObj->get(uCentralProtocol::ERROR);
if (StatusInnerObj->has(uCentralProtocol::TEXT))
Cmd.ErrorText = StatusInnerObj->get(uCentralProtocol::TEXT).toString();
std::stringstream ResultText;
if(rpc_answer.has(uCentralProtocol::RESULT)) {
Poco::JSON::Stringifier::stringify(
rpc_answer.get(uCentralProtocol::RESULT), ResultText);
} if (rpc_answer.has(uCentralProtocol::RESULT_64)) {
uint64_t sz=0;
if(rpc_answer.has(uCentralProtocol::RESULT_SZ))
sz=rpc_answer.get(uCentralProtocol::RESULT_SZ);
std::string UnCompressedData;
Utils::ExtractBase64CompressedData(rpc_answer.get(uCentralProtocol::RESULT_64).toString(),
UnCompressedData,sz);
Poco::JSON::Stringifier::stringify(UnCompressedData, ResultText);
}
Cmd.Results = ResultText.str();
Cmd.Status = "completed";
Cmd.Completed = OpenWifi::Now();
Cmd.executionTime = rpc_execution_time.count();
if (Cmd.ErrorCode && Cmd.Command == uCentralProtocol::TRACE) {
Cmd.WaitingForFile = 0;
Cmd.AttachDate = Cmd.AttachSize = 0;
Cmd.AttachType = "";
}
// Add the completed command to the database...
StorageService()->AddCommand(Cmd.SerialNumber, Cmd, Storage::COMMAND_COMPLETED);
if (ObjectToReturn) {
Handler->ReturnObject(*ObjectToReturn);
} else {
Poco::JSON::Object O;
Cmd.to_json(O);
Handler->ReturnObject(O);
}
Logger.information( fmt::format("Command({}): completed in {:.3f}ms.", Cmd.UUID, Cmd.executionTime));
return;
} else {
SetCommandStatus(Cmd, Request, Response, Handler, Storage::COMMAND_FAILED,
Logger);
Logger.information(Poco::format(
"Invalid response for command '%s'. Missing status.", Cmd.UUID));
SetCommandStatus(Cmd, Request, Response, Handler,
Storage::COMMAND_FAILED, Logger);
Logger.information(fmt::format(
"Invalid response for command '{}'. Missing status.", Cmd.UUID));
return;
}
} else {
SetCommandStatus(Cmd, Request, Response, Handler, Storage::COMMAND_FAILED,
Logger);
Logger.information(fmt::format(
"Invalid response for command '{}'. Missing status.", Cmd.UUID));
return;
}
} else if (rpc_result == std::future_status::timeout) {
Logger.information(fmt::format(
"Timeout2 for command '{}'.", Cmd.UUID));
SetCommandStatus(Cmd, Request, Response, Handler, Storage::COMMAND_TIMEDOUT,
Logger);
return;
} else {
Logger.information(fmt::format(
"Pending completion for command '{}'.", Cmd.UUID));
SetCommandStatus(Cmd, Request, Response, Handler, Storage::COMMAND_PENDING, Logger);
return;
}
} else {
Logger.information(fmt::format(
"Pending completion for command '{}'.", Cmd.UUID));
SetCommandStatus(Cmd, Request, Response, Handler, Storage::COMMAND_PENDING, Logger);
return;
}
}
}

View File

@@ -14,7 +14,7 @@
#include "Poco/File.h"
#include "Poco/JSON/Object.h"
#include "RESTObjects//RESTAPI_GWobjects.h"
#include "RESTObjects/RESTAPI_GWobjects.h"
#include "StorageService.h"
#include "framework/MicroService.h"

View File

@@ -12,8 +12,7 @@
#include "Poco/JSON/Stringifier.h"
#include "RESTAPI_blacklist.h"
#include "StorageService.h"
#include "framework/RESTAPI_errors.h"
#include "framework/RESTAPI_protocol.h"
#include "framework/ow_constants.h"
namespace OpenWifi {
void RESTAPI_blacklist::DoDelete() {
@@ -52,8 +51,7 @@ namespace OpenWifi {
}
void RESTAPI_blacklist::DoPost() {
auto Obj = ParseStream();
const auto &Obj = ParsedBody_;
GWObjects::BlackListedDevice D;
if(!D.from_json(Obj)) {
return BadRequest(RESTAPI::Errors::InvalidJSONDocument);
@@ -69,7 +67,7 @@ namespace OpenWifi {
}
D.author = UserInfo_.userinfo.email;
D.created = std::time(nullptr);
D.created = OpenWifi::Now();
if(StorageService()->AddBlackListDevice(D)) {
GWObjects::BlackListedDevice CreatedDevice;
@@ -89,8 +87,7 @@ namespace OpenWifi {
return BadRequest(RESTAPI::Errors::MissingSerialNumber);
}
auto Obj = ParseStream();
const auto &Obj = ParsedBody_;
GWObjects::BlackListedDevice Existing;
if(!StorageService()->GetBlackListDevice(SerialNumber, Existing)) {
return BadRequest(RESTAPI::Errors::InvalidJSONDocument);

View File

@@ -23,7 +23,7 @@ namespace OpenWifi {
Server,
TransactionId,
Internal) {}
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/blacklist/{serialNumber}"};}
static auto PathName() { return std::list<std::string>{"/api/v1/blacklist/{serialNumber}"};}
void DoGet() final;
void DoDelete() final;
void DoPost() final;

View File

@@ -16,7 +16,7 @@ namespace OpenWifi {
Server,
TransactionId,
Internal) {}
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/blacklist"};}
static auto PathName() { return std::list<std::string>{"/api/v1/blacklist"};}
void DoGet() final;
void DoDelete() final {};
void DoPost() final {};

View File

@@ -16,7 +16,7 @@ namespace OpenWifi {
Server,
TransactionId,
Internal) {}
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/capabilities"};}
static auto PathName() { return std::list<std::string>{"/api/v1/capabilities"};}
void DoGet() final;
void DoDelete() final {};
void DoPost() final {};

View File

@@ -9,12 +9,15 @@
#include "RESTAPI_command.h"
#include "StorageService.h"
#include "framework/RESTAPI_errors.h"
#include "framework/RESTAPI_protocol.h"
#include "framework/ow_constants.h"
namespace OpenWifi {
void RESTAPI_command::DoGet() {
auto CommandUUID = GetBinding(RESTAPI::Protocol::COMMANDUUID, "");
if(!Utils::ValidUUID(CommandUUID)) {
return NotFound();
}
GWObjects::CommandDetails Command;
if (StorageService()->GetCommand(CommandUUID, Command)) {
Poco::JSON::Object RetObj;
@@ -25,20 +28,23 @@ namespace OpenWifi {
}
void RESTAPI_command::DoDelete() {
auto UUID = GetBinding(RESTAPI::Protocol::COMMANDUUID, "");
if(UUID.empty()) {
auto CommandUUID = GetBinding(RESTAPI::Protocol::COMMANDUUID, "");
if(CommandUUID.empty()) {
return BadRequest(RESTAPI::Errors::MissingUUID);
}
GWObjects::CommandDetails C;
if(!StorageService()->GetCommand(UUID, C)) {
if(!Utils::ValidUUID(CommandUUID)) {
return NotFound();
}
if (StorageService()->DeleteCommand(UUID)) {
GWObjects::CommandDetails C;
if(!StorageService()->GetCommand(CommandUUID, C)) {
return NotFound();
}
if (StorageService()->DeleteCommand(CommandUUID)) {
return OK();
}
return InternalError();
return InternalError(RESTAPI::Errors::NoRecordsDeleted);
}
}

View File

@@ -21,7 +21,7 @@ class RESTAPI_command : public RESTAPIHandler {
Server,
TransactionId,
Internal) {}
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/command/{commandUUID}"};}
static auto PathName() { return std::list<std::string>{"/api/v1/command/{commandUUID}"};}
void DoGet() final;
void DoDelete() final;
void DoPost() final {};

View File

@@ -8,8 +8,7 @@
#include "RESTAPI_commands.h"
#include "StorageService.h"
#include "framework/RESTAPI_errors.h"
#include "framework/RESTAPI_protocol.h"
#include "framework/ow_constants.h"
namespace OpenWifi {
void RESTAPI_commands::DoGet() {
@@ -41,6 +40,6 @@ namespace OpenWifi {
if (StorageService()->DeleteCommands(SerialNumber, QB_.StartDate, QB_.EndDate)) {
return OK();
}
InternalError();
InternalError(RESTAPI::Errors::NoRecordsDeleted);
}
}

View File

@@ -21,7 +21,7 @@ namespace OpenWifi {
Server,
TransactionId,
Internal) {}
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/commands"};}
static auto PathName() { return std::list<std::string>{"/api/v1/commands"};}
void DoGet() final;
void DoDelete() final;
void DoPost() final {};

View File

@@ -12,8 +12,7 @@
#include "RESTObjects/RESTAPI_GWobjects.h"
#include "StorageService.h"
#include "framework/RESTAPI_errors.h"
#include "framework/RESTAPI_protocol.h"
#include "framework/ow_constants.h"
#include "framework/ConfigurationValidator.h"
namespace OpenWifi {
@@ -48,17 +47,17 @@ namespace OpenWifi {
}
if(StorageService()->DefaultConfigurationAlreadyExists(Name)) {
return BadRequest("Configuration name already exists.");
return BadRequest(RESTAPI::Errors::DefConfigNameExists);
}
auto Obj = ParseStream();
const auto &Obj = ParsedBody_;
GWObjects::DefaultConfiguration DefConfig;
if (!DefConfig.from_json(Obj)) {
return BadRequest(RESTAPI::Errors::InvalidJSONDocument);
}
if(DefConfig.Models.empty()) {
return BadRequest("modelIds cannot be empty");
return BadRequest(RESTAPI::Errors::ModelIDListCannotBeEmpty);
}
std::string Error;
@@ -66,7 +65,7 @@ namespace OpenWifi {
return BadRequest(RESTAPI::Errors::ConfigBlockInvalid);
}
DefConfig.Created = DefConfig.LastModified = std::time(nullptr);
DefConfig.Created = DefConfig.LastModified = OpenWifi::Now();
if (StorageService()->CreateDefaultConfiguration(Name, DefConfig)) {
return OK();
}
@@ -77,7 +76,7 @@ namespace OpenWifi {
void RESTAPI_default_configuration::DoPut() {
std::string Name = GetBinding(RESTAPI::Protocol::NAME, "");
auto Obj = ParseStream();
const auto &Obj = ParsedBody_;
GWObjects::DefaultConfiguration NewConfig;
if (!NewConfig.from_json(Obj)) {
return BadRequest(RESTAPI::Errors::InvalidJSONDocument);
@@ -96,7 +95,7 @@ namespace OpenWifi {
Existing.Configuration = NewConfig.Configuration;
}
Existing.LastModified = std::time(nullptr);
Existing.LastModified = OpenWifi::Now();
AssignIfPresent(Obj,"description",Existing.Description);
if(Obj->has("modelIds"))
Existing.Models = NewConfig.Models;

View File

@@ -22,7 +22,7 @@ namespace OpenWifi {
Server,
TransactionId,
Internal) {}
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/default_configuration/{name}"};}
static auto PathName() { return std::list<std::string>{"/api/v1/default_configuration/{name}"};}
void DoGet() final;
void DoDelete() final;
void DoPost() final;

View File

@@ -11,7 +11,7 @@
#include "RESTAPI_default_configurations.h"
#include "StorageService.h"
#include "framework/RESTAPI_protocol.h"
#include "framework/ow_constants.h"
namespace OpenWifi {
void RESTAPI_default_configurations::DoGet() {

View File

@@ -20,7 +20,7 @@ class RESTAPI_default_configurations : public RESTAPIHandler {
Server,
TransactionId,
Internal){};
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/default_configurations"};}
static auto PathName() { return std::list<std::string>{"/api/v1/default_configurations"};}
void DoGet() final;
void DoDelete() final {};
void DoPost() final {};

View File

@@ -14,7 +14,7 @@ namespace OpenWifi {
std::vector<std::string>{
Poco::Net::HTTPRequest::HTTP_GET, Poco::Net::HTTPRequest::HTTP_POST,
Poco::Net::HTTPRequest::HTTP_OPTIONS}, Server, TransactionId,Internal) {}
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/deviceDashboard"};}
static auto PathName() { return std::list<std::string>{"/api/v1/deviceDashboard"};}
void DoGet() final;
void DoDelete() final {};
void DoPost() final {};

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,6 @@
#pragma once
#include "framework/MicroService.h"
#include "framework/RESTAPI_protocol.h"
namespace OpenWifi {
class RESTAPI_device_commandHandler : public RESTAPIHandler {
@@ -46,8 +45,9 @@ namespace OpenWifi {
void Rtty();
void Telemetry();
void Ping();
void Script();
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/device/{serialNumber}/{command}"}; };
static auto PathName() { return std::list<std::string>{"/api/v1/device/{serialNumber}/{command}"}; };
void DoGet() final;
void DoDelete() final;
void DoPost() final;

View File

@@ -13,8 +13,7 @@
#include "StorageService.h"
#include "framework/ConfigurationValidator.h"
#include "framework/MicroService.h"
#include "framework/RESTAPI_errors.h"
#include "framework/RESTAPI_protocol.h"
#include "framework/ow_constants.h"
#include "RESTAPI_device_helper.h"
namespace OpenWifi {
@@ -91,13 +90,13 @@ namespace OpenWifi {
return BadRequest(RESTAPI::Errors::MissingSerialNumber);
}
const auto &Obj = ParsedBody_;
std::string Arg;
if(HasParameter("validateOnly",Arg) && Arg=="true") {
auto Body = ParseStream();
if(!Body->has("configuration")) {
return BadRequest("Must have 'configuration' element.");
if(!Obj->has("configuration")) {
return BadRequest(RESTAPI::Errors::MustHaveConfigElement);
}
auto Config=Body->get("configuration").toString();
auto Config=Obj->get("configuration").toString();
Poco::JSON::Object Answer;
std::string Error;
auto Res = ValidateUCentralConfiguration(Config, Error);
@@ -108,11 +107,10 @@ namespace OpenWifi {
}
if (!Utils::ValidSerialNumber(SerialNumber)) {
Logger_.warning(Poco::format("CREATE-DEVICE(%s): Illegal serial number.", SerialNumber));
Logger_.warning(fmt::format("CREATE-DEVICE({}): Illegal serial number.", SerialNumber));
return BadRequest( RESTAPI::Errors::InvalidSerialNumber);
}
auto Obj = ParseStream();
GWObjects::Device Device;
if (!Device.from_json(Obj)) {
return BadRequest(RESTAPI::Errors::InvalidJSONDocument);
@@ -127,11 +125,13 @@ namespace OpenWifi {
return BadRequest(RESTAPI::Errors::ConfigBlockInvalid);
}
for(auto &i:Device.Notes)
for(auto &i:Device.Notes) {
i.createdBy = UserInfo_.userinfo.email;
i.created = OpenWifi::Now();
}
Config::Config NewConfig(Device.Configuration);
Device.UUID = std::time(nullptr);
Device.UUID = OpenWifi::Now();
NewConfig.SetUUID(Device.UUID);
Device.Configuration = NewConfig.get();
@@ -153,7 +153,7 @@ namespace OpenWifi {
return BadRequest(RESTAPI::Errors::MissingSerialNumber);
}
auto Obj = ParseStream();
const auto &Obj = ParsedBody_;
GWObjects::Device NewDevice;
if (!NewDevice.from_json(Obj)) {
return BadRequest(RESTAPI::Errors::InvalidJSONDocument);
@@ -170,7 +170,7 @@ namespace OpenWifi {
return BadRequest(RESTAPI::Errors::ConfigBlockInvalid);
}
Config::Config NewConfig(NewDevice.Configuration);
uint64_t NewConfigUUID = std::time(nullptr);
uint64_t NewConfigUUID = OpenWifi::Now();
NewConfig.SetUUID(NewConfigUUID);
Existing.Configuration = NewConfig.get();
Existing.UUID = NewConfigUUID;
@@ -179,13 +179,16 @@ namespace OpenWifi {
AssignIfPresent(Obj, "venue", Existing.Venue);
AssignIfPresent(Obj, "owner", Existing.Owner);
AssignIfPresent(Obj, "location", Existing.Location);
AssignIfPresent(Obj, "subscriber", Existing.subscriber);
AssignIfPresent(Obj, "entity", Existing.entity);
for(auto &i:NewDevice.Notes) {
i.createdBy = UserInfo_.userinfo.email;
i.created = OpenWifi::Now();
Existing.Notes.push_back(i);
}
Existing.LastConfigurationChange = std::time(nullptr);
Existing.LastConfigurationChange = OpenWifi::Now();
if (StorageService()->UpdateDevice(Existing)) {
SetCurrentConfigurationID(SerialNumber, Existing.UUID);
Poco::JSON::Object DevObj;

View File

@@ -24,7 +24,7 @@ namespace OpenWifi {
Server,
TransactionId,
Internal) {}
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/device/{serialNumber}"}; };
static auto PathName() { return std::list<std::string>{"/api/v1/device/{serialNumber}"}; };
void DoGet() final;
void DoDelete() final;
void DoPost() final;

View File

@@ -11,14 +11,66 @@
#include "RESTAPI_devices_handler.h"
#include "StorageService.h"
#include "framework/RESTAPI_protocol.h"
#include "framework/ow_constants.h"
#include "framework/MicroService.h"
#include "RESTAPI/RESTAPI_device_helper.h"
#include "Poco/StringTokenizer.h"
namespace OpenWifi {
bool PrepareOrderBy(const std::string &OrderByList, std::string &OrderByString) {
auto items = Poco::StringTokenizer(OrderByList,",");
std::string ItemList;
Types::StringVec Fields;
StorageService()->GetDeviceDbFieldList(Fields);
std::set<std::string> FieldNames;
for(const auto &field:Fields)
FieldNames.insert(Poco::toLower(field));
for(const auto &i:items) {
auto T = Poco::StringTokenizer(i,":");
if(T.count()!=2) {
return false;
}
if(T[1]!="a" && T[1]!="d") {
return false;
}
if(!ItemList.empty())
ItemList += " , ";
auto hint = FieldNames.find(Poco::toLower(T[0]));
if(hint==FieldNames.end()) {
return false;
}
ItemList += T[0] + (T[1]=="a" ? " ASC" : " DESC");
}
if(!ItemList.empty()) {
OrderByString = " ORDER BY " + ItemList;
}
return true;
}
void RESTAPI_devices_handler::DoGet() {
if(GetBoolParameter("orderSpec")) {
Types::StringVec Fields;
StorageService()->GetDeviceDbFieldList(Fields);
std::sort(Fields.begin(),Fields.end());
Poco::JSON::Object Answer;
RESTAPI_utils::field_to_json(Answer,"list",Fields);
return ReturnObject(Answer);
}
std::string OrderBy{" ORDER BY serialNumber ASC "}, Arg;
if(HasParameter("orderBy",Arg)) {
if(!PrepareOrderBy(Arg,OrderBy)) {
return BadRequest(RESTAPI::Errors::InvalidLOrderBy);
}
}
auto serialOnly = GetBoolParameter(RESTAPI::Protocol::SERIALONLY, false);
auto deviceWithStatus = GetBoolParameter(RESTAPI::Protocol::DEVICEWITHSTATUS, false);
auto completeInfo = GetBoolParameter("completeInfo",false);
@@ -44,7 +96,7 @@ namespace OpenWifi {
}
} else {
Logger_.error(
Poco::format("DEVICE(%s): device in select cannot be found.", i));
fmt::format("DEVICE({}): device in select cannot be found.", i));
}
}
if (deviceWithStatus)
@@ -59,7 +111,7 @@ namespace OpenWifi {
}
} else if (serialOnly) {
std::vector<std::string> SerialNumbers;
StorageService()->GetDeviceSerialNumbers(QB_.Offset, QB_.Limit, SerialNumbers);
StorageService()->GetDeviceSerialNumbers(QB_.Offset, QB_.Limit, SerialNumbers, OrderBy);
Poco::JSON::Array Objects;
for (const auto &i : SerialNumbers) {
Objects.add(i);
@@ -67,7 +119,7 @@ namespace OpenWifi {
RetObj.set(RESTAPI::Protocol::SERIALNUMBERS, Objects);
} else {
std::vector<GWObjects::Device> Devices;
StorageService()->GetDevices(QB_.Offset, QB_.Limit, Devices);
StorageService()->GetDevices(QB_.Offset, QB_.Limit, Devices, OrderBy);
Poco::JSON::Array Objects;
for (const auto &i : Devices) {
Poco::JSON::Object Obj;

View File

@@ -20,7 +20,7 @@ namespace OpenWifi {
Server,
TransactionId,
Internal){};
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/devices"}; };
static auto PathName() { return std::list<std::string>{"/api/v1/devices"}; };
void DoGet() final;
void DoDelete() final {};
void DoPost() final {};

View File

@@ -12,8 +12,7 @@
#include "Poco/File.h"
#include "StorageService.h"
#include "framework/RESTAPI_errors.h"
#include "framework/RESTAPI_protocol.h"
#include "framework/ow_constants.h"
#include <fstream>
namespace OpenWifi {
@@ -21,15 +20,12 @@ namespace OpenWifi {
auto UUID = GetBinding(RESTAPI::Protocol::FILEUUID, "");
auto SerialNumber = GetParameter(RESTAPI::Protocol::SERIALNUMBER, "");
// does the file exist
Poco::File DownloadFile(FileUploader()->Path() + "/" + UUID);
std::string FileType;
if (!StorageService()->GetAttachedFile(UUID, SerialNumber, DownloadFile.path(), FileType)) {
std::string FileContent;
if (!StorageService()->GetAttachedFileContent(UUID, SerialNumber, FileContent, FileType)) {
return NotFound();
}
SendFile(DownloadFile, UUID);
DownloadFile.remove();
SendFileContent(FileContent,"pcap",UUID+".pcap");
}
void RESTAPI_file::DoDelete() {

View File

@@ -21,7 +21,7 @@ namespace OpenWifi {
Server,
TransactionId,
Internal) {}
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/file/{uuid}"};}
static auto PathName() { return std::list<std::string>{"/api/v1/file/{uuid}"};}
void DoGet() final;
void DoDelete() final;
void DoPost() final {};

View File

@@ -16,7 +16,7 @@ class RESTAPI_iptocountry_handler : public RESTAPIHandler {
Server,
TransactionId,
Internal){};
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/iptocountry"}; };
static auto PathName() { return std::list<std::string>{"/api/v1/iptocountry"}; };
void DoGet() final;
void DoDelete() final {};
void DoPost() final {};

View File

@@ -14,7 +14,7 @@ namespace OpenWifi {
std::vector<std::string>{
Poco::Net::HTTPRequest::HTTP_GET,
Poco::Net::HTTPRequest::HTTP_OPTIONS}, Server, TransactionId,Internal) {}
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/ouis"};}
static auto PathName() { return std::list<std::string>{"/api/v1/ouis"};}
void DoGet() final;
void DoDelete() final {};
void DoPost() final {};

View File

@@ -0,0 +1,70 @@
//
// Created by stephane bourque on 2022-05-20.
//
#include "RESTAPI_radiusProxyConfig_handler.h"
#include "RESTObjects/RESTAPI_GWobjects.h"
#include "RADIUS_proxy_server.h"
namespace OpenWifi {
void RESTAPI_radiusProxyConfig_handler::DoGet() {
GWObjects::RadiusProxyPoolList C;
RADIUS_proxy_server()->GetConfig(C);
Poco::JSON::Object Answer;
C.to_json(Answer);
return ReturnObject(Answer);
}
void RESTAPI_radiusProxyConfig_handler::DoDelete() {
if(!Internal_ && (UserInfo_.userinfo.userRole!=SecurityObjects::ROOT && UserInfo_.userinfo.userRole!=SecurityObjects::ADMIN)) {
return UnAuthorized(RESTAPI::Errors::ACCESS_DENIED);
}
RADIUS_proxy_server()->DeleteConfig();
return OK();
}
void RESTAPI_radiusProxyConfig_handler::DoPut() {
if(!Internal_ && (UserInfo_.userinfo.userRole!=SecurityObjects::ROOT && UserInfo_.userinfo.userRole!=SecurityObjects::ADMIN)) {
return UnAuthorized(RESTAPI::Errors::ACCESS_DENIED);
}
GWObjects::RadiusProxyPoolList C;
if(!C.from_json(ParsedBody_)) {
return BadRequest(RESTAPI::Errors::InvalidJSONDocument);
}
// Logically validate the config.
for(const auto &pool:C.pools) {
if(pool.name.empty()) {
return BadRequest(RESTAPI::Errors::PoolNameInvalid);
}
for(const auto &config:{pool.acctConfig,pool.authConfig}) {
if(config.strategy!="random" && config.strategy!="round_robin" && config.strategy!="weighted") {
return BadRequest(RESTAPI::Errors::InvalidRadiusProxyStrategy);
}
if(config.monitorMethod!="none" && config.monitorMethod!="https" && config.monitorMethod!="radius") {
return BadRequest(RESTAPI::Errors::InvalidRadiusProxyMonitorMethod);
}
if(config.servers.empty()) {
return BadRequest(RESTAPI::Errors::MustHaveAtLeastOneRadiusServer);
}
for(auto &server:config.servers) {
Poco::Net::IPAddress Addr;
if(!Poco::Net::IPAddress::tryParse(server.ip,Addr) || server.port==0) {
return BadRequest(RESTAPI::Errors::InvalidRadiusServerEntry);
}
if(config.strategy=="weighted" && server.weight==0) {
return BadRequest(RESTAPI::Errors::InvalidRadiusServerWeigth);
}
}
}
}
RADIUS_proxy_server()->SetConfig(C);
return ReturnObject(*ParsedBody_);
}
}

View File

@@ -0,0 +1,27 @@
//
// Created by stephane bourque on 2022-05-20.
//
#pragma once
#include "framework/MicroService.h"
namespace OpenWifi {
class RESTAPI_radiusProxyConfig_handler : public RESTAPIHandler {
public:
RESTAPI_radiusProxyConfig_handler(const RESTAPIHandler::BindingMap &bindings, Poco::Logger &L,
RESTAPI_GenericServer &Server, uint64_t TransactionId,
bool Internal)
: RESTAPIHandler(bindings, L,
std::vector<std::string>{Poco::Net::HTTPRequest::HTTP_GET,
Poco::Net::HTTPRequest::HTTP_DELETE,
Poco::Net::HTTPRequest::HTTP_PUT,
Poco::Net::HTTPRequest::HTTP_OPTIONS},
Server, TransactionId, Internal) {}
static auto PathName() { return std::list<std::string>{"/api/v1/radiusProxyConfig"}; }
void DoGet() final;
void DoDelete() final;
void DoPost() final{};
void DoPut() final;
};
}

View File

@@ -16,15 +16,14 @@
#include "RESTAPI/RESTAPI_devices_handler.h"
#include "RESTAPI/RESTAPI_file.h"
#include "RESTAPI/RESTAPI_ouis.h"
#include "RESTAPI/RESTAPI_capabilities_handler.h"
#include "RESTAPI/RESTAPI_telemetryWebSocket.h"
#include "RESTAPI/RESTAPI_webSocketServer.h"
#include "RESTAPI/RESTAPI_iptocountry_handler.h"
#include "RESTAPI/RESTAPI_radiusProxyConfig_handler.h"
namespace OpenWifi {
Poco::Net::HTTPRequestHandler * RESTAPI_ExtRouter(const char *Path, RESTAPIHandler::BindingMap &Bindings,
Poco::Net::HTTPRequestHandler * RESTAPI_ExtRouter(const std::string &Path, RESTAPIHandler::BindingMap &Bindings,
Poco::Logger & L, RESTAPI_GenericServer & S, uint64_t TransactionId) {
Poco::Thread::current()->setName("ExtWebServerThread_" + std::to_string(TransactionId));
@@ -44,10 +43,11 @@ namespace OpenWifi {
RESTAPI_blacklist,
RESTAPI_blacklist_list,
RESTAPI_iptocountry_handler,
RESTAPI_radiusProxyConfig_handler,
RESTAPI_capabilities_handler, RESTAPI_telemetryWebSocket>(Path,Bindings,L, S, TransactionId);
}
Poco::Net::HTTPRequestHandler * RESTAPI_IntRouter(const char *Path, RESTAPIHandler::BindingMap &Bindings,
Poco::Net::HTTPRequestHandler * RESTAPI_IntRouter(const std::string &Path, RESTAPIHandler::BindingMap &Bindings,
Poco::Logger & L, RESTAPI_GenericServer & S, uint64_t TransactionId) {
Poco::Thread::current()->setName("IntWebServerThread_" + std::to_string(TransactionId));
@@ -63,6 +63,7 @@ namespace OpenWifi {
RESTAPI_file,
RESTAPI_blacklist,
RESTAPI_iptocountry_handler,
RESTAPI_radiusProxyConfig_handler,
RESTAPI_blacklist_list>(Path,Bindings,L, S, TransactionId);
}
}

View File

@@ -11,6 +11,7 @@ namespace OpenWifi {
void RESTAPI_telemetryWebSocket::DoGet() {
// try and upgrade this session to websocket...
Poco::Thread::current()->setName(fmt::format("TELEMETRY-WS({})",UserInfo_.userinfo.email));
if (Request->find("Upgrade") != Request->end() &&
Poco::icompare((*Request)["Upgrade"], "websocket") == 0) {
try {
@@ -28,11 +29,16 @@ void RESTAPI_telemetryWebSocket::DoGet() {
auto SerialNumber = Utils::SerialNumberToInt(SNum);
if(!TelemetryStream()->IsValidEndPoint(SerialNumber,UUID)) {
Logger_.warning(Poco::format("Illegal telemetry request for S: %s, UUID: %s", SerialNumber, UUID));
Logger_.warning(fmt::format("Illegal telemetry request for S: {}, UUID: {}", SerialNumber, UUID));
Response->setStatusAndReason(Poco::Net::HTTPResponse::HTTP_BAD_REQUEST);
Response->setContentLength(0);
Response->send();
return;
}
auto WS = Poco::SharedPtr<Poco::Net::WebSocket>( new Poco::Net::WebSocket(*Request, *Response));
new TelemetryClient(UUID, SerialNumber, WS, TelemetryStream()->NextReactor(), Logger_);
auto WS = std::make_unique<Poco::Net::WebSocket>(*Request, *Response);
new TelemetryClient(UUID, SerialNumber, std::move(WS), TelemetryStream()->NextReactor(), Logger_);
} catch (const Poco::Net::WebSocketException &E) {
Logger_.log(E);
switch (E.code()) {
@@ -49,7 +55,21 @@ void RESTAPI_telemetryWebSocket::DoGet() {
}
} catch (const Poco::Exception &E) {
Logger_.log(E);
Response->setStatusAndReason(Poco::Net::HTTPResponse::HTTP_BAD_REQUEST);
Response->setContentLength(0);
Response->send();
return;
} catch (...) {
Response->setStatusAndReason(Poco::Net::HTTPResponse::HTTP_BAD_REQUEST);
Response->setContentLength(0);
Response->send();
return;
}
} else {
SetCommonHeaders(true);
Response->setStatus(Poco::Net::HTTPResponse::HTTP_METHOD_NOT_ALLOWED);
Response->send();
return;
}
}
}

View File

@@ -14,7 +14,7 @@ namespace OpenWifi {
std::vector<std::string>{ Poco::Net::HTTPRequest::HTTP_GET,
Poco::Net::HTTPRequest::HTTP_OPTIONS},
Server, TransactionId, Internal, false) {}
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/ws_telemetry"};}
static auto PathName() { return std::list<std::string>{"/api/v1/ws_telemetry"};}
void DoGet() final;
void DoDelete() final {};
void DoPost() final {};

View File

@@ -1,152 +0,0 @@
//
// Created by stephane bourque on 2021-08-12.
//
#include "Poco/Net/WebSocket.h"
#include "Poco/Net/NetException.h"
#include "Poco/Net/HTTPResponse.h"
#include "Poco/JSON/Object.h"
#include "Poco/JSON/Parser.h"
#include "Poco/JSON/Stringifier.h"
#include "RESTAPI_webSocketServer.h"
#include "SerialNumberCache.h"
#include "framework/MicroService.h"
namespace OpenWifi {
void RESTAPI_webSocketServer::DoGet() {
// try and upgrade this session to websocket...
if(Request->find("Upgrade") != Request->end() && Poco::icompare((*Request)["Upgrade"], "websocket") == 0) {
try
{
Poco::Net::WebSocket WS(*Request, *Response);
int flags;
int n;
bool Authenticated=false;
bool Done=false;
do
{
Poco::Buffer<char> IncomingFrame(0);
n = WS.receiveFrame(IncomingFrame, flags);
auto Op = flags & Poco::Net::WebSocket::FRAME_OP_BITMASK;
switch(Op) {
case Poco::Net::WebSocket::FRAME_OP_PING: {
WS.sendFrame("", 0,
(int)Poco::Net::WebSocket::FRAME_OP_PONG |
(int)Poco::Net::WebSocket::FRAME_FLAG_FIN);
}
break;
case Poco::Net::WebSocket::FRAME_OP_PONG: {
}
break;
case Poco::Net::WebSocket::FRAME_OP_TEXT: {
IncomingFrame.append(0);
if(!Authenticated) {
std::string Frame{IncomingFrame.begin()};
auto Tokens = Utils::Split(Frame,':');
bool Expired=false, Contacted = false;
if(Tokens.size()==2 && AuthClient()->IsAuthorized(Tokens[1], UserInfo_, Expired, Contacted)) {
Authenticated=true;
std::string S{"Welcome! Bienvenue! Bienvenidos!"};
WS.sendFrame(S.c_str(),S.size());
} else {
std::string S{"Invalid token. Closing connection."};
WS.sendFrame(S.c_str(),S.size());
Done=true;
}
} else {
try {
Poco::JSON::Parser P;
auto Obj = P.parse(IncomingFrame.begin())
.extract<Poco::JSON::Object::Ptr>();
std::string Answer;
if(Process(Obj, Answer)) {
if (!Answer.empty())
WS.sendFrame(Answer.c_str(), Answer.size());
else {
WS.sendFrame("{}", 2);
}
} else {
Done=true;
}
} catch (const Poco::JSON::JSONException & E) {
Logger_.log(E);
}
}
}
break;
case Poco::Net::WebSocket::FRAME_OP_CLOSE: {
Done=true;
}
break;
default:
{
}
}
}
while (!Done && (n > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE));
}
catch (const Poco::Net::WebSocketException & E)
{
Logger_.log(E);
switch (E.code())
{
case Poco::Net::WebSocket::WS_ERR_HANDSHAKE_UNSUPPORTED_VERSION:
Response->set("Sec-WebSocket-Version", Poco::Net::WebSocket::WEBSOCKET_VERSION);
// fallthrough
case Poco::Net::WebSocket::WS_ERR_NO_HANDSHAKE:
case Poco::Net::WebSocket::WS_ERR_HANDSHAKE_NO_VERSION:
case Poco::Net::WebSocket::WS_ERR_HANDSHAKE_NO_KEY:
Response->setStatusAndReason(Poco::Net::HTTPResponse::HTTP_BAD_REQUEST);
Response->setContentLength(0);
Response->send();
break;
}
}
catch (const Poco::Exception &E) {
Logger_.log(E);
}
catch (...) {
}
} else {
return BadRequest("Client does not support a websocket connection.");
}
}
bool RESTAPI_webSocketServer::Process(const Poco::JSON::Object::Ptr &O, std::string &Answer ) {
try {
if (O->has("command")) {
auto Command = O->get("command").toString();
if (Command == "serial_number_search" && O->has("serial_prefix")) {
auto Prefix = O->get("serial_prefix").toString();
uint64_t HowMany = 50;
if (O->has("howMany"))
HowMany = O->get("howMany");
Logger_.information(Poco::format("serial_number_search: %s", Prefix));
if (!Prefix.empty() && Prefix.length() < 13) {
std::vector<uint64_t> Numbers;
SerialNumberCache()->FindNumbers(Prefix, HowMany, Numbers);
Poco::JSON::Array A;
for (const auto &i : Numbers)
A.add(Utils::IntToSerialNumber(i));
Poco::JSON::Object AO;
AO.set("serialNumbers", A);
AO.set("command","serial_number_search");
std::ostringstream SS;
Poco::JSON::Stringifier::stringify(AO, SS);
Answer = SS.str();
}
}
}
return true;
} catch (const Poco::Exception &E) {
Logger_.log(E);
}
return false;
}
}

View File

@@ -1,25 +0,0 @@
//
// Created by stephane bourque on 2021-08-12.
//
#pragma once
#include "framework/MicroService.h"
namespace OpenWifi {
class RESTAPI_webSocketServer : public RESTAPIHandler {
public:
RESTAPI_webSocketServer(const RESTAPIHandler::BindingMap &bindings, Poco::Logger &L, RESTAPI_GenericServer &Server, uint64_t TransactionId, bool Internal)
: RESTAPIHandler(bindings, L,
std::vector<std::string>{ Poco::Net::HTTPRequest::HTTP_GET,
Poco::Net::HTTPRequest::HTTP_OPTIONS},
Server, TransactionId, Internal,false) {}
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/ws"};}
void DoGet() final;
void DoDelete() final {};
void DoPost() final {};
void DoPut() final {};
private:
bool Process(const Poco::JSON::Object::Ptr &O, std::string &Answer);
};
}

View File

@@ -0,0 +1,622 @@
//
// Created by stephane bourque on 2022-01-10.
//
#include "RESTAPI_AnalyticsObjects.h"
#include "RESTAPI_ProvObjects.h"
#include "framework/MicroService.h"
using OpenWifi::RESTAPI_utils::field_to_json;
using OpenWifi::RESTAPI_utils::field_from_json;
namespace OpenWifi::AnalyticsObjects {
void Report::reset() {
}
void Report::to_json([[maybe_unused]] Poco::JSON::Object &Obj) const {
}
void VenueInfo::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"id",id);
field_to_json(Obj,"name",name);
field_to_json(Obj,"description",description);
field_to_json(Obj,"retention",retention);
field_to_json(Obj,"interval",interval);
field_to_json(Obj,"monitorSubVenues",monitorSubVenues);
}
bool VenueInfo::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"id",id);
field_from_json(Obj,"name",name);
field_from_json(Obj,"description",description);
field_from_json(Obj,"retention",retention);
field_from_json(Obj,"interval",interval);
field_from_json(Obj,"monitorSubVenues",monitorSubVenues);
return true;
} catch(...) {
}
return false;
}
void BoardInfo::to_json(Poco::JSON::Object &Obj) const {
info.to_json(Obj);
field_to_json(Obj,"venueList",venueList);
}
bool BoardInfo::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
info.from_json(Obj);
field_from_json(Obj,"venueList",venueList);
return true;
} catch(...) {
}
return false;
}
void DeviceInfo::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"boardId",boardId);
field_to_json(Obj,"type",type);
field_to_json(Obj,"serialNumber",serialNumber);
field_to_json(Obj,"deviceType",deviceType);
field_to_json(Obj,"lastContact",lastContact);
field_to_json(Obj,"lastPing",lastPing);
field_to_json(Obj,"lastState",lastState);
field_to_json(Obj,"lastFirmware",lastFirmware);
field_to_json(Obj,"lastFirmwareUpdate",lastFirmwareUpdate);
field_to_json(Obj,"lastConnection",lastConnection);
field_to_json(Obj,"lastDisconnection",lastDisconnection);
field_to_json(Obj,"pings",pings);
field_to_json(Obj,"states",states);
field_to_json(Obj,"connected",connected);
field_to_json(Obj,"connectionIp",connectionIp);
field_to_json(Obj,"associations_2g",associations_2g);
field_to_json(Obj,"associations_5g",associations_5g);
field_to_json(Obj,"associations_6g",associations_6g);
field_to_json(Obj,"health",health);
field_to_json(Obj,"lastHealth",lastHealth);
field_to_json(Obj,"locale",locale);
field_to_json(Obj,"uptime",uptime);
field_to_json(Obj,"memory",memory);
}
bool DeviceInfo::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"boardId",boardId);
field_from_json(Obj,"type",type);
field_from_json(Obj,"serialNumber",serialNumber);
field_from_json(Obj,"deviceType",deviceType);
field_from_json(Obj,"lastContact",lastContact);
field_from_json(Obj,"lastPing",lastPing);
field_from_json(Obj,"lastState",lastState);
field_from_json(Obj,"lastFirmware",lastFirmware);
field_from_json(Obj,"lastFirmwareUpdate",lastFirmwareUpdate);
field_from_json(Obj,"lastConnection",lastConnection);
field_from_json(Obj,"lastDisconnection",lastDisconnection);
field_from_json(Obj,"pings",pings);
field_from_json(Obj,"states",states);
field_from_json(Obj,"connected",connected);
field_from_json(Obj,"connectionIp",connectionIp);
field_from_json(Obj,"associations_2g",associations_2g);
field_from_json(Obj,"associations_5g",associations_5g);
field_from_json(Obj,"associations_6g",associations_6g);
field_from_json(Obj,"health",health);
field_from_json(Obj,"lastHealth",lastHealth);
field_from_json(Obj,"locale",locale);
field_from_json(Obj,"uptime",uptime);
field_from_json(Obj,"memory",memory);
return true;
} catch(...) {
}
return false;
}
void DeviceInfoList::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"devices",devices);
}
bool DeviceInfoList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"devices",devices);
return true;
} catch(...) {
}
return false;
}
void UE_rate::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"bitrate",bitrate);
field_to_json(Obj,"mcs",mcs);
field_to_json(Obj,"nss",nss);
field_to_json(Obj,"ht",ht);
field_to_json(Obj,"sgi",sgi);
field_to_json(Obj,"chwidth",chwidth);
}
bool UE_rate::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"bitrate",bitrate);
field_from_json(Obj,"mcs",mcs);
field_from_json(Obj,"nss",nss);
field_from_json(Obj,"ht",ht);
field_from_json(Obj,"sgi",sgi);
field_from_json(Obj,"chwidth",chwidth);
return true;
} catch(...) {
}
return false;
}
void UETimePoint::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"station",station);
field_to_json(Obj,"rssi",rssi);
field_to_json(Obj,"tx_bytes",tx_bytes);
field_to_json(Obj,"rx_bytes",rx_bytes);
field_to_json(Obj,"tx_duration",tx_duration);
field_to_json(Obj,"rx_packets",rx_packets);
field_to_json(Obj,"tx_packets",tx_packets);
field_to_json(Obj,"tx_retries",tx_retries);
field_to_json(Obj,"tx_failed",tx_failed);
field_to_json(Obj,"connected",connected);
field_to_json(Obj,"inactive",inactive);
field_to_json(Obj,"tx_rate",tx_rate);
field_to_json(Obj,"rx_rate",rx_rate);
// field_to_json(Obj, "tidstats", tidstats);
field_to_json(Obj,"tx_bytes_bw",tx_bytes_bw);
field_to_json(Obj,"rx_bytes_bw",rx_bytes_bw);
field_to_json(Obj,"tx_packets_bw",tx_packets_bw);
field_to_json(Obj,"rx_packets_bw",rx_packets_bw);
field_to_json(Obj,"tx_failed_pct",tx_failed_pct);
field_to_json(Obj,"tx_retries_pct",tx_retries_pct);
field_to_json(Obj,"tx_duration_pct",tx_duration_pct);
field_to_json(Obj,"tx_bytes_delta",tx_bytes_delta);
field_to_json(Obj,"rx_bytes_delta",rx_bytes_delta);
field_to_json(Obj,"tx_packets_delta",tx_packets_delta);
field_to_json(Obj,"rx_packets_delta",rx_packets_delta);
field_to_json(Obj,"tx_failed_delta",tx_failed_delta);
field_to_json(Obj,"tx_retries_delta",tx_retries_delta);
field_to_json(Obj,"tx_duration_delta",tx_duration_delta);
}
bool UETimePoint::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"station",station);
field_from_json(Obj,"rssi",rssi);
field_from_json(Obj,"tx_bytes",tx_bytes);
field_from_json(Obj,"rx_bytes",rx_bytes);
field_from_json(Obj,"tx_duration",tx_duration);
field_from_json(Obj,"rx_packets",rx_packets);
field_from_json(Obj,"tx_packets",tx_packets);
field_from_json(Obj,"tx_retries",tx_retries);
field_from_json(Obj,"tx_failed",tx_failed);
field_from_json(Obj,"connected",connected);
field_from_json(Obj,"inactive",inactive);
field_from_json(Obj,"tx_rate",tx_rate);
field_from_json(Obj,"rx_rate",rx_rate);
// field_from_json(Obj,"tidstats",tidstats);
field_from_json(Obj,"tx_bytes_bw",tx_bytes_bw);
field_from_json(Obj,"rx_bytes_bw",rx_bytes_bw);
field_from_json(Obj,"tx_packets_bw",tx_packets_bw);
field_from_json(Obj,"rx_packets_bw",rx_packets_bw);
field_from_json(Obj,"tx_failed_pct",tx_failed_pct);
field_from_json(Obj,"tx_retries_pct",tx_retries_pct);
field_from_json(Obj,"tx_duration_pct",tx_duration_pct);
field_from_json(Obj,"tx_bytes_delta",tx_bytes_delta);
field_from_json(Obj,"rx_bytes_delta",rx_bytes_delta);
field_from_json(Obj,"tx_packets_delta",tx_packets_delta);
field_from_json(Obj,"rx_packets_delta",rx_packets_delta);
field_from_json(Obj,"tx_failed_delta",tx_failed_delta);
field_from_json(Obj,"tx_retries_delta",tx_retries_delta);
field_from_json(Obj,"tx_duration_delta",tx_duration_delta);
return true;
} catch(...) {
}
return false;
}
void APTimePoint::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"collisions",collisions);
field_to_json(Obj,"multicast",multicast);
field_to_json(Obj,"rx_bytes",rx_bytes);
field_to_json(Obj,"rx_dropped",rx_dropped);
field_to_json(Obj,"rx_errors",rx_errors);
field_to_json(Obj,"rx_packets",rx_packets);
field_to_json(Obj,"tx_bytes",tx_bytes);
field_to_json(Obj,"tx_packets",tx_packets);
field_to_json(Obj,"tx_dropped",tx_dropped);
field_to_json(Obj,"tx_errors",tx_errors);
field_to_json(Obj,"tx_packets",tx_packets);
field_to_json(Obj,"tx_bytes_bw",tx_bytes_bw);
field_to_json(Obj,"rx_bytes_bw",rx_bytes_bw);
field_to_json(Obj,"rx_dropped_pct",rx_dropped_pct);
field_to_json(Obj,"tx_dropped_pct",tx_dropped_pct);
field_to_json(Obj,"rx_packets_bw",rx_packets_bw);
field_to_json(Obj,"tx_packets_bw",tx_packets_bw);
field_to_json(Obj,"rx_errors_pct",rx_errors_pct);
field_to_json(Obj,"tx_errors_pct",tx_errors_pct);
field_to_json(Obj,"tx_bytes_delta",tx_bytes_delta);
field_to_json(Obj,"rx_bytes_delta",rx_bytes_delta);
field_to_json(Obj,"rx_dropped_delta",rx_dropped_delta);
field_to_json(Obj,"tx_dropped_delta",tx_dropped_delta);
field_to_json(Obj,"rx_packets_delta",rx_packets_delta);
field_to_json(Obj,"tx_packets_delta",tx_packets_delta);
field_to_json(Obj,"rx_errors_delta",rx_errors_delta);
field_to_json(Obj,"tx_errors_delta",tx_errors_delta);
}
bool APTimePoint::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"collisions",collisions);
field_from_json(Obj,"multicast",multicast);
field_from_json(Obj,"rx_bytes",rx_bytes);
field_from_json(Obj,"rx_dropped",rx_dropped);
field_from_json(Obj,"rx_errors",rx_errors);
field_from_json(Obj,"rx_packets",rx_packets);
field_from_json(Obj,"tx_bytes",tx_bytes);
field_from_json(Obj,"tx_packets",tx_packets);
field_from_json(Obj,"tx_dropped",tx_dropped);
field_from_json(Obj,"tx_errors",tx_errors);
field_from_json(Obj,"tx_packets",tx_packets);
field_from_json(Obj,"tx_bytes_bw",tx_bytes_bw);
field_from_json(Obj,"rx_bytes_bw",rx_bytes_bw);
field_from_json(Obj,"rx_dropped_pct",rx_dropped_pct);
field_from_json(Obj,"tx_dropped_pct",tx_dropped_pct);
field_from_json(Obj,"rx_packets_bw",rx_packets_bw);
field_from_json(Obj,"tx_packets_bw",tx_packets_bw);
field_from_json(Obj,"rx_errors_pct",rx_errors_pct);
field_from_json(Obj,"tx_errors_pct",tx_errors_pct);
field_from_json(Obj,"tx_bytes_delta",tx_bytes_delta);
field_from_json(Obj,"rx_bytes_delta",rx_bytes_delta);
field_from_json(Obj,"rx_dropped_delta",rx_dropped_delta);
field_from_json(Obj,"tx_dropped_delta",tx_dropped_delta);
field_from_json(Obj,"rx_packets_delta",rx_packets_delta);
field_from_json(Obj,"tx_packets_delta",tx_packets_delta);
field_from_json(Obj,"rx_errors_delta",rx_errors_delta);
field_from_json(Obj,"tx_errors_delta",tx_errors_delta);
return true;
} catch(...) {
}
return false;
}
void TIDstat_entry::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"rx_msdu",rx_msdu);
field_to_json(Obj,"tx_msdu",tx_msdu);
field_to_json(Obj,"tx_msdu_failed",tx_msdu_failed);
field_to_json(Obj,"tx_msdu_retries",tx_msdu_retries);
}
bool TIDstat_entry::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"rx_msdu",rx_msdu);
field_from_json(Obj,"tx_msdu",tx_msdu);
field_from_json(Obj,"tx_msdu_failed",tx_msdu_failed);
field_from_json(Obj,"tx_msdu_retries",tx_msdu_retries);
return true;
} catch(...) {
}
return false;
}
void RadioTimePoint::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"band",band);
field_to_json(Obj,"channel_width",channel_width);
field_to_json(Obj,"active_ms",active_ms);
field_to_json(Obj,"busy_ms",busy_ms);
field_to_json(Obj,"receive_ms",receive_ms);
field_to_json(Obj,"transmit_ms",transmit_ms);
field_to_json(Obj,"tx_power",tx_power);
field_to_json(Obj,"channel",channel);
field_to_json(Obj,"temperature",temperature);
field_to_json(Obj,"noise",noise);
field_to_json(Obj,"active_pct",active_pct);
field_to_json(Obj,"busy_pct",busy_pct);
field_to_json(Obj,"receive_pct",receive_pct);
field_to_json(Obj,"transmit_pct",transmit_pct);
}
bool RadioTimePoint::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"band",band);
field_from_json(Obj,"channel_width",channel_width);
field_from_json(Obj,"active_ms",active_ms);
field_from_json(Obj,"busy_ms",busy_ms);
field_from_json(Obj,"receive_ms",receive_ms);
field_from_json(Obj,"transmit_ms",transmit_ms);
field_from_json(Obj,"tx_power",tx_power);
field_from_json(Obj,"channel",channel);
field_from_json(Obj,"temperature",temperature);
field_from_json(Obj,"noise",noise);
field_from_json(Obj,"active_pct",active_pct);
field_from_json(Obj,"busy_pct",busy_pct);
field_from_json(Obj,"receive_pct",receive_pct);
field_from_json(Obj,"transmit_pct",transmit_pct);
return true;
} catch(...) {
}
return false;
}
void AveragePoint::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"min",min);
field_to_json(Obj,"max",max);
field_to_json(Obj,"avg",avg);
}
bool AveragePoint::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"min",min);
field_from_json(Obj,"max",max);
field_from_json(Obj,"avg",avg);
return true;
} catch(...) {
}
return false;
}
void SSIDTimePoint::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"bssid",bssid);
field_to_json(Obj,"mode",mode);
field_to_json(Obj,"ssid",ssid);
field_to_json(Obj,"band",band);
field_to_json(Obj,"channel",channel);
field_to_json(Obj,"associations",associations);
field_to_json(Obj,"tx_bytes_bw",tx_bytes_bw);
field_to_json(Obj,"rx_bytes_bw",rx_bytes_bw);
field_to_json(Obj,"tx_packets_bw",tx_packets_bw);
field_to_json(Obj,"rx_packets_bw",rx_packets_bw);
field_to_json(Obj,"tx_failed_pct",tx_failed_pct);
field_to_json(Obj,"tx_retries_pct",tx_retries_pct);
field_to_json(Obj,"tx_duration_pct",tx_duration_pct);
}
bool SSIDTimePoint::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"bssid",bssid);
field_from_json(Obj,"mode",mode);
field_from_json(Obj,"ssid",ssid);
field_from_json(Obj,"band",band);
field_from_json(Obj,"channel",channel);
field_from_json(Obj,"associations",associations);
field_from_json(Obj,"tx_bytes_bw",tx_bytes_bw);
field_from_json(Obj,"rx_bytes_bw",rx_bytes_bw);
field_from_json(Obj,"tx_packets_bw",tx_packets_bw);
field_from_json(Obj,"rx_packets_bw",rx_packets_bw);
field_from_json(Obj,"tx_failed_pct",tx_failed_pct);
field_from_json(Obj,"tx_retries_pct",tx_retries_pct);
field_from_json(Obj,"tx_duration_pct",tx_duration_pct);
return true;
} catch(...) {
}
return false;
}
void DeviceTimePoint::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"id",id);
field_to_json(Obj,"boardId",boardId);
field_to_json(Obj,"timestamp",timestamp);
field_to_json(Obj,"ap_data",ap_data);
field_to_json(Obj,"ssid_data",ssid_data);
field_to_json(Obj,"radio_data",radio_data);
field_to_json(Obj,"device_info",device_info);
field_to_json(Obj,"serialNumber",serialNumber);
}
bool DeviceTimePoint::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"id",id);
field_from_json(Obj,"boardId",boardId);
field_from_json(Obj,"timestamp",timestamp);
field_from_json(Obj,"ap_data",ap_data);
field_from_json(Obj,"ssid_data",ssid_data);
field_from_json(Obj,"radio_data",radio_data);
field_from_json(Obj,"device_info",device_info);
field_from_json(Obj,"serialNumber",serialNumber);
return true;
} catch(...) {
}
return false;
}
void DeviceTimePointAnalysis::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"noise",noise);
field_to_json(Obj,"temperature",temperature);
field_to_json(Obj,"active_pct",active_pct);
field_to_json(Obj,"busy_pct",busy_pct);
field_to_json(Obj,"receive_pct",receive_pct);
field_to_json(Obj,"transmit_pct",transmit_pct);
field_to_json(Obj,"tx_power",tx_power);
field_to_json(Obj,"tx_bytes_bw",tx_bytes_bw);
field_to_json(Obj,"rx_bytes_bw",rx_bytes_bw);
field_to_json(Obj,"rx_dropped_pct",rx_dropped_pct);
field_to_json(Obj,"tx_dropped_pct",tx_dropped_pct);
field_to_json(Obj,"rx_packets_bw",rx_packets_bw);
field_to_json(Obj,"tx_packets_bw",tx_packets_bw);
field_to_json(Obj,"rx_errors_pct",rx_errors_pct);
field_to_json(Obj,"tx_errors_pct",tx_errors_pct);
}
bool DeviceTimePointAnalysis::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"noise",noise);
field_from_json(Obj,"temperature",temperature);
field_from_json(Obj,"active_pct",active_pct);
field_from_json(Obj,"busy_pct",busy_pct);
field_from_json(Obj,"receive_pct",receive_pct);
field_from_json(Obj,"transmit_pct",transmit_pct);
field_from_json(Obj,"tx_power",tx_power);
field_from_json(Obj,"tx_bytes_bw",tx_bytes_bw);
field_from_json(Obj,"rx_bytes_bw",rx_bytes_bw);
field_from_json(Obj,"rx_dropped_pct",rx_dropped_pct);
field_from_json(Obj,"tx_dropped_pct",tx_dropped_pct);
field_from_json(Obj,"rx_packets_bw",rx_packets_bw);
field_from_json(Obj,"tx_packets_bw",tx_packets_bw);
field_from_json(Obj,"rx_errors_pct",rx_errors_pct);
field_from_json(Obj,"tx_errors_pct",tx_errors_pct);
return true;
} catch(...) {
}
return false;
}
void DeviceTimePointList::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"points",points);
field_to_json(Obj,"stats",stats);
}
bool DeviceTimePointList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"points",points);
field_from_json(Obj,"stats",stats);
return true;
} catch(...) {
}
return false;
}
void DeviceTimePointStats::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"firstPoint",firstPoint);
field_to_json(Obj,"lastPoint",lastPoint);
field_to_json(Obj,"count",count);
}
bool DeviceTimePointStats::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"firstPoint",firstPoint);
field_from_json(Obj,"lastPoint",lastPoint);
field_from_json(Obj,"count",count);
return true;
} catch(...) {
}
return false;
}
void WifiClientRate::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"bitrate",bitrate);
field_to_json(Obj,"chwidth",chwidth);
field_to_json(Obj,"mcs",mcs);
field_to_json(Obj,"nss",nss);
field_to_json(Obj,"vht",vht);
}
bool WifiClientRate::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"bitrate",bitrate);
field_from_json(Obj,"chwidth",chwidth);
field_from_json(Obj,"mcs",mcs);
field_from_json(Obj,"nss",nss);
field_from_json(Obj,"vht",vht);
return true;
} catch(...) {
}
return false;
}
void WifiClientHistory::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"timestamp",timestamp);
field_to_json(Obj,"stationId",stationId);
field_to_json(Obj,"bssId",bssId);
field_to_json(Obj,"ssid",ssid);
field_to_json(Obj,"rssi",rssi);
field_to_json(Obj,"rx_bitrate",rx_bitrate);
field_to_json(Obj,"rx_chwidth",rx_chwidth);
field_to_json(Obj,"rx_mcs",rx_mcs);
field_to_json(Obj,"rx_nss",rx_nss);
field_to_json(Obj,"rx_vht",rx_vht);
field_to_json(Obj,"tx_bitrate",tx_bitrate);
field_to_json(Obj,"tx_chwidth",tx_chwidth);
field_to_json(Obj,"tx_mcs",tx_mcs);
field_to_json(Obj,"tx_nss",tx_nss);
field_to_json(Obj,"tx_vht",tx_vht);
field_to_json(Obj,"rx_bytes",rx_bytes);
field_to_json(Obj,"tx_bytes",tx_bytes);
field_to_json(Obj,"rx_duration",rx_duration);
field_to_json(Obj,"tx_duration",tx_duration);
field_to_json(Obj,"rx_packets",rx_packets);
field_to_json(Obj,"tx_packets",tx_packets);
field_to_json(Obj,"ipv4",ipv4);
field_to_json(Obj,"ipv6",ipv6);
field_to_json(Obj,"channel_width",channel_width);
field_to_json(Obj,"noise",noise);
field_to_json(Obj,"tx_power",tx_power);
field_to_json(Obj,"channel",channel);
field_to_json(Obj,"active_ms",active_ms);
field_to_json(Obj,"busy_ms",busy_ms);
field_to_json(Obj,"receive_ms",receive_ms);
field_to_json(Obj,"mode",mode);
field_to_json(Obj,"ack_signal",ack_signal);
field_to_json(Obj,"ack_signal_avg",ack_signal_avg);
field_to_json(Obj,"connected",connected);
field_to_json(Obj,"inactive",inactive);
field_to_json(Obj,"tx_retries",tx_retries);
}
bool WifiClientHistory::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"timestamp",timestamp);
field_from_json(Obj,"stationId",stationId);
field_from_json(Obj,"bssId",bssId);
field_from_json(Obj,"ssid",ssid);
field_from_json(Obj,"rssi",rssi);
field_from_json(Obj,"rx_bitrate",rx_bitrate);
field_from_json(Obj,"rx_chwidth",rx_chwidth);
field_from_json(Obj,"rx_mcs",rx_mcs);
field_from_json(Obj,"rx_nss",rx_nss);
field_from_json(Obj,"rx_vht",rx_vht);
field_from_json(Obj,"tx_bitrate",tx_bitrate);
field_from_json(Obj,"tx_chwidth",tx_chwidth);
field_from_json(Obj,"tx_mcs",tx_mcs);
field_from_json(Obj,"tx_nss",tx_nss);
field_from_json(Obj,"tx_vht",tx_vht);
field_from_json(Obj,"rx_bytes",rx_bytes);
field_from_json(Obj,"tx_bytes",tx_bytes);
field_from_json(Obj,"rx_duration",rx_duration);
field_from_json(Obj,"tx_duration",tx_duration);
field_from_json(Obj,"rx_packets",rx_packets);
field_from_json(Obj,"tx_packets",tx_packets);
field_from_json(Obj,"ipv4",ipv4);
field_from_json(Obj,"ipv6",ipv6);
field_from_json(Obj,"channel_width",channel_width);
field_from_json(Obj,"noise",noise);
field_from_json(Obj,"tx_power",tx_power);
field_from_json(Obj,"channel",channel);
field_from_json(Obj,"active_ms",active_ms);
field_from_json(Obj,"busy_ms",busy_ms);
field_from_json(Obj,"receive_ms",receive_ms);
field_from_json(Obj,"mode",mode);
field_from_json(Obj,"ack_signal",ack_signal);
field_from_json(Obj,"ack_signal_avg",ack_signal_avg);
field_from_json(Obj,"connected",connected);
field_from_json(Obj,"inactive",inactive);
field_from_json(Obj,"tx_retries",tx_retries);
return true;
} catch(...) {
}
return false;
}
}

View File

@@ -0,0 +1,421 @@
//
// Created by stephane bourque on 2022-01-10.
//
#pragma once
#include "RESTAPI_ProvObjects.h"
#include <vector>
namespace OpenWifi {
namespace AnalyticsObjects {
struct Report {
uint64_t snapShot = 0;
void reset();
void to_json(Poco::JSON::Object &Obj) const;
};
struct VenueInfo {
OpenWifi::Types::UUID_t id;
std::string name;
std::string description;
uint64_t retention = 0;
uint64_t interval = 0;
bool monitorSubVenues = false;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct BoardInfo {
ProvObjects::ObjectInfo info;
std::vector<VenueInfo> venueList;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
inline bool operator<(const BoardInfo &bb) const {
return info.id < bb.info.id;
}
inline bool operator==(const BoardInfo &bb) const {
return info.id == bb.info.id;
}
};
struct DeviceInfo {
std::string boardId;
std::string type;
std::string serialNumber;
std::string deviceType;
uint64_t lastContact = 0 ;
uint64_t lastPing = 0;
uint64_t lastState = 0;
std::string lastFirmware;
uint64_t lastFirmwareUpdate = 0;
uint64_t lastConnection = 0;
uint64_t lastDisconnection = 0;
uint64_t pings = 0;
uint64_t states = 0;
bool connected = false;
std::string connectionIp;
uint64_t associations_2g = 0;
uint64_t associations_5g = 0;
uint64_t associations_6g = 0;
uint64_t health = 0;
uint64_t lastHealth = 0;
std::string locale;
uint64_t uptime = 0;
double memory = 0.0;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct DeviceInfoList {
std::vector<DeviceInfo> devices;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
enum wifi_band {
band_2g = 0, band_5g = 1, band_6g = 2
};
struct TIDstat_entry {
uint64_t rx_msdu = 0,
tx_msdu = 0,
tx_msdu_failed = 0,
tx_msdu_retries = 0;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct UE_rate {
uint64_t bitrate=0;
uint64_t mcs=0;
uint64_t nss=0;
bool ht=false;
bool sgi=false;
uint64_t chwidth=0;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct AveragePoint {
double min = 0.0,
max = 0.0,
avg = 0.0;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct UETimePoint {
std::string station;
int64_t rssi = 0;
uint64_t tx_bytes = 0,
rx_bytes = 0,
tx_duration = 0,
rx_packets = 0,
tx_packets = 0,
tx_retries = 0,
tx_failed = 0,
connected = 0,
inactive = 0;
double tx_bytes_bw = 0.0 ,
rx_bytes_bw = 0.0 ,
tx_packets_bw = 0.0 ,
rx_packets_bw = 0.0 ,
tx_failed_pct = 0.0 ,
tx_retries_pct = 0.0 ,
tx_duration_pct = 0.0;
uint64_t tx_bytes_delta = 0,
rx_bytes_delta = 0,
tx_duration_delta = 0,
rx_packets_delta = 0,
tx_packets_delta = 0,
tx_retries_delta = 0,
tx_failed_delta = 0;
UE_rate tx_rate,
rx_rate;
std::vector<TIDstat_entry> tidstats;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
enum SSID_MODES {
unknown = 0,
ap,
mesh,
sta,
wds_ap,
wds_sta,
wds_repeater
};
inline SSID_MODES SSID_Mode(const std::string &m) {
if (m == "ap")
return ap;
if (m == "sta")
return sta;
if (m == "mesh")
return mesh;
if (m == "wds-ap")
return wds_ap;
if (m == "wds-sta")
return wds_sta;
if (m == "wds-repeater")
return wds_repeater;
return unknown;
}
struct SSIDTimePoint {
std::string bssid,
mode,
ssid;
uint64_t band=0,
channel=0;
std::vector<UETimePoint> associations;
AveragePoint tx_bytes_bw,
rx_bytes_bw,
tx_packets_bw,
rx_packets_bw,
tx_failed_pct,
tx_retries_pct,
tx_duration_pct;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct APTimePoint {
uint64_t collisions = 0,
multicast = 0,
rx_bytes = 0,
rx_dropped = 0,
rx_errors = 0,
rx_packets = 0,
tx_bytes = 0,
tx_dropped = 0,
tx_errors = 0,
tx_packets = 0;
double tx_bytes_bw = 0.0 ,
rx_bytes_bw = 0.0 ,
rx_dropped_pct = 0.0,
tx_dropped_pct = 0.0,
rx_packets_bw = 0.0,
tx_packets_bw = 0.0,
rx_errors_pct = 0.0 ,
tx_errors_pct = 0.0;
uint64_t tx_bytes_delta = 0,
rx_bytes_delta = 0 ,
rx_dropped_delta = 0,
tx_dropped_delta = 0,
rx_packets_delta = 0,
tx_packets_delta = 0,
rx_errors_delta = 0,
tx_errors_delta = 0;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct RadioTimePoint {
uint64_t band = 0,
channel_width = 0;
uint64_t active_ms = 0,
busy_ms = 0,
receive_ms = 0,
transmit_ms = 0,
tx_power = 0,
channel = 0;
int64_t temperature = 0,
noise = 0;
double active_pct = 0.0 ,
busy_pct = 0.0,
receive_pct = 0.0,
transmit_pct = 0.0;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct DeviceTimePoint {
std::string id;
std::string boardId;
uint64_t timestamp = 0;
APTimePoint ap_data;
std::vector<SSIDTimePoint> ssid_data;
std::vector<RadioTimePoint> radio_data;
AnalyticsObjects::DeviceInfo device_info;
std::string serialNumber;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
inline bool operator<(const DeviceTimePoint &rhs) const {
if(timestamp < rhs.timestamp)
return true;
if(timestamp > rhs.timestamp)
return false;
if(device_info.serialNumber < rhs.device_info.serialNumber)
return true;
return false;
}
inline bool operator==(const DeviceTimePoint &rhs) const {
return timestamp==rhs.timestamp && device_info.serialNumber==rhs.device_info.serialNumber;
}
inline bool operator>(const DeviceTimePoint &rhs) const {
if(timestamp > rhs.timestamp)
return true;
if(timestamp < rhs.timestamp)
return false;
if(device_info.serialNumber > rhs.device_info.serialNumber)
return true;
return false;
}
};
struct DeviceTimePointAnalysis {
uint64_t timestamp;
AveragePoint noise;
AveragePoint temperature;
AveragePoint active_pct;
AveragePoint busy_pct;
AveragePoint receive_pct;
AveragePoint transmit_pct;
AveragePoint tx_power;
AveragePoint tx_bytes_bw;
AveragePoint rx_bytes_bw;
AveragePoint rx_dropped_pct;
AveragePoint tx_dropped_pct;
AveragePoint rx_packets_bw;
AveragePoint tx_packets_bw;
AveragePoint rx_errors_pct;
AveragePoint tx_errors_pct;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct DeviceTimePointList {
std::vector<DeviceTimePoint> points;
std::vector<DeviceTimePointAnalysis> stats;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct BandwidthAnalysisEntry {
uint64_t timestamp = 0;
};
struct BandwidthAnalysis {
};
struct AverageValueSigned {
int64_t peak=0, avg=0, low=0;
};
struct AverageValueUnsigned {
uint64_t peak=0, avg=0, low=0;
};
struct RadioAnalysis {
uint64_t timestamp=0;
AverageValueSigned noise, temperature;
AverageValueUnsigned active_ms,
busy_ms,
transmit_ms,
receive_ms;
};
struct DeviceTimePointStats {
uint64_t firstPoint=0;
uint64_t lastPoint=0;
uint64_t count=0;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct WifiClientRate {
uint32_t bitrate=0;
uint32_t chwidth=0;
uint16_t mcs=0;
uint16_t nss=0;
bool vht=false;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct WifiClientHistory {
uint64_t timestamp=OpenWifi::Now();
std::string stationId;
std::string bssId;
std::string ssid;
int64_t rssi=0;
uint32_t rx_bitrate=0;
uint32_t rx_chwidth=0;
uint16_t rx_mcs=0;
uint16_t rx_nss=0;
bool rx_vht=false;
uint32_t tx_bitrate=0;
uint32_t tx_chwidth=0;
uint16_t tx_mcs=0;
uint16_t tx_nss=0;
bool tx_vht=false;
uint64_t rx_bytes=0;
uint64_t tx_bytes=0;
uint64_t rx_duration=0;
uint64_t tx_duration=0;
uint64_t rx_packets=0;
uint64_t tx_packets=0;
std::string ipv4;
std::string ipv6;
uint64_t channel_width=0;
int64_t noise=0;
uint64_t tx_power=0;
uint64_t channel=0;
uint64_t active_ms=0;
uint64_t busy_ms=0;
uint64_t receive_ms=0;
std::string mode;
int64_t ack_signal=0;
int64_t ack_signal_avg=0;
uint64_t connected=0;
uint64_t inactive=0;
uint64_t tx_retries=0;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
}
}

View File

@@ -233,10 +233,10 @@ namespace OpenWifi::FMSObjects {
UnknownFirmwares_.clear();
totalSecondsOld_.clear();
numberOfDevices = 0 ;
snapshot = std::time(nullptr);
snapshot = OpenWifi::Now();
}
bool DeviceReport::from_json(const Poco::JSON::Object::Ptr &Obj) {
bool DeviceReport::from_json([[maybe_unused]] const Poco::JSON::Object::Ptr &Obj) {
try {
return true;
@@ -245,4 +245,65 @@ namespace OpenWifi::FMSObjects {
}
return false;
}
void DeviceInformation::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj, "serialNumber",serialNumber);
field_to_json(Obj, "history", history);
field_to_json(Obj, "currentFirmware", currentFirmware);
field_to_json(Obj, "currentFirmwareDate", currentFirmwareDate);
field_to_json(Obj, "latestFirmware", latestFirmware);
field_to_json(Obj, "latestFirmwareDate", latestFirmwareDate);
field_to_json(Obj, "latestFirmwareAvailable",latestFirmwareAvailable);
field_to_json(Obj, "latestFirmwareURI",latestFirmwareURI);
}
bool DeviceInformation::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj, "serialNumber",serialNumber);
field_from_json(Obj, "history", history);
field_from_json(Obj, "currentFirmware", currentFirmware);
field_from_json(Obj, "currentFirmwareDate", currentFirmwareDate);
field_from_json(Obj, "latestFirmware", latestFirmware);
field_from_json(Obj, "latestFirmwareDate", latestFirmwareDate);
field_from_json(Obj, "latestFirmwareAvailable",latestFirmwareAvailable);
field_from_json(Obj, "latestFirmwareURI",latestFirmwareURI);
return true;
} catch(...) {
}
return false;
}
void DeviceCurrentInfo::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj, "serialNumber",serialNumber);
field_to_json(Obj, "revision", revision);
field_to_json(Obj, "upgraded", upgraded);
}
bool DeviceCurrentInfo::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj, "serialNumber",serialNumber);
field_from_json(Obj, "revision", revision);
field_from_json(Obj, "upgraded", upgraded);
return true;
} catch(...) {
}
return false;
}
void DeviceCurrentInfoList::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj, "devices",devices);
}
bool DeviceCurrentInfoList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj, "devices",devices);
return true;
} catch(...) {
}
return false;
}
}

View File

@@ -4,9 +4,7 @@
#include <string>
#ifndef UCENTRALFMS_RESTAPI_FMSOBJECTS_H
#define UCENTRALFMS_RESTAPI_FMSOBJECTS_H
#pragma once
#include "RESTAPI_SecurityObjects.h"
#include "framework/OpenWifiTypes.h"
@@ -29,7 +27,7 @@ namespace OpenWifi::FMSObjects {
std::string location;
std::string uploader;
std::string digest;
bool latest=0;
bool latest=false;
SecurityObjects::NoteInfoVec notes;
uint64_t created=0;
@@ -127,7 +125,35 @@ namespace OpenWifi::FMSObjects {
void reset();
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct DeviceInformation {
std::string serialNumber;
RevisionHistoryEntryList history;
std::string currentFirmware;
uint64_t currentFirmwareDate=0;
std::string latestFirmware;
uint64_t latestFirmwareDate=0;
bool latestFirmwareAvailable;
std::string latestFirmwareURI;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct DeviceCurrentInfo {
std::string serialNumber;
std::string revision;
uint64_t upgraded=0;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct DeviceCurrentInfoList {
std::vector<DeviceCurrentInfo> devices;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
}
#endif //UCENTRALFMS_RESTAPI_FMSOBJECTS_H

View File

@@ -45,6 +45,10 @@ namespace OpenWifi::GWObjects {
field_to_json(Obj,"compatible", Compatible);
field_to_json(Obj,"fwUpdatePolicy", FWUpdatePolicy);
field_to_json(Obj,"devicePassword", DevicePassword);
field_to_json(Obj,"subscriber", subscriber);
field_to_json(Obj,"entity", entity);
field_to_json(Obj,"modified", modified);
field_to_json(Obj,"locale", locale);
}
void Device::to_json_with_status(Poco::JSON::Object &Obj) const {
@@ -69,7 +73,7 @@ namespace OpenWifi::GWObjects {
#endif
}
bool Device::from_json(Poco::JSON::Object::Ptr &Obj) {
bool Device::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"serialNumber",SerialNumber);
field_from_json(Obj,"deviceType",DeviceType);
@@ -81,6 +85,9 @@ namespace OpenWifi::GWObjects {
field_from_json(Obj,"location",Location);
field_from_json(Obj,"venue",Venue);
field_from_json(Obj,"compatible",Compatible);
field_from_json(Obj,"subscriber", subscriber);
field_from_json(Obj,"entity", entity);
field_from_json(Obj,"locale", locale);
return true;
} catch (const Poco::Exception &E) {
}
@@ -149,7 +156,7 @@ namespace OpenWifi::GWObjects {
field_to_json(Obj,"executionTime", executionTime);
}
bool DefaultConfiguration::from_json(Poco::JSON::Object::Ptr &Obj) {
bool DefaultConfiguration::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"name",Name);
field_from_json(Obj,"configuration",Configuration);
@@ -168,7 +175,7 @@ namespace OpenWifi::GWObjects {
field_to_json(Obj,"created", created);
}
bool BlackListedDevice::from_json(Poco::JSON::Object::Ptr &Obj) {
bool BlackListedDevice::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"serialNumber",serialNumber);
field_from_json(Obj,"author",author);
@@ -195,6 +202,7 @@ namespace OpenWifi::GWObjects {
field_to_json(Obj,"websocketPackets", websocketPackets);
field_to_json(Obj,"kafkaClients", kafkaClients);
field_to_json(Obj,"kafkaPackets", kafkaPackets);
field_to_json(Obj,"locale", locale);
switch(VerifiedCertificate) {
case NO_CERTIFICATE:
@@ -256,7 +264,7 @@ namespace OpenWifi::GWObjects {
lastContact.clear();
associations.clear();
numberOfDevices = 0 ;
snapshot = std::time(nullptr);
snapshot = OpenWifi::Now();
}
void CapabilitiesModel::to_json(Poco::JSON::Object &Obj) const{
@@ -264,5 +272,100 @@ namespace OpenWifi::GWObjects {
field_to_json(Obj,"capabilities", capabilities);
};
void ScriptRequest::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"serialNumber",serialNumber);
field_to_json(Obj,"timeout",timeout);
field_to_json(Obj,"type",type);
field_to_json(Obj,"script",script);
field_to_json(Obj,"scriptId",scriptId);
field_to_json(Obj,"when",when);
}
bool ScriptRequest::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"serialNumber",serialNumber);
field_from_json(Obj,"timeout",timeout);
field_from_json(Obj,"type",type);
field_from_json(Obj,"script",script);
field_from_json(Obj,"scriptId",scriptId);
field_from_json(Obj,"when",when);
return true;
} catch (const Poco::Exception &E) {
}
return false;
}
void RadiusProxyPoolList::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"pools",pools);
}
bool RadiusProxyPoolList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"pools",pools);
return true;
} catch (const Poco::Exception &E) {
}
return false;
}
void RadiusProxyPool::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"name",name);
field_to_json(Obj,"description",description);
field_to_json(Obj,"authConfig",authConfig);
field_to_json(Obj,"acctConfig",acctConfig);
}
bool RadiusProxyPool::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"name",name);
field_from_json(Obj,"description",description);
field_from_json(Obj,"authConfig",authConfig);
field_from_json(Obj,"acctConfig",acctConfig);
return true;
} catch (const Poco::Exception &E) {
}
return false;
}
void RadiusProxyServerConfig::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"policy",strategy);
field_to_json(Obj,"monitor",monitor);
field_to_json(Obj,"monitorMethod",monitorMethod);
field_to_json(Obj,"methodParameters",methodParameters);
field_to_json(Obj,"servers",servers);
}
bool RadiusProxyServerConfig::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"policy",strategy);
field_from_json(Obj,"monitor",monitor);
field_from_json(Obj,"monitorMethod",monitorMethod);
field_from_json(Obj,"methodParameters",methodParameters);
field_from_json(Obj,"servers",servers);
return true;
} catch (const Poco::Exception &E) {
}
return false;
}
void RadiusProxyServerEntry::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"name",name);
field_to_json(Obj,"ip",ip);
field_to_json(Obj,"port",port);
field_to_json(Obj,"weight",weight);
}
bool RadiusProxyServerEntry::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"name",name);
field_from_json(Obj,"ip",ip);
field_from_json(Obj,"port",port);
field_from_json(Obj,"weight",weight);
return true;
} catch (const Poco::Exception &E) {
}
return false;
}
}

View File

@@ -37,6 +37,7 @@ namespace OpenWifi::GWObjects {
uint64_t webSocketClients=0;
uint64_t kafkaPackets=0;
uint64_t websocketPackets=0;
std::string locale;
void to_json(Poco::JSON::Object &Obj) const;
};
@@ -59,9 +60,14 @@ namespace OpenWifi::GWObjects {
uint64_t LastFWUpdate = 0 ;
std::string Venue;
std::string DevicePassword;
std::string subscriber;
std::string entity;
uint64_t modified=0;
std::string locale;
void to_json(Poco::JSON::Object &Obj) const;
void to_json_with_status(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj);
bool from_json(const Poco::JSON::Object::Ptr &Obj);
void Print() const;
};
@@ -118,7 +124,7 @@ namespace OpenWifi::GWObjects {
uint64_t Created;
uint64_t LastModified;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj);
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct CommandDetails {
@@ -150,7 +156,7 @@ namespace OpenWifi::GWObjects {
std::string author;
uint64_t created;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj);
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct RttySessionDetails {
@@ -193,4 +199,53 @@ namespace OpenWifi::GWObjects {
void to_json(Poco::JSON::Object &Obj) const;
};
struct ScriptRequest {
uint64_t timeout=30;
std::string serialNumber;
std::string type;
std::string script;
std::string scriptId;
uint64_t when=0;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct RadiusProxyServerEntry {
std::string name;
std::string ip;
uint16_t port=0;
uint64_t weight=0;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct RadiusProxyServerConfig {
std::string strategy;
bool monitor=false;
std::string monitorMethod;
std::vector<std::string> methodParameters;
std::vector<RadiusProxyServerEntry> servers;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct RadiusProxyPool {
std::string name;
std::string description;
RadiusProxyServerConfig authConfig;
RadiusProxyServerConfig acctConfig;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct RadiusProxyPoolList {
std::vector<RadiusProxyPool> pools;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
}

View File

@@ -91,8 +91,13 @@ namespace OpenWifi::ProvObjects {
field_to_json( Obj,"managementPolicy",managementPolicy);
field_to_json( Obj,"deviceConfiguration",deviceConfiguration);
field_to_json( Obj,"devices",devices);
field_to_json( Obj,"rrm",rrm);
field_to_json( Obj,"deviceRules",deviceRules);
field_to_json( Obj,"sourceIP",sourceIP);
field_to_json( Obj,"variables", variables);
field_to_json( Obj,"managementPolicies", managementPolicies);
field_to_json( Obj,"managementRoles", managementRoles);
field_to_json( Obj,"maps", maps);
field_to_json( Obj,"configurations", configurations);
}
bool Entity::from_json(const Poco::JSON::Object::Ptr &Obj) {
@@ -106,8 +111,13 @@ namespace OpenWifi::ProvObjects {
field_from_json( Obj,"managementPolicy",managementPolicy);
field_from_json( Obj,"deviceConfiguration",deviceConfiguration);
field_from_json( Obj,"devices",devices);
field_from_json( Obj,"rrm",rrm);
field_from_json( Obj,"deviceRules",deviceRules);
field_from_json( Obj,"sourceIP",sourceIP);
field_from_json( Obj,"variables", variables);
field_from_json( Obj,"managementPolicies", managementPolicies);
field_from_json( Obj,"managementRoles", managementRoles);
field_from_json( Obj,"maps", maps);
field_from_json( Obj,"configurations", configurations);
return true;
} catch(...) {
@@ -142,10 +152,16 @@ namespace OpenWifi::ProvObjects {
field_to_json( Obj,"design",design);
field_to_json( Obj,"managementPolicy",managementPolicy);
field_to_json( Obj,"deviceConfiguration",deviceConfiguration);
field_to_json( Obj,"contact",contact);
field_to_json( Obj,"contacts",contacts);
field_to_json( Obj,"location",location);
field_to_json( Obj,"rrm",rrm);
field_to_json( Obj,"deviceRules",deviceRules);
field_to_json( Obj,"sourceIP",sourceIP);
field_to_json( Obj,"variables", variables);
field_to_json( Obj,"managementPolicies", managementPolicies);
field_to_json( Obj,"managementRoles", managementRoles);
field_to_json( Obj,"maps", maps);
field_to_json( Obj,"configurations", configurations);
field_to_json( Obj,"boards", boards);
}
bool Venue::from_json(const Poco::JSON::Object::Ptr &Obj) {
@@ -160,10 +176,16 @@ namespace OpenWifi::ProvObjects {
field_from_json( Obj,"design",design);
field_from_json( Obj,"managementPolicy",managementPolicy);
field_from_json( Obj,"deviceConfiguration",deviceConfiguration);
field_from_json( Obj,"contact",contact);
field_from_json( Obj,"contacts",contacts);
field_from_json( Obj,"location",location);
field_from_json( Obj,"rrm",rrm);
field_from_json( Obj,"deviceRules",deviceRules);
field_from_json( Obj,"sourceIP",sourceIP);
field_from_json( Obj,"variables", variables);
field_from_json( Obj,"managementPolicies", managementPolicies);
field_from_json( Obj,"managementRoles", managementRoles);
field_from_json( Obj,"maps", maps);
field_from_json( Obj,"configurations", configurations);
field_from_json( Obj,"boards", boards);
return true;
} catch (...) {
@@ -171,6 +193,89 @@ namespace OpenWifi::ProvObjects {
return false;
}
void Operator::to_json(Poco::JSON::Object &Obj) const {
info.to_json(Obj);
field_to_json( Obj,"managementPolicy",managementPolicy);
field_to_json( Obj,"managementRoles",managementRoles);
field_to_json( Obj,"deviceRules",deviceRules);
field_to_json( Obj,"variables",variables);
field_to_json( Obj,"defaultOperator",defaultOperator);
field_to_json( Obj,"sourceIP",sourceIP);
field_to_json( Obj,"registrationId",registrationId);
}
bool Operator::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
info.from_json(Obj);
field_from_json( Obj,"managementPolicy",managementPolicy);
field_from_json( Obj,"managementRoles",managementRoles);
field_from_json( Obj,"deviceRules",deviceRules);
field_from_json( Obj,"variables",variables);
field_from_json( Obj,"defaultOperator",defaultOperator);
field_from_json( Obj,"sourceIP",sourceIP);
field_from_json( Obj,"registrationId",registrationId);
return true;
} catch(...) {
}
return false;
}
void OperatorList::to_json(Poco::JSON::Object &Obj) const {
field_to_json( Obj,"operators",operators);
}
bool OperatorList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json( Obj,"operators",operators);
return true;
} catch(...) {
}
return false;
}
void ServiceClass::to_json(Poco::JSON::Object &Obj) const {
info.to_json(Obj);
field_to_json( Obj,"operatorId",operatorId);
field_to_json( Obj,"managementPolicy",managementPolicy);
field_to_json( Obj,"cost",cost);
field_to_json( Obj,"currency",currency);
field_to_json( Obj,"period",period);
field_to_json( Obj,"billingCode",billingCode);
field_to_json( Obj,"variables",variables);
field_to_json( Obj,"defaultService",defaultService);
}
bool ServiceClass::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
info.from_json(Obj);
field_from_json( Obj,"operatorId",operatorId);
field_from_json( Obj,"managementPolicy",managementPolicy);
field_from_json( Obj,"cost",cost);
field_from_json( Obj,"currency",currency);
field_from_json( Obj,"period",period);
field_from_json( Obj,"billingCode",billingCode);
field_from_json( Obj,"variables",variables);
field_from_json( Obj,"defaultService",defaultService);
return true;
} catch(...) {
}
return false;
}
void ServiceClassList::to_json(Poco::JSON::Object &Obj) const {
field_to_json( Obj,"serviceClasses",serviceClasses);
}
bool ServiceClassList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json( Obj,"serviceClasses",serviceClasses);
return true;
} catch(...) {
}
return false;
}
void UserInfoDigest::to_json(Poco::JSON::Object &Obj) const {
field_to_json( Obj,"id",id);
field_to_json( Obj,"entity",loginId);
@@ -193,6 +298,7 @@ namespace OpenWifi::ProvObjects {
field_to_json( Obj,"managementPolicy",managementPolicy);
field_to_json( Obj,"users",users);
field_to_json( Obj,"entity",entity);
field_to_json( Obj,"venue",venue);
}
bool ManagementRole::from_json(const Poco::JSON::Object::Ptr &Obj) {
@@ -201,6 +307,7 @@ namespace OpenWifi::ProvObjects {
field_from_json( Obj,"managementPolicy",managementPolicy);
field_from_json( Obj,"users",users);
field_from_json( Obj,"entity",entity);
field_from_json( Obj,"venue",venue);
return true;
} catch(...) {
}
@@ -249,6 +356,92 @@ namespace OpenWifi::ProvObjects {
return false;
}
void OperatorLocation::to_json(Poco::JSON::Object &Obj) const {
info.to_json(Obj);
field_to_json( Obj,"type",type);
field_to_json( Obj,"buildingName",buildingName);
field_to_json( Obj,"addressLines",addressLines);
field_to_json( Obj,"city",city);
field_to_json( Obj,"state",state);
field_to_json( Obj,"postal",postal);
field_to_json( Obj,"country",country);
field_to_json( Obj,"phones",phones);
field_to_json( Obj,"mobiles",mobiles);
field_to_json( Obj,"geoCode",geoCode);
field_to_json( Obj,"operatorId",operatorId);
field_to_json( Obj,"subscriberDeviceId",subscriberDeviceId);
field_to_json( Obj,"managementPolicy",managementPolicy);
}
bool OperatorLocation::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
info.from_json(Obj);
field_from_json( Obj,"type", type);
field_from_json( Obj,"buildingName",buildingName);
field_from_json( Obj,"addressLines",addressLines);
field_from_json( Obj,"city",city);
field_from_json( Obj,"state",state);
field_from_json( Obj,"postal",postal);
field_from_json( Obj,"country",country);
field_from_json( Obj,"phones",phones);
field_from_json( Obj,"mobiles",mobiles);
field_from_json( Obj,"geoCode",geoCode);
field_from_json( Obj,"operatorId",operatorId);
field_from_json( Obj,"subscriberDeviceId",subscriberDeviceId);
field_from_json( Obj,"managementPolicy",managementPolicy);
return true;
} catch (...) {
}
return false;
}
void SubLocation::to_json(Poco::JSON::Object &Obj) const {
field_to_json( Obj,"type",type);
field_to_json( Obj,"buildingName",buildingName);
field_to_json( Obj,"addressLines",addressLines);
field_to_json( Obj,"city",city);
field_to_json( Obj,"state",state);
field_to_json( Obj,"postal",postal);
field_to_json( Obj,"country",country);
field_to_json( Obj,"phones",phones);
field_to_json( Obj,"mobiles",mobiles);
field_to_json( Obj,"geoCode",geoCode);
}
bool SubLocation::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json( Obj,"type", type);
field_from_json( Obj,"buildingName",buildingName);
field_from_json( Obj,"addressLines",addressLines);
field_from_json( Obj,"city",city);
field_from_json( Obj,"state",state);
field_from_json( Obj,"postal",postal);
field_from_json( Obj,"country",country);
field_from_json( Obj,"phones",phones);
field_from_json( Obj,"mobiles",mobiles);
field_from_json( Obj,"geoCode",geoCode);
return true;
} catch (...) {
}
return false;
}
void OperatorLocationList::to_json(Poco::JSON::Object &Obj) const {
field_to_json( Obj, "locations", locations);
}
bool OperatorLocationList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json( Obj, "locations", locations);
return true;
} catch(...) {
}
return false;
}
void Contact::to_json(Poco::JSON::Object &Obj) const {
info.to_json(Obj);
field_to_json( Obj,"type", to_string(type));
@@ -295,21 +488,118 @@ namespace OpenWifi::ProvObjects {
return false;
}
void OperatorContact::to_json(Poco::JSON::Object &Obj) const {
info.to_json(Obj);
field_to_json( Obj,"type", type);
field_to_json( Obj,"title",title);
field_to_json( Obj,"salutation",salutation);
field_to_json( Obj,"firstname",firstname);
field_to_json( Obj,"lastname",lastname);
field_to_json( Obj,"initials",initials);
field_to_json( Obj,"visual",visual);
field_to_json( Obj,"mobiles",mobiles);
field_to_json( Obj,"phones",phones);
field_to_json( Obj,"primaryEmail",primaryEmail);
field_to_json( Obj,"secondaryEmail",secondaryEmail);
field_to_json( Obj,"accessPIN",accessPIN);
field_to_json( Obj,"operatorId",operatorId);
field_to_json( Obj,"subscriberDeviceId",subscriberDeviceId);
field_to_json( Obj,"managementPolicy",managementPolicy);
}
bool OperatorContact::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
info.from_json(Obj);
field_from_json( Obj,"type", type);
field_from_json( Obj,"title",title);
field_from_json( Obj,"salutation",salutation);
field_from_json( Obj,"firstname",firstname);
field_from_json( Obj,"lastname",lastname);
field_from_json( Obj,"initials",initials);
field_from_json( Obj,"visual",visual);
field_from_json( Obj,"mobiles",mobiles);
field_from_json( Obj,"phones",phones);
field_from_json( Obj,"primaryEmail",primaryEmail);
field_from_json( Obj,"secondaryEmail",secondaryEmail);
field_from_json( Obj,"accessPIN",accessPIN);
field_from_json( Obj,"operatorId",operatorId);
field_from_json( Obj,"subscriberDeviceId",subscriberDeviceId);
field_from_json( Obj,"managementPolicy",managementPolicy);
return true;
} catch (...) {
}
return false;
}
void SubContact::to_json(Poco::JSON::Object &Obj) const {
field_to_json( Obj,"type", type);
field_to_json( Obj,"title",title);
field_to_json( Obj,"salutation",salutation);
field_to_json( Obj,"firstname",firstname);
field_to_json( Obj,"lastname",lastname);
field_to_json( Obj,"initials",initials);
field_to_json( Obj,"visual",visual);
field_to_json( Obj,"mobiles",mobiles);
field_to_json( Obj,"phones",phones);
field_to_json( Obj,"primaryEmail",primaryEmail);
field_to_json( Obj,"secondaryEmail",secondaryEmail);
field_to_json( Obj,"accessPIN",accessPIN);
}
bool SubContact::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json( Obj,"type", type);
field_from_json( Obj,"title",title);
field_from_json( Obj,"salutation",salutation);
field_from_json( Obj,"firstname",firstname);
field_from_json( Obj,"lastname",lastname);
field_from_json( Obj,"initials",initials);
field_from_json( Obj,"visual",visual);
field_from_json( Obj,"mobiles",mobiles);
field_from_json( Obj,"phones",phones);
field_from_json( Obj,"primaryEmail",primaryEmail);
field_from_json( Obj,"secondaryEmail",secondaryEmail);
field_from_json( Obj,"accessPIN",accessPIN);
return true;
} catch (...) {
}
return false;
}
void OperatorContactList::to_json(Poco::JSON::Object &Obj) const {
field_to_json( Obj, "contacts", contacts);
}
bool OperatorContactList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json( Obj, "contacts", contacts);
return true;
} catch(...) {
}
return false;
}
void InventoryTag::to_json(Poco::JSON::Object &Obj) const {
info.to_json(Obj);
field_to_json(Obj, "serialNumber", serialNumber);
field_to_json(Obj, "venue", venue);
field_to_json(Obj, "entity", entity);
field_to_json(Obj, "subscriber", subscriber);
field_to_json(Obj, "deviceType", deviceType);
field_to_json(Obj, "qrCode", qrCode);
field_to_json(Obj, "geoCode", geoCode);
field_to_json(Obj, "location", location);
field_to_json(Obj, "contact", contact);
field_to_json( Obj,"deviceConfiguration",deviceConfiguration);
field_to_json( Obj,"rrm",rrm);
field_to_json( Obj,"managementPolicy",managementPolicy);
field_to_json( Obj,"state",state);
field_to_json( Obj, "serialNumber", serialNumber);
field_to_json( Obj, "venue", venue);
field_to_json( Obj, "entity", entity);
field_to_json( Obj, "subscriber", subscriber);
field_to_json( Obj, "deviceType", deviceType);
field_to_json( Obj, "qrCode", qrCode);
field_to_json( Obj, "geoCode", geoCode);
field_to_json( Obj, "location", location);
field_to_json( Obj, "contact", contact);
field_to_json( Obj, "deviceConfiguration",deviceConfiguration);
field_to_json( Obj,"deviceRules",deviceRules);
field_to_json( Obj, "managementPolicy",managementPolicy);
field_to_json( Obj, "state",state);
field_to_json( Obj, "devClass",devClass);
field_to_json( Obj, "locale",locale);
field_to_json( Obj, "realMacAddress",realMacAddress);
}
bool InventoryTag::from_json(const Poco::JSON::Object::Ptr &Obj) {
@@ -320,14 +610,17 @@ namespace OpenWifi::ProvObjects {
field_from_json( Obj,"entity",entity);
field_from_json( Obj,"subscriber",subscriber);
field_from_json( Obj,"deviceType",deviceType);
field_from_json(Obj, "qrCode", qrCode);
field_from_json( Obj,"qrCode", qrCode);
field_from_json( Obj,"geoCode",geoCode);
field_from_json( Obj,"location",location);
field_from_json( Obj,"contact",contact);
field_from_json( Obj,"deviceConfiguration",deviceConfiguration);
field_from_json( Obj,"rrm",rrm);
field_from_json( Obj,"deviceRules",deviceRules);
field_from_json( Obj,"managementPolicy",managementPolicy);
field_from_json( Obj,"state",state);
field_from_json( Obj,"devClass",devClass);
field_from_json( Obj,"locale",locale);
field_from_json( Obj,"realMacAddress",realMacAddress);
return true;
} catch(...) {
@@ -335,6 +628,26 @@ namespace OpenWifi::ProvObjects {
return false;
}
void InventoryConfigApplyResult::to_json(Poco::JSON::Object &Obj) const {
field_to_json( Obj, "appliedConfiguration", appliedConfiguration);
field_to_json( Obj, "warnings", warnings);
field_to_json( Obj, "errors", errors);
field_to_json( Obj, "errorCode", errorCode);
}
bool InventoryConfigApplyResult::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json( Obj, "appliedConfiguration", appliedConfiguration);
field_from_json( Obj, "warnings", warnings);
field_from_json( Obj, "errors", errors);
field_from_json( Obj, "errorCode", errorCode);
return true;
} catch (...) {
}
return false;
}
void InventoryTagList::to_json(Poco::JSON::Object &Obj) const {
field_to_json( Obj,"taglist",taglist);
}
@@ -342,7 +655,7 @@ namespace OpenWifi::ProvObjects {
bool InventoryTagList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json( Obj,"taglist",taglist);
return false;
return true;
} catch (...) {
}
@@ -373,12 +686,14 @@ namespace OpenWifi::ProvObjects {
info.to_json(Obj);
field_to_json( Obj,"managementPolicy",managementPolicy);
field_to_json( Obj,"deviceTypes",deviceTypes);
field_to_json( Obj,"subscriberOnly",subscriberOnly);
field_to_json( Obj,"entity", entity);
field_to_json( Obj,"venue", venue);
field_to_json( Obj,"subscriber", subscriber);
field_to_json( Obj,"configuration",configuration);
field_to_json( Obj,"inUse",inUse);
field_to_json( Obj,"variables",variables);
field_to_json( Obj,"rrm",rrm);
field_to_json( Obj,"firmwareUpgrade",firmwareUpgrade);
field_to_json( Obj,"firmwareRCOnly",firmwareRCOnly);
field_to_json( Obj,"deviceRules",deviceRules);
}
bool DeviceConfiguration::from_json(const Poco::JSON::Object::Ptr &Obj) {
@@ -386,12 +701,14 @@ namespace OpenWifi::ProvObjects {
info.from_json(Obj);
field_from_json( Obj,"managementPolicy",managementPolicy);
field_from_json( Obj,"deviceTypes",deviceTypes);
field_from_json( Obj,"configuration",configuration);
field_from_json( Obj,"inUse",inUse);
field_from_json( Obj,"variables",variables);
field_from_json( Obj,"rrm",rrm);
field_from_json( Obj,"firmwareUpgrade",firmwareUpgrade);
field_from_json( Obj,"firmwareRCOnly",firmwareRCOnly);
field_from_json( Obj,"subscriberOnly",subscriberOnly);
field_from_json( Obj,"entity", entity);
field_from_json( Obj,"venue", venue);
field_from_json( Obj,"subscriber", subscriber);
field_from_json( Obj,"configuration",configuration);
field_from_json( Obj,"deviceRules",deviceRules);
return true;
} catch(...) {
@@ -470,46 +787,16 @@ namespace OpenWifi::ProvObjects {
return false;
}
void field_to_json(Poco::JSON::Object &Obj, const char * FieldName, ACLACCESS A) {
switch(A) {
case READ: Obj.set(FieldName,"read"); break;
case MODIFY: Obj.set(FieldName,"modify"); break;
case CREATE: Obj.set(FieldName,"create"); break;
case DELETE: Obj.set(FieldName,"delete"); break;
case NONE:
default:
Obj.set(FieldName,"none");
}
}
void field_from_json(const Poco::JSON::Object::Ptr &Obj, const char * FieldName, ACLACCESS &A) {
if(Obj->has(FieldName)) {
auto V = Obj->getValue<std::string>(FieldName);
if(V=="read")
A = READ;
else if(V=="modify")
A = MODIFY;
else if(V=="create")
A = CREATE;
else if(V=="delete")
A = DELETE;
else if(V=="none")
A = NONE;
else
throw Poco::Exception("invalid JSON");
}
}
void ObjectACL::to_json(Poco::JSON::Object &Obj) const {
RESTAPI_utils::field_to_json(Obj, "users", users);
RESTAPI_utils::field_to_json(Obj, "roles", roles);
field_to_json(Obj, "users", users);
field_to_json(Obj, "roles", roles);
field_to_json(Obj, "access", access);
}
bool ObjectACL::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
RESTAPI_utils::field_from_json(Obj, "users", users);
RESTAPI_utils::field_from_json(Obj, "roles", roles);
field_from_json(Obj, "users", users);
field_from_json(Obj, "roles", roles);
field_from_json(Obj, "access", access);
return true;
} catch(...) {
@@ -519,12 +806,12 @@ namespace OpenWifi::ProvObjects {
}
void ObjectACLList::to_json(Poco::JSON::Object &Obj) const {
RESTAPI_utils::field_to_json(Obj, "list", list);
field_to_json(Obj, "list", list);
}
bool ObjectACLList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
RESTAPI_utils::field_from_json(Obj, "list", list);
field_from_json(Obj, "list", list);
return true;
} catch(...) {
@@ -532,44 +819,15 @@ namespace OpenWifi::ProvObjects {
return false;
}
std::string to_string(VISIBILITY A) {
switch(A) {
case PUBLIC: return "public";
case SELECT: return "select";
case PRIVATE:
default:
return "private";
}
}
void field_to_json(Poco::JSON::Object &Obj, const char * FieldName, VISIBILITY A) {
Obj.set(FieldName,to_string(A));
}
VISIBILITY visibility_from_string(const std::string &V) {
if(V=="public")
return PUBLIC;
else if(V=="select")
return SELECT;
else if(V=="private")
return PRIVATE;
throw Poco::Exception("invalid json");
}
void field_from_json(const Poco::JSON::Object::Ptr &Obj, const char * FieldName, VISIBILITY &A) {
if(Obj->has(FieldName)) {
auto V = Obj->getValue<std::string>(FieldName);
A = visibility_from_string(V);
}
}
void Map::to_json(Poco::JSON::Object &Obj) const {
info.to_json(Obj);
RESTAPI_utils::field_to_json( Obj,"data",data);
RESTAPI_utils::field_to_json( Obj,"entity",entity);
RESTAPI_utils::field_to_json( Obj,"creator",creator);
field_to_json( Obj,"data",data);
field_to_json( Obj,"entity",entity);
field_to_json( Obj,"creator",creator);
field_to_json( Obj,"visibility",visibility);
RESTAPI_utils::field_to_json( Obj,"access",access);
field_to_json( Obj,"access",access);
field_to_json( Obj,"managementPolicy", managementPolicy);
field_to_json( Obj,"venue", venue);
}
bool Map::from_json(const Poco::JSON::Object::Ptr &Obj) {
@@ -578,8 +836,24 @@ namespace OpenWifi::ProvObjects {
RESTAPI_utils::field_from_json( Obj,"data",data);
RESTAPI_utils::field_from_json( Obj,"entity",entity);
RESTAPI_utils::field_from_json( Obj,"creator",creator);
field_from_json( Obj,"visibility",visibility);
RESTAPI_utils::field_from_json( Obj,"visibility",visibility);
RESTAPI_utils::field_from_json( Obj,"access",access);
RESTAPI_utils::field_from_json( Obj,"managementPolicy", managementPolicy);
RESTAPI_utils::field_from_json( Obj,"venue", venue);
return true;
} catch(...) {
}
return false;
}
void SerialNumberList::to_json(Poco::JSON::Object &Obj) const {
RESTAPI_utils::field_to_json( Obj,"serialNumbers",serialNumbers);
}
bool SerialNumberList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
RESTAPI_utils::field_from_json( Obj,"serialNumbers",serialNumbers);
return true;
} catch(...) {
@@ -601,8 +875,223 @@ namespace OpenWifi::ProvObjects {
return false;
}
void SignupEntry::to_json(Poco::JSON::Object &Obj) const {
info.to_json(Obj);
field_to_json( Obj,"email", email);
field_to_json( Obj,"userId", userId);
field_to_json( Obj,"macAddress", macAddress);
field_to_json( Obj,"serialNumber", serialNumber);
field_to_json( Obj,"submitted", submitted);
field_to_json( Obj,"completed", completed);
field_to_json( Obj,"status", status);
field_to_json( Obj,"error", error);
field_to_json( Obj,"statusCode", statusCode);
field_to_json( Obj,"deviceID", deviceID);
field_to_json( Obj,"registrationId",registrationId);
field_to_json( Obj,"operatorId",operatorId);
}
bool SignupEntry::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
info.from_json(Obj);
field_from_json( Obj,"email", email);
field_from_json( Obj,"userId", userId);
field_from_json( Obj,"macAddress", macAddress);
field_from_json( Obj,"serialNumber", serialNumber);
field_from_json( Obj,"submitted", submitted);
field_from_json( Obj,"completed", completed);
field_from_json( Obj,"status", status);
field_from_json( Obj,"error", error);
field_from_json( Obj,"statusCode", statusCode);
field_from_json( Obj,"deviceID", deviceID);
field_from_json( Obj,"registrationId",registrationId);
field_from_json( Obj,"operatorId",operatorId);
return true;
} catch(...) {
}
return false;
}
void Variable::to_json(Poco::JSON::Object &Obj) const {
field_to_json( Obj,"type", type);
field_to_json( Obj,"weight", weight);
field_to_json( Obj,"prefix", prefix);
field_to_json( Obj,"value", value);
}
bool Variable::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json( Obj,"type", type);
field_from_json( Obj,"weight", weight);
field_from_json( Obj,"prefix", prefix);
field_from_json( Obj,"value", value);
return true;
} catch(...) {
}
return false;
}
void VariableList::to_json(Poco::JSON::Object &Obj) const {
field_to_json( Obj,"variables", variables);
}
bool VariableList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json( Obj,"variables", variables);
return true;
} catch(...) {
}
return false;
}
void VariableBlock::to_json(Poco::JSON::Object &Obj) const {
info.to_json(Obj);
field_to_json( Obj,"variables", variables);
field_to_json( Obj,"entity", entity);
field_to_json( Obj,"venue", venue);
field_to_json( Obj,"subscriber", subscriber);
field_to_json( Obj,"inventory", inventory);
field_to_json( Obj,"configurations", configurations);
field_to_json( Obj,"managementPolicy", managementPolicy);
}
bool VariableBlock::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
info.from_json(Obj);
field_from_json( Obj,"variables", variables);
field_from_json( Obj,"entity", entity);
field_from_json( Obj,"venue", venue);
field_from_json( Obj,"subscriber", subscriber);
field_from_json( Obj,"inventory", inventory);
field_from_json( Obj,"configurations", configurations);
field_from_json( Obj,"managementPolicy", managementPolicy);
return true;
} catch(...) {
}
return false;
}
void VariableBlockList::to_json(Poco::JSON::Object &Obj) const {
field_to_json( Obj,"variableBlocks", variableBlocks);
}
bool VariableBlockList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json( Obj,"variableBlocks", variableBlocks);
return true;
} catch(...) {
}
return false;
}
void ConfigurationDetails::to_json(Poco::JSON::Object &Obj) const {
field_to_json( Obj,"configuration", configuration);
field_to_json( Obj,"rrm", rrm);
field_to_json( Obj,"firmwareRCOnly", firmwareRCOnly);
field_to_json( Obj,"firmwareUpgrade", firmwareUpgrade);
}
bool ConfigurationDetails::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json( Obj,"configuration", configuration);
field_from_json( Obj,"rrm", rrm);
field_from_json( Obj,"firmwareRCOnly", firmwareRCOnly);
field_from_json( Obj,"firmwareUpgrade", firmwareUpgrade);
return true;
} catch(...) {
}
return false;
}
void SubscriberDevice::to_json(Poco::JSON::Object &Obj) const {
info.to_json(Obj);
field_to_json( Obj,"serialNumber", serialNumber);
field_to_json( Obj,"deviceType", deviceType);
field_to_json( Obj,"operatorId", operatorId);
field_to_json( Obj,"subscriberId", subscriberId);
field_to_json( Obj,"location", location);
field_to_json( Obj,"contact", contact);
field_to_json( Obj,"managementPolicy", managementPolicy);
field_to_json( Obj,"serviceClass", serviceClass);
field_to_json( Obj,"qrCode", qrCode);
field_to_json( Obj,"geoCode", geoCode);
field_to_json( Obj,"deviceRules",deviceRules);
field_to_json( Obj,"state", state);
field_to_json( Obj,"locale", locale);
field_to_json( Obj,"billingCode", billingCode);
field_to_json( Obj,"configuration", configuration);
field_to_json( Obj,"suspended", suspended);
field_to_json( Obj,"realMacAddress", realMacAddress);
}
bool SubscriberDevice::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
info.from_json(Obj);
field_from_json( Obj,"serialNumber", serialNumber);
field_from_json( Obj,"deviceType", deviceType);
field_from_json( Obj,"operatorId", operatorId);
field_from_json( Obj,"subscriberId", subscriberId);
field_from_json( Obj,"location", location);
field_from_json( Obj,"contact", contact);
field_from_json( Obj,"managementPolicy", managementPolicy);
field_from_json( Obj,"serviceClass", serviceClass);
field_from_json( Obj,"qrCode", qrCode);
field_from_json( Obj,"geoCode", geoCode);
field_from_json( Obj,"deviceRules",deviceRules);
field_from_json( Obj,"state", state);
field_from_json( Obj,"locale", locale);
field_from_json( Obj,"billingCode", billingCode);
field_from_json( Obj,"configuration", configuration);
field_from_json( Obj,"suspended", suspended);
field_from_json( Obj,"realMacAddress", realMacAddress);
return true;
} catch(...) {
}
return false;
}
void SubscriberDeviceList::to_json(Poco::JSON::Object &Obj) const {
field_to_json( Obj,"subscriberDevices", subscriberDevices);
}
bool SubscriberDeviceList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json( Obj,"subscriberDevices", subscriberDevices);
return true;
} catch(...) {
}
return false;
}
void VenueDeviceList::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"id",id);
field_to_json(Obj,"name",name);
field_to_json(Obj,"description",description);
field_to_json(Obj,"devices",devices);
}
bool VenueDeviceList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"id",id);
field_from_json(Obj,"name",name);
field_from_json(Obj,"description",description);
field_from_json(Obj,"devices",devices);
return true;
} catch(...) {
}
return false;
}
bool UpdateObjectInfo(const Poco::JSON::Object::Ptr &O, const SecurityObjects::UserInfo &U, ObjectInfo &I) {
uint64_t Now = std::time(nullptr);
uint64_t Now = OpenWifi::Now();
if(O->has("name"))
I.name = O->get("name").toString();
@@ -623,7 +1112,7 @@ namespace OpenWifi::ProvObjects {
}
bool CreateObjectInfo(const Poco::JSON::Object::Ptr &O, const SecurityObjects::UserInfo &U, ObjectInfo &I) {
uint64_t Now = std::time(nullptr);
uint64_t Now = OpenWifi::Now();
if(O->has("name"))
I.name = O->get("name").toString();
@@ -645,5 +1134,30 @@ namespace OpenWifi::ProvObjects {
return true;
}
bool CreateObjectInfo([[maybe_unused]] const SecurityObjects::UserInfo &U, ObjectInfo &I) {
I.modified = I.created = OpenWifi::Now();
I.id = MicroService::CreateUUID();
return true;
}
void DeviceRules::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"rcOnly",rcOnly);
field_to_json(Obj,"rrm",rrm);
field_to_json(Obj,"firmwareUpgrade",firmwareUpgrade);
}
bool DeviceRules::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"rcOnly",rcOnly);
field_from_json(Obj,"rrm",rrm);
field_from_json(Obj,"firmwareUpgrade",firmwareUpgrade);
return true;
} catch(...) {
}
return false;
}
}

View File

@@ -33,6 +33,13 @@ namespace OpenWifi::ProvObjects {
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct SerialNumberList {
Types::UUIDvec_t serialNumbers;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct ManagementPolicyEntry {
Types::UUIDvec_t users;
Types::UUIDvec_t resources;
@@ -48,12 +55,22 @@ namespace OpenWifi::ProvObjects {
std::vector<ManagementPolicyEntry> entries;
Types::StringVec inUse;
Types::UUID_t entity;
Types::UUID_t venue;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
typedef std::vector<ManagementPolicy> ManagementPolicyVec;
struct DeviceRules {
std::string rcOnly{"inherit"};
std::string rrm{"inherit"};
std::string firmwareUpgrade{"inherit"};
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct Entity {
ObjectInfo info;
Types::UUID_t parent;
@@ -64,8 +81,13 @@ namespace OpenWifi::ProvObjects {
Types::UUID_t managementPolicy;
Types::UUIDvec_t deviceConfiguration;
Types::UUIDvec_t devices;
std::string rrm;
DeviceRules deviceRules;
Types::StringVec sourceIP;
Types::UUIDvec_t variables;
Types::UUIDvec_t managementPolicies;
Types::UUIDvec_t managementRoles;
Types::UUIDvec_t maps;
Types::UUIDvec_t configurations;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
@@ -92,10 +114,16 @@ namespace OpenWifi::ProvObjects {
DiGraph topology;
std::string design;
Types::UUIDvec_t deviceConfiguration;
std::string contact;
Types::UUIDvec_t contacts;
std::string location;
std::string rrm;
DeviceRules deviceRules;
Types::StringVec sourceIP;
Types::UUIDvec_t variables;
Types::UUIDvec_t configurations;
Types::UUIDvec_t maps;
Types::UUIDvec_t managementPolicies;
Types::UUIDvec_t managementRoles;
Types::UUIDvec_t boards;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
@@ -117,6 +145,7 @@ namespace OpenWifi::ProvObjects {
Types::UUIDvec_t users;
Types::StringVec inUse;
Types::UUID_t entity;
Types::UUID_t venue;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
@@ -180,6 +209,51 @@ namespace OpenWifi::ProvObjects {
};
typedef std::vector<Location> LocationVec;
struct OperatorLocation {
ObjectInfo info;
std::string type;
std::string buildingName;
Types::StringVec addressLines;
std::string city;
std::string state;
std::string postal;
std::string country;
Types::StringVec phones;
Types::StringVec mobiles;
std::string geoCode;
Types::UUID_t operatorId;
Types::UUID_t subscriberDeviceId;
Types::UUID_t managementPolicy;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
typedef std::vector<Location> LocationVec;
struct SubLocation {
std::string type;
std::string buildingName;
Types::StringVec addressLines;
std::string city;
std::string state;
std::string postal;
std::string country;
Types::StringVec phones;
Types::StringVec mobiles;
std::string geoCode;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct OperatorLocationList {
std::vector<OperatorLocation> locations;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
enum ContactType {
CT_SUBSCRIBER, CT_USER, CT_INSTALLER, CT_CSR, CT_MANAGER,
CT_BUSINESSOWNER, CT_TECHNICIAN, CT_CORPORATE, CT_UNKNOWN
@@ -243,6 +317,55 @@ namespace OpenWifi::ProvObjects {
};
typedef std::vector<Contact> ContactVec;
struct OperatorContact {
ObjectInfo info;
std::string type;
std::string title;
std::string salutation;
std::string firstname;
std::string lastname;
std::string initials;
std::string visual;
Types::StringVec mobiles;
Types::StringVec phones;
std::string primaryEmail;
std::string secondaryEmail;
std::string accessPIN;
Types::UUID_t operatorId;
Types::UUID_t subscriberDeviceId;
Types::UUID_t managementPolicy;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct SubContact {
std::string type;
std::string title;
std::string salutation;
std::string firstname;
std::string lastname;
std::string initials;
std::string visual;
Types::StringVec mobiles;
Types::StringVec phones;
std::string primaryEmail;
std::string secondaryEmail;
std::string accessPIN;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct OperatorContactList {
std::vector<OperatorContact> contacts;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
typedef std::vector<OperatorContact> OperatorContactVec;
struct DeviceConfigurationElement {
std::string name;
std::string description;
@@ -255,21 +378,24 @@ namespace OpenWifi::ProvObjects {
typedef std::vector<DeviceConfigurationElement> DeviceConfigurationElementVec;
struct DeviceConfiguration {
ObjectInfo info;
ObjectInfo info;
Types::UUID_t managementPolicy;
Types::StringVec deviceTypes;
DeviceConfigurationElementVec configuration;
Types::StringVec inUse;
Types::StringPairVec variables;
std::string rrm;
std::string firmwareUpgrade;
bool firmwareRCOnly=false;
Types::UUIDvec_t variables;
DeviceRules deviceRules;
bool subscriberOnly=false;
std::string venue;
std::string entity;
std::string subscriber;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
typedef std::vector<DeviceConfiguration> DeviceConfigurationVec;
struct InventoryTag {
ObjectInfo info;
std::string serialNumber;
@@ -282,9 +408,12 @@ namespace OpenWifi::ProvObjects {
std::string location;
std::string contact;
std::string deviceConfiguration;
std::string rrm;
DeviceRules deviceRules;
Types::UUID_t managementPolicy;
std::string state;
std::string devClass;
std::string locale;
std::string realMacAddress;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
@@ -299,6 +428,15 @@ namespace OpenWifi::ProvObjects {
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct InventoryConfigApplyResult {
std::string appliedConfiguration;
Types::StringVec errors;
Types::StringVec warnings;
uint64_t errorCode;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct Report {
uint64_t snapShot=0;
@@ -333,20 +471,20 @@ namespace OpenWifi::ProvObjects {
};
struct UuidList {
std::vector<std::string> list;
Types::UUIDvec_t list;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
enum ACLACCESS {
NONE, READ, MODIFY, CREATE, DELETE
NONE = 0, READ=1, MODIFY=2, CREATE=3, DELETE=4
};
struct ObjectACL {
UuidList users;
UuidList roles;
ACLACCESS access = NONE;
uint64_t access = (uint64_t) NONE;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
@@ -359,20 +497,15 @@ namespace OpenWifi::ProvObjects {
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
enum VISIBILITY {
PUBLIC, PRIVATE, SELECT
};
std::string to_string(VISIBILITY A);
VISIBILITY visibility_from_string(const std::string &V);
struct Map {
ObjectInfo info;
std::string data;
std::string entity;
std::string creator;
VISIBILITY visibility = PRIVATE;
std::string visibility{"private"};
ObjectACLList access;
Types::UUID_t managementPolicy;
std::string venue;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
@@ -385,6 +518,168 @@ namespace OpenWifi::ProvObjects {
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
enum SignupStatusCodes {
SignupCreated = 0 ,
SignupWaitingForEmail,
SignupWaitingForDevice,
SignupSuccess,
SignupFailure,
SignupCanceled,
SignupTimedOut
};
struct SignupEntry {
ObjectInfo info;
std::string email;
std::string userId;
std::string macAddress;
std::string serialNumber;
uint64_t submitted = 0 ;
uint64_t completed = 0 ;
std::string status;
uint64_t error=0;
uint64_t statusCode=0;
std::string deviceID;
std::string registrationId;
std::string operatorId;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct Variable {
std::string type;
uint64_t weight=0;
std::string prefix;
std::string value;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct VariableList {
std::vector<Variable> variables;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct VariableBlock {
ObjectInfo info;
std::vector<Variable> variables;
std::string entity;
std::string venue;
std::string subscriber;
std::string inventory;
Types::UUIDvec_t configurations;
Types::UUID_t managementPolicy;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct VariableBlockList {
std::vector<VariableBlock> variableBlocks;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct Operator {
ObjectInfo info;
Types::UUID_t managementPolicy;
Types::UUIDvec_t managementRoles;
DeviceRules deviceRules;
std::vector<Variable> variables;
bool defaultOperator=false;
Types::StringVec sourceIP;
std::string registrationId;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct OperatorList {
std::vector<Operator> operators;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct VenueDeviceList {
std::string id;
std::string name;
std::string description;
Types::UUIDvec_t devices;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct ServiceClass {
ObjectInfo info;
Types::UUID_t operatorId;
Types::UUID_t managementPolicy;
double cost=0.0;
std::string currency;
std::string period;
std::string billingCode;
std::vector<Variable> variables;
bool defaultService=false;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct ServiceClassList {
std::vector<ServiceClass> serviceClasses;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct ConfigurationDetails {
DeviceConfigurationElementVec configuration;
std::string rrm{"inherit"};
std::string firmwareUpgrade{"inherit"};
std::string firmwareRCOnly{"inherit"};
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct SubscriberDevice {
ObjectInfo info;
std::string serialNumber;
std::string deviceType;
Types::UUID_t operatorId;
Types::UUID_t subscriberId;
SubLocation location;
SubContact contact;
Types::UUID_t managementPolicy;
Types::UUID_t serviceClass;
std::string qrCode;
std::string geoCode;
DeviceRules deviceRules;
std::string state;
std::string locale;
std::string billingCode;
DeviceConfigurationElementVec configuration;
bool suspended=false;
std::string realMacAddress;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct SubscriberDeviceList {
std::vector<SubscriberDevice> subscriberDevices;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
bool UpdateObjectInfo(const Poco::JSON::Object::Ptr &O, const SecurityObjects::UserInfo &U, ObjectInfo &I);
bool CreateObjectInfo(const Poco::JSON::Object::Ptr &O, const SecurityObjects::UserInfo &U, ObjectInfo &I);
bool CreateObjectInfo(const SecurityObjects::UserInfo &U, ObjectInfo &I);
};

View File

@@ -95,6 +95,7 @@ namespace OpenWifi::SecurityObjects {
field_from_json(Obj, "PortalLogin", PortalLogin_);
return true;
} catch(...) {
std::cout << "Cannot parse: AclTemplate" << std::endl;
}
return false;
}
@@ -112,6 +113,8 @@ namespace OpenWifi::SecurityObjects {
field_to_json(Obj,"userMustChangePassword",userMustChangePassword);
field_to_json(Obj,"errorCode", errorCode);
Obj.set("aclTemplate",AclTemplateObj);
field_to_json(Obj,"errorCode", errorCode);
field_to_json(Obj,"lastRefresh", lastRefresh_);
}
bool WebToken::from_json(const Poco::JSON::Object::Ptr &Obj) {
@@ -128,9 +131,10 @@ namespace OpenWifi::SecurityObjects {
field_from_json(Obj, "created", created_);
field_from_json(Obj, "username", username_);
field_from_json(Obj, "userMustChangePassword",userMustChangePassword);
field_from_json(Obj,"lastRefresh", lastRefresh_);
return true;
} catch (...) {
std::cout << "Cannot parse: WebToken" << std::endl;
}
return false;
}
@@ -141,14 +145,14 @@ namespace OpenWifi::SecurityObjects {
field_to_json(Obj,"primary", primary);
}
bool MobilePhoneNumber::from_json(Poco::JSON::Object::Ptr &Obj) {
bool MobilePhoneNumber::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"number",number);
field_from_json(Obj,"verified",verified);
field_from_json(Obj,"primary",primary);
return true;
} catch (...) {
std::cout << "Cannot parse: MobilePhoneNumber" << std::endl;
}
return false;
};
@@ -158,13 +162,13 @@ namespace OpenWifi::SecurityObjects {
field_to_json(Obj,"method", method);
}
bool MfaAuthInfo::from_json(Poco::JSON::Object::Ptr &Obj) {
bool MfaAuthInfo::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"enabled",enabled);
field_from_json(Obj,"method",method);
return true;
} catch (...) {
std::cout << "Cannot parse: MfaAuthInfo" << std::endl;
}
return false;
}
@@ -175,14 +179,14 @@ namespace OpenWifi::SecurityObjects {
field_to_json(Obj, "authenticatorSecret", authenticatorSecret);
}
bool UserLoginLoginExtensions::from_json(Poco::JSON::Object::Ptr &Obj) {
bool UserLoginLoginExtensions::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"mobiles",mobiles);
field_from_json(Obj,"mfa",mfa);
field_from_json(Obj, "mobiles",mobiles);
field_from_json(Obj, "mfa",mfa);
field_from_json(Obj, "authenticatorSecret", authenticatorSecret);
return true;
} catch (...) {
std::cout << "Cannot parse: UserLoginLoginExtensions" << std::endl;
}
return false;
}
@@ -194,7 +198,7 @@ namespace OpenWifi::SecurityObjects {
field_to_json(Obj, "method", method);
}
bool MFAChallengeRequest::from_json(Poco::JSON::Object::Ptr &Obj) {
bool MFAChallengeRequest::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"uuid",uuid);
field_from_json(Obj,"question",question);
@@ -202,7 +206,7 @@ namespace OpenWifi::SecurityObjects {
field_from_json(Obj,"method",method);
return true;
} catch (...) {
std::cout << "Cannot parse: MFAChallengeRequest" << std::endl;
}
return false;
};
@@ -210,16 +214,15 @@ namespace OpenWifi::SecurityObjects {
void MFAChallengeResponse::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj, "uuid", uuid);
field_to_json(Obj, "answer", answer);
}
bool MFAChallengeResponse::from_json(Poco::JSON::Object::Ptr &Obj) {
bool MFAChallengeResponse::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"uuid",uuid);
field_from_json(Obj,"answer",answer);
return true;
} catch (...) {
std::cout << "Cannot parse: MFAChallengeResponse" << std::endl;
}
return false;
@@ -257,6 +260,7 @@ namespace OpenWifi::SecurityObjects {
field_to_json(Obj,"oauthType",oauthType);
field_to_json(Obj,"oauthUserInfo",oauthUserInfo);
field_to_json(Obj,"modified",modified);
field_to_json(Obj,"signingUp",signingUp);
};
bool UserInfo::from_json(const Poco::JSON::Object::Ptr &Obj) {
@@ -292,13 +296,28 @@ namespace OpenWifi::SecurityObjects {
field_from_json(Obj,"oauthType",oauthType);
field_from_json(Obj,"oauthUserInfo",oauthUserInfo);
field_from_json(Obj,"modified",modified);
field_from_json(Obj,"signingUp",signingUp);
return true;
} catch (const Poco::Exception &E) {
std::cout << "Cannot parse: UserInfo" << std::endl;
}
return false;
};
void UserInfoList::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"users",users);
}
bool UserInfoList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"users",users);
return true;
} catch (...) {
std::cout << "Cannot parse: InternalServiceInfo" << std::endl;
}
return false;
}
void InternalServiceInfo::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"privateURI",privateURI);
field_to_json(Obj,"publicURI",publicURI);
@@ -312,7 +331,7 @@ namespace OpenWifi::SecurityObjects {
field_from_json(Obj,"token",token);
return true;
} catch (...) {
std::cout << "Cannot parse: InternalServiceInfo" << std::endl;
}
return false;
};
@@ -330,7 +349,7 @@ namespace OpenWifi::SecurityObjects {
field_from_json(Obj, "services", services);
return true;
} catch(...) {
std::cout << "Cannot parse: InternalSystemServices" << std::endl;
}
return false;
};
@@ -352,7 +371,7 @@ namespace OpenWifi::SecurityObjects {
field_from_json(Obj, "authenticationType", authenticationType);
return true;
} catch (...) {
std::cout << "Cannot parse: SystemEndpoint" << std::endl;
}
return false;
};
@@ -366,7 +385,7 @@ namespace OpenWifi::SecurityObjects {
field_from_json(Obj, "endpoints", endpoints);
return true;
} catch (...) {
std::cout << "Cannot parse: SystemEndpointList" << std::endl;
}
return false;
}
@@ -385,7 +404,7 @@ namespace OpenWifi::SecurityObjects {
field_from_json(Obj, "userInfo", userinfo);
return true;
} catch(...) {
std::cout << "Cannot parse: UserInfoAndPolicy" << std::endl;
}
return false;
}
@@ -396,14 +415,14 @@ namespace OpenWifi::SecurityObjects {
field_to_json(Obj,"note", note);
}
bool NoteInfo::from_json(Poco::JSON::Object::Ptr &Obj) {
bool NoteInfo::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"created",created);
field_from_json(Obj,"created",created);
field_from_json(Obj,"createdBy",createdBy);
field_from_json(Obj,"note",note);
field_from_json(Obj,"note", note);
return true;
} catch(...) {
std::cout << "Cannot parse: NoteInfo" << std::endl;
}
return false;
}
@@ -414,20 +433,20 @@ namespace OpenWifi::SecurityObjects {
SecurityObjects::NoteInfoVec NIV;
NIV = RESTAPI_utils::to_object_array<SecurityObjects::NoteInfo>(Obj->get("notes").toString());
for(auto const &i:NIV) {
SecurityObjects::NoteInfo ii{.created=(uint64_t)std::time(nullptr), .createdBy=UInfo.email, .note=i.note};
SecurityObjects::NoteInfo ii{.created=(uint64_t)OpenWifi::Now(), .createdBy=UInfo.email, .note=i.note};
Notes.push_back(ii);
}
}
return true;
} catch(...) {
std::cout << "Cannot parse: MergeNotes" << std::endl;
}
return false;
}
bool MergeNotes(const NoteInfoVec & NewNotes, const UserInfo &UInfo, NoteInfoVec & ExistingNotes) {
for(auto const &i:NewNotes) {
SecurityObjects::NoteInfo ii{.created=(uint64_t)std::time(nullptr), .createdBy=UInfo.email, .note=i.note};
SecurityObjects::NoteInfo ii{.created=(uint64_t)OpenWifi::Now(), .createdBy=UInfo.email, .note=i.note};
ExistingNotes.push_back(ii);
}
return true;
@@ -438,13 +457,13 @@ namespace OpenWifi::SecurityObjects {
field_to_json<ResourceAccessType>(Obj,"access", access, ResourceAccessTypeToString);
}
bool ProfileAction::from_json(Poco::JSON::Object::Ptr &Obj) {
bool ProfileAction::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"resource",resource);
field_from_json<ResourceAccessType>(Obj,"access",access,ResourceAccessTypeFromString );
return true;
} catch(...) {
std::cout << "Cannot parse: ProfileAction" << std::endl;
}
return false;
}
@@ -458,7 +477,7 @@ namespace OpenWifi::SecurityObjects {
field_to_json(Obj,"notes", notes);
}
bool SecurityProfile::from_json(Poco::JSON::Object::Ptr &Obj) {
bool SecurityProfile::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"id",id);
field_from_json(Obj,"name",name);
@@ -468,7 +487,7 @@ namespace OpenWifi::SecurityObjects {
field_from_json(Obj,"notes",notes);
return true;
} catch(...) {
std::cout << "Cannot parse: SecurityProfile" << std::endl;
}
return false;
}
@@ -477,12 +496,12 @@ namespace OpenWifi::SecurityObjects {
field_to_json(Obj, "profiles", profiles);
}
bool SecurityProfileList::from_json(Poco::JSON::Object::Ptr &Obj) {
bool SecurityProfileList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"profiles",profiles);
return true;
} catch(...) {
std::cout << "Cannot parse: SecurityProfileList" << std::endl;
}
return false;
}
@@ -503,7 +522,7 @@ namespace OpenWifi::SecurityObjects {
field_to_json(Obj,"userAction",userAction);
}
bool ActionLink::from_json(Poco::JSON::Object::Ptr &Obj) {
bool ActionLink::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"id",id);
field_from_json(Obj,"action",action);
@@ -520,7 +539,7 @@ namespace OpenWifi::SecurityObjects {
field_from_json(Obj,"userAction",userAction);
return true;
} catch(...) {
std::cout << "Cannot parse: ActionLink" << std::endl;
}
return false;
}
@@ -531,14 +550,14 @@ namespace OpenWifi::SecurityObjects {
field_to_json(Obj,"data",data);
}
bool Preferences::from_json(Poco::JSON::Object::Ptr &Obj) {
bool Preferences::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"id",id);
field_from_json(Obj,"modified",modified);
field_from_json(Obj,"data",data);
return true;
} catch(...) {
std::cout << "Cannot parse: Preferences" << std::endl;
}
return false;
}
@@ -550,7 +569,7 @@ namespace OpenWifi::SecurityObjects {
field_to_json(Obj,"email",email);
}
bool SubMfaConfig::from_json(Poco::JSON::Object::Ptr &Obj) {
bool SubMfaConfig::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"id",id);
field_from_json(Obj,"type",type);
@@ -558,7 +577,7 @@ namespace OpenWifi::SecurityObjects {
field_from_json(Obj,"email",email);
return true;
} catch(...) {
std::cout << "Cannot parse: SubMfaConfig" << std::endl;
}
return false;
}
@@ -572,9 +591,10 @@ namespace OpenWifi::SecurityObjects {
field_to_json(Obj,"expires",expires);
field_to_json(Obj,"idleTimeout",idleTimeout);
field_to_json(Obj,"revocationDate",revocationDate);
field_to_json(Obj,"lastRefresh", lastRefresh);
}
bool Token::from_json(Poco::JSON::Object::Ptr &Obj) {
bool Token::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"token",token);
field_from_json(Obj,"refreshToken",refreshToken);
@@ -584,9 +604,10 @@ namespace OpenWifi::SecurityObjects {
field_from_json(Obj,"expires",expires);
field_from_json(Obj,"idleTimeout",idleTimeout);
field_from_json(Obj,"revocationDate",revocationDate);
field_from_json(Obj,"lastRefresh", lastRefresh);
return true;
} catch(...) {
std::cout << "Cannot parse: Token" << std::endl;
}
return false;
}

View File

@@ -15,8 +15,9 @@
#include "Poco/Data/LOBStream.h"
namespace OpenWifi {
uint64_t Now();
namespace SecurityObjects {
typedef std::string USER_ID_TYPE;
struct AclTemplate {
@@ -41,6 +42,7 @@ namespace OpenWifi {
uint64_t idle_timeout_=0;
AclTemplate acl_template_;
uint64_t created_=0;
uint64_t lastRefresh_=0;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
@@ -54,11 +56,12 @@ namespace OpenWifi {
std::string UserTypeToString(USER_ROLE U);
struct NoteInfo {
uint64_t created = std::time(nullptr);
uint64_t created=0; // = OpenWifi::Now();
std::string createdBy;
std::string note;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj);
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
typedef std::vector<NoteInfo> NoteInfoVec;
@@ -68,7 +71,7 @@ namespace OpenWifi {
bool primary = false;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj);
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct MfaAuthInfo {
@@ -76,7 +79,7 @@ namespace OpenWifi {
std::string method;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj);
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct UserLoginLoginExtensions {
@@ -85,17 +88,17 @@ namespace OpenWifi {
std::string authenticatorSecret;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj);
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct MFAChallengeRequest {
std::string uuid;
std::string question;
std::string method;
uint64_t created = std::time(nullptr);
uint64_t created = OpenWifi::Now();
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj);
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct MFAChallengeResponse {
@@ -103,7 +106,7 @@ namespace OpenWifi {
std::string answer;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj);
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct UserInfo {
@@ -138,12 +141,20 @@ namespace OpenWifi {
std::string oauthType;
std::string oauthUserInfo;
uint64_t modified;
std::string signingUp;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
typedef std::vector<UserInfo> UserInfoVec;
struct UserInfoList {
std::vector<UserInfo> users;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
// bool append_from_json(Poco::JSON::Object::Ptr Obj, const UserInfo &UInfo, NoteInfoVec & Notes);
bool MergeNotes(Poco::JSON::Object::Ptr Obj, const UserInfo &UInfo, NoteInfoVec & Notes);
bool MergeNotes(const NoteInfoVec & NewNotes, const UserInfo &UInfo, NoteInfoVec & ExistingNotes);
@@ -207,7 +218,7 @@ namespace OpenWifi {
std::string resource;
ResourceAccessType access;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj);
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
typedef std::vector<ProfileAction> ProfileActionVec;
@@ -219,21 +230,22 @@ namespace OpenWifi {
std::string role;
NoteInfoVec notes;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj);
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
typedef std::vector<SecurityProfile> SecurityProfileVec;
struct SecurityProfileList {
SecurityProfileVec profiles;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj);
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
enum LinkActions {
FORGOT_PASSWORD=1,
VERIFY_EMAIL,
SUB_FORGOT_PASSWORD,
SUB_VERIFY_EMAIL
SUB_VERIFY_EMAIL,
SUB_SIGNUP
};
struct ActionLink {
@@ -245,14 +257,14 @@ namespace OpenWifi {
std::string locale;
std::string message;
uint64_t sent=0;
uint64_t created=std::time(nullptr);
uint64_t created=OpenWifi::Now();
uint64_t expires=0;
uint64_t completed=0;
uint64_t canceled=0;
bool userAction=true;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj);
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct Preferences {
@@ -260,7 +272,7 @@ namespace OpenWifi {
uint64_t modified;
Types::StringPairVec data;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj);
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct SubMfaConfig {
@@ -270,7 +282,7 @@ namespace OpenWifi {
std::string email;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj);
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct Token {
@@ -282,9 +294,10 @@ namespace OpenWifi {
uint64_t expires=0;
uint64_t idleTimeout=0;
uint64_t revocationDate=0;
uint64_t lastRefresh=0;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj);
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct Avatar {
@@ -292,7 +305,7 @@ namespace OpenWifi {
std::string type;
uint64_t created=0;
std::string name;
Poco::Data::LOB<char> avatar;
Poco::Data::BLOB avatar;
};
struct LoginRecordInfo {

View File

@@ -280,6 +280,7 @@ namespace OpenWifi::SubObjects {
field_to_json(Obj, "ipv6", ipv6);
field_to_json(Obj, "tx", tx);
field_to_json(Obj, "rx", rx);
field_to_json(Obj, "manufacturer", manufacturer);
}
bool Association::from_json(const Poco::JSON::Object::Ptr &Obj) {
@@ -293,6 +294,7 @@ namespace OpenWifi::SubObjects {
field_from_json(Obj, "ipv6", ipv6);
field_from_json(Obj, "tx", tx);
field_from_json(Obj, "rx", rx);
field_from_json(Obj, "manufacturer", manufacturer);
return true;
} catch (...) {
}
@@ -324,6 +326,7 @@ namespace OpenWifi::SubObjects {
field_to_json(Obj, "ipv6", ipv6);
field_to_json(Obj, "tx", tx);
field_to_json(Obj, "rx", rx);
field_to_json(Obj, "manufacturer", manufacturer);
}
bool Client::from_json(const Poco::JSON::Object::Ptr &Obj) {
@@ -335,6 +338,7 @@ namespace OpenWifi::SubObjects {
field_from_json(Obj, "ipv6", ipv6);
field_from_json(Obj, "tx", tx);
field_from_json(Obj, "rx", rx);
field_from_json(Obj, "manufacturer", manufacturer);
return true;
} catch (...) {
}
@@ -433,6 +437,8 @@ namespace OpenWifi::SubObjects {
field_to_json(Obj, "rates", rates);
field_to_json(Obj, "he", he);
field_to_json(Obj, "rawInfo", rawInfo);
field_to_json(Obj, "allowDFS", allowDFS);
field_to_json(Obj, "mimo", mimo);
}
bool RadioInformation::from_json(const Poco::JSON::Object::Ptr &Obj) {
@@ -452,6 +458,8 @@ namespace OpenWifi::SubObjects {
field_from_json(Obj, "rates", rates);
field_from_json(Obj, "he", he);
field_from_json(Obj, "rawInfo", rawInfo);
field_from_json(Obj, "allowDFS", allowDFS);
field_from_json(Obj, "mimo", mimo);
return true;
} catch (...) {
}
@@ -461,6 +469,7 @@ namespace OpenWifi::SubObjects {
void AccessPoint::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj, "id", id);
field_to_json(Obj, "macAddress", macAddress);
field_to_json(Obj, "serialNumber", serialNumber);
field_to_json(Obj, "name", name);
field_to_json(Obj, "deviceType", deviceType);
field_to_json(Obj, "subscriberDevices", subscriberDevices);
@@ -473,12 +482,19 @@ namespace OpenWifi::SubObjects {
field_to_json(Obj, "radios", radios);
field_to_json(Obj, "automaticUpgrade", automaticUpgrade);
field_to_json(Obj, "configurationUUID", configurationUUID);
field_to_json(Obj, "currentFirmware", currentFirmware);
field_to_json(Obj, "currentFirmwareDate", currentFirmwareDate);
field_to_json(Obj, "latestFirmware", latestFirmware);
field_to_json(Obj, "latestFirmwareDate", latestFirmwareDate);
field_to_json(Obj, "newFirmwareAvailable", newFirmwareAvailable);
field_to_json(Obj, "latestFirmwareURI", latestFirmwareURI);
}
bool AccessPoint::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj, "id", id);
field_from_json(Obj, "macAddress", macAddress);
field_from_json(Obj, "serialNumber", serialNumber);
field_from_json(Obj, "name", name);
field_from_json(Obj, "deviceType", deviceType);
field_from_json(Obj, "subscriberDevices", subscriberDevices);
@@ -491,6 +507,12 @@ namespace OpenWifi::SubObjects {
field_from_json(Obj, "radios", radios);
field_from_json(Obj, "automaticUpgrade", automaticUpgrade);
field_from_json(Obj, "configurationUUID", configurationUUID);
field_from_json(Obj, "currentFirmware", currentFirmware);
field_from_json(Obj, "currentFirmwareDate", currentFirmwareDate);
field_from_json(Obj, "latestFirmware", latestFirmware);
field_from_json(Obj, "latestFirmwareDate", latestFirmwareDate);
field_from_json(Obj, "newFirmwareAvailable", newFirmwareAvailable);
field_from_json(Obj, "latestFirmwareURI", latestFirmwareURI);
return true;
} catch (...) {
}
@@ -544,4 +566,38 @@ namespace OpenWifi::SubObjects {
}
return false;
}
void StatsEntry::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj, "timestamp", timestamp);
field_to_json(Obj, "tx", tx);
field_to_json(Obj, "rx", rx);
}
bool StatsEntry::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj, "timestamp", timestamp);
field_from_json(Obj, "tx", tx);
field_from_json(Obj, "rx", rx);
return true;
} catch (...) {
}
return false;
}
void StatsBlock::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj, "modified", modified);
field_to_json(Obj, "external", external);
field_to_json(Obj, "internal", internal);
}
bool StatsBlock::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj, "modified", modified);
field_from_json(Obj, "external", external);
field_from_json(Obj, "internal", internal);
return true;
} catch (...) {
}
return false;
}
}

View File

@@ -24,6 +24,7 @@ namespace OpenWifi::SubObjects {
int subnetMaskV6=0;
std::string startIPV6;
std::string endIPV6;
std::string leaseTime;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
@@ -156,6 +157,7 @@ namespace OpenWifi::SubObjects {
std::string ipv6;
uint64_t tx=0;
uint64_t rx=0;
std::string manufacturer;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
@@ -178,6 +180,7 @@ namespace OpenWifi::SubObjects {
std::string ipv6;
uint64_t tx=0;
uint64_t rx=0;
std::string manufacturer;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
@@ -238,6 +241,8 @@ namespace OpenWifi::SubObjects {
uint64_t maximumClients = 64;
RadioRates rates;
RadioHE he;
bool allowDFS=false;
std::string mimo;
std::vector<std::string> rawInfo;
void to_json(Poco::JSON::Object &Obj) const;
@@ -247,6 +252,7 @@ namespace OpenWifi::SubObjects {
struct AccessPoint {
std::string id;
std::string macAddress;
std::string serialNumber;
std::string name;
std::string deviceType;
SubscriberDeviceList subscriberDevices;
@@ -259,6 +265,12 @@ namespace OpenWifi::SubObjects {
std::vector<RadioInformation> radios;
bool automaticUpgrade = true;
std::string configurationUUID;
std::string currentFirmware;
uint64_t currentFirmwareDate;
std::string latestFirmware;
uint64_t latestFirmwareDate;
bool newFirmwareAvailable;
std::string latestFirmwareURI;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
@@ -288,6 +300,23 @@ namespace OpenWifi::SubObjects {
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct StatsEntry {
uint64_t timestamp=0;
uint64_t tx=0;
uint64_t rx=0;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
struct StatsBlock {
uint64_t modified=0;
std::vector<StatsEntry> external, internal;
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
}
#endif //OWSUB_RESTAPI_SUBOBJECTS_H

View File

@@ -10,27 +10,27 @@
namespace OpenWifi {
void Archiver::onTimer(Poco::Timer &timer){
auto Now = std::time(nullptr);
void Archiver::onTimer([[maybe_unused]] Poco::Timer &timer){
auto now = OpenWifi::Now();
for(const auto &i:DBs_) {
if (!Poco::icompare(i.DBName, "healthchecks")) {
Logger().information("Archiving HealthChecks...");
StorageService()->RemoveHealthChecksRecordsOlderThan(
Now - (i.HowManyDays * 24 * 60 * 60));
now - (i.HowManyDays * 24 * 60 * 60));
} else if (!Poco::icompare(i.DBName, "statistics")) {
Logger().information("Archiving Statistics...");
StorageService()->RemoveStatisticsRecordsOlderThan(
Now - (i.HowManyDays * 24 * 60 * 60));
now - (i.HowManyDays * 24 * 60 * 60));
} else if (!Poco::icompare(i.DBName, "devicelogs")) {
Logger().information("Archiving Device Logs...");
StorageService()->RemoveDeviceLogsRecordsOlderThan(
Now - (i.HowManyDays * 24 * 60 * 60));
now - (i.HowManyDays * 24 * 60 * 60));
} else if (!Poco::icompare(i.DBName, "commandlist")) {
Logger().information("Archiving Command History...");
StorageService()->RemoveCommandListRecordsOlderThan(
Now - (i.HowManyDays * 24 * 60 * 60));
now - (i.HowManyDays * 24 * 60 * 60));
} else {
Logger().information(Poco::format("Cannot archive DB '%s'", i.DBName));
Logger().information(fmt::format("Cannot archive DB '{}'", i.DBName));
}
}
AppServiceRegistry().Set("lastStorageArchiverRun", (uint64_t) Now);
@@ -90,7 +90,7 @@ namespace OpenWifi {
int NextRun = CalculateDelta(RunAtHour_,RunAtMin_);
Logger().information(Poco::format("Next run in %d seconds.",NextRun));
Logger().information(fmt::format("Next run in {} seconds.",NextRun));
Timer_.setStartInterval( NextRun * 1000);
Timer_.setPeriodicInterval(24 * 60 * 60 * 1000); // 1 hours

View File

@@ -85,22 +85,18 @@ namespace OpenWifi {
bool CreateDefaultDevice(std::string & SerialNumber, std::string & Capabilities, std::string & Firmware, std::string &Compatible,const Poco::Net::IPAddress & IPAddress);
bool GetDevice(std::string &SerialNumber, GWObjects::Device &);
bool GetDevices(uint64_t From, uint64_t HowMany, std::vector<GWObjects::Device> &Devices);
bool GetDevices(uint64_t From, uint64_t HowMany, const std::string & Select, std::vector<GWObjects::Device> &Devices);
bool GetDevices(uint64_t From, uint64_t HowMany, std::vector<GWObjects::Device> &Devices, const std::string & orderBy="");
// bool GetDevices(uint64_t From, uint64_t HowMany, const std::string & Select, std::vector<GWObjects::Device> &Devices, const std::string & orderBy="");
bool DeleteDevice(std::string &SerialNumber);
bool UpdateDevice(GWObjects::Device &);
bool DeviceExists(std::string & SerialNumber);
bool SetOwner(std::string & SerialNumber, std::string & OwnerUUID);
bool SetLocation(std::string & SerialNumber, std::string & LocationUUID);
bool SetVenue(std::string & SerialNumber, std::string & OwnerUUID);
bool SetConnectInfo(std::string &SerialNumber, std::string &Firmware);
bool GetDeviceCount(uint64_t & Count);
bool GetDeviceSerialNumbers(uint64_t From, uint64_t HowMany, std::vector<std::string> & SerialNumbers);
bool SetDeviceCompatibility(std::string & SerialNumber, std::string & Compatible);
bool GetDevicesWithoutFirmware(std::string &DeviceType, std::string &Version, std::vector<std::string> & SerialNumbers);
bool GetDeviceSerialNumbers(uint64_t From, uint64_t HowMany, std::vector<std::string> & SerialNumbers, const std::string & orderBy="");
bool GetDeviceFWUpdatePolicy(std::string & SerialNumber, std::string & Policy);
bool SetDevicePassword(std::string & SerialNumber, std::string & Password);
bool UpdateSerialNumberCache();
void GetDeviceDbFieldList( Types::StringVec & Fields);
bool ExistingConfiguration(std::string &SerialNumber, uint64_t CurrentConfig, std::string &NewConfig, uint64_t &);
@@ -133,10 +129,12 @@ namespace OpenWifi {
bool DeleteCommand( std::string &UUID );
bool GetReadyToExecuteCommands( uint64_t Offset, uint64_t HowMany, std::vector<GWObjects::CommandDetails> & Commands );
bool CommandExecuted(std::string & UUID);
bool CommandCompleted(std::string & UUID, const Poco::JSON::Object::Ptr & ReturnVars, const std::chrono::duration<double, std::milli> & execution_time, bool FullCommand);
bool AttachFileToCommand(std::string & UUID);
bool CommandCompleted(std::string & UUID, const Poco::JSON::Object & ReturnVars, const std::chrono::duration<double, std::milli> & execution_time, bool FullCommand);
// bool AttachFileToCommand(std::string & UUID);
bool AttachFileDataToCommand(std::string & UUID, const std::stringstream &s);
bool CancelWaitFile( std::string & UUID, std::string & ErrorText );
bool GetAttachedFile(std::string & UUID, const std::string & SerialNumber, const std::string & FileName, std::string &Type);
// bool GetAttachedFile(std::string & UUID, const std::string & SerialNumber, const std::string & FileName, std::string &Type);
bool GetAttachedFileContent(std::string & UUID, const std::string & SerialNumber, std::string & FileContent, std::string &Type);
bool RemoveAttachedFile(std::string & UUID);
bool SetCommandResult(std::string & UUID, std::string & Result);
bool GetNewestCommands(std::string &SerialNumber, uint64_t HowMany, std::vector<GWObjects::CommandDetails> & Commands);

View File

@@ -16,11 +16,14 @@ namespace OpenWifi {
TelemetryClient::TelemetryClient(
std::string UUID,
uint64_t SerialNumber,
Poco::SharedPtr<Poco::Net::WebSocket> WSock,
std::unique_ptr<Poco::Net::WebSocket> WSock,
Poco::Net::SocketReactor& Reactor,
Poco::Logger &Logger):
UUID_(std::move(UUID)), SerialNumber_(SerialNumber), WS_(std::move(WSock)),Reactor_(Reactor), Logger_(Logger) {
std::cout << "Telemetry client creation" << std::endl;
UUID_(std::move(UUID)),
SerialNumber_(SerialNumber),
Reactor_(Reactor),
Logger_(Logger),
WS_(std::move(WSock)) {
try {
std::thread T([this]() { this->CompleteStartup(); });
T.detach();
@@ -36,9 +39,6 @@ namespace OpenWifi {
Socket_ = *WS_;
CId_ = Utils::FormatIPv6(Socket_.peerAddress().toString());
// auto SS = static_cast<Poco::Net::SecureStreamSocketImpl*>((WS_->impl()));
// SS->havePeerCertificate();
if (TelemetryStream()->RegisterClient(UUID_, this)) {
auto TS = Poco::Timespan(240, 0);
@@ -56,7 +56,7 @@ namespace OpenWifi {
*WS_, Poco::NObserver<TelemetryClient, Poco::Net::ErrorNotification>(
*this, &TelemetryClient::OnSocketError));
Registered_ = true;
Logger().information(Poco::format("CONNECTION(%s): completed.", CId_));
Logger().information(fmt::format("CONNECTION({}): Connection completed.", CId_));
return;
}
} catch (const Poco::Net::SSLException &E) {
@@ -69,7 +69,7 @@ namespace OpenWifi {
}
TelemetryClient::~TelemetryClient() {
Logger().information("Closing telemetry session.");
Logger().information(fmt::format("CONNECTION({}): Closing connection.", CId_));
if(Registered_ && WS_)
{
Reactor_.removeEventHandler(*WS_,
@@ -81,23 +81,18 @@ namespace OpenWifi {
Reactor_.removeEventHandler(*WS_,
Poco::NObserver<TelemetryClient,
Poco::Net::ErrorNotification>(*this,&TelemetryClient::OnSocketError));
(*WS_).close();
Socket_.shutdown();
} else {
if(WS_)
(*WS_).close();
Socket_.shutdown();
}
WS_->close();
}
bool TelemetryClient::Send(const std::string &Payload) {
std::lock_guard Guard(Mutex_);
auto BytesSent = WS_->sendFrame(Payload.c_str(),(int)Payload.size());
size_t BytesSent = WS_->sendFrame(Payload.c_str(),(int)Payload.size());
return BytesSent == Payload.size();
}
void TelemetryClient::SendTelemetryShutdown() {
Logger().information(Poco::format("TELEMETRY-SHUTDOWN(%s): Closing.",CId_));
Logger().information(fmt::format("TELEMETRY-SHUTDOWN({}): Closing.",CId_));
auto Device = DeviceRegistry()->GetDeviceConnection(SerialNumber_);
if(Device) {
if(Device->WSConn_)
@@ -107,19 +102,19 @@ namespace OpenWifi {
delete this;
}
void TelemetryClient::OnSocketShutdown(const Poco::AutoPtr<Poco::Net::ShutdownNotification>& pNf) {
void TelemetryClient::OnSocketShutdown([[maybe_unused]] const Poco::AutoPtr<Poco::Net::ShutdownNotification>& pNf) {
std::lock_guard Guard(Mutex_);
Logger().information(Poco::format("SOCKET-SHUTDOWN(%s): Orderly shutdown.", CId_));
Logger().information(fmt::format("SOCKET-SHUTDOWN({}): Orderly shutdown.", CId_));
SendTelemetryShutdown();
}
void TelemetryClient::OnSocketError(const Poco::AutoPtr<Poco::Net::ErrorNotification>& pNf) {
void TelemetryClient::OnSocketError([[maybe_unused]] const Poco::AutoPtr<Poco::Net::ErrorNotification>& pNf) {
std::lock_guard Guard(Mutex_);
Logger().information(Poco::format("SOCKET-ERROR(%s): Closing.",CId_));
Logger().information(fmt::format("SOCKET-ERROR({}): Closing.",CId_));
SendTelemetryShutdown();
}
void TelemetryClient::OnSocketReadable(const Poco::AutoPtr<Poco::Net::ReadableNotification>& pNf) {
void TelemetryClient::OnSocketReadable([[maybe_unused]] const Poco::AutoPtr<Poco::Net::ReadableNotification>& pNf) {
std::lock_guard Guard(Mutex_);
try
{
@@ -132,11 +127,11 @@ namespace OpenWifi {
}
catch (const std::exception & E) {
std::string W = E.what();
Logger().information(Poco::format("std::exception caught: %s. Connection terminated with %s",W,CId_));
Logger().information(fmt::format("std::exception caught: {}. Connection terminated with {}",W,CId_));
SendTelemetryShutdown();
}
catch ( ... ) {
Logger().information(Poco::format("Unknown exception for %s. Connection terminated.",CId_));
Logger().information(fmt::format("Unknown exception for {}. Connection terminated.",CId_));
SendTelemetryShutdown();
}
}
@@ -153,16 +148,16 @@ namespace OpenWifi {
Op = flags & Poco::Net::WebSocket::FRAME_OP_BITMASK;
if (IncomingSize == 0 && flags == 0 && Op == 0) {
Logger().information(Poco::format("DISCONNECT(%s): device has disconnected.", CId_));
Logger().information(fmt::format("DISCONNECT({}): device has disconnected.", CId_));
MustDisconnect = true;
} else {
if (Op == Poco::Net::WebSocket::FRAME_OP_PING) {
Logger().debug(Poco::format("WS-PING(%s): received. PONG sent back.", CId_));
Logger().debug(fmt::format("WS-PING({}): received. PONG sent back.", CId_));
WS_->sendFrame("", 0,
(int)Poco::Net::WebSocket::FRAME_OP_PONG |
(int)Poco::Net::WebSocket::FRAME_FLAG_FIN);
} else if (Op == Poco::Net::WebSocket::FRAME_OP_CLOSE) {
Logger().information(Poco::format("DISCONNECT(%s): device wants to disconnect.", CId_));
Logger().information(fmt::format("DISCONNECT({}): device wants to disconnect.", CId_));
MustDisconnect = true ;
}
}

View File

@@ -20,7 +20,7 @@ namespace OpenWifi {
TelemetryClient(
std::string UUID,
uint64_t SerialNumber,
Poco::SharedPtr<Poco::Net::WebSocket> WSock,
std::unique_ptr<Poco::Net::WebSocket> WSock,
Poco::Net::SocketReactor& Reactor,
Poco::Logger &Logger);
~TelemetryClient();
@@ -40,7 +40,7 @@ namespace OpenWifi {
Poco::Logger &Logger_;
Poco::Net::StreamSocket Socket_;
std::string CId_;
Poco::SharedPtr<Poco::Net::WebSocket> WS_;
std::unique_ptr<Poco::Net::WebSocket> WS_;
bool Registered_=false;
void SendTelemetryShutdown();
void CompleteStartup();

View File

@@ -16,13 +16,16 @@ namespace OpenWifi {
int TelemetryStream::Start() {
Running_ = true;
Messages_->Readable_ += Poco::delegate(this,&TelemetryStream::onMessage);
ReactorPool_.Start("TelemetryWebSocketPool_");
// ReactorPool_.Start("TelemetryWebSocketPool_");
Thr_.start(Reactor_);
return 0;
}
void TelemetryStream::Stop() {
Logger().notice("Stopping reactors...");
ReactorPool_.Stop();
// ReactorPool_.Stop();
Reactor_.stop();
Thr_.join();
if(Running_) {
Running_ = false;
Messages_->Readable_ -= Poco::delegate( this, &TelemetryStream::onMessage);
@@ -129,7 +132,4 @@ namespace OpenWifi {
}
}
}
}

View File

@@ -47,7 +47,8 @@ namespace OpenWifi {
void UpdateEndPoint(uint64_t SerialNumber, const std::string &PayLoad);
bool RegisterClient(const std::string &UUID, TelemetryClient *Client);
void DeRegisterClient(const std::string &UUID);
Poco::Net::SocketReactor & NextReactor() { return ReactorPool_.NextReactor(); }
// Poco::Net::SocketReactor & NextReactor() { return ReactorPool_.NextReactor(); }
Poco::Net::SocketReactor & NextReactor() { return Reactor_; }
void onMessage(bool& b);
@@ -55,8 +56,10 @@ namespace OpenWifi {
std::atomic_bool Running_=false;
std::map<std::string, TelemetryClient *> Clients_; // uuid -> client
std::map<uint64_t, std::set<std::string>> SerialNumbers_; // serialNumber -> uuid
ReactorPool ReactorPool_;
// ReactorPool ReactorPool_;
Poco::Net::SocketReactor Reactor_;
std::unique_ptr<FIFO<QueueUpdate>> Messages_=std::make_unique<FIFO<QueueUpdate>>(100);
Poco::Thread Thr_;
TelemetryStream() noexcept:
SubSystemServer("TelemetryServer", "TELEMETRY-SVR", "openwifi.telemetry") {

File diff suppressed because it is too large Load Diff

View File

@@ -18,20 +18,25 @@
namespace OpenWifi {
class WSConnection {
static constexpr int BufSize = 64000;
static constexpr int BufSize = 128000;
public:
WSConnection(Poco::Net::StreamSocket& Socket, Poco::Net::SocketReactor& Reactor);
~WSConnection();
void ProcessJSONRPCEvent(Poco::JSON::Object::Ptr & Doc);
void ProcessJSONRPCResult(Poco::JSON::Object::Ptr & Doc);
void ProcessJSONRPCResult(Poco::JSON::Object::Ptr Doc);
void ProcessIncomingFrame();
void ProcessIncomingRadiusData(const Poco::JSON::Object::Ptr &Doc);
bool Send(const std::string &Payload);
bool SendRadiusAuthenticationData(const unsigned char * buffer, std::size_t size);
bool SendRadiusAccountingData(const unsigned char * buffer, std::size_t size);
void OnSocketReadable(const Poco::AutoPtr<Poco::Net::ReadableNotification>& pNf);
void OnSocketShutdown(const Poco::AutoPtr<Poco::Net::ShutdownNotification>& pNf);
void OnSocketError(const Poco::AutoPtr<Poco::Net::ErrorNotification>& pNf);
bool LookForUpgrade(uint64_t UUID);
static bool ExtractBase64CompressedData(const std::string & CompressedData, std::string & UnCompressedData);
bool LookForUpgrade(const uint64_t UUID, uint64_t & UpgradedUUID);
static bool ExtractBase64CompressedData(const std::string & CompressedData, std::string & UnCompressedData, uint64_t compress_sz);
void LogException(const Poco::Exception &E);
inline Poco::Logger & Logger() { return Logger_; }
bool SetWebSocketTelemetryReporting(uint64_t interval, uint64_t TelemetryWebSocketTimer);

View File

@@ -9,22 +9,37 @@
#include "Poco/Environment.h"
namespace OpenWifi {
class ReactorPool {
class ReactorThreadPool {
public:
explicit ReactorPool(unsigned int NumberOfThreads = Poco::Environment::processorCount())
: NumberOfThreads_(NumberOfThreads) {}
explicit ReactorThreadPool() {
if(Poco::Environment::processorCount()>8)
NumberOfThreads_ = Poco::Environment::processorCount()/2;
else
NumberOfThreads_ = 2;
Start("ReactorThreadPool");
}
~ ReactorThreadPool() {
Stop();
}
void Start(const std::string & ThreadNamePrefix) {
for (auto i = 0; i < NumberOfThreads_; ++i) {
for (uint64_t i = 0; i < NumberOfThreads_; ++i) {
auto NewReactor = std::make_unique<Poco::Net::SocketReactor>();
auto NewThread = std::make_unique<Poco::Thread>();
NewThread->setStackSize(2000000);
NewThread->start(*NewReactor);
NewThread->setName(ThreadNamePrefix + std::to_string(i));
NewThread->setName(ThreadNamePrefix + "#" + std::to_string(i));
Reactors_.emplace_back(std::move(NewReactor));
Threads_.emplace_back(std::move(NewThread));
}
}
inline static auto instance() {
static auto instance_ = new ReactorThreadPool;
return instance_;
}
void Stop() {
for (auto &i : Reactors_)
i->stop();
@@ -34,15 +49,18 @@ namespace OpenWifi {
}
Poco::Net::SocketReactor &NextReactor() {
std::lock_guard G(Mutex_);
NextReactor_++;
NextReactor_ %= NumberOfThreads_;
return *Reactors_[NextReactor_];
}
private:
unsigned int NumberOfThreads_;
unsigned int NextReactor_ = 0;
std::mutex Mutex_;
uint64_t NumberOfThreads_;
uint64_t NextReactor_ = 0;
std::vector<std::unique_ptr<Poco::Net::SocketReactor>> Reactors_;
std::vector<std::unique_ptr<Poco::Thread>> Threads_;
};
inline auto ReactorThreadPool() { return ReactorThreadPool::instance(); }
}

View File

@@ -17,9 +17,9 @@ namespace OpenWifi {
bool WebSocketServer::ValidateCertificate(const std::string & ConnectionId, const Poco::Crypto::X509Certificate & Certificate) {
if(IsCertOk()) {
Logger().debug(Poco::format("CERTIFICATE(%s): issuer='%s' cn='%s'", ConnectionId, Certificate.issuerName(),Certificate.commonName()));
Logger().debug(fmt::format("CERTIFICATE({}): issuer='{}' cn='{}'", ConnectionId, Certificate.issuerName(),Certificate.commonName()));
if(!Certificate.issuedBy(*IssuerCert_)) {
Logger().debug(Poco::format("CERTIFICATE(%s): issuer mismatch. Local='%s' Incoming='%s'", ConnectionId, IssuerCert_->issuerName(), Certificate.issuerName()));
Logger().debug(fmt::format("CERTIFICATE({}): issuer mismatch. Local='{}' Incoming='{}'", ConnectionId, IssuerCert_->issuerName(), Certificate.issuerName()));
return false;
}
return true;
@@ -28,10 +28,12 @@ namespace OpenWifi {
}
int WebSocketServer::Start() {
ReactorPool_.Start("DeviceReactorPool_");
// ReactorPool_.Start("DeviceReactorPool_");
for(const auto & Svr : ConfigServersList_ ) {
Logger().notice(Poco::format("Starting: %s:%s Keyfile:%s CertFile: %s", Svr.Address(), std::to_string(Svr.Port()),
Svr.KeyFile(),Svr.CertFile()));
Logger().notice( fmt::format("Starting: {}:{} Keyfile:{} CertFile: {}",
Svr.Address(),
Svr.Port(),
Svr.KeyFile(),Svr.CertFile()));
Svr.LogCert(Logger());
if(!Svr.RootCA().empty())
@@ -41,9 +43,9 @@ namespace OpenWifi {
if(!IsCertOk()) {
IssuerCert_ = std::make_unique<Poco::Crypto::X509Certificate>(Svr.IssuerCertFile());
Logger().information(Poco::format("Certificate Issuer Name:%s",IssuerCert_->issuerName()));
Logger().information( fmt::format("Certificate Issuer Name:{}",IssuerCert_->issuerName()));
}
auto NewSocketAcceptor = std::make_unique<Poco::Net::ParallelSocketAcceptor<WSConnection, Poco::Net::SocketReactor>>(Sock, Reactor_, Poco::Environment::processorCount()*2);
auto NewSocketAcceptor = std::make_unique<ws_server_reactor_type_t>(Sock, Reactor_); // , 2 /*Poco::Environment::processorCount()*2) */ );
Acceptors_.push_back(std::move(NewSocketAcceptor));
}
@@ -63,6 +65,8 @@ namespace OpenWifi {
SimulatorId_ = MicroService::instance().ConfigGetString("simulatorid","");
SimulatorEnabled_ = !SimulatorId_.empty();
ReactorThread_.setName("WS-DEVICE-REACTOR");
ReactorThread_.setStackSize(3000000);
ReactorThread_.start(Reactor_);
return 0;
@@ -70,7 +74,7 @@ namespace OpenWifi {
void WebSocketServer::Stop() {
Logger().notice("Stopping reactors...");
ReactorPool_.Stop();
// ReactorPool_.Stop();
Reactor_.stop();
ReactorThread_.join();
}

View File

@@ -18,6 +18,7 @@
#include "Poco/AutoPtr.h"
#include "Poco/Net/SocketReactor.h"
#include "Poco/Net/ParallelSocketAcceptor.h"
#include "Poco/Net/SocketAcceptor.h"
#include "WS_Connection.h"
#include "WS_ReactorPool.h"
@@ -35,7 +36,7 @@ namespace OpenWifi {
void Stop() override;
bool IsCertOk() { return IssuerCert_!= nullptr; }
bool ValidateCertificate(const std::string & ConnectionId, const Poco::Crypto::X509Certificate & Certificate);
Poco::Net::SocketReactor & GetNextReactor() { return ReactorPool_.NextReactor(); }
// Poco::Net::SocketReactor & GetNextReactor() { return ReactorPool_.NextReactor(); }
inline bool IsSimSerialNumber(const std::string & SerialNumber) const {
return IsSim(SerialNumber) && SerialNumber == SimulatorId_;
@@ -54,10 +55,12 @@ namespace OpenWifi {
private:
std::unique_ptr<Poco::Crypto::X509Certificate> IssuerCert_;
std::vector<std::unique_ptr<Poco::Net::ParallelSocketAcceptor<WSConnection, Poco::Net::SocketReactor>>> Acceptors_;
// typedef std::unique_ptr<Poco::Net::ParallelSocketAcceptor<WSConnection, Poco::Net::SocketReactor>> ws_server_reactor_type_t;
typedef Poco::Net::SocketAcceptor<WSConnection> ws_server_reactor_type_t;
std::vector<std::unique_ptr<ws_server_reactor_type_t>> Acceptors_;
Poco::Net::SocketReactor Reactor_;
Poco::Thread ReactorThread_;
ReactorPool ReactorPool_;
// ReactorPool ReactorPool_;
std::string SimulatorId_;
bool LookAtProvisioning_ = false;
bool UseDefaultConfig_ = true;

File diff suppressed because it is too large Load Diff

View File

@@ -14,9 +14,8 @@ namespace OpenWifi {
class ConfigurationValidator : public SubSystemServer {
public:
static ConfigurationValidator *instance() {
if(instance_== nullptr)
instance_ = new ConfigurationValidator;
static auto instance() {
static auto instance_ = new ConfigurationValidator;
return instance_;
}
@@ -27,18 +26,17 @@ namespace OpenWifi {
void reinitialize(Poco::Util::Application &self) override;
private:
static ConfigurationValidator * instance_;
bool Initialized_=false;
bool Working_=false;
void Init();
std::unique_ptr<json_validator> Validator_=std::make_unique<json_validator>(nullptr, my_format_checker);
nlohmann::json RootSchema_;
ConfigurationValidator():
SubSystemServer("configvalidator", "CFG-VALIDATOR", "config.validator") {
}
};
inline ConfigurationValidator * ConfigurationValidator() { return ConfigurationValidator::instance(); }
inline auto ConfigurationValidator() { return ConfigurationValidator::instance(); }
inline bool ValidateUCentralConfiguration(const std::string &C, std::string &Error) { return ConfigurationValidator::instance()->Validate(C, Error); }
}

View File

@@ -18,6 +18,7 @@ namespace OpenWifi::KafkaTopics {
static const std::string SERVICE_EVENTS{"service_events"};
static const std::string DEVICE_EVENT_QUEUE{"device_event_queue"};
static const std::string DEVICE_TELEMETRY{"device_telemetry"};
static const std::string PROVISIONING_CHANGE{"provisioning_change"};
namespace ServiceEvents {
static const std::string EVENT_JOIN{"join"};

File diff suppressed because it is too large Load Diff

View File

@@ -1,68 +0,0 @@
//
// Created by stephane bourque on 2021-09-12.
//
#pragma once
namespace OpenWifi::RESTAPI::Errors {
static const std::string MissingUUID{"Missing UUID."};
static const std::string MissingSerialNumber{"Missing Serial Number."};
static const std::string InternalError{"Internal error. Please try later."};
static const std::string InvalidJSONDocument{"Invalid JSON document."};
static const std::string UnsupportedHTTPMethod{"Unsupported HTTP Method"};
static const std::string StillInUse{"Element still in use."};
static const std::string CouldNotBeDeleted{"Element could not be deleted."};
static const std::string NameMustBeSet{"The name property must be set."};
static const std::string ConfigBlockInvalid{"Configuration block type invalid."};
static const std::string UnknownId{"Unknown UUID."};
static const std::string InvalidDeviceTypes{"Unknown or invalid device type(s)."};
static const std::string RecordNotCreated{"Record could not be created."};
static const std::string RecordNotUpdated{"Record could not be updated."};
static const std::string UnknownManagementPolicyUUID{"Unknown management policy UUID."};
static const std::string CannotDeleteRoot{"Root Entity cannot be removed, only modified."};
static const std::string MustCreateRootFirst{"Root entity must be created first."};
static const std::string ParentUUIDMustExist{"Parent UUID must exist."};
static const std::string ConfigurationMustExist{"Configuration must exist."};
static const std::string MissingOrInvalidParameters{"Invalid or missing parameters."};
static const std::string UnknownSerialNumber{"Unknown Serial Number."};
static const std::string InvalidSerialNumber{"Invalid Serial Number."};
static const std::string SerialNumberExists{"Serial Number already exists."};
static const std::string ValidNonRootUUID{"Must be a non-root, and valid UUID."};
static const std::string VenueMustExist{"Venue does not exist."};
static const std::string NotBoth{"You cannot specify both Entity and Venue"};
static const std::string EntityMustExist{"Entity must exist."};
static const std::string ParentOrEntityMustBeSet{"Parent or Entity must be set."};
static const std::string ContactMustExist{"Contact must exist."};
static const std::string LocationMustExist{"Location must exist."};
static const std::string OnlyWSSupported{"This endpoint only supports WebSocket."};
static const std::string SerialNumberMismatch{"Serial Number mismatch."};
static const std::string InvalidCommand{"Invalid command."};
static const std::string NoRecordsDeleted{"No records deleted."};
static const std::string DeviceNotConnected{"Device is not currently connected."};
static const std::string CannotCreateWS{"Telemetry system could not create WS endpoint. Please try again."};
static const std::string BothDeviceTypeRevision{"Both deviceType and revision must be set."};
static const std::string IdOrSerialEmpty{"SerialNumber and Id must not be empty."};
static const std::string MissingUserID{"Missing user ID."};
static const std::string IdMustBe0{"To create a user, you must set the ID to 0"};
static const std::string InvalidUserRole{"Invalid userRole."};
static const std::string InvalidEmailAddress{"Invalid email address."};
static const std::string PasswordRejected{"Password was rejected. This maybe an old password."};
static const std::string InvalidIPRanges{"Invalid IP range specifications."};
static const std::string InvalidLOrderBy{"Invalid orderBy specification."};
static const std::string NeedMobileNumber{"You must provide at least one validated phone number."};
static const std::string BadMFAMethod{"MFA only supports sms or email."};
static const std::string InvalidCredentials{"Invalid credentials (username/password)."};
static const std::string InvalidPassword{"Password does not conform to basic password rules."};
static const std::string UserPendingVerification{"User access denied pending email verification."};
static const std::string PasswordMustBeChanged{"Password must be changed."};
static const std::string UnrecognizedRequest{"Ill-formed request. Please consult documentation."};
static const std::string MissingAuthenticationInformation{"Missing authentication information."};
static const std::string InsufficientAccessRights{"Insufficient access rights to complete the operation."};
static const std::string ExpiredToken{"Token has expired, user must login."};
static const std::string SubscriberMustExist{"Subscriber must exist."};
static const std::string AuthenticatorVerificationIncomplete{"Authenticator validation is not complete."};
static const std::string SMSCouldNotBeSentRetry{"SMS could not be sent to validate device, try later or change the phone number."};
static const std::string SMSCouldNotValidate{"Code and number could not be validated"};
static const std::string InvalidDeviceClass{"Invalid device class. Must be: any, venue, entity, or subscriber"};
}

View File

@@ -1,139 +0,0 @@
//
// License type: BSD 3-Clause License
// License copy: https://github.com/Telecominfraproject/wlan-cloud-ucentralgw/blob/master/LICENSE
//
// Created by Stephane Bourque on 2021-03-04.
// Arilia Wireless Inc.
//
#pragma once
namespace OpenWifi::RESTAPI::Protocol {
static const char * CAPABILITIES = "capabilities";
static const char * LOGS = "logs";
static const char * HEALTHCHECKS = "healthchecks";
static const char * STATISTICS = "statistics";
static const char * STATUS = "status";
static const char * SERIALNUMBER = "serialNumber";
static const char * PERFORM = "perform";
static const char * CONFIGURE = "configure";
static const char * UPGRADE = "upgrade";
static const char * REBOOT = "reboot";
static const char * FACTORY = "factory";
static const char * LEDS = "leds";
static const char * TRACE = "trace";
static const char * REQUEST = "request";
static const char * WIFISCAN = "wifiscan";
static const char * EVENTQUEUE = "eventqueue";
static const char * RTTY = "rtty";
static const char * COMMAND = "command";
static const char * STARTDATE = "startDate";
static const char * ENDDATE = "endDate";
static const char * OFFSET = "offset";
static const char * LIMIT = "limit";
static const char * LIFETIME = "lifetime";
static const char * UUID = "UUID";
static const char * DATA = "data";
static const char * CONFIGURATION = "configuration";
static const char * WHEN = "when";
static const char * URI = "uri";
static const char * LOGTYPE = "logType";
static const char * VALUES = "values";
static const char * TYPES = "types";
static const char * PAYLOAD = "payload";
static const char * KEEPREDIRECTOR = "keepRedirector";
static const char * NETWORK = "network";
static const char * INTERFACE = "interface";
static const char * BANDS = "bands";
static const char * CHANNELS = "channels";
static const char * VERBOSE = "verbose";
static const char * MESSAGE = "message";
static const char * STATE = "state";
static const char * HEALTHCHECK = "healthcheck";
static const char * PCAP_FILE_TYPE = "pcap";
static const char * DURATION = "duration";
static const char * NUMBEROFPACKETS = "numberOfPackets";
static const char * FILTER = "filter";
static const char * SELECT = "select";
static const char * SERIALONLY = "serialOnly";
static const char * COUNTONLY = "countOnly";
static const char * DEVICEWITHSTATUS = "deviceWithStatus";
static const char * DEVICESWITHSTATUS = "devicesWithStatus";
static const char * DEVICES = "devices";
static const char * COUNT = "count";
static const char * SERIALNUMBERS = "serialNumbers";
static const char * CONFIGURATIONS = "configurations";
static const char * NAME = "name";
static const char * COMMANDS = "commands";
static const char * COMMANDUUID = "commandUUID";
static const char * FIRMWARES = "firmwares";
static const char * TOPIC = "topic";
static const char * HOST = "host";
static const char * OS = "os";
static const char * HOSTNAME = "hostname";
static const char * PROCESSORS = "processors";
static const char * REASON = "reason";
static const char * RELOAD = "reload";
static const char * SUBSYSTEMS = "subsystems";
static const char * FILEUUID = "uuid";
static const char * USERID = "userId";
static const char * PASSWORD = "password";
static const char * TOKEN = "token";
static const char * SETLOGLEVEL = "setloglevel";
static const char * GETLOGLEVELS = "getloglevels";
static const char * GETSUBSYSTEMNAMES = "getsubsystemnames";
static const char * GETLOGLEVELNAMES = "getloglevelnames";
static const char * STATS = "stats";
static const char * PING = "ping";
static const char * PARAMETERS = "parameters";
static const char * VALUE = "value";
static const char * LASTONLY = "lastOnly";
static const char * NEWEST = "newest";
static const char * ACTIVESCAN = "activeScan";
static const char * OVERRIDEDFS = "override_dfs";
static const char * LIST = "list";
static const char * TAG = "tag";
static const char * TAGLIST = "tagList";
static const char * DESCRIPTION = "description";
static const char * NOTES = "notes";
static const char * DEVICETYPE = "deviceType";
static const char * REVISION = "revision";
static const char * AGES = "ages";
static const char * REVISIONS = "revisions";
static const char * DEVICETYPES = "deviceTypes";
static const char * LATESTONLY = "latestOnly";
static const char * IDONLY = "idOnly";
static const char * REVISIONSET = "revisionSet";
static const char * DEVICESET = "deviceSet";
static const char * HISTORY = "history";
static const char * ID = "id";
static const char * VERSION = "version";
static const char * TIMES = "times";
static const char * UPTIME = "uptime";
static const char * START = "start";
static const char * NEWPASSWORD = "newPassword";
static const char * USERS = "users";
static const char * WITHEXTENDEDINFO = "withExtendedInfo";
static const char * ERRORTEXT = "errorText";
static const char * ERRORCODE = "errorCode";
static const char * AVATARID = "avatarId";
static const char * UNNAMED = "(unnamed)";
static const char * UNSPECIFIED = "(unspecified)";
static const char * CONTENTDISPOSITION = "Content-Disposition";
static const char * CONTENTTYPE = "Content-Type";
static const char * REQUIREMENTS = "requirements";
static const char * PASSWORDPATTERN = "passwordPattern";
static const char * ACCESSPOLICY = "accessPolicy";
static const char * PASSWORDPOLICY = "passwordPolicy";
static const char * FORGOTPASSWORD = "forgotPassword";
static const char * RESENDMFACODE = "resendMFACode";
static const char * COMPLETEMFACHALLENGE = "completeMFAChallenge";
static const char * ME = "me";
static const char * TELEMETRY = "telemetry";
static const char * INTERVAL = "interval";
static const char * UI = "UI";
}

View File

@@ -51,13 +51,14 @@ namespace OpenWifi {
Pool_->shutdown();
}
DBType Type() const { return dbType_; };
private:
inline int Setup_SQLite();
inline int Setup_MySQL();
inline int Setup_PostgreSQL();
protected:
Poco::SharedPtr<Poco::Data::SessionPool> Pool_;
std::unique_ptr<Poco::Data::SessionPool> Pool_;
Poco::Data::SQLite::Connector SQLiteConn_;
Poco::Data::PostgreSQL::Connector PostgresConn_;
Poco::Data::MySQL::Connector MySQLConn_;
@@ -73,18 +74,22 @@ namespace OpenWifi {
Logger().notice("SQLite StorageClass enabled.");
dbType_ = sqlite;
auto DBName = MicroService::instance().DataDir() + "/" + MicroService::instance().ConfigGetString("storage.type.sqlite.db");
auto NumSessions = MicroService::instance().ConfigGetInt("storage.type.sqlite.maxsessions", 64);
auto IdleTime = MicroService::instance().ConfigGetInt("storage.type.sqlite.idletime", 60);
SQLiteConn_.registerConnector();
Pool_ = Poco::SharedPtr<Poco::Data::SessionPool>(new Poco::Data::SessionPool(SQLiteConn_.name(), DBName, 4, NumSessions, IdleTime));
int NumSessions = (int) MicroService::instance().ConfigGetInt("storage.type.sqlite.maxsessions", 64);
int IdleTime = (int) MicroService::instance().ConfigGetInt("storage.type.sqlite.idletime", 60);
Poco::Data::SQLite::Connector::registerConnector();
// Pool_ = std::make_unique<Poco::Data::SessionPool>(new Poco::Data::SessionPool(SQLiteConn_.name(), DBName, 8,
// (int)NumSessions, (int)IdleTime));
Pool_ = std::make_unique<Poco::Data::SessionPool>(SQLiteConn_.name(), DBName, 8,
(int)NumSessions, (int)IdleTime);
return 0;
}
inline int StorageClass::Setup_MySQL() {
Logger().notice("MySQL StorageClass enabled.");
dbType_ = mysql;
auto NumSessions = MicroService::instance().ConfigGetInt("storage.type.mysql.maxsessions", 64);
auto IdleTime = MicroService::instance().ConfigGetInt("storage.type.mysql.idletime", 60);
int NumSessions = (int) MicroService::instance().ConfigGetInt("storage.type.mysql.maxsessions", 64);
int IdleTime = (int) MicroService::instance().ConfigGetInt("storage.type.mysql.idletime", 60);
auto Host = MicroService::instance().ConfigGetString("storage.type.mysql.host");
auto Username = MicroService::instance().ConfigGetString("storage.type.mysql.username");
auto Password = MicroService::instance().ConfigGetString("storage.type.mysql.password");
@@ -99,8 +104,8 @@ namespace OpenWifi {
";port=" + Port +
";compress=true;auto-reconnect=true";
MySQLConn_.registerConnector();
Pool_ = Poco::SharedPtr<Poco::Data::SessionPool>(new Poco::Data::SessionPool(MySQLConn_.name(), ConnectionStr, 4, NumSessions, IdleTime));
Poco::Data::MySQL::Connector::registerConnector();
Pool_ = std::make_unique<Poco::Data::SessionPool>(MySQLConn_.name(), ConnectionStr, 8, NumSessions, IdleTime);
return 0;
}
@@ -108,8 +113,8 @@ namespace OpenWifi {
inline int StorageClass::Setup_PostgreSQL() {
Logger().notice("PostgreSQL StorageClass enabled.");
dbType_ = pgsql;
auto NumSessions = MicroService::instance().ConfigGetInt("storage.type.postgresql.maxsessions", 64);
auto IdleTime = MicroService::instance().ConfigGetInt("storage.type.postgresql.idletime", 60);
int NumSessions = (int) MicroService::instance().ConfigGetInt("storage.type.postgresql.maxsessions", 64);
int IdleTime = (int) MicroService::instance().ConfigGetInt("storage.type.postgresql.idletime", 60);
auto Host = MicroService::instance().ConfigGetString("storage.type.postgresql.host");
auto Username = MicroService::instance().ConfigGetString("storage.type.postgresql.username");
auto Password = MicroService::instance().ConfigGetString("storage.type.postgresql.password");
@@ -125,8 +130,8 @@ namespace OpenWifi {
" port=" + Port +
" connect_timeout=" + ConnectionTimeout;
PostgresConn_.registerConnector();
Pool_ = Poco::SharedPtr<Poco::Data::SessionPool>(new Poco::Data::SessionPool(PostgresConn_.name(), ConnectionStr, 4, NumSessions, IdleTime));
Poco::Data::PostgreSQL::Connector::registerConnector();
Pool_ = std::make_unique<Poco::Data::SessionPool>(PostgresConn_.name(), ConnectionStr, 8, NumSessions, IdleTime);
return 0;
}

View File

@@ -0,0 +1,193 @@
//
// Created by stephane bourque on 2022-05-05.
//
#pragma once
#include "framework/MicroService.h"
namespace OpenWifi {
struct WebNotificationSingleDevice {
std::string serialNumber;
inline void to_json(Poco::JSON::Object &Obj) const {
RESTAPI_utils::field_to_json(Obj,"serialNumber", serialNumber);
}
inline bool from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
RESTAPI_utils::field_from_json(Obj,"serialNumber", serialNumber);
return true;
} catch (...) {
}
return false;
}
};
struct WebNotificationSingleDeviceConfigurationChange {
std::string serialNumber;
uint64_t oldUUID;
uint64_t newUUID;
inline void to_json(Poco::JSON::Object &Obj) const {
RESTAPI_utils::field_to_json(Obj,"serialNumber", serialNumber);
RESTAPI_utils::field_to_json(Obj,"oldUUID", oldUUID);
RESTAPI_utils::field_to_json(Obj,"newUUID", newUUID);
}
inline bool from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
RESTAPI_utils::field_from_json(Obj,"serialNumber", serialNumber);
RESTAPI_utils::field_from_json(Obj,"oldUUID", oldUUID);
RESTAPI_utils::field_from_json(Obj,"newUUID", newUUID);
return true;
} catch (...) {
}
return false;
}
};
struct WebNotificationSingleDeviceFirmwareChange {
std::string serialNumber;
std::string newFirmware;
inline void to_json(Poco::JSON::Object &Obj) const {
RESTAPI_utils::field_to_json(Obj,"serialNumber", serialNumber);
RESTAPI_utils::field_to_json(Obj,"newFirmware", newFirmware);
}
inline bool from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
RESTAPI_utils::field_from_json(Obj,"serialNumber", serialNumber);
RESTAPI_utils::field_from_json(Obj,"newFirmware", newFirmware);
return true;
} catch (...) {
}
return false;
}
};
inline void WebSocketClientNotificationDeviceConfigurationChange(const std::string &SerialNumber, uint64_t oldUUID, uint64_t newUUID) {
WebSocketNotification<WebNotificationSingleDeviceConfigurationChange> N;
N.content.serialNumber = SerialNumber;
N.content.oldUUID = oldUUID;
N.content.newUUID = newUUID;
N.type = "device_configuration_upgrade";
WebSocketClientServer()->SendNotification(N);
}
inline void WebSocketClientNotificationDeviceFirmwareUpdated(const std::string &SerialNumber, const std::string &Firmware) {
WebSocketNotification<WebNotificationSingleDeviceFirmwareChange> N;
N.content.serialNumber = SerialNumber;
N.content.newFirmware = Firmware;
N.type = "device_firmware_upgrade";
WebSocketClientServer()->SendNotification(N);
}
inline void WebSocketClientNotificationDeviceConnected(const std::string &SerialNumber) {
WebSocketNotification<WebNotificationSingleDevice> N;
N.content.serialNumber = SerialNumber;
N.type = "device_connection";
WebSocketClientServer()->SendNotification(N);
}
inline void WebSocketClientNotificationDeviceDisconnected(const std::string & SerialNumber) {
WebSocketNotification<WebNotificationSingleDevice> N;
N.content.serialNumber = SerialNumber;
N.type = "device_disconnection";
WebSocketClientServer()->SendNotification(N);
}
struct WebSocketNotificationJobContent {
std::string title,
details,
jobId;
std::vector<std::string> success,
error,
warning;
uint64_t timeStamp=OpenWifi::Now();
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
inline void WebSocketNotificationJobContent::to_json(Poco::JSON::Object &Obj) const {
RESTAPI_utils::field_to_json(Obj,"title",title);
RESTAPI_utils::field_to_json(Obj,"jobId",jobId);
RESTAPI_utils::field_to_json(Obj,"success",success);
RESTAPI_utils::field_to_json(Obj,"error",error);
RESTAPI_utils::field_to_json(Obj,"warning",warning);
RESTAPI_utils::field_to_json(Obj,"timeStamp",timeStamp);
RESTAPI_utils::field_to_json(Obj,"details",details);
}
inline bool WebSocketNotificationJobContent::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
RESTAPI_utils::field_from_json(Obj,"title",title);
RESTAPI_utils::field_from_json(Obj,"jobId",jobId);
RESTAPI_utils::field_from_json(Obj,"success",success);
RESTAPI_utils::field_from_json(Obj,"error",error);
RESTAPI_utils::field_from_json(Obj,"warning",warning);
RESTAPI_utils::field_from_json(Obj,"timeStamp",timeStamp);
RESTAPI_utils::field_from_json(Obj,"details",details);
return true;
} catch(...) {
}
return false;
}
typedef WebSocketNotification<WebSocketNotificationJobContent> WebSocketClientNotificationVenueUpdateJob_t;
inline void WebSocketClientNotificationVenueUpdateJobCompletionToUser( const std::string & User, WebSocketClientNotificationVenueUpdateJob_t &N) {
N.type = "venue_configuration_update";
WebSocketClientServer()->SendUserNotification(User,N);
}
struct WebSocketNotificationRebootList {
std::string title,
details,
jobId;
std::vector<std::string> success,
warning;
uint64_t timeStamp=OpenWifi::Now();
void to_json(Poco::JSON::Object &Obj) const;
bool from_json(const Poco::JSON::Object::Ptr &Obj);
};
typedef WebSocketNotification<WebSocketNotificationRebootList> WebSocketClientNotificationVenueRebootList_t;
inline void WebSocketNotificationRebootList::to_json(Poco::JSON::Object &Obj) const {
RESTAPI_utils::field_to_json(Obj,"title",title);
RESTAPI_utils::field_to_json(Obj,"jobId",jobId);
RESTAPI_utils::field_to_json(Obj,"success",success);
RESTAPI_utils::field_to_json(Obj,"warning",warning);
RESTAPI_utils::field_to_json(Obj,"timeStamp",timeStamp);
RESTAPI_utils::field_to_json(Obj,"details",details);
}
inline bool WebSocketNotificationRebootList::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
RESTAPI_utils::field_from_json(Obj,"title",title);
RESTAPI_utils::field_from_json(Obj,"jobId",jobId);
RESTAPI_utils::field_from_json(Obj,"success",success);
RESTAPI_utils::field_from_json(Obj,"warning",warning);
RESTAPI_utils::field_from_json(Obj,"timeStamp",timeStamp);
RESTAPI_utils::field_from_json(Obj,"details",details);
return true;
} catch(...) {
}
return false;
}
inline void WebSocketClientNotificationVenueRebootCompletionToUser( const std::string & User, WebSocketClientNotificationVenueRebootList_t &N) {
N.type = "venue_rebooter";
WebSocketClientServer()->SendUserNotification(User,N);
}
} // namespace OpenWifi

View File

@@ -33,7 +33,8 @@ namespace ORM {
FT_TEXT,
FT_VARCHAR,
FT_BLOB,
FT_BOOLEAN
FT_BOOLEAN,
FT_REAL
};
enum Indextype {
@@ -81,14 +82,14 @@ namespace ORM {
typedef std::vector<Field> FieldVec;
struct IndexEntry {
std::string FieldName;
Indextype Type;
std::string FieldName;
Indextype Type;
};
typedef std::vector<IndexEntry> IndexEntryVec;
struct Index {
std::string Name;
IndexEntryVec Entries;
IndexEntryVec Entries;
};
typedef std::vector<Index> IndexVec;
@@ -108,11 +109,13 @@ namespace ORM {
return "LONGBLOB";
else if(Type==OpenWifi::DBType::pgsql)
return "BYTEA";
else if(Type==OpenWifi::DBType::sqlite)
else
return "BLOB";
default:
assert(false);
return "";
case FT_REAL:
return "REAL";
default:
assert(false);
}
assert(false);
return "";
@@ -121,12 +124,13 @@ namespace ORM {
inline std::string Escape(const std::string &S) {
std::string R;
for(const auto &i:S)
if(i=='\'')
for(const auto &i:S) {
if (i == '\'')
R += "''";
else
R += i;
return R;
}
return R;
}
enum SqlComparison { EQ = 0, NEQ, LT, LTE, GT, GTE };
@@ -151,13 +155,21 @@ namespace ORM {
return S;
}
inline std::string to_string(const Poco::Data::BLOB &blob) {
std::string result;
result.assign(blob.begin(),blob.end());
return result;
}
inline std::string to_string(const char * S) {
return S;
}
template <typename RecordType> class DBCache {
public:
DBCache(unsigned Size, unsigned Timeout)
DBCache(unsigned Size, unsigned Timeout) :
Size_(Size),
Timeout_(Timeout)
{
}
@@ -166,7 +178,8 @@ namespace ORM {
virtual void UpdateCache(const RecordType &R)=0;
virtual void Delete(const std::string &FieldName, const std::string &Value)=0;
private:
size_t Size_=0;
uint64_t Timeout_=0;
};
template <typename RecordTuple, typename RecordType> class DB {
@@ -182,8 +195,8 @@ namespace ORM {
Poco::Logger &L,
const char *Prefix,
DBCache<RecordType> * Cache=nullptr):
Type_(dbtype),
TableName_(TableName),
Type_(dbtype),
Pool_(Pool),
Logger_(L),
Prefix_(Prefix),
@@ -195,7 +208,8 @@ namespace ORM {
int Place=0;
for(const auto &i:Fields) {
FieldNames_[i.Name] = Place;
std::string FieldName = Poco::toLower(i.Name);
FieldNames_[FieldName] = Place;
if(!first) {
CreateFields_ += ", ";
SelectFields_ += ", ";
@@ -205,9 +219,9 @@ namespace ORM {
SelectList_ += "(";
}
CreateFields_ += i.Name + " " + FieldTypeToChar(Type_, i.Type,i.Size) + (i.Index ? " unique primary key" : "");
SelectFields_ += i.Name ;
UpdateFields_ += i.Name + "=?";
CreateFields_ += FieldName + " " + FieldTypeToChar(Type_, i.Type,i.Size) + (i.Index ? " unique primary key" : "");
SelectFields_ += FieldName ;
UpdateFields_ += FieldName + "=?";
SelectList_ += "?";
first = false;
Place++;
@@ -222,12 +236,13 @@ namespace ORM {
IndexLine = std::string("CREATE INDEX IF NOT EXISTS ") + j.Name + std::string(" ON ") + TableName_+ " (";
bool first_entry=true;
for(const auto &k:j.Entries) {
assert(FieldNames_.find(k.FieldName) != FieldNames_.end());
auto IndexFieldName = Poco::toLower(k.FieldName);
assert(ValidFieldName(IndexFieldName));
if(!first_entry) {
IndexLine += " , ";
}
first_entry = false;
IndexLine += k.FieldName + std::string(" ") + std::string(k.Type == Indextype::ASC ? "ASC" : "DESC") ;
IndexLine += IndexFieldName + std::string(" ") + std::string(k.Type == Indextype::ASC ? "ASC" : "DESC") ;
}
IndexLine += " )";
IndexCreation_.template emplace_back(IndexLine);
@@ -242,12 +257,13 @@ namespace ORM {
IndexLine += " INDEX " + j.Name + " ( " ;
bool first_entry=true;
for(const auto &k:j.Entries) {
assert(FieldNames_.find(k.FieldName) != FieldNames_.end());
auto IndexFieldName = Poco::toLower(k.FieldName);
assert(FieldNames_.find(IndexFieldName) != FieldNames_.end());
if(!first_entry) {
IndexLine += " ,";
}
first_entry = false;
IndexLine += k.FieldName + std::string(k.Type == Indextype::ASC ? " ASC" : " DESC");
IndexLine += IndexFieldName + std::string(k.Type == Indextype::ASC ? " ASC" : " DESC");
}
IndexLine += " ) ";
}
@@ -262,27 +278,27 @@ namespace ORM {
[[nodiscard]] const std::string & UpdateFields() const { return UpdateFields_; };
inline std::string OP(field_name_t F, SqlComparison O , bool V) {
assert( FieldNames_.find(F) != FieldNames_.end() );
assert(ValidFieldName(F));
return std::string{"("} + F + SQLCOMPS[O] + (V ? "true" : "false") + ")" ;
}
inline std::string OP(field_name_t F, SqlComparison O , int V) {
assert( FieldNames_.find(F) != FieldNames_.end() );
assert(ValidFieldName(F));
return std::string{"("} + F + SQLCOMPS[O] + std::to_string(V) + ")" ;
}
inline std::string OP(field_name_t F, SqlComparison O , uint64_t V) {
assert( FieldNames_.find(F) != FieldNames_.end() );
assert(ValidFieldName(F));
return std::string{"("} + F + SQLCOMPS[O] + std::to_string(V) + ")" ;
}
std::string OP(field_name_t F, SqlComparison O , const std::string & V) {
assert( FieldNames_.find(F) != FieldNames_.end() );
assert(ValidFieldName(F));
return std::string{"("} + F + SQLCOMPS[O] + "'" + Escape(V) + "')" ;
}
std::string OP(field_name_t F, SqlComparison O , const char * V) {
assert( FieldNames_.find(F) != FieldNames_.end() );
assert(ValidFieldName(F));
return std::string{"("} + F + SQLCOMPS[O] + "'" + Escape(V) + "')" ;
}
@@ -290,7 +306,7 @@ namespace ORM {
return std::string("(")+P1 + BOPS[BOP] + P2 +")";
}
std::string OP( bool Paran, const std::string &P1, SqlBinaryOp BOP , const std::string &P2) {
std::string OP( [[maybe_unused]] bool Paran, const std::string &P1, SqlBinaryOp BOP , const std::string &P2) {
return P1 + BOPS[BOP] + P2 +")";
}
@@ -404,7 +420,7 @@ namespace ORM {
template<typename T> bool GetRecord(field_name_t FieldName, const T & Value, RecordType & R) {
try {
assert( FieldNames_.find(FieldName) != FieldNames_.end() );
assert(ValidFieldName(FieldName));
if(Cache_) {
if(Cache_->GetFromCache(FieldName, Value, R))
@@ -415,7 +431,7 @@ namespace ORM {
Poco::Data::Statement Select(Session);
RecordTuple RT;
std::string St = "select " + SelectFields_ + " from " + TableName_ + " where " + FieldName + "=?" ;
std::string St = "select " + SelectFields_ + " from " + TableName_ + " where " + FieldName + "=?" + " limit 1";
auto tValue{Value};
@@ -424,13 +440,12 @@ namespace ORM {
Poco::Data::Keywords::use(tValue);
Select.execute();
if(Select.rowsExtracted()==1) {
if(Select.execute()==1) {
Convert(RT,R);
if(Cache_)
Cache_->UpdateCache(R);
return true;
}
return false;
} catch (const Poco::Exception &E) {
Logger_.log(E);
}
@@ -443,7 +458,7 @@ namespace ORM {
typename T0, typename T1> bool GR(field_name_t FieldName, T & R,T0 &V0, T1 &V1) {
try {
assert( FieldNames_.find(FieldName) != FieldNames_.end() );
assert( ValidFieldName(FieldName) );
Poco::Data::Session Session = Pool_.get();
Poco::Data::Statement Select(Session);
@@ -467,9 +482,11 @@ namespace ORM {
return false;
}
typedef std::vector<RecordTuple> RecordList;
typedef std::vector<RecordTuple> RecordList;
typedef std::vector<RecordType> RecordVec;
typedef RecordType RecordName;
bool GetRecords( uint64_t Offset, uint64_t HowMany, std::vector<RecordType> & Records, const std::string & Where = "", const std::string & OrderBy = "") {
bool GetRecords( uint64_t Offset, uint64_t HowMany, RecordVec & Records, const std::string & Where = "", const std::string & OrderBy = "") {
try {
Poco::Data::Session Session = Pool_.get();
Poco::Data::Statement Select(Session);
@@ -499,7 +516,7 @@ namespace ORM {
template <typename T> bool UpdateRecord(field_name_t FieldName, const T & Value, const RecordType & R) {
try {
assert( FieldNames_.find(FieldName) != FieldNames_.end() );
assert( ValidFieldName(FieldName) );
Poco::Data::Session Session = Pool_.get();
Poco::Data::Statement Update(Session);
@@ -524,6 +541,21 @@ namespace ORM {
return false;
}
bool RunStatement(const std::string &St) {
try {
Poco::Data::Session Session = Pool_.get();
Poco::Data::Statement Command(Session);
Command << St ;
Command.execute();
return true;
} catch (const Poco::Exception &E) {
Logger_.log(E);
}
return false;
}
template <typename T> bool ReplaceRecord(field_name_t FieldName, const T & Value, RecordType & R) {
try {
if(Exists(FieldName, Value)) {
@@ -538,7 +570,7 @@ namespace ORM {
template <typename T> bool GetNameAndDescription(field_name_t FieldName, const T & Value, std::string & Name, std::string & Description ) {
try {
assert( FieldNames_.find(FieldName) != FieldNames_.end() );
assert( ValidFieldName(FieldName) );
Poco::Data::Session Session = Pool_.get();
Poco::Data::Statement Select(Session);
RecordTuple RT;
@@ -565,7 +597,7 @@ namespace ORM {
template <typename T> bool DeleteRecord(field_name_t FieldName, const T & Value) {
try {
assert( FieldNames_.find(FieldName) != FieldNames_.end() );
assert( ValidFieldName(FieldName) );
Poco::Data::Session Session = Pool_.get();
Poco::Data::Statement Delete(Session);
@@ -603,7 +635,7 @@ namespace ORM {
bool Exists(field_name_t FieldName, const std::string & Value) {
try {
assert( FieldNames_.find(FieldName) != FieldNames_.end() );
assert( ValidFieldName(FieldName) );
RecordType R;
if(GetRecord(FieldName,Value,R))
@@ -656,7 +688,7 @@ namespace ORM {
}
if(!ItemList.empty())
ItemList += " , ";
auto hint = FieldNames_.find(T[0]);
auto hint = FieldNames_.find(Poco::toLower(T[0]));
if(hint==FieldNames_.end()) {
return false;
}
@@ -666,9 +698,6 @@ namespace ORM {
if(!ItemList.empty()) {
OrderByString = " ORDER BY " + ItemList;
}
std::cout << OrderByString << std::endl;
return true;
}
@@ -695,7 +724,7 @@ namespace ORM {
template <typename X> bool ManipulateVectorMember( X T, field_name_t FieldName, const std::string & ParentUUID, const std::string & ChildUUID, bool Add) {
try {
assert( FieldNames_.find(FieldName) != FieldNames_.end() );
assert( ValidFieldName(FieldName) );
RecordType R;
if(GetRecord(FieldName, ParentUUID, R)) {
@@ -729,11 +758,11 @@ namespace ORM {
try {
Command << i, Poco::Data::Keywords::now;
} catch (const Poco::Exception &E) {
Logger_.log(E);
Logger_.error(Poco::format("The following statement '%s' generated an exception during a table upgrade. This maya or may not be a problem.", i));
}
if(!IgnoreExceptions) {
return false;
// Logger_.log(E);
// Logger_.error(Poco::format("The following statement '%s' generated an exception during a table upgrade. This may or may not be a problem.", i));
if(!IgnoreExceptions) {
return false;
}
}
Command.reset(Session);
}
@@ -809,32 +838,32 @@ namespace ORM {
return ManipulateVectorMember(&RecordType::users, FieldName, ParentUUID, ChildUUID, false);
}
inline bool AddInUse(field_name_t FieldName, std::string & ParentUUID, const std::string & Prefix, const std::string & ChildUUID) {
inline bool AddConfiguration(field_name_t FieldName, const std::string & ParentUUID, const std::string & ChildUUID) {
return ManipulateVectorMember(&RecordType::deviceConfiguration, FieldName, ParentUUID, ChildUUID, true);
}
inline bool DelConfiguration(field_name_t FieldName, const std::string & ParentUUID, const std::string & ChildUUID) {
return ManipulateVectorMember(&RecordType::deviceConfiguration, FieldName, ParentUUID, ChildUUID, false);
}
inline bool AddVariable(field_name_t FieldName, const std::string & ParentUUID, const std::string & ChildUUID) {
return ManipulateVectorMember(&RecordType::variables, FieldName, ParentUUID, ChildUUID, true);
}
inline bool DelVariable(field_name_t FieldName, const std::string & ParentUUID, const std::string & ChildUUID) {
return ManipulateVectorMember(&RecordType::variables, FieldName, ParentUUID, ChildUUID, false);
}
inline bool AddInUse(field_name_t FieldName, const std::string & ParentUUID, const std::string & Prefix, const std::string & ChildUUID) {
std::string FakeUUID{ Prefix + ":" + ChildUUID};
return ManipulateVectorMember(&RecordType::inUse,FieldName, ParentUUID, FakeUUID, true);
}
inline bool DeleteInUse(field_name_t FieldName, std::string & ParentUUID, const std::string & Prefix, const std::string & ChildUUID) {
inline bool DeleteInUse(field_name_t FieldName, const std::string & ParentUUID, const std::string & Prefix, const std::string & ChildUUID) {
std::string FakeUUID{ Prefix + ":" + ChildUUID};
return ManipulateVectorMember(&RecordType::inUse,FieldName, ParentUUID, FakeUUID, false);
}
inline bool DeleteContact(field_name_t FieldName, std::string & ParentUUID, const std::string & ChildUUID) {
return ManipulateVectorMember(&RecordType::contacts,FieldName, ParentUUID, ChildUUID, false);
}
inline bool AddContact(field_name_t FieldName, std::string & ParentUUID, const std::string & ChildUUID) {
return ManipulateVectorMember(&RecordType::contacts,FieldName, ParentUUID, ChildUUID, true);
}
inline bool DeleteLocation(field_name_t FieldName, std::string & ParentUUID, const std::string & ChildUUID) {
return ManipulateVectorMember(&RecordType::locations,FieldName, ParentUUID, ChildUUID, false);
}
inline bool AddLocation(field_name_t FieldName, std::string & ParentUUID, const std::string & ChildUUID) {
return ManipulateVectorMember(&RecordType::locations,FieldName, ParentUUID, ChildUUID, true);
}
inline bool GetInUse(field_name_t FieldName, const std::string & UUID, std::vector<std::string> & UUIDs ) {
RecordType R;
if(GetRecord(FieldName,UUID,R)) {
@@ -844,6 +873,15 @@ namespace ORM {
return false;
}
inline bool ValidFieldName(const std::string &FieldName) {
return FieldNames_.find(Poco::toLower(FieldName)) != FieldNames_.end();
}
inline bool ValidFieldName(const char *FieldName) {
std::string Field{FieldName};
return ValidFieldName(Field);
}
[[nodiscard]] inline std::string ComputeRange(uint64_t From, uint64_t HowMany) {
if(From<1) From=0;
switch(Type_) {
@@ -860,26 +898,31 @@ namespace ORM {
Poco::Logger & Logger() { return Logger_; }
bool DeleteRecordsFromCache(const char *FieldName, const std::string &Value ) {
inline bool DeleteRecordsFromCache(const char *FieldName, const std::string &Value ) {
if(Cache_)
Cache_->Delete(FieldName, Value);
return true;
}
inline void GetFieldNames( OpenWifi::Types::StringVec & F) {
for(const auto &[field,_]:FieldNames_)
F.push_back(field);
}
protected:
std::string TableName_;
OpenWifi::DBType Type_;
Poco::Data::SessionPool &Pool_;
Poco::Logger &Logger_;
std::string TableName_;
std::string Prefix_;
DBCache<RecordType> *Cache_= nullptr;
private:
OpenWifi::DBType Type_;
std::string CreateFields_;
std::string SelectFields_;
std::string SelectList_;
std::string UpdateFields_;
std::vector<std::string> IndexCreation_;
std::map<std::string,int> FieldNames_;
std::string Prefix_;
};
}

Some files were not shown because too many files have changed in this diff Show More