Compare commits

...

256 Commits

Author SHA1 Message Date
suvendhu
293a8a27a0 mqttmngr: Device.MQTT.Broker dotso plugin 2022-12-14 18:19:57 +05:30
suvendhu
07eb27b1dd icwmp: parsing of DHCP option 125 2022-12-14 06:55:40 +00:00
Amit Kumar
548ae9605b icwmp: dhcp handling for option 125 2022-12-14 06:55:40 +00:00
Anjan Chanda
a4f4add21b wfadatad: 2.11.0.4 2022-12-13 22:05:26 +01:00
Anjan Chanda
fe8f39cd5a ieee1905: 6.0.16 2022-12-13 22:03:41 +01:00
Jakob Olsson
77626b51b0 map-controller: 2.11.0.20 2022-12-13 17:53:56 +01:00
Jakob Olsson
d10ca5330e map-agent: 2.10.4.11 2022-12-13 17:50:40 +01:00
Jakob Olsson
c2e77a5fbe map-agent: 2.10.4.10 2022-12-12 16:20:38 +01:00
Jakob Olsson
93b9aa8312 map-controller: 2.11.0.19 2022-12-12 16:19:44 +01:00
Anjan Chanda
937ad7c0fc wfadatad: 2.11.0.2 2022-12-12 15:16:48 +01:00
Anjan Chanda
cb6d5bdc36 map-controller: 2.11.0.18 2022-12-12 15:15:17 +01:00
Anjan Chanda
df3d450671 map-agent: 2.10.4.9 2022-12-12 15:14:16 +01:00
Anjan Chanda
16951b9c31 wfadatad: 2.11.0.1 2022-12-12 13:18:43 +01:00
Anjan Chanda
cd9149efad map-topology: 2.5.1.13 2022-12-12 11:51:51 +01:00
Jakob Olsson
c4965c9c05 map-agent: 2.10.4.8 2022-12-09 16:46:23 +01:00
vdutta
d439066686 sulu: 1.3.16 2022-12-09 10:06:36 +05:30
vdutta
826aeb477e usermngr: CheckCredentialsDiagnostic Operate 2022-12-08 12:07:06 +05:30
Yalu Zhang
63b776f97d Update packages voicemngr, libvoice-broadcom and libvoice-d2 2022-12-07 18:18:38 +01:00
Jakob Olsson
a7383806cd map-agent: 2.10.4.7 2022-12-07 15:49:31 +01:00
vdutta
81d15db29c sulu: 1.3.15 2022-12-07 19:29:48 +05:30
vdutta
07bf2de658 uspd: 2.2.22 2022-12-07 19:24:59 +05:30
Jakob Olsson
5c94394a6b map-agent: 2.10.4.6 2022-12-07 10:47:24 +01:00
Suvendhu Hansa
224a40f7b4 usermngr: added uci-defaults to sync shells 2022-12-07 09:26:32 +00:00
Janusz Dziedzic
f7bc58530b map-controller: 2.11.0.17 2022-12-07 09:14:26 +00:00
Janusz Dziedzic
c11bf82271 easy-soc-libs: 6.8.0
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2022-12-07 08:48:48 +00:00
Janusz Dziedzic
4bf446929a easy-soc-libs: 6.7.9
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2022-12-07 06:46:01 +00:00
Jakob Olsson
85c916aa6d map-topology: 2.5.1.11 2022-12-06 16:28:06 +01:00
Janusz Dziedzic
a142950c90 map-agent: 2.10.4.5 2022-12-06 14:08:28 +00:00
Janusz Dziedzic
0f28109363 ieee1905: 6.0.9 2022-12-06 14:02:54 +00:00
Anjan Chanda
e2c593662d ieee1905: 6.0.8 2022-12-06 14:31:00 +01:00
Amin Ben Romdhane
749713615c bbf: 6.8.9 2022-12-06 14:21:34 +01:00
vdutta
e6ff986010 sulu: 1.3.14 2022-12-06 10:59:43 +05:30
Jakob Olsson
7f8869cdae map-agent: 2.10.4.4 2022-12-05 17:17:08 +01:00
Jakob Olsson
9a5658fa23 map-agent: 2.10.4.3 2022-12-05 16:19:33 +01:00
Anjan Chanda
9874a26de2 ieee1905: 6.0.7 2022-12-05 09:47:03 +01:00
vdutta
ee54c28426 sulu: 1.3.13 2022-12-05 11:57:46 +05:30
Jakob Olsson
71d8a2ac30 map-controller: 2.11.0.16 2022-12-02 15:09:06 +01:00
Jakob Olsson
b35cc044b4 map-controller: 2.11.0.15 2022-12-02 14:35:12 +01:00
Amin Ben Romdhane
8d80e4d38f bbf: 6.8.8 2022-12-02 14:23:02 +01:00
Jakob Olsson
55afb62ba0 map-agent: 2.10.4.2 2022-12-02 14:21:44 +01:00
Sukru Senli
07a8753149 iop: config: select usermngr 2022-12-02 14:08:45 +01:00
Andreas Gnau
5d3027c777 iop: genconfig: Use lowercase version name throughout
OpenWrt normalises the version number in the image name to lowercase.
For consistency set the version already in lowercase in the config so
that there is not inconsistency between the version stored in
/etc/os-release and the image name.

Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
2022-12-02 14:05:12 +01:00
Filip Matusiak
8c2421018a map-agent: add On Boot Only scan config option
Signed-off-by: Filip Matusiak <filip.matusiak@iopsys.eu>
2022-12-02 12:57:30 +00:00
vdutta
a4f7d4650b usermngr: 1.0.1 2022-12-02 17:36:39 +05:30
vdutta
ab92e503bc uspd: 2.2.21 2022-12-02 17:08:20 +05:30
vdutta
f0f3560789 sulu: 1.3.12 2022-12-02 17:07:11 +05:30
vdutta
a7577d8975 bbf: 6.8.7 2022-12-02 17:02:16 +05:30
Sukru Senli
243e034156 questd: 5.2.5 2022-12-02 11:58:21 +01:00
vdutta
ea242d4e4d swmodd: 2.1.19 2022-12-02 15:40:17 +05:30
suvendhu
2c154d09e6 usermngr: added new package for user management 2022-12-02 15:15:37 +05:30
Jakob Olsson
62166c5465 map-agent: 2.10.4.1 2022-12-01 14:46:28 +01:00
Andreas Gnau
89264fa175 iop: genconfig: Use new version format
Use a new version format:

* More strict regex for filtering tags for determining version which
  prevents OpenWrt and hopefully other tags from becoming the IOWRT
  version
* version follows standard git-describe format with -dirty
* customerconfigs are appended to the version

Example-versions:
 * 7.1.0BETA1
 * 7.1.0BETA1-29-g1292f9102e-dirty
 * 7.1.0BETA1-29-g1292f9102e-secureboot
 * 7.1.0BETA1-29-g1292f9102e-securebooteval
Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
2022-11-30 19:53:44 +01:00
Anjan Chanda
6091b22937 map-topology: 2.5.1.10 2022-11-30 17:36:10 +01:00
Jakob Olsson
e0f2f11174 map-agent: 2.10.4.0 2022-11-30 16:53:43 +01:00
Janusz Dziedzic
1df0c1472f easy-soc-libs: 6.7.8
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2022-11-30 15:23:50 +00:00
Yalu Zhang
cc5348a282 voicemngr: Divide libvoice to common code and platform specific one
Also add a new packages libvoice-broadcom.
2022-11-30 14:19:40 +01:00
vdutta
d18a1b6788 uspd: 2.2.20 2022-11-30 15:28:47 +05:30
vdutta
8553a5c00f obuspa: 6.0.0.11 2022-11-30 15:26:12 +05:30
Anjan Chanda
67d2e0fe01 ieee1905: 6.0.2 2022-11-29 19:23:06 +01:00
Marek Puzyniak
423c7e7f7a easy-soc-libs: 6.7.7 2022-11-29 14:05:11 +00:00
vdutta
ff6a0e67da bbf: 6.8.6 2022-11-29 18:35:24 +05:30
vdutta
65f8a28962 uspd: 2.2.19 2022-11-28 18:19:06 +05:30
Janusz Dziedzic
ccd154cfa5 wifimngr: 14.3.2
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2022-11-28 11:28:18 +00:00
vdutta
7b987fa396 uspd: 2.2.18 2022-11-28 16:48:32 +05:30
vdutta
3f4a439de4 icwmp: 9.1.2 2022-11-28 16:29:54 +05:30
vdutta
a1cc37d3a6 sulu: 1.3.11 2022-11-25 22:35:53 +05:30
Anjan Chanda
8af85b8883 ieee1905: 6.0.1 2022-11-25 16:47:48 +01:00
Amin Ben Romdhane
55b69db576 bbf: 6.8.5 2022-11-25 14:51:33 +01:00
Amin Ben Romdhane
07f2cc555e bbf: 6.8.4 2022-11-25 14:17:16 +01:00
Amin Ben Romdhane
6b6383c237 icwmp: 9.1.1 2022-11-25 14:16:21 +01:00
Janusz Dziedzic
03344e0df5 map-agent: 2.10.3.28
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2022-11-25 12:27:17 +00:00
vdutta
75ed0c7a18 uspd: 2.2.17 2022-11-25 16:48:56 +05:30
Suvendhu Hansa
0d076595f8 swmodd: Fix AutoStart, RequestedState for OCI containers 2022-11-25 08:36:13 +00:00
vdutta
1ba2d5ab89 obuspa: 6.0.0.10 2022-11-24 19:45:00 +05:30
vdutta
ec6533707f sulu: Role based access control 2022-11-24 19:42:50 +05:30
vdutta
f868713ed9 sulu: 1.3.10 2022-11-24 13:42:46 +05:30
vdutta
1ef8245cf9 obuspa: 6.0.0.9 2022-11-23 21:00:00 +05:30
Amit Kumar
0385a0b715 qos: qos reload handling updated 2022-11-23 18:08:57 +05:30
vdutta
5dd35e99e2 obuspa: Fix db update with uci delete 2022-11-23 12:07:26 +05:30
hemlata
43dd5bf8c7 endptmgr :Correction of codec names for codecs ubus call 2022-11-22 14:11:53 +01:00
Filip Matusiak
98ea973e61 map-agent: 2.10.3.27
Signed-off-by: Filip Matusiak <filip.matusiak@iopsys.eu>
2022-11-22 10:49:26 +01:00
vdutta
f7d0cc8dbd sulu: 1.3.9 2022-11-21 17:27:48 +05:30
hemlata
0afb94dc77 endptmngr :Support hardware specific codec capability other than hardcoding 2022-11-21 11:39:05 +01:00
Amin Ben Romdhane
3835cc0bc9 bbf: 6.8.3 2022-11-18 14:19:09 +01:00
subramanian c
7b766ea7f1 qos: Apply qos classify config in the order of order param value 2022-11-18 11:37:55 +00:00
Dineshkumar
4efacdaee5 iop: genconfig_min: Added ipq95xx target in TARGET_DEVICES model
Signed-off-by: Dineshkumar <quic_dinel@quicinc.com>
2022-11-18 10:43:15 +05:30
Dineshkumar
fb91a7f70f iop: genconfig: Added ipq95xx target in TARGET_DEVICES model
Signed-off-by: Dineshkumar <quic_dinel@quicinc.com>
2022-11-17 15:08:34 +00:00
Jakob Olsson
47f47ac097 map-controller: 2.11.0.14 2022-11-17 15:55:25 +01:00
vdutta
b4cb466f4e icwmp: 9.1.0 2022-11-17 17:02:21 +05:30
vdutta
9a1cd147d0 bbf: 6.8.2 2022-11-17 17:01:57 +05:30
vdutta
c67e429387 sulu: 1.3.8 2022-11-17 16:32:22 +05:30
Jakob Olsson
a5e6d08394 map-controller: 2.11.0.13 2022-11-17 09:45:31 +01:00
Andreas Gnau
a37729d885 iop: config: Set version config-settings
Set version config settings and document the motivation behind some
settings. This enables use of standard OpenWrt image naming for IOWRT.

Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
2022-11-17 08:42:07 +00:00
vdutta
2efa706f67 bbf: 6.8.1 2022-11-16 21:28:38 +05:30
Jakob Olsson
1911881b94 wifimngr: 05-wifi: fix multiap.backhaul path 2022-11-16 16:57:50 +01:00
Jakob Olsson
8c9f390b89 map-agent: fix multiap.backhaul path 2022-11-16 16:57:30 +01:00
Wenpeng Song
9dacae709b evoice 0.2.39
Correct libvoiceservice MaxQIValues
2022-11-16 09:16:32 +00:00
Amin Ben Romdhane
363fb57b3e bbf: Added support for UserInterface Object 2022-11-15 17:41:25 +00:00
Jakob Olsson
99ed84be4d map-controller: 2.11.0.12 2022-11-15 16:42:42 +01:00
Jakob Olsson
930611301b map-agent: 2.10.3.26 2022-11-15 16:42:05 +01:00
Jakob Olsson
e06e0a6599 ieee1905: 5.0.20 2022-11-15 16:40:16 +01:00
Filip Matusiak
9de5fe3362 map-controller: validate sta_steering section of cntlr config file
Signed-off-by: Filip Matusiak <filip.matusiak@iopsys.eu>
2022-11-15 14:00:24 +00:00
Filip Matusiak
c9fded45b7 map-controller: add sta_steering in example cntlr config file
Signed-off-by: Filip Matusiak <filip.matusiak@iopsys.eu>
2022-11-15 14:00:24 +00:00
Lukasz Kotasa
545a54eb9f TARGET rename: iopsys-brcm63xx-arm -> brcmbca 2022-11-15 12:04:23 +00:00
Lukasz Kotasa
b979bf4891 genconfig: rename iopsys-brcm63xx-arm -> brcmbca 2022-11-15 12:04:23 +00:00
Sukru Senli
d2111b2bad qosmngr: econet -> airoha 2022-11-15 11:30:10 +01:00
Lukasz Kotasa
ffb839b1d0 qosmngr: rename econet target 2022-11-14 12:47:19 +00:00
suvendhu
360e48a3cf urlfilter: added description of vendor parameters 2022-11-14 06:50:10 +00:00
vdutta
71198a83de bulkdata: 2.0.9 2022-11-14 11:04:33 +05:30
Grzegorz Sluja
87eb713593 endptmngr: Refactor inconsistency about call_id, pcm_id and pcm_state 2022-11-11 10:37:08 +01:00
vdutta
5fbc3e9efb sulu: 1.3.7 2022-11-11 14:20:46 +05:30
Janusz Dziedzic
6140efcb5a easy-soc-libs: 6.7.6
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2022-11-10 14:47:33 +00:00
Yalu Zhang
108c98c8bb Update package voicemngr
Fix a compiling error on release-6.5 branch
2022-11-10 15:35:42 +01:00
Lukasz Kotasa
887fb46dbd Rename TARGET_iopsys_econet -> TARGET_airoha 2022-11-09 09:39:34 +00:00
Lukasz Kotasa
1b65330af4 genconfig: rename iopsys-econet -> airoha 2022-11-09 09:39:34 +00:00
vdutta
cf709c995f sulu: 1.3.6 2022-11-09 12:27:19 +05:30
Amit Kumar
6a1b7d91a1 qosmngr: handled qos reload, statistics reset
hanlded the qos reload without statistics reset.
shaping , classification or policer change and qos reload should
not cause queue reset in driver that was causing statistics of that queue
reset to 0. qos reload if trigerred with queue specific config change,in
that case only statistics will reset tot 0.
2022-11-09 02:47:46 +00:00
vdutta
a1bbf877a1 uspd: 2.2.16 2022-11-08 17:08:08 +05:30
vdutta
ac24516ec0 sulu: 1.3.5 2022-11-08 15:45:21 +05:30
vdutta
aab79b15f1 sulu: 1.3.4 2022-11-08 15:21:11 +05:30
vdutta
39fd5323b0 bulkdata: 2.0.8 2022-11-07 18:17:49 +05:30
vdutta
ba6f732628 icwmp: 9.0.17 2022-11-07 18:01:03 +05:30
vdutta
ada4e7cfd5 sulu: 1.3.3 2022-11-04 20:51:46 +05:30
Sukru Senli
c9d73a6bcb sulu: 1.3.2 2022-11-04 16:13:28 +01:00
vdutta
e91fc5169c sulu: 1.3.1 2022-11-04 12:51:25 +00:00
vdutta
452b1e548a bbf: 6.7.5 2022-11-04 18:10:43 +05:30
Amin Ben Romdhane
630c3ec7ba bbf: 6.7.4 2022-11-04 12:16:27 +01:00
vdutta
c808bb188d icwmp: 9.0.16 2022-11-04 16:32:42 +05:30
vdutta
dce4728377 uspd: 2.2.15 2022-11-04 16:31:40 +05:30
Amin Ben Romdhane
38d77bcf5c bbf: 6.7.3 2022-11-03 17:03:41 +01:00
vdutta
e99cdc434f bbf: 6.7.2 2022-11-03 12:04:56 +05:30
Maxim Menshikov
225bf15ae7 qosmngr: implement Econet support in configuration scripts
- restructure qosmngr separating broadcom and airoha
2022-11-03 06:21:48 +00:00
Yalu Zhang
dd69c0b4b1 Update voicemngr and libvoice 2022-11-02 15:16:30 +01:00
subramanian c
cc7d076dc8 qos: Apply qos classify config in the order of order param value 2022-11-01 09:41:03 +00:00
Yalu Zhang
1d1c621821 Add a new package voicemngr
Voicemngr is an upgrading of endptmngr and supports multiple platforms.
2022-10-31 16:26:01 +01:00
vdutta
d70db5ef94 icwmp: 9.0.15 2022-10-31 15:22:19 +05:30
vdutta
656ead95cb icwmp: 9.0.14 2022-10-31 08:58:54 +05:30
Vivek Kumar Dutta
d13ee35789 Revert "icwmp: 2.0.7"
This reverts commit db3147076e
2022-10-31 03:27:01 +00:00
vdutta
0534b9c616 bulkdata: 2.0.7 2022-10-31 08:54:24 +05:30
vdutta
db3147076e icwmp: 2.0.7 2022-10-31 08:53:27 +05:30
vdutta
3c67fbf70b icwmp: 9.0.13 2022-10-30 13:00:03 +05:30
Anjan Chanda
49d6c61a8a ieee1905: 5.0.19: fixup EASYMESH_VERSION default value 2022-10-28 16:02:42 +02:00
Sukru Senli
549746bffd sulu: 1.3.0 2022-10-28 13:02:47 +02:00
Anjan Chanda
bc73d859a2 ieee1905: 5.0.19: move plugin makefiles to plugins directory 2022-10-27 13:31:16 +02:00
Anjan Chanda
998ea1fa85 ieee1905: 5.0.19 2022-10-27 12:17:36 +02:00
Grzegorz Bielski
020606132e evoice: 0.2.38 accept msgs only from proxy 2022-10-27 11:03:34 +02:00
Piotr Kubik
d693cb2fbb iop: ssh_install_key: Disable host key checking
This change simplifies ssh key install
when connecting to different hosts with same IP address.
2022-10-27 06:46:50 +00:00
Piotr Kubik
9cf572e22e iop: ssh_upgrade: Disable host key checking
This change simplifies ssh updates when connecting to
different hosts with same IP address.
2022-10-27 06:46:50 +00:00
Piotr Kubik
1759f36740 iop: ssh_upgrade: Fix usage option typo 2022-10-27 06:46:50 +00:00
Janusz Dziedzic
c3666a7b40 wifimngr: 14.3.1
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2022-10-26 10:04:14 +00:00
hemlata
c691dd210a evoice : Support transmit and receive gain on Airoha 2022-10-26 09:39:41 +02:00
Jakob Olsson
d3c5f0d78a map-agent: 2.10.3.25 2022-10-25 16:34:29 +02:00
Sukru Senli
62dc66831a iop: config: deselect peripheral-manager
will be selectd by target device which needs it
2022-10-25 14:51:52 +02:00
Jakob Olsson
1ba9025809 map-agent: 2.10.3.24 2022-10-25 11:01:38 +02:00
Anjan Chanda
da2a5a6a9d map-topology: 2.5.1.8 2022-10-25 09:47:23 +02:00
Anjan Chanda
da9bd48dd5 wfadatad: 2.10.0.4 2022-10-25 09:21:10 +02:00
Anjan Chanda
56a49d4628 ieee1905: 5.0.17 2022-10-25 09:10:54 +02:00
Roman Azarenko
152a15d147 swmodd: fix typos in error message for low disk space, bundle existence 2022-10-23 21:36:28 +02:00
Andreas Gnau
47f938f0fd iop: config: iptables-legacy => iptables-zz-legacy
Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
2022-10-22 10:02:02 +00:00
Jakob Olsson
56f653c84b map-agent: 2.10.3.23 2022-10-21 14:11:39 +02:00
Jakob Olsson
5527f66c11 map-controler: allow band 6 in radio section 2022-10-21 09:47:35 +02:00
Jakob Olsson
aadc11e7f4 map-agent: allow band 6 in radio setion 2022-10-21 09:47:23 +02:00
vdutta
15e7f35459 obuspa: 6.0.0.7 2022-10-21 10:19:22 +05:30
vdutta
8569ef77fc icwmp: 9.0.12 2022-10-21 09:30:56 +05:30
Jakob Olsson
e3c1e47040 map-agent: 2.10.3.22 2022-10-20 15:57:16 +02:00
Rahul
c722f70f10 ponmngr: update serial number generation 2022-10-20 12:26:05 +00:00
Anjan Chanda
e6a6703b73 ieee1905: 5.0.16 2022-10-20 14:24:58 +02:00
vdutta
dddd927d30 obuspa: Fix internal role for set command 2022-10-20 12:08:41 +05:30
Amin Ben Ramdhane
f9a31cd9dc bbf: 6.7.1 2022-10-19 19:58:24 +01:00
Jakob Olsson
abeedffa94 map-agent: 2.10.3.21 2022-10-19 16:12:46 +02:00
Suvendhu Hansa
bda286a27d icwmpd: 9.0.11 2022-10-19 12:40:09 +00:00
vdutta
3039f3725e stunc: 1.1.14 2022-10-19 14:11:33 +05:30
Jakob Olsson
21d63db2f8 wfadatad: 2.10.0.1 2022-10-18 17:48:55 +02:00
Jakob Olsson
6ec7d8c06b map-controller: 2.11.0.11 2022-10-18 17:48:20 +02:00
Jakob Olsson
09949f6823 map-agent: 2.10.3.20 2022-10-18 17:47:35 +02:00
Anjan Chanda
e870ac2161 ieee1905: 5.0.14 2022-10-18 17:02:59 +02:00
hemlata
2415a92f08 evoice : Support Echo Cancellation which can be configured via TR-104 2022-10-18 16:07:15 +02:00
Jakob Olsson
f3be07599e map-controller: 2.11.0.10 2022-10-18 15:48:04 +02:00
vdutta
2593f9d472 obuspa: 6.0.0.5 2022-10-18 17:33:29 +05:30
Anjan Chanda
7d8396f21c wifimngr: 14.3.0 2022-10-18 13:01:28 +02:00
Dineshkumar
84c8f673c5 iop: genconfig: add qualcomm ipq95xx target
Signed-off-by: Dineshkumar <quic_dinel@quicinc.com>
2022-10-18 10:00:53 +00:00
Grzegorz Sluja
e3ed5f9581 dectmngr: Play dial tone if called number is not included in call establish message 2022-10-18 11:34:08 +02:00
vdutta
e904e57bc8 obuspa: 6.0.0.4 2022-10-18 11:19:30 +05:30
Amin Ben Ramdhane
3fcb150330 bbf: 6.7.0 2022-10-17 18:36:24 +01:00
Anjan Chanda
928cde7e3c ieee1905: 5.0.13 2022-10-17 15:23:37 +02:00
Grzegorz Bielski
f2aa11ba83 evoice: 0.2.35 support of sip sess. timer per account 2022-10-17 13:50:08 +02:00
Jakob Olsson
dd18b4ff9a map-controller: 2.11.0.9 2022-10-17 11:38:13 +02:00
Janusz Dziedzic
875ed0fc12 easy-soc-libs: 6.7.5
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2022-10-17 08:05:11 +00:00
Jakob Olsson
affdd43f7a map-agent: 2.10.3.19 2022-10-14 17:28:57 +02:00
vdutta
9de9248d5a owsd: 1.1.5 2022-10-13 14:59:44 +05:30
vdutta
31a89052f8 bbf: 6.9.9 2022-10-13 14:25:32 +05:30
suvendhu
0248cd1e38 icwmpd: fix uloop deadlock for ProcessStatus 2022-10-13 12:36:31 +05:30
Jakob Olsson
6f21f9bb4b map-controller: 2.11.0.8 2022-10-12 17:24:53 +02:00
Amin Ben Ramdhane
0f87f89b71 bbf: 6.9.8 2022-10-12 12:20:46 +01:00
Amin Ben Ramdhane
ab65dba802 bbf: 6.9.7 2022-10-12 12:15:05 +01:00
Jakob Olsson
6c40e135e9 map-agent: add ip-bridge dependency 2022-10-12 09:58:25 +02:00
Jakob Olsson
893deb57d0 map-agent: initd: remove legacy vlan setup 2022-10-12 09:30:42 +02:00
Anjan Chanda
c3b450a679 ieee1905: 4.11.0 2022-10-11 22:52:17 +02:00
Jakob Olsson
62573f47dc map-controller: 2.11.0.7 2022-10-11 15:52:31 +02:00
hemlata
71bf9943b7 evoice : CallStatus fix for R4/R5 call transfer and 486 busy when on-hold 2022-10-11 14:42:52 +02:00
Suvendhu Hansa
d0fe5d68e3 icwmpd: 9.0.9 2022-10-11 12:04:52 +00:00
Amin Ben Ramdhane
612ea61b0e bbf: 6.9.6 2022-10-10 21:18:14 +01:00
Sukru Senli
53b6001a51 ponmngr: airoha: don't start pon daemons if xpon module is not loaded 2022-10-10 16:53:17 +02:00
Amit Kumar
ad8cee56df libqos: nvg678 qos stats handling
nvg678 is having 64bit broadcom chip.
added compilation flag KERNEL64 for nvg678.
2022-10-10 10:20:50 +05:30
Janusz Dziedzic
ae8c079e8c wifimngr: 14.2.4
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2022-10-07 12:58:45 +00:00
Janusz Dziedzic
68d1b91701 easy-soc-libs: 6.7.4
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2022-10-07 12:57:39 +00:00
suvendhu
3389378868 icwmp: added support of AutonomousDUStateChangeComplPolicy 2022-10-07 10:36:38 +00:00
Amin Ben Ramdhane
6a6c123a63 bbf: 6.9.5 2022-10-07 10:37:17 +01:00
hemlata
64c0fa39a0 evoice : Codec name fix for Brcm platform for CodecProfile display 2022-10-07 11:29:39 +02:00
Hemlata
c19fd6cd11 evoice: Correct codec names in the JSON file 2022-10-07 09:21:39 +00:00
Jakob Olsson
6dd17390d7 map-agent: 2.10.3.18 2022-10-06 15:43:08 +02:00
hemlata
59e724dcf2 evoice: libvoiceservice: fix a bug in codec capability initialisation that causes uspd crash on Broadcom platform 2022-10-06 15:29:09 +02:00
vdutta
cc71eb3ef5 obuspa: 6.0.0.3 2022-10-06 15:57:28 +05:30
vdutta
d4ac43a3bf icwmp: 9.0.7 2022-10-06 09:20:53 +05:30
Grzegorz Sluja
56fa7db0a7 dectmngr: Change DECT handset presence check to RSSI request 2022-10-05 15:10:13 +02:00
vdutta
1b58259562 bbf: 6.9.4 2022-10-04 17:01:54 +05:30
vdutta
23d564116c obuspa: 6.0.0.2 2022-10-04 17:00:07 +05:30
vdutta
a5aeba560e icwmp: 9.0.6 2022-10-04 16:43:23 +05:30
Amit Kumar
58688bd436 easy-soc-libs: libqos handling for qos stats 2022-10-03 19:27:37 +05:30
vdutta
3682edfe7b sulu: 1.2.3 2022-09-30 18:57:47 +05:30
Jakob Olsson
feb1932e25 map-topology: 2.5.1.5 2022-09-30 12:31:28 +02:00
Jakob Olsson
696dc1f798 map-controller: 2.11.0.6 2022-09-30 12:30:45 +02:00
Jakob Olsson
4ad3a464fe map-agent: 2.10.3.17 2022-09-30 12:30:03 +02:00
Jakob Olsson
b75f473a5a map-controller: pass CFLAGS EASYMESH_VENDOR_EXT 2022-09-30 12:28:48 +02:00
Jakob Olsson
26023599c1 map-agent: pass CFLAGS EASYMESH_VENDOR_EXT 2022-09-30 12:28:32 +02:00
Anjan Chanda
5f276201b3 ieee1905: 4.10.8 2022-09-30 11:39:14 +02:00
hemlata
f9072e9a21 evoice : Support hardware specific codec capability 2022-09-30 11:34:16 +02:00
Hemlata
3638e0efa2 evoice: provide codecs_evoice.json for codecs capability ubus call 2022-09-30 09:29:44 +00:00
vdutta
fa613814d5 icwmp: 9.0.5 2022-09-30 11:21:21 +05:30
vdutta
9b673e44dc umoci: Switch to tar source 2022-09-30 11:19:40 +05:30
vdutta
44f0bc818e skopeo: Switch to tar source 2022-09-30 11:18:45 +05:30
Wenpeng Song
5d64b987aa evoice 0.2.30
Makefile update for ABI version dependency of libbbf_api
2022-09-29 14:21:45 +00:00
Janusz Dziedzic
da4f911bd9 easy-soc-libs: 6.7.3
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2022-09-29 12:03:56 +00:00
Janusz Dziedzic
8c0ae77797 easy-soc-libs: 6.7.2
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2022-09-29 11:19:10 +00:00
Filip Matusiak
613656d485 map-controller: load rcpi plugin by default
Signed-off-by: Filip Matusiak <filip.matusiak@iopsys.eu>
2022-09-28 14:09:18 +00:00
Amin Ben Ramdhane
570f421c3d bbf: 6.9.3 2022-09-28 13:03:21 +01:00
Janusz Dziedzic
1c538249ea easy-soc-libs: 6.7.1
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2022-09-28 11:06:46 +00:00
Jakob Olsson
2b94cae86b map-controller: 2.11.0.5 2022-09-28 12:38:19 +02:00
vdutta
c2d92def50 icwmp: 9.0.4 2022-09-28 14:36:12 +05:30
Amin Ben Ramdhane
32628e4165 bbf: 6.9.2 2022-09-28 09:01:19 +01:00
Amin Ben Ramdhane
2501484ac2 bulkdata: 2.0.6 2022-09-28 08:59:09 +01:00
Janusz Dziedzic
87b565d552 easy-soc-libs: 6.7.0
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2022-09-27 14:56:13 +00:00
Amin Ben Ramdhane
56af686410 bbf: 6.9.1 2022-09-26 14:12:35 +01:00
vdutta
90fd7508b6 periodicstats: 1.2.1 2022-09-26 17:00:09 +05:30
vdutta
5f8cbe5393 stunc: 1.1.13 2022-09-26 16:46:19 +05:30
vdutta
94433b4502 swmodd: 2.1.17 2022-09-26 16:44:58 +05:30
vdutta
e311e64900 udpecho: 2.0.2 2022-09-26 16:43:26 +05:30
vdutta
973b11e33b xmppc: 2.0.3 2022-09-26 16:25:35 +05:30
vdutta
fd3f544210 twamp: 1.2.3 2022-09-26 16:23:24 +05:30
vdutta
078bcd16c1 bbf: 6.9.0 2022-09-26 15:58:49 +05:30
vdutta
4c5073ad03 sulu: 1.2.2 2022-09-24 20:31:33 +05:30
vdutta
2660d8ad2e twamp: 1.2.2 2022-09-23 18:23:51 +05:30
vdutta
588478e981 sulu: 1.2.1 2022-09-23 15:59:10 +05:30
Amin Ben Ramdhane
0f9326cff6 bbf: 6.8.34 2022-09-23 10:49:53 +01:00
Jakob Olsson
e01fc47ab6 map-agent: 2.10.3.16 2022-09-23 10:56:05 +02:00
vdutta
a35893a722 sulu: 1.2.0 2022-09-22 20:54:49 +05:30
132 changed files with 5535 additions and 552 deletions

View File

@@ -5,11 +5,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libbbfdm
PKG_VERSION:=6.8.33
PKG_VERSION:=6.8.9
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
PKG_SOURCE_VERSION:=9bdcb1ac188c44fc2274bf01dd9dce46f572b967
PKG_SOURCE_VERSION:=4ad900a9bb6b4a0dd38edc1d14e1b6cbfeaa8e9b
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
@@ -25,7 +25,8 @@ define Package/libbbf_api
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Library for libbbfdm API
TITLE:=BBF datamodel library, provides API to extend datamodel using DotSO plugins
ABI_VERSION:=1.0
endef
define Package/libbbfdm/default
@@ -33,7 +34,7 @@ define Package/libbbfdm/default
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Library for broadband forum data model support
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libcurl
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libcurl +libbbf_api
endef
define Package/libbbfdm
@@ -66,6 +67,17 @@ define Package/libbbfdm-wolfssl
VARIANT:=wolfssl
endef
define Package/userinterface
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Package to add Device.UserInterface. datamodel support
endef
define Package/userinterface/description
Package to add Device.UserInterface. datamodel support using libbbf JSON Plugin
endef
define Package/libbbfdm/config
source "$(SOURCE)/Config_bbfdm.in"
endef
@@ -137,13 +149,15 @@ endef
define Package/libbbfdm/default/install
$(INSTALL_DIR) $(1)/lib
$(INSTALL_DIR) $(1)/usr/share/bbfdm
$(INSTALL_DIR) $(1)/etc/bbfdm
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
$(INSTALL_DIR) $(1)/etc/bbfdm/json
$(INSTALL_DIR) $(1)/usr/share/bbfdm
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
$(CP) $(PKG_BUILD_DIR)/libbbfdm.so $(1)/lib/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/* $(1)/usr/share/bbfdm
$(LN) /usr/share/bbfdm/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
endef
define Package/libbbfdm/default/prerm
@@ -152,6 +166,18 @@ define Package/libbbfdm/default/prerm
exit 0
endef
define Package/userinterface/install
$(INSTALL_DIR) $(1)/etc/bbfdm/json
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DATA) ./files/etc/bbfdm/json/UserInterface.json $(1)/etc/bbfdm/json/
$(INSTALL_DATA) ./files/etc/config/userinterface $(1)/etc/config/userinterface
$(INSTALL_BIN) ./files/etc/init.d/userinterface $(1)/etc/init.d/userinterface
$(INSTALL_BIN) ./files/etc/uci-defaults/93-userinterface-firewall $(1)/etc/uci-defaults/93-userinterface-firewall
$(INSTALL_BIN) ./files/etc/firewall.userinterface $(1)/etc/firewall.userinterface
endef
Package/libbbfdm-openssl/prerm = $(Package/libbbfdm/default/prerm)
Package/libbbfdm-wolfssl/prerm = $(Package/libbbfdm/default/prerm)
Package/libbbfdm-mbedtls/prerm = $(Package/libbbfdm/default/prerm)
@@ -169,9 +195,9 @@ define Build/InstallDev
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbf_api/*.h $(1)/usr/include/libbbf_api/
$(CP) $(PKG_BUILD_DIR)/libbbfdm.so $(1)/usr/lib/
touch $(1)/usr/lib/libbbf_api.so
endef
$(eval $(call BuildPackage,userinterface))
$(eval $(call BuildPackage,libbbf_api))
$(eval $(call BuildPackage,libbbfdm))
$(eval $(call BuildPackage,libbbfdm-openssl))

View File

@@ -0,0 +1,112 @@
{
"Device.UserInterface.": {
"type": "object",
"version": "2.0",
"protocols": [
"cwmp",
"usp"
],
"access": false,
"array": false,
"Device.UserInterface.RemoteAccess.": {
"type": "object",
"version": "2.0",
"protocols": [
"cwmp",
"usp"
],
"access": false,
"array": false,
"Enable": {
"type": "boolean",
"read": true,
"write": true,
"version": "2.0",
"protocols": [
"cwmp",
"usp"
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "userinterface",
"section": {
"name": "remote_access"
},
"option": {
"name": "enable"
}
}
}
]
},
"Port": {
"type": "string",
"read": true,
"write": true,
"version": "2.0",
"protocols": [
"cwmp",
"usp"
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "userinterface",
"section": {
"name": "remote_access"
},
"option": {
"name": "port"
}
}
}
]
},
"SupportedProtocols": {
"type": "string",
"read": true,
"write": false,
"version": "2.0",
"protocols": [
"cwmp",
"usp"
],
"list": {
"datatype": "string",
"enumerations": [
"HTTP",
"HTTPS"
]
},
"default": "HTTP"
},
"Protocol": {
"type": "string",
"read": true,
"write": true,
"version": "2.0",
"protocols": [
"cwmp",
"usp"
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "userinterface",
"section": {
"name": "remote_access"
},
"option": {
"name": "protocol"
}
}
}
]
}
}
}
}

View File

@@ -0,0 +1,6 @@
config userinterface 'remote_access'
option enable '0'
option interface 'wan'
option port '80'
option protocol 'HTTP'

View File

@@ -0,0 +1,88 @@
#!/bin/sh
#!/bin/sh
. /lib/functions.sh
IDENTIFIER="REMOTE-ACCESS-WAN"
log() {
echo "${@}"|logger -t firewall.userinterface -p info
}
if [ ! -f "/etc/config/userinterface" ]; then
exit 0;
fi
function exec_cmd()
{
if ! $@; then
log "Failed to run [$@]"
fi
}
function configure_firewall_rule()
{
local enable port protocol gui_port
local zone interface
config_load userinterface
config_get_bool enable remote_access enable 1
config_get port remote_access port
config_get interface remote_access interface
if [ "${enable}" -eq "0" -o -z "${port}" -o -z "${interface}" ]; then
return 0;
fi
zone="zone_${interface}_input"
iptables -w 1 -t filter -nL ${zone} 2>/dev/null 1>&2
if [ "$?" -eq 0 ]; then
iptables -w 1 -I ${zone} -p tcp -m multiport --dports ${port} -m conntrack --ctstate NEW,ESTABLISHED -m comment --comment "${IDENTIFIER}" -j ACCEPT
fi
zone="zone_${interface}_output"
iptables -w 1 -t filter -nL ${zone} 2>/dev/null 1>&2
if [ "$?" -eq 0 ]; then
iptables -w 1 -I ${zone} -p tcp -m multiport --dports ${port} -m conntrack --ctstate ESTABLISHED -m comment --comment "${IDENTIFIER}" -j ACCEPT
fi
}
function delete_firewall_rule()
{
local zone interface
local CMD
config_load userinterface
config_get interface remote_access interface
# Clean remote interface rules
if [ -z "${interface}" ]; then
return 0
fi
zone="zone_${interface}_input"
CMD="iptables -w 1 -t filter -L ${zone} --line-numbers"
while ${CMD} 2>/dev/null | grep "${IDENTIFIER}"; do
rule_num="$(${CMD} | grep "${IDENTIFIER}" | head -1|awk '{print $1}')"
if [ -n "${rule_num}" ]; then
exec_cmd iptables -w 1 -t filter -D ${zone} ${rule_num};
fi
done
zone="zone_${interface}_output"
CMD="iptables -w 1 -t filter -L ${zone} --line-numbers"
while ${CMD} 2>/dev/null | grep "${IDENTIFIER}"; do
rule_num="$(${CMD} | grep "${IDENTIFIER}" | head -1|awk '{print $1}')"
if [ -n "${rule_num}" ]; then
exec_cmd iptables -w 1 -t filter -D ${zone} ${rule_num};
fi
done
}
# Delete existing remote access rules
delete_firewall_rule
# Configure the User Interface rule
configure_firewall_rule

View File

@@ -0,0 +1,27 @@
#!/bin/sh /etc/rc.common
START=99
STOP=01
USE_PROCD=1
start_service() {
local enable
procd_open_instance usp
config_load userinterface
config_get_bool enable global enable 1
# Inject firewall rules
if [ "${enable}" -eq "1" ]; then
/etc/firewall.userinterface
fi
procd_close_instance
}
service_triggers()
{
procd_add_reload_trigger "userinterface"
}

View File

@@ -0,0 +1,12 @@
#!/bin/sh
uci -q batch <<-EOT
delete firewall.userinterface
set firewall.userinterface=include
set firewall.userinterface.path=/etc/firewall.userinterface
set firewall.userinterface.reload=1
commit firewall
EOT
exit 0

View File

@@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bulkdata
PKG_VERSION:=2.0.5
PKG_VERSION:=2.0.9
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bulkdata.git
PKG_SOURCE_VERSION:=33a6648de9ee0af33c44518656b56b0a30b6c1ab
PKG_SOURCE_VERSION:=6e85d2032e66df581fae7c72cd83cc89367b8fc8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -25,8 +25,6 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=bbf
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
@@ -50,8 +48,8 @@ endif
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.so $(1)/usr/lib/bbfdm
$(INSTALL_DIR) $(1)/etc/bbfdm/json
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.json $(1)/etc/bbfdm/json
$(CP) ./files/* $(1)/
endef

View File

@@ -7,22 +7,19 @@ USE_PROCD=1
PROG="/usr/sbin/bulkdatad"
start_service() {
local enable=$(uci -q get bulkdata.bulkdata.enable)
local enable
[ "$enable" != "1" ] && {
return 0
config_load bulkdata
config_get_bool enable bulkdata enable 1
procd_open_instance bulkdata
[ "$enable" -eq "1" ] && {
procd_set_param command "$PROG"
procd_set_param respawn "3" "7" "0"
}
procd_open_instance
procd_set_param command "$PROG"
procd_set_param respawn "3" "7" "0"
procd_close_instance
}
boot() {
start
}
reload_service() {
stop
start

View File

@@ -14,7 +14,7 @@ LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=c5695bc92f7f22089c9a85d3e1f4dac7c12ca900
PKG_SOURCE_VERSION:=cf4e91ffe0a1d83140fef5b41d16e581e5341cec
PKG_MIRROR_HASH:=skip
endif

View File

@@ -26,7 +26,7 @@ PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
ifeq ($(CONFIG_TARGET_brcmbca),y)
TARGET_PLATFORM=BROADCOM
else
$(info Unexpected CONFIG_TARGET)

View File

@@ -19,7 +19,7 @@ define Package/easy-qos
SECTION:=net
CATEGORY:=Network
TITLE:=Easy QoS
DEPENDS:=@(TARGET_iopsys_brcm63xx_arm||TARGET_iopsys_econet)
DEPENDS:=@(TARGET_brcmbca||TARGET_airoha)
endef
define Package/easy-qos/description

View File

@@ -19,7 +19,7 @@ include $(INCLUDE_DIR)/package.mk
-include $(TOPDIR)/.config
ifneq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),)
ifneq ($(CONFIG_TARGET_brcmbca),)
LINUX_DIR=$(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-4.1
LINUX_VERSION := 4.1.52
LINUXINCLUDE=-Iarch/$(LINUX_KARCH)/mach-bcm963xx/include
@@ -85,7 +85,7 @@ define Build/Compile
endef
ifneq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),)
ifneq ($(CONFIG_TARGET_brcmbca),)
define KernelPackage/easy-soc-events/install-extra
cp $(PKG_BUILD_DIR)/easyevent.ko $(FS_DIR)/lib/modules/$(LINUX_VERSION)/extra
endef

View File

@@ -7,13 +7,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=easy-soc-libs
PKG_VERSION:=6.6.0
PKG_VERSION:=6.8.0
PKG_RELEASE:=1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=c8c406568822b170e373a54fbf32323e960259ff
PKG_SOURCE_VERSION:=ddc7b272bec5e3b5c2a216a1f86cd5589a1a4a19
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
@@ -36,7 +36,7 @@ define Package/easy-soc-libs
MENU:=1
endef
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
ifeq ($(CONFIG_TARGET_brcmbca),y)
TARGET_PLATFORM=BROADCOM
TARGET_WIFI_TYPE=BROADCOM
CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
@@ -55,7 +55,7 @@ else ifeq ($(CONFIG_TARGET_iopsys_armvirt),y)
TARGET_PLATFORM=TEST
TARGET_WIFI_TYPE=TEST
TARGET_CFLAGS +=-DIOPSYS_TEST
else ifeq ($(CONFIG_TARGET_iopsys_econet),y)
else ifeq ($(CONFIG_TARGET_airoha),y)
TARGET_PLATFORM=ECONET
TARGET_WIFI_TYPE=MAC80211
TARGET_CFLAGS +=-DIOPSYS_ECONET

View File

@@ -2,7 +2,7 @@
define Package/libethernet
$(call Package/easy-soc-libs)
TITLE:= Ethernet library (libethernet)
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_iopsys_ramips:swconfig +TARGET_iopsys_econet:ecnt_api
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_iopsys_ramips:swconfig +TARGET_airoha:ecnt_api
endef
define Package/libethernet/config

View File

@@ -2,7 +2,7 @@
define Package/libwifi
$(call Package/easy-soc-libs)
TITLE:= WiFi library (libwifi)
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_iopsys_brcm63xx_arm:bcmkernel
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_brcmbca:bcmkernel
endef
define Package/libwifi/config

View File

@@ -13,7 +13,7 @@ LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/endptmngr.git
PKG_SOURCE_VERSION:=0901382048bb7ce01fc1767fef75e54692f56743
PKG_SOURCE_VERSION:=dc12712af8c4088f7873502ca845e51c68a1ada9
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=evoice
PKG_VERSION:=0.2.29
PKG_VERSION:=0.2.39
LOCAL_DEV=0
LOCAL_DEV_EVOICE_DIR=~/voip/evoice
@@ -13,7 +13,7 @@ LOCAL_DEV_EVOICE_DIR=~/voip/evoice
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/evoice.git
PKG_SOURCE_VERSION:=ee4e9e00ec1c54b41e15a3de38f6a733634622dd
PKG_SOURCE_VERSION:=30d65330de0368f73ecf4a2e804c39a2ee280454
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -21,8 +21,6 @@ endif
PKG_LICENSE:=PROPRIETARY IOPSYS
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=bbf
# All config variable that are passed to the make invocation, directly or
# indirectly. This ensures that the package is rebuilt on config-changes.
#PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD
@@ -34,10 +32,10 @@ define Package/$(PKG_NAME)
SUBMENU:=Telephony
TITLE:=Ensemble Voice
URL:=
DEPENDS:= +libubox +libubus +libpicoevent +libuci +libstdcpp +libopenssl\
+TARGET_iopsys_brcm63xx_arm:bcmkernel\
+TARGET_iopsys_econet:kmod-voip_driver\
+TARGET_iopsys_econet:voip_app
DEPENDS:= +libubox +libubus +libpicoevent +libuci +libstdcpp +libopenssl +libjson-c +libblobmsg-json\
+TARGET_brcmbca:bcmkernel\
+TARGET_airoha:kmod-voip_driver\
+TARGET_airoha:voip_app +libbbf_api
endef
define Package/$(PKG_NAME)/description
@@ -58,17 +56,19 @@ endif
IDIR = $(STAGING_DIR)/usr/include
TONES_INI_REQUIRED=
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
ifeq ($(CONFIG_TARGET_brcmbca),y)
TARGET_PLATFORM=BROADCOM
BDIR = bcm963xx/userspace/private/apps/voice
CC_FLAGS = -I$(IDIR) -I$(IDIR)/$(BDIR)/inc\
-I$(IDIR)/bcm963xx/xchg/bos/publicInc\
-I$(IDIR)/bcm963xx/bcmdrivers/broadcom/include/bcm963xx
TRG=SVrgBcmFxs
else ifeq ($(CONFIG_TARGET_iopsys_econet),y)
JSONFILE=codecs_brcm.json
else ifeq ($(CONFIG_TARGET_airoha),y)
TARGET_PLATFORM=ECONET
TONES_INI_REQUIRED=y
TRG=SVrgMtekOwrt
JSONFILE=codecs_airoha.json
endif
# disable temporarily some not important warnings, force PIC
@@ -95,6 +95,9 @@ define Package/evoice/install
$(CP) ./files/* $(1)/
$(if $(TONES_INI_REQUIRED),,$(RM) $(1)/etc/evoice/tones.ini)
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(1)/lib/voice/$(JSONFILE) $(1)/lib/voice/codecs_evoice.json
$(RM) $(1)/lib/voice/codecs_brcm.json
$(RM) $(1)/lib/voice/codecs_airoha.json
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
$(INSTALL_BIN) $(PKG_BUILD_DIR)/_bin/a_openwrt/evoice $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/_bin/a_openwrt/libvoiceservice.so $(1)/usr/lib/bbfdm/

View File

@@ -22,6 +22,7 @@ config SIPClient 'Client2'
config SIPNetwork 'Network1'
option Enable '1'
option ProxyServer 'sip-proxy.iopsys.eu'
option AcceptFromProxyOnly '0'
option ProxyServerPort '5060'
option ProxyServerTransport 'UDP'
option RegistrarServer 'sip-proxy.iopsys.eu'
@@ -33,6 +34,12 @@ config SIPNetwork 'Network1'
option TimerRegistrationFailed '120'
option TimerT1 '500'
option VoIPProfile 'VoIPProfile1'
option SIPSessionTimerEnable '0'
option SIPSessionExpireInterval '1800'
option SIPSessionMinimumTimer '90'
option SIPSessionRefresher 'NONE'
option SIPSessionTimerMode 'REQUEST'
option SIPSessionRefreshRequest 'UPDATE'
list CodecList '1CodecProfile1'
list CodecList '1CodecProfile2'
list CodecList '1CodecProfile3'

View File

@@ -48,16 +48,23 @@ config account 'map_account'
# Network stuff associated with an account.
# All parameters in this table are written to internal configuration
config network 'map_net'
option Enable 'voice.Network@.Enable'
option Registration_Server 'voice.Network@.RegistrarServer'
option Outbound_Proxy 'voice.Network@.ProxyServer'
option SIP_Port 'voice.Network@.RegistrarServerPort'
option SIP_Transport 'voice.Network@.RegistrarServerTransport'
option RegistrationPeriod 'voice.Network@.RegistrationPeriod'
option Enable 'voice.Network@.Enable'
option Registration_Server 'voice.Network@.RegistrarServer'
option Outbound_Proxy 'voice.Network@.ProxyServer'
option Accept_From_Registered 'voice.Network@.AcceptFromProxyOnly'
option SIP_Port 'voice.Network@.RegistrarServerPort'
option SIP_Transport 'voice.Network@.RegistrarServerTransport'
option RegistrationPeriod 'voice.Network@.RegistrationPeriod'
option Registration_Interval 'voice.Network@.RegisterExpires'
option Reg_Failure_Interval 'voice.Network@.TimerRegistrationFailed'
option T1 'voice.Network@.TimerT1'
option UserAgentDomain 'voice.Network@.UserAgentDomain'
option Reg_Failure_Interval 'voice.Network@.TimerRegistrationFailed'
option T1 'voice.Network@.TimerT1'
option UserAgentDomain 'voice.Network@.UserAgentDomain'
option SIP_SessTmrEnable 'voice.Network@.SIPSessionTimerEnable'
option SIP_SessTmrMode 'voice.Network@.SIPSessionTimerMode'
option SIP_SessTmrMsg 'voice.Network@.SIPSessionRefreshRequest'
option SIP_SessTmrRefresher 'voice.Network@.SIPSessionRefresher'
option SIP_MinSE 'voice.Network@.SIPSessionMinimumTimer'
option SIP_SessInterval 'voice.Network@.SIPSessionExpireInterval'
config VoIPProfile 'map_voip'
option Enable 'voice.VoIPProfile@.Enable'

View File

@@ -22,7 +22,6 @@ config static_prm 'defaults'
option Tone_On_Hangup '1'
option BusyTone_On_Hangup '1'
option Enable_Analouge_Conf '0'
option SIP_SessTmrEnable '0'
option PrackUsage '1'
option SIP_SupportedPath '0'
option IMS_Access_Network_Info ' '

View File

@@ -0,0 +1,50 @@
{
"G.711ALaw": [
{
"BitRate": 64000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
],
"G.711MuLaw": [
{
"BitRate": 64000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
],
"G.722": [
{
"BitRate": 64000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
],
"G.726": [
{
"BitRate": 32000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
},
{
"BitRate": 24000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
],
"G.729": [
{
"BitRate": 8000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
],
"AMR": [
{
"BitRate": 7400,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
]
}

View File

@@ -0,0 +1,140 @@
{
"G.711MuLaw": [
{
"BitRate": 64000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"G.711ALaw": [
{
"BitRate": 64000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"G.726": [
{
"BitRate": 16000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 24000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 32000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 40000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"G.723.1": [
{
"BitRate": 5300,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 6300,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"G.729": [
{
"BitRate": 8000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"iLBC": [
{
"BitRate": 15200,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 13300,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"G.722": [
{
"BitRate": 64000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"AMR": [
{
"BitRate": 12200,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 10200,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 7950,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 7400,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 6700,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 5900,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 5150,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 4750,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"GSM-EFR": [
{
"BitRate": 12200,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"GSM-FR": [
{
"BitRate": 13200,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"GSM-HR": [
{
"BitRate": 5600,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
]
}

View File

@@ -28,7 +28,7 @@ define KernelPackage/$(PKG_NAME)
FILES:=$(PKG_BUILD_DIR)/$(PKG_NAME).$(LINUX_KMOD_SUFFIX)
KCONFIG:=CONFIG_PACKAGE_kmod-gryphon-led-kernel-module=y
AUTOLOAD:=$(call AutoLoad,60,$(PKG_NAME))
DEPENDS:= +(TARGET_iopsys_brcm63xx_arm):bcmkernel
DEPENDS:= +(TARGET_brcmbca):bcmkernel
PKG_LICENSE:=GPLv2
PKG_LICENSE_URL:=
endef
@@ -42,7 +42,7 @@ EXTRA_KCONFIG:= CONFIG_RGB_LED=m
MODULE_INCLUDE=-I$(PKG_BUILD_DIR)
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
ifeq ($(CONFIG_TARGET_brcmbca),y)
LINUX_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-4.19
# This assumes that the MODULES_SUBDIR set by OpenWrt is of the form
# lib/modules/4.19.235-abcdef where 4.19.235 is the version of our fake bcmlinux kernel

View File

@@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=9.0.3
PKG_VERSION:=9.1.2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
PKG_SOURCE_VERSION:=304db5eb064d89cf4e4df0bb81fa22b88933d602
PKG_SOURCE_VERSION:=b964edb3570797286584793dbadfbef323cddbeb
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
@@ -29,7 +29,7 @@ define Package/icwmp/default
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=TR069 CWMP client
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml +libuuid
endef
define Package/icwmp-openssl
@@ -83,6 +83,7 @@ define Package/icwmp/default/install
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_DIR) $(1)/etc/bbfdm/json/
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/icwmpd $(1)/usr/sbin/icwmpd
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
$(INSTALL_BIN) ./files/etc/firewall.cwmp $(1)/etc/firewall.cwmp
@@ -92,6 +93,7 @@ define Package/icwmp/default/install
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
$(INSTALL_BIN) ./files/etc/icwmpd/update.sh $(1)/etc/icwmpd/update.sh
$(INSTALL_DATA) ./files/etc/bbfdm/json/CWMPManagementServer.json $(1)/etc/bbfdm/json/
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_icwmp.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp.user
endef
Package/icwmp-openssl/install = $(Package/icwmp/default/install)

View File

@@ -14,15 +14,18 @@ handle_icwmp_update() {
return 0
fi
status="$(ubus call tr069 status |jsonfilter -qe '@.last_session.status')"
if [ "$status" != "running" ]; then
log "Trigger out of bound inform, since last inform status was failure"
ubus -t 10 call tr069 inform >/dev/null 2>&1
# Handle timeout or tr069 object not found
if [ "$?" -eq 7 ] || [ "$?" -eq 4 ]; then
log "Restarting icwmp tr069 object"
/etc/init.d/icwmpd restart
ret=$(ubus call service list '{"name":"icwmpd"}' | jsonfilter -qe '@.icwmpd.instances.icwmp.running')
if [ "$ret" == "true" ]; then
# read status from var/state/cwmp
status=$(uci -q -c /var/state get cwmp.sess_status.current_status)
if [ "$status" != "running" ]; then
log "Trigger out of bound inform, since last inform status was failure"
ubus -t 10 call tr069 inform >/dev/null 2>&1
fi
else
log "Restarting icwmp tr069 object"
/etc/init.d/icwmpd restart
fi
}

View File

@@ -77,7 +77,7 @@ convert_to_hex() {
OPTIND=1
while getopts ":" opt "-$optval"
do
temp=$(printf "%X" "'${OPTARG:-:}")
temp=$(printf "%02X" "'${OPTARG:-:}")
val="${val}:${temp}"
done
@@ -133,14 +133,14 @@ configure_send_op125() {
opt125_len=$((opt125_len + 4))
fi
hex_opt125_len=$(printf "%X" "${opt125_len}")
hex_opt125_len=$(printf "%02X" "${opt125_len}")
opt125="${opt125}:${hex_opt125_len}"
hex_oui=$(convert_to_hex "${oui}")
if [ -z "${hex_oui}" ]; then
return 0
fi
hex_oui_len=$(printf "%X" "${oui_len}")
hex_oui_len=$(printf "%02X" "${oui_len}")
if [ "${uci}" = "network" ]; then
opt125="${opt125}:01:${hex_oui_len}${hex_oui}"
else
@@ -152,7 +152,7 @@ configure_send_op125() {
return 0
fi
hex_serial_len=$(printf "%X" "${serial_len}")
hex_serial_len=$(printf "%02X" "${serial_len}")
if [ "${uci}" = "network" ]; then
opt125="${opt125}:02:${hex_serial_len}${hex_serial}"
else
@@ -165,7 +165,7 @@ configure_send_op125() {
return 0
fi
hex_class_len=$(printf "%X" "${class_len}")
hex_class_len=$(printf "%02X" "${class_len}")
if [ "${uci}" = "network" ]; then
opt125="${opt125}:03:${hex_class_len}${hex_class}"
else
@@ -313,6 +313,8 @@ copy_cwmp_varstate_files_to_etc() {
fi
if [ -f /var/state/cwmp ]; then
uci -q -c /var/state delete cwmp.sess_status
uci -q -c /var/state commit cwmp
cp -f /var/state/cwmp /etc/icwmpd/
fi
@@ -460,6 +462,11 @@ service_stopped()
copy_cwmp_varstate_files_to_etc
}
stop_service()
{
copy_cwmp_varstate_files_to_etc
}
reload_service() {
local ret
@@ -473,7 +480,14 @@ reload_service() {
return 0
fi
status="$(ubus -t 1 call tr069 status |jsonfilter -qe '@.cwmp.status')"
tr069_status="$(ubus -t 1 call tr069 status)"
ret="$?"
if [ "$ret" = "7" ]; then
# ubus timed out may be due to uloop is busy in some task so returning
return 0
fi
status="$(echo $tr069_status | jsonfilter -qe '@.cwmp.status')"
ret="$?"
if [ "$status" = "up" ]; then
ubus -t 1 call tr069 command '{"command":"reload"}'

View File

@@ -0,0 +1,122 @@
#!/bin/sh
CLASS=""
OUI=""
SERIAL=""
get_vivsoi() {
# opt125 environment variable has data in below format
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# | enterprise-number1 |
# | |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# | data-len1 | |
# +-+-+-+-+-+-+-+-+ option-data1 |
# / /
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -----
# | enterprise-number2 | ^
# | | |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
# | data-len2 | | optional
# +-+-+-+-+-+-+-+-+ option-data2 | |
# / / |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
# ~ ... ~ V
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -----
# Enterprise Id Len Sub Op SLen Data Sub Op SLen Data Sub Op SLen Data
# +-------------+-----+------+------+----+------+-----+----+-----+------+-----+----+
# | id | n | 1 | n1 | D1 | 2 | n2 | D2 | ... | 6 | n6 | D6 |
# +-------------+-----+------+------+----+------+-----+----+-----+------+-----+----+
local opt125="$1"
local len="$2"
local ent_id
#hex-string 2 character=1 Byte
# length in hex string will be twice of actual Byte length
[ "$len" -gt "8" ] || return
data="${opt125}"
rem_len="${len}"
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
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 ))
continue
fi
# read the length of enterprise data
len_val=${data:8:2}
opt_len=$(printf "%d\n" "0x$len_val")
[ $opt_len -eq 0 ] && return
# populate the option data of enterprise id
sub_data_len=$(( opt_len * 2))
# starting 10 means ahead of length field
sub_data=${data:10:"${sub_data_len}"}
# parsing of suboption of option 125
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")
# get the length of suboption
sub_opt_len=${sub_data:2:2}
sub_opt_len=$(printf "%d\n" "0x$sub_opt_len")
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}}
# 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 '')
;;
"5") SERIAL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
;;
"6") CLASS=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
;;
esac
# add 2 bytes for sub_opt id and sub_opt len field
sub_opt_end=$(( sub_opt_len + 4 ))
# fetch next sub option hex string
sub_data=${sub_data:${sub_opt_end}:${sub_data_len}}
# update the remaining sub option hex string length
sub_data_len=$((sub_data_len - sub_opt_end))
done
break
done
}
wan_intf=$(uci -q get cwmp.cpe.default_wan_interface)
if [ -n "${wan_intf}" ] && [ "${wan_intf}" == "${INTERFACE}" ]; then
if [ -n "$opt125" ]; then
len=$(printf "$opt125"|wc -c)
get_vivsoi "$opt125" "$len"
fi
sec=$(uci -q -c /var/state get cwmp.gatewayinfo)
if [ -z "${sec}" ]; then
sec=$(uci -q -c /var/state add cwmp gatewayinfo)
uci -q -c /var/state rename cwmp."${sec}"="gatewayinfo"
fi
uci -q -c /var/state set cwmp.gatewayinfo.class="$CLASS"
uci -q -c /var/state set cwmp.gatewayinfo.oui="$OUI"
uci -q -c /var/state set cwmp.gatewayinfo.serial="$SERIAL"
uci -q -c /var/state commit cwmp
fi

View File

@@ -1,6 +1,6 @@
if (PACKAGE_ieee1905)
menu "Configurations"
menu "Configuration"
config IEEE1905_EXTENSION_ALLOWED
bool "Allow plugins to extend 1905 CMDUs and/or TLVs"
@@ -10,5 +10,18 @@ config IEEE1905_PLATFORM_HAS_WIFI
bool "Platform has WiFi"
default y if PACKAGE_libwifi
config IEEE1905_CMDU_SA_IS_ALMAC
bool "Send CMDUs with SA set to 1905 AL-macaddress instead of interface macaddress"
default n
config IEEE1905_WIFI_EASYMESH
bool "Include WiFi-Alliance's Easymesh updates"
default y
config IEEE1905_CMDU_FRAGMENT_TLV_BOUNDARY
bool "Fragment large CMDU frame at TLV boundary instead of octet boundary"
default y
endmenu
endif

View File

@@ -1,14 +0,0 @@
if (PACKAGE_map-plugin)
menu "Configurations"
config MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG
bool "Sync configuration between dynamic controllers in the network"
default n
config MULTIAP_FUZZ_1905_CMDUS
bool "Include support to fuzz 1905 CMDUs for testing purpose"
default n
endmenu
endif

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ieee1905
PKG_VERSION:=4.10.7
PKG_VERSION:=6.0.16
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=b50f79061a95840d89a6129aa0a95aff82b5a1b7
PKG_SOURCE_VERSION:=3b12bdd1b0e75f4e5b744e18f00ab5ac703382e6
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ieee1905.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
@@ -35,31 +35,21 @@ define Package/ieee1905/config
endef
define Package/libieee1905
$(call Package/ieee1905/Default,$(1))
TITLE+= (library for CMDU and TLV handling)
$(call Package/ieee1905/Default)
TITLE:=libieee1905.so (library for CMDU and TLV handling)
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
+libjson-c +libblobmsg-json
endef
define Package/ieee1905
$(call Package/ieee1905/Default,$(1))
TITLE+= ieee1905d (daemon implementing 1905.1 and provides cli)
$(call Package/ieee1905/Default)
TITLE:=ieee1905d (daemon implementing 1905.1 and provides cli)
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
+libjson-c +libblobmsg-json +ubus +libpthread \
+libieee1905 +IEEE1905_PLATFORM_HAS_WIFI:libwifi
endef
define Package/map-plugin
$(call Package/ieee1905/Default,$(1))
TITLE:=Multi-AP (Easymesh) plugin
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
+libjson-c +libblobmsg-json +ieee1905 +libieee1905
endef
define Package/map-plugin/config
source "$(SOURCE)/Config.map-plugin.in"
endef
include $(wildcard plugins/*.mk)
define Package/ieee1905/description
This package provides IEEE Std 1905.1 stack.
@@ -69,8 +59,16 @@ define Package/libieee1905/description
This package provides library functions for IEEE Std 1905.1 stack.
endef
plugins := \
$(if $(CONFIG_PACKAGE_map-plugin),map) \
$(if $(CONFIG_PACKAGE_snoop-plugin),snoop) \
$(if $(CONFIG_PACKAGE_topology-plugin),topology)
ppkg:=$(patsubst plugins/%.mk,%-plugin,$(wildcard plugins/*.mk))
TARGET_CFLAGS += \
-Wno-error=deprecated-declarations \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl3 \
-D_GNU_SOURCE
@@ -79,10 +77,20 @@ ifeq ($(CONFIG_IEEE1905_PLATFORM_HAS_WIFI),y)
TARGET_CFLAGS += -DHAS_WIFI
endif
ifeq ($(CONFIG_MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG),y)
TARGET_CFLAGS += -DDYNAMIC_CNTLR_SYNC_CONFIG
ifeq ($(CONFIG_IEEE1905_CMDU_SA_IS_ALMAC),y)
TARGET_CFLAGS += -DCMDU_SA_IS_ALMAC
endif
ifeq ($(CONFIG_IEEE1905_WIFI_EASYMESH),y)
TARGET_CFLAGS += -DWIFI_EASYMESH
endif
ifeq ($(CONFIG_IEEE1905_CMDU_FRAGMENT_TLV_BOUNDARY),y)
TARGET_CFLAGS += -DIEEE1905_CMDU_FRAGMENT_TLV_BOUNDARY
endif
MAKE_FLAGS += \
extmod_subdirs="$(patsubst %,extensions/%,$(plugins))"
MAKE_PATH:=src
@@ -101,25 +109,6 @@ define Package/libieee1905/install
$(CP) $(PKG_BUILD_DIR)/src/libmidgen.so $(1)/usr/lib/
endef
define Package/map-plugin/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/libmaputil.so $(1)/usr/lib/libmaputil.so
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map.so $(1)/usr/lib/ieee1905/map.so
endef
define Build/InstallDev/map-plugin
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map2.h $(1)/usr/include/map2.h
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map_module.h $(1)/usr/include/map_module.h
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/cntlrsync.h $(1)/usr/include/cntlrsync.h
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map.so $(1)/usr/lib/ieee1905/map.so
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/libmaputil.so $(1)/usr/lib/libmaputil.so
endef
define Build/InstallDev/libieee1905
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include
@@ -137,7 +126,7 @@ endef
define Build/InstallDev
$(call Build/InstallDev/libieee1905,$(1),$(2))
$(call Build/InstallDev/map-plugin,$(1),$(2))
$(foreach p,$(ppkg),$(call Build/InstallDev/$(p),$(1),$(2)))
endef
ifeq ($(LOCAL_DEV),1)
@@ -148,4 +137,4 @@ endif
$(eval $(call BuildPackage,ieee1905))
$(eval $(call BuildPackage,libieee1905))
$(eval $(call BuildPackage,map-plugin))
$(eval $(foreach p,$(ppkg),$(call BuildPackage,$(p))))

View File

@@ -82,8 +82,10 @@ start_service() {
validate_ieee1905_config || return 1;
procd_open_instance
procd_set_param command "/usr/sbin/ieee1905d"
procd_set_param command "/usr/sbin/ieee1905d" "-o" "/tmp/ieee1905.log" "-f"
procd_set_param respawn
procd_set_param limits core="unlimited"
# procd_set_param env IEEE1905_LOG_CMDU=1
# procd_set_param stdout 1
# procd_set_param stderr 1
procd_close_instance

51
ieee1905/plugins/map.mk Normal file
View File

@@ -0,0 +1,51 @@
define Package/map-plugin
$(call Package/ieee1905/Default)
TITLE:=Multi-AP plugin supporting WiFi-Alliance Easymesh standard
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
+libjson-c +libblobmsg-json +ieee1905 +libieee1905
endef
define Package/map-plugin/config
if (PACKAGE_map-plugin)
menu "Configuration"
config MULTIAP_EASYMESH_VERSION
int "Easymesh version"
default 2
config MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG
bool "Sync configuration between dynamic controllers in the network"
default n
config MULTIAP_FUZZ_1905_CMDUS
bool "Include support to fuzz 1905 CMDUs for testing purpose"
default n
endmenu
endif
endef
TARGET_CFLAGS += -DEASYMESH_VERSION=$(CONFIG_MULTIAP_EASYMESH_VERSION)
ifeq ($(CONFIG_MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG),y)
TARGET_CFLAGS += -DDYNAMIC_CNTLR_SYNC_CONFIG
endif
define Build/InstallDev/map-plugin
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/easymesh.h $(1)/usr/include/easymesh.h
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map_module.h $(1)/usr/include/map_module.h
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/cntlrsync.h $(1)/usr/include/cntlrsync.h
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map.so $(1)/usr/lib/ieee1905/map.so
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/libmaputil.so $(1)/usr/lib/libmaputil.so
endef
define Package/map-plugin/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/libmaputil.so $(1)/usr/lib/libmaputil.so
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map.so $(1)/usr/lib/ieee1905/map.so
endef

12
ieee1905/plugins/snoop.mk Normal file
View File

@@ -0,0 +1,12 @@
define Package/snoop-plugin
$(call Package/ieee1905/Default)
TITLE:=Show all received 1905 CMDUs over UBUS
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
+libjson-c +libblobmsg-json +ieee1905 +libieee1905
endef
define Package/snoop-plugin/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
$(CP) $(PKG_BUILD_DIR)/src/extensions/snoop/snoop.so $(1)/usr/lib/ieee1905/snoop.so
endef

View File

@@ -0,0 +1,12 @@
define Package/topology-plugin
$(call Package/ieee1905/Default)
TITLE:=Build full network topology of the 1905 nodes only
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
+libjson-c +libblobmsg-json +ieee1905 +libieee1905
endef
define Package/topology-plugin/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
$(CP) $(PKG_BUILD_DIR)/src/extensions/topology/topology.so $(1)/usr/lib/ieee1905/topology.so
endef

View File

@@ -18,8 +18,21 @@ CONFIG_TARGET_ROOTFS_TARGZ=y
# /etc/banner and /etc/device_info #
CONFIG_IMAGEOPT=y
CONFIG_VERSIONOPT=y
CONFIG_VERSION_MANUFACTURER="iopsysWrt"
CONFIG_VERSION_MANUFACTURER="IOPSYS"
CONFIG_VERSION_MANUFACTURER_URL="https://iopsys.eu/"
CONFIG_VERSION_DIST="IOWRT"
# OpenWrt is given by CONFIG_VERSION_NUMBER which we do not want to override.
# disabling CONFIG_VERSION_FILENAMES will hide the OpenWrt version from the image filename
# CONFIG_VERSION_FILENAMES is not set
# CONFIG_VERSION_CODE is set to the IOWRT version instead by the genconfig-script and
# CONFIG_VERSION_CODE_FILENAMES will put it into the image filename.
CONFIG_VERSION_CODE_FILENAMES=y
CONFIG_VERSION_HOME_URL="https://iopsys.eu"
CONFIG_VERSION_BUG_URL="https://iopsys.eu"
CONFIG_VERSION_SUPPORT_URL="https://iopsys.eu"
# /lib/preinit #
CONFIG_PREINITOPT=y
@@ -44,7 +57,6 @@ CONFIG_LOCALMIRROR="https://download.iopsys.eu/iopsys/mirror/"
# EasySoC HAL #
CONFIG_PACKAGE_inbd=y
CONFIG_PACKAGE_libwifi=y
CONFIG_PACKAGE_peripheral_manager=y
CONFIG_PACKAGE_port-management=y
CONFIG_PACKAGE_wifimngr=y
@@ -64,6 +76,7 @@ CONFIG_PACKAGE_urlfilter=y
CONFIG_PACKAGE_imonitor=m
CONFIG_PACKAGE_questd=y
CONFIG_PACKAGE_rulengd=y
CONFIG_PACKAGE_usermngr=y
# TR-x69 #
CONFIG_PACKAGE_uspd-mbedtls=y
@@ -140,7 +153,7 @@ CONFIG_PACKAGE_ip-bridge=y
CONFIG_PACKAGE_ip-full=y
CONFIG_PACKAGE_iperf3=y
CONFIG_PACKAGE_ipset=y
CONFIG_PACKAGE_iptables-legacy=y
CONFIG_PACKAGE_iptables-zz-legacy=y
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
CONFIG_PACKAGE_iptables-mod-filter=y
CONFIG_PACKAGE_iptables-mod-ipopt=y

View File

@@ -13,12 +13,13 @@ function genconfig {
export DEVELOPER=0
target="bogus"
target_config_path=""
brcm63xx_arm="target/linux/feeds/iopsys-brcm63xx-arm"
ramips="target/linux/feeds/iopsys-ramips"
econet="target/linux/feeds/iopsys-econet"
x86="target/linux/feeds/iopsys-x86"
armvirt="target/linux/feeds/iopsys-armvirt"
mediatek="target/linux/feeds/iopsys-mediatek"
brcmbca_feed="target/linux/feeds/brcmbca"
ramips_feed="target/linux/feeds/iopsys-ramips"
airoha_feed="target/linux/feeds/airoha"
x86_feed="target/linux/feeds/iopsys-x86"
armvirt_feed="target/linux/feeds/iopsys-armvirt"
mediatek_feed="target/linux/feeds/iopsys-mediatek"
qualcomm_ipq95xx_feed="target/linux/feeds/ipq95xx"
Red='\033[0;31m' # Red
Color_Off='\033[0m' # Text Reset
@@ -108,21 +109,23 @@ function genconfig {
return
fi
[ -e $brcm63xx_arm/genconfig ] &&
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
[ -e $ramips/genconfig ] &&
iopsys_ramips=$(cd $ramips; ./genconfig)
[ -e $econet/genconfig ] &&
iopsys_econet=$(cd $econet; ./genconfig)
[ -e $x86/genconfig ] &&
iopsys_x86=$(cd $x86; ./genconfig)
[ -e $armvirt/genconfig ] &&
iopsys_armvirt=$(cd $armvirt; ./genconfig)
[ -e $mediatek/genconfig ] &&
iopsys_mediatek=$(cd $mediatek; ./genconfig)
[ -e $brcmbca_feed/genconfig ] &&
brcmbca=$(cd $brcmbca_feed; ./genconfig)
[ -e $ramips_feed/genconfig ] &&
iopsys_ramips=$(cd $ramips_feed; ./genconfig)
[ -e $airoha_feed/genconfig ] &&
airoha=$(cd $airoha_feed; ./genconfig)
[ -e $x86_feed/genconfig ] &&
iopsys_x86=$(cd $x86_feed; ./genconfig)
[ -e $armvirt_feed/genconfig ] &&
iopsys_armvirt=$(cd $armvirt_feed; ./genconfig)
[ -e $mediatek_feed/genconfig ] &&
iopsys_mediatek=$(cd $mediatek_feed; ./genconfig)
[ -e $qualcomm_ipq95xx_feed/genconfig ] &&
ipq95xx=$(cd $qualcomm_ipq95xx_feed; ./genconfig)
if [ "$profile" == "LIST" ]; then
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_econet iopsys_x86 iopsys_armvirt iopsys_mediatek; do
for list in brcmbca iopsys_ramips airoha iopsys_x86 iopsys_armvirt iopsys_mediatek ipq95xx; do
echo "$list based boards:"
for b in ${!list}; do
echo -e "\t$b"
@@ -131,10 +134,10 @@ function genconfig {
return
fi
for p in $iopsys_brcm63xx_arm; do
for p in $brcmbca; do
if [ $p == $profile ]; then
target="iopsys_brcm63xx_arm"
target_config_path="$brcm63xx_arm/config"
target="brcmbca"
target_config_path="$brcmbca_feed/config"
return
fi
done
@@ -142,15 +145,15 @@ function genconfig {
for p in $iopsys_ramips; do
if [ $p == $profile ]; then
target="iopsys_ramips"
target_config_path="$ramips/config"
target_config_path="$ramips_feed/config"
return
fi
done
for p in $iopsys_econet; do
for p in $airoha; do
if [ $p == $profile ]; then
target="iopsys_econet"
target_config_path="$econet/config"
target="airoha"
target_config_path="$airoha_feed/config"
return
fi
done
@@ -158,7 +161,7 @@ function genconfig {
for p in $iopsys_x86; do
if [ $p == $profile ]; then
target="iopsys_x86"
target_config_path="$x86/config"
target_config_path="$x86_feed/config"
return
fi
done
@@ -166,7 +169,7 @@ function genconfig {
for p in $iopsys_armvirt; do
if [ $p == $profile ]; then
target="iopsys_armvirt"
target_config_path="$armvirt/config"
target_config_path="$armvirt_feed/config"
return
fi
done
@@ -174,7 +177,15 @@ function genconfig {
for p in $iopsys_mediatek; do
if [ $p == $profile ]; then
target="iopsys_mediatek"
target_config_path="$mediatek/config"
target_config_path="$mediatek_feed/config"
return
fi
done
for p in $ipq95xx; do
if [ $p == $profile ]; then
target="ipq95xx"
target_config_path="$qualcomm_ipq95xx_feed/config"
return
fi
done
@@ -331,7 +342,7 @@ function genconfig {
# Special handling for targets which use TARGET_DEVICES
case "$target" in
iopsys_ramips | iopsys_econet | iopsys_mediatek | iopsys_brcm63xx_arm)
iopsys_ramips | airoha | iopsys_mediatek | brcmbca | ipq95xx)
# This assumes the device name to be unique within one target,
# which is a fair assumption to make.
local mk_file="$(grep -Fx --files-with-matches "define Device/${BOARDTYPE}" "$target_config_path/../image/"*.mk)"
@@ -377,12 +388,15 @@ function genconfig {
fi
# Set target version
local GIT_TAG=$(git describe --abbrev=0 --tags)
local GIT_REV=$(git rev-parse --short HEAD)
local GIT_VER="$GIT_TAG"
git describe --contains $GIT_REV >/dev/null 2>&1 || GIT_VER="${GIT_TAG}_${GIT_REV}"
echo "CONFIG_TARGET_VERSION=\"${GIT_VER}\"" >> .config
echo "CONFIG_VERSION_CODE=\"${GIT_VER}\"" >> .config
local git_version
if ! git_version="$(git describe --always --dirty --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then
echo "ERROR: Failed getting version via git describe, exiting." >&2
return 1
fi
local version="${git_version,,}${CUSTOMERS:+-${CUSTOMERS// /}}"
local version_lower="${version,,}"
echo "CONFIG_TARGET_VERSION=\"${version_lower}\"" >> .config
echo "CONFIG_VERSION_CODE=\"${version_lower}\"" >> .config
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
# Enable Package source tree override if selected

View File

@@ -12,12 +12,13 @@ function genconfig_min {
export DEVELOPER=0
target="bogus"
target_config_path=""
brcm63xx_arm="target/linux/feeds/iopsys-brcm63xx-arm"
ramips="target/linux/feeds/iopsys-ramips"
econet="target/linux/feeds/iopsys-econet"
x86="target/linux/feeds/iopsys-x86"
armvirt="target/linux/feeds/iopsys-armvirt"
mediatek="target/linux/feeds/iopsys-mediatek"
brcmbca_feed="target/linux/feeds/brcmbca"
ramips_feed="target/linux/feeds/iopsys-ramips"
airoha_feed="target/linux/feeds/airoha"
x86_feed="target/linux/feeds/iopsys-x86"
armvirt_feed="target/linux/feeds/iopsys-armvirt"
mediatek_feed="target/linux/feeds/iopsys-mediatek"
qualcomm_ipq95xx_feed="target/linux/feeds/ipq95xx"
Red='\033[0;31m' # Red
Color_Off='\033[0m' # Text Reset
@@ -107,21 +108,23 @@ function genconfig_min {
return
fi
[ -e $brcm63xx_arm/genconfig ] &&
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
[ -e $ramips/genconfig ] &&
iopsys_ramips=$(cd $ramips; ./genconfig)
[ -e $econet/genconfig ] &&
iopsys_econet=$(cd $econet; ./genconfig)
[ -e $x86/genconfig ] &&
iopsys_x86=$(cd $x86; ./genconfig)
[ -e $armvirt/genconfig ] &&
iopsys_armvirt=$(cd $armvirt; ./genconfig)
[ -e $mediatek/genconfig ] &&
iopsys_mediatek=$(cd $mediatek; ./genconfig)
[ -e $brcmbca_feed/genconfig ] &&
brcmbca=$(cd $brcmbca_feed; ./genconfig)
[ -e $ramips_feed/genconfig ] &&
iopsys_ramips=$(cd $ramips_feed; ./genconfig)
[ -e $airoha_feed/genconfig ] &&
airoha=$(cd $airoha_feed; ./genconfig)
[ -e $x86_feed/genconfig ] &&
iopsys_x86=$(cd $x86_feed; ./genconfig)
[ -e $armvirt_feed/genconfig ] &&
iopsys_armvirt=$(cd $armvirt_feed; ./genconfig)
[ -e $mediatek_feed/genconfig ] &&
iopsys_mediatek=$(cd $mediatek_feed; ./genconfig)
[ -e $qualcomm_ipq95xx_feed/genconfig ] &&
ipq95xx=$(cd $qualcomm_ipq95xx_feed; ./genconfig)
if [ "$profile" == "LIST" ]; then
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_econet iopsys_x86 iopsys_armvirt iopsys_mediatek; do
for list in brcmbca iopsys_ramips airoha iopsys_x86 iopsys_armvirt iopsys_mediatek ipq95xx; do
echo "$list based boards:"
for b in ${!list}; do
echo -e "\t$b"
@@ -130,10 +133,10 @@ function genconfig_min {
return
fi
for p in $iopsys_brcm63xx_arm; do
for p in $brcmbca; do
if [ $p == $profile ]; then
target="iopsys_brcm63xx_arm"
target_config_path="$brcm63xx_arm/config"
target="brcmbca"
target_config_path="$brcmbca_feed/config"
return
fi
done
@@ -141,15 +144,15 @@ function genconfig_min {
for p in $iopsys_ramips; do
if [ $p == $profile ]; then
target="iopsys_ramips"
target_config_path="$ramips/config"
target_config_path="$ramips_feed/config"
return
fi
done
for p in $iopsys_econet; do
for p in $airoha; do
if [ $p == $profile ]; then
target="iopsys_econet"
target_config_path="$econet/config"
target="airoha"
target_config_path="$airoha_feed/config"
return
fi
done
@@ -157,7 +160,7 @@ function genconfig_min {
for p in $iopsys_x86; do
if [ $p == $profile ]; then
target="iopsys_x86"
target_config_path="$x86/config"
target_config_path="$x86_feed/config"
return
fi
done
@@ -165,7 +168,7 @@ function genconfig_min {
for p in $iopsys_armvirt; do
if [ $p == $profile ]; then
target="iopsys_armvirt"
target_config_path="$armvirt/config"
target_config_path="$armvirt_feed/config"
return
fi
done
@@ -173,7 +176,15 @@ function genconfig_min {
for p in $iopsys_mediatek; do
if [ $p == $profile ]; then
target="iopsys_mediatek"
target_config_path="$mediatek/config"
target_config_path="$mediatek_feed/config"
return
fi
done
for p in $ipq95xx; do
if [ $p == $profile ]; then
target="ipq95xx"
target_config_path="$qualcomm_ipq95xx_feed/config"
return
fi
done
@@ -322,7 +333,7 @@ function genconfig_min {
# Special handling for targets which use TARGET_DEVICES
case "$target" in
iopsys_ramips | iopsys_econet | iopsys_mediatek | iopsys_brcm63xx_arm)
iopsys_ramips | airoha | iopsys_mediatek | brcmbca | ipq95xx)
# This assumes the device name to be unique within one target,
# which is a fair assumption to make.
local mk_file="$(grep -Fx --files-with-matches "define Device/${BOARDTYPE}" "$target_config_path/../image/"*.mk)"
@@ -368,12 +379,15 @@ function genconfig_min {
fi
# Set target version
local GIT_TAG=$(git describe --abbrev=0 --tags)
local GIT_REV=$(git rev-parse --short HEAD)
local GIT_VER="$GIT_TAG"
git describe --contains $GIT_REV >/dev/null 2>&1 || GIT_VER="${GIT_TAG}_${GIT_REV}"
echo "CONFIG_TARGET_VERSION=\"${GIT_VER}\"" >> .config
echo "CONFIG_VERSION_CODE=\"${GIT_VER}\"" >> .config
local git_version
if ! git_version="$(git describe --always --dirty --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then
echo "ERROR: Failed getting version via git describe, exiting." >&2
return 1
fi
local version="${git_version,,}${CUSTOMERS:+-${CUSTOMERS// /}}"
local version_lower="${version,,}"
echo "CONFIG_TARGET_VERSION=\"${version_lower}\"" >> .config
echo "CONFIG_VERSION_CODE=\"${version_lower}\"" >> .config
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
# Enable Package source tree override if selected

View File

@@ -48,7 +48,10 @@ function ssh_install_key {
local keys="$(get_ssh_public_keys)"
echo "Adding the following keys to $DROPBEAR_AUTHORIZED_KEYS_FILE on $host:"
echo "$keys"
ssh root@$host "echo '$keys' >> '$DROPBEAR_AUTHORIZED_KEYS_FILE'" && echo ok
ssh \
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
root@$host \
"echo '$keys' >> '$DROPBEAR_AUTHORIZED_KEYS_FILE'" && echo ok
}
register_command "ssh_install_key" "Install the users public ssh key on host running dropbear"

View File

@@ -274,9 +274,10 @@ function ssh_upgrade {
pv "$upd_fw" |
ssh \
-o ConnectTimeout=60 \
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
root@"$upd_host" \
sh -c "cat > '/tmp/$upd_fw_base' && (set -x && sysupgrade -v $extra_args /tmp/$upd_fw_base)" ||
echo "Sysupgrade failed" >&2 && return 1
}
register_command "ssh_upgrade" "-h <host> -f <file> [opts] Install firmware on remote host with SSH"
register_command "ssh_upgrade" "-t <host> -f <file> [opts] Install firmware on remote host with SSH"

View File

@@ -0,0 +1,61 @@
#
# Copyright (C) 2022 IOPSYS Software Solutions AB
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libvoice-broadcom
PKG_VERSION:=0.1
PKG_LICENSE:=PROPRIETARY
PKG_LICENSE_FILES:=LICENSE
LOCAL_SRC_DIR:=~/git/voip/$(PKG_NAME)
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
PKG_SOURCE_VERSION:=b53e93ca1a2fdda56ca9caffb6020e158e684f3d
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
# All config variable that are passed to the make invocation, directly or
# indirectly. This ensures that the package is rebuilt on config-changes.
PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD
LIBVOICE_PKG_BUILD_DIR := $(PKG_BUILD_DIR)
export CONFIG_BRCM_SDK_VER_504040
export CONFIG_BCM_CHIP_ID
include $(INCLUDE_DIR)/package.mk
TARGET_CFLAGS += -Wall -Werror
define Package/$(PKG_NAME)
CATEGORY:=Utilities
TITLE:=IOPSYS libvoice for Broadcom
URL:=
DEPENDS:=
endef
define Package/$(PKG_NAME)/description
Libvoice is a library that provides a uniform set of APIs and data types with hardware abstract layer for DSP/SLIC from different vendors
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -av --exclude=.* $(LOCAL_SRC_DIR)/* $(PKG_BUILD_DIR)/
endef
endif
define Package/$(PKG_NAME)/install
# Although there is nothing needs to be installed, but the install section must NOT be empty. Otherwise the package will be skipped as below.
# WARNING: skipping libvoice-broadcom -- package has no install section
$(INSTALL_DIR) $(1)/usr/lib
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

58
libvoice-d2/Makefile Normal file
View File

@@ -0,0 +1,58 @@
#
# Copyright (C) 2022 IOPSYS Software Solutions AB
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libvoice-d2
PKG_VERSION:=0.1
PKG_LICENSE:=PROPRIETARY
PKG_LICENSE_FILES:=LICENSE
LOCAL_SRC_DIR:=~/git/voip/$(PKG_NAME)
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
PKG_SOURCE_VERSION:=45e7d35f97f258f5e13c3afa0542db724bf59828
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
# All config variable that are passed to the make invocation, directly or
# indirectly. This ensures that the package is rebuilt on config-changes.
PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD
LIBVOICE_PKG_BUILD_DIR := $(PKG_BUILD_DIR)
include $(INCLUDE_DIR)/package.mk
TARGET_CFLAGS += -Wall -Werror
define Package/$(PKG_NAME)
CATEGORY:=Utilities
TITLE:=IOPSYS libvoice for D2 which is software DSP
URL:=
DEPENDS:=
endef
define Package/$(PKG_NAME)/description
Libvoice is a library that provides a uniform set of APIs and data types with hardware abstract layer for DSP/SLIC from different vendors
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -av --exclude=.* $(LOCAL_SRC_DIR)/* $(PKG_BUILD_DIR)/
endef
endif
define Package/$(PKG_NAME)/install
# Although there is nothing needs to be installed, but the install section must NOT be empty. Otherwise the package will be skipped as below.
# WARNING: skipping libvoice-d2 -- package has no install section
$(INSTALL_DIR) $(1)/usr/lib
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -13,6 +13,9 @@ config AGENT_ISLAND_PREVENTION
config AGENT_EASYMESH_R2_CERT
bool "Compile for WFA test bed"
config AGENT_EASYMESH_VERSION
int "Support Easymesh version"
default 2
config AGENT_EASYMESH_VENDOR_EXT
bool "Enable extra features through Easymesh vendor extension"

View File

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-agent
PKG_VERSION:=2.10.3.15
PKG_VERSION:=2.10.4.11
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=075fb9f89722979d4622cbc575f34f74f19c1a91
PKG_SOURCE_VERSION:=0852c7803475f7fb919f680d02437ba9672c42fc
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_LICENSE:=BSD-3-Clause
@@ -28,7 +28,7 @@ define Package/map-agent
CATEGORY:=Utilities
TITLE:=WiFi multi-AP Agent (EasyMesh R2)
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
+map-plugin
+map-plugin +ip-bridge
endef
@@ -59,6 +59,8 @@ TARGET_CFLAGS += \
-Wno-error=deprecated-declarations \
-D_GNU_SOURCE
TARGET_CFLAGS += -DEASYMESH_VERSION=$(CONFIG_AGENT_EASYMESH_VERSION)
ifeq ($(CONFIG_AGENT_SYNC_DYNAMIC_CNTLR_CONFIG),y)
TARGET_CFLAGS += -DAGENT_SYNC_DYNAMIC_CNTLR_CONFIG
endif
@@ -73,6 +75,7 @@ endif
ifeq ($(CONFIG_AGENT_EASYMESH_VENDOR_EXT),y)
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_AGENT_EASYMESH_VENDOR_EXT_OUI)\\\"
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT
endif

View File

@@ -7,6 +7,7 @@ config agent 'agent'
option island_prevention '0'
option eth_onboards_wifi_bhs '0'
# option controller_macaddr '0a:1b:2c:3d:4e:50'
option scan_on_boot_only '0'
config dynamic_backhaul
option missing_bh_timer '60'

View File

@@ -3,7 +3,7 @@
. /lib/network/utils.sh
conn_ports_file="/tmp/map.connected.ports"
map_bh_file="/tmp/multiap.backhaul"
map_bh_file="/var/run/multiap/multiap.backhaul"
al_bridge="$(uci -q get mapagent.agent.al_bridge)"
[ "${al_bridge:0:3}" = "br-" ] || exit 0
al_brnet="${al_bridge:3}"

View File

@@ -10,56 +10,9 @@ IS_CFG_VALID=1
MAP_DEV="map_dev"
MAP_IF="map"
create_map() {
ip link add lei type veth peer name lei_map 2>/dev/null
ip link add link lei name lei_lan type vlan id 1 2>/dev/null
uci -q set network.${MAP_DEV}=device
uci -q set network.${MAP_DEV}.name=br-map
uci -q set network.${MAP_DEV}.type=bridge
uci -q show network.${MAP_DEV}.ports | grep -q lei_map || {
uci -q add_list network.${MAP_DEV}.ports='lei_map'
}
uci -q set network.${MAP_IF}=interface
uci -q set network.${MAP_IF}.device=br-map
uci -q set network.${MAP_IF}.is_lan=1
uci -q show network.br_lan.ports | grep -q lei_lan || {
uci -q add_list network.br_lan.ports="lei_lan"
}
uci -q set mapagent.agent.al_bridge=br-map
uci -q commit
ubus call network reload
ubus -t 5 wait_for network.interface.map
brctl addif br-map lei_map 2>/dev/null
brctl addif br-lan lei_lan 2>/dev/null
ip link set lei up 2>/dev/null
ip link set lei_map up 2>/dev/null
ip link set lei_lan up 2>/dev/null
}
remove_map() {
ip link delete ${MAP_VETH} &>/dev/null
uci -q delete network.${MAP_DEV}
uci -q delete network.${MAP_IF}
uci -q set mapagent.agent.al_bridge=br-lan
uci -q commit
ubus call network reload
}
start_dynbhd_service() {
rm -f /tmp/multiap.backhaul
rm -f /var/run/multiap/multiap.backhaul
procd_open_instance
procd_set_param command "/usr/sbin/dynbhd"
procd_set_param respawn
@@ -81,7 +34,8 @@ validate_agent_section() {
'resend_num:uinteger:0' \
'dyn_cntlr_sync:bool:true' \
'island_prevention:bool:false' \
'eth_onboards_wifi_bhs:bool:false'
'eth_onboards_wifi_bhs:bool:false' \
'scan_on_boot_only:bool:false'
[ "$?" -ne 0 ] && {
@@ -138,7 +92,7 @@ validate_radio_section() {
uci_validate_section mapagent $section "${1}" \
'device:string' \
'band:or("2", "5")' \
'band:or("2", "5", "6")' \
'configured:bool:false' \
'onboarded:bool:false' \
'dedicated_backhaul:bool:false' \
@@ -233,10 +187,6 @@ start_service() {
config_get_bool enabled agent enabled 1
[ "$enabled" -eq 0 ] && return 1
local ts
config_get_bool ts agent vlan_segregation 0
[ "$ts" -eq 1 ] && create_map #|| remove_map
procd_open_instance
create_dir
procd_set_param command "/usr/sbin/mapagent" "-d"
@@ -246,10 +196,6 @@ start_service() {
procd_close_instance
}
#stop_service() {
# remove_map
#}
service_triggers()
{
procd_add_reload_trigger "mapagent"

View File

@@ -14,6 +14,10 @@ config CONTROLLER_EASYMESH_VENDOR_EXT_OUI_DEFAULT
string
default "\\\\x11\\\\x22\\\\x33"
config CONTROLLER_EASYMESH_VERSION
int "Support Easymesh version"
default 2
config CONTROLLER_EASYMESH_VENDOR_EXT_OUI
string "Vendor OUI in '\\\\xAB\\\\xCD\\\\xEF' format"
default CONTROLLER_EASYMESH_VENDOR_EXT_OUI_DEFAULT

View File

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-controller
PKG_VERSION:=2.11.0.4
PKG_VERSION:=2.11.0.20
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=a4a626539ede73c1c4eb1ad768331524a8ee9ce8
PKG_SOURCE_VERSION:=5ff7f037c040d337982a1e3a51693fb8e0682046
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
@@ -45,12 +45,15 @@ TARGET_CFLAGS += \
MAKE_PATH:=src
TARGET_CFLAGS += -DEASYMESH_VERSION=$(CONFIG_CONTROLLER_EASYMESH_VERSION)
ifeq ($(CONFIG_CONTROLLER_SYNC_DYNAMIC_CNTLR_CONFIG),y)
TARGET_CFLAGS += -DCONTROLLER_SYNC_DYNAMIC_CNTLR_CONFIG
endif
ifeq ($(CONFIG_CONTROLLER_EASYMESH_VENDOR_EXT),y)
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_CONTROLLER_EASYMESH_VENDOR_EXT_OUI)\\\"
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT
endif
define Package/map-controller/install
@@ -58,6 +61,8 @@ define Package/map-controller/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mapcontroller $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/usr/lib/mapcontroller
$(CP) $(PKG_BUILD_DIR)/src/plugins/steer/rcpi/rcpi.so $(1)/usr/lib/mapcontroller/rcpi.so
endef
ifeq ($(LOCAL_DEV),1)

View File

@@ -2,15 +2,23 @@ config controller 'controller'
option enabled '1'
option registrar '2 5'
option debug '0'
option enable_sta_steer '0'
option enable_bsta_steer '0'
option use_bcn_metrics '0'
option use_usta_metrics '0'
option bcn_metrics_max_num '10'
option initial_channel_scan '0'
option primary_vid '0'
option primary_pcp '0'
option allow_bgdfs '0'
option channel_plan '0'
config sta_steering
option steer_module 'rcpi'
option enabled '1'
option enable_sta_steer '0'
option enable_bsta_steer '0'
option use_bcn_metrics '0'
option use_usta_metrics '0'
option bandsteer '0'
option diffsnr '8'
config ap
option band '2'
option encryption 'sae-mixed'
@@ -60,8 +68,8 @@ config ap
# option report_sta_assocfails_rate '0'
# option report_metric_periodic '0'
# option report_scan '0'
# option steer_exclude '0'
# option steer_exclude_btm '0'
# list steer_exclude 'e0:d4:e8:79:c4:ee'
# list steer_exclude_btm 'e0:d4:e8:79:c4:11'
# option steer_disallow '0'
# option coordinated_cac '0'
# option traffic_separation '0'
@@ -107,8 +115,8 @@ config ap
# option report_sta_assocfails_rate '0'
# option report_metric_periodic '0'
# option report_scan '0'
# option steer_exclude '0'
# option steer_exclude_btm '0'
# list steer_exclude 'e0:d4:e8:79:c4:ee'
# list steer_exclude_btm 'e0:d4:e8:79:c4:11'
# option steer_disallow '0'
# option coordinated_cac '0'
# option traffic_separation '0'

View File

@@ -19,11 +19,9 @@ validate_controller_section() {
'enabled:bool:true' \
'registrar:string' \
'debug:range(0,16)' \
'bcn_metrics_max_num:range(1,256)' \
'initial_channel_scan:bool:true' \
'resend_num:uinteger:0' \
'enable_sta_steer:bool:false' \
'enable_bsta_steer:bool:false' \
'use_bcn_metrics:bool:false' \
'use_usta_metrics:bool:false' \
'allow_bgdfs:range(0,2629744)' \
'channel_plan:range(0,2629744)' \
'enable_ts:bool:false'
@@ -36,6 +34,27 @@ validate_controller_section() {
return 0
}
validate_sta_steering_section() {
local section="$1"
uci_validate_section mapcontroller $section "${1}" \
'steer_module:string' \
'enabled:bool:true' \
'enable_sta_steer:bool:false' \
'enable_bsta_steer:bool:false' \
'use_bcn_metrics:bool:false' \
'use_usta_metrics:bool:false' \
'bandsteer:bool:false' \
'diffsnr:range(0,100)'
[ "$?" -ne 0 ] && {
logger -s -t "mapcontroller" "Validation of sta_steering section failed"
IS_CFG_VALID=0
return 1
}
return 0
}
validate_ap_section() {
local section="$1"
@@ -93,7 +112,7 @@ validate_radio_section() {
uci_validate_section mapcontroller $section "${1}" \
'agent_id:macaddr' \
'macaddr:macaddr' \
'band:or("2", "5")' \
'band:or("2", "5", "6")' \
'steer_policy:range(0,2)' \
'util_threshold:range(0,255)' \
'rcpi_threshold:range(0,255)' \
@@ -116,6 +135,7 @@ validate_controller_config() {
IS_CFG_VALID=1
validate_controller_section &&
config_foreach validate_sta_steering_section sta_steering &&
config_foreach validate_ap_section ap &&
config_foreach validate_node_section node &&
config_foreach validate_radio_section radio

View File

@@ -6,11 +6,11 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=map-topology
PKG_VERSION:=2.5.1.4
PKG_VERSION:=2.5.1.13
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_VERSION:=488ce1ce576b57c9b3c4d7c034969bf65e66216f
PKG_SOURCE_VERSION:=aaa55a72e719184af32d57a9b40bec1c440774a9
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-topology.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz

308
mqttmngr/LICENSE Normal file
View File

@@ -0,0 +1,308 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
uspd - USP Daemon exposing USP API over uBus
Copyright (C) 2019 iopsys Software Solutions AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

44
mqttmngr/Makefile Normal file
View File

@@ -0,0 +1,44 @@
#
# Copyright (C) 2022 IOPSYS
#
include $(TOPDIR)/rules.mk
PKG_NAME:=mqttmngr
PKG_VERSION:=1.0.0
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/mqttmngr
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
DEPENDS:= +libbbf_api +mosquitto
TITLE:=Package to add Device.MQTT. datamodel support
endef
define Package/mqttmngr/description
Package to add Device.MQTT. datamodel support
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) src/* $(PKG_BUILD_DIR)
mkdir -p $(PKG_BUILD_DIR)/files
$(CP) files/* $(PKG_BUILD_DIR)/files/
endef
define Package/mqttmngr/install
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libmqttmngr.so $(1)/usr/lib/bbfdm/libmqttmngr.so
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/uci-defaults/01-mosquitto-config $(1)/etc/uci-defaults/01-mosquitto-config
endef
$(eval $(call BuildPackage,mqttmngr))

4
mqttmngr/README.md Normal file
View File

@@ -0,0 +1,4 @@
# MQTTmngr
MQTT manager is a lightweight program to manage MQTT broker. It also provides the TR181 datamodel object `Device.MQTT.` using libbbf DotSO plugin.

View File

@@ -0,0 +1,47 @@
#!/bin/sh
config_mosquitto_owrt() {
sec=$(uci -q get mosquitto.owrt)
if [ -z "${sec}" ]; then
sec=$(uci -q add mosquitto owrt)
uci -q rename mosquitto."${sec}"="owrt"
fi
uci -q set mosquitto.owrt.use_uci="1"
uci -q set mosquitto.owrt.write_pid="0"
uci -q commit mosquitto
}
config_mosquitto_general() {
sec=$(uci -q get mosquitto.mosquitto)
if [ -z "${sec}" ]; then
sec=$(uci -q add mosquitto mosquitto)
uci -q rename mosquitto."${sec}"="mosquitto"
fi
uci -q set mosquitto.mosquitto.log_dest="syslog"
uci -q set mosquitto.mosquitto.include_dir="/etc/mosquitto/conf.d"
uci -q set mosquitto.mosquitto.log_facility="5"
uci -q set mosquitto.mosquitto.log_timestamp="1"
uci -q set mosquitto.mosquitto.log_types="error warning notice"
uci -q set mosquitto.mosquitto.per_listener_settings="1"
uci -q commit mosquitto
}
config_mosquitto_persistence() {
sec=$(uci -q get mosquitto.persistence)
if [ -z "${sec}" ]; then
sec=$(uci -q add mosquitto persistence)
uci -q rename mosquitto."${sec}"="persistence"
fi
uci -q set mosquitto.persistence.persistence="0"
uci -q set mosquitto.persistence.location="/var/run"
uci -q commit mosquitto
}
if [ -f "/etc/config/mosquitto" ]; then
config_mosquitto_owrt
config_mosquitto_general
config_mosquitto_persistence
fi

17
mqttmngr/src/Makefile Normal file
View File

@@ -0,0 +1,17 @@
LIB = libmqttmngr.so
LIB_OBJS = mqtt.o
PROG_CFLAGS = $(CFLAGS) -Wall -Werror -fPIC
LIB_LDFLAGS = $(LDFLAGS)
%.o: %.c
$(CC) $(PROG_CFLAGS) $(FPIC) -c -o $@ $<
all: $(LIB)
$(LIB): $(LIB_OBJS)
$(CC) $(PROG_CFLAGS) $(LIB_LDFLAGS) -shared -o $@ $^
clean:
rm -f *.o $(LIB)

334
mqttmngr/src/mqtt.c Normal file
View File

@@ -0,0 +1,334 @@
/*
* Copyright (C) 2022 iopsys Software Solutions AB
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation
*
* Author: Suvendhu Hansa <suvendhu.hansa@iopsys.eu>
*/
#include <libbbf_api.h>
#include "mqtt.h"
static bool duplicate_entry_exist(char *name, char *section_type)
{
bool exist = false;
struct uci_section *s = NULL, *stmp = NULL;
uci_foreach_sections_safe("mosquitto", section_type, stmp, s) {
if (DM_STRCMP(name, section_name(s)) == 0) {
exist = true;
break;
}
}
return exist;
}
/*************************************************************
* ADD & DEL OBJ
**************************************************************/
static int addMQTTBroker(char *refparam, struct dmctx *ctx, void *data, char **instance)
{
struct uci_section *s = NULL, *dmmap_broker = NULL;
char sec_name[40];
snprintf(sec_name, sizeof(sec_name), "broker_%s", *instance);
if (bbf_uci_add_section("mosquitto", "listener", &s) == 0) {
bbf_uci_rename_section(s, sec_name);
bbf_uci_set_value_by_section(s, "enabled", "0");
bbf_uci_add_section_bbfdm("dmmap_mqtt", "listener", &dmmap_broker);
bbf_uci_set_value_by_section(dmmap_broker, "section_name", sec_name);
bbf_uci_set_value_by_section(dmmap_broker, "listener_instance", *instance);
}
return 0;
}
static int delMQTTBroker(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action)
{
struct uci_section *s = NULL, *stmp = NULL;
switch (del_action) {
case DEL_INST:
bbf_uci_delete_section_by_section(((struct dmmap_dup *)data)->config_section, NULL, NULL);
bbf_uci_delete_section_by_section(((struct dmmap_dup *)data)->dmmap_section, NULL, NULL);
break;
case DEL_ALL:
bbf_uci_foreach_sections_safe("users", "user", stmp, s) {
struct uci_section *dmmap_section = NULL;
get_dmmap_section_of_config_section("dmmap_users", "user", section_name(s), &dmmap_section);
bbf_uci_delete_section_by_section(s, NULL, NULL);
bbf_uci_delete_section_by_section(dmmap_section, NULL, NULL);
}
break;
}
return 0;
}
/*************************************************************
* ENTRY METHOD
*************************************************************/
static int browseMQTTBrokerInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
{
struct dmmap_dup *p = NULL;
char *inst = NULL;
LIST_HEAD(dup_list);
synchronize_specific_config_sections_with_dmmap("mosquitto", "listener", "dmmap_mqtt", &dup_list);
list_for_each_entry(p, &dup_list, list) {
inst = handle_instance(dmctx, parent_node, p->dmmap_section, "listener_instance", "listener_alias");
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)p, inst) == DM_STOP)
break;
}
free_dmmap_config_dup_list(&dup_list);
return 0;
}
/*************************************************************
* GET & SET PARAM
**************************************************************/
static int get_MQTT_BrokerNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
int cnt = bbf_get_number_of_entries(ctx, data, instance, browseMQTTBrokerInst);
dmasprintf(value, "%d", cnt);
return 0;
}
static int get_MQTTBroker_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
bbf_uci_get_value_by_section(((struct dmmap_dup *)data)->dmmap_section, "listener_alias", value);
if ((*value)[0] == '\0')
dmasprintf(value, "cpe-%s", instance);
return 0;
}
static int set_MQTTBroker_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 64, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
bbf_uci_set_value_by_section(((struct dmmap_dup *)data)->dmmap_section, "listener_alias", value);
return 0;
}
return 0;
}
static int get_MQTTBroker_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = bbf_uci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "enabled", "0");
return 0;
}
static int set_MQTTBroker_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
bool b;
switch (action) {
case VALUECHECK:
if (dm_validate_boolean(value))
return FAULT_9007;
break;
case VALUESET:
string_to_bool(value, &b);
bbf_uci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "enabled", b ? "1" : "0");
break;
}
return 0;
}
static int get_MQTTBroker_Name(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
bbf_uci_get_value_by_section(((struct dmmap_dup *)data)->dmmap_section, "section_name", value);
return 0;
}
static int set_MQTTBroker_Name(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
char *curr_name = NULL;
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 64, NULL, NULL))
return FAULT_9007;
// Check if the value is empty
if (*value == '\0')
return FAULT_9007;
// Check if new name is same as current name
curr_name = section_name(((struct dmmap_dup *)data)->config_section);
if (DM_STRCMP(curr_name, value) == 0)
break;
// check if duplicate entry already exists
if (duplicate_entry_exist(value, "listener"))
return FAULT_9001;
break;
case VALUESET:
// If new name is same as current name then nothing to do
curr_name = section_name(((struct dmmap_dup *)data)->config_section);
if (DM_STRCMP(curr_name, value) == 0)
break;
// Update mosquitto config
if (0 != bbf_uci_rename_section(((struct dmmap_dup *)data)->config_section, value))
return FAULT_9001;
// Update dmmap_users file
bbf_uci_set_value_by_section(((struct dmmap_dup *)data)->dmmap_section, "section_name", value);
break;
}
return 0;
}
static int get_MQTTBroker_Port(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = bbf_uci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "port", "1");
return 0;
}
static int set_MQTTBroker_Port(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
return FAULT_9007;
break;
case VALUESET:
bbf_uci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "port", value);
break;
}
return 0;
}
static int get_MQTTBroker_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
char *intf = NULL;
bbf_uci_get_value_by_section(((struct dmmap_dup *)data)->config_section, "interface", &intf);
if (DM_STRLEN(intf) == 0)
return 0;
adm_entry_get_linker_param(ctx, "Device.IP.Interface.", intf, value);
return 0;
}
static int set_MQTTBroker_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
char *allowed_objects[] = {"Device.IP.Interface.", NULL};
char *iface = NULL;
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 256, NULL, NULL))
return FAULT_9007;
if (dm_entry_validate_allowed_objects(ctx, value, allowed_objects))
return FAULT_9007;
break;
case VALUESET:
adm_entry_get_linker_value(ctx, value, &iface);
if (DM_STRLEN(iface) != 0)
bbf_uci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "interface", iface);
break;
}
return 0;
}
static int get_MQTTBroker_Username(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
bbf_uci_get_value_by_section(((struct dmmap_dup *)data)->config_section, "username", value);
return 0;
}
static int set_MQTTBroker_Username(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 64, NULL, NULL))
return FAULT_9007;
// Check if the value is empty
if (*value == '\0')
return FAULT_9007;
break;
case VALUESET:
bbf_uci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "username", value);
break;
}
return 0;
}
static int get_MQTTBroker_Password(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = "";
return 0;
}
static int set_MQTTBroker_Password(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 64, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
bbf_uci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "password", value);
break;
}
return 0;
}
/**********************************************************************************************************************************
* OBJ & LEAF DEFINITION
**********************************************************************************************************************************/
DM_MAP_OBJ tDynamicObj[] = {
/* parentobj, nextobject, parameter */
{"Device.", tDeviceMQTTObj, NULL},
{0}
};
/* *** Device.MQTT. *** */
DMOBJ tDeviceMQTTObj[] = {
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
{"MQTT", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tMQTTObj, tMQTTParams, NULL, BBFDM_BOTH, NULL, "2.10"},
{0}
};
/* *** Device.MQTT.Broker. *** */
DMOBJ tMQTTObj[] = {
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
{"Broker", &DMWRITE, addMQTTBroker, delMQTTBroker, NULL, browseMQTTBrokerInst, NULL, NULL, NULL, tMQTTBrokerParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", "Name", NULL}, "2.10"},
{0}
};
DMLEAF tMQTTParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{"BrokerNumberOfEntries", &DMREAD, DMT_UNINT, get_MQTT_BrokerNumberOfEntries, NULL, BBFDM_BOTH, "2.10"},
{0}
};
DMLEAF tMQTTBrokerParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{"Enable", &DMWRITE, DMT_BOOL, get_MQTTBroker_Enable, set_MQTTBroker_Enable, BBFDM_BOTH, "2.10"},
{"Alias", &DMWRITE, DMT_STRING, get_MQTTBroker_Alias, set_MQTTBroker_Alias, BBFDM_BOTH, "2.10"},
{"Name", &DMWRITE, DMT_STRING, get_MQTTBroker_Name, set_MQTTBroker_Name, BBFDM_BOTH, "2.10"},
//{"Status", &DMREAD, DMT_STRING, get_MQTTBroker_Status, NULL, BBFDM_BOTH, "2.10"},
{"Port", &DMWRITE, DMT_UNINT, get_MQTTBroker_Port, set_MQTTBroker_Port, BBFDM_BOTH, "2.10"},
{"Interface", &DMWRITE, DMT_STRING, get_MQTTBroker_Interface, set_MQTTBroker_Interface, BBFDM_BOTH, "2.10"},
{"Username", &DMWRITE, DMT_STRING, get_MQTTBroker_Username, set_MQTTBroker_Username, BBFDM_BOTH, "2.10"},
{"Password", &DMWRITE, DMT_STRING, get_MQTTBroker_Password, set_MQTTBroker_Password, BBFDM_BOTH, "2.10"},
{0}
};

20
mqttmngr/src/mqtt.h Normal file
View File

@@ -0,0 +1,20 @@
/*
* Copyright (C) 2022 iopsys Software Solutions AB
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation
*
* Author: Suvendhu Hansa <suvendhu.hansa@iopsys.eu>
*/
#ifndef _MQTT_H
#define _MQTT_H
#include "libbbf_api/dmcommon.h"
extern DMOBJ tDeviceMQTTObj[];
extern DMOBJ tMQTTObj[];
extern DMLEAF tMQTTParams[];
extern DMLEAF tMQTTBrokerParams[];
#endif

View File

@@ -20,7 +20,7 @@ config OBUSPA_MTP_ENABLE_STOMP
config OBUSPA_MTP_ENABLE_COAP
bool "Enable CoAP as mtp protocol"
default n
default y
config OBUSPA_CONTROLLER_MTP_VERIFY
bool "Enable verification of MQTT response topic before processing the message"

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=obuspa
PKG_VERSION:=6.0.0.1
PKG_VERSION:=6.0.0.11
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/obuspa.git
PKG_SOURCE_VERSION:=6372841ada18a4f577799fedb19f489ec1f28255
PKG_SOURCE_VERSION:=668748cd4801aa5af12d61d9b0837064b9f933cc
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
@@ -91,6 +91,7 @@ endif
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/obuspa/* $(PKG_BUILD_DIR)/
$(Build/Patch)
endef
endif

View File

@@ -2,7 +2,7 @@ config obuspa 'global'
option enabled '1'
option debug '1'
option log_level '1'
option prototrace '1'
option prototrace '0'
option db_file '/etc/obuspa/usp.db'
#option role_file '/etc/obuspa/roles.json'
option dm_caching_exclude '/etc/obuspa/dmcaching_exclude.json'

View File

@@ -1,14 +1,14 @@
#!/bin/sh /etc/rc.common
START=99
STOP=2
STOP=02
USE_PROCD=1
PROG=/usr/sbin/obuspa
CONFIGURATION=obuspa
ENV_PROFILE="/root/.profile"
KEEP_FILES="/lib/upgrade/keep.d/obuspa"
KEEP_FILE="/lib/upgrade/keep.d/obuspa"
RESET_FILE="/tmp/obuspa/obuspa_param_reset.txt"
SQL_DB_FILE="/tmp/obuspa/usp.db"
@@ -59,6 +59,17 @@ db_set_sql()
fi
}
db_del_sql()
{
local param
param="${1}"
if [ -n "${param}" ]; then
${PROG} -f ${SQL_DB_FILE} -c dbdel "${param}" >/dev/null 2>&1
fi
}
db_set()
{
# if sql db present, update sql db
@@ -70,6 +81,14 @@ db_set()
fi
}
update_db_dump()
{
if [ -f "${DB_DUMP}" ]; then
rm ${DB_DUMP}
${PROG} -f ${SQL_DB_FILE} -c show database |sort > ${DB_DUMP}
fi
}
# if db present then check if it matches with existing instances
# fallback to max instance present + 1
# In case of no db get the count
@@ -112,8 +131,8 @@ get_refrence_path()
value="${2}"
path=""
if [ -f "${SQL_DB_FILE}" ]; then
path=$(${PROG} -f ${SQL_DB_FILE} -c show database |grep "${dmref}\d.Alias "|grep -w "${value}")
if [ -f "${DB_DUMP}" ]; then
path=$(grep "${dmref}\d.Alias " ${DB_DUMP}|grep -w "${value}")
elif [ -f "${RESET_FILE}" ]; then
path=$(grep "${dmref}\d.Alias " ${RESET_FILE}|grep -w "${value}")
fi
@@ -123,14 +142,18 @@ get_refrence_path()
update_keep()
{
keep_file=${1}
file=${1}
if [ -z "${keep_file}" ]; then
if [ -z "${file}" ]; then
return;
fi
if ! grep -q "${keep_file}" ${KEEP_FILES}; then
echo "${keep_file}" >> ${KEEP_FILES}
if [ ! -f "${KEEP_FILE}" ]; then
touch "${KEEP_FILE}"
fi
if ! grep -q "${file}" ${KEEP_FILE}; then
echo "${file}" >> ${KEEP_FILE}
fi
}
@@ -200,13 +223,15 @@ validate_controller_section()
'Enable:bool:1' \
'EndpointID:string' \
'assigned_role_name:string' \
'AssignedRole:string' \
'Protocol:or("STOMP","CoAP","MQTT", "WebSocket")' \
'Destination:string' \
'Topic:string' \
'ParameterName:list(string)' \
'Reference:string' \
'mqtt:string' \
'stomp:string' \
'Host:host' \
'Host:string' \
'Port:port' \
'Path:string' \
'EnableEncryption:bool'
@@ -218,7 +243,7 @@ validate_subscription_section()
'Enable:bool:1' \
'NotifType:or("ValueChange","ObjectCreation","ObjectDeletion","OperationComplete","Event")' \
'ReferenceList:list(string)' \
'Persistent:bool:1' \
'Recipient:string' \
'controller:string'
}
@@ -233,6 +258,7 @@ validate_mtp_section()
'Path:string' \
'mqtt:string' \
'stomp:string' \
'Reference:string' \
'EnableEncryption:bool'
}
@@ -240,7 +266,7 @@ validate_stomp_connection_section()
{
uci_validate_section ${CONFIGURATION} stomp "${1}" \
'Enable:bool:1' \
'Host:host' \
'Host:string' \
'Port:port:61613' \
'Username:string' \
'Password:string' \
@@ -253,7 +279,7 @@ validate_mqtt_client_section()
{
uci_validate_section ${CONFIGURATION} mqtt "${1}" \
'Enable:bool:1' \
'BrokerAddress:host' \
'BrokerAddress:string' \
'BrokerPort:port:1883' \
'Username:string' \
'Password:string' \
@@ -289,7 +315,6 @@ publish_endpoint()
local AgentEndpointID serial oui user pass
if ! uci -q get obuspa.localmqtt; then
log "Remote mqtt broker configured, skip publishing endpoint"
return 0;
fi
@@ -335,6 +360,7 @@ configure_localagent()
}
db_set Device.LocalAgent.EndpointID "${EndpointID}"
update_db_dump
}
update_reset_reason()
@@ -350,16 +376,18 @@ configure_controller()
{
local EndpointID Enable
local Protocol Destination
local Topic mqtt stomp assigned_role_name ParameterName
local Host Port Path EnableEncryption
local dm_ref
local Topic mqtt stomp assigned_role_name AssignedRole ParameterName
local Host Port Path EnableEncryption Reference
local dm_ref sec
sec="${1}"
validate_controller_section "${1}" || {
log "Validation of controller section failed"
return 1;
}
get_base_path "Device.LocalAgent.Controller." "uci-${1}"
sec="${sec/controller_/cpe-}"
get_base_path "Device.LocalAgent.Controller." "${sec}"
if [ -z "${BASEPATH}" ]; then
log "Failed to get path [$BASEPATH]"
return 1;
@@ -371,21 +399,30 @@ configure_controller()
fi
dm_ref=""
if [ "${Protocol}" = "STOMP" ]; then
dm_ref=$(get_refrence_path "Device.STOMP.Connection." "uci-${stomp}")
elif [ "${Protocol}" = "MQTT" ]; then
dm_ref=$(get_refrence_path "Device.MQTT.Client." "uci-${mqtt}")
if [ -z "${Reference}" ]; then
if [ "${Protocol}" = "STOMP" ]; then
stomp="${stomp/stomp_/cpe-}"
dm_ref=$(get_refrence_path "Device.STOMP.Connection." "${stomp}")
elif [ "${Protocol}" = "MQTT" ]; then
mqtt="${mqtt/mqtt_/cpe-}"
dm_ref=$(get_refrence_path "Device.MQTT.Client." "${mqtt}")
fi
else
dm_ref="${Reference}"
fi
db_set "${BASEPATH}.Alias" "uci-${1}"
db_set "${BASEPATH}.Alias" "${sec}"
db_set "${BASEPATH}.Enable" "${Enable}"
db_set "${BASEPATH}.EndpointID" "${EndpointID}"
if [ -n "${assigned_role_name}" ]; then
AssignedRole=$(get_role_index "${assigned_role_name}")
fi
if [ -n "${AssignedRole}" ]; then
db_set "${BASEPATH}.AssignedRole" "${AssignedRole}"
fi
db_set "${BASEPATH}.MTP.1.Alias" "uci-${1}"
db_set "${BASEPATH}.MTP.1.Alias" "${sec}"
db_set "${BASEPATH}.MTP.1.Enable" "${Enable}"
db_set "${BASEPATH}.MTP.1.Protocol" "${Protocol}"
# only support configuration of one mtp path per controller using uci
@@ -412,36 +449,41 @@ configure_controller()
for param in ${ParameterName}
do
db_set "${BASEPATH}.BootParameter.${_pnum}.Alias" "uci-${1}-${_pnum}"
db_set "${BASEPATH}.BootParameter.${_pnum}.Alias" "${sec}_boot_${_pnum}"
db_set "${BASEPATH}.BootParameter.${_pnum}.Enable" "${Enable}"
db_set "${BASEPATH}.BootParameter.${_pnum}.ParameterName" "${param}"
_pnum=$(( _pnum + 1 ))
done
db_set
update_db_dump
}
configure_subscription()
{
local Enable NotifType ReferenceList Persistent controller
local Enable NotifType ReferenceList controller
local dm_ref
local sec
sec="${1}"
validate_subscription_section "${1}" || {
log "Validation of subscription section failed"
return 1;
}
get_base_path "Device.LocalAgent.Subscription." "uci-${1}"
sec="${sec/sub_/cpe-}"
get_base_path "Device.LocalAgent.Subscription." "sub_${1}"
if [ -z "${BASEPATH}" ]; then
log "Failed to get path [$BASEPATH]"
return 1;
fi
if [ -n "${controller}" ]; then
dm_ref=$(get_refrence_path "Device.LocalAgent.Controller." "uci-${controller}")
controller="${controller/controller_/cpe-}"
dm_ref=$(get_refrence_path "Device.LocalAgent.Controller." "${controller}")
fi
db_set "${BASEPATH}.Alias" "uci-${1}"
db_set "${BASEPATH}.Alias" "${sec}"
db_set "${BASEPATH}.ID" "uci-${1}"
db_set "${BASEPATH}.CreationDate" "$(date -I'seconds')"
db_set "${BASEPATH}.Enable" "${Enable}"
@@ -450,8 +492,10 @@ configure_subscription()
ReferenceList=${ReferenceList// /,}
db_set "${BASEPATH}.ReferenceList" "${ReferenceList}"
fi
db_set "${BASEPATH}.Persistent" "${Persistent}"
db_set "${BASEPATH}.Persistent" "1"
db_set "${BASEPATH}.Recipient" "${dm_ref}"
# Entry updated in db, remove uci entry
uci_remove obuspa "${1}"
}
check_json_load()
@@ -488,8 +532,7 @@ get_role_index()
*)
local ji=0
check_json_load
if [ "$?" -eq "0" ]; then
if check_json_load; then
ji=$(get_role_index_from_json "${role_name}" "${role_def_file}")
fi
idx=$(( ji + 2 )) # Add predefined roles
@@ -501,13 +544,16 @@ get_role_index()
configure_challenges()
{
local Enable Description role_name Role Value Retries LockoutPeriod
local sec
sec="${1}"
validate_challenge_section "${1}" || {
log "Validation of challenge section failed"
exit 1;
}
get_base_path "Device.LocalAgent.ControllerTrust.Challenge." "uci-${1}"
sec="${sec/challenge_/cpe-}"
get_base_path "Device.LocalAgent.ControllerTrust.Challenge." "${sec}"
if [ -z "${BASEPATH}" ]; then
log "Failed to get path [$BASEPATH]"
return 1;
@@ -518,7 +564,7 @@ configure_challenges()
return 1;
fi
db_set "${BASEPATH}.Alias" "uci-${1}"
db_set "${BASEPATH}.Alias" "${sec}"
db_set "${BASEPATH}.Enable" "${Enable}"
db_set "${BASEPATH}.Description" "${Description}"
@@ -530,19 +576,22 @@ configure_challenges()
db_set "${BASEPATH}.Value" "${Value}"
db_set "${BASEPATH}.Retries" "${Retries}"
db_set "${BASEPATH}.LockoutPeriod" "${LockoutPeriod}"
# Entry updated in db, remove uci entry
uci_remove obuspa "${1}"
}
configure_mtp() {
local Enable Protocol ResponseTopicConfigured
local Path Port EnableEncryption
local stomp mqtt dm_ref
local stomp mqtt dm_ref sec
sec="${1}"
validate_mtp_section "${1}" || {
log "Validation of mtp section failed"
return 1;
}
get_base_path "Device.LocalAgent.MTP." "uci-${1}"
sec="${sec/mtp_/cpe-}"
get_base_path "Device.LocalAgent.MTP." "${sec}"
if [ -z "${BASEPATH}" ]; then
log "Failed to get path [$BASEPATH]"
return 1;
@@ -554,13 +603,19 @@ configure_mtp() {
fi
dm_ref=""
if [ "${Protocol}" = "STOMP" ]; then
dm_ref=$(get_refrence_path "Device.STOMP.Connection." "uci-${stomp}")
elif [ "${Protocol}" = "MQTT" ]; then
dm_ref=$(get_refrence_path "Device.MQTT.Client." "uci-${mqtt}")
if [ -z "${Reference}" ]; then
if [ "${Protocol}" = "STOMP" ]; then
stomp="${stomp/stomp_/cpe-}"
dm_ref=$(get_refrence_path "Device.STOMP.Connection." "${stomp}")
elif [ "${Protocol}" = "MQTT" ]; then
mqtt="${mqtt/mqtt_/cpe-}"
dm_ref=$(get_refrence_path "Device.MQTT.Client." "${mqtt}")
fi
else
dm_ref="${Reference}"
fi
db_set "${BASEPATH}.Alias" "uci-${1}"
db_set "${BASEPATH}.Alias" "${sec}"
db_set "${BASEPATH}.Enable" "${Enable}"
db_set "${BASEPATH}.Protocol" "${Protocol}"
if [ "${Protocol}" = "MQTT" ]; then
@@ -578,24 +633,28 @@ configure_mtp() {
db_set "${BASEPATH}.WebSocket.EnableEncryption" "${EnableEncryption}"
fi
db_set
update_db_dump
}
configure_stomp_connection() {
local Host Username Password Enable Port VirtualHost
local EnableEncryption EnableHeartbeats
local sec
sec="${1}"
validate_stomp_connection_section "${1}" || {
log "Validation of stomp section failed"
return 1;
}
get_base_path "Device.STOMP.Connection." "uci-${1}"
sec="${sec/stomp_/cpe-}"
get_base_path "Device.STOMP.Connection." "${sec}"
if [ -z "${BASEPATH}" ]; then
log "Failed to get path [$BASEPATH]"
return 1;
fi
db_set "${BASEPATH}.Alias" "uci-${1}"
db_set "${BASEPATH}.Alias" "${sec}"
db_set "${BASEPATH}.Host" "${Host}"
db_set "${BASEPATH}.Username" "${Username}"
db_set "${BASEPATH}.Password" "${Password}"
@@ -606,24 +665,28 @@ configure_stomp_connection() {
db_set "${BASEPATH}.EnableHeartbeats" "${EnableHeartbeats}"
db_set "${BASEPATH}.VirtualHost" "${VirtualHost}"
db_set
update_db_dump
}
configure_mqtt_client(){
configure_mqtt_client() {
local BrokerAddress BrokerPort Enable Username Password ProtocolVersion
local TransportProtocol ClientID
local sec
sec="${1}"
validate_mqtt_client_section "${1}" || {
log "Validation of mqtt section failed"
return 1;
}
get_base_path "Device.MQTT.Client." "uci-${1}"
sec="${sec/mqtt_/cpe-}"
get_base_path "Device.MQTT.Client." "${sec}"
if [ -z "${BASEPATH}" ]; then
log "Failed to get path [$BASEPATH]"
return 1;
fi
db_set "${BASEPATH}.Alias" "uci-${1}"
db_set "${BASEPATH}.Alias" "${sec}"
db_set "${BASEPATH}.Enable" "${Enable}"
db_set "${BASEPATH}.BrokerAddress" "${BrokerAddress}"
db_set "${BASEPATH}.BrokerPort" "${BrokerPort}"
@@ -634,6 +697,7 @@ configure_mqtt_client(){
db_set "${BASEPATH}.ClientID" "${ClientID}"
db_set
update_db_dump
}
@@ -705,21 +769,277 @@ configure_obuspa() {
fi
}
get_instances_from_db_dump()
{
local obj inst
obj="${1}\d"
if [ ! -f "${DB_DUMP}" ]; then
echo ""
return 0;
fi
inst="$(grep -oe "${obj}" "${DB_DUMP}"|uniq)"
echo "$inst"
}
get_param_value_from_dump()
{
local param value
param="${1}"
if [ -z "${param}" ] || [ ! -f "${DB_DUMP}" ]; then
log "error getting param"
echo ""
return 0
fi
value="$(grep "^${param} " ${DB_DUMP}|awk '{print $3}')"
echo "$value"
}
update_uci_sec()
{
local sec tmp
sec="${1}"
stype="${2}"
if [ -z "$sec" ] || [ -z "$stype" ]; then
log "No section name, error"
return 0
fi
tmp="$(uci_get obuspa "${sec}")"
if [ "$tmp" != "$stype" ]; then
uci_add obuspa "${stype}" "${sec}"
fi
}
sync_db_controller()
{
local cntrs copts sec pvalue protocol
copts="Enable EndpointID AssignedRole"
popts="Destination Topic Reference Host Port Path EnableEncryption"
cntrs="$(get_instances_from_db_dump Device.LocalAgent.Controller.)"
for cntr in $cntrs; do
sec="$(get_param_value_from_dump "${cntr}".Alias)"
sec="${sec/cpe-/controller_}"
sec="${sec/-/_}"
update_uci_sec "${sec}" controller
for param in ${copts}; do
pvalue="$(get_param_value_from_dump "${cntr}"."${param}")"
uci_set obuspa "${sec}" "${param}" "${pvalue}"
done
uci_set obuspa "${sec}" "_sync" "1"
protocol="$(get_param_value_from_dump "${cntr}".MTP.1.Protocol)"
if [ -z "${protocol}" ]; then
break;
fi
uci_set obuspa "${sec}" "Protocol" "${protocol}"
for param in ${popts}; do
pvalue="$(get_param_value_from_dump "${cntr}".MTP.1."${protocol}"."${param}")"
uci_set obuspa "${sec}" "${param}" "${pvalue}"
done
done
}
sync_db_localagent_mtp()
{
local mtps opts popts sec pvalue protocol
opts="Enable"
popts="ResponseTopicConfigured Destination Port Path Reference EnableEncryption"
ropts="mqtt stomp"
mtps="$(get_instances_from_db_dump Device.LocalAgent.MTP.)"
for inst in $mtps; do
sec="$(get_param_value_from_dump "${inst}".Alias)"
sec="${sec/cpe-/mtp_}"
sec="${sec/-/_}"
update_uci_sec "${sec}" mtp
for param in ${opts}; do
pvalue="$(get_param_value_from_dump "${inst}"."${param}")"
uci_set obuspa "${sec}" "${param}" "${pvalue}"
done
uci_set obuspa "${sec}" "_sync" "1"
protocol="$(get_param_value_from_dump "${inst}".Protocol)"
if [ -z "${protocol}" ]; then
break;
fi
uci_set obuspa "${sec}" "Protocol" "${protocol}"
for param in ${popts}; do
pvalue="$(get_param_value_from_dump "${inst}"."${protocol}"."${param}")"
uci_set obuspa "${sec}" "${param}" "${pvalue}"
done
for param in ${ropts}; do
uci_set obuspa "${sec}" "${param}" ""
done
done
}
sync_db_mqtt_client()
{
local mtps copts sec pvalue protocol
opts="Enable BrokerAddress BrokerPort Username ProtocolVersion TransportProtocol ClientID"
mtps="$(get_instances_from_db_dump Device.MQTT.Client.)"
for inst in $mtps; do
sec="$(get_param_value_from_dump "${inst}".Alias)"
sec="${sec/cpe-/mqtt_}"
sec="${sec/-/_}"
update_uci_sec "${sec}" mqtt
for param in ${opts}; do
pvalue="$(get_param_value_from_dump "${inst}"."${param}")"
uci_set obuspa "${sec}" "${param}" "${pvalue}"
done
uci_set obuspa "${sec}" "_sync" "1"
done
}
sync_db_stomp_connection()
{
local mtps copts sec pvalue protocol
opts="Enable Host Port Username EnableEncryption EnableHeartbeats VirtualHost"
mtps="$(get_instances_from_db_dump Device.STOMP.Connection.)"
for inst in $mtps; do
sec="$(get_param_value_from_dump "${inst}".Alias)"
sec="${sec/cpe-/stomp_}"
sec="${sec/-/_}"
update_uci_sec "${sec}" stomp
for param in ${opts}; do
pvalue="$(get_param_value_from_dump "${inst}"."${param}")"
uci_set obuspa "${sec}" "${param}" "${pvalue}"
done
uci_set obuspa "${sec}" "_sync" "1"
done
}
sync_update_sec()
{
local _sync
config_get _sync "${1}" _sync ""
if [ -z "${_sync}" ]; then
uci_remove obuspa "${1}"
else
uci_remove obuspa "${1}" _sync
fi
}
sync_uci_with_db()
{
if [ ! -f "${DB_DUMP}" ]; then
return 0;
fi
config_load obuspa
sync_db_controller
sync_db_localagent_mtp
sync_db_mqtt_client
sync_db_stomp_connection
uci_commit obuspa
config_load obuspa
config_foreach sync_update_sec controller
config_foreach sync_update_sec mtp
config_foreach sync_update_sec mqtt
config_foreach sync_update_sec stomp
uci_commit obuspa
}
delete_sql_db_entry_with_pattern()
{
local params pattern
pattern="${1}"
if [ ! -f "${DB_DUMP}" ]; then
return 0;
fi
if [ "${#pattern}" -lt 7 ]; then
return 0;
fi
params="$(grep ${pattern} ${DB_DUMP}|awk '{print $1}')"
for p in ${params}; do
db_del_sql "${p}"
done
}
check_n_delete_db()
{
local sec t r path
sec="${1}"
if uci -q get obuspa.${sec} >/dev/null 2>&1; then
return 0
fi
t="${2}"
r="${3}"
sec="${sec/${t}_/cpe-}"
path=$(grep "${r}\d.Alias => ${sec}" ${DB_DUMP})
path=${path%.*}
delete_sql_db_entry_with_pattern "${path}"
}
reverse_update_db_with_uci()
{
if [ ! -f "${DB_DUMP}" ]; then
return 0;
fi
export UCI_CONFIG_DIR="/tmp/obuspa"
config_load obuspa
config_foreach check_n_delete_db controller controller "Device.LocalAgent.Controller."
config_foreach check_n_delete_db mtp mtp "Device.LocalAgent.MTP."
config_foreach check_n_delete_db mqtt mqtt "Device.MQTT.Client."
config_foreach check_n_delete_db stomp stomp "Device.STOMP.Connection."
unset UCI_CONFIG_DIR
}
# Create factory reset file
db_init()
{
local reason
reason="${1}"
mkdir -p /tmp/obuspa/
# Load configuration
config_load $CONFIGURATION
config_get SQL_DB_FILE global db_file "/tmp/obuspa/usp.db"
# Dump datamodel parameters from DB
if [ -f "${SQL_DB_FILE}" ]; then
${PROG} -f ${SQL_DB_FILE} -c show database > ${DB_DUMP}
${PROG} -f ${SQL_DB_FILE} -c show database |sort > ${DB_DUMP}
fi
# Only sync uci with db in case of non service triggers
if [ -f "${DB_DUMP}" ] && [ "${reason}" != "update" ]; then
sync_uci_with_db
fi
# remove entries from db if deleted from uci
if [ -f "${DB_DUMP}" ] && [ "${reason}" == "update" ] && [ -f "/tmp/obuspa/obuspa" ]; then
reverse_update_db_with_uci
fi
# Remove reset file if present
[ -f "${RESET_FILE}" ] && rm -f ${RESET_FILE}
config_load $CONFIGURATION
global_init
config_foreach configure_localagent localagent
global_init
@@ -736,6 +1056,9 @@ db_init()
config_foreach configure_challenges challenge
global_init
update_reset_reason
uci_commit ${CONFIGURATION}
cp /etc/config/obuspa /tmp/obuspa/
[ -f "${DB_DUMP}" ] && rm -f ${DB_DUMP}
@@ -771,7 +1094,7 @@ start_service() {
fi
mkdir -p /tmp/obuspa/
db_init
db_init "${1}"
register_service
}
@@ -781,7 +1104,7 @@ stop_service() {
reload_service() {
stop
start
start update
}
service_triggers() {
@@ -801,7 +1124,7 @@ service_triggers() {
json_add_array
json_add_string "" "run_script"
json_add_string "" "/etc/init.d/obuspa"
json_add_string "" "reload"
json_add_string "" "restart"
json_close_array
json_close_array
json_add_int "" "2000"

View File

@@ -1,7 +1,8 @@
{
"dmcaching_exclude": [
"Device.DeviceInfo.ProcessStatus.Process.",
"Device.InterfaceStack.",
"Device.Hosts.Host.",
"Device.IEEE1905.",
"Device.WiFi.DataElements."
]
}

View File

@@ -0,0 +1,49 @@
diff --git a/src/core/cli_server.c b/src/core/cli_server.c
index 701cbd9..103361e 100644
--- a/src/core/cli_server.c
+++ b/src/core/cli_server.c
@@ -733,10 +733,6 @@ int ExecuteCli_Get(char *arg1, char *arg2, char *usage)
USP_ASSERT(gge->value != NULL);
SendCliResponse("%s => %s\n", gge->path, gge->value);
}
- else
- {
- SendCliResponse("ERROR: %d retrieving %s (%s)\n", gge->err_code, gge->path, gge->err_msg);
- }
}
GROUP_GET_VECTOR_Destroy(&ggv);
diff --git a/src/core/handle_get.c b/src/core/handle_get.c
index e1055e0..16b9ceb 100755
--- a/src/core/handle_get.c
+++ b/src/core/handle_get.c
@@ -260,26 +260,16 @@ void FormPathExprResponse(int get_expr_index, char *path_expr, get_expr_info_t *
return;
}
- // If there was an error in getting any of the parameters associated with the path expression,
- // then just add the first error, without any of the parameter values, for this path expression result
- for (i=0; i < gi->num_entries; i++)
- {
- gge = &ggv->vector[gi->index + i];
- if (gge->err_code != USP_ERR_OK)
- {
- (void)AddGetResp_ReqPathRes(resp, path_expr, gge->err_code, gge->err_msg);
- return;
- }
- }
-
// If the code gets here, then the value of all parameters were retrieved successfully, so add their values to the result_params
req_path_result = AddGetResp_ReqPathRes(resp, path_expr, USP_ERR_OK, "");
for (i=0; i < gi->num_entries; i++)
{
gge = &ggv->vector[gi->index + i];
- // Simple format contains a resolved_path_result for every object (and sub object)
- AddResolvedPathResult(req_path_result, gge->path, gge->value);
+ if (gge->err_code == USP_ERR_OK) {
+ // Simple format contains a resolved_path_result for every object (and sub object)
+ AddResolvedPathResult(req_path_result, gge->path, gge->value);
+ }
}
}

View File

@@ -0,0 +1,43 @@
--- a/src/core/cli_server.c
+++ b/src/core/cli_server.c
@@ -787,6 +787,7 @@ int ExecuteCli_Set(char *arg1, char *arg
goto exit;
}
+ SetControllerRoleForInternal();
// Iterate over all objects to set
for (i=0; i < objects.num_entries; i++)
{
--- a/src/core/data_model.h
+++ b/src/core/data_model.h
@@ -324,6 +324,7 @@ void DATA_MODEL_DumpSchema(void);
void DATA_MODEL_DumpInstances(void);
char DATA_MODEL_GetJSONParameterType(char *path);
int DATA_MODEL_SetParameterInDatabase(char *path, char *value);
+void SetControllerRoleForInternal();
int DM_PRIV_InitSetRequest(dm_req_t *req, dm_node_t *node, char *path, dm_instances_t *inst, char *new_value);
void DM_PRIV_RequestInit(dm_req_t *req, dm_node_t *node, char *path, dm_instances_t *inst);
--- a/src/core/msg_handler.c
+++ b/src/core/msg_handler.c
@@ -839,6 +839,20 @@ char *MtpSendItemToString(mtp_send_item_
/*********************************************************************//**
**
+** SetControllerRoleForInternal
+**
+** Sets the role for internal user
+**
+**
+**************************************************************************/
+void SetControllerRoleForInternal()
+{
+ cur_msg_combined_role.inherited = kCTrustRole_Untrusted;
+ cur_msg_combined_role.assigned = kCTrustRole_FullAccess;
+}
+
+/*********************************************************************//**
+**
** CacheControllerRoleForCurMsg
**
** Retrieves the role to use for the specified controller, and caches it locally, so that

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=owsd
PKG_VERSION:=1.1.4
PKG_VERSION:=1.1.5
PKG_RELEASE:=1
PKG_SOURCE_PROTO=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/owsd.git
PKG_SOURCE_VERSION:=e37c6f9d708c454c802eede814cc51fb89c919e9
PKG_SOURCE_VERSION:=d866ee2a96f5b75b3f45b0e1d655431184e8032d
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}

View File

@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=periodicstats
PKG_VERSION:=1.2.0
PKG_VERSION:=1.2.1
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
@@ -20,15 +20,13 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=bbf
include $(INCLUDE_DIR)/package.mk
define Package/periodicstats
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Periodic Statistics Daemon
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbf_api
endef
define Package/periodicstats/description

View File

@@ -18,7 +18,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/ponmngr
CATEGORY:=Utilities
TITLE:=PON Manager
DEPENDS:=@(TARGET_iopsys_brcm63xx_arm||TARGET_iopsys_econet)
DEPENDS:=@(TARGET_brcmbca||TARGET_airoha)
endef
define Package/ponmngr/description
@@ -34,9 +34,9 @@ endef
define Package/ponmngr/install
$(CP) ./files/common/* $(1)/
ifneq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),)
ifneq ($(CONFIG_TARGET_brcmbca),)
$(CP) ./files/broadcom/* $(1)/
else ifneq ($(CONFIG_TARGET_iopsys_econet),)
else ifneq ($(CONFIG_TARGET_airoha),)
$(CP) ./files/airoha/* $(1)/
endif
endef

View File

@@ -10,6 +10,9 @@ set_serial_number() {
}
init_xpon() {
# don't start pon daemons if xpon module is not loaded
[ -d /sys/module/xpon ] || return
procd_open_instance ponmgr_cfg
procd_set_param command /userfs/bin/ponmgr_cfg
procd_close_instance

View File

@@ -9,14 +9,16 @@ USE_PROCD=1
include /lib/xpon
configure_serial_number() {
# serial number generation is taken care in the uci defaults, so if
# serial number is not found here its a misconfig
serial_number="$(uci -q get xpon.ani.serial_number)"
if [ ${#serial_number} -eq 12 ]; then
vendor_id="${serial_number:0:4}"
vssn="${serial_number:4:8}"
else
macaddr="$(fw_printenv -n ethaddr | tr -d ':' | tr 'a-z' 'A-Z')"
vendor_id="IOPS"
vssn="${macaddr:4:8}"
logger -s -t "xpon" "Serial number not found in uci, ont will probably not be registered at the olt"
logger -s -t "xpon" "Please configure a valid serial number"
return
fi
set_serial_number $vendor_id $vssn

View File

@@ -1,17 +1,34 @@
#!/bin/sh
configure_serial_number() {
# check if serial number is present in the production data
production_sn="$(fw_printenv -n gponsn)"
if [ ${#production_sn} -eq 12 ]; then
uci set xpon.ani.serial_number=$production_sn
else
macaddr="$(fw_printenv -n ethaddr | tr -d ':' | tr 'a-z' 'A-Z')"
vendor_id="IOPS"
vssn="${macaddr:4:8}"
uci set xpon.ani.serial_number=$vendor_id$vssn
fi
}
if [ -s "/etc/config/xpon" ]; then
if uci -q get xpon.ani >/dev/null; then
# return if there is any valid content
# generate serial number in case its not present and return
serial_number="$(uci -q get xpon.ani.serial_number)"
if [ ${#serial_number} -ne 12 ]; then
configure_serial_number
fi
exit
else
rm -f /etc/config/xpon
fi
fi
touch /etc/config/xpon
uci set xpon.ani=ani
uci set xpon.ani.enable="1"
uci commit xpon
configure_serial_number

View File

@@ -27,7 +27,7 @@ define Package/qosmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=QoS Manager
DEPENDS:=@(TARGET_iopsys_brcm63xx_arm||TARGET_iopsys_econet) +libuci +libubox +libubus +libblobmsg-json +libjson-c +libqos
DEPENDS:=@(TARGET_brcmbca||TARGET_airoha) +libuci +libubox +libubus +libblobmsg-json +libjson-c +libqos
endef
define Package/qosmngr/description
@@ -40,11 +40,24 @@ define Build/Prepare
endef
endif
define Package/qosmngr/install
$(CP) ./files/* $(1)/
define Package/qosmngr/install/common
$(CP) ./files/common/* $(1)/
$(INSTALL_DIR) $(1)/usr
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/qosmngr $(1)/usr/sbin
endef
ifeq ($(CONFIG_TARGET_brcmbca),y)
define Package/qosmngr/install
$(CP) ./files/broadcom/* $(1)/
$(call Package/qosmngr/install/common,$(1))
endef
endif
ifeq ($(CONFIG_TARGET_airoha),y)
define Package/qosmngr/install
$(CP) ./files/airoha/* $(1)/
$(call Package/qosmngr/install/common,$(1))
endef
endif
$(eval $(call BuildPackage,qosmngr))

View File

@@ -0,0 +1,48 @@
#!/bin/sh
. /lib/functions.sh
ethwan="$(db -q get hw.board.ethernetWanPort)"
generate_queue(){
section="$1"
config_get ifname "$section" "ifname"
if [ "$ifname" != "$ethwan" ]; then
return 0
fi
# guaranteed number of queues
no_of_q="0 1 2 3"
i=0
local total_q=$((${no_of_q##* } + 1))
for i in $no_of_q; do
order=$((total_q - i))
uci add qos queue
uci rename qos.@queue[-1]="q_${i}_${ifname}"
uci set qos.@queue[-1].enable="1"
uci set qos.@queue[-1].ifname="$ifname"
uci set qos.@queue[-1].precedence="$order"
uci set qos.@queue[-1].scheduling="SP"
uci set qos.@queue[-1].rate="0"
uci set qos.@queue[-1].burst_size="0"
uci set qos.@queue[-1].weight="1"
done
uci commit qos
}
if [ -s "/etc/config/qos" ]; then
if uci -q get qos.@queue[0] >/dev/null; then
# return if there is any valid content
exit
else
rm -f /etc/config/qos
fi
fi
touch /etc/config/qos
config_load ports
config_foreach generate_queue ethport

View File

@@ -0,0 +1,190 @@
#!/bin/sh
# Implementation of QoS setup for Econet platform.
errmsg() {
echo "$@" >&2
return 0
}
get_var() {
local varname="$1"
eval echo \$\{${varname}\}
return 0
}
# Initialized queues
# (Not needed on Econet)
hw_queue_init_all() {
return 0
}
# Initialize all interfaces
# (Not needed on Econet)
hw_intf_init() {
return 0
}
# Initialize the hardware setup library
hw_init_all() {
export TMP_HW_QUEUE_LIST=""
export TMP_HW_QUEUE_MASK="0"
return 0
}
# Remember selected queue options. They will be committed
# during hw_commit_all()
hw_queue_set() {
local ifname="$1"
local q_count="$2"
local order="$3"
local qsize="$4"
local wgt="$5"
local sc_alg="$6"
local rate="$7"
local burstsize="$8"
local index="$((order - 1))"
local ethwan="$(db -q get hw.board.ethernetWanPort)"
#if [ "${ifname}" != "${ethwan}" ] ; then
# return 2
#fi
export TMP_HW_QUEUE_${order}_no="${q_count}"
export TMP_HW_QUEUE_${order}_ifname="${ifname}"
export TMP_HW_QUEUE_${order}_order="${order}"
export TMP_HW_QUEUE_${order}_qsize="${qsize}"
export TMP_HW_QUEUE_${order}_wgt="${wgt}"
export TMP_HW_QUEUE_${order}_sc_alg="${sc_alg}"
export TMP_HW_QUEUE_${order}_rate="${rate}"
export TMP_HW_QUEUE_${order}_burstsize="${burstsize}"
export TMP_HW_QUEUE_LIST="${TMP_HW_QUEUE_LIST} ${order}"
export TMP_HW_QUEUE_MASK="$((TMP_HW_QUEUE_MASK | 1 << index))"
return 0
}
# Set policer options. In fact, they are not supported.
hw_policer_set() {
local action="$1"
local dir="$2"
local policer_no="$3"
shift 3
case "$action" in
add)
meter="$1"
cir="$2"
cbs="$3"
ebs="$4"
pir="$5"
pbs="$6"
;;
del)
;;
esac
errmsg "Policer (action $action, direction $dir) is not implemented"
return $?
}
# Set ingress rate. In fact, it is not supported
hw_policer_set_ingress_rate() {
local ifname="$1"
local ingress_rate="$2"
local in_burst_size="$3"
errmsg "Policer (action set_ingress_rate) is not implemented"
}
# Configure shaper rate that will be committed during hw_commit_all()
hw_shaper_set() {
local ifname="$1"
local action="$2"
local rate="$3"
local burstsize="$4"
case "${action}" in
add)
export TMP_HW_SHAPE_RATE="$rate"
export TMP_HW_SHAPE_BURSTSIZE="$burstsize"
;;
del)
export TMP_HW_SHAPE_RATE=""
export TMP_HW_SHAPE_BURSTSIZE=""
;;
*)
return 1
;;
esac
return 0
}
# Convert shaper in UCI terms to Econet terms
hw_sc_alg2str() {
local sc_alg="$1"
case "${sc_alg}" in
SP)
echo "PQ"
;;
WRR)
echo "WRR"
;;
*)
echo ""
return 1
esac
return 0
}
# Commit all options preserved during
hw_commit_all() {
local sorted_list="$(echo $TMP_HW_QUEUE_LIST | tr ' ' '\n' | sort | xargs)"
local weight_list=""
local glob_alg=""
local shape_rate="$TMP_HW_SHAPE_RATE"
local queue_mask="$TMP_HW_QUEUE_MASK"
local q_count="0"
# Reorder queues
for q in ${sorted_list} ; do
local sc_alg="$(get_var TMP_HW_QUEUE_${q}_sc_alg)"
local wgt="$(get_var TMP_HW_QUEUE_${q}_wgt)"
if [ "$glob_alg" != "" ] && [ "$sc_alg" != "$glob_alg" ] ; then
errmsg "Not matching scheduling algorithm: $sc_alg vs $glob_alg"
return 1
fi
glob_alg="$sc_alg"
case "${sc_alg}" in
WRR)
if [ $(($q_count >= 4)) != 0 ] ; then
errmsg "Too many queues, next queues will be ignored"
else
weight_list="$weight_list $wgt"
fi
q_count=$((q_count + 1))
;;
esac
done
if [ "${glob_alg}" == "WRR" ] ; then
while [ $((q_count < 4)) != 0 ] ; do
weight_list="$weight_list 1"
q_count=$((q_count + 1))
done
fi
if [ "${glob_alg}" != "" ] ; then
/userfs/bin/qosrule discpline $(hw_sc_alg2str ${glob_alg}) ${weight_list} \
${shape_rate:+uplink-bandwidth} $shape_rate \
queuemask $queue_mask
else
/userfs/bin/qosrule discpline off
fi
}

View File

@@ -0,0 +1,453 @@
#!/bin/sh
# Install ebtables rules
BR_RULE=""
BR6_RULE=""
init_broute_rule() {
BR_RULE=""
BR6_RULE=""
}
broute_filter_on_src_if() {
BR_RULE="$BR_RULE --in-if $1"
}
broute_filter_on_src_mac() {
BR_RULE="$BR_RULE --src $1"
}
broute_filter_on_dst_mac() {
BR_RULE="$BR_RULE --dst $1"
}
broute_filter_on_pcp() {
case "$BR_RULE" in
*proto*)
BR_RULE="$BR_RULE --vlan-prio $1"
;;
*)
BR_RULE="$BR_RULE --proto 802_1Q --vlan-prio $1"
;;
esac
}
broute_filter_on_ether_type() {
BR_RULE="$BR_RULE --proto $1"
}
broute_filter_on_ether_type6() {
BR6_RULE="$BR6_RULE --proto IPv6"
}
ebt_match_src_ip() {
BR_RULE="$BR_RULE --ip-src $1"
}
ebt_match_dst_ip() {
BR_RULE="$BR_RULE --ip-dst $1"
}
ebt_match_ipv6_src_ip() {
BR_RULE="$BR_RULE --ip6-src $1"
}
ebt_match_ipv6_dst_ip() {
BR_RULE="$BR_RULE --ip6-dst $1"
}
ebt_match_ip_src_port() {
BR_RULE="$BR_RULE --ip-source-port $1"
}
ebt_match_ip_dst_port() {
BR_RULE="$BR_RULE --ip-destination-port $1"
}
ebt_match_ipv6_src_port() {
if [ -n "$BR6_RULE" ]; then
BR6_RULE="$BR6_RULE --ip6-source-port $1"
else
BR_RULE="$BR_RULE --ip6-source-port $1"
fi
}
ebt_match_ipv6_dst_port() {
if [ -n "$BR6_RULE" ]; then
BR6_RULE="$BR6_RULE --ip6-destination-port $1"
else
BR_RULE="$BR_RULE --ip6-destination-port $1"
fi
}
ebt_match_ip_protocol() {
BR_RULE="$BR_RULE --ip-proto $1"
}
ebt_match_ipv6_protocol() {
if [ -n "$BR6_RULE" ]; then
BR6_RULE="$BR6_RULE --ip6-proto $1"
else
BR_RULE="$BR_RULE --ip6-proto $1"
fi
}
ebt_match_ipv6_dscp() {
if [ -n "$BR6_RULE" ]; then
BR6_RULE="$BR6_RULE --ip6-tclass $1"
else
BR_RULE="$BR_RULE --ip6-tclass $1"
fi
}
broute_filter_on_vid() {
if [ -z "$1" ] || [ "$1" -lt 0 ]; then
return
fi
case "$BR_RULE" in
*proto*)
BR_RULE="$BR_RULE --vlan-id $1"
;;
*)
BR_RULE="$BR_RULE --proto 802_1Q --vlan-id $1"
;;
esac
}
broute_rule_set_traffic_class() {
BR_RULE="$BR_RULE -j mark --mark-or 0x$1 --mark-target ACCEPT"
if [ -n "$BR6_RULE" ]; then
BR6_RULE="$BR6_RULE -j mark --mark-or 0x$1 --mark-target ACCEPT"
fi
}
broute_append_rule() {
echo "ebtables -t broute -A qos $BR_RULE" >> /tmp/qos/classify.ebtables
if [ -n "$BR6_RULE" ]; then
echo "ebtables -t broute -A qos $BR6_RULE" >> /tmp/qos/classify.ebtables
fi
}
set_ip_addr()
{
local cid="$1"
local match_src_ip_func="$2"
local match_dst_ip_func="$3"
config_get src_ip "$cid" "src_ip"
config_get dst_ip "$cid" "dest_ip"
if [ -n "$src_ip" ]; then
$match_src_ip_func "$src_ip"
fi
if [ -n "$dst_ip" ]; then
$match_dst_ip_func "$dst_ip"
fi
}
set_ports()
{
local cid="$1"
local match_src_port_func="$2"
local match_dst_port_func="$3"
local src_port=""
local dst_port=""
local src_port_range=""
local dst_port_range=""
config_get src_port "$cid" "src_port"
config_get dst_port "$cid" "dest_port"
config_get src_port_range "$cid" "src_port_range"
config_get dst_port_range "$cid" "dest_port_range"
if [ -n "$src_port" ] && [ -n "$src_port_range" ] ; then
$match_src_port_func "$src_port:$src_port_range"
elif [ -n "$src_port" ] ; then
$match_src_port_func "$src_port"
fi
if [ -n "$dst_port" ] && [ -n "$dst_port_range" ] ; then
$match_dst_port_func "$dst_port:$dst_port_range"
elif [ -n "$dst_port" ] ; then
$match_dst_port_func "$dst_port"
fi
}
protocol_string_to_num()
{
local value="-1"
case "$1" in
*[0-9]*)
value="$1"
;;
TCP|tcp)
value=6
;;
UDP|udp)
value=17
;;
ICMP|icmp)
value=1
;;
ICMPv6|icmpv6)
value=58
;;
IGMP|igmp)
value=2
;;
SCTP|sctp)
value=132
;;
*)
value=-1
;;
esac
echo $value
}
broute_ipv4_rule_options()
{
local cid="$1"
config_get protocol "$cid" "proto"
config_get dscp_filter "$cid" "dscp_filter"
set_ip_addr "$cid" ebt_match_src_ip ebt_match_dst_ip
if [ -n "$dscp_filter" ]; then
echo "DSCP filter is not supporter"
fi
if [ -n "$protocol" ]; then
local proto_num="$(protocol_string_to_num "$protocol")"
ebt_match_ip_protocol "$proto_num"
if [ "$proto_num" == "6" ] || [ "$proto_num" == "17" ] || [ "$proto_num" = "132" ] ; then
set_ports "$cid" ebt_match_ip_src_port ebt_match_ip_dst_port
fi
fi
}
broute_ipv6_rule_options()
{
local cid="$1"
config_get protocol "$cid" "proto"
config_get dscp_filter "$cid" "dscp_filter"
set_ip_addr "$cid" ebt_match_ipv6_src_ip ebt_match_ipv6_dst_ip
if [ -n "$dscp_filter" ]; then
local tos_val
local tos_hex
tos_val=$((dscp_filter<<2))
tos_hex=$(printf "%x" $tos_val)
ebt_match_ipv6_dscp "$tos_hex"
fi
if [ -n "$protocol" ]; then
local proto_num="$(protocol_string_to_num "$protocol")"
ebt_match_ipv6_protocol "$proto_num"
if [ "$proto_num" = "6" ] || [ "$proto_num" = "17" ] || [ "$proto_num" = "132" ] ; then
set_ports "$cid" ebt_match_ipv6_src_port ebt_match_ipv6_dst_port
fi
fi
}
handle_ebtables_rules() {
local sid="$1"
local is_l2_rule=0
local src_dhcp_options=""
local dst_dhcp_options=""
local protocol=""
local ip_version=""
init_broute_rule
config_get src_if "$sid" "ifname"
config_get src_mac "$sid" "src_mac"
config_get dst_mac "$sid" "dst_mac"
config_get dscp_filter "$sid" "dscp_filter"
config_get pcp_check "$sid" "pcp_check"
config_get eth_type "$sid" "ethertype"
config_get vid "$sid" "vid_check"
config_get dhcp_type "$sid" "dhcp_type" # dhcpv4 or v6
config_get src_vcid "$sid" "src_vendor_class_id" # dhcp option 60
config_get dst_vcid "$sid" "dst_vendor_class_id" # dhcp option 60
config_get src_clid "$sid" "src_client_id" # dhcp option 61
config_get dst_clid "$sid" "dst_client_id" # dhcp option 61
config_get src_ucid "$sid" "src_user_class_id" # dhcp option 77
config_get dst_ucid "$sid" "dst_user_class_id" # dhcp option 77
config_get traffic_class "$sid" "traffic_class"
config_get protocol "$sid" "proto"
if [ -n "$src_if" ]; then
for interf in $(db -q get hw.board.ethernetPortOrder); do
if [ "$src_if" == "$interf" ]; then
src_if="$src_if+"
broute_filter_on_src_if "$src_if"
is_l2_rule=1
fi
done
fi
if [ -n "$src_mac" ]; then
broute_filter_on_src_mac "$src_mac"
is_l2_rule=1
fi
if [ -n "$dst_mac" ]; then
broute_filter_on_dst_mac "$dst_mac"
is_l2_rule=1
fi
if [ -n "$pcp_check" ]; then
broute_filter_on_pcp "$pcp_check"
is_l2_rule=1
fi
if [ -n "$eth_type" ]; then
broute_filter_on_ether_type "$eth_type"
is_l2_rule=1
fi
if [ -n "$vid" ]; then
broute_filter_on_vid "$vid"
is_l2_rule=1
fi
case $eth_type in
IPv4|IPV4|0800)
ip_version=4
;;
IPv6|IPV6|86DD)
ip_version=6
;;
*)
if [ -z "$eth_type" ]; then
case "$src_ip$dst_ip" in
*.*)
ip_version=4
broute_filter_on_ether_type "IPv4"
;;
*:*)
ip_version=6
broute_filter_on_ether_type "IPv6"
;;
*)
if [ -n "$protocol" ] || [ -n "$dscp_filter" ]; then
# Neither ether_type nor ip address used,
# ethertype is not configured by user, so install
# both proto IPv4 and IPv6 rule (version 1)
ip_version=1
BR6_RULE="$BR_RULE"
broute_filter_on_ether_type "IPv4"
broute_filter_on_ether_type6 "IPv6"
fi
esac
fi
esac
if [ "$ip_version" == "4" ] || [ "$ip_version" == "1" ]; then
broute_ipv4_rule_options "$sid"
is_l2_rule=1
fi
if [ "$ip_version" == "6" ] || [ "$ip_version" == "1" ]; then
broute_ipv6_rule_options "$sid"
is_l2_rule=1
fi
# first process options that will help figure our source mac address
# dhcp option for "vendor class id"
if [ -n "$src_vcid" ]; then
src_dhcp_options="$src_dhcp_options vcid=$src_vcid"
is_l2_rule=1
fi
# dhcp option for "client id"
if [ -n "$src_clid" ]; then
src_dhcp_options="$src_dhcp_options clid=$src_clid"
is_l2_rule=1
fi
# dhcp option for "user class id"
if [ -n "$src_ucid" ]; then
src_dhcp_options="$src_dhcp_options ucid=$src_ucid"
is_l2_rule=1
fi
# if src mac is already a classification criteria, then it
# does not really make sense to add it as a criteria to
# filter packets again based on source mac
if [ -n "$src_dhcp_options" ] && [ -z "$src_mac" ]; then
comp="$(grep -i "$src_dhcp_options" /tmp/dhcp.client.options)"
if [ -n "$comp" ]; then
s_mac_add="$(echo $comp | head -n1 | awk '{print $1;}')"
if [ -n "$s_mac_add" ]; then
broute_filter_on_src_mac "$s_mac_add"
fi
fi
fi
# Now process options that will help figure our destination mac address
# dhcp option for "vendor class id"
if [ -n "$dst_vcid" ]; then
dst_dhcp_options="$dst_dhcp_options vcid=$dst_vcid"
is_l2_rule=1
fi
# dhcp option for "client id"
if [ -n "$dst_clid" ]; then
dst_dhcp_options="$dst_dhcp_options clid=$dst_clid"
is_l2_rule=1
fi
# dhcp option for "user class id"
if [ -n "$dst_ucid" ]; then
dst_dhcp_options="$dst_dhcp_options ucid=$dst_ucid"
is_l2_rule=1
fi
# if dst mac is already a classification criteria, then it
# does not really make sense to add it as a criteria to
# filter packets again based on destination mac
if [ -n "$dst_dhcp_options" ] && [ -z "$dst_mac" ] ; then
comp="$(grep -i "$dst_dhcp_options" /tmp/dhcp.client.options)"
if [ -n "$comp" ]; then
d_mac_add="$(echo $comp | head -n1 | awk '{print $1;}')"
if [ -n "$d_mac_add" ]; then
broute_filter_on_dst_mac "$d_mac_add"
fi
fi
fi
if [ $is_l2_rule -eq 0 ]; then
return
fi
[ -n "$traffic_class" ] && broute_rule_set_traffic_class "$traffic_class"
[ -n "$BR_RULE" ] && broute_append_rule
}
create_ebtables_chains() {
ebtables -t broute -N qos
ret=$?
if [ $ret -eq 0 ]; then
ebtables -t broute -I BROUTING -j qos
else
ebtables -t broute -D BROUTING -j qos
ebtables -t broute -I BROUTING -j qos
fi
}
flush_ebtables_chains() {
echo "ebtables -t broute -F qos" > /tmp/qos/classify.ebtables
}

View File

@@ -0,0 +1,240 @@
#!/bin/sh
# Install iptables rules
IP_RULE=""
init_iptables_rule() {
IP_RULE=""
}
iptables_filter_intf() {
IP_RULE="$IP_RULE -i $1"
}
iptables_filter_proto() {
IP_RULE="$IP_RULE -p $1"
}
iptables_filter_ip_src() {
IP_RULE="$IP_RULE -s $1"
}
iptables_filter_ip_dest() {
IP_RULE="$IP_RULE -d $1"
}
iptables_filter_port_dest() {
IP_RULE="$IP_RULE --dport $1"
}
iptables_filter_port_src() {
IP_RULE="$IP_RULE --sport $1"
}
iptables_filter_port_dest_range() {
IP_RULE="$IP_RULE --dport $1:$2"
}
iptables_filter_port_src_range() {
IP_RULE="$IP_RULE --sport $1:$2"
}
iptables_filter_dscp_filter() {
IP_RULE="$IP_RULE -m dscp --dscp $1"
}
iptables_filter_ip_len_min() {
IP_RULE="$IP_RULE -m length --length $1"
}
iptables_filter_ip_len_max() {
IP_RULE="$IP_RULE:$1"
}
iptables_set_dscp_mark() {
IP_RULE="$IP_RULE -j DSCP --set-dscp $1"
}
iptables_set_traffic_class() {
IP_RULE="$IP_RULE -j MARK --set-xmark 0x${1}0/0xF0"
}
append_rule_to_mangle_table() {
if [ "$2" == 4 ]; then
echo "iptables -w -t mangle -A $1 $IP_RULE" >> /tmp/qos/classify.iptables
elif [ "$2" == 6 ]; then
echo "ip6tables -w -t mangle -A $1 $IP_RULE" >> /tmp/qos/classify.ip6tables
elif [ "$2" == 1 ]; then
echo "iptables -w -t mangle -A $1 $IP_RULE" >> /tmp/qos/classify.iptables
echo "ip6tables -w -t mangle -A $1 $IP_RULE" >> /tmp/qos/classify.ip6tables
fi
}
handle_iptables_rules() {
local cid="$1"
local ip_version=0
local is_l3_rule=0
init_iptables_rule
config_get proto "$cid" "proto"
config_get traffic_class "$cid" "traffic_class"
config_get dscp_mark "$cid" "dscp_mark"
config_get dscp_filter "$cid" "dscp_filter"
config_get dest_port "$cid" "dest_port"
config_get dest_port_range "$cid" "dest_port_range"
config_get src_port "$cid" "src_port"
config_get src_port_range "$cid" "src_port_range"
config_get dest_ip "$cid" "dest_ip"
config_get src_ip "$cid" "src_ip"
config_get ip_len_min "$cid" "ip_len_min"
config_get ip_len_max "$cid" "ip_len_max"
config_get ifname "$cid" "ifname"
#check version of ip
case $src_ip$dest_ip in
*.*)
ip_version=4
;;
*:*)
ip_version=6
;;
*)
ip_version=1 #ip address not used
esac
#filter interface
if [ -n "$ifname" ]; then
if [ "$ifname" != "lo" ]; then
iptables_filter_intf "$ifname"
fi
fi
# filter proto
if [ -n "$proto" ]; then
iptables_filter_proto "$proto"
is_l3_rule=1
fi
#filter src. ip
if [ -n "$src_ip" ]; then
iptables_filter_ip_src "$src_ip"
is_l3_rule=1
fi
#filter dest. ip
if [ -n "$dest_ip" ]; then
iptables_filter_ip_dest "$dest_ip"
is_l3_rule=1
fi
#filter dest. port
if [ -n "$dest_port" ] && [ -z "$dest_port_range" ]; then
iptables_filter_port_dest "$dest_port"
is_l3_rule=1
fi
#filter src. port
if [ -n "$src_port" ] && [ -z "$src_port_range" ]; then
iptables_filter_port_src "$src_port"
is_l3_rule=1
fi
#filter dest. port range
if [ -n "$dest_port" ] && [ -n "$dest_port_range" ]; then
if [ "$dest_port_range" == "-1" ] ; then
dest_port_range="$dest_port"
fi
iptables_filter_port_dest_range "$dest_port" "$dest_port_range"
is_l3_rule=1
fi
#filter src. port range
if [ -n "$src_port" ] && [ -n "$src_port_range" ]; then
if [ "$src_port_range" == "-1" ] ; then
src_port_range="$src_port"
fi
iptables_filter_port_src_range "$src_port" "$src_port_range"
is_l3_rule=1
fi
#filter dscp
if [ -n "$dscp_filter" ]; then
iptables_filter_dscp_filter "$dscp_filter"
is_l3_rule=1
fi
#filter min. IP packet len.
if [ -n "$ip_len_min" ]; then
iptables_filter_ip_len_min "$ip_len_min"
is_l3_rule=1
fi
#filter max. IP packet len.
if [ -n "$ip_len_max" ]; then
iptables_filter_ip_len_max "$ip_len_max"
is_l3_rule=1
fi
if [ -z "$is_l3_rule" ] || [ "$is_l3_rule" -eq 0 ] ; then
return
fi
#set dscp mark
[ -n "$dscp_mark" ] && iptables_set_dscp_mark "$dscp_mark"
#set packet queue mark
[ -n "$traffic_class" ] && iptables_set_traffic_class "$traffic_class"
#write iptables rule for dscp marking
[ -n "$IP_RULE" ] && [ -n "$dscp_mark" ] && append_rule_to_mangle_table "qos_forward" $ip_version
if [ -n "$IP_RULE" ] && [ -n "$traffic_class" ]; then
if [ "$ifname" == "lo" ]; then
#write iptables rule for putting WAN directed internal packets in different queue
append_rule_to_mangle_table "qos_output" $ip_version
else
#write iptables rule for putting WAN directed LAN packets in different queue
append_rule_to_mangle_table "qos_prerouting" $ip_version
fi
fi
}
create_iptables_chains() {
iptables -w -t mangle -N qos_forward
ret=$?
[ $ret -eq 0 ] && iptables -w -t mangle -I FORWARD -j qos_forward
iptables -w -t mangle -N qos_prerouting
ret=$?
[ $ret -eq 0 ] && iptables -w -t mangle -I PREROUTING -j qos_prerouting
iptables -w -t mangle -N qos_output
ret=$?
[ $ret -eq 0 ] && iptables -w -t mangle -I OUTPUT -j qos_output
ip6tables -t mangle -N qos_forward
ret=$?
[ $ret -eq 0 ] && ip6tables -t mangle -I FORWARD -j qos_forward
ip6tables -t mangle -N qos_prerouting
ret=$?
[ $ret -eq 0 ] && ip6tables -t mangle -I PREROUTING -j qos_prerouting
ip6tables -t mangle -N qos_output
ret=$?
[ $ret -eq 0 ] && ip6tables -t mangle -I OUTPUT -j qos_output
}
flush_iptables_chains() {
echo "iptables -w -t mangle -F qos_forward" > /tmp/qos/classify.iptables
echo "iptables -w -t mangle -F qos_prerouting" >> /tmp/qos/classify.iptables
echo "iptables -w -t mangle -F qos_output" >> /tmp/qos/classify.iptables
echo "ip6tables -w -t mangle -F qos_forward" > /tmp/qos/classify.ip6tables
echo "ip6tables -w -t mangle -F qos_prerouting" >> /tmp/qos/classify.ip6tables
echo "ip6tables -w -t mangle -F qos_output" >> /tmp/qos/classify.ip6tables
}

View File

@@ -0,0 +1,12 @@
#!/bin/sh
# Set up or flush all chains
setup_qos() {
create_ebtables_chains
create_iptables_chains
}
flush_chains() {
flush_ebtables_chains
flush_iptables_chains
}

View File

@@ -0,0 +1,44 @@
#!/bin/sh
# Common classifier library
# Handle classify section
handle_classify() {
cid="$1" #classify section ID
config_get is_enable "$cid" "enable"
# no need to configure disabled classify rules
if [ -z "$is_enable" ] || [ "$is_enable" == "0" ]; then
return
fi
handle_ebtables_rules "$cid"
handle_iptables_rules "$cid"
handle_policer_rules "$cid"
}
# Configure classifier based on UCI subtree 'qos.classify'
configure_classify() {
# Processing classify section
# First remove old files
rm -f /tmp/qos/classify.ebtables
rm -f /tmp/qos/classify.iptables
rm -f /tmp/qos/classify.ip6tables
# Create files that will contain the rules if not present already
mkdir -p /tmp/qos/
touch /tmp/qos/classify.iptables
touch /tmp/qos/classify.ip6tables
touch /tmp/qos/classify.ebtables
# Add flush chain rules
flush_chains
# Load UCI file
config_load qos
config_foreach handle_classify classify
sh /tmp/qos/classify.ebtables
sh /tmp/qos/classify.iptables
sh /tmp/qos/classify.ip6tables
}

View File

@@ -0,0 +1,132 @@
#!/bin/sh
# Common policer library
POLICER_COUNT=0
# Function invoked
handle_policer_rules() {
local c_sec="$1"
local policer_name
local ifname
local pname
local pindex=-1
local ingress_rate=0
local in_burst_size=0
config_get policer_name "$c_sec" "policer"
if [ -z "$policer_name" ];then
# no need to apply policer if policer not present in this
# classification rule
return
fi
config_get ifname "$c_sec" "ifname"
if [ -z "$ifname" ]; then
# cannot associate policer as interface is not mentioned
return
fi
local i=0
local max_policer_inst="$(cat /tmp/qos/max_policer_inst)"
while :
do
if [ "${i}" -eq "$max_policer_inst" ]; then
break
fi
pname="$(uci -q get qos.@policer[$i].name)"
if [ "$policer_name" == "$pname" ]; then
pindex=$i
ingress_rate="$(uci -q get qos.@policer[$i].committed_rate)"
in_burst_rate="$(uci -q get qos.@policer[$i].committed_burst_size)"
break
fi
i=$((i + 1))
done
if [ -z "$pindex" ] || [ "$pindex" -lt 0 ]; then
# policer not found, no need to proceed further
return
fi
config_ingress_rate_limit "$ifname" "$ingress_rate" "$in_burst_size"
}
# Configure ingress rate limit
config_ingress_rate_limit() {
local ifname="$1"
local ingress_rate="$2"
local in_burst_size="$3"
local port=""
if [ -z "$ingress_rate" ] || [ "$ingress_rate" -lt 1000 ] ; then
return
fi
ingress_rate=$((ingress_rate / 1000))
if [ "$in_burst_size" -eq 0 ]; then
in_burst_size="$ingress_rate"
else
in_burst_size="$((in_burst_size / 1000))"
fi
hw_policer_set_ingress_rate "$ifname" "$port" "$ingress_rate" "$in_burst_size"
}
# Function invoked for handling policer section in UCI
handle_policer() {
local p_sec="$1" # policer section ID
local dir=1 # default direction, upstream
config_get is_enable "$p_sec" "enable"
# No need to configure disabled policer
if [ -z "$is_enable" ] || [ "$is_enable" == "0" ] ; then
return
fi
config_get cir "$p_sec" "committed_rate"
config_get cbs "$p_sec" "committed_burst_size" -1
config_get ebs "$p_sec" "excess_burst_size" 0
config_get pir "$p_sec" "peak_rate" 0
config_get pbs "$p_sec" "peak_burst_size" 0
config_get meter "$p_sec" "meter_type" 0
hw_policer_set add "$dir" "$POLICER_COUNT" "$meter" "$cir" "$cbs" "$ebs" "$pir" "$pbs"
POLICER_COUNT=$((POLICER_COUNT + 1))
}
# Configure policer based on UCI subtree 'qos.policer'
configure_policer() {
for intf in $(db get hw.board.ethernetPortOrder); do
if [ -n "${intf}" ] ; then
hw_policer_set_ingress_rate "$intf" 0 0
fi
done
# Delete policer
local i=0
local max_p_inst=0
if [ -f "/tmp/qos/max_policer_inst" ]; then
max_p_inst=$(cat /tmp/qos/max_policer_inst)
fi
while :
do
if [ "$i" -eq "$max_p_inst" ]; then
break
fi
hw_policer_set del 1 $i
i=$((i + 1))
done
# reset the policer counter
echo 0 > /tmp/qos/max_policer_inst
# Load UCI file
config_load qos
config_foreach handle_policer policer
echo $POLICER_COUNT > /tmp/qos/max_policer_inst
}

View File

@@ -0,0 +1,50 @@
#!/bin/sh
# Handle queues and their order
Q_COUNT=0
# Preliminary configuration of a queue
pre_configure_queue() {
# Delete queues
hw_queue_init_all
for intf in $(db get hw.board.ethernetPortOrder); do
hw_intf_init "${intf}"
done
}
# UCI queue section handler
handle_queue() {
local qid="$1" #queue section ID
local intf_name="$2"
config_get is_enable "$qid" "enable"
# no need to configure disabled queues
if [ -z "${is_enable}" ] || [ "${is_enable}" == "0" ]; then
return
fi
config_get ifname "$qid" "ifname"
# if ifname is empty that is good enough to break
if [ -z "$ifname" ];then
return
fi
config_get sc_alg "$qid" "scheduling"
config_get wgt "$qid" "weight" 1
config_get rate "$qid" "rate"
config_get bs "$qid" "burst_size"
config_get qsize "$qid" "queue_size" 1024
config_get precedence "$qid" "precedence"
hw_queue_set "${ifname}" "${Q_COUNT}" "${precedence}" "$qsize" "$wgt" "$sc_alg" "$shapingrate" "$rate" "$bs"
Q_COUNT=$((Q_COUNT + 1))
}
# Configure all queues specified in UCI tree 'qos.queue'
configure_queue() {
# Load UCI file
config_load qos
config_foreach handle_queue queue
}

View File

@@ -0,0 +1,46 @@
#!/bin/sh
# Common shaper library
# UCI 'shaper' section handler.
# It will verify shaper configuration sanity and then invoke
# hardware-specific functions
handle_shaper() {
sid="$1" #queue section ID
config_get is_enable "$sid" "enable"
# no need to configure disabled queues
if [ -z "${is_enable}" ] || [ "${is_enable}" == "0" ] ; then
return
fi
config_get ifname "$sid" "ifname"
# if ifname is empty that is good enough to break
if [ -z "$ifname" ] ; then
return
fi
config_get rate "$sid" "rate"
# Convert the rate from bps to kbps.
if [ -z "${rate}" ] || [ "${rate}" -lt 1000 ] ; then
return
fi
rate=$((rate / 1000))
config_get bs "$sid" "burst_size"
hw_shaper_set "$ifname" add "$rate" "$bs"
}
# Configure shaper based on options saved to UCI tree 'qos.shaper'
configure_shaper() {
# Delete existing shaper
for intf in $(db get hw.board.ethernetPortOrder); do
hw_shaper_set "$intf" del
done
# Load UCI file
config_load qos
# Processing shaper section(s)
config_foreach handle_shaper shaper
}

View File

@@ -0,0 +1,55 @@
#!/bin/sh
# The entrypoint for the QoS setup library
. /lib/functions.sh
. /lib/network/port.sh
. /lib/qos/common/chains.sh
. /lib/qos/common/chains.ebtables.sh
. /lib/qos/common/chains.iptables.sh
. /lib/qos/common/classify.sh
. /lib/qos/common/policer.sh
. /lib/qos/common/queue.sh
. /lib/qos/common/shaper.sh
. /lib/qos/airoha.sh
configure_qos() {
# queue configuration is being done after shaper configuration,
# If port shapingrate configuration on DISC device is called after queue configuration then
# driver overwrites the queue shaping rate with default value of port shaping rate.
pre_configure_queue
setup_qos
configure_shaper
configure_queue
configure_policer
configure_classify
}
reload_qos() {
local service_name="$1"
hw_init_all
case "${service_name}" in
shaper)
configure_shaper
;;
queue)
pre_configure_queue
configure_queue
;;
classify)
configure_classify
;;
policer)
configure_policer
;;
"")
configure_qos
;;
esac
hw_commit_all
}
reload_qos_service() {
reload_qos
}

View File

@@ -10,6 +10,12 @@ POLICER_COUNT=0
Q_COUNT=0
SP_Q_PRIO=7
#counter variable to assign classify order value if not added in config
temp_order=1
cfg_name=""
cfg_type=""
# Function to handle a queue order and
# update total number of queues
handle_q_order() {
@@ -61,6 +67,37 @@ sort_by_precedence() {
done
}
# function to handle a queue section shapingrate
handle_queue_shapingrate() {
local qid="$1" #queue section ID
local intf_name="$2"
config_get is_enable "$qid" "enable"
# no need to configure disabled queues
if [ $is_enable == '0' ]; then
return
fi
config_get ifname "$qid" "ifname"
# if ifname is empty that is good enough to break
if [ -z "$ifname" ];then
return
fi
# This is to get the qid per interface.
if [ "$intf_name" != "$ifname" ]; then
return
fi
config_get rate "$qid" "rate"
config_get bs "$qid" "burst_size"
# Call tmctl which is a broadcomm command to configure queues shapingrate.
tmctl setqcfg --devtype 0 --if $ifname --qid $Q_COUNT --shapingrate $rate --burstsize $bs &>/dev/null
Q_COUNT=$((Q_COUNT + 1))
}
# function to handle a queue section
handle_queue() {
local qid="$1" #queue section ID
@@ -186,6 +223,14 @@ handle_shaper() {
}
setup_qos() {
if [ ! -d "/tmp/qos" ]; then
mkdir -p /tmp/qos
fi
if [ ! -f "/tmp/qos/qos" ]; then
touch /tmp/qos/qos
cp /etc/config/qos /tmp/qos/qos
fi
ebtables -t broute -N qos
ret=$?
if [ $ret -eq 0 ]; then
@@ -607,12 +652,12 @@ handle_ebtables_rules() {
fi
esac
if [ $ip_version = "4" ] || [ $ip_version = "1" ]; then
if [ "$ip_version" == "4" ] || [ "$ip_version" == "1" ]; then
broute_ipv4_rule_options "$sid"
is_l2_rule=1
fi
if [ $ip_version = "6" ] || [ $ip_version = "1" ]; then
if [ "$ip_version" == "6" ] || [ "$ip_version" == "1" ]; then
broute_ipv6_rule_options "$sid"
is_l2_rule=1
fi
@@ -976,19 +1021,61 @@ config_ingress_rate_limit() {
ethswctl -c rxratectrl -n $unit -p $port -x $ingress_rate -y $in_burst_size
}
# Function to handle a classify order
handle_classify_order() {
local cid="$1" #classify section ID
config_get is_enable "$cid" "enable" 1
# No need to configure disabled classify
if [ $is_enable == '0' ]; then
return
fi
# Create classify file containing classify order
local corder_file="/tmp/qos/classify.order"
config_get c_order "$cid" "order"
if [ -z "$c_order" ]; then
c_order=$temp_order;
temp_order=$((temp_order + 1))
fi
value=${c_order}_${cid}
echo $value >> $corder_file
}
# Sort classify, lower value in uci means higher precedence, so this
# function sorts the classify order in assending order
sort_classify_by_order() {
local corder_file="/tmp/qos/classify.order"
local tmp_corder_file="/tmp/qos/tmp_classify.order"
sort -n -k1 $corder_file > $tmp_corder_file
cp $tmp_corder_file $corder_file
rm -f $tmp_corder_file
}
#function to handle a classify section
handle_classify() {
cid="$1" #classify section ID
config_get is_enable "$cid" "enable"
# no need to configure disabled classify rules
if [ $is_enable == '0' ]; then
if [ "$is_enable" == '0' ]; then
return
fi
local corder_file="/tmp/qos/classify.order"
handle_ebtables_rules $cid
handle_iptables_rules $cid
handle_policer_rules $cid
while read -r line; do
line_cid=${line: 2}
handle_ebtables_rules $line_cid
handle_iptables_rules $line_cid
handle_policer_rules $line_cid
done < "$corder_file"
}
configure_shaper() {
@@ -1008,19 +1095,25 @@ configure_classify() {
rm -f /tmp/qos/classify.ebtables
rm -f /tmp/qos/classify.iptables
rm -f /tmp/qos/classify.ip6tables
rm -f /tmp/qos/classify.order
rm -f /tmp/qos/tmp_classify.order
#create files that will contain the rules if not present already
mkdir -p /tmp/qos/
touch /tmp/qos/classify.iptables
touch /tmp/qos/classify.ip6tables
touch /tmp/qos/classify.ebtables
touch /tmp/qos/classify.order
touch /tmp/qos/tmp_classify.order
#add flush chain rules
flush_chains
# Load UCI file
config_load qos
config_foreach handle_classify classify
config_foreach handle_classify_order classify
sort_classify_by_order
handle_classify classify
sh /tmp/qos/classify.ebtables
sh /tmp/qos/classify.iptables
@@ -1051,6 +1144,15 @@ pre_configure_queue() {
done
}
configure_queue_shaping_rate() {
# Load UCI file
config_load qos
for interf in $(db -q get hw.board.ethernetPortOrder); do
Q_COUNT=0
config_foreach handle_queue_shapingrate queue $interf
done
}
configure_queue() {
# Load UCI file
config_load qos
@@ -1075,7 +1177,7 @@ configure_policer() {
local port=$(echo $unitport | cut -d ' ' -f 2)
# setting rate and burst size to 0 disables rate limiting
if [ $port != "" -a $unit != "" ]; then
ethswctl -c rxratectrl -n $unit -p $port -x 0 -y 0
ethswctl -c rxratectrl -n $unit -p $port -x 0 -y 0 &>/dev/null
fi
done
@@ -1122,6 +1224,10 @@ reload_qos() {
configure_qos
elif [ "$service_name" == "shaper" ]; then
configure_shaper
# call to configure queue shaping rate as in some platform port shaping rate
# configuration overwrites the queue shaping rate in driver to default value
# this will restore the queue shping rate
configure_queue_shaping_rate
elif [ "$service_name" == "queue" ]; then
pre_configure_queue
configure_queue
@@ -1131,3 +1237,149 @@ reload_qos() {
configure_policer
fi
}
get_cfg_added_deleted()
{
# return true if there is difference in number of queue configuration
# in /etc/config/qos and /tmp/qos/qos, false is returned if both file
# has same count of queue configuration.
local queue=0
local classify=0
local shaper=0
local policer=0
local old_cfg="false"
config_cb() {
# invoked on the just previous config_load, get the count of
# queue configuration in /etc/config/qos and /tmp/qos/qos.
cfg_type="$1"
cfg_name="$2"
if [ -z $cfg_name ] || [ -z $cfg_type ]; then
return
fi
if [ "$old_cfg" == "false" ]; then
eval $cfg_type=$(($cfg_type + 1))
else
eval $cfg_type=$(($cfg_type - 1))
fi
option_cb() {
local option="$1"
local value="$2"
if [ -z "$option" ] || [ -z "$value" ]; then
return
fi
if [ "$old_cfg" == "false" ]; then
eval $cfg_type=$(($cfg_type + 1))
else
eval $cfg_type=$(($cfg_type - 1))
fi
}
}
# config_load will trigger call for config_cb that is getting count
# of qos configuration, respective config counts will come.
config_load qos
# config_load will trigger call for config_cb that is decreasing count
# of qos configuration.
old_cfg="true"
UCI_CONFIG_DIR="/tmp/qos"
config_load qos
UCI_CONFIG_DIR="/etc/config"
reset_cb
if [ $classify -ne 0 ]; then
modified_config="classify"
fi
if [ $shaper -ne 0 ]; then
modified_config="$modified_config shaper"
fi
if [ $policer -ne 0 ]; then
modified_config="$modified_config policer"
fi
if [ $queue -eq 0 ]; then
echo "$modified_config"
return
else
echo "queue"
return
fi
}
# reload_qos_service is invoked on qos service reload.
reload_qos_service() {
q_cfg_restart="false"
policer="false"
classify="false"
shaper="false"
setup_qos
if ! [[ -f "/etc/config/qos" && -f "/tmp/qos/qos" ]]; then
configure_qos
cp /etc/config/qos /tmp/qos/qos
fi
config_cb() {
# this is invoked when config_load is called.
cfg_type="$1"
cfg_name="$2"
if [ -z $cfg_name ] || [ -z $cfg_type ]; then
return
fi
option_cb() {
# checking for if any parameters value is modified in queue cfg
# comparsion is done between /etc/config/qos and /tmp/qos/qos
local option="$1"
local value="$2"
local old_value=""
if [ -z "$option" ] || [ -z "$value" ]; then
return
fi
old_value=$(uci -q -c "/tmp/qos" get qos.$cfg_name.$option)
if ! [ "$old_value" == "$value" ]; then
if [ "$cfg_type" == "queue" ]; then
q_cfg_restart="true"
else
eval $cfg_type="true"
fi
fi
}
}
# if there is new addition/deletion of queue configuration
# then return is queue to trigger restart of qos.
# Otehrwise shaper policer classify
# respective operation config is invoked that does not change queue statistics
cfg_added_deleted=$(get_cfg_added_deleted)
if [ "$cfg_added_deleted" == "queue" ]; then
configure_qos
else
q_cfg_restart="false"
# config_load will trigger call for config_cb that is checking
# for modification in config value of queue config.
# if change of value of queue config is there then q_cfg_restart
# is set as true, else other qos config flag is set as true.
config_load qos
reset_cb
if [ "$q_cfg_restart" == "true" ]; then
configure_qos
else
for config in $cfg_added_deleted
do
eval $config="true"
done
if [ "$shaper" == "true" ]; then
reload_qos "shaper"
fi
if [ "$policer" == "true" ]; then
reload_qos "policer"
# change in policer config may need reconfiguration
# of classifier
reload_qos "classify"
fi
if [ "$classify" == "true" ]; then
reload_qos "classify"
fi
fi
fi
cp /etc/config/qos /tmp/qos/qos
}

View File

@@ -11,7 +11,8 @@ NAME=qosmngr
PROG=/usr/sbin/qosmngr
. /lib/functions.sh
include /lib/qos
. /lib/qos/qos.sh
start_service() {
if [ -f "/etc/config/qos" ]; then
@@ -37,3 +38,8 @@ restart() {
setup_qos
start
}
reload_service()
{
reload_qos_service
}

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=questd
PKG_VERSION:=5.2.4
PKG_VERSION:=5.2.5
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/questd
PKG_SOURCE_VERSION:=2ca3ae0c29dcbbf01282f6118eb8d5e5bc9a1c45
PKG_SOURCE_VERSION:=38af3655416c80933f89f5a03638403a7c051a42
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -2,14 +2,11 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=skopeo
PKG_VERSION:=1.9.2
PKG_RELEASE:=1
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_NAME:=skopeo
PKG_SOURCE_URL:=https://github.com/containers/skopeo.git
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION)-$(PKG_RELEASE).tar.gz
PKG_MIRROR_HASH:=skip
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/containers/skopeo/archive/v$(PKG_VERSION)
PKG_HASH:=9a321ba75f213e5c46cba7f92073c2437137a56d3140c9ab6e723fb92890f9d0
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE

View File

@@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=stunc
PKG_RELEASE:=1
PKG_VERSION:=1.1.12
PKG_VERSION:=1.1.14
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/stunc.git
PKG_SOURCE_VERSION:=5b65364709a921db0956bf74a4f126217cfb1775
PKG_SOURCE_VERSION:=06b63878a448b593d907bb3e9c1381dc0e69bca6
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -23,8 +23,6 @@ endif
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=bbf
include $(INCLUDE_DIR)/package.mk
define Package/stunc/default
@@ -32,7 +30,7 @@ define Package/stunc/default
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=BBF STUN Client
DEPENDS:=+libubus +libuci +libubox +libjson-c +libblobmsg-json
DEPENDS:=+libubus +libuci +libubox +libjson-c +libblobmsg-json +libbbf_api
endef
define Package/stunc-mbedtls

View File

@@ -13,7 +13,7 @@ menu "SULU_CORE"
config SULU_CORE_VERSION
string "SULU repo version"
default "944f4e2217e478c04f1ef56ae67c66d82ece7994"
default "c7e62f7f7cda1961012e8149d220ac1eb26d362f"
endmenu
menu "SULU_PLUGIN_LCM"
@@ -35,7 +35,7 @@ menu "SULU_PLUGIN_LCM"
config SULU_PLUGIN_LCM_VERSION
depends on SULU_PLUGIN_LCM_ENABLE
string "Version"
default "f8a96f1c55904082c0658ee63aebe1e67a097f42"
default "ccd70b399b31530dc1af6a871eee94fbb179d794"
endmenu
menu "SULU_PLUGIN_MULTIAP"
@@ -57,7 +57,7 @@ menu "SULU_PLUGIN_MULTIAP"
config SULU_PLUGIN_MULTIAP_VERSION
depends on SULU_PLUGIN_MULTIAP_ENABLE
string "Version"
default "89b4e4b95d3a94b88782f5cdc9d1eafd5728a1f7"
default "3c79d57bee453e7b62c7b7626e33bf273212bbc9"
endmenu
menu "SULU_THEME_IOPSYS"

View File

@@ -5,27 +5,25 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-builder
PKG_VERSION:=1.1.4
PKG_VERSION:=1.3.16
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-builder.git
PKG_SOURCE_VERSION:=ca38b2086cee7ba83b41eec56539e9432271a349
PKG_SOURCE_VERSION:=81d4bb268914dc3822293e93519ae6adbd6ddbea
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
PKG_LICENSE:=PROPRIETARY IOPSYS
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=node-yarn/host
include $(INCLUDE_DIR)/package.mk
define Package/${PKG_NAME}
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Build sulu from source
DEPENDS:=+nginx +mosquitto-auth-shadow
MENU:=1
DEPENDS:=+nginx +mosquitto-auth-shadow +usermngr +jq
CONFLICTS:=sulu
endef
define Package/${PKG_NAME}/description
@@ -37,7 +35,7 @@ define Package/${PKG_NAME}/config
endef
# Sulu core and other dependent needs to be updated in Config.in
SULU_DL_FILE:=sulu-${PKG_VERSION}-${CONFIG_SULU_CORE_VERSION}.tar.gz
SULU_DL_FILE:=sulu_core-${CONFIG_SULU_CORE_VERSION}.tar.gz
define Download/sulu_core
FILE:=$(SULU_DL_FILE)
URL:=$(CONFIG_SULU_CORE_URL)
@@ -144,11 +142,36 @@ endef
define Package/${PKG_NAME}/install
$(INSTALL_DIR) $(1)/sulu
$(INSTALL_DIR) $(1)/sulu/config
$(INSTALL_DIR) $(1)/sulu/config/widgets
$(INSTALL_DIR) $(1)/etc/nginx/
$(INSTALL_DIR) $(1)/etc/mosquitto/conf.d/
$(CP) $(PKG_BUILD_DIR)/build/dist/* $(1)/sulu
$(CP) $(PKG_BUILD_DIR)/build/src/config/widgets/*.json $(1)/sulu/config/
$(CP) ./files/* $(1)/
$(CP) $(PKG_BUILD_DIR)/build/src/config/*.json $(1)/sulu/config/
$(CP) $(PKG_BUILD_DIR)/build/src/config/widgets/diagnostics.json $(1)/sulu/config/widgets/
$(CP) $(PKG_BUILD_DIR)/build/src/config/widgets/wan.json $(1)/sulu/config/widgets/
ifeq ($(CONFIG_PACKAGE_skopeo)$(CONFIG_PACKAGE_umoci),yy)
$(CP) $(PKG_BUILD_DIR)/build/src/config/widgets/lcm-store.json $(1)/sulu/config/widgets/
endif
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_BIN) ./files/etc/config/sulu $(1)/etc/config/sulu
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/etc/init.d/sulu $(1)/etc/init.d/sulu
$(INSTALL_DIR) $(1)/etc/mosquitto/conf.d/
$(INSTALL_DATA) ./files/etc/mosquitto/conf.d/obuspa.conf $(1)/etc/mosquitto/conf.d/
$(INSTALL_DATA) ./files/etc/mosquitto/conf.d/sulu.conf $(1)/etc/mosquitto/conf.d/
$(INSTALL_DATA) ./files/etc/mosquitto/sulu.password $(1)/etc/mosquitto/sulu.password
$(INSTALL_DIR) $(1)/etc/nginx/conf.d
$(INSTALL_DATA) ./files/etc/nginx/conf.d/sulu.conf $(1)/etc/nginx/conf.d/
$(INSTALL_DIR) $(1)/etc/sulu
$(INSTALL_DATA) ./files/etc/sulu/roles.json $(1)/etc/sulu/
$(INSTALL_BIN) ./files/etc/sulu/sulu.sh $(1)/etc/sulu/
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/etc/uci-defaults/99-fix-sulu-config $(1)/etc/uci-defaults/
endef
$(eval $(call BuildPackage,${PKG_NAME}))

View File

@@ -0,0 +1,9 @@
config global 'global'
option root '/sulu'
option port '8080'
option ws_port '9001'
option enabled '1'
option enable_system_credentials '1'
option role_based_access '1'
list user 'admin'
list user 'user'

View File

@@ -1,19 +1,42 @@
#!/bin/sh /etc/rc.common
START=99
STOP=10
USE_PROCD=1
START=99
STOP=01
. /lib/functions.sh
. /etc/sulu/sulu.sh
log() {
echo "${@}"|logger -t sulu.init -p debug
}
start_service() {
procd_open_instance sulu
# append sulu connection injection
procd_close_instance
validate_sulu_global_section()
{
uci_validate_section sulu global global \
'enabled:bool:1' \
'enable_system_credentials:bool:1' \
'role_based_access:bool:0'
}
start_service() {
local enabled enable_system_credentials role_based_access
config_load sulu
procd_open_instance sulu
validate_sulu_global_section || return 0;
# append sulu connection injection
if [ "${enabled}" -eq "0" ]; then
procd_close_instance
return 0
fi
configure_sulu "${enable_system_credentials}" "${role_based_access}" 1
update_nginx_config "${enabled}" 1
update_sulu_connection_port
procd_close_instance
}
reload_service() {
@@ -23,5 +46,5 @@ reload_service() {
service_triggers()
{
procd_add_config_trigger "config.change" "obuspa" /etc/init.d/sulu reload
procd_add_reload_trigger "sulu"
}

View File

@@ -1,5 +1,4 @@
listener 9001
protocol websockets
plugin /usr/lib/mosquitto_auth_shadow.so
require_certificate false
allow_anonymous false

View File

@@ -0,0 +1 @@
admin:$6$OmM9kU/lYct3KJ9j$iP0WK4ezEtRm8+EAggNp7WbJFoWO0p7IUdI0v/hr1WcVHyfFAC30Pb8Csn7GqwwqI2dcmnDOAITnimo2VNe6ug==

View File

@@ -0,0 +1,27 @@
server {
listen 8080;
listen [::]:8080;
server_name _sulu;
root /sulu;
location / {
autoindex on;
expires -1;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,Content-Type,Range';
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
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';
}
}
}

View File

@@ -1,18 +0,0 @@
location /config/ {
autoindex on;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}
}

View File

@@ -0,0 +1,95 @@
{
"roles": [
{
"name": "admin",
"permission": [
{
"object": "Device.",
"perm": [
"PERMIT_ALL"
]
}
]
},
{
"name": "user",
"permission": [
{
"object": "Device.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO"
]
},
{
"object": "Device.LocalAgent.Subscription.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_ADD",
"PERMIT_SET",
"PERMIT_DEL"
]
},
{
"object": "Device.WiFi.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_OPER",
"PERMIT_SUBS_VAL_CHANGE",
"PERMIT_SUBS_OBJ_ADD",
"PERMIT_SUBS_OBJ_DEL",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object": "Device.DNS.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_OPER",
"PERMIT_SUBS_VAL_CHANGE",
"PERMIT_SUBS_OBJ_ADD",
"PERMIT_SUBS_OBJ_DEL",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object": "Device.IP.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_OPER",
"PERMIT_SUBS_VAL_CHANGE",
"PERMIT_SUBS_OBJ_ADD",
"PERMIT_SUBS_OBJ_DEL",
"PERMIT_SUBS_EVT_OPER_COMP"
]
}
]
},
{
"name": "undefined-1"
},
{
"name": "undefined-2"
},
{
"name": "undefined-3"
},
{
"name": "undefined-4"
}
]
}

View File

@@ -0,0 +1,439 @@
#!/bin/sh
. /lib/functions.sh
ACL_FILE="/tmp/sulu/mqtt.acl"
_RESTART_SERVICES="0"
mkdir -p /tmp/sulu/
function slog()
{
echo "$*" |logger -t sulu.init -p debug
}
function _get_agent_id()
{
local oui serial endpointid
endpointid="$(uci_get obuspa localagent EndpointID)"
if [ -z "${endpointid}" ]; then
oui="$(db -q get device.deviceinfo.ManufacturerOUI)"
serial="$(db -q get device.deviceinfo.SerialNumber)"
echo "${oui}-${serial}"
else
echo "$(echo "${endpointid/::/,}"|cut -d "," -f 2)"
fi
}
function _get_endpoint_id()
{
local oui serial endpointid
endpointid="$(uci_get obuspa localagent EndpointID)"
if [ -z "${endpointid}" ]; then
oui="$(db -q get device.deviceinfo.ManufacturerOUI)"
serial="$(db -q get device.deviceinfo.SerialNumber)"
echo "os::${oui}-${serial}"
else
echo "${endpointid}"
fi
}
function _get_sulu_users()
{
echo "$(uci -q get sulu.global.user)"
}
function _get_sulu_root()
{
local root
root="$(uci -q get sulu.global.root)"
echo "${root:-/sulu}"
}
function _get_sulu_port()
{
local port
port="$(uci -q get sulu.global.port)"
echo "${port:-8080}"
}
function _get_sulu_ws_port()
{
local port
port="$(uci -q get sulu.global.ws_port)"
echo "${port:-9001}"
}
function generate_sulu_conn_config()
{
local rbac users SCONFIG
rbac="${1}"
users="$(_get_sulu_users)"
SCONFIG="$(_get_sulu_root)/config/connectionConfig.json"
json_init;
if [ "${rbac}" -eq "1" ]; then
json_add_string 'currentConnection' 'rbac';
else
json_add_string 'currentConnection' 'main';
fi
json_add_object 'connections';
json_add_object 'rbac';
json_add_string 'toId' "$(_get_endpoint_id)";
json_add_int 'port' "$(_get_sulu_ws_port)";
json_add_string 'protocol' 'ws';
json_add_array 'auth';
json_close_array;
json_add_object 'overrides';
for f in ${users}; do
json_add_object "${f}";
json_add_string 'fromId' "self::sulu-${f}";
json_add_string 'publishEndpoint' "/usp/$(_get_agent_id)/${f}/endpoint";
json_add_string 'subscribeEndpoint' "/usp/$(_get_agent_id)/${f}/controller";
json_close_object;
done
json_close_object;
json_close_object;
# add the default connection
json_add_object 'main';
json_add_string 'fromId' 'proto::interop-usp-controller';
json_add_string 'toId' "$(_get_endpoint_id)";
json_add_int 'port' "$(_get_sulu_ws_port)";
json_add_string 'protocol' 'ws';
json_add_string 'publishEndpoint' "/usp/endpoint";
json_add_string 'subscribeEndpoint' "/usp/controller";
json_add_array 'auth';
json_close_array;
json_close_object;
json_close_object;
json_dump > ${SCONFIG}
}
function set_sulu_connection_mode()
{
local rbac profile config SCONFIG
SCONFIG="$(_get_sulu_root)/config/connectionConfig.json"
rbac="${1}"
profile="$(jq '.currentConnection' ${SCONFIG})"
if [ "$rbac" -eq "1" -a "${profile}" == "\"main\"" ]; then
config="$(jq '.currentConnection = "rbac"' ${SCONFIG})"
echo "${config}" > ${SCONFIG}
elif [ "$rbac" -eq "0" -a "${profile}" == "\"rbac\"" ]; then
config="$(jq '.currentConnection = "main"' ${SCONFIG})"
echo "${config}" > ${SCONFIG}
fi
}
function update_sulu_connection_port()
{
local port ws_port SCONF
SCONF="$(_get_sulu_root)/config/connectionConfig.json"
ws_port="$(_get_sulu_ws_port)"
port="$(jq '.connections.rbac.port' ${SCONF})"
if [ "${port}" -ne "${ws_port}" ]; then
jq ".connections.main.port = ${ws_port} | .connections.rbac.port = ${ws_port}" ${SCONF} > /tmp/sulu/ss_port.json
mv /tmp/sulu/ss_port.json ${SCONF}
fi
}
function _update_obuspa_config()
{
local restart
restart=0
if ! uci_get obuspa localmqtt >/dev/null 2>&1; then
uci_add obuspa mqtt localmqtt
uci_set obuspa localmqtt BrokerAddress "127.0.0.1"
uci_set obuspa localmqtt BrokerPort "1883"
uci_set obuspa localmqtt TransportProtocol "TCP/IP"
restart=1
fi
if ! uci_get obuspa agent_mtp >/dev/null 2>&1; then
uci_add obuspa mtp agent_mtp
uci_set obuspa agent_mtp Protocol "MQTT"
uci_set obuspa agent_mtp ResponseTopicConfigured "/usp/endpoint"
uci_set obuspa agent_mtp mqtt "localmqtt"
restart=1
fi
if ! uci_get obuspa localcontroller >/dev/null 2>&1; then
uci_add obuspa controller localcontroller
uci_set obuspa localcontroller EndpointID "proto::interop-usp-controller"
uci_set obuspa localcontroller Protocol "MQTT"
uci_set obuspa localcontroller Topic "/usp/controller"
uci_set obuspa localcontroller mqtt "localmqtt"
uci_set obuspa localcontroller assigned_role_name "full_access"
restart=1
fi
return "${restart}"
}
function _remove_obuspa_config()
{
local restart
restart=0
if [ "$(uci_get obuspa localmqtt)" == "mqtt" ]; then
uci_remove obuspa localmqtt
restart=1
fi
if [ "$(uci_get obuspa agent_mtp)" == "mtp" ]; then
uci_remove obuspa agent_mtp
restart=1
fi
if [ "$(uci_get obuspa localcontroller)" == "controller" ]; then
uci_remove obuspa localcontroller
restart=1
fi
return "${restart}"
}
function _update_obuspa_config_rbac() {
local agent users restart
agent="$(_get_agent_id)"
users="$(_get_sulu_users)"
restart=0
for f in ${users}; do
local sec
# Add mqtt
sec="mqtt_sulu_${f}"
if ! uci_get obuspa ${sec} >/dev/null 2>&1; then
uci_add obuspa mqtt ${sec}
uci_set obuspa ${sec} BrokerAddress "127.0.0.1"
uci_set obuspa ${sec} BrokerPort "1883"
uci_set obuspa ${sec} TransportProtocol "TCP/IP"
restart=1
fi
# Add mtp
sec="mtp_sulu_${f}"
if ! uci_get obuspa ${sec} >/dev/null 2>&1; then
uci_add obuspa mtp ${sec}
uci_set obuspa ${sec} Protocol "MQTT"
uci_set obuspa ${sec} ResponseTopicConfigured "/usp/${agent}/${f}/endpoint"
uci_set obuspa ${sec} mqtt "mqtt_sulu_$f"
restart=1
fi
# Add controller
sec="controller_sulu_${f}"
if ! uci_get obuspa ${sec} >/dev/null 2>&1; then
uci_add obuspa controller ${sec}
uci_set obuspa ${sec} EndpointID "self::sulu-${f}"
uci_set obuspa ${sec} Protocol "MQTT"
uci_set obuspa ${sec} Topic "/usp/${agent}/${f}/controller"
uci_set obuspa ${sec} mqtt "mqtt_sulu_$f"
uci_set obuspa ${sec} assigned_role_name "$f"
restart=1
fi
done
if [ -f "/etc/sulu/roles.json" ]; then
uci_set obuspa global role_file "/etc/sulu/roles.json"
fi
return "${restart}"
}
function _remove_sulu_sec()
{
local sec
if [[ "${1}" == *"_sulu_"* ]]; then
uci_remove obuspa ${1}
return 1
fi
return 0
}
function _remove_obuspa_config_rbac()
{
local restart
restart=0
config_foreach _remove_sulu_sec mqtt
restart="$(( restart + $? ))"
config_foreach _remove_sulu_sec mtp
restart="$(( restart + $? ))"
config_foreach _remove_sulu_sec controller
restart="$(( restart + $? ))"
uci_set obuspa global role_file ""
return "${restart}"
}
function _create_acl() {
local agentid rbac users
rbac="${1:-0}"
[ -f "${ACL_FILE}" ] && rm -f "${ACL_FILE}"
if [ "${rbac}" -eq "0" ]; then
return 0;
fi
agentid="$(_get_agent_id)"
users="$(_get_sulu_users)"
for f in ${users}; do
echo "user ${f}" >> ${ACL_FILE}
echo "topic read /usp/${agentid}/${f}/controller/reply-to/#" >> ${ACL_FILE}
echo "topic write /usp/${agentid}/${f}/endpoint/#" >> ${ACL_FILE}
echo "topic read /usp/${agentid}/${f}/controller/#" >> ${ACL_FILE}
echo "" >> ${ACL_FILE}
done
}
function update_mosquitto_broker_config()
{
local system_cred rbac restart ws_port
MB_SULU_CONF="/etc/mosquitto/conf.d/sulu.conf"
system_cred="${1}"
rbac="${2}"
restart=0
ws_port="$(_get_sulu_ws_port)"
if [ "${system_cred}" -eq "1" ]; then
if grep -q "password_file " ${MB_SULU_CONF}; then
sed -i '/password_file /d' ${MB_SULU_CONF}
restart=1
fi
if ! grep -q "plugin .*mosquitto_auth_shadow.so" ${MB_SULU_CONF}; then
echo "plugin /usr/lib/mosquitto_auth_shadow.so" >> ${MB_SULU_CONF}
restart=1
fi
else
if grep -q 'plugin .*mosquitto_auth_shadow.so' ${MB_SULU_CONF}; then
sed -i '/plugin .*mosquitto_auth_shadow.so/d' ${MB_SULU_CONF}
restart=1
fi
if ! grep -q "password_file /etc/mosquitto/sulu.password" ${MB_SULU_CONF}; then
echo "password_file /etc/mosquitto/sulu.password" >> ${MB_SULU_CONF}
restart=1
fi
fi
if [ "${rbac}" -eq "1" ]; then
_create_acl "${rbac}"
if ! grep -q "acl_file ${ACL_FILE}" ${MB_SULU_CONF}; then
echo "acl_file ${ACL_FILE}" >> ${MB_SULU_CONF}
restart=1
fi
else
if grep -q "acl_file ${ACL_FILE}" ${MB_SULU_CONF}; then
sed -i '/acl_file /d' ${MB_SULU_CONF}
restart=1
fi
fi
if ! grep -q "listener ${ws_port}" ${MB_SULU_CONF}; then
sed -i "s/listener [0-9]\+/listener ${ws_port}/" ${MB_SULU_CONF}
restart=1
fi
if [ "${_RESTART_SERVICES}" -eq "1" -a "${restart}" -eq "1" ]; then
slog "Restarting mqtt broker..."
/etc/init.d/mosquitto restart &
fi
}
function update_obuspa_config()
{
local rbac restart
rbac="${1}"
restart=0
uci_load obuspa
if [ "${rbac}" -eq "1" ]; then
_remove_obuspa_config
restart="$(( restart + $? ))"
_update_obuspa_config_rbac
restart="$(( restart + $? ))"
else
_remove_obuspa_config_rbac
restart="$(( restart + $? ))"
_update_obuspa_config
restart="$(( restart + $? ))"
fi
uci_commit obuspa
if [ "${_RESTART_SERVICES}" -eq "1" -a "${restart}" -gt "0" ]; then
slog "Restarting obuspa..."
ubus call uci commit '{"config":"obuspa"}'
fi
}
function update_nginx_config()
{
local enabled restart port
NCONF="/etc/nginx/conf.d/sulu.conf"
restart=0
enabled="${1:-0}"
_RESTART_SERVICES="${2:-0}"
port="$(_get_sulu_port)"
root="$(_get_sulu_root)"
if [ "${enabled}" -eq "1" ]; then
if [ ! -f "${NCONF}" ]; then
cp /etc/sulu/nginx.conf ${NCONF}
restart=1
fi
if ! grep -q "listen ${port}" ${NCONF}; then
sed -i "s/listen [0-9]\+/listen ${port}/" ${NCONF}
sed -i "s/listen \[::\]:[0-9]\+/listen [::]:${port}/" ${NCONF}
restart=1
fi
if ! grep -q "root ${root}" ${NCONF}; then
sed -i "s/root .*;/root ${root//\//\\/};/" ${NCONF}
restart=1
fi
else
if [ -f "${NCONF}" ]; then
rm -f ${NCONF}
restart=1
fi
fi
if [ "${_RESTART_SERVICES}" -eq "1" -a "${restart}" -eq "1" ]; then
slog "Restarting nginx..."
ubus call uci commit '{"config":"nginx"}'
fi
}
function configure_sulu()
{
local sys_cred rbac restart
sys_cred="${1}"
rbac="${2}"
restart="${3:-0}"
if [ -z "${sys_cred}" -o -z "${rbac}" ]; then
slog "Invalid inputs"
return 0
fi
_RESTART_SERVICES="${restart}"
update_mosquitto_broker_config "${sys_cred}" "${rbac}"
set_sulu_connection_mode "${rbac}"
update_obuspa_config "${rbac}"
}

View File

@@ -1,10 +0,0 @@
mkdir -p /tmp/sulu
uci -q get nginx._sulu && exit 0
uci -q set nginx._sulu=server
uci -q add_list nginx._sulu.listen='8080'
uci -q add_list nginx._sulu.listen='[::]:8080'
uci -q set nginx._sulu.root='/sulu'
uci -q set nginx._sulu.server_name='_sulu'
uci -q add_list nginx._sulu.include='conf.d/sulu.locations'

View File

@@ -0,0 +1,11 @@
#!/bin/sh
. /etc/sulu/sulu.sh
config_load sulu
config_get enable_system_credentials global enable_system_credentials 1
config_get role_based_access global role_based_access 0
config_get enabled global enabled 0
configure_sulu "${enable_system_credentials}" "${role_based_access}" 0
generate_sulu_conn_config "${role_based_access}"

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