Compare commits

..

188 Commits

Author SHA1 Message Date
Sukru Senli
ce40c32040 netmode: set default netmode 2025-10-20 17:45:57 +02:00
Sukru Senli
bb090135b2 netmode: fix static mode
and improve other modes
2025-10-20 16:43:38 +02:00
Sukru Senli
8d7cf1c701 netmode: add static mode and vlanid and dns servers as arguments to all modes 2025-10-20 12:51:04 +02:00
Erik Karlsson
9692cf8bc3 sulu-vendorext: remove unused voip ubus object 2025-10-20 10:23:28 +02:00
Vivek Kumar Dutta
7fa5c901f9 sulu-vendorext: fix compilation 2025-10-17 18:29:48 +05:30
Sukru Senli
7c2cbc4c1a sulu-vendorext: remove AccessPoint management from X_IOWRT_MAPController vendor extension 2025-10-17 14:57:17 +02:00
Sukru Senli
a9bdc41462 sulu-vendorext: remove firewall extension 2025-10-17 14:53:42 +02:00
Amin Ben Romdhane
389485a526 wifidmd: 1.1.33.4 2025-10-17 10:08:35 +02:00
Vivek Kumar Dutta
8087a16cdf firewallmngr: selects nat interface setting 2025-10-17 12:25:29 +05:30
Vivek Kumar Dutta
4e33db2700 usermngr: Only select shadow pam utils with security hardening 2025-10-17 10:46:54 +05:30
Vivek Kumar Dutta
e6b7048775 icwmp: Fix segfault with SMM disabled 2025-10-16 18:11:16 +05:30
Suvendhu Hansa
23c43898a4 usermngr: Vendor extension for Security Hardening parameters 2025-10-16 15:45:03 +05:30
Vivek Kumar Dutta
abebc40733 obuspa: Optimize startup to avoid db corruption
- Force update values from uci on firmware update
- In case of reload(uci update), old sql db gets deleted and created from uci
- Use In memory sql journal mode
2025-10-16 14:44:47 +05:30
Suvendhu Hansa
4823154afb usermngr: Added password strength validation 2025-10-15 18:13:54 +05:30
Vivek Dutta
936ce9be85 passwdqc: Install pwqcheck tool
(cherry picked from commit 17ae16e5d2)

17ae16e5 passwdqc: Install pwqcheck tool

Co-authored-by: Suvendhu Hansa <suvendhu.hansa@iopsys.eu>
2025-10-15 17:35:56 +05:30
Reidar Cederqvist
996c0b1832 sulu: update to version 5.1.8 2025-10-14 17:02:23 +02:00
Jakob Olsson
8c4e77a96b Revert "Revert "map-controller: config: add zerotouch, rate, bsteer plugins to default""
This reverts commit 2c58ce6912.
2025-10-14 09:46:15 +02:00
Jakob Olsson
e647ec0990 Revert "Revert "map-agent: map_genconfig: add dpp_chirp section for 2.4GHz""
This reverts commit ad3028061c.
2025-10-14 09:46:13 +02:00
Vivek Dutta
4cfbb3636f mosquitto-auth-shadow: support libpam based authentication
(cherry picked from commit 082452bfb5)

082452bf mosquitto-auth-shadow: support libpam based authentication

Co-authored-by: Vivek Kumar Dutta <vivek.dutta@iopsys.eu>
2025-10-14 09:35:03 +05:30
Janusz Dziedzic
528ad5cbd2 wifimngr: 17.7.8 2025-10-13 16:15:59 +00:00
Erik Karlsson
def81d62d5 logmngr: include pid when migrating also
(cherry picked from commit 46dc9e86d8)

Co-authored-by: Erik Karlsson <erik.karlsson@iopsys.eu>
2025-10-13 19:21:13 +05:30
Jakob Olsson
ad3028061c Revert "map-agent: map_genconfig: add dpp_chirp section for 2.4GHz"
This reverts commit 8554ccf3fc.
2025-10-13 12:12:08 +02:00
Jakob Olsson
2c58ce6912 Revert "map-controller: config: add zerotouch, rate, bsteer plugins to default"
This reverts commit ba95eec1b5.
2025-10-13 12:11:52 +02:00
Vivek Dutta
064418e23d logmngr: include pid in log output by fluent-bit
(cherry picked from commit 0b3420240d)

Co-authored-by: Mohd Husaam Mehdi <husaam.mehdi@iopsys.eu>
2025-10-12 11:38:13 +05:30
Jakob Olsson
ba95eec1b5 map-controller: config: add zerotouch, rate, bsteer plugins to default 2025-10-10 15:50:30 +02:00
Jakob Olsson
8554ccf3fc map-agent: map_genconfig: add dpp_chirp section for 2.4GHz 2025-10-10 15:47:08 +02:00
Janusz Dziedzic
d6cf506901 wifimngr: 17.7.7 2025-10-10 11:38:06 +00:00
Janusz Dziedzic
263723b795 libwifi: 7.13.7 2025-10-10 11:37:15 +00:00
Jakob Olsson
21724ac691 map-agent: 6.3.7.0: zerotouch 2025-10-10 12:01:47 +02:00
Jakob Olsson
3422f7fc4d map-plugins: 1.1.2 2025-10-10 12:01:47 +02:00
Jakob Olsson
19e4b41368 map-plugins: add zerotouch options 2025-10-10 12:01:47 +02:00
Jakob Olsson
db30526f64 map-controller: 6.4.4.0: add ZEROTOUCH_DPP 2025-10-10 12:01:47 +02:00
Janusz Dziedzic
d4c101f90f libwifi: fix target cflags 2025-10-09 14:27:32 +02:00
Janusz Dziedzic
d90063c7d5 wifimngr: disable scancache by default 2025-10-09 14:27:32 +02:00
Mohd Husaam Mehdi
09323326f4 passwdqc: align with usermngr (move PAM setup to usermngr) 2025-10-09 16:32:40 +05:30
Husaam Mehdi
33b62a44c5 sshmngr: use openssh-with-pam as the default backend 2025-10-09 16:32:17 +05:30
Vivek Kumar Dutta
9d0f9750dc usermngr: 1.4.1 2025-10-09 16:30:50 +05:30
Vivek Kumar Dutta
e68abd6288 usermngr: 1.4.0 2025-10-09 16:30:50 +05:30
Suvendhu Hansa
61559073e8 usermngr: modify password policy 2025-10-09 16:30:50 +05:30
Mohd Husaam Mehdi
ffd8352d38 usermngr: add UCI support for passwdqc parameters 2025-10-09 16:30:50 +05:30
Mohd Husaam Mehdi
d75d3bc3ed usermngr: 1.3.11 2025-10-09 16:30:50 +05:30
Mohd Husaam Mehdi
86ef800f0d usermngr: add support for USERMNGR_SECURITY_HARDENING
* this compile time flag will set up faildelay, lock out upon
  6 failed attempts during login via shell or console and enable
  password strength checks when changing password
* this will set openssh usePam option
* openssh and shadow-utils with PAM backend need to be selected for
  this compile time flag to work
2025-10-09 16:30:50 +05:30
Mohd Husaam Mehdi
130a3e5952 usermngr: set compile time flag to use pam with shadow-utils 2025-10-09 16:30:50 +05:30
Mohd Husaam Mehdi
0d4b4c5399 usermngr: include passwdqc and linux-pam
* passwdqc helps us enforce strong passwords policy
* linux-pam helps in managing failed login attempts
2025-10-09 16:30:50 +05:30
Mohd Husaam Mehdi
2240a84adc linux-pam: align with usermngr (move PAM setup to usermngr) 2025-10-09 10:36:57 +00:00
Mohd Husaam Mehdi
d4dfe767c9 parental-control: improve bundle sync logic
* handle the case when interface comes up after parental-control
* handle the case when bundle size can't be fetched for some reason
2025-10-09 14:09:06 +05:30
Vivek Kumar Dutta
58f141573a tr143: workaround for download byte mismatch 2025-10-09 14:01:05 +05:30
Suvendhu Hansa
91fac0490a firewallmngr: Add compile flag for InterfaceSetting 2025-10-09 13:48:25 +05:30
Sukru Senli
a80713423c sulu-vendorext: remove mldsync script
since changes via tr-181 do not trigger procd config reload trigger
2025-10-08 08:54:01 +02:00
Reidar Cederqvist
d530ffa4ba sulu: update to version 5.1.7 2025-10-07 17:14:47 +02:00
Mohd Husaam Mehdi
2da18cbb7d parental-control: fix handling of tcp and ipv6 based dns responses 2025-10-07 13:44:39 +05:30
Mohd Husaam Mehdi
c89816ac60 parental-control: config option for nfqueue number 2025-10-07 13:44:31 +05:30
Vivek Kumar Dutta
03810c0099 parental-control: 1.3.2 2025-10-07 13:44:24 +05:30
Mohd Husaam Mehdi
aad4bd7db5 parental-control: only flush relevant connections using conntrack 2025-10-07 13:44:18 +05:30
Reidar Cederqvist
f36ba2dc1f Update 3 files
- /sulu/sulu-base/Makefile
- /sulu/sulu-builder/Makefile
- /sulu/sulu-theme-genexis/Makefile
2025-10-04 14:27:19 +00:00
Erik Karlsson
91dced7427 sulu: fix faulty ACL generation logic
Also remove leftovers from QR code generation and pointless uci_load
2025-10-03 10:15:00 +02:00
Jakob Olsson
57ef92af9a map-controller: 6.4.3.5 2025-10-03 09:54:55 +02:00
Jakob Olsson
631122aa04 map-plugins: 1.1.1 2025-10-03 09:52:09 +02:00
Sukru Senli
ede7966809 sulu-vendorext: ap_to_mld_creds_sync: do no hardcode mld_id to 1
set it only if there are unused mld sections
2025-10-02 17:34:54 +02:00
Vivek Kumar Dutta
9a36c0310f sulu: Fix migration scripts 2025-10-02 15:17:18 +00:00
Jakob Olsson
2528cde629 map-controller: 6.4.3.4 2025-10-02 16:47:21 +02:00
Vivek Kumar Dutta
f317c67aed obuspa: Skip overriding of uci in case of firstboot 2025-10-02 12:52:56 +00:00
Jakob Olsson
7f14f8634e map-controller: 6.4.3.3 2025-10-02 13:21:31 +02:00
Jakob Olsson
62552e2269 map-controller: 6.4.3.2 2025-10-02 09:45:14 +02:00
Jakob Olsson
5837b73946 map-agent: 6.3.6.18 2025-10-01 13:32:08 +02:00
Erik Karlsson
22bded8f33 timemngr: do not fail uci-defaults on keep-settings upgrade 2025-09-30 16:15:28 +02:00
Erik Karlsson
1fbf254b3a sulu-vendorext: fix missed heimgard.wan to genexis.wan renaming
Also add proper sanity checks so a catch-all ACCEPT rule cannot be
inadvertently added.
2025-09-30 12:49:15 +02:00
Erik Karlsson
3b6f88daed sulu-builder: fix typo in version 2025-09-30 11:53:35 +02:00
Amin Ben Romdhane
f8ceb6293d wifidmd: 1.1.33.3 2025-09-30 11:24:36 +02:00
Jakob Olsson
d5375c89b1 map-agent: 6.3.6.17 2025-09-29 10:53:48 +02:00
Reidar Cederqvist
1301adc7c6 sulu: update to version 5.1.5 2025-09-26 15:08:51 +02:00
Filip Matusiak
85d7715db7 map-agent: 6.3.6.16 2025-09-26 12:10:25 +02:00
Reidar Cederqvist
25cb059235 sulu update to version 5.1.4 2025-09-25 15:56:29 +00:00
Filip Matusiak
a87b85eba5 map-controller: 6.4.2.10 2025-09-25 14:40:16 +02:00
Vivek Kumar Dutta
49a83e17cb sulu-vendorext: Updated MAPController ext 2025-09-25 14:47:59 +05:30
Sukru Senli
2ec059a373 sulu-vendorext: remove unused vendor extensions 2025-09-25 10:09:58 +02:00
Vivek Kumar Dutta
7193985d39 icwmp: Generate error on duplicate params 2025-09-25 11:55:16 +05:30
Jouni Ikonen
74372dab99 Bug 18049: Use separate file for sulu functions 2025-09-25 09:19:11 +05:30
Vivek Kumar Dutta
6bc7842b0d sulu-vendorext: Fix compilation 2025-09-24 17:35:16 +05:30
Reidar Cederqvist
87c2d0bb10 sulu: update to version 2 (5.1.3) 2025-09-24 01:04:33 +02:00
Sukru Senli
1e2f6161d6 sulu-vendorext: replace X_GENEXIS_EU_mesh with X_IOWRT_EU_MAPController 2025-09-23 10:07:13 +00:00
Jakob Olsson
bbb3df8c17 map-controller: config: add name to unique sections
channel_plan and sta_steering are unique sections, and should be named. Additionally added uci-default script to name the sections if missing
2025-09-23 11:50:17 +02:00
Vivek Kumar Dutta
945d95b518 tr143: Fix format syntax parsing for upload diagnostics 2025-09-22 19:04:07 +05:30
Vivek Dutta
9eee6a59f8 logmngr: Fix /dev/log permission to allow all processes to write
(cherry picked from commit 60dafc2028)

047d345b logmngr: /dev/log permissions should allow all processes to write

Co-authored-by: Husaam Mehdi <husaam.mehdi@iopsys.eu>
2025-09-22 18:58:16 +05:30
Markus Gothe
1c6e8aaec8 qosmngr: airoha: flush HW NAT to directly apply changes. 2025-09-19 16:54:11 +02:00
Markus Gothe
aa7ad2dfe9 qosmng: airoha: Don't flush HW NAT unless necessary. 2025-09-19 16:52:51 +02:00
Markus Gothe
dd637db803 qosmngr: airoha: Fix uplink bandwidth calculation.
For lower speeds we need to adjust the bandwidth
calculation for QoS to work on AN7581 (but not on EN7523).

Also make sure we clear old HW NAT entries if the uplink
bandwidth changes for QoS to take effect immediaty.
2025-09-19 16:52:29 +02:00
Jakob Olsson
04b74dca49 map-controller: 6.4.2.9 2025-09-19 15:11:08 +02:00
Anjan Chanda
5ab49f8ff4 map-plugins: 1.0.32 2025-09-19 14:34:16 +02:00
Anjan Chanda
4ac917a191 map-plugins: 1.0.18 (bsteer) 2025-09-19 14:33:53 +02:00
Vivek Kumar Dutta
37d313ccc5 sulu-vendorextn: remove parental control extn 2025-09-19 16:20:26 +05:30
Vivek Kumar Dutta
a225cc2e3f bridgemngr: Simplify QnQ deployments 2025-09-19 15:19:36 +05:30
Reidar Cederqvist
6df061de8e sulu: update to version 2 (5.1.2) 2025-09-19 11:41:31 +02:00
Jakob Olsson
c6d3cac61e hostmngr: 1.3.3 2025-09-18 17:22:54 +02:00
Reidar Cederqvist
f1ac19b604 sulu: update to version 5.1.1 2025-09-18 12:16:10 +02:00
Markus Gothe
27bd279333 dslmngr: airoha: Fix QoS uplink bandwidth monitor. 2025-09-17 19:54:03 +02:00
Reidar Cederqvist
f7d845beaa sulu: tmp give admin full access 2025-09-17 19:02:28 +02:00
Reidar Cederqvist
41c39445bc SULU: depend on sulu-vendorext 2025-09-17 16:24:17 +00:00
Vivek Kumar Dutta
f1c7fc9e1e sulu: return 503 if usp not ready 2025-09-17 18:04:40 +02:00
Sukru Senli
426ddd0f30 sulu-vendorext: move under sulu folder 2025-09-17 16:36:33 +02:00
Jouni Ikonen
9c26dc269e Make sulu work on again 2025-09-17 16:34:02 +02:00
Jouni Ikonen
775c7bf9b9 Changed dns to option instead of list and added peerdns 2025-09-17 16:33:58 +02:00
Vivek Kumar Dutta
154532348b sulu-vendorext: Updated default values 2025-09-17 16:33:53 +02:00
Vivek Kumar Dutta
ed638f3913 sulu: ui updates 2025-09-17 16:33:45 +02:00
Sukru Senli
a3298e14cc sulu-vendorext: if ssid is set different, remove mld, if same, set mld 2025-09-17 16:33:40 +02:00
Sukru Senli
0c72ad488c sulu-vendorext: sync creds from ap to mld 2025-09-17 16:33:33 +02:00
Sukru Senli
d39b258091 sulu-hmg: heimgard sulu 2025-09-17 16:33:29 +02:00
Sukru Senli
d4398bc4a7 HGM: add files extensions depend on 2025-09-17 16:33:21 +02:00
Vivek Kumar Dutta
4f479680b0 HGM vendor extensions 2025-09-17 16:32:39 +02:00
Vivek Kumar Dutta
888b1c186a tr104: Vendor extension for SIP bind Interface 2025-09-17 18:45:31 +05:30
Reidar Cederqvist
5ebb2552ac update to Sulu V2 (5.1.0) 2025-09-17 12:22:40 +02:00
Jakob Olsson
e7f26ec647 map-controller: 6.4.0.16 2025-09-17 12:10:17 +02:00
Vivek Kumar Dutta
f4350eba32 bridgemngr: Fix deletion of ProviderBridge 2025-09-17 15:36:34 +05:30
Janusz Dziedzic
e781b0c1cc libwifi: 7.13.6 2025-09-16 14:02:05 +00:00
Vivek Kumar Dutta
075280c30b userinterface: 1.1.9 2025-09-16 17:09:15 +05:30
Vivek Kumar Dutta
bd984a6f1c bridgemngr: Fix tpid order in QnQ 2025-09-16 16:35:27 +05:30
Vivek Kumar Dutta
f017ef0b41 icwmp: expose periodic inform params over usp 2025-09-16 16:19:28 +05:30
Vivek Dutta
daf540bf4d userinterface: Support for ISP info parameters
(cherry picked from commit 0f23bee1da)

Co-authored-by: Vivek Kumar Dutta <vivek.dutta@iopsys.eu>
2025-09-16 15:54:01 +05:30
Husaam Mehdi
9177090e7c logmngr: 1.1.4 2025-09-16 15:33:55 +05:30
Mohd Husaam Mehdi
8001d9d14b logmngr: fix severity and facility configuration issues 2025-09-16 15:32:31 +05:30
Husaam Mehdi
28c22277cd logmngr: use multiple workers for logging 2025-09-16 15:32:31 +05:30
Erik Karlsson
a82c3562f2 logmngr: use fluent-bit filters to adapt kmsg fields and add hostname 2025-09-16 15:32:31 +05:30
Erik Karlsson
d6e6747380 logmngr: miscellaneous fixes
Always migrate configuration. Do not set executable bit on config
files and uci-defaults scripts. Remove unused /lib/functions.sh
include. Remove redundant "default y" on choice.
2025-09-16 15:32:31 +05:30
Husaam Mehdi
9cf65109e8 logmngr: add support for Syslog Source and Template 2025-09-16 15:32:31 +05:30
Markus Gothe
819b9e3e97 logmngr: Make sure we never fail to setup /var/log/messages.
If it fails during MP the verfication of buttons will not work
as expected. The problem is that the file is created before
data is commited and when power is cut prematurely it won't
re-create the file, maybe because the uci-default script has
been removed already as well.
2025-09-16 15:32:31 +05:30
Vivek Kumar Dutta
05cf17b007 logmngr: fix /dev/log creation 2025-09-16 15:32:31 +05:30
Vivek Kumar Dutta
4538e26d87 logmngr: generate kmsg,log config if dev exists 2025-09-16 15:32:31 +05:30
Husaam Mehdi
c45695ce93 logmngr: Use kmsg module instead of klogd 2025-09-16 15:32:31 +05:30
Husaam Mehdi
e8124555bb logmngr: Include kernel logs 2025-09-16 15:32:31 +05:30
Mohd Husaam Mehdi
596df801e6 fluent-bit: fix kmsg plugin issues
* improved type conversion
* improved error checking while string parsing
* misc improvements
2025-09-15 16:07:15 +05:30
Erik Karlsson
b713b68045 fluent-bit: human readable time in file output 2025-09-15 16:07:15 +05:30
Erik Karlsson
869d482198 fluent-bit: remove patches for hostname and kmsg field adaptation
Filters will be used instead.
2025-09-15 16:07:15 +05:30
Mohd Husaam Mehdi
e5c59ebfcd fluent-bit: align kmsg output fields with syslog fields
- this allows for a better mapping to the data model
- this reduces load on fluent-bit because now one OUTPUT section
  is sufficient (earlier we needed two output sections because of
  two different templates)
2025-09-15 16:07:15 +05:30
Vivek Kumar Dutta
fd0c7e93ef fluent-bit: build using git proto 2025-09-15 16:07:15 +05:30
Janusz Dziedzic
862a278fbe fluent-bit: fix package hash 2025-09-15 16:07:15 +05:30
Mohd Husaam Mehdi
87aa6ea898 fluent-bit: bump version and adjust patch accordingly 2025-09-15 16:07:15 +05:30
Mohd Husaam Mehdi
64c6ff7787 fluent-bit: fix kmsg plugin and add syslog timestamp to kmsg logs 2025-09-15 16:07:15 +05:30
Mohd Husaam Mehdi
ab66957fad fluent-bit: enable kmsg plugin 2025-09-15 16:07:15 +05:30
Markus Gothe
e590fc7894 qosmngr: airoha: flush HW NAT to directly apply changes. 2025-09-15 11:47:13 +02:00
Filip Matusiak
785f2e9db2 map-controller: 6.4.0.15 2025-09-08 17:10:30 +02:00
Filip Matusiak
35cb886b3e map-agent: 6.3.6.15 2025-09-08 17:09:40 +02:00
Jakob Olsson
a1e8a8a464 map-agent: 6.3.6.14 2025-09-04 16:05:37 +02:00
Vivek Kumar Dutta
98c35bf25f obuspa: fallback get connection params from db 2025-09-04 11:00:58 +05:30
Jakob Olsson
7cc2e3eac9 map-agent: 6.3.6.13 2025-09-03 11:50:31 +02:00
Filip Matusiak
f6aff4ba81 hostmngr: 1.3.2 2025-09-02 14:07:47 +02:00
Filip Matusiak
cbd0b5b6bb decollector: 6.2.1.8 2025-09-02 14:07:47 +02:00
Filip Matusiak
d2df0e5633 libdpp: 2.1.2 2025-09-02 14:07:47 +02:00
Filip Matusiak
43be3d334c ieee1905: 8.7.33 2025-09-02 14:07:47 +02:00
Filip Matusiak
900c221ef8 libwifi: 7.13.5 2025-09-02 14:07:47 +02:00
Filip Matusiak
1b88e03e43 wifimngr: 17.7.6 2025-09-02 14:07:47 +02:00
Filip Matusiak
b9e40818a3 map-agent: 6.3.6.12 2025-09-02 14:07:47 +02:00
Jakob Olsson
af272291d2 map-controller: 6.4.0.14 2025-09-02 14:03:47 +02:00
Vivek Kumar Dutta
e7e49350b1 obuspa: removed test controller definition 2025-09-02 16:17:31 +05:30
Vivek Kumar Dutta
40056f3e65 iopsys-analytics: enable dmcli remote connection 2025-09-02 10:03:03 +05:30
Vivek Kumar Dutta
110589b1e2 sulu: remove jq dependency 2025-09-01 21:24:21 +05:30
Erik Karlsson
a3352224c2 sulu: depend on local MQTT listener regardlessly of variant 2025-09-01 21:24:10 +05:30
Erik Karlsson
9e3cbbc1f7 sulu: remove faulty mosquitto option
The actual spelling of this option is require_certificate and it is
anyway not relevant here since it is not a TLS listener.
2025-09-01 21:23:58 +05:30
Vivek Dutta
dd18f6f9ed sulu: Fix restarting of mqtt broker 2025-09-01 21:23:46 +05:30
Vivek Kumar Dutta
e69fba300a sulu: support dynamic QR 2025-09-01 21:23:30 +05:30
Vivek Kumar Dutta
0bd3c5e020 usp-js: 1.2.9 2025-09-01 17:28:03 +05:30
Vivek Kumar Dutta
bd115c48bf usp-js: 1.2.8 2025-09-01 17:27:47 +05:30
Vivek Dutta
6241dc0500 parental-control: improve dns packet inspection
(cherry picked from commit 1a80f2df47)

Co-authored-by: Vivek Kumar Dutta <vivek.dutta@iopsys.eu>
2025-08-28 12:53:59 +05:30
Vivek Dutta
5986d9ad3f parental-control: improve packet capture rules for DNS
(cherry picked from commit 9b79eb42db)

Co-authored-by: Mohd Husaam Mehdi <husaam.mehdi@iopsys.eu>
2025-08-28 12:48:36 +05:30
Vivek Dutta
e1d1b37edf parental-control: flush hw_nat along with conntrack
(cherry picked from commit 602926b076)

Co-authored-by: Mohd Husaam Mehdi <husaam.mehdi@iopsys.eu>
2025-08-28 12:48:01 +05:30
Vivek Kumar Dutta
ac6c0c3e60 bbfdm: fix log levels 2025-08-27 16:39:59 +05:30
Filip Matusiak
ee13ac5774 self-diagnostics: update wifi data collection 2025-08-25 15:14:57 +02:00
Filip Matusiak
f4fa5821e5 self-diagnostics: get status of MLD stations 2025-08-25 15:12:00 +02:00
Filip Matusiak
324f482548 map-controller: 6.4.0.13
Default logging level to INFO (2)
2025-08-22 16:34:05 +02:00
Jakob Olsson
a794e51f56 map-controller: 6.4.0.12 2025-08-21 15:45:48 +02:00
Mohd Husaam Mehdi
8bdc47344a parental-control: fix cleanup when bundle is default enabled 2025-08-20 20:18:04 +05:30
Husaam Mehdi
544b0346d7 parental-control: auto enable urlbundle based on /apps 2025-08-20 19:22:12 +05:30
Markus Gothe
b95714fcb9 libdsl: 7.3.2 2025-08-11 09:06:59 +02:00
Jakob Olsson
19ff37bd9b map-agent: 6.3.6.11 2025-08-07 15:27:56 +02:00
Markus Gothe
95f47e28a1 libdsl: Fix issue with G.vectoring. 2025-08-07 14:17:51 +02:00
Vivek Kumar Dutta
4edd2e5cbf tr104: Fix CallControlGroup Extension references 2025-08-07 16:48:32 +05:30
Suvendhu Hansa
3d54e83e0d icwmpd: Retry on bind failure 2025-08-07 15:36:57 +05:30
Markus Gothe
ead2de7ad1 xdsl_wan: ros -> roc. 2025-08-06 19:51:56 +02:00
Markus Gothe
8e21d2d702 xdsl_wan: Enable vectoring and G.iNP by default. 2025-08-06 19:35:41 +02:00
Vivek Kumar Dutta
a2627faef1 icwmp: use default port if not defined 2025-08-06 18:25:46 +05:30
Suvendhu Hansa
10a0fa34c3 wifidmd: sync with mapcontroller config 2025-08-06 16:57:12 +05:30
Jakob Olsson
6e8c83eafd map-agent: 6.3.6.10 2025-08-06 09:58:44 +02:00
Jakob Olsson
53cea83a61 map-agent: 6.3.6.9 2025-07-30 12:34:33 +02:00
Vivek Kumar Dutta
69ff8452e2 wifidmd: Fix legacy WiFi nodes for extenders 2025-07-29 18:29:57 +05:30
Suvendhu Hansa
f7c39b5fef wifidmd,map-agent: Fix legacy WiFi nodes for extenders 2025-07-29 18:27:58 +05:30
Jakob Olsson
7765b3de9c map-agent: 6.3.6.8 2025-07-28 12:17:13 +02:00
Vivek Kumar Dutta
a51d5e6616 wifidmd: Fix legacy nodes for extenders 2025-07-25 17:51:06 +05:30
Vivek Kumar Dutta
971392a796 xmppc: Fix ConnReqXMPPConnection value 2025-07-25 17:48:44 +05:30
Vivek Kumar Dutta
291cd43b10 bbfdm: Fix internal dm references 2025-07-25 17:44:11 +05:30
137 changed files with 2706 additions and 1939 deletions

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bbfdm
PKG_VERSION:=1.18.12
PKG_VERSION:=1.16.6.2
USE_LOCAL:=0
ifneq ($(USE_LOCAL),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
PKG_SOURCE_VERSION:=adfdb54d625b952c533670f093dae008782ff56a
PKG_SOURCE_VERSION:=aa480554461c82e6f6f44ee6c23108d3e44fce21
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -55,7 +55,7 @@ define Package/dm-service
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Datamodel ubus backend to expose micro-service tree
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +libbbfdm-ubus +bbf_configmngr +libeasy
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +libbbfdm-ubus +bbf_configmngr
endef
define Package/bbf_configmngr
@@ -149,10 +149,10 @@ define Package/bbfdmd/install
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/bbf $(1)/lib/upgrade/keep.d/bbf
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/etc/uci-defaults/91-fix-bbfdmd-enabled-option $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/uci-defaults/ruleng.bbfdm $(1)/etc/uci-defaults
@@ -183,7 +183,6 @@ define Package/bbf_configmngr/install
$(INSTALL_BIN) ./files/etc/init.d/bbf_configd $(1)/etc/init.d/bbf_configd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_config_notify.sh $(1)/usr/share/bbfdm/scripts/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_default_reload.sh $(1)/etc/bbfdm/
$(INSTALL_DATA) ./files/etc/bbfdm/critical_services.json $(1)/etc/bbfdm/
endef

View File

@@ -1,51 +1,23 @@
{
"usp": [
"/etc/config/firewall",
"/etc/bbfdm/dmmap/dmmap_firewall",
"/etc/config/network",
"/etc/bbfdm/dmmap/IP",
"/etc/bbfdm/dmmap/Ethernet",
"/etc/bbfdm/dmmap/GRE",
"/etc/bbfdm/dmmap/IPv6rd",
"/etc/bbfdm/dmmap/PPP",
"/etc/bbfdm/dmmap/Routing",
"/etc/config/dhcp",
"/etc/bbfdm/dmmap/dmmap_dhcp",
"/etc/bbfdm/dmmap/dmmap_dhcp_client",
"/etc/bbfdm/dmmap/dmmap_dhcp_relay",
"/etc/bbfdm/dmmap/dmmap_dhcpv6",
"/etc/config/time",
"/etc/bbfdm/dmmap/dmmap_time",
"/etc/config/mapcontroller",
"/etc/config/wireless",
"/etc/bbfdm/dmmap/WiFi",
"/etc/config/ieee1905",
"/etc/config/mosquitto",
"/etc/config/nginx",
"/etc/config/netmode",
"/etc/bbfdm/dmmap/dmmap_netmode"
"firewall",
"network",
"dhcp",
"time",
"wireless",
"ieee1905",
"mapcontroller",
"mosquitto",
"nginx",
"netmode"
],
"cwmp": [
"/etc/config/firewall",
"/etc/bbfdm/dmmap/dmmap_firewall",
"/etc/config/network",
"/etc/bbfdm/dmmap/IP",
"/etc/bbfdm/dmmap/Ethernet",
"/etc/bbfdm/dmmap/GRE",
"/etc/bbfdm/dmmap/IPv6rd",
"/etc/bbfdm/dmmap/PPP",
"/etc/bbfdm/dmmap/Routing",
"/etc/config/dhcp",
"/etc/bbfdm/dmmap/dmmap_dhcp",
"/etc/bbfdm/dmmap/dmmap_dhcp_client",
"/etc/bbfdm/dmmap/dmmap_dhcp_relay",
"/etc/bbfdm/dmmap/dmmap_dhcpv6",
"/etc/config/mapcontroller",
"/etc/config/wireless",
"/etc/bbfdm/dmmap/WiFi",
"/etc/config/time",
"/etc/bbfdm/dmmap/dmmap_time",
"/etc/config/netmode",
"/etc/bbfdm/dmmap/dmmap_netmode"
"firewall",
"network",
"dhcp",
"mapcontroller",
"wireless",
"time",
"netmode"
]
}

View File

@@ -10,10 +10,19 @@ log() {
echo "${@}"|logger -t bbf.config -p info
}
create_needed_directories()
{
mkdir -p /tmp/bbfdm/.cwmp
mkdir -p /tmp/bbfdm/.usp
mkdir -p /tmp/bbfdm/.bbfdm
}
start_service()
{
local log_level
create_needed_directories
config_load bbfdm
config_get log_level "reload_handler" log_level 2
@@ -27,6 +36,6 @@ start_service()
service_triggers() {
for config_file in /etc/config/*; do
config_name=$(basename "$config_file")
procd_add_config_trigger "config.change" "$config_name" /usr/share/bbfdm/scripts/bbf_config_notify.sh "$config_name"
procd_add_config_trigger "config.change" "$config_name" /usr/share/bbfdm/scripts/bbf_config_notify.sh
done
}

View File

@@ -5,7 +5,6 @@ STOP=05
USE_PROCD=1
PROG=/usr/sbin/dm-service
DM_AGENT_PROG=/usr/sbin/dm-agent
BBFDM_MICROSERVICE_DIR="/etc/bbfdm/services"
@@ -25,8 +24,7 @@ validate_bbfdm_micro_service_section()
_add_microservice()
{
local name path loglevel
local enable enable_core unified_daemon dm_framework
local daemon_prog
local enable enable_core unified_daemon
# Check enable from micro-service
path="${1}"
@@ -49,25 +47,14 @@ _add_microservice()
return 0
fi
json_get_var dm_framework dm-framework 0
if [ "${dm_framework}" -eq "1" ] || [ "${dm_framework}" = "true" ]; then
daemon_prog="${DM_AGENT_PROG}"
else
daemon_prog="${PROG}"
fi
json_select config
json_get_var loglevel loglevel 4
procd_open_instance "${name}"
procd_set_param command ${daemon_prog}
# Only add parameters for dm-service, not for dm-agent
if [ "${daemon_prog}" = "${PROG}" ]; then
procd_append_param command -m "${name}"
procd_append_param command -l "${loglevel}"
fi
procd_set_param command ${PROG}
procd_append_param command -m "${name}"
procd_append_param command -l "${loglevel}"
if [ "${enable_core}" -eq "1" ]; then
procd_set_param limits core="unlimited"

17
bridgemngr/Config.in Normal file
View File

@@ -0,0 +1,17 @@
if PACKAGE_bridgemngr
config BRIDGEMNGR_BRIDGE_VLAN
bool "Use bridge-vlan backend"
help
Set this option to use bridge-vlan as backend for VLAN objects.
config BRIDGEMNGR_BRIDGE_VENDOR_EXT
bool "Use bridge BBF vendor extensions"
default y
help
Set this option to use bridge BBF vendor extensions.
config BRIDGEMNGR_BRIDGE_VENDOR_PREFIX
string "Package specific datamodel Vendor Prefix for TR181 extensions"
default ""
endif

75
bridgemngr/Makefile Normal file
View File

@@ -0,0 +1,75 @@
#
# Copyright (C) 2020-2024 iopsys
#
include $(TOPDIR)/rules.mk
PKG_NAME:=bridgemngr
PKG_VERSION:=1.0.18.2
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/bridgemngr
PKG_SOURCE_VERSION:=71ed529be038392071b0399bcfe9d46e89d3cb46
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include ../bbfdm/bbfdm.mk
define Package/bridgemngr
CATEGORY:=Utilities
TITLE:=Bridge Manager
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
endef
define Package/bridgemngr/description
Package to add Device.Bridging. data model support.
endef
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
MAKE_PATH:=src
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_PREFIX),"")
VENDOR_PREFIX = $(CONFIG_BBF_VENDOR_PREFIX)
else
VENDOR_PREFIX = $(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_PREFIX)
endif
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(VENDOR_PREFIX)\\\"
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VLAN),y)
TARGET_CFLAGS += -DBRIDGE_VLAN_BACKEND
endif
define Package/bridgemngr/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libbridgemngr.so $(1) $(PKG_NAME)
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_EXT), y)
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/libbridgeext.so $(1) $(PKG_NAME) 10
$(BBFDM_INSTALL_MS_PLUGIN) -v ${VENDOR_PREFIX} ./files/VLAN_Filtering_Extension.json $(1) $(PKG_NAME) 11
endif
$(INSTALL_BIN) ./files/etc/init.d/bridging $(1)/etc/init.d/
$(INSTALL_DATA) ./files/etc/config/bridging $(1)/etc/config/
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) ~/git/bridgemngr/* $(PKG_BUILD_DIR)/
endef
endif
$(eval $(call BuildPackage,bridgemngr))

View File

@@ -2,7 +2,6 @@
"daemon": {
"enable": "1",
"service_name": "bridgemngr",
"dm-framework": true,
"unified_daemon": false,
"services": [
{

View File

@@ -0,0 +1,31 @@
{
"json_plugin_version": 2,
"Device.Bridging.Bridge.{i}.": {
"type": "object",
"protocols": [
"cwmp",
"usp"
],
"access": true,
"array": true,
"{BBF_VENDOR_PREFIX}VLANFiltering": {
"type": "boolean",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "boolean",
"description": "Enable or disable VLAN Filtering on this bridge.",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "vlan_filtering"
}
]
}
}
}

View File

@@ -77,7 +77,6 @@ handle_ebtables_rule() {
}
start_service() {
ubus -t 30 wait_for network.device uci
config_load bridging
config_foreach handle_ebtables_chain chain
config_foreach handle_ebtables_rule rule

View File

@@ -7,13 +7,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bulkdata
PKG_VERSION:=2.1.23
PKG_VERSION:=2.1.20
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bulkdata.git
PKG_SOURCE_VERSION:=f54550f2d587a701c0a8d5cac4a0910a99ce92cf
PKG_SOURCE_VERSION:=a5e57962938ca143ede65d92be90b6e9fce66e15
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -4,16 +4,4 @@ config DECOLLECTOR_EASYMESH_VERSION
int "Support Easymesh version"
default 6
config DECOLLECTOR_BUILD_TR181_PLUGIN
bool "Build TR-181 mapping module (responsible for Device.WiFi.DataElements.)"
default y
config DECOLLECTOR_VENDOR_EXTENSIONS
bool "Iopsys vendor extensions for Device.WiFi.DataElements."
default y
config DECOLLECTOR_VENDOR_PREFIX
string "Package specific datamodel Vendor Prefix for TR181 extensions"
default ""
endmenu

View File

@@ -6,12 +6,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=decollector
PKG_VERSION:=6.2.2.7
PKG_VERSION:=6.2.1.8
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=9d1399c09f55da14a8de55828ba57c0e296ce62f
PKG_SOURCE_VERSION:=b7e294d7c610adfd80cf40a0628c189695dc5156
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
@@ -24,7 +24,6 @@ PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
define Package/decollector
SECTION:=utils
@@ -67,18 +66,6 @@ MAKE_PATH:=src
TARGET_CFLAGS += -DEASYMESH_VERSION=$(CONFIG_DECOLLECTOR_EASYMESH_VERSION)
ifeq ($(CONFIG_DECOLLECTOR_BUILD_TR181_PLUGIN),y)
MAKE_FLAGS += DECOLLECTOR_BUILD_TR181_PLUGIN=y
ifeq ($(CONFIG_DECOLLECTOR_VENDOR_EXTENSIONS),y)
TARGET_CFLAGS += -DDECOLLECTOR_VENDOR_EXTENSIONS
ifeq ($(CONFIG_DECOLLECTOR_VENDOR_PREFIX),"")
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
else
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_DECOLLECTOR_VENDOR_PREFIX)\\\"
endif
endif
endif
EXECS := \
$(if $(CONFIG_PACKAGE_decollector),decollector)
@@ -89,7 +76,6 @@ define Package/decollector/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) ./files/decollector.init $(1)/etc/init.d/decollector
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/decollector $(1)/usr/sbin/
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
endef
$(eval $(call BuildPackage,decollector))

View File

@@ -1,26 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "decollector",
"unified_daemon": true,
"services": [
{
"parent_dm": "Device.WiFi.",
"object": "DataElements"
}
],
"config": {
"loglevel": "3"
},
"apply_handler": {
"uci": [
{
"file": [
"mapcontroller"
],
"external_handler": "/etc/wifidmd/bbf_config_reload.sh"
}
]
}
}
}

View File

@@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dectmngr
PKG_RELEASE:=3
PKG_VERSION:=3.7.11
PKG_VERSION:=3.7.10
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=815ee44808169b8e1efa2cac44bd7d238ad33cdc
PKG_SOURCE_VERSION:=1f851980a6ba616df54f79930225f8bcd563b711
PKG_MIRROR_HASH:=skip
endif

View File

@@ -1,207 +0,0 @@
#
# Copyright (c) 2023 Genexis B.V. All rights reserved.
# This Software and its content are protected by the Dutch Copyright Act
# ('Auteurswet'). All and any copying and distribution of the software
# and its content without authorization by Genexis B.V. is
# prohibited. The prohibition includes every form of reproduction and
# distribution.
#
#
include $(TOPDIR)/rules.mk
PKG_NAME:=dm-framework
PKG_VERSION:=1.0.0
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/lcm/dm-framework.git
PKG_SOURCE_VERSION:=37dade4a2df6eaf6a4291a06ac776641ed81a79e
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
# Build directories for each component
DATAMODELS_BUILD_DIR:=$(PKG_BUILD_DIR)/datamodels-build
DMAPI_BUILD_DIR:=$(PKG_BUILD_DIR)/dm-api-build
DMAGENT_BUILD_DIR:=$(PKG_BUILD_DIR)/dm-agent-build
include $(INCLUDE_DIR)/package.mk
-include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
#
# Datamodels Package Definition
#
define Package/datamodels
SECTION:=utils
CATEGORY:=Genexis
TITLE:=dm-framework Datamodel
URL:=http://www.genexis.eu
PKG_LICENSE:=GENEXIS
PKG_LICENSE_URL:=
endef
define Package/datamodels/description
This package contains dm-framework datamodel.
endef
#
# DM-API Package Definition
#
define Package/dm-api
CATEGORY:=Genexis
TITLE:=dm-api
PKG_BUILD_DEPENDS:=datamodels
DEPENDS:=+libsqlite3 \
+libjson-c +libstdcpp +quickjs \
+libubus +libubox +libuci
URL:=http://www.genexis.eu
PKG_LICENSE:=GENEXIS
PKG_LICENSE_URL:=
endef
define Package/dm-api/description
This package contains api for the dm-framework
endef
#
# DM-Agent Package Definition
#
define Package/dm-agent
DEPENDS:=+dm-api +datamodels +libubox +libubus +ubus
CATEGORY:=Genexis
TITLE:=dm-framework agent
URL:=http://www.genexis.eu
PKG_LICENSE:=GENEXIS
PKG_LICENSE_URL:=
endef
define Package/dm-agent/description
This package contains dm-framework agent.
endef
#
# Build Preparation
#
define Build/Prepare
$(call Build/Prepare/Default)
# Prepare datamodels
mkdir -p $(DATAMODELS_BUILD_DIR)
$(CP) -rf $(PKG_BUILD_DIR)/datamodels/* $(DATAMODELS_BUILD_DIR)/
# Copy scripts from top-level scripts directory
mkdir -p $(DATAMODELS_BUILD_DIR)/scripts
$(CP) -rf $(PKG_BUILD_DIR)/scripts/* $(DATAMODELS_BUILD_DIR)/scripts/
cd $(DATAMODELS_BUILD_DIR); \
npm install better-sqlite3 quickjs && \
node ./scripts/json2code.js && \
node ./scripts/qjs-handlers-validate.js
# Prepare dm-api
mkdir -p $(DMAPI_BUILD_DIR)
$(CP) -rf $(PKG_BUILD_DIR)/dm-api/* $(DMAPI_BUILD_DIR)/
# Prepare dm-agent
mkdir -p $(DMAGENT_BUILD_DIR)
$(CP) -rf $(PKG_BUILD_DIR)/dm-agent/* $(DMAGENT_BUILD_DIR)/
endef
TARGET_CFLAGS += $(FPIC)
#
# Build Compilation
#
define Build/Compile
# Build datamodels first (dependency for others)
$(MAKE) -C $(DATAMODELS_BUILD_DIR)\
PROJECT_ROOT="$(DATAMODELS_BUILD_DIR)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
ARCH="$(LINUX_KARCH)" \
EXTRA_CFLAGS="$(TARGET_CFLAGS) -I$(DATAMODELS_BUILD_DIR)" \
all
# Build dm-api (depends on datamodels)
$(MAKE) -C $(DMAPI_BUILD_DIR)\
PROJECT_ROOT="$(DMAPI_BUILD_DIR)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
ARCH="$(LINUX_KARCH)" \
EXTRA_CFLAGS="$(TARGET_CFLAGS) -I$(DMAPI_BUILD_DIR)" \
all
# Build dm-agent (depends on both)
$(MAKE) -C $(DMAGENT_BUILD_DIR)\
PROJECT_ROOT="$(DMAGENT_BUILD_DIR)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
ARCH="$(LINUX_KARCH)" \
EXTRA_CFLAGS="$(TARGET_CFLAGS) -I$(DMAGENT_BUILD_DIR)" \
all
endef
#
# Development Installation (headers and libraries)
#
define Build/InstallDev
# Datamodels development files
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(DATAMODELS_BUILD_DIR)/dm.h $(1)/usr/include/
$(CP) $(DATAMODELS_BUILD_DIR)/libdm.so $(1)/usr/lib/
# DM-API development files - headers are now in dm-api/include/
$(CP) $(DMAPI_BUILD_DIR)/include/dm_types.h $(1)/usr/include/
$(CP) $(DMAPI_BUILD_DIR)/include/dm_node.h $(1)/usr/include/
$(CP) $(DMAPI_BUILD_DIR)/core/dm_api.h $(1)/usr/include/
$(CP) $(DMAPI_BUILD_DIR)/core/dm_linker.h $(1)/usr/include/
$(CP) $(DMAPI_BUILD_DIR)/core/dbmgr.h $(1)/usr/include/
$(CP) $(DMAPI_BUILD_DIR)/include/dm_log.h $(1)/usr/include/
$(CP) $(DMAPI_BUILD_DIR)/utils/dm_list.h $(1)/usr/include/
$(CP) $(DMAPI_BUILD_DIR)/libdmapi.so $(1)/usr/lib/
endef
#
# Package Installation - Datamodels
#
define Package/datamodels/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/bbfdm
$(INSTALL_DIR) $(1)/usr/lib/dmf_handlers
$(INSTALL_BIN) $(DATAMODELS_BUILD_DIR)/default.db $(1)/etc/bbfdm/default_dm.db
$(INSTALL_BIN) $(DATAMODELS_BUILD_DIR)/libdm.so $(1)/usr/lib/
# Copy handler files from datamodels directory (new structure)
# Copy .js files from root datamodels directory
( cd $(DATAMODELS_BUILD_DIR); \
find . -maxdepth 1 -type f -name '*.js' -not -path './.*' -exec $(INSTALL_BIN) {} $(1)/usr/lib/dmf_handlers/{} \; )
# Copy .js files from subdirectories, preserving folder structure (skip hidden files/folders)
( cd $(DATAMODELS_BUILD_DIR); \
find . -type d -mindepth 1 -not -path './.*' -not -path './scripts*' -exec $(INSTALL_DIR) $(1)/usr/lib/dmf_handlers/{} \; ; \
find . -type f -name '*.js' -mindepth 2 -not -path './.*' -not -path './scripts*' -exec $(INSTALL_BIN) {} $(1)/usr/lib/dmf_handlers/{} \; )
endef
#
# Package Installation - DM-API
#
define Package/dm-api/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/sbin/
$(INSTALL_BIN) $(DMAPI_BUILD_DIR)/libdmapi.so $(1)/usr/lib/
endef
#
# Package Installation - DM-Agent
#
define Package/dm-agent/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_BIN) ./files/etc/init.d/bridging $(1)/etc/init.d/
$(INSTALL_DATA) ./files/etc/config/bridging $(1)/etc/config/
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) dm-agent
$(INSTALL_BIN) $(DMAGENT_BUILD_DIR)/dm-agent $(1)/usr/sbin
endef
# Register all three packages
$(eval $(call BuildPackage,datamodels))
$(eval $(call BuildPackage,dm-api))
$(eval $(call BuildPackage,dm-agent))

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ethmngr
PKG_VERSION:=3.1.3
PKG_VERSION:=3.0.8
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/ethmngr.git
PKG_SOURCE_VERSION:=7bc8297e1a74adb522f7635bab4f93a1a2620216
PKG_SOURCE_VERSION:=c73e5b15718ca40b2740bbe6151dfbb2bcca16df
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -10,14 +10,19 @@ PKG_NAME:=fdtextract
PKG_RELEASE:=1
PKG_VERSION:=1.0
PKG_SOURCE_URL:=https://dev.iopsys.eu/system/fdtextract.git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/fdtextract.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=7917dbcb29724476cd46164eec29848df1e5fb67
PKG_SOURCE_VERSION:=e3cefda3b26c9aea3021b20725ce7b31b33eebc4
PKG_MIRROR_HASH:=skip
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=LICENSE
RSTRIP:=true
export BUILD_DIR
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_PARALLEL:=1
@@ -35,7 +40,9 @@ endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fdtextract $(1)/usr/sbin/
$(STRIP) $(1)/usr/sbin/fdtextract
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -8,5 +8,11 @@ config FIREWALLMNGR_PORT_TRIGGER
help
Set this option to include support for PortTrigger object.
config FIREWALLMNGR_NAT_INTERFACE_SETTING
bool "Include Device.NAT.InterfaceSetting"
default y
help
Set this option to include support for NAT InterfaceSetting object.
endmenu
endif

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=firewallmngr
PKG_VERSION:=1.0.10
PKG_VERSION:=1.0.9.2
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/firewallmngr.git
PKG_SOURCE_VERSION:=05ad0d6f7f21520eecd05429c14d1963de2a8463
PKG_SOURCE_VERSION:=fdabd33cf42ac02adadbdf43bd8bf86a62d7d1e3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -52,6 +52,10 @@ ifeq ($(CONFIG_FIREWALLMNGR_PORT_TRIGGER),y)
TARGET_CFLAGS += -DINCLUDE_PORT_TRIGGER
endif
ifeq ($(CONFIG_FIREWALLMNGR_NAT_INTERFACE_SETTING),y)
TARGET_CFLAGS += -DINCLUDE_NAT_IF_SETTING
endif
define Package/firewallmngr/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/uci-defaults

View File

@@ -40,22 +40,22 @@ get_vivsoi() {
#hex-string 2 character=1 Byte
# length in hex string will be twice of actual Byte length
[ "${len}" -gt 8 ] || return
[ "$len" -gt "8" ] || return
data="${opt125}"
rem_len="${len}"
while [ "${rem_len}" -gt 0 ]; do
while [ $rem_len -gt 0 ]; do
ent_id=${data:0:8}
ent_id=$(printf "%d\n" "0x$ent_id")
if [ "${ent_id}" -ne 3561 ]; then
if [ $ent_id -ne 3561 ]; then
len_val=${data:8:2}
data_len=$(printf "%d\n" "0x$len_val")
# add 4 byte for ent_id and 1 byte for len
data_len=$(( data_len * 2 + 10 ))
# move ahead data to next enterprise id
data=${data:"${data_len}":"${rem_len}"}
rem_len=$(( rem_len - data_len ))
rem_len=$(( rem_len - $data_len ))
continue
fi
@@ -66,7 +66,7 @@ get_vivsoi() {
data_len=$(( data_len * 2 + 10 ))
opt_len=$(printf "%d\n" "0x$len_val")
[ "${opt_len}" -eq 0 ] && return
[ $opt_len -eq 0 ] && return
# populate the option data of enterprise id
sub_data_len=$(( opt_len * 2))
@@ -74,7 +74,7 @@ get_vivsoi() {
sub_data=${data:10:"${sub_data_len}"}
# parsing of suboption of option 125
while [ "${sub_data_len}" -gt 0 ]; do
while [ $sub_data_len -gt 0 ]; do
# get the suboption id
sub_opt_id=${sub_data:0:2}
sub_opt_id=$(printf "%d\n" "0x$sub_opt_id")
@@ -85,20 +85,20 @@ get_vivsoi() {
sub_opt_len=$(( sub_opt_len * 2 ))
# get the value of sub option starting 4 means starting after length
sub_opt_val=${sub_data:4:"${sub_opt_len}"}
sub_opt_val=${sub_data:4:${sub_opt_len}}
# assign the value found in sub option
case "${sub_opt_id}" in
"4")
OUI=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
OUI=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
GW_DISCOVERED=1
;;
"5")
SERIAL=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
SERIAL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
GW_DISCOVERED=1
;;
"6")
CLASS=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
CLASS=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
GW_DISCOVERED=1
;;
esac
@@ -110,7 +110,7 @@ get_vivsoi() {
sub_data_len=$((sub_data_len - sub_opt_end))
# fetch next sub option hex string
sub_data=${sub_data:"${sub_opt_end}":"${sub_data_len}"}
sub_data=${sub_data:${sub_opt_end}:${sub_data_len}}
done
# move ahead data to next enterprise id
@@ -131,13 +131,15 @@ send_host_query() {
sleep 5
json_load "$(ubus call umdns browse)"
if ! json_select discovered_services; then
json_select discovered_services
if [ "${?}" -ne 0 ]; then
json_cleanup
loop=$(( loop - 1 ))
continue
fi
if ! json_select _usp-agt-mqtt._tcp; then
json_select _usp-agt-mqtt._tcp
if [ "${?}" -ne 0 ]; then
json_cleanup
loop=$(( loop - 1 ))
continue
@@ -154,7 +156,7 @@ send_host_query() {
json_get_keys keys
for key in $keys; do
json_select "${key}"
json_select $key
json_get_var _host host ""
if [ -z "${_host}" ] || [[ "${sent_host}" =~ " ${_host}" ]]; then
@@ -164,10 +166,9 @@ send_host_query() {
sent_host="${sent_host} ${_host}"
cmd="ubus call umdns query '{\"question\":\"$_host\",\"interface\":\"$intf\"}'"
sh -c "${cmd}"
eval $cmd
resp=0
json_select ..
sleep 2 # umdns query sometime takes time to resolve so adding some sleep
done
json_cleanup
@@ -184,29 +185,32 @@ get_usp_agent_id() {
fi
json_load "$(ubus call umdns browse)"
if ! json_select discovered_services; then
json_select discovered_services
if [ "${?}" -ne 0 ]; then
json_cleanup
echo "${ID}"
echo ${ID}
return 0
fi
if ! json_select _usp-agt-mqtt._tcp; then
json_select _usp-agt-mqtt._tcp
if [ "${?}" -ne 0 ]; then
json_cleanup
echo "${ID}"
echo ${ID}
return 0
fi
json_get_keys keys
for key in $keys; do
json_select "${key}"
if ! json_select "${family}"; then
json_select $key
json_select $family
if [ "${?}" -ne 0 ]; then
json_select ..
continue
fi
json_get_keys ips
for ip in $ips; do
json_get_var ip_val "${ip}"
json_get_var ip_val $ip
if [ "${ip_val}" != "${dhcp_ip}" ]; then
continue
fi
@@ -215,8 +219,8 @@ get_usp_agent_id() {
json_select txt
json_get_keys txts
for _txt in $txts; do
json_get_var text_val "${_txt}"
if [[ "${text_val:0:3}" = "ID=" ]]; then
json_get_var text_val $_txt
if [[ "${text_val:0:3}" == "ID=" ]]; then
ID="${text_val:3}"
break
fi
@@ -234,16 +238,16 @@ get_usp_agent_id() {
done
json_cleanup
echo "${ID}"
echo ${ID}
}
get_mac_address() {
ip="${1}"
device="${2}"
mac=$(grep "${ip}" /proc/net/arp | awk '{print $4}')
mac="$(cat /proc/net/arp | grep $ip | awk '{print $4}')"
if [ -z "${mac}" ]; then
arp_resp=$(arping -b -f -c 5 -I "${device}" "${ip}" | grep 'Unicast reply from' | awk '{print $5}')
arp_resp="$(arping -b -f -c 5 -I $device $ip | grep 'Unicast reply from' | awk '{print $5}')"
if [ -n "${arp_resp}" ]; then
mac=${arp_resp:1:-1}
fi
@@ -256,7 +260,7 @@ send_unknown_gw_event() {
mac="${1}"
cmd="ubus -t 5 send gateway-info.gateway.unknown '{\"hwaddr\":\"$mac\"}'"
sh -c "${cmd}"
eval $cmd
}
send_cwmp_gw_event() {
@@ -265,14 +269,14 @@ send_cwmp_gw_event() {
serial="${3}"
cmd="ubus -t 5 send gateway-info.gateway.cwmp '{\"oui\":\"$oui\",\"class\":\"$class\",\"serial\":\"$serial\"}'"
sh -c "${cmd}"
eval $cmd
}
send_usp_gw_event() {
endpoint="${1}"
cmd="ubus -t 5 send gateway-info.gateway.usp '{\"endpoint\":\"$endpoint\"}'"
sh -c "${cmd}"
eval $cmd
}
config_load gateway
@@ -283,13 +287,13 @@ if [ "${enable}" -eq 0 ]; then
return 0
fi
if [ "${wan_intf}" = "${INTERFACE}" ]; then
if [ "${1}" = "deconfig" ]; then
if [ "${wan_intf}" == "${INTERFACE}" ]; then
if [ "${1}" == "deconfig" ]; then
rm -rf /var/state/gwinfo
return 0
fi
json_load "$(ifstatus "${INTERFACE}")"
json_load "$(ifstatus ${INTERFACE})"
json_get_var dev_name device ""
json_select data
json_get_var dhcp_ip dhcpserver ""
@@ -299,7 +303,7 @@ if [ "${wan_intf}" = "${INTERFACE}" ]; then
return 0
fi
MAC=$(get_mac_address "${dhcp_ip}" "${dev_name}")
MAC="$(get_mac_address $dhcp_ip $dev_name)"
mkdir -p /var/state
touch /var/state/gwinfo
@@ -322,8 +326,8 @@ if [ "${wan_intf}" = "${INTERFACE}" ]; then
return 0
fi
len=$(echo -n "${opt125}" | wc -c)
get_vivsoi "${opt125}" "${len}"
len=$(printf "$opt125"|wc -c)
get_vivsoi "$opt125" "$len"
if [ "${GW_DISCOVERED}" -eq 0 ]; then
send_unknown_gw_event "${MAC}"
@@ -337,18 +341,19 @@ if [ "${wan_intf}" = "${INTERFACE}" ]; then
uci -q -c /var/state commit gwinfo
# Check for USP parameters
if ! ubus -t 15 wait_for umdns; then
ubus -t 15 wait_for umdns
if [ "${?}" -ne 0 ]; then
send_cwmp_gw_event "${OUI}" "${CLASS}" "${SERIAL}"
return 0
fi
resp=$(send_host_query "${dev_name}")
resp=$(send_host_query $dev_name)
if [ "${resp}" -ne 0 ]; then
send_cwmp_gw_event "${OUI}" "${CLASS}" "${SERIAL}"
return 0
fi
ID=$(get_usp_agent_id "${dhcp_ip}")
ID="$(get_usp_agent_id $dhcp_ip)"
if [ -z "${ID}" ]; then
send_cwmp_gw_event "${OUI}" "${CLASS}" "${SERIAL}"
return 0

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=hostmngr
PKG_VERSION:=1.4.0
PKG_VERSION:=1.3.3
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=230d55ae6769e1ebde02cef3f718e6c4cf1b1962
PKG_SOURCE_VERSION:=fee5bd0067fc1f30498bc2b81e893d170796b459
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/hostmngr.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip

View File

@@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=9.10.5
PKG_VERSION:=9.9.9.5
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
PKG_SOURCE_VERSION:=7f4a159f6ff49584655e57bb801218eb083fba67
PKG_SOURCE_VERSION:=f3d5843c54a4c1c3e74629f0953a3bf144c2fa8e
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -31,6 +31,7 @@ config cpe 'cpe'
option bind_retries '5'
option userid '' #$OUI-$SER
option passwd ''
option port '7547'
option provisioning_code ''
option amd_version '5'
# compression possible configs: InstanceNumber, InstanceAlias

View File

@@ -133,56 +133,9 @@ add_firewall_rule() {
fi
}
remove_port_protection() {
local enabled chain rule rule_num
config_get enabled "${1}" "${2}"
if [ "${enabled}" -eq 1 ]; then
config_get zonename "$1" name
[ -n "$zonename" ] || return 0
chain='prerouting_'$zonename'_rule'
while rule=$(iptables -w -t nat -nL "$chain" --line-numbers | grep -m 1 -w CWMP_Port_protection); do
rule_num=${rule%%[$' \t']*}
iptables -w -t nat -D "$chain" "$rule_num"
done
fi
}
cleanup_port_protection() {
config_load firewall
config_foreach remove_port_protection zone masq
}
install_port_protection() {
local PORT="${3}"
local enabled zonename chain
config_get enabled "${1}" "${2}"
if [ "${enabled}" -eq 1 ]; then
config_get zonename "${1}" name
[ -n "$zonename" ] || return 0
chain='prerouting_'$zonename'_rule'
iptables -w -t nat -I "$chain" -p tcp --dport "$PORT" -j ACCEPT -m comment --comment=CWMP_Port_protection
iptables -w -t nat -I "$chain" -p udp --dport "$PORT" -j ACCEPT -m comment --comment=CWMP_Port_protection
fi
}
add_port_protection() {
config_load firewall
config_foreach install_port_protection zone masq "${1}"
}
configure_connection_req_rules() {
app="${1}"
cleanup_port_protection
wan="$(uci -q get cwmp.cpe.default_wan_interface)"
wan="${wan:-wan}"
@@ -222,11 +175,8 @@ configure_connection_req_rules() {
fi
fi
port=$(uci -q -c /var/state get icwmp.cpe.port)
if [ -z "${port}" ]; then
log "cwmp cpe port not configured"
exit 0
fi
port=$(uci -q get cwmp.cpe.port)
port="${port:-7547}"
ipaddr=$(uci -q get cwmp.cpe.allowed_cr_ip)
if [ -n "${ipaddr}" ]; then
@@ -247,8 +197,6 @@ configure_connection_req_rules() {
# Close the ACS port at Lan side
close_downstream_acs_port "${lan}" "${port}"
fi
add_port_protection "${port}"
}
load_zone_names

View File

@@ -5,6 +5,7 @@ uci -q batch <<-EOT
set firewall.cwmp=include
set firewall.cwmp.path=/etc/icwmpd/firewall.cwmp
set firewall.cwmp.reload=1
commit firewall
EOT
exit 0

View File

@@ -16,12 +16,12 @@ get_opt43() {
local opt43="$1"
local len="$2"
[ "${len}" -gt 2 ] || return
[ "$len" -gt "2" ] || return
first_byte=${opt43:0:2}
first_byte=$(printf "%d\n" "0x$first_byte")
if [ "${len}" -ge 4 ] && [ "${first_byte}" -ge 1 ] && [ "${first_byte}" -le 4 ]; then
if [ $len -ge 4 ] && [ $first_byte -ge 1 ] && [ $first_byte -le 4 ]; then
# it is in encapsulated form
# opt43 encapsulated vendor-specific option has data in below format
# Code Len Data item Code Len Data item Code
@@ -35,7 +35,7 @@ get_opt43() {
data="${opt43}"
rem_len="${len}"
# parsing of suboption of option 43
while [ "${rem_len}" -gt 0 ]; do
while [ $rem_len -gt 0 ]; do
# get the suboption id
sub_opt_id=${data:0:2}
sub_opt_id=$(printf "%d\n" "0x$sub_opt_id")
@@ -50,13 +50,13 @@ get_opt43() {
# assign the value found in sub option
case "${sub_opt_id}" in
"1") DHCP_ACS_URL=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
"1") DHCP_ACS_URL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
;;
"2") DHCP_PROV_CODE=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
"2") DHCP_PROV_CODE=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
;;
"3") MIN_WAIT_INVL=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
"3") MIN_WAIT_INVL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
;;
"4") INVL_MULTIPLIER=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
"4") INVL_MULTIPLIER=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
;;
esac
@@ -70,14 +70,13 @@ get_opt43() {
rem_len=$((rem_len - sub_opt_end))
done
else
DHCP_ACS_URL=$(echo -n "${opt43}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
DHCP_ACS_URL=$(echo -n $opt43 | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
fi
}
config_load cwmp
config_get wan_intf cpe default_wan_interface "wan"
config_get dhcp_discovery acs dhcp_discovery "0"
config_get_bool insecure_enable acs insecure_enable "0"
config_get dhcp_url acs dhcp_url ""
config_get min_wait_intvl acs dhcp_retry_min_wait_interval "0"
config_get intvl_multi acs dhcp_retry_interval_multiplier "0"
@@ -93,9 +92,9 @@ if [ "$discovery_enable" = "0" ]; then
return 0
fi
if [ "${wan_intf}" = "${INTERFACE}" ]; then
if [ "${wan_intf}" == "${INTERFACE}" ]; then
if [ -n "$opt43" ]; then
len=$(echo -n "$opt43"|wc -c)
len=$(printf "$opt43"|wc -c)
get_opt43 "$opt43" "$len"
fi
@@ -103,17 +102,6 @@ if [ "${wan_intf}" = "${INTERFACE}" ]; then
return 0
fi
if [ "${insecure_enable}" -eq "0" ]; then
case $DHCP_ACS_URL in
https://*)
log "ACS url $DHCP_ACS_URL has https"
;;
*)
return 0
;;
esac
fi
sec=$(uci -q get cwmp.acs)
if [ -z "${sec}" ]; then

View File

@@ -6,12 +6,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ieee1905
PKG_VERSION:=8.7.39
PKG_VERSION:=8.7.33
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=85fa0fe16d6a5a3452422b72186f6bbb16a13c62
PKG_SOURCE_VERSION:=f28f1c04cae008d7d6448ba02b992506af28448c
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/ieee1905.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
@@ -116,7 +116,7 @@ MAKE_PATH:=src
define Package/ieee1905/install
$(CP) ./files/etc $(1)/
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
$(INSTALL_DIR) $(1)/usr/sbin

View File

@@ -1,23 +0,0 @@
{
"Device.IEEE1905.AL.": {
"type": "object",
"protocols": [
"cwmp",
"usp"
],
"access": false,
"array": false,
"{BBF_VENDOR_PREFIX}LocalOnlyMode": {
"type": "boolean",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"description": "Enable or disable interfaces from ieee1905.",
"datatype": "boolean"
}
}
}

View File

@@ -34,9 +34,6 @@ define Package/$(PKG_NAME)
+@PACKAGE_syslog-ng:SYSLOGNG_LOGROTATE \
+PACKAGE_fluent-bit:logrotate \
+@DMCLI_REMOTE_CONNECTION
# tools used in development/testing
DEPENDS+= \
+iperf3
endef

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libdpp
PKG_VERSION:=2.1.1
PKG_VERSION:=2.1.2
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=6024efd3db9dd490c07465ea9b0c15120063165c
PKG_SOURCE_VERSION:=5f1184c52be19f3bfd3bc7e9bc582ef09b0a2b1c
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/libdpp.git
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz

View File

@@ -1,28 +1,32 @@
#
# Copyright (C) 2025 Genexis Sweden AB
# Copyright (C) 2020-2023 Iopsys
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libeasy
PKG_VERSION:=7.5.0
PKG_VERSION:=7.4.6
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=18f93677bb4d33ebb6249324a5043294f0eae16c
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/libeasy.git
PKG_SOURCE_VERSION:=ca7b20068c9d373e41045a2e899a9c697576262c
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libeasy.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=LGPL-2.1-only
PKG_LICENSE_FILES:=
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@genexis.eu>
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/openssl \
-I$(STAGING_DIR)/usr/include/libnl3
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
@@ -30,6 +34,9 @@ define Build/Prepare
endef
endif
MAKE_FLAGS += \
CFLAGS="$(TARGET_CFLAGS) -Wall"
define Package/libeasy
SECTION:=libs
CATEGORY:=Libraries
@@ -40,7 +47,7 @@ define Package/libeasy
endef
define Package/libeasy/description
This package provides libeasy.so for common utility functions.
Library provides common utility functions
endef
define Build/InstallDev/libeasy
@@ -60,7 +67,6 @@ define Build/InstallDev/libeasy
endef
define Build/InstallDev
$(call Build/InstallDev/cmake,$(1))
$(call Build/InstallDev/libeasy,$(1),$(2))
endef

View File

@@ -1,32 +1,27 @@
#
# Copyright (C) 2019-2024 Iopsys
# Copyright (C) 2025 Genexis Sweden AB
# Copyright (C) 2020-2023 Iopsys
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libwifi
PKG_VERSION:=7.22.6
PKG_VERSION:=7.13.7
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=ddeb681a9f99202b1ded6c965591bb8c1f5cb05d
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/libwifi.git
PKG_SOURCE_VERSION:=0b3cc45334c167d164c2c79e82522f13698abf92
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libwifi.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=LGPL-2.1-only
PKG_LICENSE_FILES:=
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@genexis.eu>
MAKE_VERBOSE := 1
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/cmake.mk
ifeq ($(CONFIG_TARGET_brcmbca),y)
TARGET_PLATFORM=BROADCOM
@@ -47,20 +42,10 @@ else ifeq ($(CONFIG_TARGET_armvirt),y)
else ifeq ($(CONFIG_TARGET_airoha),y)
TARGET_PLATFORM=ECONET
TARGET_WIFI_TYPE=MEDIATEK
TARGET_CFLAGS +=-DIOPSYS_ECONET -I$(LINUX_DIR)/include/uapi/linux/mtk_nl80211_inc
TARGET_CFLAGS +=-DIOPSYS_ECONET
ifeq ($(CONFIG_TARGET_airoha_an7581),y)
TARGET_CFLAGS +=-DCONFIG_MTK
endif
else ifeq ($(CONFIG_TARGET_mediatek),y)
TARGET_PLATFORM=MEDIATEK
TARGET_WIFI_TYPE=MAC80211
ifeq ($(CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_cx750),y)
TARGET_WIFI_TYPE=MEDIATEK
TARGET_CFLAGS +=-DCONFIG_MTK -I$(LINUX_DIR)/include/uapi/linux/mtk_nl80211_inc
else ifeq ($(CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_mediatek_mt7987a-spim-nand-an8801sb),y)
TARGET_WIFI_TYPE=MEDIATEK
TARGET_CFLAGS +=-DCONFIG_MTK -I$(LINUX_DIR)/include/uapi/linux/mtk_nl80211_inc
endif
else ifeq ($(CONFIG_TARGET_ipq95xx),y)
TARGET_PLATFORM=IPQ95XX
TARGET_WIFI_TYPE=QUALCOMM
@@ -82,7 +67,7 @@ endif
PKG_BUILD_DEPENDS:=PACKAGE_kmod-mt7915e_en7523:mt76_en7523
ifneq ($(CONFIG_PACKAGE_libwifi),)
CMAKE_OPTIONS +=-DHAS_WIFI=ON
TARGET_CFLAGS +=-DHAS_WIFI
endif
ifeq ($(CONFIG_LIBWIFI_USE_CTRL_IFACE),y)
@@ -93,8 +78,18 @@ ifeq ($(CONFIG_LIBWIFI_SKIP_PROBES),y)
TARGET_CFLAGS +=-DLIBWIFI_BRCM_SKIP_PROBES
endif
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/openssl \
-I$(STAGING_DIR)/usr/include/libnl3
CMAKE_OPTIONS += -DPLATFORM=$(TARGET_PLATFORM) -DWIFI_TYPE=$(TARGET_WIFI_TYPE)
MAKE_FLAGS += \
CFLAGS="$(TARGET_CFLAGS) -Wall -I./" \
LDFLAGS="$(TARGET_LDFLAGS)" \
FPIC="$(FPIC)" \
PLATFORM="$(TARGET_PLATFORM)" \
WIFI_TYPE="$(TARGET_WIFI_TYPE)" \
subdirs="$(subdirs)"
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
@@ -102,39 +97,43 @@ define Build/Prepare
endef
endif
define Package/libwifiutils
SECTION:=libs
CATEGORY:=Libraries
TITLE:= WiFi utility library (libwifiutils.so)
DEPENDS+=+libnl +libnl-route +libeasy +libopenssl
endef
define Package/libwifiutils/description
Library provides WiFi utility functions
endef
define Package/libwifi
SECTION:=libs
CATEGORY:=Libraries
TITLE:= WiFi HAL library (libwifi-7.so.m)
DEPENDS+=+libnl +libnl-route +libeasy +libwifiutils +TARGET_brcmbca:bcm963xx-bsp
define Package/libwifi-common
SECTION:=libs
CATEGORY:=Libraries
TITLE:=libwifi
SUBMENU:=IOPSYS HAL libs
DEPENDS:=+libopenssl
MENU:=1
endef
define Package/libwifi/description
Library provides WiFi HAL APIs
Library provides WiFi HAL APIs and WiFi common utility functions
endef
define Package/libwifiutils
$(call Package/libwifi-common)
TITLE:= WiFi utility library (libwifiutils.so)
DEPENDS+=+libnl +libnl-route +libeasy
endef
define Build/InstallDev/libwifiutils
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libwifiutils/wifidefs.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libwifiutils/wifiutils.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libwifiutils/libwifiutils*.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/wifidefs.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/wifiutils.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libwifiutils*.so* $(1)/usr/lib/
endef
define Package/libwifiutils/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libwifiutils/libwifiutils*.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/libwifiutils*.so* $(1)/usr/lib/
endef
define Package/libwifi
$(call Package/libwifi-common)
TITLE:= WiFi library (libwifi)
DEPENDS+=+libnl +libnl-route +libeasy +libwifiutils +TARGET_brcmbca:bcm963xx-bsp
endef
define Package/libwifi/config
@@ -155,12 +154,13 @@ define Package/libwifi/config
endif
endef
define Build/InstallDev/libwifi
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libwifi/wifiops.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libwifi/wifi.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi-7*.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/wifiops.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/wifi.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libwifi-7*.so* $(1)/usr/lib/
endef
@@ -173,7 +173,7 @@ endef
define Package/libwifi/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi-7*.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/libwifi-7*.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libwifiutils))

View File

@@ -77,12 +77,6 @@ create_default_filters() {
append_conf " rename msg message"
append_conf ""
append_conf "[FILTER]"
append_conf " name modify"
append_conf " match *"
append_conf " add pid 0"
append_conf ""
append_conf "[FILTER]"
append_conf " name sysinfo"
append_conf " match *"

View File

@@ -63,12 +63,8 @@ config AGENT_CHECK_PARTIAL_WIFI_RELOAD
bool "Option that allow SSID/PSK simple reload"
default y
config DYNBH
bool "Enable map-agent dynamic Ethernet backhaul management"
default n
config DYNBH_DYNAMICALLY_PERSIST_CONTROLLER
bool "Let map-agent through AP-Autoconfiguration Search and DHCP Discovery determine the controller or agent role"
config DYNBHD_DYNAMICALLY_PERSIST_CONTROLLER
bool "Let dynbhd through AP-Autoconfiguration Search and DHCP Discovery determine the controller or agent role"
config AGENT_UNASSOC_STA_CONT_MONITOR
bool "Enable continuos monitoring of unassociated clients"

View File

@@ -6,9 +6,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-agent
PKG_VERSION:=6.4.3.6
PKG_VERSION:=6.3.7.0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=e37b8f1a4b988b907416161e3c8fe83cd39597c3
PKG_SOURCE_VERSION:=ab9fa6ffc6978c84ab9a3b410d31c71c3b185430
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
PKG_LICENSE:=BSD-3-Clause
@@ -38,6 +38,14 @@ ifeq ($(CONFIG_AGENT_USE_LIBDPP),y)
TARGET_CFLAGS += -DUSE_LIBDPP
endif
define Package/dynbhd
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Dynamic Backhaul Daemon
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
+ieee1905-map-plugin +map-agent
endef
ifeq ($(CONFIG_AGENT_ZEROTOUCH_DPP),y)
TARGET_CFLAGS += -DZEROTOUCH_DPP
endif
@@ -46,6 +54,10 @@ define Package/map-agent/description
This package provides EasyMesh R6 compliant Wi-Fi Multi-AP Agent.
endef
define Package/dynbhd/description
Dyanmic LAN/WAN port detection and loop avoidance.
endef
define Package/map-agent/config
source "$(SOURCE)/Config.in"
endef
@@ -103,11 +115,7 @@ ifeq ($(CONFIG_AGENT_CHECK_PARTIAL_WIFI_RELOAD),y)
TARGET_CFLAGS += -DCHECK_PARTIAL_WIFI_RELOAD
endif
ifeq ($(CONFIG_DYNBH),y)
TARGET_CFLAGS += -DDYNBH
endif
ifeq ($(CONFIG_DYNBH_DYNAMICALLY_PERSIST_CONTROLLER),y)
ifeq ($(CONFIG_DYNBHD_DYNAMICALLY_PERSIST_CONTROLLER),y)
TARGET_CFLAGS += -DPERSIST_CONTROLLER
endif
@@ -120,10 +128,6 @@ MAKE_PATH:=src
define Package/map-agent/install
$(INSTALL_DIR) $(1)/etc
$(CP) ./files/* $(1)/
ifeq ($(CONFIG_DYNBH),y)
$(RM) $(1)/etc/hotplug.d/ethernet/map-dynamic-backhaul
$(RM) $(1)/etc/hotplug.d/ethernet/map-topology-discovery
endif
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/lib/wifi
@@ -131,6 +135,15 @@ endif
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mapagent $(1)/usr/sbin/
endef
define Package/dynbhd/install
$(INSTALL_DIR) $(1)/etc
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/lib/wifi/dynbhd
$(INSTALL_DIR) $(1)/etc/hotplug.d/ethernet
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dynbh/dynbhd $(1)/usr/sbin/dynbhd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dynbh/api $(1)/lib/wifi/dynbhd/api
# $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dynbh/map-dynamic-backhaul $(1)/etc/hotplug.d/ethernet/map-dynamic-backhaul
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
@@ -139,3 +152,4 @@ endef
endif
$(eval $(call BuildPackage,map-agent))
$(eval $(call BuildPackage,dynbhd))

View File

@@ -17,7 +17,7 @@ config dynamic_backhaul
option missing_bh_reconfig_timer '1800'
config controller_select
option mode 'auto'
option id 'auto'
option probe_int '20'
option retry_int '9'
option autostart '1'

View File

@@ -27,6 +27,11 @@ done
al_brnet="${al_bridge:3}"
[ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ] || exit 0
############## Dynamic Backhaul Daemon ##############
if [ -n "$(which dynbhd)" ]; then
exit 0
fi
########################################################
################ Dedicated ETH WAN Port ################
wanport="$(jsonfilter -i /etc/board.json -e @.network.wan.device)"
@@ -90,8 +95,7 @@ if [ "$LINK" = "up" ]; then
config_foreach remove_from_bridge bsta
config_foreach update_bstas bsta down
hwaddr="$(ifconfig $PORT | grep -i hwaddr | awk '{print $5}' | awk '{print tolower($0)}')"
/lib/wifi/multiap set_uplink "eth" "$PORT" "$hwaddr"
/lib/wifi/multiap set_uplink "eth" "$PORT"
else
/lib/wifi/multiap unset_uplink "eth"
#rm -f "$map_bh_file"

View File

@@ -7,6 +7,20 @@ USE_PROCD=1
IS_CFG_VALID=1
MAP_DEV="map_dev"
MAP_IF="map"
start_dynbhd_service() {
rm -f /var/run/multiap/multiap.backhaul
procd_open_instance
procd_set_param command "/usr/sbin/dynbhd"
procd_set_param respawn
# procd_set_param stdout 1
# procd_set_param stderr 1
procd_close_instance
}
validate_agent_section() {
uci_validate_section mapagent agent "agent" \
'enabled:bool:true' \
@@ -37,7 +51,7 @@ validate_cs_section() {
uci_validate_section mapagent $section "${section}" \
'local:bool:false' \
'mode:string' \
'id:string' \
'probe_int:range(0,1000):20' \
'retry_int:range(0,255):3' \
'autostart:bool:false'
@@ -165,6 +179,17 @@ create_dir() {
}
start_service() {
if [ -f /usr/sbin/dynbhd ]; then
# Start dynbhd only if the device is operating in extender/repeater mode
al_bridge="$(uci -q get mapagent.agent.al_bridge)"
if [ "${al_bridge:0:3}" = "br-" ]; then
al_brnet="${al_bridge:3}"
if [ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ]; then
start_dynbhd_service
fi
fi
fi
config_load "mapagent"
validate_agent_config || return 1;

View File

@@ -1,15 +0,0 @@
#!/bin/sh
. /lib/functions.sh
adapt_cntlr_sel() {
local section=$1
id=$(uci -q get mapagent.@controller_select[0].id)
uci -q del mapagent.@controller_select[0].id
# re-apply any custom value
[ -z "${id}" ] || uci -q set mapagent.@controller_select[0].mode="${id}"
}
adapt_cntlr_sel

View File

@@ -10,11 +10,6 @@ network_mode="$(fw_printenv -n netmode)" # default is layer3
multiap_mode="$(fw_printenv -n multiap_mode)" # default is full
disable_mlo="$(fw_printenv -n disable_mlo)"
is_logan() {
[ -d /sys/module/mt_wifi ] && return 0
return 1
}
is_airoha() {
[ -f /proc/device-tree/compatible ] || return
strings /proc/device-tree/compatible | grep -qE '^(econet,|airoha,)'; return
@@ -69,44 +64,45 @@ generate_multiap_config() {
device="$dev"
ifprefix_radio=""
if is_logan; then
uci set mapagent.agent.mld_prefix="bss"
ifname_sta=""
case "$band" in
2g)
ifprefix="ra%"
ifname="ra0"
ifname_bh="ra1"
ifname_sta="apcli0"
;;
5g)
ifprefix="rai%"
ifname="rai0"
ifname_bh="rai1"
ifname_sta="apclii0"
;;
6g)
ifprefix="rax%"
ifname="rax0"
ifname_bh="rax1"
ifname_sta="apclix0"
;;
esac
ifprefix_radio="${ifprefix}"
if [ "${network_mode}" == "extender" ]; then
ifname="${ifname_sta}"
fi
[ "$disable_mlo" == "1" ] || {
uci set wireless.$dev.mlo="1"
uci set wireless.$dev.mlo_capable="1"
}
elif is_airoha; then
if is_airoha; then
if [ -d "/sys/module/mt76" ]; then
ifprefix="wlan%_%"
ifname="wlan${devidx}_0"
ifname_bh="wlan${devidx}_1"
else
uci set mapagent.agent.mld_prefix="bss"
ifname_sta=""
case "$band" in
2g)
ifprefix="ra%"
ifname="ra0"
ifname_bh="ra1"
ifname_sta="apcli0"
;;
5g)
ifprefix="rai%"
ifname="rai0"
ifname_bh="rai1"
ifname_sta="apclii0"
;;
6g)
ifprefix="rax%"
ifname="rax0"
ifname_bh="rax1"
ifname_sta="apclix0"
;;
esac
ifprefix_radio="${ifprefix}"
if [ "${network_mode}" == "extender" ]; then
ifname="${ifname_sta}"
fi
[ "$disable_mlo" == "1" ] || {
uci set wireless.$dev.mlo="1"
uci set wireless.$dev.mlo_capable="1"
}
fi
uci set wireless.$dev.channels="$channels"
uci commit wireless
elif is_broadcom; then

View File

@@ -6,9 +6,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-controller
PKG_VERSION:=6.4.4.8
PKG_VERSION:=6.4.4.0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=a863fc3a9d248b0be7385524e0680155ff614467
PKG_SOURCE_VERSION:=d2e91ca156dbe0b44f0fc551b0a353137343fdf1
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@genexis.eu>
LOCAL_DEV=0

View File

@@ -4,16 +4,17 @@ config controller 'controller'
option registrar '2 5 6'
option debug '2'
option bcn_metrics_max_num '10'
option initial_channel_scan '0'
option enable_ts '0'
option primary_vid '1'
option primary_pcp '0'
option stale_sta_timeout '20d'
option stale_sta_timeout '30d'
option de_collect_interval '60'
list plugin 'zerotouch'
config sta_steering 'sta_steering'
option enable_sta_steer '1'
option enable_bsta_steer '1'
option enable_bsta_steer '0'
option rcpi_threshold_2g '70'
option rcpi_threshold_5g '86'
option rcpi_threshold_6g '86'

View File

@@ -20,6 +20,7 @@ validate_controller_section() {
'registrar:string' \
'debug:range(0,16)' \
'bcn_metrics_max_num:range(1,256)' \
'initial_channel_scan:bool:true' \
'resend_num:uinteger:0' \
'allow_bgdfs:range(0,2629744)' \
'stale_sta_timeout:string' \

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-plugins
PKG_VERSION:=1.2.5
PKG_VERSION:=1.1.2
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=05c0aa02b60b27aa57bf80b8fb068b1ee8bfc8ac
PKG_SOURCE_VERSION:=a76610182366cf05ed7e8f5fbac26890b709eeb4
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/map-plugins.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
@@ -59,8 +59,7 @@ define Package/map-plugins
endef
define Package/map-plugins/description
Provides extra Multi-AP services viz. steering, channel-planning,
self-organizing network, zero-touch onboarding etc.
Provides extra Multi-AP services viz. steering, channel-planning, self-organizing network etc.
endef
define Package/map-plugins/install

View File

@@ -32,7 +32,7 @@ define Package/mcastmngr
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json
DEPENDS+=+!TARGET_brcmbca:mcproxy +!TARGET_brcmbca:sipcalc
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service +!TARGET_brcmbca:kmod-ebt-igmpsnooping +!TARGET_brcmbca:kmod-ebt-mldsnooping
DEPENDS+=+!TARGET_brcmbca:ebtables-legacy +dm-agent
DEPENDS+=+!TARGET_brcmbca:ebtables-legacy +bridgemngr
endef
define Package/mcastmngr/description

View File

@@ -1,616 +0,0 @@
/*
* Copyright (c) 2022 Genexis B.V.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Erik Karlsson - initial implementation
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <shadow.h>
#include <crypt.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include <mosquitto.h>
#include <mosquitto_broker.h>
#include <mosquitto_plugin.h>
#ifdef ENABLE_PAM_SUPPORT
#include <security/pam_appl.h>
#endif
#define MAX_USERS 256
#define MAX_SUBNETS_PER_USER 32
typedef struct {
union {
uint32_t ipv4_network;
uint8_t ipv6_network[16];
};
union {
uint32_t ipv4_netmask;
uint8_t ipv6_netmask[16];
};
int is_ipv6;
} subnet_t;
typedef struct {
char username[64];
subnet_t allow_subnets[MAX_SUBNETS_PER_USER];
int allow_count;
subnet_t deny_subnets[MAX_SUBNETS_PER_USER];
int deny_count;
} user_acl_t;
typedef struct {
user_acl_t users[MAX_USERS];
int user_count;
mosquitto_plugin_id_t *identifier;
} plugin_data_t;
/* Parse CIDR notation for IPv4 or IPv6 (e.g., "192.168.1.0/24" or "2001:db8::/32") */
static int parse_subnet(const char *cidr, subnet_t *subnet)
{
char ip_str[128];
char *slash;
int prefix_len;
struct in_addr addr4;
struct in6_addr addr6;
strncpy(ip_str, cidr, sizeof(ip_str) - 1);
ip_str[sizeof(ip_str) - 1] = '\0';
slash = strchr(ip_str, '/');
if (slash != NULL) {
*slash = '\0';
prefix_len = atoi(slash + 1);
}
/* Try IPv4 first */
if (inet_pton(AF_INET, ip_str, &addr4) == 1) {
subnet->is_ipv6 = 0;
if (slash == NULL)
prefix_len = 32;
if (prefix_len < 0 || prefix_len > 32)
return -1;
subnet->ipv4_network = ntohl(addr4.s_addr);
subnet->ipv4_netmask = prefix_len == 0 ? 0 : (~0U << (32 - prefix_len));
subnet->ipv4_network &= subnet->ipv4_netmask;
return 0;
}
/* Try IPv6 */
if (inet_pton(AF_INET6, ip_str, &addr6) == 1) {
subnet->is_ipv6 = 1;
if (slash == NULL)
prefix_len = 128;
if (prefix_len < 0 || prefix_len > 128)
return -1;
/* Copy network address */
memcpy(subnet->ipv6_network, addr6.s6_addr, 16);
/* Generate netmask */
memset(subnet->ipv6_netmask, 0, 16);
for (int i = 0; i < prefix_len / 8; i++)
subnet->ipv6_netmask[i] = 0xff;
if (prefix_len % 8)
subnet->ipv6_netmask[prefix_len / 8] = ~((1 << (8 - (prefix_len % 8))) - 1);
/* Apply netmask to network address */
for (int i = 0; i < 16; i++)
subnet->ipv6_network[i] &= subnet->ipv6_netmask[i];
return 0;
}
return -1;
}
/* Check if IPv4 address is in subnet */
static int ipv4_in_subnet(uint32_t ip, const subnet_t *subnet)
{
if (subnet->is_ipv6)
return 0;
return (ip & subnet->ipv4_netmask) == subnet->ipv4_network;
}
/* Check if IPv6 address is in subnet */
static int ipv6_in_subnet(const uint8_t *ip, const subnet_t *subnet)
{
if (!subnet->is_ipv6)
return 0;
for (int i = 0; i < 16; i++) {
if ((ip[i] & subnet->ipv6_netmask[i]) != subnet->ipv6_network[i])
return 0;
}
return 1;
}
/* Check if IP is in any subnet in the list */
static int ip_in_subnet_list(const char *client_address, const subnet_t *subnets, int count)
{
struct in_addr addr4;
struct in6_addr addr6;
uint32_t ipv4;
/* Try IPv4 */
if (inet_pton(AF_INET, client_address, &addr4) == 1) {
ipv4 = ntohl(addr4.s_addr);
for (int i = 0; i < count; i++) {
if (ipv4_in_subnet(ipv4, &subnets[i]))
return 1;
}
return 0;
}
/* Try IPv6 */
if (inet_pton(AF_INET6, client_address, &addr6) == 1) {
for (int i = 0; i < count; i++) {
if (ipv6_in_subnet(addr6.s6_addr, &subnets[i]))
return 1;
}
return 0;
}
return 0;
}
/* Find or create user ACL entry */
static user_acl_t* find_or_create_user_acl(plugin_data_t *pdata, const char *username)
{
user_acl_t *user;
/* Find existing user */
for (int i = 0; i < pdata->user_count; i++) {
if (strcmp(pdata->users[i].username, username) == 0)
return &pdata->users[i];
}
/* Create new user if not found */
if (pdata->user_count >= MAX_USERS) {
mosquitto_log_printf(MOSQ_LOG_ERR,
"subnet_acl: Max users exceeded");
return NULL;
}
user = &pdata->users[pdata->user_count];
strncpy(user->username, username, sizeof(user->username) - 1);
user->username[sizeof(user->username) - 1] = '\0';
user->allow_count = 0;
user->deny_count = 0;
pdata->user_count++;
return user;
}
/* Parse subnet ACL file with simplified format
* Format:
* # Comment lines
* subnet allow <username> <cidr>
* subnet deny <username> <cidr>
*/
static int load_subnet_acl_config(plugin_data_t *pdata, const char *config_file)
{
FILE *fp;
char line[512];
int line_num = 0;
/* Initialize user count */
pdata->user_count = 0;
/* Config file is optional - if not provided, no subnet filtering */
if (config_file == NULL) {
mosquitto_log_printf(MOSQ_LOG_INFO,
"subnet_acl: No subnet ACL file specified, subnet filtering disabled");
return 0;
}
/* If config file is specified but cannot be opened, this is a fatal error */
fp = fopen(config_file, "r");
if (fp == NULL) {
mosquitto_log_printf(MOSQ_LOG_ERR,
"subnet_acl: Failed to open subnet ACL file '%s'", config_file);
return -1;
}
while (fgets(line, sizeof(line), fp) != NULL) {
char *token, *saveptr;
char *action, *username, *cidr;
user_acl_t *user;
subnet_t subnet;
line_num++;
/* Remove newline and comments */
line[strcspn(line, "\r\n")] = '\0';
char *comment = strchr(line, '#');
if (comment)
*comment = '\0';
/* Trim leading whitespace */
char *line_start = line;
while (*line_start == ' ' || *line_start == '\t')
line_start++;
/* Skip empty lines */
if (*line_start == '\0')
continue;
/* Parse: subnet allow|deny <username> <cidr> */
token = strtok_r(line_start, " \t", &saveptr);
if (token == NULL)
continue;
/* Must start with "subnet" */
if (strcmp(token, "subnet") != 0) {
mosquitto_log_printf(MOSQ_LOG_ERR,
"subnet_acl: Invalid directive '%s' at line %d (expected 'subnet')",
token, line_num);
fclose(fp);
return -1;
}
/* Get allow/deny */
action = strtok_r(NULL, " \t", &saveptr);
if (action == NULL) {
mosquitto_log_printf(MOSQ_LOG_ERR,
"subnet_acl: Missing allow/deny at line %d", line_num);
fclose(fp);
return -1;
}
if (strcmp(action, "allow") != 0 && strcmp(action, "deny") != 0) {
mosquitto_log_printf(MOSQ_LOG_ERR,
"subnet_acl: Invalid action '%s' at line %d (use 'allow' or 'deny')",
action, line_num);
fclose(fp);
return -1;
}
/* Get username */
username = strtok_r(NULL, " \t", &saveptr);
if (username == NULL) {
mosquitto_log_printf(MOSQ_LOG_ERR,
"subnet_acl: Missing username at line %d", line_num);
fclose(fp);
return -1;
}
/* Get CIDR */
cidr = strtok_r(NULL, " \t", &saveptr);
if (cidr == NULL) {
mosquitto_log_printf(MOSQ_LOG_ERR,
"subnet_acl: Missing CIDR at line %d", line_num);
fclose(fp);
return -1;
}
/* Parse subnet */
if (parse_subnet(cidr, &subnet) != 0) {
mosquitto_log_printf(MOSQ_LOG_ERR,
"subnet_acl: Invalid CIDR '%s' at line %d", cidr, line_num);
fclose(fp);
return -1;
}
/* Find or create user */
user = find_or_create_user_acl(pdata, username);
if (user == NULL) {
mosquitto_log_printf(MOSQ_LOG_ERR,
"subnet_acl: Max users (%d) exceeded at line %d", MAX_USERS, line_num);
fclose(fp);
return -1;
}
/* Add to appropriate list */
if (strcmp(action, "allow") == 0) {
if (user->allow_count >= MAX_SUBNETS_PER_USER) {
mosquitto_log_printf(MOSQ_LOG_ERR,
"subnet_acl: Max allow subnets (%d) exceeded for user '%s' at line %d",
MAX_SUBNETS_PER_USER, user->username, line_num);
fclose(fp);
return -1;
}
user->allow_subnets[user->allow_count] = subnet;
user->allow_count++;
mosquitto_log_printf(MOSQ_LOG_DEBUG,
"subnet_acl: User '%s' allow subnet %s",
user->username, cidr);
} else { /* deny */
if (user->deny_count >= MAX_SUBNETS_PER_USER) {
mosquitto_log_printf(MOSQ_LOG_ERR,
"subnet_acl: Max deny subnets (%d) exceeded for user '%s' at line %d",
MAX_SUBNETS_PER_USER, user->username, line_num);
fclose(fp);
return -1;
}
user->deny_subnets[user->deny_count] = subnet;
user->deny_count++;
mosquitto_log_printf(MOSQ_LOG_DEBUG,
"subnet_acl: User '%s' deny subnet %s",
user->username, cidr);
}
}
fclose(fp);
/* Log summary */
for (int i = 0; i < pdata->user_count; i++) {
user_acl_t *user = &pdata->users[i];
if (user->allow_count > 0 || user->deny_count > 0) {
mosquitto_log_printf(MOSQ_LOG_INFO,
"subnet_acl: User '%s' has %d allow and %d deny subnet rules",
user->username, user->allow_count, user->deny_count);
}
}
mosquitto_log_printf(MOSQ_LOG_NOTICE,
"subnet_acl: Loaded subnet restrictions for %d user(s)", pdata->user_count);
return 0;
}
/* Find user ACL entry */
static const user_acl_t* find_user_acl(const plugin_data_t *pdata, const char *username)
{
for (int i = 0; i < pdata->user_count; i++) {
if (strcmp(pdata->users[i].username, username) == 0)
return &pdata->users[i];
}
return NULL;
}
/* Check subnet access on authentication (connection time)
* Returns: MOSQ_ERR_SUCCESS if allowed, MOSQ_ERR_AUTH if denied
*/
static int check_subnet_on_auth(plugin_data_t *pdata, struct mosquitto_evt_basic_auth *ed)
{
const user_acl_t *user_acl;
const char *client_address;
/* Skip if no subnet config loaded */
if (pdata == NULL || pdata->user_count == 0)
return MOSQ_ERR_SUCCESS;
/* Skip anonymous users */
if (ed->username == NULL)
return MOSQ_ERR_SUCCESS;
/* Find user's subnet ACL */
user_acl = find_user_acl(pdata, ed->username);
/* If user not in config or has no subnet rules, allow */
if (user_acl == NULL || (user_acl->allow_count == 0 && user_acl->deny_count == 0))
return MOSQ_ERR_SUCCESS;
/* Get client IP address */
client_address = mosquitto_client_address(ed->client);
if (client_address == NULL) {
mosquitto_log_printf(MOSQ_LOG_WARNING,
"subnet_acl: Could not get client address for user '%s', denying connection",
ed->username);
return MOSQ_ERR_AUTH;
}
/* Check deny list first - deny takes precedence */
if (user_acl->deny_count > 0) {
if (ip_in_subnet_list(client_address, user_acl->deny_subnets, user_acl->deny_count)) {
mosquitto_log_printf(MOSQ_LOG_NOTICE,
"subnet_acl: User '%s' from %s DENIED by deny rule",
ed->username, client_address);
return MOSQ_ERR_AUTH;
}
}
/* If there are allow rules, IP must match one of them */
if (user_acl->allow_count > 0) {
if (ip_in_subnet_list(client_address, user_acl->allow_subnets, user_acl->allow_count)) {
mosquitto_log_printf(MOSQ_LOG_DEBUG,
"subnet_acl: User '%s' from %s allowed by allow rule",
ed->username, client_address);
return MOSQ_ERR_SUCCESS;
} else {
mosquitto_log_printf(MOSQ_LOG_NOTICE,
"subnet_acl: User '%s' from %s DENIED (not in allowed subnets)",
ed->username, client_address);
return MOSQ_ERR_AUTH;
}
}
/* No subnet rules for this user - allow */
return MOSQ_ERR_SUCCESS;
}
#ifdef ENABLE_PAM_SUPPORT
static int pam_conversation(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr)
{
int i;
const char *pass = (const char *)appdata_ptr;
*resp = calloc(num_msg, sizeof(struct pam_response));
if (*resp == NULL) {
mosquitto_log_printf(MOSQ_LOG_ERR, "pam failed to allocate buffer for validation");
return PAM_BUF_ERR;
}
if (pass == NULL)
return PAM_SUCCESS;
for (i = 0; i < num_msg; ++i) {
if (msg[i]->msg_style == PAM_PROMPT_ECHO_OFF) {
(*resp)[i].resp = strdup(pass);
if ((*resp)[i].resp == NULL) {
for (int j = 0; j < i ; j++)
free((*resp)[j].resp);
free(*resp);
*resp = NULL;
mosquitto_log_printf(MOSQ_LOG_ERR, "pam failed in strdup");
return PAM_BUF_ERR;
}
}
}
return PAM_SUCCESS;
}
static int process_pam_auth_callback(struct mosquitto_evt_basic_auth *ed)
{
struct pam_conv conv;
int retval;
pam_handle_t *pamh = NULL;
conv.conv = pam_conversation;
conv.appdata_ptr = (void *)ed->password;
retval = pam_start("mosquitto", ed->username, &conv, &pamh);
if (retval != PAM_SUCCESS) {
mosquitto_log_printf(MOSQ_LOG_ERR, "pam start failed: %s", pam_strerror(pamh, retval));
return MOSQ_ERR_AUTH;
}
retval = pam_authenticate(pamh, 0);
pam_end(pamh, retval);
if (retval == PAM_SUCCESS) {
mosquitto_log_printf(MOSQ_LOG_NOTICE, "pam user [%s] logged in", ed->username);
return MOSQ_ERR_SUCCESS;
}
mosquitto_log_printf(MOSQ_LOG_NOTICE, "pam user [%s] failed authentication, err [%s]", ed->username, pam_strerror(pamh, retval));
return MOSQ_ERR_AUTH;
}
#else
static int process_shadow_auth_callback(struct mosquitto_evt_basic_auth *ed)
{
struct spwd spbuf, *sp = NULL;
char buf[256];
struct crypt_data data;
char *hash;
getspnam_r(ed->username, &spbuf, buf, sizeof(buf), &sp);
if (sp == NULL || sp->sp_pwdp == NULL)
return MOSQ_ERR_AUTH;
/* Empty string as hash means password is not required */
if (sp->sp_pwdp[0] == 0)
return MOSQ_ERR_SUCCESS;
if (ed->password == NULL)
return MOSQ_ERR_AUTH;
memset(&data, 0, sizeof(data));
hash = crypt_r(ed->password, sp->sp_pwdp, &data);
if (hash == NULL)
return MOSQ_ERR_AUTH;
if (strcmp(hash, sp->sp_pwdp) == 0)
return MOSQ_ERR_SUCCESS;
return MOSQ_ERR_AUTH;
}
#endif
static int basic_auth_callback(int event, void *event_data, void *userdata)
{
struct mosquitto_evt_basic_auth *ed = event_data;
plugin_data_t *pdata = userdata;
int auth_result;
/* Let other plugins or broker decide about anonymous login */
if (ed->username == NULL)
return MOSQ_ERR_PLUGIN_DEFER;
/* First check username/password authentication */
#ifdef ENABLE_PAM_SUPPORT
auth_result = process_pam_auth_callback(ed);
#else
auth_result = process_shadow_auth_callback(ed);
#endif
/* If authentication failed, reject immediately */
if (auth_result != MOSQ_ERR_SUCCESS)
return auth_result;
/* Authentication succeeded, now check subnet restrictions */
return check_subnet_on_auth(pdata, ed);
}
int mosquitto_plugin_version(int supported_version_count,
const int *supported_versions)
{
return 5;
}
int mosquitto_plugin_init(mosquitto_plugin_id_t *identifier,
void **user_data,
struct mosquitto_opt *opts, int opt_count)
{
plugin_data_t *pdata;
const char *config_file = NULL;
int rc;
/* Find subnet config file option */
for (int i = 0; i < opt_count; i++) {
if (strcmp(opts[i].key, "subnet_acl_file") == 0) {
config_file = opts[i].value;
break;
}
}
pdata = calloc(1, sizeof(plugin_data_t));
if (pdata == NULL)
return MOSQ_ERR_NOMEM;
pdata->identifier = identifier;
/* Load subnet ACL configuration */
if (load_subnet_acl_config(pdata, config_file) != 0) {
free(pdata);
return MOSQ_ERR_UNKNOWN;
}
/* Register authentication callback only - subnet check is done during auth */
rc = mosquitto_callback_register(identifier, MOSQ_EVT_BASIC_AUTH,
basic_auth_callback, NULL, pdata);
if (rc != MOSQ_ERR_SUCCESS) {
mosquitto_log_printf(MOSQ_LOG_ERR,
"subnet_acl: Failed to register authentication callback");
free(pdata);
return rc;
}
mosquitto_log_printf(MOSQ_LOG_INFO,
"subnet_acl: Plugin initialized with %d user(s)", pdata->user_count);
/* Only assign user_data after all possible error paths */
*user_data = pdata;
return MOSQ_ERR_SUCCESS;
}
int mosquitto_plugin_cleanup(void *user_data,
struct mosquitto_opt *opts, int opt_count)
{
plugin_data_t *pdata = user_data;
if (pdata) {
mosquitto_callback_unregister(pdata->identifier, MOSQ_EVT_BASIC_AUTH,
basic_auth_callback, NULL);
free(pdata);
}
return MOSQ_ERR_SUCCESS;
}

View File

@@ -1,4 +1,4 @@
if PACKAGE_mosquitto-auth-plugin
if PACKAGE_mosquitto-auth-shadow
config MOSQUITTO_AUTH_PAM_SUPPORT
bool "Enable support of Linux PAM module for Authentication"

View File

@@ -13,8 +13,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mosquitto-auth-plugin
PKG_VERSION:=1.2.0
PKG_NAME:=mosquitto-auth-shadow
PKG_VERSION:=1.1.0
PKG_MAINTAINER:=Erik Karlsson <erik.karlsson@genexis.eu>
PKG_LICENSE:=EPL-2.0
@@ -24,7 +24,7 @@ PKG_CONFIG_DEPENDS:=CONFIG_MOSQUITTO_AUTH_PAM_SUPPORT
include $(INCLUDE_DIR)/package.mk
define Package/mosquitto-auth-plugin
define Package/mosquitto-auth-shadow
SECTION:=net
CATEGORY:=Network
TITLE:=mosquitto - /etc/shadow authentication plugin
@@ -32,12 +32,12 @@ define Package/mosquitto-auth-plugin
USERID:=mosquitto=200:mosquitto=200 mosquitto=200:shadow=11
endef
define Package/mosquitto-auth-plugin/description
define Package/mosquitto-auth-shadow/description
Plugin for the mosquitto MQTT message broker that authenticates
users using /etc/shadow
endef
define Package/mosquitto-auth-plugin/config
define Package/mosquitto-auth-shadow/config
source "$(SOURCE)/Config.in"
endef
@@ -45,10 +45,10 @@ ifeq ($(CONFIG_MOSQUITTO_AUTH_PAM_SUPPORT),y)
TARGET_CFLAGS+=-DENABLE_PAM_SUPPORT
endif
define Package/mosquitto-auth-plugin/install
define Package/mosquitto-auth-shadow/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/mosquitto_auth_plugin.so $(1)/usr/lib/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/mosquitto_auth_shadow.so $(1)/usr/lib/
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,mosquitto-auth-plugin))
$(eval $(call BuildPackage,mosquitto-auth-shadow))

View File

@@ -11,14 +11,14 @@
# Erik Karlsson - initial implementation
#
TARGETS = mosquitto_auth_plugin.so
TARGETS = mosquitto_auth_shadow.so
all: $(TARGETS)
%.pic.o: %.c
$(CC) $(CFLAGS) -Wall -Werror -fPIC -c -o $@ $<
mosquitto_auth_plugin.so: mosquitto_auth_plugin.pic.o
mosquitto_auth_shadow.so: mosquitto_auth_shadow.pic.o
$(CC) $(LDFLAGS) -shared -o $@ $^ $(if $(filter -DENABLE_PAM_SUPPORT,$(CFLAGS)),-lpam)
clean:

View File

@@ -0,0 +1,153 @@
/*
* Copyright (c) 2022 Genexis B.V.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Erik Karlsson - initial implementation
*/
#define _GNU_SOURCE
#include <string.h>
#include <shadow.h>
#include <crypt.h>
#include <stdlib.h>
#include <mosquitto.h>
#include <mosquitto_broker.h>
#include <mosquitto_plugin.h>
#ifdef ENABLE_PAM_SUPPORT
#include <security/pam_appl.h>
static int pam_conversation(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr)
{
int i;
const char *pass = (const char *)appdata_ptr;
*resp = calloc(num_msg, sizeof(struct pam_response));
if (*resp == NULL) {
mosquitto_log_printf(MOSQ_LOG_ERR, "pam failed to allocate buffer for validation");
return PAM_BUF_ERR;
}
if (pass == NULL)
return PAM_SUCCESS;
for (i = 0; i < num_msg; ++i) {
if (msg[i]->msg_style == PAM_PROMPT_ECHO_OFF) {
(*resp)[i].resp = strdup(pass);
if ((*resp)[i].resp == NULL) {
for (int j = 0; j < i ; j++)
free((*resp)[j].resp);
free(*resp);
*resp = NULL;
mosquitto_log_printf(MOSQ_LOG_ERR, "pam failed in strdup");
return PAM_BUF_ERR;
}
}
}
return PAM_SUCCESS;
}
static int process_pam_auth_callback(struct mosquitto_evt_basic_auth *ed)
{
struct pam_conv conv;
int retval;
pam_handle_t *pamh = NULL;
conv.conv = pam_conversation;
conv.appdata_ptr = (void *)ed->password;
retval = pam_start("mosquitto", ed->username, &conv, &pamh);
if (retval != PAM_SUCCESS) {
mosquitto_log_printf(MOSQ_LOG_ERR, "pam start failed: %s", pam_strerror(pamh, retval));
return MOSQ_ERR_AUTH;
}
retval = pam_authenticate(pamh, 0);
pam_end(pamh, retval);
if (retval == PAM_SUCCESS) {
mosquitto_log_printf(MOSQ_LOG_NOTICE, "pam user [%s] logged in", ed->username);
return MOSQ_ERR_SUCCESS;
}
mosquitto_log_printf(MOSQ_LOG_NOTICE, "pam user [%s] failed authentication, err [%s]", ed->username, pam_strerror(pamh, retval));
return MOSQ_ERR_AUTH;
}
#else
static int process_shadow_auth_callback(struct mosquitto_evt_basic_auth *ed)
{
struct spwd spbuf, *sp = NULL;
char buf[256];
struct crypt_data data;
char *hash;
getspnam_r(ed->username, &spbuf, buf, sizeof(buf), &sp);
if (sp == NULL || sp->sp_pwdp == NULL)
return MOSQ_ERR_AUTH;
/* Empty string as hash means password is not required */
if (sp->sp_pwdp[0] == 0)
return MOSQ_ERR_SUCCESS;
if (ed->password == NULL)
return MOSQ_ERR_AUTH;
memset(&data, 0, sizeof(data));
hash = crypt_r(ed->password, sp->sp_pwdp, &data);
if (hash == NULL)
return MOSQ_ERR_AUTH;
if (strcmp(hash, sp->sp_pwdp) == 0)
return MOSQ_ERR_SUCCESS;
return MOSQ_ERR_AUTH;
}
#endif
static int basic_auth_callback(int event, void *event_data, void *userdata)
{
struct mosquitto_evt_basic_auth *ed = event_data;
/* Let other plugins or broker decide about anonymous login */
if (ed->username == NULL)
return MOSQ_ERR_PLUGIN_DEFER;
#ifdef ENABLE_PAM_SUPPORT
return process_pam_auth_callback(ed);
#else
return process_shadow_auth_callback(ed);
#endif
}
int mosquitto_plugin_version(int supported_version_count,
const int *supported_versions)
{
return 5;
}
int mosquitto_plugin_init(mosquitto_plugin_id_t *identifier,
void **user_data,
struct mosquitto_opt *opts, int opt_count)
{
*user_data = identifier;
return mosquitto_callback_register(identifier, MOSQ_EVT_BASIC_AUTH,
basic_auth_callback, NULL, NULL);
}
int mosquitto_plugin_cleanup(void *user_data,
struct mosquitto_opt *opts, int opt_count)
{
mosquitto_plugin_id_t *identifier = user_data;
return mosquitto_callback_unregister(identifier, MOSQ_EVT_BASIC_AUTH,
basic_auth_callback, NULL);
}

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=netmngr
PKG_VERSION:=1.2.0
PKG_VERSION:=1.1.8
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/netmngr.git
PKG_SOURCE_VERSION:=000da9cbb2cfe965908adf60eda0823682c8bd69
PKG_SOURCE_VERSION:=6310f32b80f8abeccbf99ad55ce88792b19342d6
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=netmode
PKG_VERSION:=1.1.8
PKG_VERSION:=1.1.5
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0-only
@@ -18,7 +18,6 @@ include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
define Package/netmode
CATEGORY:=Utilities
TITLE:=Network Modes and Utils
DEPENDS:=+dm-service
endef
define Package/netmode/description

View File

@@ -58,7 +58,7 @@
"name": "mode"
}
},
"linker_obj": "Device.{BBF_VENDOR_PREFIX}NetMode.SupportedModes.*.Name"
"linker_obj": "Device.{BBF_VENDOR_PREFIX}NetMode.SupportedModes.[Name==@key]."
}
]
},

View File

@@ -1,2 +1,2 @@
config netmode global
option enabled 1
option enabled 0

View File

@@ -4,19 +4,13 @@ enabled="$(uci -q get netmode.global.enabled)"
[ "$enabled" == "1" ] || exit 0
mode="$(uci -q get netmode.global.mode)"
wanproto=$(uci -q get network.wan.proto)
if [ -n "$mode" ]; then
# check if wanproto and mode aligned
if [ "${mode}" = "routed-${wanproto}" ]; then
exit 0
fi
fi
[ -n "$mode" ] && exit 0
[ -f /etc/netmodes/supported_modes.json ] || exit 0
# NetMode is enabled without a Mode being set
# Figure out the current mode from network config
wanproto=$(uci -q get network.wan.proto)
curmode=""
case "$wanproto" in
dhcp) curmode="routed-dhcp" ;;

View File

@@ -19,3 +19,7 @@ fi
if [ -x "/etc/init.d/bbfdmd" ]; then
/etc/init.d/bbfdmd restart
fi
if [ -x "/etc/init.d/obuspa" ]; then
/etc/init.d/obuspa restart
fi

View File

@@ -1 +0,0 @@
/etc/netmodes/.last_mode

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=obuspa
PKG_VERSION:=10.0.7.5
PKG_VERSION:=10.0.0.17
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
PKG_SOURCE_VERSION:=f3b5b79476adadc55830de9466361c0eeced473e
PKG_SOURCE_VERSION:=8f0f8cfc2c4048bfed674163030d0b06f96f2da1
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip

View File

@@ -667,7 +667,7 @@ db_init()
reason="${1}"
# remove usp.db, in case of reload
if [ -f "${OBUSPA_BOOT_MARKER}" ] && [ "${reason}" = "update" ]; then
log "Deleting ${OBUSPA_BOOT_MARKER} in order to enforce values from UCI..."
log "Deleting ${OBUSPA_BOOT_MARKER} to enforce values from uci ...."
rm -f "${OBUSPA_BOOT_MARKER}"
fi
@@ -686,7 +686,7 @@ db_init()
config_load $CONFIGURATION
config_get dualstack_pref global dualstack_pref "IPv6"
log "Enforcing UCI values, no boot marker found."
log "Enforce uci values, no boot marker"
global_init
config_foreach configure_localagent localagent
global_init

View File

@@ -1,8 +1,8 @@
Index: obuspa-10.0.5.0/src/core/device_controller.c
Index: obuspa-10.0.0.1/src/core/device_controller.c
===================================================================
--- obuspa-10.0.5.0.orig/src/core/device_controller.c
+++ obuspa-10.0.5.0/src/core/device_controller.c
@@ -4223,6 +4223,14 @@ int ProcessControllerAdded(int cont_inst
--- obuspa-10.0.0.1.orig/src/core/device_controller.c
+++ obuspa-10.0.0.1/src/core/device_controller.c
@@ -4211,6 +4211,14 @@ int ProcessControllerAdded(int cont_inst
goto exit;
}
@@ -17,7 +17,7 @@ Index: obuspa-10.0.5.0/src/core/device_controller.c
// Exit if unable to get the object instance numbers present in this controller's MTP table
USP_SNPRINTF(path, sizeof(path), "%s.%d.MTP", device_cont_root, cont_instance);
err = DATA_MODEL_GetInstances(path, &iv);
@@ -4264,14 +4272,6 @@ int ProcessControllerAdded(int cont_inst
@@ -4252,14 +4260,6 @@ int ProcessControllerAdded(int cont_inst
DEVICE_MQTT_UpdateControllerTopics();
#endif

View File

@@ -1,7 +1,7 @@
Index: obuspa-10.0.4.0/src/core/bdc_exec.c
Index: obuspa-10.0.0.1/src/core/bdc_exec.c
===================================================================
--- obuspa-10.0.4.0.orig/src/core/bdc_exec.c
+++ obuspa-10.0.4.0/src/core/bdc_exec.c
--- obuspa-10.0.0.1.orig/src/core/bdc_exec.c
+++ obuspa-10.0.0.1/src/core/bdc_exec.c
@@ -549,10 +549,25 @@ int StartSendingReport(bdc_connection_t
// Set the list of headers
@@ -30,10 +30,10 @@ Index: obuspa-10.0.4.0/src/core/bdc_exec.c
bc->headers = curl_slist_append(bc->headers, "Content-Encoding: gzip");
}
Index: obuspa-10.0.4.0/src/core/bdc_exec.h
Index: obuspa-10.0.0.1/src/core/bdc_exec.h
===================================================================
--- obuspa-10.0.4.0.orig/src/core/bdc_exec.h
+++ obuspa-10.0.4.0/src/core/bdc_exec.h
--- obuspa-10.0.0.1.orig/src/core/bdc_exec.h
+++ obuspa-10.0.0.1/src/core/bdc_exec.h
@@ -54,6 +54,8 @@ void BDC_EXEC_ScheduleExit(void);
#define BDC_FLAG_PUT 0x00000001 // If set, HTTP PUT should be used instead of HTTP POST when sending the report to the BDC server
#define BDC_FLAG_GZIP 0x00000002 // If set, the reports contants are Gzipped
@@ -45,10 +45,10 @@ Index: obuspa-10.0.4.0/src/core/bdc_exec.h
+#define BDC_FLAG_HEADER_PER_ROW 0x00000020 // If set, report format in header would be csv ParameterPerRow
+#define BDC_FLAG_HEADER_PER_COL 0x00000040 // If set, report format in header would be csv ParameterPerColumn
#endif
Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
Index: obuspa-10.0.0.1/src/core/device_bulkdata.c
===================================================================
--- obuspa-10.0.4.0.orig/src/core/device_bulkdata.c
+++ obuspa-10.0.4.0/src/core/device_bulkdata.c
--- obuspa-10.0.0.1.orig/src/core/device_bulkdata.c
+++ obuspa-10.0.0.1/src/core/device_bulkdata.c
@@ -71,8 +71,12 @@
//------------------------------------------------------------------------------
@@ -95,7 +95,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
int Validate_BulkDataHTTPMethod(dm_req_t *req, char *value);
@@ -247,7 +259,8 @@ bulkdata_profile_t *bulkdata_find_free_p
bulkdata_profile_t *bulkdata_find_profile(int profile_id);
int bulkdata_calc_report_map(bulkdata_profile_t *bp, kv_vector_t *report_map, combined_role_t *combined_role);
int bulkdata_calc_report_map(bulkdata_profile_t *bp, kv_vector_t *report_map);
int bulkdata_reduce_to_alt_name(char *spec, char *path, char *alt_name, char *out_buf, int buf_len);
-char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timestamp);
+char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timestamp, char *report_format);
@@ -103,16 +103,16 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
unsigned char *bulkdata_compress_report(profile_ctrl_params_t *ctrl, char *input_buf, int input_len, int *p_output_len);
int bulkdata_schedule_sending_http_report(profile_ctrl_params_t *ctrl, bulkdata_profile_t *bp, unsigned char *json_report, int report_len);
int bulkdata_start_profile(bulkdata_profile_t *bp);
@@ -263,6 +276,8 @@ int bulkdata_platform_get_param_refs(int
int bulkdata_platform_calc_combined_role(int instance, combined_role_t **bulkdata_role, combined_role_t *combined_role, int *cont_instance);
void bulkdata_expand_param_ref(param_ref_entry_t *pr, group_get_vector_t *ggv, combined_role_t *combined_role);
@@ -262,6 +275,8 @@ char *bulkdata_platform_calc_uri_query_s
int bulkdata_platform_get_param_refs(int profile_id, param_ref_vector_t *param_refs);
void bulkdata_expand_param_ref(param_ref_entry_t *pr, group_get_vector_t *ggv);
void bulkdata_append_to_result_map(param_ref_entry_t *pr, group_get_vector_t *ggv, kv_vector_t *report_map);
+void append_string_to_target(char *str, char **output);
+char *csv_encode(const char *str);
int GetAuto_BulkDataController(dm_req_t *req, char *buf, int len);
#ifdef ENABLE_MQTT
int Validate_BulkDataMqttReference(dm_req_t *req, char *value);
@@ -301,7 +316,7 @@ int DEVICE_BULKDATA_Init(void)
void bulkdata_process_profile_mqtt(bulkdata_profile_t *bp);
@@ -299,7 +314,7 @@ int DEVICE_BULKDATA_Init(void)
err |= USP_REGISTER_VendorParam_ReadOnly("Device.BulkData.Status", Get_BulkDataGlobalStatus, DM_STRING);
err |= USP_REGISTER_Param_Constant("Device.BulkData.MinReportingInterval", BULKDATA_MINIMUM_REPORTING_INTERVAL_STR, DM_UINT);
err |= USP_REGISTER_Param_SupportedList("Device.BulkData.Protocols", bdc_protocols, NUM_ELEM(bdc_protocols));
@@ -121,7 +121,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
err |= USP_REGISTER_Param_Constant("Device.BulkData.ParameterWildCardSupported", "true", DM_BOOL);
err |= USP_REGISTER_Param_Constant("Device.BulkData.MaxNumberOfProfiles", BULKDATA_MAX_PROFILES_STR, DM_INT);
err |= USP_REGISTER_Param_Constant("Device.BulkData.MaxNumberOfParameterReferences", "-1", DM_INT);
@@ -316,7 +331,7 @@ int DEVICE_BULKDATA_Init(void)
@@ -314,7 +329,7 @@ int DEVICE_BULKDATA_Init(void)
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.Name", "", NULL, NULL, DM_STRING);
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.NumberOfRetainedFailedReports", "0", Validate_NumberOfRetainedFailedReports, NULL, DM_INT);
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.Protocol", BULKDATA_PROTOCOL_HTTP, Validate_BulkDataProtocol, NULL, DM_STRING);
@@ -129,8 +129,8 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
+ err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.EncodingType", BULKDATA_ENCODING_TYPE_JSON, Validate_BulkDataEncodingType, NULL, DM_STRING);
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.ReportingInterval", "86400", Validate_BulkDataReportingInterval, NotifyChange_BulkDataReportingInterval, DM_UINT);
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.TimeReference", UNKNOWN_TIME_STR, NULL, NotifyChange_BulkDataTimeReference, DM_DATETIME);
err |= USP_REGISTER_DBParam_ReadOnlyAuto("Device.BulkData.Profile.{i}.Controller", GetAuto_BulkDataController, DM_STRING);
@@ -329,9 +344,16 @@ int DEVICE_BULKDATA_Init(void)
@@ -326,9 +341,16 @@ int DEVICE_BULKDATA_Init(void)
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.Parameter.{i}.Reference", "", Validate_BulkDataReference, NULL, DM_STRING);
// Device.BulkData.Profile.{i}.JSONEncoding
@@ -148,7 +148,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
// Device.BulkData.Profile.{i}.HTTP
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.HTTP.URL", "", NULL, NotifyChange_BulkDataURL, DM_STRING);
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.HTTP.Username", "", NULL, NULL, DM_STRING);
@@ -687,9 +709,10 @@ int Validate_BulkDataProtocol(dm_req_t *
@@ -614,9 +636,10 @@ int Validate_BulkDataProtocol(dm_req_t *
int Validate_BulkDataEncodingType(dm_req_t *req, char *value)
{
// Exit if trying to set a value outside of the range we accept
@@ -162,7 +162,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
return USP_ERR_INVALID_VALUE;
}
@@ -793,9 +816,36 @@ int Validate_BulkDataReference(dm_req_t
@@ -720,9 +743,36 @@ int Validate_BulkDataReference(dm_req_t
int Validate_BulkDataReportFormat(dm_req_t *req, char *value)
{
// Exit if trying to set a value outside of the range we accept
@@ -201,7 +201,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
return USP_ERR_INVALID_VALUE;
}
@@ -2151,6 +2201,14 @@ int bulkdata_platform_get_profile_contro
@@ -2053,6 +2103,14 @@ int bulkdata_platform_get_profile_contro
return err;
}
@@ -216,7 +216,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
// Exit if unable to get ReportTimestamp
USP_SNPRINTF(path, sizeof(path), "Device.BulkData.Profile.%d.JSONEncoding.ReportTimestamp", bp->profile_id);
err = DATA_MODEL_GetParameterValue(path, ctrl_params->report_timestamp, sizeof(ctrl_params->report_timestamp), 0);
@@ -2159,6 +2217,54 @@ int bulkdata_platform_get_profile_contro
@@ -2061,6 +2119,54 @@ int bulkdata_platform_get_profile_contro
return err;
}
@@ -271,7 +271,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
#ifdef ENABLE_MQTT
{
char protocol[32];
@@ -2492,7 +2598,7 @@ void bulkdata_process_profile_http(bulkd
@@ -2334,7 +2440,7 @@ void bulkdata_process_profile_http(bulkd
{
int err;
report_t *cur_report;
@@ -280,7 +280,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
profile_ctrl_params_t ctrl;
unsigned char *compressed_report;
int compressed_len;
@@ -2541,26 +2647,39 @@ void bulkdata_process_profile_http(bulkd
@@ -2373,10 +2479,23 @@ void bulkdata_process_profile_http(bulkd
}
// Exit if unable to generate the report
@@ -308,9 +308,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
return;
}
// Print out the JSON report, if debugging is enabled
- USP_LOG_Info("\nBULK DATA: %sing at time %s, to url=%s", ctrl.method, iso8601_cur_time(buf, sizeof(buf)), ctrl.url);
+ USP_LOG_Info("BULK DATA: %sing at time %s, to url=%s", ctrl.method, iso8601_cur_time(buf, sizeof(buf)), ctrl.url);
@@ -2385,14 +2504,14 @@ void bulkdata_process_profile_http(bulkd
USP_LOG_Info("BULK DATA: using compression method=%s", ctrl.compression);
if (enable_protocol_trace)
{
@@ -329,7 +327,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
}
// NOTE: From this point on, only the compressed_report exists
@@ -2590,8 +2709,15 @@ void bulkdata_process_profile_usp_event(
@@ -2422,8 +2541,15 @@ void bulkdata_process_profile_usp_event(
kv_vector_t event_args;
kv_pair_t kv;
report_t *cur_report;
@@ -343,11 +341,11 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
+ char escape_char[10];
+ char csv_format[20];
+ char row_timestamp[33];
combined_role_t *bulkdata_role;
combined_role_t combined_role;
int cont_instance;
@@ -2610,13 +2736,63 @@ void bulkdata_process_profile_usp_event(
return;
// Exit if the MTP has not been connected to successfully after bootup
// This is to prevent BDC events being enqueued before the Boot! event is sent (the Boot! event is only sent after successfully connecting to the MTP).
@@ -2432,13 +2558,63 @@ void bulkdata_process_profile_usp_event(
goto exit;
}
- // Exit if unable to get ReportTimestamp
@@ -417,7 +415,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
// When sending via USP events, only one report is ever sent in each USP event
// So ensure all retained reports are removed. NOTE: Clearing the reports here is only necessary when switching protocol from HTTP to USP event, and where HTTP had some unsent reports
@@ -2634,11 +2810,17 @@ void bulkdata_process_profile_usp_event(
@@ -2456,11 +2632,17 @@ void bulkdata_process_profile_usp_event(
}
bp->num_retained_reports = 1;
@@ -438,7 +436,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
return;
}
@@ -2646,15 +2828,15 @@ void bulkdata_process_profile_usp_event(
@@ -2468,15 +2650,15 @@ void bulkdata_process_profile_usp_event(
// Construct event_args manually to avoid the overhead of a malloc and copy of the report in KV_VECTOR_Add()
kv.key = "Data";
@@ -448,7 +446,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
event_args.num_entries = 1;
USP_SNPRINTF(path, sizeof(path), "Device.BulkData.Profile.%d.Push!", bp->profile_id);
DEVICE_SUBSCRIPTION_ProcessAllEventCompleteSubscriptions(path, &event_args, cont_instance);
DEVICE_SUBSCRIPTION_ProcessAllEventCompleteSubscriptions(path, &event_args);
- // Free the report. No need to free the event_args as json_report is the only thing dynamically allocated in it
- free(json_report); // The report is not allocated via USP_MALLOC
@@ -457,7 +455,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
// From the point of view of this code, the report(s) have been successfully sent, so don't retain them
// NOTE: Sending of the reports successfully is delegated to the USP notification retry mechanism
@@ -2736,15 +2918,28 @@ void bulkdata_process_profile_mqtt(bulkd
@@ -2548,11 +2730,24 @@ void bulkdata_process_profile_mqtt(bulkd
}
// Exit if unable to generate the report
@@ -487,21 +485,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
}
// Print out the JSON report, if debugging is enabled
- USP_LOG_Debug("\nBULK DATA: Sending at time %s to MQTT topic %s", iso8601_cur_time(buf, sizeof(buf)), ctrl.mqtt_publish_topic);
+ USP_LOG_Debug("BULK DATA: Sending at time %s to MQTT topic %s", iso8601_cur_time(buf, sizeof(buf)), ctrl.mqtt_publish_topic);
if (enable_protocol_trace)
{
USP_LOG_String(kLogLevel_Info, kLogType_Protocol, report);
@@ -2939,7 +3134,7 @@ int bulkdata_reduce_to_alt_name(char *sp
/*********************************************************************//**
**
-** bulkdata_generate_json_report
+** bulkdata_generate_json_name_value_pair_report
**
** Generates a JSON name-value pair format report
** NOTE: The report contains all retained failed reports, as well as the current report
@@ -2951,7 +3146,7 @@ int bulkdata_reduce_to_alt_name(char *sp
@@ -2763,7 +2958,7 @@ int bulkdata_reduce_to_alt_name(char *sp
** \return pointer to NULL terminated dynamically allocated buffer containing the serialized report to send
**
**************************************************************************/
@@ -510,7 +494,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
{
JsonNode *top; // top of report
JsonNode *array; // array of reports (retained + current)
@@ -3056,6 +3251,483 @@ char *bulkdata_generate_json_report(bulk
@@ -2868,6 +3063,483 @@ char *bulkdata_generate_json_report(bulk
return result;
}
@@ -994,7 +978,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
/*********************************************************************//**
**
** bulkdata_compress_report
@@ -3259,6 +3931,20 @@ int bulkdata_schedule_sending_http_repor
@@ -3071,6 +3743,20 @@ int bulkdata_schedule_sending_http_repor
flags |= BDC_FLAG_DATE_HEADER;
}

View File

@@ -1,7 +1,7 @@
Index: obuspa-10.0.5.0/src/core/expr_vector.c
Index: obuspa-10.0.0.1/src/core/expr_vector.c
===================================================================
--- obuspa-10.0.5.0.orig/src/core/expr_vector.c
+++ obuspa-10.0.5.0/src/core/expr_vector.c
--- obuspa-10.0.0.1.orig/src/core/expr_vector.c
+++ obuspa-10.0.0.1/src/core/expr_vector.c
@@ -59,6 +59,7 @@ char *expr_op_2_str[kExprOp_Max] =
"<", // kExprOp_LessThan
">", // kExprOp_GreaterThan
@@ -10,7 +10,7 @@ Index: obuspa-10.0.5.0/src/core/expr_vector.c
};
@@ -487,6 +488,15 @@ char *SplitOnOperator(char *buf, expr_op
@@ -483,6 +484,15 @@ char *SplitOnOperator(char *buf, expr_op
*op = '\0';
return &op[2];
}
@@ -26,10 +26,10 @@ Index: obuspa-10.0.5.0/src/core/expr_vector.c
// Exit if found the "<" operator
op = strchr(buf, '<');
Index: obuspa-10.0.5.0/src/core/path_resolver.c
Index: obuspa-10.0.0.1/src/core/path_resolver.c
===================================================================
--- obuspa-10.0.5.0.orig/src/core/path_resolver.c
+++ obuspa-10.0.5.0/src/core/path_resolver.c
--- obuspa-10.0.0.1.orig/src/core/path_resolver.c
+++ obuspa-10.0.0.1/src/core/path_resolver.c
@@ -1088,7 +1088,7 @@ int ResolveUniqueKey(char *resolved, cha
char temp[MAX_DM_PATH];
bool is_match;
@@ -38,7 +38,7 @@ Index: obuspa-10.0.5.0/src/core/path_resolver.c
+ expr_op_t valid_ops[] = {kExprOp_Equal, kExprOp_NotEqual, kExprOp_LessThanOrEqual, kExprOp_GreaterThanOrEqual, kExprOp_LessThan, kExprOp_GreaterThan, kExprOp_Contains};
// Exit if unable to find the end of the unique key
p = TEXT_UTILS_StrStr(unresolved, "]");
p = strchr(unresolved, ']');
@@ -1754,6 +1754,67 @@ int DoUniqueKeysMatch(int index, search_
}
USP_ASSERT(gge->value != NULL); // GROUP_GET_VECTOR_GetValues() should have set an error message if the vendor hook didn't set a value for the parameter
@@ -107,10 +107,10 @@ Index: obuspa-10.0.5.0/src/core/path_resolver.c
// Determine the function to call to perform the comparison
if (type_flags & (DM_INT | DM_UINT | DM_ULONG | DM_LONG | DM_DECIMAL))
{
Index: obuspa-10.0.5.0/src/include/usp_api.h
Index: obuspa-10.0.0.1/src/include/usp_api.h
===================================================================
--- obuspa-10.0.5.0.orig/src/include/usp_api.h
+++ obuspa-10.0.5.0/src/include/usp_api.h
--- obuspa-10.0.0.1.orig/src/include/usp_api.h
+++ obuspa-10.0.0.1/src/include/usp_api.h
@@ -106,6 +106,7 @@ typedef enum
kExprOp_LessThan, // '<'
kExprOp_GreaterThan, // '>'

View File

@@ -1,40 +1,40 @@
Index: obuspa-10.0.5.0/src/core/device.h
Index: obuspa-10.0.0.2/src/core/device.h
===================================================================
--- obuspa-10.0.5.0.orig/src/core/device.h
+++ obuspa-10.0.5.0/src/core/device.h
@@ -311,6 +311,9 @@ int DEVICE_CTRUST_InstSelToRoleInstance(
--- obuspa-10.0.0.2.orig/src/core/device.h
+++ obuspa-10.0.0.2/src/core/device.h
@@ -305,6 +305,8 @@ void DEVICE_CTRUST_ApplyPermissionsToSub
char *DEVICE_CTRUST_InstSelToPermTarget(int role_index, void *is, int *perm_instance);
int DEVICE_CTRUST_SetRoleParameter(int instance, char *param_name, char *new_value);
int DEVICE_CTRUST_SetPermissionParameter(int instance1, int instance2, char *param_name, char *new_value);
+
+bool DEVICE_CTRUST_IsControllerSecured(void);
+
int DEVICE_CTRUST_DumpPermissionSelectors(int role_instance, char *path);
int DEVICE_REQUEST_Init(void);
int DEVICE_REQUEST_Add(char *path, char *command_key, int *instance);
Index: obuspa-10.0.5.0/src/core/device_ctrust.c
void DEVICE_REQUEST_OperationComplete(int instance, int err_code, char *err_msg, kv_vector_t *output_args);
Index: obuspa-10.0.0.2/src/core/device_ctrust.c
===================================================================
--- obuspa-10.0.5.0.orig/src/core/device_ctrust.c
+++ obuspa-10.0.5.0/src/core/device_ctrust.c
@@ -246,6 +246,7 @@ credential_t *FindCredentialByCertInstan
--- obuspa-10.0.0.2.orig/src/core/device_ctrust.c
+++ obuspa-10.0.0.2/src/core/device_ctrust.c
@@ -235,6 +235,7 @@ credential_t *FindCredentialByCertInstan
int Get_CredentialRole(dm_req_t *req, char *buf, int len);
int Get_CredentialCertificate(dm_req_t *req, char *buf, int len);
int Get_CredentialNumEntries(dm_req_t *req, char *buf, int len);
+int Validate_SecuredRoles(dm_req_t *req, char *value);
void ApplySearchExpressionPermissions(char *path, inst_sel_t *sel);
bool ValidateDataModelPathSegment(char *segment, bool is_last, char *path);
@@ -293,6 +294,9 @@ int DEVICE_CTRUST_Init(void)
// Create a timer which will be used to apply all modified permissions to the data model, after processing a USP Message
SYNC_TIMER_Add(ApplyModifiedPermissions, 0, END_OF_TIME);
#ifndef REMOVE_DEVICE_SECURITY
int InitChallengeTable();
@@ -354,6 +355,10 @@ int DEVICE_CTRUST_Init(void)
challenge_response_input_args, NUM_ELEM(challenge_response_input_args),
NULL, 0);
#endif
+
+ // Register Device.LocalAgent.ControllerTrust.SecuredRoles parameter
+ err |= USP_REGISTER_DBParam_ReadWrite(DEVICE_CTRUST_ROOT ".SecuredRoles", "", Validate_SecuredRoles, NULL, DM_STRING);
+
// Register parameters implemented by this component
// Device.LocalAgent.ControllerTrust.Role.{i}
err |= USP_REGISTER_Object(DEVICE_ROLE_ROOT, ValidateAdd_CTrustRole, NULL, Notify_CTrustRoleAdded,
@@ -3533,3 +3537,139 @@ exit:
// Exit if any errors occurred
if (err != USP_ERR_OK)
{
@@ -2908,3 +2913,139 @@ exit:
return err;
}
#endif // REMOVE_DEVICE_SECURITY

View File

@@ -1,8 +1,8 @@
Index: obuspa-10.0.7.0/src/core/cli_server.c
Index: obuspa-10.0.0.2/src/core/cli_server.c
===================================================================
--- obuspa-10.0.7.0.orig/src/core/cli_server.c
+++ obuspa-10.0.7.0/src/core/cli_server.c
@@ -726,10 +726,6 @@ int ExecuteCli_Get(str_vector_t *args)
--- obuspa-10.0.0.2.orig/src/core/cli_server.c
+++ obuspa-10.0.0.2/src/core/cli_server.c
@@ -724,10 +724,6 @@ int ExecuteCli_Get(str_vector_t *args)
USP_ASSERT(gge->value != NULL);
SendCliResponse("%s => %s\n", gge->path, gge->value);
}
@@ -13,11 +13,11 @@ Index: obuspa-10.0.7.0/src/core/cli_server.c
}
GROUP_GET_VECTOR_Destroy(&ggv);
Index: obuspa-10.0.7.0/src/core/data_model.c
Index: obuspa-10.0.0.2/src/core/data_model.c
===================================================================
--- obuspa-10.0.7.0.orig/src/core/data_model.c
+++ obuspa-10.0.7.0/src/core/data_model.c
@@ -1398,7 +1398,7 @@ int DATA_MODEL_NotifyInstanceAdded(char
--- obuspa-10.0.0.2.orig/src/core/data_model.c
+++ obuspa-10.0.0.2/src/core/data_model.c
@@ -1321,7 +1321,7 @@ int DATA_MODEL_NotifyInstanceAdded(char
// Exit if instance already exists - nothing to do
if (exists)
{
@@ -26,7 +26,7 @@ Index: obuspa-10.0.7.0/src/core/data_model.c
return USP_ERR_CREATION_FAILURE;
}
@@ -1486,7 +1486,7 @@ int DATA_MODEL_NotifyInstanceDeleted(cha
@@ -1409,7 +1409,7 @@ int DATA_MODEL_NotifyInstanceDeleted(cha
// Exit if instance does not exist - nothing to do
if (exists == false)
{
@@ -35,11 +35,11 @@ Index: obuspa-10.0.7.0/src/core/data_model.c
return USP_ERR_OBJECT_DOES_NOT_EXIST;
}
Index: obuspa-10.0.7.0/src/core/mqtt.c
===================================================================
--- obuspa-10.0.7.0.orig/src/core/mqtt.c
+++ obuspa-10.0.7.0/src/core/mqtt.c
@@ -4070,7 +4070,7 @@ void MessageV5Callback(struct mosquitto
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
index 388697a..444b4da 100644
--- a/src/core/mqtt.c
+++ b/src/core/mqtt.c
@@ -4020,7 +4020,7 @@ void MessageV5Callback(struct mosquitto *mosq, void *userdata, const struct mosq
if (mosquitto_property_read_string(props, RESPONSE_TOPIC,
&response_info_ptr, false) == NULL)
{

View File

@@ -4,11 +4,11 @@ Date: Wed Apr 30 17:18:27 2025 +0530
1001-use-datamodel-caching.patch
Index: obuspa-10.0.7.0/src/core/cli_server.c
===================================================================
--- obuspa-10.0.7.0.orig/src/core/cli_server.c
+++ obuspa-10.0.7.0/src/core/cli_server.c
@@ -513,6 +513,7 @@ int CLI_SERVER_ExecuteCliCommand(char *c
diff --git a/src/core/cli_server.c b/src/core/cli_server.c
index da61c6f..abac7cb 100644
--- a/src/core/cli_server.c
+++ b/src/core/cli_server.c
@@ -511,6 +511,7 @@ int CLI_SERVER_ExecuteCliCommand(char *cmd_line)
SendCliResponse("WARNING: Discarding unused args: %s\n", args.vector[cli_cmd->max_args+1]);
}
@@ -16,7 +16,7 @@ Index: obuspa-10.0.7.0/src/core/cli_server.c
// Process command
err = cli_cmd->exec_cmd(&args);
print_help = false;
@@ -672,6 +673,11 @@ int ExecuteCli_Version(str_vector_t *arg
@@ -670,6 +671,11 @@ int ExecuteCli_Version(str_vector_t *args)
int ExecuteCli_Get(str_vector_t *args)
{
combined_role_t *combined_role;
@@ -28,22 +28,22 @@ Index: obuspa-10.0.7.0/src/core/cli_server.c
#ifndef REMOVE_USP_BROKER
char *arg1;
Index: obuspa-10.0.7.0/src/core/data_model.h
===================================================================
--- obuspa-10.0.7.0.orig/src/core/data_model.h
+++ obuspa-10.0.7.0/src/core/data_model.h
@@ -417,5 +417,6 @@ int DM_PRIV_ReRegister_DBParam_Default(c
diff --git a/src/core/data_model.h b/src/core/data_model.h
index 7564127..2736d7c 100755
--- a/src/core/data_model.h
+++ b/src/core/data_model.h
@@ -405,5 +405,6 @@ int DM_PRIV_ReRegister_DBParam_Default(char *path, char *value);
bool DM_PRIV_IsChildNodeOf(dm_node_t *node, dm_node_t *parent_node);
void DM_PRIV_GetAllEventsAndCommands(dm_node_t *node, str_vector_t *events, str_vector_t *commands);
+int vendor_create_dm_cache(char *paths[], int num_paths);
#endif
Index: obuspa-10.0.7.0/src/core/handle_get.c
===================================================================
--- obuspa-10.0.7.0.orig/src/core/handle_get.c
+++ obuspa-10.0.7.0/src/core/handle_get.c
@@ -129,6 +129,7 @@ void MSG_HANDLER_HandleGet(Usp__Msg *usp
diff --git a/src/core/handle_get.c b/src/core/handle_get.c
index d9d3e9e..c263978 100644
--- a/src/core/handle_get.c
+++ b/src/core/handle_get.c
@@ -129,6 +129,7 @@ void MSG_HANDLER_HandleGet(Usp__Msg *usp, char *controller_endpoint, mtp_conn_t
goto exit;
}
@@ -51,11 +51,11 @@ Index: obuspa-10.0.7.0/src/core/handle_get.c
// Calculate the number of hierarchical levels to traverse in the data model when performing partial path resolution
// NOTE: protocol buffer has depth as an unsigned quantity, but internally we use a signed number, so limit range to that of a signed number
depth = usp->body->request->get->max_depth;
Index: obuspa-10.0.7.0/src/core/msg_handler.c
===================================================================
--- obuspa-10.0.7.0.orig/src/core/msg_handler.c
+++ obuspa-10.0.7.0/src/core/msg_handler.c
@@ -987,6 +987,8 @@ int HandleUspMessage(Usp__Msg *usp, char
diff --git a/src/core/msg_handler.c b/src/core/msg_handler.c
index 647591d..b7498d8 100755
--- a/src/core/msg_handler.c
+++ b/src/core/msg_handler.c
@@ -863,6 +863,8 @@ int HandleUspMessage(Usp__Msg *usp, char *endpoint_id, mtp_conn_t *mtpc)
MSG_HANDLER_UspMsgTypeToString(usp->header->msg_type),
iso8601_cur_time(buf, sizeof(buf)) );

View File

@@ -1,8 +1,8 @@
Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
Index: obuspa-10.0.0.1/src/core/device_bulkdata.c
===================================================================
--- obuspa-10.0.4.0.orig/src/core/device_bulkdata.c
+++ obuspa-10.0.4.0/src/core/device_bulkdata.c
@@ -378,6 +378,8 @@ int DEVICE_BULKDATA_Init(void)
--- obuspa-10.0.0.1.orig/src/core/device_bulkdata.c
+++ obuspa-10.0.0.1/src/core/device_bulkdata.c
@@ -375,6 +375,8 @@ int DEVICE_BULKDATA_Init(void)
// Device.BulkData.Profile.{i}.MQTT
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.MQTT.Reference", "", Validate_BulkDataMqttReference, NULL, DM_STRING);
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.MQTT.PublishTopic", "", NULL, NULL, DM_STRING);

View File

@@ -1,8 +1,8 @@
Index: obuspa-10.0.7.0/src/core/data_model.c
Index: obuspa-10.0.0.2/src/core/data_model.c
===================================================================
--- obuspa-10.0.7.0.orig/src/core/data_model.c
+++ obuspa-10.0.7.0/src/core/data_model.c
@@ -5519,7 +5519,7 @@ int RegisterDefaultControllerTrust(void)
--- obuspa-10.0.0.2.orig/src/core/data_model.c
+++ obuspa-10.0.0.2/src/core/data_model.c
@@ -5347,7 +5347,7 @@ int RegisterDefaultControllerTrust(void)
int err = USP_ERR_OK;
// Register 'Full Access' role

View File

@@ -1,8 +1,8 @@
Index: obuspa-10.0.6.0/src/core/device.h
Index: obuspa-10.0.0.2/src/core/device.h
===================================================================
--- obuspa-10.0.6.0.orig/src/core/device.h
+++ obuspa-10.0.6.0/src/core/device.h
@@ -355,6 +355,10 @@ void DEVICE_CONTROLLER_SetInheritedRole(
--- obuspa-10.0.0.2.orig/src/core/device.h
+++ obuspa-10.0.0.2/src/core/device.h
@@ -346,6 +346,10 @@ void DEVICE_CONTROLLER_SetInheritedRole(
int DEVICE_CONTROLLER_CountEnabledWebsockClientConnections(void);
#endif
@@ -13,11 +13,11 @@ Index: obuspa-10.0.6.0/src/core/device.h
#ifndef REMOVE_USP_BROKER
int DEVICE_SUBSCRIPTION_RouteNotification(Usp__Msg *usp, int instance, char *subscribed_path);
bool DEVICE_SUBSCRIPTION_MarkVendorLayerSubs(int broker_instance, subs_notify_t notify_type, char *path, int group_id);
Index: obuspa-10.0.6.0/src/core/device_controller.c
Index: obuspa-10.0.0.2/src/core/device_controller.c
===================================================================
--- obuspa-10.0.6.0.orig/src/core/device_controller.c
+++ obuspa-10.0.6.0/src/core/device_controller.c
@@ -969,6 +969,78 @@ int DEVICE_CONTROLLER_QueueBinaryMessage
--- obuspa-10.0.0.2.orig/src/core/device_controller.c
+++ obuspa-10.0.0.2/src/core/device_controller.c
@@ -968,6 +968,78 @@ int DEVICE_CONTROLLER_QueueBinaryMessage
return USP_ERR_OK;
}
@@ -96,11 +96,11 @@ Index: obuspa-10.0.6.0/src/core/device_controller.c
/*********************************************************************//**
**
** DEVICE_CONTROLLER_IsMTPConfigured
Index: obuspa-10.0.6.0/src/core/msg_handler.c
Index: obuspa-10.0.0.2/src/core/msg_handler.c
===================================================================
--- obuspa-10.0.6.0.orig/src/core/msg_handler.c
+++ obuspa-10.0.6.0/src/core/msg_handler.c
@@ -1344,6 +1344,15 @@ int ValidateUspRecord(UspRecord__Record
--- obuspa-10.0.0.2.orig/src/core/msg_handler.c
+++ obuspa-10.0.0.2/src/core/msg_handler.c
@@ -1220,6 +1220,15 @@ int ValidateUspRecord(UspRecord__Record
usp_service_instance = USP_BROKER_GetUspServiceInstance(rec->from_id, 0);
#endif

View File

@@ -1,8 +1,8 @@
Index: obuspa-10.0.6.0/src/core/mqtt.c
Index: obuspa-10.0.0.1/src/core/mqtt.c
===================================================================
--- obuspa-10.0.6.0.orig/src/core/mqtt.c
+++ obuspa-10.0.6.0/src/core/mqtt.c
@@ -265,6 +265,8 @@ void SaveMqttPublishErrMsg(const char *f
--- obuspa-10.0.0.1.orig/src/core/mqtt.c
+++ obuspa-10.0.0.1/src/core/mqtt.c
@@ -259,6 +259,8 @@ void MqttSubscriptionDestroy(mqtt_subscr
#define DEFINE_MQTT_TrustCertVerifyCallbackIndex(index) \
int MQTT_TrustCertVerifyCallback_##index (int preverify_ok, X509_STORE_CTX *x509_ctx) \
{\
@@ -11,7 +11,7 @@ Index: obuspa-10.0.6.0/src/core/mqtt.c
return DEVICE_SECURITY_TrustCertVerifyCallbackWithCertChain(preverify_ok, x509_ctx, &mqtt_clients[index].cert_chain);\
}
@@ -275,6 +277,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex
@@ -269,6 +271,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex
DEFINE_MQTT_TrustCertVerifyCallbackIndex(2);
DEFINE_MQTT_TrustCertVerifyCallbackIndex(3);
DEFINE_MQTT_TrustCertVerifyCallbackIndex(4);
@@ -23,7 +23,7 @@ Index: obuspa-10.0.6.0/src/core/mqtt.c
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
//------------------------------------------------------------------------------------
@@ -285,10 +292,15 @@ ssl_verify_callback_t* mqtt_verify_callb
@@ -279,10 +286,15 @@ ssl_verify_callback_t* mqtt_verify_callb
MQTT_TrustCertVerifyCallbackIndex(2),
MQTT_TrustCertVerifyCallbackIndex(3),
MQTT_TrustCertVerifyCallbackIndex(4),

View File

@@ -1,7 +1,7 @@
Index: obuspa-10.0.7.0/src/core/mqtt.c
===================================================================
--- obuspa-10.0.7.0.orig/src/core/mqtt.c
+++ obuspa-10.0.7.0/src/core/mqtt.c
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
index 70978501b1..96119fe080 100644
--- a/src/core/mqtt.c
+++ b/src/core/mqtt.c
@@ -53,6 +53,7 @@
#include <openssl/bio.h>
#include <openssl/err.h>
@@ -10,7 +10,7 @@ Index: obuspa-10.0.7.0/src/core/mqtt.c
#include <mosquitto.h>
#include "mqtt.h"
@@ -206,8 +207,9 @@ int EnableMosquitto(mqtt_client_t *clien
@@ -201,8 +202,9 @@ int EnableMosquitto(mqtt_client_t *client);
void SetupCallbacks(mqtt_client_t *client);
void QueueUspConnectRecord_MQTT(mqtt_client_t *client, mtp_send_item_t *msi, char *controller_topic, time_t expiry_time);
int SendQueueHead(mqtt_client_t *client);
@@ -21,7 +21,7 @@ Index: obuspa-10.0.7.0/src/core/mqtt.c
int ConnectSetEncryption(mqtt_client_t *client);
void ConnectCallback(struct mosquitto *mosq, void *userdata, int result);
void ConnectV5Callback(struct mosquitto *mosq, void *userdata, int result, int flags, const mosquitto_property *props);
@@ -250,7 +252,7 @@ void HandleMqttReconnect(mqtt_client_t *
@@ -245,7 +247,7 @@ void HandleMqttReconnect(mqtt_client_t *client);
void HandleMqttReconnectAfterDisconnect(mqtt_client_t *client);
void HandleMqttDisconnect(mqtt_client_t *client);
void DisconnectIfAllSubscriptionsFailed(mqtt_client_t *client);
@@ -30,7 +30,7 @@ Index: obuspa-10.0.7.0/src/core/mqtt.c
void RemoveMqttQueueItem(mqtt_client_t *client, mqtt_send_item_t *queued_msg);
void RemoveExpiredMqttMessages(mqtt_client_t *client);
void ParseSubscribeTopicsFromConnack(mqtt_client_t *client, mosquitto_property *prop);
@@ -2380,6 +2382,143 @@ int SendQueueHead(mqtt_client_t *client)
@@ -2350,6 +2352,143 @@ int SendQueueHead(mqtt_client_t *client)
return err;
}
@@ -174,7 +174,7 @@ Index: obuspa-10.0.7.0/src/core/mqtt.c
/*********************************************************************//**
**
** IsMqttBrokerUp
@@ -2394,109 +2533,92 @@ int SendQueueHead(mqtt_client_t *client)
@@ -2364,109 +2503,92 @@ int SendQueueHead(mqtt_client_t *client)
** \return true if the MQTT Broker is up, false otherwise
**
**************************************************************************/
@@ -343,7 +343,7 @@ Index: obuspa-10.0.7.0/src/core/mqtt.c
}
return result;
@@ -2517,18 +2639,20 @@ void Connect(mqtt_client_t *client)
@@ -2487,18 +2609,20 @@ void Connect(mqtt_client_t *client)
{
int err = USP_ERR_OK;
bool is_up;
@@ -367,7 +367,7 @@ Index: obuspa-10.0.7.0/src/core/mqtt.c
// Exit if failed to connect
if (err != USP_ERR_OK)
@@ -2561,7 +2685,7 @@ exit:
@@ -2531,7 +2655,7 @@ exit:
** \return USP_ERR_INTERNAL_ERROR if failed to connect (and should retry)
**
**************************************************************************/
@@ -376,7 +376,7 @@ Index: obuspa-10.0.7.0/src/core/mqtt.c
{
int version;
mosquitto_property *proplist = NULL;
@@ -2631,19 +2755,19 @@ int PerformMqttClientConnect(mqtt_client
@@ -2601,19 +2725,19 @@ int PerformMqttClientConnect(mqtt_client_t *client)
// We do this to prevent the data model thread from potentially being blocked, whilst the connect call is taking place
OS_UTILS_UnlockMutex(&mqtt_access_mutex);

View File

@@ -97,13 +97,15 @@ packet_capture_launch() {
fi
if [ -n "${interface}" ]; then
intf=$(ifstatus "${interface}" | jsonfilter -e '$.l3_device')
intf=$(ifstatus "${interface}" | jq ".l3_device")
if [ -z "${intf}" ]; then
# Error
packet_capture_error "Error_Internal" "${proto}"
return
fi
intf=$(eval echo "${intf}")
fi
cmd="timeout ${duration} tcpdump -w ${filename}"

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=parental-control
PKG_VERSION:=1.4.3
PKG_VERSION:=1.4.1
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/parental-control.git
PKG_SOURCE_VERSION:=f7ec652c763bf6ffd550bf7d51b2c125774b79af
PKG_SOURCE_VERSION:=bd852e8b0a6528893917fb89e2ea27a8920f6280
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -148,7 +148,7 @@ reload_service() {
}
service_triggers() {
local enable urlfilter default_wan_interface
local enable urlfilter default_wan_interface
validate_global_section || {
return 1

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=periodicstats
PKG_VERSION:=1.6.3
PKG_VERSION:=1.5.18
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/periodicstats.git
PKG_SOURCE_VERSION:=351db77e982b1f4887e5878345fe98be72d262fb
PKG_SOURCE_VERSION:=2772d77bd477adfdf513499fda11397107996d21
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -0,0 +1,60 @@
#
# Copyright (C) 2019 iopsys
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=peripheral_manager
PKG_VERSION:=1.0.6
PKG_RELEASE:=1
PKG_SOURCE_VERSION:=21522c2003b8c61904acc61ff97e54fc9b0c3c92
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/peripheral-manager
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=LICENSE
# support parallel build
PKG_BUILD_PARALLEL:=1
# run install target when cross compiling. basically, make install DESTDIR=$(PKG_INSTALL_DIR)
# this way we don't need to pick out the resulting files from the build dir.
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/peripheral_manager
CATEGORY:=Utilities
TITLE:=Application deamon for handling of peripheral
URL:=
DEPENDS:=+libuci +libubus +libblobmsg-json
endef
define Package/peripheral_manager/description
Application handling peripheral
endef
CMAKE_OPTIONS += \
-DCMAKE_BUILD_TYPE:String="Release" \
define Package/peripheral_manager/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/etc/
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/peripheral_manager $(1)/sbin/
# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpio_test $(1)/sbin/
endef
$(eval $(call BuildPackage,peripheral_manager))

View File

@@ -0,0 +1,62 @@
#!/bin/sh /etc/rc.common
START=20
USE_PROCD=1
setled() {
local enable
local brightness
config_get_bool enable $1 enable 1
config_get brightness $1 brightness 100
ubus call led.$1 set "{\"enable\":$enable,\"brightness\":$brightness}"
}
start_service() {
local enable
config_load leds
config_foreach setled led
config_get_bool enable leds enable 1
if [ "$enable" == "0" ]; then
ubus call leds set '{"state" : "alloff"}'
else
ubus call leds set '{"state" : "normal"}'
fi
}
boot() {
local led ledname
ubus list led* >/dev/null || sleep 1
ubus list led* >/dev/null || sleep 1
[ -f /etc/config/leds ] || touch /etc/config/leds
if ! uci -q get leds.leds >/dev/null; then
uci set leds.leds=leds
uci set leds.leds.enable=1
fi
for led in $(ubus list led.*); do
ledname=${led:4}
case $ledname in
*phy*) continue ;;
esac
if ! uci -q get leds.$ledname >/dev/null; then
uci set leds.$ledname=led
uci set leds.$ledname.enable=1
fi
done
uci commit leds
start
}
service_triggers()
{
procd_add_reload_trigger "leds"
}

View File

@@ -0,0 +1,25 @@
#!/bin/sh /etc/rc.common
START=12
STOP=89
USE_PROCD=1
NAME=peripheral_manager
PROG=/sbin/peripheral_manager
start_service() {
procd_open_instance
procd_set_param command "$PROG" -f
procd_set_param respawn
procd_close_instance
}
service_running() {
ubus -t 2 wait_for led.status
ubus call led.status set '{"state":"notice"}'
ubus -t 2 wait_for buttons
}
stop_service() {
ubus call leds set '{"state":"alloff"}'
}

View File

@@ -0,0 +1,19 @@
#!/bin/sh
usage () {
echo "Usage: ledctl [normal|test|allon|alloff|production]"
exit 1
}
[ $# -ne 1 ] && usage
ledstate=$(echo $1 | tr 'A-Z' 'a-z')
case $ledstate in
normal|test|allon|alloff|production)
ubus call leds set "{\"state\" : \"$ledstate\"}"
;;
*)
usage
;;
esac

22
ponmngr/files/common/etc/uci-defaults/60-xpon-generate Normal file → Executable file
View File

@@ -1,17 +1,13 @@
#!/bin/sh
. /lib/functions/system.sh
. /lib/functions/iopsys-environment.sh
configure_serial_number() {
# check if serial number is present in the production data
local production_sn="$(get_xpon_serial 2>/dev/null)"
[ ${#production_sn} -eq 12 ] || production_sn="$(fw_printenv -n gponsn)"
local production_sn="$(fw_printenv -n gponsn)"
if [ ${#production_sn} -eq 12 ]; then
uci set xpon.ani.serial_number="${production_sn}"
else
local macaddr="$(get_mac_label | tr -d ':' | tr 'a-z' 'A-Z')"
local macaddr="$(fw_printenv -n ethaddr | tr -d ':' | tr 'a-z' 'A-Z')"
local vendor_id="IOPS"
local vssn="${macaddr:4:8}"
@@ -24,10 +20,8 @@ configure_ploam_password() {
local passwd="$(uci -q get xpon.ani.ploam_password)"
if [ -z "${passwd}" ]; then
local production_passwd="$(get_xpon_password 2>/dev/null)"
[ -n "${production_passwd}" ] || production_passwd="$(fw_printenv -n gponpswd)"
if [ -n "${production_passwd}" ]; then
local production_passwd="$(fw_printenv -n gponpswd)"
if [ -n ${#production_passwd} ]; then
uci set xpon.ani.ploam_password="${production_passwd}"
uci set xpon.ani.ploam_hexadecimalpassword=0
fi
@@ -42,12 +36,10 @@ configure_loid_authentication() {
local loidpwd="$(uci -q get xpon.ani.loid_password)"
if [ -z "${loid}" ]; then
production_loid="$(get_xpon_loid 2>/dev/null)"
[ -n "${production_loid}" ] || production_loid="$(fw_printenv -n gponloid)"
production_loid="$(fw_printenv -n gponloid)"
fi
if [ -z "${loidpwd}" ]; then
production_loidpwd="$(get_xpon_loid_password 2>/dev/null)"
[ -n "${production_loidpwd}" ] || production_loidpwd="$(fw_printenv -n gponloid_password)"
production_loidpwd="$(fw_printenv -n gponloid_password)"
fi
if [ -n "${production_loid}" ]; then
@@ -56,6 +48,7 @@ configure_loid_authentication() {
if [ -n "${production_loidpwd}" ]; then
uci set xpon.ani.loid_password="${production_loidpwd}"
fi
}
if [ -s "/etc/config/xpon" ]; then
@@ -79,3 +72,4 @@ uci set xpon.ani.enable="1"
configure_serial_number
configure_ploam_password
configure_loid_authentication

View File

@@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=qosmngr
PKG_VERSION:=1.1.2
PKG_VERSION:=1.1.0
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/qosmngr.git
PKG_SOURCE_VERSION:=ee6692438c5d533758c2ea50624c049cda2d07da
PKG_SOURCE_VERSION:=1a15f1da7a1474d29aad77b8ad3272fcf4b4f6d1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -32,7 +32,7 @@ define Package/qosmngr
TITLE:=QoS Manager
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libqos +!(TARGET_brcmbca||TARGET_airoha):tc-full
DEPENDS+=+kmod-ebt-vlantranslation +kmod-ebt-dscp2pbit +!(TARGET_brcmbca):ebtables-legacy
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service +dm-agent
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service +bridgemngr
endef
define Package/qosmngr/description

View File

@@ -114,7 +114,6 @@ hw_init_all() {
export TMP_HW_QUEUE_LIST=""
echo clear > /proc/ifc_debug
echo reinit > /proc/ifc_debug
echo 'set mode 0 2' 2> /dev/null > /proc/tc3162/fe_acnt_mapping # Accounter #2 is used for meter #0, so we need re-assign IP flow accounting mode (mode 0) to #2.
for tc in $(seq 0 7); do
rm -rf "/tmp/qos/dscp_values_${tc}_4"
@@ -134,10 +133,6 @@ hw_init_all() {
# set_wan_ingress_rate "0" - Not needed, done in policer.sh
set_wan_egress_rate "0" "0"
# Don't put TCP ACKs into a high priority queue
echo 0 > /proc/qdma_lan/tcp_ack_flag
echo 0 > /proc/qdma_wan/tcp_ack_flag
return 0
}

View File

@@ -98,7 +98,7 @@ handle_policer() {
# Configure policer based on UCI subtree 'qos.policer'
configure_policer() {
# initialize ratelimit params
/userfs/bin/femgr ratelimit set rx_mode 1 2 0
/userfs/bin/femgr ratelimit set rx_mode 1 2
/userfs/bin/qdmamgr_wan set general_rx_init enable trtcm 8 125
for intf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs); do

View File

@@ -22,6 +22,10 @@ ip_rule_get_converted_tos() {
echo $con_tos
}
flush_hw_nat() {
hw_nat -! > /dev/null 2>&1
}
configure_qos() {
# queue configuration is being done after shaper configuration,
# If port shapingrate configuration on DISC device is called after queue configuration then
@@ -33,8 +37,9 @@ configure_qos() {
configure_policer
configure_classify
if [ -f "/tmp/qos/classify.ebtables" ]; then
sh /tmp/qos/classify.ebtables
sh /tmp/qos/classify.ebtables
fi
flush_hw_nat
}
reload_qos() {
@@ -65,6 +70,7 @@ reload_qos() {
;;
esac
hw_commit_all
flush_hw_nat
}
reload_qos_service() {

View File

@@ -42,7 +42,7 @@ handle_shaper() {
# Configure shaper based on options saved to UCI tree 'qos.shaper'
configure_shaper() {
# initialize ratelimit params
/userfs/bin/femgr ratelimit set rx_mode 0 2 0
/userfs/bin/femgr ratelimit set rx_mode 0 2
/userfs/bin/qdmamgr_lan set general_rx_init enable trtcm 8 125
# Delete existing shaper

29
quickjs/Makefile Executable file → Normal file
View File

@@ -5,8 +5,8 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/bellard/quickjs.git
PKG_SOURCE_DATE:=2025-07-09
PKG_SOURCE_VERSION:=1fdc768fdc8571300755cdd3e4654ce99c0255ce
PKG_SOURCE_DATE:=2022-03-06
PKG_SOURCE_VERSION:=2788d71e823b522b178db3b3660ce93689534e6d
PKG_MIRROR_HASH:=skip
PKG_LICENSE:=MIT
@@ -15,8 +15,6 @@ PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
TARGET_CFLAGS += -fPIC
define Package/quickjs
SECTION:=lang
CATEGORY:=Languages
@@ -33,30 +31,15 @@ define Package/quickjs/description
endef
MAKE_FLAGS = \
PREFIX=/usr \
prefix=/usr \
CONFIG_SMALL=y \
EXTRA_LIBS="-latomic" \
CROSS_PREFIX="$(TARGET_CROSS)"
define Build/Compile
# The upstream Makefile uses the same CFLAGS for host and target builds,
# which breaks cross-compilation. We work around this by first building
# the host tools ('host-qjsc', 'unicode_gen') with the host compiler
# and flags.
# We still pass MAKE_FLAGS so the upstream Makefile knows we're cross-compiling.
CFLAGS="$(HOST_CFLAGS)" \
LDFLAGS="$(HOST_LDFLAGS)" \
$(MAKE) -C $(PKG_BUILD_DIR) \
$(MAKE_FLAGS) \
host-qjsc unicode_gen
# Then we proceed with the default build process for the target binaries.
# Make should not rebuild the host tools as they are already up-to-date.
$(call Build/Compile/Default)
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/lib/quickjs
$(CP) $(PKG_INSTALL_DIR)/usr/lib/quickjs/libquickjs.a $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/quickjs/libquickjs.lto.a $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/include/quickjs
$(CP) $(PKG_INSTALL_DIR)/usr/include/quickjs/quickjs.h $(1)/usr/include/quickjs/
$(CP) $(PKG_INSTALL_DIR)/usr/include/quickjs/quickjs-libc.h $(1)/usr/include/quickjs/

View File

@@ -0,0 +1,87 @@
diff --git a/Makefile b/Makefile
index 49b1f6f..2c96eae 100644
--- a/Makefile
+++ b/Makefile
@@ -33,6 +33,8 @@ CONFIG_LTO=y
#CONFIG_WERROR=y
# force 32 bit build for some utilities
#CONFIG_M32=y
+# build with -Os instead of -O2
+#CONFIG_SMALL=y
ifdef CONFIG_DARWIN
# use clang instead of gcc
@@ -52,6 +54,13 @@ CONFIG_BIGNUM=y
OBJDIR=.obj
+CFLAGS_ENV:=$(CFLAGS)
+LDFLAGS_ENV:=$(LDFLAGS)
+
+HOST_BUILD=
+CFLAGS=$(if $(HOST_BUILD),,$(CFLAGS_ENV))
+LDFLAGS=$(if $(HOST_BUILD),,$(LDFLAGS_ENV))
+
ifdef CONFIG_WIN32
ifdef CONFIG_M32
CROSS_PREFIX=i686-w64-mingw32-
@@ -66,7 +75,7 @@ endif
ifdef CONFIG_CLANG
HOST_CC=clang
CC=$(CROSS_PREFIX)clang
- CFLAGS=-g -Wall -MMD -MF $(OBJDIR)/$(@F).d
+ CFLAGS += -g -Wall -MMD -MF $(OBJDIR)/$(@F).d
CFLAGS += -Wextra
CFLAGS += -Wno-sign-compare
CFLAGS += -Wno-missing-field-initializers
@@ -87,7 +96,7 @@ ifdef CONFIG_CLANG
else
HOST_CC=gcc
CC=$(CROSS_PREFIX)gcc
- CFLAGS=-g -Wall -MMD -MF $(OBJDIR)/$(@F).d
+ CFLAGS += -g -Wall -MMD -MF $(OBJDIR)/$(@F).d
CFLAGS += -Wno-array-bounds -Wno-format-truncation
ifdef CONFIG_LTO
AR=$(CROSS_PREFIX)gcc-ar
@@ -110,9 +119,13 @@ endif
CFLAGS+=$(DEFINES)
CFLAGS_DEBUG=$(CFLAGS) -O0
CFLAGS_SMALL=$(CFLAGS) -Os
+ifdef CONFIG_SMALL
+CFLAGS_OPT=$(CFLAGS) -Os
+else
CFLAGS_OPT=$(CFLAGS) -O2
+endif
CFLAGS_NOLTO:=$(CFLAGS_OPT)
-LDFLAGS=-g
+LDFLAGS+=-g
ifdef CONFIG_LTO
CFLAGS_SMALL+=-flto
CFLAGS_OPT+=-flto
@@ -195,6 +208,8 @@ qjsc$(EXE): $(OBJDIR)/qjsc.o $(QJS_LIB_OBJS)
ifneq ($(CROSS_PREFIX),)
+$(QJSC): HOST_BUILD=1
+
$(QJSC): $(OBJDIR)/qjsc.host.o \
$(patsubst %.o, %.host.o, $(QJS_LIB_OBJS))
$(HOST_CC) $(LDFLAGS) -o $@ $^ $(HOST_LIBS)
@@ -262,6 +277,8 @@ run-test262-32: $(patsubst %.o, %.m32.o, $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS)
$(OBJDIR)/%.o: %.c | $(OBJDIR)
$(CC) $(CFLAGS_OPT) -c -o $@ $<
+$(OBJDIR)/%.host.o: HOST_BUILD=1
+
$(OBJDIR)/%.host.o: %.c | $(OBJDIR)
$(HOST_CC) $(CFLAGS_OPT) -c -o $@ $<
@@ -286,6 +303,8 @@ $(OBJDIR)/%.check.o: %.c | $(OBJDIR)
regexp_test: libregexp.c libunicode.c cutils.c
$(CC) $(LDFLAGS) $(CFLAGS) -DTEST -o $@ libregexp.c libunicode.c cutils.c $(LIBS)
+unicode_gen: HOST_BUILD=1
+
unicode_gen: $(OBJDIR)/unicode_gen.host.o $(OBJDIR)/cutils.host.o libunicode.c unicode_gen_def.h
$(HOST_CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJDIR)/unicode_gen.host.o $(OBJDIR)/cutils.host.o

View File

@@ -0,0 +1,106 @@
diff --git a/quickjs.c b/quickjs.c
index 7916013..3936eec 100644
--- a/quickjs.c
+++ b/quickjs.c
@@ -67,6 +67,16 @@
#define CONFIG_PRINTF_RNDN
#endif
+#ifdef CONFIG_PRINTF_RNDN
+#if !defined(FE_DOWNWARD) || !defined(FE_UPWARD)
+#ifdef CONFIG_BIGNUM
+#define CONFIG_DTOA_LIBBF
+#else
+#error "CONFIG_BIGNUM required if printf is RNDN and there is no fenv support"
+#endif
+#endif
+#endif
+
/* define to include Atomics.* operations which depend on the OS
threads */
#if !defined(EMSCRIPTEN)
@@ -11299,6 +11309,11 @@ static char *i64toa(char *buf_end, int64_t n, unsigned int base)
return q;
}
+/* maximum buffer size for js_dtoa */
+#define JS_DTOA_BUF_SIZE 128
+
+#ifndef CONFIG_DTOA_LIBBF
+
/* buf1 contains the printf result */
static void js_ecvt1(double d, int n_digits, int *decpt, int *sign, char *buf,
int rounding_mode, char *buf1, int buf1_size)
@@ -11318,9 +11333,6 @@ static void js_ecvt1(double d, int n_digits, int *decpt, int *sign, char *buf,
*decpt = atoi(buf1 + n_digits + 2 + (n_digits > 1)) + 1;
}
-/* maximum buffer size for js_dtoa */
-#define JS_DTOA_BUF_SIZE 128
-
/* needed because ecvt usually limits the number of digits to
17. Return the number of digits. */
static int js_ecvt(double d, int n_digits, int *decpt, int *sign, char *buf,
@@ -11429,6 +11441,8 @@ static void js_fcvt(char *buf, int buf_size, double d, int n_digits)
js_fcvt1(buf, buf_size, d, n_digits, rounding_mode);
}
+#endif /* CONFIG_DTOA_LIBBF */
+
/* radix != 10 is only supported with flags = JS_DTOA_VAR_FORMAT */
/* use as many digits as necessary */
#define JS_DTOA_VAR_FORMAT (0 << 0)
@@ -11442,8 +11456,10 @@ static void js_fcvt(char *buf, int buf_size, double d, int n_digits)
/* XXX: slow and maybe not fully correct. Use libbf when it is fast enough.
XXX: radix != 10 is only supported for small integers
*/
-static void js_dtoa1(char *buf, double d, int radix, int n_digits, int flags)
+static JSValue js_dtoa(JSContext *ctx,
+ double d, int radix, int n_digits, int flags)
{
+ char buf[JS_DTOA_BUF_SIZE];
char *q;
if (!isfinite(d)) {
@@ -11465,6 +11481,25 @@ static void js_dtoa1(char *buf, double d, int radix, int n_digits, int flags)
ptr = i64toa(buf1 + sizeof(buf1), i64, radix);
strcpy(buf, ptr);
} else {
+#ifdef CONFIG_DTOA_LIBBF
+ bf_flags_t bf_flags;
+ generic_conv:
+ bf_flags = BF_RNDNA;
+ switch (flags & 3) {
+ case JS_DTOA_VAR_FORMAT:
+ bf_flags |= BF_FTOA_FORMAT_FREE_MIN;
+ break;
+ case JS_DTOA_FIXED_FORMAT:
+ bf_flags |= BF_FTOA_FORMAT_FIXED;
+ break;
+ case JS_DTOA_FRAC_FORMAT:
+ bf_flags |= BF_FTOA_FORMAT_FRAC;
+ break;
+ }
+ if (flags & JS_DTOA_FORCE_EXP)
+ bf_flags |= BF_FTOA_FORCE_EXP;
+ return js_ftoa(ctx, JS_NewFloat64(ctx, d), radix, n_digits, bf_flags);
+#else /* CONFIG_DTOA_LIBBF */
if (d == 0.0)
d = 0.0; /* convert -0 to 0 */
if (flags == JS_DTOA_FRAC_FORMAT) {
@@ -11528,14 +11563,8 @@ static void js_dtoa1(char *buf, double d, int radix, int n_digits, int flags)
sprintf(q, "%d", p);
}
}
+#endif /* CONFIG_DTOA_LIBBF */
}
-}
-
-static JSValue js_dtoa(JSContext *ctx,
- double d, int radix, int n_digits, int flags)
-{
- char buf[JS_DTOA_BUF_SIZE];
- js_dtoa1(buf, d, radix, n_digits, flags);
return JS_NewString(ctx, buf);
}

View File

@@ -1,12 +1,15 @@
diff --git a/quickjs-libc.c b/quickjs-libc.c
index 54a7a15..a64c4d6 100644
index e180dd0..76182d2 100644
--- a/quickjs-libc.c
+++ b/quickjs-libc.c
@@ -385,12 +385,86 @@ fail:
@@ -358,12 +358,89 @@ fail:
return JS_EXCEPTION;
}
+#define READALL_CHUNK (10*1024)
+// For reading files that are not seekable, per second answer from stackoverflow:
+// https://stackoverflow.com/questions/14002954/c-programming-how-to-read-the-whole-file-contents-into-a-buffer
+
+#define READALL_CHUNK 10*1024
+
+static int readall(FILE *f, JSContext *ctx, uint8_t **dataptr, size_t *sizeptr)
+{
@@ -87,10 +90,10 @@ index 54a7a15..a64c4d6 100644
size_t buf_len;
- long lret;
+ long lret = 0;
f = fopen(filename, "rb");
if (!f)
@@ -398,7 +472,7 @@ uint8_t *js_load_file(JSContext *ctx, size_t *pbuf_len, const char *filename)
@@ -371,7 +448,7 @@ uint8_t *js_load_file(JSContext *ctx, size_t *pbuf_len, const char *filename)
if (fseek(f, 0, SEEK_END) < 0)
goto fail;
lret = ftell(f);
@@ -99,7 +102,7 @@ index 54a7a15..a64c4d6 100644
goto fail;
/* XXX: on Linux, ftell() return LONG_MAX for directories */
if (lret == LONG_MAX) {
@@ -414,13 +488,19 @@ uint8_t *js_load_file(JSContext *ctx, size_t *pbuf_len, const char *filename)
@@ -387,13 +464,19 @@ uint8_t *js_load_file(JSContext *ctx, size_t *pbuf_len, const char *filename)
buf = malloc(buf_len + 1);
if (!buf)
goto fail;

View File

@@ -51,10 +51,6 @@
"description": "MAP Agent Backhaul Info",
"cmd": "ubus call map.agent backhaul_info"
},
{
"description": "MAP Agent Backhaul Status",
"cmd": "ubus call map.agent backhaul"
},
{
"description": "MAP Controller Status",
"cmd": "ubus call map.controller status"

View File

@@ -341,30 +341,6 @@ static int set_UPnPDevice_Enable(char *refparam, struct dmctx *ctx, void *data,
return 0;
}
/*#Device.UPnP.Device.UPnPIGD!UCI:upnpd/upnpd,config/igdv1*/
static int get_UPnPDevice_UPnPIGD(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_option_value_fallback_def("upnpd", "config", "igdv1", "1");
return 0;
}
static int set_UPnPDevice_UPnPIGD(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
bool b;
switch (action) {
case VALUECHECK:
if (bbfdm_validate_boolean(ctx, value))
return FAULT_9007;
return 0;
case VALUESET:
string_to_bool(value, &b);
dmuci_set_value("upnpd", "config", "igdv1", b ? "1" : "0");
return 0;
}
return 0;
}
static int get_UPnPDeviceCapabilities_UPnPArchitecture(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = "1";
@@ -833,12 +809,12 @@ DMLEAF tUPnPDeviceCapabilitiesParams[] = {
DMLEAF tUPnPDeviceParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/
{"Enable", &DMWRITE, DMT_BOOL, get_UPnPDevice_Enable, set_UPnPDevice_Enable, BBFDM_BOTH},
{"UPnPIGD", &DMWRITE, DMT_BOOL, get_UPnPDevice_UPnPIGD, set_UPnPDevice_UPnPIGD, BBFDM_BOTH},
//{"UPnPMediaServer", &DMWRITE, DMT_BOOL, get_UPnPDevice_UPnPMediaServer, set_UPnPDevice_UPnPMediaServer, BBFDM_BOTH},
//{"UPnPMediaRenderer", &DMWRITE, DMT_BOOL, get_UPnPDevice_UPnPMediaRenderer, set_UPnPDevice_UPnPMediaRenderer, BBFDM_BOTH},
//{"UPnPWLANAccessPoint", &DMWRITE, DMT_BOOL, get_UPnPDevice_UPnPWLANAccessPoint, set_UPnPDevice_UPnPWLANAccessPoint, BBFDM_BOTH},
//{"UPnPQoSDevice ", &DMWRITE, DMT_BOOL, get_UPnPDevice_UPnPQoSDevice , set_UPnPDevice_UPnPQoSDevice , BBFDM_BOTH},
//{"UPnPQoSPolicyHolder", &DMWRITE, DMT_BOOL, get_UPnPDevice_UPnPQoSPolicyHolder, set_UPnPDevice_UPnPQoSPolicyHolder, BBFDM_BOTH},
//{"UPnPIGD", &DMWRITE, DMT_BOOL, get_UPnPDevice_UPnPIGD, set_UPnPDevice_UPnPIGD, BBFDM_BOTH},
//{"UPnPDMBasicMgmt", &DMWRITE, DMT_BOOL, get_UPnPDevice_UPnPDMBasicMgmt, set_UPnPDevice_UPnPDMBasicMgmt, BBFDM_BOTH},
//{"UPnPDMConfigurationMgmt", &DMWRITE, DMT_BOOL, get_UPnPDevice_UPnPDMConfigurationMgmt, set_UPnPDevice_UPnPDMConfigurationMgmt, BBFDM_BOTH},
//{"UPnPDMSoftwareMgmt", &DMWRITE, DMT_BOOL, get_UPnPDevice_UPnPDMSoftwareMgmt, set_UPnPDevice_UPnPDMSoftwareMgmt, BBFDM_BOTH},

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sshmngr
PKG_VERSION:=1.1.1
PKG_VERSION:=1.0.6
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/sshmngr.git
PKG_SOURCE_VERSION:=dc0e3933231680aec844d587d49fefbc0cc7f8d7
PKG_SOURCE_VERSION:=0c7d58a51d6f5eb4ad33e03630206bbb4e559779
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -5,11 +5,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-base
PKG_VERSION:=5.2.2
PKG_VERSION:=5.1.8
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
PKG_SOURCE_VERSION:=b2bf5c9615e0e81afb2e6bcbf6c75b347e24c705
PKG_SOURCE_VERSION:=24cb862a27b4282668b434044a20fdc2c437316b
PKG_MIRROR_HASH:=skip
SULU_MOD:=core

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-builder
PKG_VERSION:=5.2.2
PKG_VERSION:=5.1.8
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-builder.git
PKG_SOURCE_VERSION:=d270fcaec14aaf53b1a8983e71b2c61dec1ab1ed
PKG_SOURCE_VERSION:=89f778534565e4ee9cea80fe881e9739c83d4c57
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/sulu-$(PKG_VERSION)/sulu-builder-$(PKG_SOURCE_VERSION)
@@ -28,7 +28,7 @@ define Package/sulu/default
CATEGORY:=Utilities
SUBMENU:=SULU
TITLE:=SULU-CE
DEPENDS:=+mosquitto-auth-plugin +usermngr +userinterface +obuspa
DEPENDS:=+mosquitto-auth-shadow +usermngr +userinterface +obuspa +sulu-vendorext
DEPENDS+=+@OBUSPA_LOCAL_MQTT_LISTENER
EXTRA_DEPENDS:=nginx
endef

View File

@@ -20,7 +20,7 @@ location /wss {
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Port $server_port;
@@ -50,8 +50,6 @@ location / {
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,Content-Type,Range' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
add_header Pragma 'no-cache';
if (!-f $document_root/connection/ready) {
return 503;

View File

@@ -33,7 +33,7 @@ add_sulu_config_to_mosquitto()
uci_set mosquitto sulu port '9009'
uci_set mosquitto sulu no_remote_access '1'
uci_set mosquitto sulu protocol 'websockets'
uci_set mosquitto sulu auth_plugin '/usr/lib/mosquitto_auth_plugin.so'
uci_set mosquitto sulu auth_plugin '/usr/lib/mosquitto_auth_shadow.so'
uci_set mosquitto sulu acl_file '/etc/sulu/mqtt.acl'
}

View File

@@ -7,14 +7,6 @@
{
"object": "Device.",
"perm": ["PERMIT_ALL"]
},
{
"object": "Device.Firewall.Enable",
"perm": ["PERMIT_GET", "PERMIT_SUBS_VAL_CHANGE", "PERMIT_OBJ_INFO"]
},
{
"object": "Device.Firewall.Chain.*.Rule.",
"perm": ["PERMIT_NONE"]
}
]
}

View File

@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-theme-genexis
PKG_VERSION:=5.2.2
PKG_VERSION:=5.1.8
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/gnx/sulu-theme-genexis

View File

@@ -0,0 +1,34 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-vendorext
PKG_VERSION:=0.0.4
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=none
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
define Package/sulu-vendorext
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Adds sulu-vendorext extensions
endef
define Build/Compile
endef
define Package/sulu-vendorext/install
$(BBFDM_INSTALL_MS_PLUGIN) ./extn/X_GENEXIS_EU.json $(1) sysmngr
$(BBFDM_INSTALL_MS_PLUGIN) ./extn/X_GENEXIS_EU_wan.json $(1) sysmngr
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) suluvendorext
$(BBFDM_INSTALL_MS_DM) ./extn/X_IOWRT_EU_MAPController.json $(1) suluvendorext
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,sulu-vendorext))

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