Compare commits

..

278 Commits

Author SHA1 Message Date
Marina Maslova
ddce033a5a ieee1905: 8.3.4.15 2025-04-02 16:07:45 +04:00
Marina Maslova
3c557f56cf hostmngr: 1.1.9 2025-04-02 16:06:15 +04:00
Vivek Kumar Dutta
ba6e9e334d iop: disable mosquitto bridge support 2025-04-01 10:17:57 +05:30
George Yang
5afb27846a libvoice-airoha: Fix error caller name in CLIP, REF #16094 2025-02-26 11:00:19 +01:00
Erik Karlsson
da6b78fc66 libethernet: 7.2.112.1 2025-01-30 11:45:20 +01:00
Sukru Senli
dfa716b68b map-controller: use the same backhaul SSID for all bands 2025-01-16 09:51:12 +01:00
Janusz Dziedzic
c99b4bed3b libwifi: 7.4.16.18 2025-01-14 11:30:31 +01:00
Jakob Olsson
0945e724ea map-agent: 4.5.0.34 2024-11-26 16:10:40 +01:00
arbala
3eba64701c map-controller: 4.5.0.23 2024-11-19 13:29:50 +01:00
Janusz Dziedzic
106ae13535 libwifi: 7.4.16.17 2024-11-15 11:42:22 +00:00
Anjan Chanda
6dfd9bc6e9 ieee1905: 8.3.4.14 2024-11-15 11:27:07 +01:00
Anjan Chanda
b5f9792a6d ieee1905: 8.3.4.13 2024-11-15 09:24:19 +01:00
arbala
ec9f11cdb9 ieee1905: update_neighbor_queue 2024-11-14 16:10:57 +01:00
Jakob Olsson
18b7370941 decollector: 4.2.1.1.6 2024-11-06 15:36:40 +01:00
Erik Karlsson
33b9620b5f ethmngr: fix memory leaks and potential read outside of buffer 2024-10-31 16:58:14 +01:00
Janusz Dziedzic
3b33257502 libwifi: skip probe-req events by default 2024-10-30 16:04:14 +01:00
Rahul Thakur
f4c1cd7596 mcastmngr: remove unnecessary log 2024-10-29 08:44:16 +00:00
Filip Matusiak
bce1c004fb map-controller: 4.5.0.22 2024-10-25 13:56:45 +02:00
Vivek Kumar Dutta
88c81945b5 icwmp: Fix loop in rpc list 2024-10-25 16:38:59 +05:30
Jakob Olsson
45c6d20b9e map-controller: 4.5.0.21 2024-10-24 17:26:03 +02:00
Vivek Kumar Dutta
0740877068 icwmp: Fix missing TransferComplete after reboot 2024-10-24 17:27:49 +05:30
Jakob Olsson
0016db38b7 map-controller: 4.5.0.20 2024-10-23 16:11:58 +02:00
Vivek Kumar Dutta
1f7e25ad18 icwmp: 9.5.29.16 2024-10-23 16:23:22 +05:30
Mohd Husaam Mehdi
c034b97513 urlfilter: fix crash on cleanup of dns answer struct 2024-10-23 10:14:48 +00:00
Jakob Olsson
cd34ac6acd map-controller: 4.5.0.19 2024-10-23 11:50:06 +02:00
Jakob Olsson
b1578f02b2 map-controller: 4.5.0.18 2024-10-21 17:14:45 +02:00
Jakob Olsson
1c2e38d1cf map-controller: 4.5.0.17 2024-10-18 15:15:11 +02:00
Jakob Olsson
b6ec722a3c map-agent: 4.5.0.33 2024-10-18 13:50:39 +02:00
Jakob Olsson
d655076bb7 map-controller: 4.5.0.16 2024-10-18 13:50:07 +02:00
Jakob Olsson
cf4f7a5ee9 map-controller: add config option to enable probe requests on ubus 2024-10-18 13:49:37 +02:00
Janusz Dziedzic
415243d9d5 libwifi: 7.4.16.16 2024-10-18 11:34:30 +00:00
Marina Maslova
4eb60b1199 libvoice-airoha: 1.0.13 2024-10-17 20:15:08 +04:00
Jakob Olsson
42f85f02ef map-controller: 4.5.0.15 2024-10-17 16:53:40 +02:00
Filip Matusiak
9fa333f811 map-controller: 4.5.0.14 2024-10-17 15:26:37 +02:00
Filip Matusiak
a1936766f4 map-agent: 4.5.0.32 2024-10-17 15:18:06 +02:00
Jakob Olsson
d7903e3912 map-agent: 4.5.0.31 2024-10-16 16:53:42 +02:00
Mohd Husaam Mehdi
07ab390f89 urfilter: support global enable/disable in data model and rework 2024-10-16 11:56:55 +00:00
Jakob Olsson
bdace90039 map-controller: 4.5.0.13 2024-10-16 13:55:55 +02:00
Vivek Kumar Dutta
9bbb12eae1 bbfdm: Updated schedule parameters 2024-10-16 11:44:43 +05:30
Mohd Husaam Mehdi
e5f08d801b urlfilter: add support for bedtime and internet_access schedules 2024-10-16 04:32:01 +00:00
Vivek Kumar Dutta
68f17cf1e8 obuspa: acl for ParentalControl and Schedules 2024-10-16 04:32:01 +00:00
Suvendhu Hansa
972613399d urlfilter: Added C plugin 2024-10-16 04:32:01 +00:00
Suvendhu Hansa
ca8409e74e Added param in plugin 2024-10-16 04:32:01 +00:00
Vivek Kumar Dutta
820aba6359 urlfilter: ParentalControl datamodel 2024-10-16 04:32:01 +00:00
Jakob Olsson
3871de8453 map-controller: 4.5.0.12 2024-10-15 18:01:32 +02:00
Jakob Olsson
cec6165f25 map-agent: 4.5.0.30 2024-10-15 11:21:40 +02:00
Jakob Olsson
5e7b84c27e wifimngr: 16.2.1.7 2024-10-15 11:20:55 +02:00
Jakob Olsson
65d05cc880 libwifi: 7.4.16.15 2024-10-15 11:20:21 +02:00
Jakob Olsson
4de38e786e map-agent: 4.5.0.29 2024-10-14 13:47:27 +02:00
Vivek Kumar Dutta
6254930f2d icwmp: Fix empty ConnectionReqURL in Inform 2024-10-10 13:53:22 +05:30
Jakob Olsson
b849a95c5a map-agent: 4.5.0.28 2024-10-01 15:56:22 +02:00
Vivek Kumar Dutta
ea991cb4f9 obuspa: Fix AssignedRole with reboot 2024-09-27 17:46:35 +05:30
Jakob Olsson
fbfcb9276f map-controller: 4.5.0.11 2024-09-26 16:04:48 +02:00
Jakob Olsson
6b1cd1bde6 map-agent: 4.5.0.27 2024-09-26 16:04:16 +02:00
Xiaofeng Meng
b1f5afaca8 xmppc: Fix reconnection interval calculation 2024-09-26 08:23:10 +02:00
Janusz Dziedzic
ee2ba5a572 map-agent: 4.5.0.26 2024-09-20 10:54:31 +00:00
Vivek Kumar Dutta
91504ce01d bbfdm: failsafe input.json generation 2024-09-20 10:52:35 +05:30
Vivek Kumar Dutta
ab92c8ce5e icwmp: Skip Inform if ConnectionRequestURL is empty 2024-09-20 10:13:27 +05:30
Vivek Kumar Dutta
161cd68c3c xmppc: Support for re-connect when max_keepalive_fails 2024-09-17 12:46:40 +05:30
Suvendhu Hansa
eb675d1193 bbfdm: cherry-pick Device.Schedules DM 2024-09-16 06:55:35 +00:00
Vivek Kumar Dutta
1d4dbc59b4 icwmp: Fix memory leak 2024-09-06 22:14:06 +05:30
Rahul Thakur
3cb3a657d8 mcastmngr: handle multiple filters for mcproxy
the library script that converts uci to mcproxy config is generating
incorrect config for filtering ip addresses which leads to mcproxy
not even starting when multiple filters are defined.

this commit fixes the above described issue.
2024-09-06 16:21:22 +05:30
Mohd Husaam Mehdi
7f1898a0cc bbfdm: fix IP.ActivePort specific instance cannot be fetched 2024-09-06 12:46:51 +05:30
Jakob Olsson
cee142b761 map-agent: 4.5.0.25 2024-09-05 11:35:32 +02:00
Rahul Thakur
c1d70ea983 update package libethernet
* 3853c55 libethernet: Improve counter logic for Airoha.
2024-08-27 17:07:24 +05:30
Markus Gothe
385bf86e99 update package libethernet
* libethernet: Improve counter logic for Airoha.
2024-08-23 16:47:54 +02:00
Rahul Thakur
31645bc7fa update package libethernet
* d94e302 libethernet: removed unwanted code in rmon stats
* a82181d libethernet: corrected bcm rmonstats
* be00aa9 econet: Handle unbound HSGMII LAN interfaces.
2024-08-23 16:47:46 +02:00
Rahul Thakur
f1a355b7b8 urlfilter: update regex
* update regex handling
* simplify iptables rules to setup nfq into single rule
* update makefile to not compile urlfilter as a kernel module
2024-08-20 11:57:54 +00:00
Vivek Kumar Dutta
fb245c8279 bbfdm: Fix setting empty values with json plugins 2024-08-19 17:25:14 +05:30
Jakob Olsson
e0e2ed34ab map-controller: 4.5.0.10 2024-08-09 16:22:25 +02:00
Jakob Olsson
303d26a12e Revert "map-agent: 4.5.0.25"
This reverts commit f7ec53c0a1.
2024-08-09 16:20:50 +02:00
Jakob Olsson
f7ec53c0a1 map-agent: 4.5.0.25 2024-08-09 16:07:44 +02:00
Vivek Kumar Dutta
b390b46c07 obuspa: enabled dm_caching_exclude in default config 2024-08-02 18:52:33 +05:30
Mohd Husaam Mehdi
ac19369e3e bbfdm: move Device.IP.ActivePort. implementation to libbbfdm
the implementation has been merged with ip.c
2024-07-31 11:52:44 +05:30
Mohd Husaam Mehdi
4565208573 bbfdm: remove active port package
Support for Device.IP.ActivePort has been added directly in
libbbfdm, so separate package is not needed.
* Removed from bbfdm
* Removed from iop/config
2024-07-29 12:22:41 +05:30
Amit Kumar
f174cd5e12 urlfilter: updated ebtables command
* used concurrent option with ebatables
2024-07-26 16:17:34 +05:30
Amit Kumar
b1aa6341a2 urlfilter: iptables rule handled for dns over tcp
* changes taken from devel for handling DNS over tcp
2024-07-26 12:20:27 +05:30
Vivek Kumar Dutta
bf6af55ba6 hostmngr: remove host instances from dmmap 2024-07-25 19:35:57 +05:30
Mohd Husaam Mehdi
ad0d093b23 iop: enable active-port package
This package provides support for Device.IP.ActivePort. datamodel
object.
2024-07-22 10:44:23 +05:30
Mohd Husaam Mehdi
bcf799389d bbfdm: add support for Device.IP.ActivePort
A package is added in bbfdm Makefile, which installs:

* json file for ActivePort data model object mapped to ubus call
* daemon that implements active-port ubus call
2024-07-16 12:04:04 +05:30
Vivek Kumar Dutta
950023a786 obuspa: Updated Hosts ACL for user 2024-07-08 16:43:55 +05:30
Vivek Kumar Dutta
73246e703a obuspa: fix crash in reboot/reset 2024-07-05 14:04:58 +05:30
Suvendhu Hansa
0e59720ad9 obuspa: new MQTT client connection at runtime 2024-07-01 08:54:14 +00:00
Suvendhu Hansa
79e91c2458 obuspa: mqtt retry params change at runtime 2024-07-01 08:52:43 +00:00
Filip Matusiak
43b5cdf816 wifimngr: 16.2.1.6 2024-06-21 13:57:24 +02:00
Vivek Kumar Dutta
f48cf5a3ab swmodd: 2.5.3.2
Update default bundle root to '/container', swmodd only starts if '/container'
mounted and accessible. Mounting of persistent storage to '/container' is
out of scope of swmodd.

Sharing host network added with config.json
2024-06-17 18:35:22 +05:30
Erik Karlsson
0924ffc34a usp-js: depend on OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL
This avoids the need for duplicating local MQTT broker setup.
2024-06-14 14:48:07 +02:00
Erik Karlsson
ee38bf37d9 obuspa: split up OBUSPA_ENABLE_TEST_CONTROLLER configuration
A separate OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL configuration is added
which can be used by for example usp-js to accomplish local MQTT
broker setup but without compromising security by enabling remote
access. Appropriate dependencies are also added. In addition
unnecessary uci_load commands and misspelled and unnecessary
require_certificates mosquitto option are removed.
2024-06-14 14:48:07 +02:00
Filip Matusiak
853ae1f351 ieee1905: 8.3.4.11 2024-06-14 13:17:31 +02:00
Marina Maslova
1e5effb7fb map-agent: 4.5.0.24 2024-06-13 14:59:26 +04:00
Marek Puzyniak
c1a83b94f3 map-controller: 4.5.0.9 2024-06-12 11:59:18 +00:00
Marek Puzyniak
d68aee3e75 libwifi: 7.4.16.14 2024-06-11 15:17:21 +00:00
Amit Kumar
1d5b6f239f mcastmngr: Handled max multicast snoop entry
* removed +2 logic as multicast snoop entry handled in mcproxy
 with logic to exclude count of reserve mcast ip address subnet
2024-06-10 14:49:37 +05:30
Marek Puzyniak
952e789c6d decollector: 4.2.1.1.5 2024-06-10 07:45:39 +00:00
Vivek Kumar Dutta
4ae6af4322 bbfdm: config options for core TR181 datamodels 2024-06-07 23:21:09 +05:30
Vivek Kumar Dutta
cf3309e0e5 obuspa: 7.0.5.6.6 2024-06-07 14:01:47 +05:30
Vivek Kumar Dutta
3affc786d4 obuspa: Fix dhcp onboarding 2024-06-07 12:49:33 +05:30
Vivek Kumar Dutta
7c23220712 hostmngr: define datamodel plugin dir 2024-06-06 18:47:53 +05:30
Vivek Kumar Dutta
73ce886e9a obuspa: configure instance refresh timer 2024-06-06 15:21:36 +05:30
Vivek Kumar Dutta
b9e84a8679 bbfdm: optimize instance refresh handler 2024-06-06 15:20:14 +05:30
Marina Maslova
e9eae90cef map-agent: 4.5.0.23 2024-06-05 17:50:30 +04:00
Vivek Kumar Dutta
b02190065a bbfdm: config option to include (Dis)Association table 2024-06-05 15:18:19 +05:30
nevadita.chatterjee
bf6b547783 decollector: 4.2.1.1.4 2024-06-05 14:06:32 +05:30
Filip Matusiak
c42779c963 map-controller: 4.5.0.8 2024-06-05 10:10:08 +02:00
Marek Puzyniak
951a880017 decollector: 4.2.1.1.3 2024-06-04 12:23:20 +00:00
Jakob Olsson
de4b7fca62 map-agent: introduce config option that passes PERSIST_CONTROLLER CLFLAG 2024-06-04 13:48:40 +02:00
Jakob Olsson
a78540790d map-agent: 4.5.0.22 2024-06-04 13:48:37 +02:00
Jakob Olsson
9c6c25bf4b map-controller: 4.5.0.7 2024-06-04 13:48:03 +02:00
Jakob Olsson
cbdad382a2 map-agent: map_genconfig: don't modify mapcontroller enabled unconditionally 2024-06-04 13:48:03 +02:00
Filip Matusiak
482c1a1a81 map-agent: 4.5.0.21 2024-06-03 16:25:21 +02:00
Janusz Dziedzic
324280cf8f libwifi: 7.4.16.13 2024-06-03 11:16:59 +00:00
Vivek Kumar Dutta
49874bc3ef obuspa: host AccessControl access for user role 2024-05-30 18:56:56 +05:30
Vivek Kumar Dutta
8820fc7d73 swmodd: 2.5.3.1 2024-05-30 14:35:49 +05:30
Vivek Kumar Dutta
018c6ef9c4 icwmp: retries in deviceID get 2024-05-29 17:12:38 +05:30
Filip Matusiak
da51891a58 map-controller: 4.5.0.6 2024-05-24 10:52:10 +02:00
Amit Kumar
c794673a8a Update package urlfilter
* ebf8afb Allow setting URL in Blacklist/Whitelist URL
* 7507725 urlfilter: do not populate list if global blacklisting is disabled
* 9142ba3 urlfilter: fix building with glibc
* 898c4a9 filter: don't allocate UCI context and don't get UCI package more than once
2024-05-24 06:41:37 +00:00
Janusz Dziedzic
cae61fd18b libwifi: 7.4.16.12 2024-05-20 10:40:05 +00:00
Vivek Kumar Dutta
7e5b565190 bbfdm: Support PeriodicStats Push event 2024-05-16 15:47:09 +05:30
Vivek Kumar Dutta
4ca088bea5 periodicstats: Add support for push event 2024-05-16 14:23:14 +05:30
Marek Puzyniak
b1bbb6e056 decollector: 4.2.1.1.2 2024-05-15 14:35:47 +00:00
Marek Puzyniak
daca8e977f libwifi: 7.4.16.11 2024-05-15 14:34:03 +00:00
Markus Gothe
061bede64d mcastmngr: Airoha multicast snooping needs to be toggled to work.
We need to flush the mdb entries when configuring multicast
snooping on Airoha.

This commit fixes a bug where blocking multicast snooping doesn't
work.
2024-05-15 11:14:09 +00:00
Janusz Dziedzic
177dab28d1 csmngr: 1.0.1 2024-05-15 07:35:17 +00:00
Anjan Chanda
ae769b4dee csmngr: 0.0.5 2024-05-15 07:09:05 +00:00
Anjan Chanda
0ef82d3d0f csmngr: 0.0.4 2024-05-15 07:09:05 +00:00
Anjan Chanda
fdbe5689e2 csmngr: 0.0.2 2024-05-15 07:09:05 +00:00
Anjan Chanda
30cafc9b45 csmngr: 0.0.1 2024-05-15 07:09:05 +00:00
Janusz Dziedzic
e8a683a8ac libwifi: 7.4.16.10 2024-05-15 06:52:45 +00:00
Vivek Kumar Dutta
502dec56b3 obuspa: optimised uci update on reload 2024-05-14 10:48:37 +05:30
Filip Matusiak
3f5a3cb200 map-controller: 4.5.0.5 2024-05-13 14:28:26 +02:00
Jakob Olsson
fea1da3b53 map-agent: 4.5.0.20 2024-05-08 11:37:36 +02:00
Marina Maslova
7405571200 libwifi: 7.4.16.9, wifimngr: 16.2.1.5 2024-05-08 11:48:29 +04:00
Vivek Kumar Dutta
21a1a32f27 bbfdm: optimised wifi key handling 2024-05-07 16:33:20 +05:30
Janusz Dziedzic
fa402fdb2e libwifi: 7.4.16.8 2024-05-06 10:49:57 +00:00
Vivek Kumar Dutta
6f85fbd7ca bbfdm: Fix PossibleChannels with radio down 2024-05-06 16:00:13 +05:30
Markus Gothe
058bfb4c8a hostmngr: Don't try to resolve IP-adresses in firewall.
Using iptables --list without -n takes a long time
on some configurations during boot up which is a problem.

This commit resolves this by not trying resolve hostnames
as it is not necessary for the functionality.

It also splits up the check in two: one for IPv4 and one
for IPv6 to make the logic more robust and fail-safe.
2024-05-03 07:04:36 +00:00
Mohd Husaam Mehdi
3003cb98f4 bbfdm: add udhcpc.user.d script to store dhcp lease start time
DCHP lease start time is needed to calculate remaining lease time
which is needed for Device.DHCPv4.Client.{i}.LeaseTimeRemaining.

Earlier this was being provided via interface.status, but that was
leading to unnecessary hotplug events for interface data update so
it had to be removed from there.

Add the logic in udhcpc.user.d script separate from netifd as
there does not seem to be a need in netifd for this information.
2024-05-02 19:20:28 +05:30
Vivek Kumar Dutta
762835179d obuspa: disable E2ESession 2024-04-27 11:12:44 +05:30
Vivek Kumar Dutta
29beb2dd33 periodicstats: CalculationMode and bug fixes 2024-04-26 18:13:15 +05:30
Amin Ben Romdhane
1a20be1c9d obuspa: 7.0.5.6.0 2024-04-26 00:42:33 +02:00
Amin Ben Romdhane
52b92afac7 icwmp: 9.5.29.11 2024-04-26 00:40:31 +02:00
Amin Ben Romdhane
edff254a69 bbfdm: 1.4.23.15 2024-04-26 00:39:11 +02:00
Erik Karlsson
58cc602f8f mcastmngr: handle multiple upstream interface sections
Do not overwrite mcast configuration if there are multiple interface
sections referring to the same upstream device such as wan/wan6

(cherry picked from commit 2214fd99e8)
2024-04-25 11:09:15 +02:00
Janusz Dziedzic
1f4e445894 wifimngr: 16.2.1.4 2024-04-24 15:53:36 +00:00
Janusz Dziedzic
3460ddd956 libwifi: 7.4.16.7 2024-04-24 15:52:54 +00:00
Jakob Olsson
b6f0dc71e4 map-controller: 4.5.0.4 2024-04-23 16:18:41 +02:00
Jakob Olsson
74a1470463 map-agent: 4.5.0.19 2024-04-23 15:47:22 +02:00
Jakob Olsson
d31a9abd2f wifimngr: 16.2.1.3 2024-04-23 15:44:11 +02:00
Jakob Olsson
ee74a4a06b libwifi: 7.4.16.6 2024-04-23 15:41:13 +02:00
Markus Gothe
5ec644e052 qosmngr: Fix filtering on TOS field for non-Broadcom platforms. 2024-04-22 14:17:48 +00:00
Vivek Kumar Dutta
0787af4769 rulengd: enabled extended regex for pattern matching
(cherry picked from commit 016dbef779)
2024-04-22 12:50:30 +00:00
Vivek Kumar Dutta
66aa4bf8de tr104: fix alias for sip client 2024-04-20 13:33:01 +05:30
Vivek Kumar Dutta
98d0c9b490 bbfdm: Fix IP and Bridge alias 2024-04-20 13:28:17 +05:30
Anjan Chanda
b853cc5bfb ieee1905: 8.3.4.10 2024-04-16 19:34:48 +02:00
Janusz Dziedzic
458938d614 libwifi: 7.4.16.5 2024-04-12 07:20:43 +00:00
Vivek Kumar Dutta
d6514f0128 periodicstats: 1.5.5 2024-04-11 13:53:52 +05:30
Jakob Olsson
3bab7956a3 map-agent: config: disable dynamic controller sync by default 2024-04-11 10:23:24 +02:00
Vivek Kumar Dutta
5e19d4aa13 icwmp: fix uci commit issue 2024-04-11 10:35:09 +05:30
Vivek Kumar Dutta
49b4528cc9 periodicstats: Fix service reloadwq 2024-04-11 10:25:16 +05:30
Jakob Olsson
60b009b24c map-agent: config: enable island prevention 2024-04-10 14:12:22 +02:00
Markus Gothe
8ee4951532 mcastmngr: Fix typo in Broadcom snooping.
(cherry picked from commit 65fbf9958d)
2024-04-09 12:18:54 +02:00
Vivek Kumar Dutta
9c93a7157e obuspa: workaround for mqtt unreachable hosts 2024-04-04 12:49:32 +05:30
Marek Puzyniak
46f4f18888 decollector: 4.2.1.1.1 2024-04-02 12:49:53 +00:00
Sukru Senli
8da087908c map-agent: remove unused include 2024-03-27 11:40:25 +01:00
Rahul Thakur
3094ca245f mcastmgr: remove outdated comment 2024-03-27 11:35:47 +01:00
Sukru Senli
0b2321a306 map-agent: map-dynamic-backhaul: replace deprecated get_network_of function usage 2024-03-27 11:33:03 +01:00
Vivek Kumar Dutta
fe03fe073f icwmp: align with bbfdm 2024-03-27 15:51:22 +05:30
Vivek Kumar Dutta
815ddf9f7a bbfdm: Support Cancelled diagnostics state 2024-03-27 15:47:38 +05:30
Vivek Kumar Dutta
bb47ceff49 bbfdm: fix refresh instances 2024-03-27 11:01:11 +05:30
Jakob Olsson
e57a60bab3 map-agent: config: set enabled '1' as default 2024-03-26 14:13:40 +01:00
Sukru Senli
ad4869ac85 map-agent: map_genconfig: set full as default multiap_mode 2024-03-26 10:33:14 +01:00
Rahul Thakur
16034d1c98 Update package libethernet
* cc72f5a libethernet: fix log spam
2024-03-26 12:56:01 +05:30
Erik Karlsson
caae5d92f4 testnet: avoid potential race condition
Instead of running a second instance of testnet once and in parallel
with the background task on interface up/down, the background task is
woken up. The avoids the potential for a race where under certain
circumstances a ubus event for internet up or down may never be sent.

Also remove unused include and add missing quotation.

(cherry picked from commit ec7ba74900)
2024-03-25 15:55:13 +00:00
Sukru Senli
e64cfa29e4 testnet: remove unused include
(cherry picked from commit 9cdba3b3e0)
2024-03-25 15:55:13 +00:00
Vivek Kumar Dutta
d358cf56bd rulengd: execute action when no match expression defined
(cherry picked from commit bc0e021b3c)
2024-03-25 15:55:13 +00:00
Jakob Olsson
b86902dcbd libeasy: 7.4.3 2024-03-25 16:54:20 +01:00
Jakob Olsson
ed7bf0fab1 map-agent: 4.5.0.18 2024-03-25 15:37:31 +01:00
George Yang
8e5bf24ab0 libvoice-broadcom: Support Poland by adding VRG_COUNTRY_POLAND 2024-03-25 11:55:36 +01:00
Markus Gothe
9e518aa011 ponmngr: Refactor code.
Cleanup code and make sure we can use whitespace
in passwords.

(cherry picked from commit b8b2dcb6fe)
2024-03-20 20:41:24 +04:00
Markus Gothe
f654b5c350 ponmngr: Fix LOID password on Airoha.
The LOID password can never have worked on
Airoha since the syntax is wrong.

(cherry picked from commit 504d124486)
2024-03-20 20:41:15 +04:00
Marina Maslova
cb4620da03 libwifi: 7.4.16.4 2024-03-19 11:45:41 +04:00
Vivek Kumar Dutta
2a4594b30c obuspa: fix operate response within session 2024-03-18 17:38:37 +05:30
Erik Karlsson
df87055d04 bbfdm: fix shell injection in /etc/firewall.portmap
Rework the script to use iptables-restore instead of eval


(cherry picked from commit cf8350b6b365429aa68f0f957f79eb31bb43e2db)
2024-03-16 05:18:08 +00:00
Erik Karlsson
32848d7f69 bbfdm: fix shell injection in /etc/firewall.service
Avoid use of eval


(cherry picked from commit 53167364863ef4afc249045fe5dcb510e3ec164d)
2024-03-16 05:17:35 +00:00
Yalu Zhang
fd842a5638 voicemngr-1.1.8: Support K-break 2024-03-15 16:36:24 +01:00
George Yang
0acfc03ce7 Fix voicemngr crash if no extension exists in asterisk config 2024-03-15 14:20:58 +01:00
George Yang
715ac12974 mcastmngr: Set the "igmp" as the default protocol for mcast proxy/snooping config
For example, in the current LUCI iptv page, option "proto" is not provided, and IGMP is assumed.

(cherry picked from commit 8b39953242)
2024-03-15 10:30:31 +01:00
Erik Karlsson
22f0aa3ea7 hostmngr: avoid creating /scripts directory in the root
(cherry picked from commit 356c6c76d2)
2024-03-13 12:00:42 +00:00
Rahul Thakur
01e4ff2c8b netmode: disable firewall for l2 netmode
since the intent for l2 netmode is to accept all traffic, hence,
disable firewall on top of zone lan's input/output/forward being
ACCEPT/ACCEPT/ACCEPT

Please note: when firewall is disabled, it esentially set's input
to ACCEPT, it does not stop or disable fw3.
2024-03-13 17:24:43 +05:30
Vivek Kumar Dutta
2aa679f209 icwmp: 9.5.29.8 2024-03-13 11:56:02 +05:30
Vivek Kumar Dutta
2a2ce30792 stunc: 1.3.3.1 2024-03-13 11:54:49 +05:30
George Yang
d5eb8f6335 libvoice-broadcom: asterisk uci-defaults
Create voice extensions base on product data base
2024-03-12 10:44:42 +01:00
Marek Puzyniak
0c09c1044c map-controller: 4.5.0.3 2024-03-11 21:20:39 +00:00
Marek Puzyniak
34670fb071 map-agent: 4.5.0.17 2024-03-11 20:37:52 +00:00
Marek Puzyniak
d7c9fdf574 ieee1905: 8.3.4.3 2024-03-11 20:24:43 +00:00
Jakob Olsson
61e6d6e6d0 map-agent: config: remove deprecated netdev option from default config 2024-03-11 11:01:23 +01:00
Janusz Dziedzic
07d3d98709 libwifi: 7.4.16.3 2024-03-07 19:22:26 +00:00
Jakob Olsson
ea3805e531 map-agent: 4.5.0.16 2024-03-07 15:22:53 +01:00
Jakob Olsson
712e05fbeb wifimngr: 16.2.1.2 2024-03-07 15:21:59 +01:00
Jakob Olsson
bfb51eb501 libwifi: 7.4.16.2 2024-03-07 15:21:21 +01:00
Rahul Thakur
7ccc61effe ethmngr: fix pause stats appearing twice in ubus output 2024-03-07 10:17:38 +05:30
Rahul Thakur
3a85319a74 ethmngr: add pause frame support
* e96775c Add pause packets for rmon statistics
* f11bdbe ethmngr: Add support for representing pause frames over UBUS.
2024-03-06 17:02:17 +05:30
Rahul Thakur
95c50f0808 libethernet: add pause frame support
df0181a Add rudimentary support for pause frames.
797a2b1 Add pause packets counters and get it for airoha
99d02dc linux: pause frame stats increment
2024-03-06 16:59:46 +05:30
Yalu Zhang
fda7416852 libvoice-broadcom-1.0.9: Do not use 'latency' DSP parameter for averageRoundTripDelay 2024-03-05 17:07:14 +01:00
Vivek Kumar Dutta
f25274d726 usp-js: use usp-1.2 spec for qjs 2024-03-04 19:22:57 +05:30
Vivek Kumar Dutta
6ba197ce98 bbfdm: Fix usp session revert operate command 2024-03-04 17:49:43 +05:30
Vivek Kumar Dutta
0e2dc2f81c obuspa: 7.0.5.5.7 2024-03-01 19:46:28 +05:30
Vivek Kumar Dutta
34a285bc6b bbfdm: 1.4.23.10 2024-03-01 16:03:31 +05:30
Vivek Kumar Dutta
da455c0808 obuspa: 7.0.5.5.6 2024-03-01 16:02:15 +05:30
Vivek Kumar Dutta
07ac62e428 bbfdm: Fix open network issue with SetSSID 2024-02-29 20:01:40 +05:30
Jakob Olsson
ccf5a26c17 map-agent: 4.5.0.15 2024-02-28 14:02:08 +01:00
Jakob Olsson
f9e1decc9a map-agent: map-dynamic-backhaul: use brctl delif to remove bsta from bridge
Map-agent now uses libeasy rather than netifd
2024-02-28 14:01:27 +01:00
George Yang
21170ae143 voicemngr: 1.1.7
Do not delete extensions in asterisk UCI config even if they are not used
2024-02-23 12:45:02 +01:00
Amin Ben Romdhane
9dbf0bc0e5 bbfdm: 1.4.23.8 2024-02-23 12:39:58 +01:00
Jakob Olsson
b5707298be map-agent: 4.5.0.14 2024-02-23 12:23:05 +01:00
Mohd Husaam Mehdi
a73b9b1dec mcastmngr: do not hard code snooping_mode to 1 for proxy sections 2024-02-21 08:37:11 +00:00
Vivek Kumar Dutta
bd830ca37b bbfdm: Updated dhcp options parsing 2024-02-20 16:14:26 +05:30
Wenpeng Song
014f35b7ab dectmngr: 3.6.5
* 192e74db: Simulate flash hook when answering the second calls for call waiting  
* dd5288df: Fix a crash on incoming calls sometimes  
* f970cd28: Fix UART communication issue in RDK  
* 804678ba: Make UCI configuration path configurable
2024-02-20 10:41:33 +00:00
Wenpeng Song
0a9f5c30c9 voicemngr: 1.1.6
Do not close the connection if DECT accepts the second call for call waiting
2024-02-20 10:37:31 +00:00
Erik Karlsson
c05e258ceb genconfig: set 0700/0600 on /etc/ssl/private
This is needed so that private keys provided via default/customer
configuration do not become world readable.

Change-Id: I0e5d1b22730c7a44c82c34611412085fd500ce3a
2024-02-19 17:56:56 +00:00
Fredrik Eriksson
b318a5b6f2 RM#33371 - /etc/shadow globally readable ...
When this file is provided/overridden through customerconfigs it may get
too promiscous file permissions, so that any system user could read it
and someone could more easily extract a copy to run a password cracker
on.  Here we make sure access is limited to the root user only.

Change-Id: I74d15487639f94a7d10ce4fc609225632ce2971f
2024-02-19 17:56:56 +00:00
Arne Jonsson
1070248a0d iopsys: fix issues related to updated genconfig
(cherry picked from commit 01c1899208)
2024-02-19 17:46:49 +00:00
Arne Jonsson
9d3f965e62 iopsys: fix issue in feeds_update.sh in order to handle multiple custom feeds
(cherry picked from commit bec7eeaa33)
2024-02-19 17:46:49 +00:00
Vivek Kumar Dutta
ed690caaf1 sulu: 3.1.53 2024-02-19 19:34:14 +05:30
Vivek Kumar Dutta
ae5af97107 tr104: 1.0.13.3 2024-02-19 19:29:10 +05:30
Vivek Kumar Dutta
60b474355b obuspa: Fix fault in transaction retry 2024-02-19 17:43:13 +05:30
Vivek Kumar Dutta
1faed9afbd bbfdm: Use keep_settings for firmware download 2024-02-15 18:50:33 +05:30
George Yang
e6f090c9e6 Fine tune the default asterisk config 2024-02-15 10:49:29 +00:00
Vivek Kumar Dutta
532da477d9 icwmp: Use fw_upgrade_keep_settings in 6 Stored Images 2024-02-15 15:43:51 +05:30
Sukru Senli
ef281267db iop: deselect unusued atftp package 2024-02-13 15:03:25 +01:00
Vivek Kumar Dutta
51f19923c0 bbfdm: 1.4.23.5 2024-02-13 17:37:52 +05:30
Vivek Kumar Dutta
6cf78059d7 wifimngr: 16.2.1.1 2024-02-13 17:32:24 +05:30
Vivek Kumar Dutta
a913f05342 libwifi: 7.4.16.1 2024-02-13 17:31:57 +05:30
Jakob Olsson
83fb8b879b map-agent: 4.5.0.13 2024-02-12 11:04:49 +01:00
Vivek Kumar Dutta
af3cbff6d1 tr104: JSON and DotSO plugin override whole tree 2024-02-10 09:24:35 +05:30
Erik Karlsson
45dcdc7783 ieee1905: 8.3.4.2 2024-02-09 15:49:59 +01:00
Vivek Kumar Dutta
8997c156d9 icwmp: 9.5.29.6 2024-02-09 18:17:35 +05:30
Rohit Topno
25e01248c5 mcastmngr: fixed uci syntax error in init script
Problem description:
Multiple device section name fetched due
to wild card grep command.

Fix: modified grep command which gets exact device
section name based on device name.
2024-02-09 14:36:30 +05:30
Yalu Zhang
2e70d12fd7 Update packages voicemngr and libvoice-airoha
Support syslog levels and make it configurable.
2024-02-07 14:35:11 +01:00
Vivek Kumar Dutta
e47d128902 bbfdm: Fix overriding of core tree from plugins 2024-02-07 11:05:00 +05:30
Vivek Kumar Dutta
bb755d5774 sulu: 3.1.49 2024-02-07 10:45:19 +05:30
Vivek Kumar Dutta
250a89ca1d obuspa: Support for session and fix bulk event updater 2024-02-07 10:29:26 +05:30
Erik Karlsson
f139834fc7 testnet: start from init script and add missing dependency 2024-02-06 12:46:52 +01:00
Jakob Olsson
0a8fb82fa8 map-agent: 4.5.0.12 2024-02-01 16:34:59 +01:00
Vivek Kumar Dutta
0c8626ef5e icwmp: Fix inform parameters 2024-02-01 17:16:18 +05:30
Vivek Kumar Dutta
dbd0fc3e17 bbfdm: Fix gpn issues with datamodel micro-services 2024-02-01 17:14:55 +05:30
Jakob Olsson
267a855faf hostmngr: 1.1.7 2024-02-01 11:32:38 +01:00
Jakob Olsson
cea30db473 ieee1905: 8.3.5 2024-02-01 11:31:30 +01:00
Sukru Senli
532aab72ee testnet: move it to its own package, out of netmode 2024-01-30 11:32:43 +01:00
Sukru Senli
1a6a42b0ca netmode: move l2mode from eval profile to here 2024-01-30 11:30:33 +01:00
Jakob Olsson
2d21fa7e95 map-agent: 4.5.0.11 2024-01-29 17:47:19 +01:00
Jakob Olsson
8a120f056a hostmngr: 1.1.6 2024-01-26 12:14:45 +01:00
Jakob Olsson
6e2083e30e hostmngr: 1.1.5 2024-01-25 15:04:41 +01:00
Vivek Kumar Dutta
9c50c4c41b sulu: 3.1.48 2024-01-24 18:58:02 +05:30
Vivek Kumar Dutta
689905913c obuspa: option to define max controller 2024-01-23 18:03:19 +05:30
Rahul Thakur
c17d03ef56 qosmngr: fix lan traffic limited to 1G always
Problem description:
Two problems seen,
1. The queues on a port are by default setup to handle maximum rate
   of 1G
2. The default qos uci config for ipq and brcm platforms is different

Fix:
1. Update queue setup to not impose rate limit, by setting the maximum
   rate as the maximum rate supported by the port.
2. Update uci default script to generate same config for both platforms
2024-01-23 15:32:22 +05:30
Vivek Kumar Dutta
0c65d03dca bbfdm: Fix ipping unreachable host error 2024-01-23 10:06:42 +05:30
Wenpeng Song
aeca33ecae voicemnr: 1.1.4
Add support for single or multiple call mode
2024-01-19 07:28:27 +00:00
Vivek Kumar Dutta
150730e3e2 tr104: Add support for VoiceService.{i}.SIP.Client.{i}.Network. 2024-01-19 11:03:07 +05:30
Rahul Thakur
bc5d99459d inbd: remove package
remove deprecated package
2024-01-16 17:39:59 +05:30
Rahul Thakur
2e4b1c84ac iop: deprecate inbd
The package inbd is deprecated with the logic for generation of
hotplug events for dsl and ethernet ports having been moved to
dslmngr and ethmngr respectively.
2024-01-16 17:28:12 +05:30
Rahul Thakur
49a823a046 dslmngr: add support for hotplug event
Changes done:
1. Add support for hotplug event generation
2. Fix pipeline and static code analysis error/warnings
3. Rectify package source URL.
2024-01-16 17:28:07 +05:30
Rahul Thakur
7ba428e4b2 ethmngr: add support for generation hotplug event
Changes:
1. Add support for generating hotplug event
2. Update makefile to have prepare section for local development.
3. Update URL to point to updated location for ethmngr
2024-01-16 17:27:59 +05:30
Vivek Kumar Dutta
f215dd2fb8 sulu: 3.1.45 2024-01-15 12:12:08 +05:30
Elena Vengerova
e9f91b465f voicemngr 1.1.3 2024-01-12 20:28:42 +04:00
Elena Vengerova
6f4e3daffb libvoice_airoha 1.0.11 2024-01-12 14:34:33 +04:00
Elena Vengerova
9ecc88fc72 Airoha: set the default transmit and receive gain in the UCI config 2024-01-12 09:00:53 +00:00
Vivek Kumar Dutta
a9a44c2b13 tr104: 1.0.13 2024-01-09 20:20:58 +05:30
Sukru Senli
71316b37e3 iop: config: switch to using iputils arping and ping
instead of busybox arping and ping
2024-01-09 15:28:32 +01:00
Vivek Kumar Dutta
bb3267649f sulu: 3.1.44 2024-01-09 15:19:51 +05:30
Vivek Kumar Dutta
ae630fc142 icwmp: Fix setting empty parameterkey 2023-12-29 18:08:48 +05:30
Vivek Kumar Dutta
9f71023857 icwmp: Fix logging and acs_changed detection 2023-12-27 21:16:48 +05:30
Vivek Kumar Dutta
8a86868513 obuspa: Fix admin/user datamodel permissions 2023-12-27 17:11:37 +05:30
Vivek Kumar Dutta
91edc0fc99 icwmp: 9.5.29.2 2023-12-26 23:26:18 +05:30
Vivek Kumar Dutta
a2bbe00934 bbfdm: Top down config DHCPv4 Server Pool 2023-12-26 16:11:49 +05:30
Vivek Kumar Dutta
3861cb8714 icwmp: Fix random failures in UploadRPC 2023-12-26 13:07:06 +05:30
Vivek Kumar Dutta
c94232f071 sulu: Use multipart download for local fw 2023-12-25 20:37:34 +05:30
Vivek Kumar Dutta
9cdc3e8265 obuspa: Support multipart download 2023-12-25 20:37:10 +05:30
122 changed files with 3039 additions and 2285 deletions

View File

@@ -1,3 +1,7 @@
config BBF_VENDOR_EXTENSION
bool "Enable Vendor Extension"
default y
config BBF_VENDOR_LIST
string "Vendor List"
default "iopsys"
@@ -6,14 +10,168 @@ config BBF_VENDOR_PREFIX
string "Vendor Prefix"
default "X_IOPSYS_EU_"
config BBF_TR143
bool "Enable TR-143 Data Model Support"
default y
config BBF_TR471
bool "Enable TR-471 Data Model Support"
default y
config BBF_MAX_OBJECT_INSTANCES
int "Maximum number of instances per object"
default 255
menu "TR181 Datamodels"
depends on PACKAGE_libbbfdm
config BBF_TR143
bool "Enable TR-143 Data Model Support"
default y
config BBF_TR471
bool "Enable TR-471 Data Model Support"
default y
config BBFDM_TR181_ATM
bool "Include Device.ATM."
default y
config BBFDM_TR181_BRIDGING
bool "Include Device.Bridging."
default y
config BBFDM_TR181_DDNS
bool "Include Device.DynamicDNS."
default y
config BBFDM_TR181_DEVICEINFO
bool "Include Device.DeviceInfo."
default y
config BBFDM_TR181_DEVICEINFO_PROCESSSTATUS
bool "Include Device.DeviceInfo.ProcessStatus."
default y
config BBFDM_TR181_DHCPv4
bool "Include Device.DHCPv4."
default y
config BBFDM_TR181_DHCPv6
bool "Include Device.DHCPv6."
default y
config BBFDM_TR181_DNS
bool "Include Device.DNS."
default y
config BBFDM_TR181_DSL
bool "Include Device.DSL."
default y
config BBFDM_TR181_ETHERNET
bool "Include Device.Ethenet."
default y
config BBFDM_TR181_FAST
bool "Include Device.FAST."
default y
config BBFDM_TR181_FIREWALL
bool "Include Device.Firewall."
default y
config BBFDM_TR181_GATEWAYINFO
bool "Include Device.GatewayInfo."
default y
config BBFDM_TR181_GRE
bool "Include Device.GRE."
default y
config BBFDM_TR181_IEEE1905
bool "Include Device.IEEE1905."
default y
config BBFDM_TR181_INTERFACESTACK
bool "Include Device.InterfaceStack."
default y
config BBFDM_TR181_IP
bool "Include Device.IP."
default y
config BBFDM_TR181_LANCONFSEC
bool "Include Device.LANonfigSecurity."
default y
config BBFDM_TR181_MQTT
bool "Include Device.MQTT."
default y
config BBFDM_TR181_NAT
bool "Include Device.NAT."
default y
config BBFDM_TR181_PACKETCAPTURE
bool "Include Device.PacketCaptureDiagnostics."
default y
config BBFDM_TR181_PPP
bool "Include Device.PPP."
default y
config BBFDM_TR181_PTM
bool "Include Device.PTM."
default y
config BBFDM_TR181_QOS
bool "Include Device.QoS."
default y
config BBFDM_TR181_ROUTERADVERTISEMENT
bool "Include Device.RouterAdvertisement."
default y
config BBFDM_TR181_ROUTING
bool "Include Device.Routing."
default y
config BBFDM_TR181_SECURITY
bool "Include Device.Security."
default y
config BBFDM_TR181_SELFTEST
bool "Include Device.SelfTestDiagnostics."
default y
config BBFDM_TR181_SSH
bool "Include Device.SSH."
default y
config BBFDM_TR181_TIME
bool "Include Device.Time."
default y
config BBFDM_TR181_UPNP
bool "Include Device.UPnP."
default y
config BBFDM_TR181_USB
bool "Include Device.USB."
default y
config BBFDM_TR181_USERINTERFACE
bool "Include Device.UserInterface."
default y
config BBFDM_TR181_WIFI
bool "Include Device.WiFi."
default y
config BBFDM_TR181_WIFI_DATAELEMENTS
bool "Include Device.WiFi.DataElements."
default y
config BBFDM_TR181_WIFI_DATAELEMENTS_ASSOCEVENTS
bool "Include deprecated AssociationEventData/DisassociationEventData tables"
default n
help
TR181-2.17 deprecates below dataelements tables
- Device.WiFi.DataElements.AssociationEvent.AssociationEventData.{i}.
- Device.WiFi.DataElements.DisassociationEvent.DisassociationEventData.{i}.
If this option is selected, above mentioned tables shall be added in datamodel.
endmenu

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bbfdm
PKG_VERSION:=1.7.4
PKG_VERSION:=1.4.23.29
USE_LOCAL:=0
ifneq ($(USE_LOCAL),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
PKG_SOURCE_VERSION:=57a3aedb8f6dea2a951d3edf1da0c868e252b27c
PKG_SOURCE_VERSION:=2f1dac5686f54219fc7706c677905816b650dd1c
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -21,24 +21,56 @@ PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
include bbfdm.mk
define Package/libbbfdm-api
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=BBF datamodel library, provides API to extend datamodel using DotSO plugins
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libcurl
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
ABI_VERSION:=1.0
endef
define Package/libbbfdm
define Package/libbbfdm/default
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Library for broadband forum data model support
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api \
+BBF_TR471:obudpst +libopenssl
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libcurl +libbbfdm-api \
+BBF_TR471:obudpst
MENU:=1
endef
define Package/libbbfdm
$(Package/libbbfdm/default)
TITLE += (default)
VARIANT:=default
DEPENDS += +PACKAGE_libbbfdm-openssl:libopenssl
DEFAULT_VARIANT:=1
endef
define Package/libbbfdm-mbedtls
$(Package/libbbfdm/default)
TITLE += (mbedtls)
DEPENDS += +PACKAGE_libbbfdm-mbedtls:libmbedtls
VARIANT:=mbedtls
CONFLICTS := libbbfdm libbbfdm-openssl libbbfdm-wolfssl
endef
define Package/libbbfdm-openssl
$(Package/libbbfdm/default)
TITLE += (openssl)
DEPENDS += +PACKAGE_libbbfdm-openssl:libopenssl
VARIANT:=openssl
CONFLICTS := libbbfdm libbbfdm-mbedtls libbbfdm-wolfssl
endef
define Package/libbbfdm-wolfssl
$(Package/libbbfdm/default)
TITLE += (wolfssl)
DEPENDS += +PACKAGE_libbbfdm-wolfssl:libwolfssl
VARIANT:=wolfssl
CONFLICTS := libbbfdm libbbfdm-mbedtls libbbfdm-openssl
endef
define Package/bbfdmd
@@ -46,7 +78,20 @@ define Package/bbfdmd
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Datamodel ubus backend
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libbbfdm-api +libbbfdm
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libbbfdm-api +PACKAGE_libbbfdm-mbedtls:libbbfdm-mbedtls \
+PACKAGE_libbbfdm-openssl:libbbfdm-openssl +PACKAGE_libbbfdm-wolfssl:libbbfdm-wolfssl \
+PACKAGE_libbbfdm:libbbfdm
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
endef
define Package/libbbfdm/config
@@ -68,8 +113,153 @@ endef
endif
CMAKE_OPTIONS += \
-DBBF_TR181=ON
-DBBF_WIFI_DATAELEMENTS=ON
-DBBF_TR181=ON \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
ifeq ($(CONFIG_BBFDM_TR181_ATM),y)
TARGET_CFLAGS += -DBBFDM_TR181_ATM
endif
ifeq ($(CONFIG_BBFDM_TR181_BRIDGING),y)
TARGET_CFLAGS += -DBBFDM_TR181_BRIDGING
endif
ifeq ($(CONFIG_BBFDM_TR181_DDNS),y)
TARGET_CFLAGS += -DBBFDM_TR181_DDNS
endif
ifeq ($(CONFIG_BBFDM_TR181_DEVICEINFO),y)
TARGET_CFLAGS += -DBBFDM_TR181_DEVICEINFO
endif
ifeq ($(CONFIG_BBFDM_TR181_DEVICEINFO_PROCESSSTATUS),y)
TARGET_CFLAGS += -DBBFDM_TR181_DEVICEINFO_PROCESSSTATUS
endif
ifeq ($(CONFIG_BBFDM_TR181_DHCPv4),y)
TARGET_CFLAGS += -DBBFDM_TR181_DHCPv4
endif
ifeq ($(CONFIG_BBFDM_TR181_DHCPv6),y)
TARGET_CFLAGS += -DBBFDM_TR181_DHCPv6
endif
ifeq ($(CONFIG_BBFDM_TR181_DNS),y)
TARGET_CFLAGS += -DBBFDM_TR181_DNS
endif
ifeq ($(CONFIG_BBFDM_TR181_DSL),y)
TARGET_CFLAGS += -DBBFDM_TR181_DSL
endif
ifeq ($(CONFIG_BBFDM_TR181_ETHERNET),y)
TARGET_CFLAGS += -DBBFDM_TR181_ETHERNET
endif
ifeq ($(CONFIG_BBFDM_TR181_FAST),y)
TARGET_CFLAGS += -DBBFDM_TR181_FAST
endif
ifeq ($(CONFIG_BBFDM_TR181_FIREWALL),y)
TARGET_CFLAGS += -DBBFDM_TR181_FIREWALL
endif
ifeq ($(CONFIG_BBFDM_TR181_GATEWAYINFO),y)
TARGET_CFLAGS += -DBBFDM_TR181_GATEWAYINFO
endif
ifeq ($(CONFIG_BBFDM_TR181_GRE),y)
TARGET_CFLAGS += -DBBFDM_TR181_GRE
endif
ifeq ($(CONFIG_BBFDM_TR181_IEEE1905),y)
TARGET_CFLAGS += -DBBFDM_TR181_IEEE1905
endif
ifeq ($(CONFIG_BBFDM_TR181_INTERFACESTACK),y)
TARGET_CFLAGS += -DBBFDM_TR181_INTERFACESTACK
endif
ifeq ($(CONFIG_BBFDM_TR181_IP),y)
TARGET_CFLAGS += -DBBFDM_TR181_IP
endif
ifeq ($(CONFIG_BBFDM_TR181_LANCONFSEC),y)
TARGET_CFLAGS += -DBBFDM_TR181_LANCONFSEC
endif
ifeq ($(CONFIG_BBFDM_TR181_MQTT),y)
TARGET_CFLAGS += -DBBFDM_TR181_MQTT
endif
ifeq ($(CONFIG_BBFDM_TR181_NAT),y)
TARGET_CFLAGS += -DBBFDM_TR181_NAT
endif
ifeq ($(CONFIG_BBFDM_TR181_PACKETCAPTURE),y)
TARGET_CFLAGS += -DBBFDM_TR181_PACKETCAPTURE
endif
ifeq ($(CONFIG_BBFDM_TR181_PPP),y)
TARGET_CFLAGS += -DBBFDM_TR181_PPP
endif
ifeq ($(CONFIG_BBFDM_TR181_PTM),y)
TARGET_CFLAGS += -DBBFDM_TR181_PTM
endif
ifeq ($(CONFIG_BBFDM_TR181_QOS),y)
TARGET_CFLAGS += -DBBFDM_TR181_QOS
endif
ifeq ($(CONFIG_BBFDM_TR181_ROUTERADVERTISEMENT),y)
TARGET_CFLAGS += -DBBFDM_TR181_ROUTERADVERTISEMENT
endif
ifeq ($(CONFIG_BBFDM_TR181_ROUTING),y)
TARGET_CFLAGS += -DBBFDM_TR181_ROUTING
endif
ifeq ($(CONFIG_BBFDM_TR181_SECURITY),y)
TARGET_CFLAGS += -DBBFDM_TR181_SECURITY
endif
ifeq ($(CONFIG_BBFDM_TR181_SELFTEST),y)
TARGET_CFLAGS += -DBBFDM_TR181_SELFTEST
endif
ifeq ($(CONFIG_BBFDM_TR181_SSH),y)
TARGET_CFLAGS += -DBBFDM_TR181_SSH
endif
ifeq ($(CONFIG_BBFDM_TR181_TIME),y)
TARGET_CFLAGS += -DBBFDM_TR181_TIME
endif
ifeq ($(CONFIG_BBFDM_TR181_UPNP),y)
TARGET_CFLAGS += -DBBFDM_TR181_UPNP
endif
ifeq ($(CONFIG_BBFDM_TR181_USB),y)
TARGET_CFLAGS += -DBBFDM_TR181_USB
endif
ifeq ($(CONFIG_BBFDM_TR181_USERINTERFACE),y)
TARGET_CFLAGS += -DBBFDM_TR181_USERINTERFACE
endif
ifeq ($(CONFIG_BBFDM_TR181_WIFI),y)
TARGET_CFLAGS += -DBBFDM_TR181_WIFI
endif
ifeq ($(CONFIG_BBFDM_TR181_WIFI_DATAELEMENTS),y)
TARGET_CFLAGS += -DBBFDM_TR181_WIFI_DATAELEMENTS
endif
ifeq ($(CONFIG_BBFDM_TR181_WIFI_DATAELEMENTS_ASSOCEVENTS),y)
TARGET_CFLAGS += -DBBFDM_TR181_WIFI_DATAELEMENTS_ASSOCEVENTS
endif
ifeq ($(CONFIG_BBF_TR143),y)
CMAKE_OPTIONS += \
@@ -81,11 +271,33 @@ CMAKE_OPTIONS += \
-DBBF_TR471=ON
endif
ifeq ($(CONFIG_BBF_VENDOR_EXTENSION),y)
CMAKE_OPTIONS += \
-DBBF_VENDOR_EXTENSION=ON
CMAKE_OPTIONS += \
-DBBF_VENDOR_LIST:String="$(CONFIG_BBF_VENDOR_LIST)" \
-DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)" \
-DBBF_MAX_OBJECT_INSTANCES:Integer=$(CONFIG_BBF_MAX_OBJECT_INSTANCES)
endif ##CONFIG_BBF_VENDOR_EXTENSION
ifeq ($(BUILD_VARIANT),default)
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
endif
ifeq ($(BUILD_VARIANT),openssl)
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
endif
ifeq ($(BUILD_VARIANT),wolfssl)
CMAKE_OPTIONS += -DWITH_WOLFSSL=ON
endif
ifeq ($(BUILD_VARIANT),mbedtls)
CMAKE_OPTIONS += -DWITH_MBEDTLS=ON
endif
ifeq ($(CONFIG_PACKAGE_bbfdmd),y)
CMAKE_OPTIONS += \
-DBBFDMD_MAX_MSG_LEN:Integer=10485760
@@ -94,9 +306,11 @@ endif
define Package/libbbfdm-api/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/libbbfdm-api.so $(1)/lib/
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/scripts/bbf.config $(1)/usr/libexec/rpcd/bbf.config
endef
define Package/libbbfdm/install
define Package/libbbfdm/default/install
$(INSTALL_DIR) $(1)/lib
$(INSTALL_DIR) $(1)/etc/bbfdm
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
@@ -109,18 +323,15 @@ define Package/libbbfdm/install
$(INSTALL_BIN) ./files/etc/uci-defaults/99-link-core-plugins $(1)/etc/uci-defaults/99-link-core-plugins
$(INSTALL_BIN) ./files/etc/firewall.portmap $(1)/etc/firewall.portmap
$(INSTALL_BIN) ./files/etc/firewall.service $(1)/etc/firewall.service
ifeq ($(findstring iopsys,$(CONFIG_BBF_VENDOR_LIST)),iopsys)
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libbbfdm/dmtree/vendor/iopsys/libbbfdm_iopsys_ext.so)
endif
ifeq ($(CONFIG_BBF_TR143),y)
$(INSTALL_DIR) $(1)/usr/share/bbfdm
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
$(CP) $(PKG_BUILD_DIR)/libbbfdm/scripts/* $(1)/usr/share/bbfdm
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libbbfdm/scripts/* $(1)/usr/share/bbfdm
$(LN) /usr/share/bbfdm/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
endif
endef
define Package/libbbfdm/prerm
define Package/libbbfdm/default/prerm
#!/bin/sh
rm -rf /etc/bbfdm/dmmap/*
exit 0
@@ -132,22 +343,60 @@ define Package/bbfdmd/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/bbfdm
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbfdmd/ubus/bbfdmd $(1)/usr/sbin/
$(INSTALL_DATA) ./files/etc/bbfdm/input.json $(1)/etc/bbfdm/
$(INSTALL_BIN) ./files/etc/init.d/bbfdmd $(1)/etc/init.d/bbfdmd
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
$(INSTALL_CONF) ./files/etc/config/schedules $(1)/etc/config/schedules
$(INSTALL_BIN) ./files/etc/bbfdm/bbfdm_services.sh $(1)/etc/bbfdm/
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_lease_start_time.user $(1)/etc/udhcpc.user.d/udhcpc_lease_start_time.user
endef
define Package/userinterface/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_DATA) ./files/etc/config/userinterface $(1)/etc/config/userinterface
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/userinterface $(1)/lib/upgrade/keep.d/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/uci-defaults/94-userinterface-json $(1)/etc/uci-defaults/94-userinterface-json
$(INSTALL_BIN) ./files/etc/firewall.userinterface $(1)/etc/firewall.userinterface
endef
Package/libbbfdm/prerm = $(Package/libbbfdm/default/prerm)
Package/libbbfdm-openssl/prerm = $(Package/libbbfdm/default/prerm)
Package/libbbfdm-wolfssl/prerm = $(Package/libbbfdm/default/prerm)
Package/libbbfdm-mbedtls/prerm = $(Package/libbbfdm/default/prerm)
Package/libbbfdm/install = $(Package/libbbfdm/default/install)
Package/libbbfdm-openssl/install = $(Package/libbbfdm/default/install)
Package/libbbfdm-wolfssl/install = $(Package/libbbfdm/default/install)
Package/libbbfdm-mbedtls/install = $(Package/libbbfdm/default/install)
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/include/libbbfdm
$(INSTALL_DIR) $(1)/usr/include/libbbfdm-api
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/*.h $(1)/usr/include/libbbfdm-api/
$(INSTALL_DIR) $(1)/usr/include/libbbf_api
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/include/*.h $(1)/usr/include/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm/dmtree/tr181/device.h $(1)/usr/include/libbbfdm/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm/dmtree/vendor/vendor.h $(1)/usr/include/libbbfdm/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/*.h $(1)/usr/include/libbbfdm-api/
# Work around for backward compatibility
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/*.h $(1)/usr/include/libbbf_api/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/include/libbbfdm_api.h $(1)/usr/include/libbbf_api.h
endef
$(eval $(call BuildPackage,libbbfdm-api))
$(eval $(call BuildPackage,libbbfdm))
$(eval $(call BuildPackage,libbbfdm-openssl))
$(eval $(call BuildPackage,libbbfdm-wolfssl))
$(eval $(call BuildPackage,libbbfdm-mbedtls))
$(eval $(call BuildPackage,bbfdmd))
$(eval $(call BuildPackage,userinterface))

View File

@@ -2,7 +2,7 @@
config bbfdmd 'bbfdmd'
option enabled '1'
option loglevel '1'
option refresh_time '10'
option refresh_time '120'
option transaction_timeout '30'
option subprocess_level '2'

View File

@@ -0,0 +1,2 @@
config global 'global'
option enable '1'

View File

@@ -2,71 +2,40 @@
. /lib/functions.sh
log() {
echo "${@}"|logger -t firewall.dnat -p info
}
exec_cmd() {
if ! eval "$*"; then
log "Failed to run [$*]"
fi
}
reorder_dnat_rules() {
nat_chains=$(iptables -t nat -S | grep -E "^-N zone[a-zA-Z0-9_]+prerouting$" | cut -d' ' -f 2)
for chain in ${nat_chains}; do
# Collect empty remote host & empty dport rules
EMPTY_HOST_PORT=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep -v "\-\-dport" | grep -v "\-s ")
if [ -n "${EMPTY_HOST_PORT}" ]; then
echo "${EMPTY_HOST_PORT}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
exec_cmd $cmd1
done
fi
# Collect empty remote host but non empty dport rules
EMPTY_HOST=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep "\-\-dport" | grep -v "\-s ")
if [ -n "${EMPTY_HOST}" ]; then
echo "${EMPTY_HOST}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
exec_cmd $cmd1
done
fi
# Collect non empty remote host but empty dport rules
EMPTY_PORT=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep -v "\-\-dport" | grep "\-s ")
if [ -n "${EMPTY_PORT}" ]; then
echo "${EMPTY_PORT}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
exec_cmd $cmd1
done
fi
# Now add rules as per datamodel precedence shown below
## Non empty remote host, empty dport
## empty remote host, non empty dport
## empty remote host, empty dport
if [ -n "${EMPTY_PORT}" ]; then
echo "${EMPTY_PORT}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd)"
exec_cmd $cmd1
done
fi
# Skip this chain if no matching rules were found
[ -n "${EMPTY_HOST_PORT}" -o -n "${EMPTY_HOST}" -o -n "${EMPTY_PORT}" ] || continue
if [ -n "${EMPTY_HOST}" ]; then
echo "${EMPTY_HOST}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd)"
exec_cmd $cmd1
done
fi
(
echo '*nat'
if [ -n "${EMPTY_HOST_PORT}" ]; then
echo "${EMPTY_HOST_PORT}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd)"
exec_cmd $cmd1
done
fi
# Delete collected rules
[ -n "${EMPTY_HOST_PORT}" ] && echo "${EMPTY_HOST_PORT}" | sed 's/^-A /-D /'
[ -n "${EMPTY_HOST}" ] && echo "${EMPTY_HOST}" | sed 's/^-A /-D /'
[ -n "${EMPTY_PORT}" ] && echo "${EMPTY_PORT}" | sed 's/^-A /-D /'
# Now add rules as per datamodel precedence shown below
## Non empty remote host, empty dport
## empty remote host, non empty dport
## empty remote host, empty dport
[ -n "${EMPTY_PORT}" ] && echo "${EMPTY_PORT}"
[ -n "${EMPTY_HOST}" ] && echo "${EMPTY_HOST}"
[ -n "${EMPTY_HOST_PORT}" ] && echo "${EMPTY_HOST_PORT}"
echo 'COMMIT'
) | iptables-restore -w -n
done
}

View File

@@ -7,7 +7,7 @@ log() {
}
exec_cmd() {
if ! eval "$*"; then
if ! "$@"; then
log "Failed to run [$*]"
echo "-1"
return 0
@@ -73,7 +73,7 @@ add_iptable_rule() {
fi
if [ -z "${src_prefix}" ]; then
res=$(exec_cmd "iptables ${cmd} -m comment --comment IPtables_service_rule -j ${action}")
res=$(exec_cmd iptables -w ${cmd} -m comment --comment IPtables_service_rule -j "${action}")
else
#Add ipv4 sources if any
src_list=""
@@ -86,7 +86,7 @@ add_iptable_rule() {
if [ -n "$src_list" ]; then
src_list=$(echo "${src_list}" | sed "s/,$//")
res=$(exec_cmd "iptables -s $src_list ${cmd} -m comment --comment IPtables_service_rule -j ${action}")
res=$(exec_cmd iptables -w -s "$src_list" ${cmd} -m comment --comment IPtables_service_rule -j "${action}")
fi
fi
fi
@@ -97,7 +97,7 @@ add_iptable_rule() {
fi
if [ -z "${src_prefix}" ]; then
res=$(exec_cmd "ip6tables ${cmd} -m comment --comment IP6tables_service_rule -j ${action}")
res=$(exec_cmd ip6tables -w ${cmd} -m comment --comment IP6tables_service_rule -j "${action}")
else
#Add ipv6 sources if any
src_list=""
@@ -110,7 +110,7 @@ add_iptable_rule() {
if [ -n "$src_list" ]; then
src_list=$(echo "${src_list}" | sed "s/,$//")
res=$(exec_cmd "ip6tables -s $src_list ${cmd} -m comment --comment IP6tables_service_rule -j ${action}")
res=$(exec_cmd ip6tables -w -s "$src_list" ${cmd} -m comment --comment IP6tables_service_rule -j "${action}")
fi
fi
fi

View File

@@ -40,7 +40,12 @@ configure_bbfdmd()
[ "${enabled}" -eq 0 ] && return 0
if [ -f "${BBFDM_JSON_INPUT}" ]; then
echo "$(jq --arg log ${loglevel} --arg tran ${transaction_timeout} --arg refresh ${refresh_time} --arg level ${subprocess_level} '.daemon.config += {"loglevel": $log, "refresh_time": $refresh, "transaction_timeout": $tran, "subprocess_level": $level}' ${BBFDM_JSON_INPUT})" > ${BBFDM_TEMP_JSON}
cat ${BBFDM_JSON_INPUT} |jq --arg log ${loglevel} --arg tran ${transaction_timeout} --arg refresh ${refresh_time} --arg level ${subprocess_level} '.daemon.config += {"loglevel": $log, "refresh_time": $refresh, "transaction_timeout": $tran, "subprocess_level": $level}' > ${BBFDM_TEMP_JSON}
val="$(jq -r '.daemon.input // empty' ${BBFDM_TEMP_JSON})"
if [ -z "${val}" ]; then
log "Failed to generate temp input json, uci changes not applied"
cp ${BBFDM_JSON_INPUT} ${BBFDM_TEMP_JSON}
fi
fi
procd_set_param command ${PROG}

View File

@@ -0,0 +1,14 @@
#!/bin/sh
leasestarttime="$(awk -F'.' '{print $1}' /proc/uptime 2> /dev/null)"
target_file=/tmp/dhcp_client_info
target_str="$INTERFACE $lease $leasestarttime"
# if this interface is present in file, then replace it
if grep -q "$INTERFACE" "$target_file" 2> /dev/null; then
# replace the whole line if pattern matches
sed -i "/${INTERFACE}/c\\${target_str}" "$target_file"
else
# interface info was not present, append it to the file
echo "$target_str" >> "$target_file"
fi

View File

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

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=capiagent
PKG_VERSION:=2.1.1
PKG_VERSION:=2.1.0
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=136cab3a9f1eec0132db9fa3f7bb1c8748ce1449
PKG_SOURCE_VERSION:=3e671db8f567b19c109fc13b25bc571c4c73a962
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/capiagent.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
@@ -31,7 +31,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/capiagent
TITLE+= capiagent (daemon implementing Wi-Fi Alliance's CAPI commands)
DEPENDS= +libubox +libuci +libubus +libnl-genl +libeasy +libwifi \
+libjson-c +libblobmsg-json +ubus +libieee1905 +libwifiutils
+libjson-c +libblobmsg-json +ubus +libieee1905
endef
define Package/capiagent/description

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=csmngr
PKG_VERSION:=0.0.5
PKG_VERSION:=1.0.1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=dcdaba75b85bf8758c34d3ae4a1be0ba09359331
PKG_SOURCE_VERSION:=92c62f8df86066bd1718a6a6036195b113e74032
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/csmngr.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip

View File

@@ -1,16 +0,0 @@
if PACKAGE_ddnsmngr
choice
prompt "Select backend for dynamic DNS management"
default DDNSMNGR_BACKEND_DDNSSCRIPT
depends on PACKAGE_ddnsmngr
help
Select which package to use for dynamic DNS support
config DDNSMNGR_BACKEND_DDNSSCRIPT
bool "Use ddns_script"
config DDNSMNGR_BACKEND_INADYN
bool "Use inadyn"
endchoice
endif

View File

@@ -1,79 +0,0 @@
#
# Copyright (C) 2024 IOPSYS
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ddnsmngr
PKG_VERSION:=1.0.0
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/ddnsmngr.git
PKG_SOURCE_VERSION:=d0d37df44644ef2c1a0b11d3a4f92dc694ae1010
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_CONFIG_DEPENDS:=CONFIG_DDNSMNGR_BACKEND_DDNSSCRIPT CONFIG_DDNSMNGR_BACKEND_INADYN
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Dynamic DNS manager
DEPENDS:=+libbbfdm-api +DDNSMNGR_BACKEND_DDNSSCRIPT:ddns-scripts +DDNSMNGR_BACKEND_INADYN:inadyn
MENU:=1
endef
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
MAKE_PATH:=src
define Package/$(PKG_NAME)/description
Manage dynamic DNS updation and provides Device.DynamicDNS. datamodel object based on TR181-2.16
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/ddnsmngr/* $(PKG_BUILD_DIR)/
endef
endif
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/ddnsmngr
$(INSTALL_DIR) $(1)/etc/ddnsmngr/ddns
$(INSTALL_DIR) $(1)/etc/ddnsmngr/servers
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/lib/ddnsmngr
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/libddnsmngr.so $(1)/etc/ddnsmngr/
$(INSTALL_DATA) ./files/etc/ddnsmngr/input.json $(1)/etc/ddnsmngr/
$(INSTALL_DATA) ./files/etc/config/ddnsmngr $(1)/etc/config/ddnsmngr
$(INSTALL_BIN) ./files/etc/uci-defaults/01-ddns-config-migrate $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/init.d/ddnsmngr $(1)/etc/init.d/ddnsmngr
ifeq ($(CONFIG_DDNSMNGR_BACKEND_DDNSSCRIPT),y)
$(INSTALL_BIN) ./files/usr/lib/ddns_script/ddnsmngr_service.sh $(1)/usr/lib/ddnsmngr/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns-script/usr/lib/ddnsmngr/ddnsmngr_updater.sh $(1)/usr/lib/ddnsmngr/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/files/ddns-script/server/* $(1)/etc/ddnsmngr/servers
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns-script/usr/libexec/rpcd/ddnsmngr $(1)/usr/libexec/rpcd/ddnsmngr
endif
ifeq ($(CONFIG_DDNSMNGR_BACKEND_INADYN),y)
$(INSTALL_BIN) ./files/usr/lib/inadyn/ddnsmngr_service.sh $(1)/usr/lib/ddnsmngr/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/files/inadyn/server/* $(1)/etc/ddnsmngr/servers
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/inadyn/usr/libexec/rpcd/ddnsmngr $(1)/usr/libexec/rpcd/ddnsmngr
endif
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -1,23 +0,0 @@
config ddnsmngr 'global'
option configfile '/var/run/ddnsmngr/ddnsmngr.json'
option ddns_dateformat '%F %R'
option ddns_rundir '/var/run/ddnsmngr'
option ddns_logdir '/var/log/ddnsmngr'
option ddns_loglines '250'
option upd_privateip '0'
option use_curl '1'
config server 'ddns_server_1'
option enabled '1'
option service 'dynu.com'
option name 'dynu.com'
config server 'ddns_server_2'
option enabled '1'
option service 'dyndns.org'
option name 'dyndns.org'
config server 'ddns_server_3'
option enabled '1'
option service 'zoneedit.com'
option name 'zoneedit.com'

View File

@@ -1,15 +0,0 @@
{
"daemon": {
"input": {
"type": "DotSo",
"name": "/etc/ddnsmngr/libddnsmngr.so"
},
"output": {
"type": "UBUS",
"name": "bbfdm.ddnsmngr",
"parent_dm": "Device.",
"object": "DynamicDNS",
"root_obj": "bbfdm"
}
}
}

View File

@@ -1,29 +0,0 @@
#!/bin/sh /etc/rc.common
START=80
STOP=10
USE_PROCD=1
DM_INPUT="/etc/ddnsmngr/input.json"
. /etc/bbfdm/bbfdm_services.sh
. /usr/lib/ddnsmngr/ddnsmngr_service.sh
start_service() {
start_ddnsmngr_service
bbfdm_add_service "bbfdm.ddnsmngr" "${DM_INPUT}"
}
stop_service() {
stop_ddnsmngr_service
}
reload_service() {
stop
sleep 1
start
}
service_triggers() {
procd_add_reload_trigger ddnsmngr
add_ddnsmngr_triggers
}

View File

@@ -1,170 +0,0 @@
#!/bin/sh
. /lib/functions.sh
cl_id=1
srv_id=1
function get_ddns_config_option() {
local val
val="$(uci -q get ddns.${1}.${2})"
if [ -z "${val}" ] && [ -n "${3}" ]; then
val="${3}"
fi
echo "${val}"
}
function config_supported_service() {
if ! uci -q get ddnsmngr.global >/dev/null 2>&1; then
uci -q set ddnsmngr.global="ddnsmngr"
fi
servers=""
for i in $(find /etc/ddnsmngr/servers/ -name '*.json' | cut -d'/' -f 5 | sed "s/.json//")
do
if [ -z "${servers}" ]; then
servers="${i}"
else
servers="${servers},${i}"
fi
done
uci -q set ddnsmngr.global.supported_services="${servers}"
}
function migrate_service_section() {
client_sec=""
enabled="$(get_ddns_config_option ${1} enabled "0")"
service_name="$(get_ddns_config_option ${1} service_name)"
interface="$(get_ddns_config_option ${1} interface)"
ip_network="$(get_ddns_config_option ${1} ip_network)"
username="$(get_ddns_config_option ${1} username)"
password="$(get_ddns_config_option ${1} password)"
lookup_host="$(get_ddns_config_option ${1} lookup_host)"
use_ipv6="$(get_ddns_config_option ${1} use_ipv6 "0")"
force_ipversion="$(get_ddns_config_option ${1} force_ipversion "0")"
use_https="$(get_ddns_config_option ${1} use_https "0")"
force_dnstcp="$(get_ddns_config_option ${1} force_dnstcp "0")"
if [ -z "${service_name}" ]; then
uci -q delete ddns."${1}"
return 0
fi
# check server file is present in device
if [ ! -f "/etc/ddnsmngr/servers/${service_name}.json" ]; then
uci -q delete ddns."${1}"
return 0
fi
# Check if client section is already added for this service
clients=$(uci -q show ddnsmngr | grep "=client")
client_count=$(echo "${clients}" | wc -l)
tmp=0
while [ $tmp -lt $client_count ]
do
mngr_serv="$(uci -q get ddnsmngr.@client[$tmp].service_name)"
mngr_intf="$(uci -q get ddnsmngr.@client[$tmp].interface)"
mngr_netw="$(uci -q get ddnsmngr.@client[$tmp].ip_network)"
mngr_user="$(uci -q get ddnsmngr.@client[$tmp].username)"
mngr_ipv6="$(uci -q get ddnsmngr.@client[$tmp].use_ipv6)"
mngr_forceip="$(uci -q get ddnsmngr.@client[$tmp].force_ipversion)"
mngr_https="$(uci -q get ddnsmngr.@client[$tmp].use_https)"
mngr_dnstcp="$(uci -q get ddnsmngr.@client[$tmp].force_dnstcp)"
[ -z "${mngr_ipv6}" ] && mngr_ipv6="0"
[ -z "${mngr_forceip}" ] && mngr_forceip="0"
[ -z "${mngr_https}" ] && mngr_https="0"
[ -z "${mngr_dnstcp}" ] && mngr_dnstcp="0"
if [ "${mngr_serv}" == "${service_name}" ] && [ "${mngr_intf}" == "${interface}" ] && \
[ "${mngr_netw}" == "${ip_network}" ] && [ "${mngr_user}" == "${username}" ] && \
[ "${mngr_ipv6}" == "${use_ipv6}" ] && [ "${mngr_forceip}" == "${force_ipversion}" ] && \
[ "${mngr_https}" == "${use_https}" ] && [ "${mngr_dnstcp}" == "${force_dnstcp}" ]; then
break
fi
tmp=$(( tmp + 1 ))
done
if [ $tmp -ne $client_count ]; then
i=0
for client in $clients; do
if [ $i -eq $tmp ]; then
client_sec="$(echo $client | cut -d'=' -f 1 | cut -d'.' -f 2)"
break
fi
i=$(( i + 1 ))
done
if [ $enabled -eq 1 ]; then
uci -q set ddnsmngr."${client_sec}".enabled="1"
fi
else
client_sec=ddns_mig_client_"${cl_id}"
uci -q set ddnsmngr."${client_sec}"="client"
uci -q set ddnsmngr."${client_sec}".enabled="${enabled}"
uci -q set ddnsmngr."${client_sec}".service_name="${service_name}"
uci -q set ddnsmngr."${client_sec}".interface="${interface}"
uci -q set ddnsmngr."${client_sec}".ip_network="${ip_network}"
uci -q set ddnsmngr."${client_sec}".username="${username}"
uci -q set ddnsmngr."${client_sec}".password="${password}"
uci -q set ddnsmngr."${client_sec}".use_ipv6="${use_ipv6}"
uci -q set ddnsmngr."${client_sec}".force_ipversion="${force_ipversion}"
uci -q set ddnsmngr."${client_sec}".use_https="${use_https}"
uci -q set ddnsmngr."${client_sec}".force_dnstcp="${force_dnstcp}"
cl_id=$(( cl_id + 1 ))
# add server section if not added
servers=$(uci -q show ddnsmngr | grep "service=\'${service_name}\'")
if [ -z "${servers}" ]; then
server_sec=ddns_mig_server_"${srv_id}"
uci -q set ddnsmngr."${server_sec}"="server"
uci -q set ddnsmngr."${server_sec}".enabled="1"
uci -q set ddnsmngr."${server_sec}".service="${service_name}"
uci -q set ddnsmngr."${server_sec}".name="${service_name}"
srv_id=$(( srv_id + 1 ))
fi
fi
# if lookup_host is set then add host section
if [ -n "${lookup_host}" ] && [ -n "${client_sec}" ]; then
# check number of hosts present for this client
host_count=$(uci -q show ddnsmngr | grep "dm_parent=\'${client_sec}\'" | wc -l)
host_ix=$(( host_count + 1 ))
host_sec="${client_sec}"_host_"${host_ix}"
uci -q set ddnsmngr."${host_sec}"="host"
uci -q set ddnsmngr."${host_sec}".enabled="${enabled}"
uci -q set ddnsmngr."${host_sec}".lookup_host="${lookup_host}"
uci -q set ddnsmngr."${host_sec}".dm_parent="${client_sec}"
fi
uci -q delete ddns."${1}"
}
function migrate_ddns_config() {
if [ ! -f "/etc/config/ddnsmngr" ]; then
# Create ddnsmngr config file
touch /etc/config/ddnsmngr
fi
config_supported_service
config_load ddns
config_foreach migrate_service_section service
uci -q commit ddns
uci -q commit ddnsmngr
}
migrate_ddns_config

View File

@@ -1,169 +0,0 @@
#! /bin/sh
RUNDIR="/var/run/ddnsmngr"
LOGDIR="/var/log/ddnsmngr"
PROG="/usr/lib/ddnsmngr/ddnsmngr_updater.sh"
CONFIGFILE="/var/run/ddnsmngr/ddnsmngr.json"
CLIENT_INTFS=""
. /usr/share/libubox/jshn.sh
log() {
echo "$*"|logger -t ddnsmngr.init -p debug
}
validate_host_section() {
uci_validate_section ddnsmngr host "${1}" \
'enabled:bool:0' \
'lookup_host:string' \
'dm_parent:string'
}
validate_client_section() {
uci_validate_section ddnsmngr client "${1}" \
'enabled:bool:0' \
'service_name:string' \
'interface:string' \
'ip_network:string' \
'username:string' \
'password:string' \
'use_https:bool:0' \
'force_dnstcp:bool:0' \
'use_ipv6:bool:0' \
'force_ipversion:bool:0'
}
add_object() {
local enabled lookup_host dm_parent use_ipv6 force_ipversion proc_info_file
local service_name interface ip_network username password use_https force_dnstcp
validate_host_section "${1}" || {
log "Validation of host section failed"
return 0
}
if [ "${enabled}" -ne 1 ] || [ -z "${dm_parent}" ]; then
return 0
fi
validate_client_section "${dm_parent}" || {
log "Validation of client section failed"
return 0
}
if [ "${enabled}" -ne 1 ]; then
return 0
fi
service_name=$(uci -q get ddnsmngr.${dm_parent}.service_name)
if [ -z "${service_name}" ]; then
return 0
fi
service_section=$(uci -q show ddnsmngr | grep "service=\'${service_name}\'" | cut -d'.' -f 2 | head -1)
if [ -z "${service_section}" ]; then
return 0
fi
service_enabled=$(uci -q get ddnsmngr.${service_section}.enabled)
if [ "${service_enabled}" -ne 1 ]; then
return 0
fi
json_add_object
json_add_string "interface" "${interface}"
json_add_string "service_name" "${service_name}"
json_add_string "username" "${username}"
json_add_string "password" "${password}"
json_add_string "lookup_host" "${lookup_host}"
json_add_string "ip_network" "${ip_network}"
json_add_string "proc_info_file" "${1}"
json_add_string "use_ipv6" "${use_ipv6}"
json_add_string "force_ipversion" "${force_ipversion}"
json_add_string "use_https" "${use_https}"
json_add_string "force_dnstcp" "${force_dnstcp}"
json_close_object
if [ -z "${interface}" ]; then
if [ "${use_ipv6}" -eq 0 ]; then
interface="wan"
else
interface="wan6"
fi
fi
for intf in $CLIENT_INTFS; do
if [ "${intf}" == "${interface}" ]; then
return 0
fi
done
CLIENT_INTFS="${CLIENT_INTFS} ${interface}"
}
start_ddnsmngr_service() {
run_dir=$(uci -q get ddnsmngr.global.ddns_rundir)
log_dir=$(uci -q get ddnsmngr.global.ddns_logdir)
if [ -n "${run_dir}" ]; then
RUNDIR="${run_dir}"
fi
if [ -n "${log_dir}" ]; then
LOGDIR="${log_dir}"
fi
mkdir -p "${RUNDIR}"
mkdir -p "${LOGDIR}"
conf_file=$(uci -q get ddnsmngr.global.configfile)
if [ -n "${conf_file}" ]; then
CONFIGFILE="${conf_file}"
fi
touch "${CONFIGFILE}"
if [ ! -f "${CONFIGFILE}" ]; then
log "Can not create ${CONFIGFILE}, exit"
exit 0
fi
json_init
json_add_array "services"
config_load ddnsmngr
config_foreach add_object host
json_close_array
json_dump > "${CONFIGFILE}"
procd_open_instance ddnsmngr
procd_set_param command "$PROG"
procd_append_param command -c "${CONFIGFILE}"
procd_append_param command -- start
procd_close_instance
}
stop_ddnsmngr_service() {
conf_file=$(uci -q get ddnsmngr.global.configfile)
if [ -n "${conf_file}" ]; then
CONFIGFILE="${conf_file}"
fi
if [ ! -f "${CONFIGFILE}" ]; then
log "${CONFIGFILE} not found, can't stop services if running any"
fi
"$PROG" -c "${CONFIGFILE}" -- stop
return 0
}
add_ddnsmngr_triggers() {
procd_open_trigger
for intf in $CLIENT_INTFS; do
# No need to handle other ifevents like ifupdate etc
procd_add_interface_trigger "interface.*.up" $intf /etc/init.d/ddnsmngr restart
procd_add_interface_trigger "interface.*.down" $intf /etc/init.d/ddnsmngr restart
done
procd_close_trigger
}

View File

@@ -1,311 +0,0 @@
#!/bin/sh
PROG="/usr/sbin/inadyn"
CONFIGPATH="/tmp/inadyn_config"
PIDPATH="/etc/inadyn_pid"
CLIENT_INTFS=""
CONFIG_FILES=""
SERVER_PATH="/etc/ddnsmngr/servers"
FORMAT="custom [SECTION] {\n\tusername\t= [USER]\n\tpassword\t= [PWD]\n\tddns-server\t= [SERV]\n\tddns-path\t= [URI]\n\tssl\t\t= [SSL]\n\thostname\t= [NAME]\n\tcheckip-command\t= [CMD]\n\tddns-response\t= [RESPONSES]\n}"
. /usr/share/libubox/jshn.sh
log() {
echo "$*"|logger -t ddnsmngr.init -p debug
}
get_service_data() {
local provider="$1"
shift
local dir="$1"
shift
local ipv6="$1"
shift
local name data url answer script
[ $# -ne 2 ] && {
return 1
}
[ -f "${dir}/${provider}.json" ] || {
eval "$1=\"\""
eval "$2=\"\""
return 1
}
json_load_file "${dir}/${provider}.json"
json_get_var name "name"
if [ "$ipv6" -eq "1" ]; then
json_select "ipv6"
else
json_select "ipv4"
fi
json_get_var data "url"
json_get_var answer "answer"
json_select ".."
json_cleanup
response=""
if [ -n "${answer}" ]; then
answer=$(echo "${answer}" | sed 's/|/ /g')
for ans in $answer; do
if [ -z "${response}" ]; then
response="${ans}"
else
response="${response}, ${ans}"
fi
done
response="{ ${response} }"
fi
eval "$1=\"$data\""
eval "$2=\"$response\""
return 0
}
generate_inadyn_config() {
json_load "${1}"
json_get_var service_name service_name
json_get_var use_ipv6 use_ipv6
json_get_var interface interface
json_get_var username username
json_get_var password password
json_get_var host lookup_host
json_get_var conf_file config_file
json_get_var conf_dir config_dir
json_get_var server_address server_address
json_cleanup
if [ -z "${service_name}" ] || [ -z "${host}" ]; then
return 1
fi
if [ -z "${conf_file}" ]; then
return 1
fi
if [ -z "${conf_dir}" ]; then
return 1
fi
# First look into custom path to load the url otherwise default path
get_service_data "${service_name}" "${SERVER_PATH}" "${use_ipv6}" server_url server_answer
if [ -z "${server_url}" ]; then
return 1
fi
# Need to pick proto, server address and request uri separately from the url
# format http://[server_address]/[update_Request_uri]
proto=$(echo $server_url | cut -d':' -f 1)
serv=$(echo $server_url | cut -d'/' -f 3 | cut -d'@' -f 2)
uri=${server_url#*$serv}
if [ -z $proto ] || [ -z $serv ] || [ -z $uri ]; then
return 1
fi
path=$(echo "$uri" | sed 's/&/\\&/g')
update_uri=$(echo $path | sed -e "s#\[DOMAIN\]#%h#g" -e "s#\[PASSWORD\]#%p#g" \
-e "s#\[USERNAME\]#%u#g" -e "s#\[IP\]#%i#g")
if [ -z "${interface}" ]; then
if [ "${use_ipv6}" -eq 0 ]; then
interface="wan"
else
interface="wan6"
fi
fi
# now get the physical interface name
intf=$(ifstatus "${interface}" | jsonfilter -e '@.device')
if [ -z "${intf}" ]; then
return 1
fi
# command to get ip of the interface
if [ "${use_ipv6}" -eq 0 ]; then
get_ip="\"ifstatus ${interface} | jsonfilter -e '@[\\\\\"ipv4-address\\\\\"][0].address'\""
else
get_ip="\"ifstatus ${interface} | jsonfilter -e '@[\\\\\"ipv6-address\\\\\"][0].address'\""
fi
if [ "${proto}" = "http" ]; then
ssl="false"
else
ssl="true"
fi
inadyn_ver=$(inadyn -v)
user_agent="inadyn/${inadyn_ver}"
config_file="${conf_dir}/${conf_file}"
touch "${config_file}"
echo "iface = ${intf}" > "${config_file}"
echo "period = 600" >> "${config_file}"
echo "user-agent = ${user_agent}" >> "${config_file}"
if [ "${use_ipv6}" -eq 1 ]; then
echo "allow-ipv6 = true" >> "${config_file}"
fi
if [ -z "${password}" ]; then
FORMAT=$(echo "${FORMAT}" | sed 's/\\tpassword\\t= \[PWD\]\\n//g')
fi
if [ -z "${server_answer}" ]; then
FORMAT=$(echo "${FORMAT}" | sed 's/\\tddns-response\\t= \[RESPONSES\]\\n//g')
fi
config=$(echo $FORMAT | sed -e "s#\[SECTION\]#$conf_file#g" -e "s#\[PWD\]#$password#g" \
-e "s#\[USER\]#$username#g" -e "s#\[SERV\]#$serv#g" \
-e "s#\[URI\]#\"$update_uri\"#g" -e "s#\[SSL\]#$ssl#g" \
-e "s#\[NAME\]#$host#g" -e "s#\[CMD\]#$get_ip#g" \
-e "s#\[RESPONSES\]#$server_answer#g")
echo -e "\n\n${config}" >> "${config_file}"
return 0
}
validate_host_section() {
uci_validate_section ddnsmngr host "${1}" \
'enabled:bool:0' \
'lookup_host:string' \
'dm_parent:string'
}
validate_client_section() {
uci_validate_section ddnsmngr client "${1}" \
'enabled:bool:0' \
'service_name:string' \
'interface:string' \
'ip_network:string' \
'username:string' \
'password:string' \
'use_https:bool:0' \
'force_dnstcp:bool:0' \
'use_ipv6:bool:0' \
'force_ipversion:bool:0'
}
add_object() {
local enabled lookup_host dm_parent use_ipv6 force_ipversion
local service_name interface ip_network username password use_https force_dnstcp
validate_host_section "${1}" || {
log "Validation of host section failed"
return
}
if [ "${enabled}" -ne 1 ] || [ -z "${dm_parent}" ]; then
return
fi
validate_client_section "${dm_parent}" || {
log "Validation of client section failed"
return
}
if [ "${enabled}" -ne 1 ]; then
return
fi
service_name=$(uci -q get ddnsmngr.${dm_parent}.service_name)
if [ -z "${service_name}" ]; then
return
fi
service_section=$(uci show ddnsmngr | grep "service=\'${service_name}\'" | cut -d'.' -f 2 | head -1)
if [ -z "${service_section}" ]; then
return
fi
service_enabled=$(uci -q get ddnsmngr.${service_section}.enabled)
if [ "${service_enabled}" -ne 1 ]; then
return
fi
json_init
json_add_string "interface" "${interface}"
json_add_string "service_name" "${service_name}"
json_add_string "username" "${username}"
json_add_string "password" "${password}"
json_add_string "lookup_host" "${lookup_host}"
json_add_string "ip_network" "${ip_network}"
json_add_string "use_ipv6" "${use_ipv6}"
json_add_string "force_ipversion" "${force_ipversion}"
json_add_string "use_https" "${use_https}"
json_add_string "force_dnstcp" "${force_dnstcp}"
json_add_string "config_file" "${1}"
json_add_string "config_dir" "${CONFIGPATH}"
json_str=$(json_dump)
json_cleanup
generate_inadyn_config "${json_str}"
if [ "$?" -ne 0 ]; then
return
fi
CONFIG_FILES="${CONFIG_FILES} ${1}"
if [ -z "${interface}" ]; then
if [ "${use_ipv6}" -eq 0 ]; then
interface="wan"
else
interface="wan6"
fi
fi
for intf in $CLIENT_INTFS; do
if [ "${intf}" == "${interface}" ]; then
return
fi
done
CLIENT_INTFS="${CLIENT_INTFS} ${interface}"
}
start_ddnsmngr_service() {
rm -rf $CONFIGPATH
mkdir $CONFIGPATH
mkdir -p $PIDPATH
config_load ddnsmngr
config_foreach add_object host
i=1
for conf in $CONFIG_FILES; do
instance="ddnsmngr_${i}"
i=$(( i + 1 ))
procd_open_instance $instance
procd_set_param command "$PROG"
procd_append_param command -f "${CONFIGPATH}/${conf}"
procd_append_param command -l debug
procd_append_param command -P "${PIDPATH}/${conf}"
procd_append_param command -n -C
procd_close_instance
done
}
stop_ddnsmngr_service() {
rm -rf $CONFIGPATH
return 0
}
add_ddnsmngr_triggers() {
procd_open_trigger
for intf in $CLIENT_INTFS; do
# No need to handle other ifevents like ifupdate etc
procd_add_interface_trigger "interface.*.up" $intf /etc/init.d/ddnsmngr restart
done
procd_close_trigger
}

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=decollector
PKG_VERSION:=4.2.1.3
PKG_VERSION:=4.2.1.1.6
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=0fe317cbe2b2e37c25a6d6d4e6f5c1d6964f9e50
PKG_SOURCE_VERSION:=9fae736fa6c4ee39e7775964c7f84b105196c034
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
@@ -29,7 +29,7 @@ define Package/decollector
CATEGORY:=Utilities
TITLE:=WiFi DataElements Collector Proxy
DEPENDS:=+libuci +libubox +ubus +libpthread +libnl-genl \
+libeasy +libwifiutils +libieee1905 +ieee1905-map-plugin
+libeasy +libwifiutils +libieee1905 +map-plugin
endef
define Package/decollector/description

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ethmngr
PKG_VERSION:=2.1.2
PKG_VERSION:=2.1.3.1
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=e5cccdd45a93d969d51c4085cb52b543df544811
PKG_SOURCE_VERSION:=847a94cee530d60bfd10ceaee4185d64fb6397d0
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/ethmngr.git
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
@@ -26,7 +26,7 @@ define Package/ethmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Ethernet status and configration utility
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_ipq53xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl +libeasy
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_ipq53xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl
endef
define Package/ethmngr/description

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=hostmngr
PKG_VERSION:=1.2.2
PKG_VERSION:=1.1.9
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=b4990b384461f2d1ff75a122a7fa5d9276f211bb
PKG_SOURCE_VERSION:=3aabf79273537b146e063e32cd0443d8a156daa2
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/hostmngr.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
@@ -31,8 +31,7 @@ define Package/hostmngr
DEPENDS= +libubox +libuci +libubus +ubus +libeasy +libnl-genl \
+libjson-c +libblobmsg-json +libnfnetlink +libmnl \
+libnetfilter-conntrack \
+HOSTMNGR_PLATFORM_HAS_WIFI:libwifi +libbbfdm-api \
+libwifiutils
+HOSTMNGR_PLATFORM_HAS_WIFI:libwifi +libbbfdm-api
endef
@@ -58,7 +57,7 @@ endif
MAKE_PATH:=src
define Package/hostmngr/install
$(CP) ./files/* $(1)/
$(CP) ./files/etc $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/hostmngr/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/hostmngr $(1)/usr/sbin/

View File

@@ -2,7 +2,8 @@
"daemon": {
"input": {
"type": "DotSo",
"name": "/etc/hostmngr/libhostmngr.so"
"name": "/etc/hostmngr/libhostmngr.so",
"plugin_dir": "/etc/hostmngr/plugins/"
},
"output": {
"type": "UBUS",

View File

@@ -5,9 +5,6 @@
day=""
next_days=""
prev_days=""
schedule_added=""
ACCESS_RULE=""
IP_RULE=""
IP_RULE1=""
@@ -111,77 +108,70 @@ ip_rule_east_zone() {
fi
}
add_access_rule() {
local rule="$1"
echo "iptables -w -A hosts_forward ${rule}" >> $ACL_FILE
echo "ip6tables -w -A hosts_forward ${rule}" >> $ACL_FILE
}
handle_day_list() {
local value=$1
val=$(echo $value | cut -c 1-3)
next_day_val=$(get_next_day $val)
prev_day_val=$(get_previous_day $val)
if [ -z $day ]; then
day="$val"
next_days="$next_day_val"
prev_days="$prev_day_val"
else
day="$day,$val"
next_days="$next_days,$next_day_val"
prev_days="$prev_days,$prev_day_val"
fi
}
handle_schedule() {
local schd_section="$1"
local ac_section="$2"
local acs_id
local start_time
local duration
IP_RULE="$ACCESS_RULE"
IP_RULE1=""
day=""
next_days=""
prev_days=""
config_get acs_id "$schd_section" "dm_parent"
if [ "$acs_id" != "$ac_section" ]; then
return # schedule not for this access control section
fi
process_ac_schedule() {
local acs_id="$1"
local is_enabled
config_get is_enabled "$schd_section" "enable" 0
local access_control
local start_time=""
local mac=""
handle_day_list() {
local value=$1
val=$(echo $value | cut -c 1-3)
next_day_val=$(get_next_day $val)
prev_day_val=$(get_previous_day $val)
if [ -z $day ]; then
day="$val"
next_days="$next_day_val"
prev_days="$prev_day_val"
else
day="$day,$val"
next_days="$next_days,$next_day_val"
prev_days="$prev_days,$prev_day_val"
fi
}
config_list_foreach "$acs_id" "day" handle_day_list
config_get is_enabled "$acs_id" "enable" 1
config_get access_control "$acs_id" "dm_parent"
if [ "$is_enabled" == "0" ] || [ -z "$access_control" ]; then
return
fi
IP_RULE=""
IP_RULE1=""
config_get is_enabled "$access_control" "enable" 1
if [ "$is_enabled" == "0" ]; then
return
fi
local all_days="Monday Tuesday Wednesday Thursday Friday Saturday Sunday"
local day_config
config_get day_config "$schd_section" "day" "$all_days"
mac=$(uci -q get hosts.$access_control.macaddr)
access_policy=$(uci -q get hosts.$access_control.access_policy)
IFS=" "
for d in $day_config; do
handle_day_list $d
done
config_get start_time "$acs_id" "start_time"
config_get duration "$acs_id" "duration"
config_get start_time "$schd_section" "start_time" "00:00"
config_get duration "$schd_section" "duration"
if [ -z "$mac" ] && [ -z "$start_time" ] && [ -z "$duration" ] && [ -z "$day" ] && [ -z "$access_policy" ]; then
return
fi
if [ -n "$mac" ]; then
IP_RULE="$IP_RULE -m mac --mac-source $mac"
fi
zone=$(date +%z | cut -c 1)
local_start_time=$start_time
hh=$(echo $local_start_time | awk -F: '{ print $1 }')
mm=$(echo $local_start_time | awk -F: '{ print $2 }')
hh_s=`expr $hh \* 3600`
mm_s=`expr $mm \* 60`
ss=$(( hh_s + mm_s ))
local_start_hh=$hh
if [ -n "$duration" ]; then
hh=$(echo $local_start_time | awk -F: '{ print $1 }')
mm=$(echo $local_start_time | awk -F: '{ print $2 }')
hh_s=`expr $hh \* 3600`
mm_s=`expr $mm \* 60`
ss=$(( hh_s + mm_s ))
local_start_hh=$hh
stop_ss=$(( ss + duration ))
hh=$(( stop_ss / 3600 ))
rem_ss=$(( stop_ss % 3600 ))
@@ -189,10 +179,6 @@ handle_schedule() {
ss=$(( rem_ss % 60 ))
local_stop_time="$hh:$mm:$ss"
local_stop_hh=$hh
else
# if duartion is not specified, then apply rule to end of the day
local_stop_time="23:59:59"
local_stop_hh="23"
fi
utc_start_time=$(date -u -d @$(date "+%s" -d "$local_start_time") +%H:%M)
@@ -205,91 +191,47 @@ handle_schedule() {
ip_rule_east_zone $utc_start_hh $utc_stop_hh $local_start_hh $local_stop_hh $utc_start_time $utc_stop_time
fi
IP_RULE="$IP_RULE -j ACCEPT"
if [ -n "$IP_RULE1" ]; then
IP_RULE1="$IP_RULE1 -j ACCEPT"
fi
add_access_rule "$IP_RULE"
if [ -n "$IP_RULE1" ]; then
add_access_rule "$IP_RULE1"
fi
# for access rules to be effective for a schedule, need to add DROP rule
# to block the access outside the defined schedule
if [ "$schedule_added" == "0" ]; then
schedule_added="1"
fi
}
handle_access_control() {
local ac_section="$1"
local is_enabled
# default value of Hosts.AccessControl.{i}.Enable is false,
# so, if not defined in uci as 1, assume 0
config_get is_enabled "$ac_section" "enable" 0
if [ "$is_enabled" == "0" ]; then
return
fi
local mac_addr
config_get mac_addr "$ac_section" "macaddr"
if [ -z "$mac_addr" ]; then
return
else
ACCESS_RULE="-m mac --mac-source $mac_addr"
fi
local access_policy
config_get access_policy "$ac_section" "access_policy"
if [ -z "$access_policy" ]; then
return # since system default is allow so no need to do anything
fi
# As per Data Model, if access policy is deny, then schedule is to be ignored
# and no access is to be provided for the device
if [ "$access_policy" == "Deny" ]; then
ACCESS_RULE="$ACCESS_RULE -j DROP"
add_access_rule "$ACCESS_RULE"
return # no need to parse schedule
IP_RULE="$IP_RULE -j DROP"
if [ -n "$IP_RULE1" ]; then
IP_RULE1="$IP_RULE1 -j DROP"
fi
else
IP_RULE="$IP_RULE -j ACCEPT"
if [ -n "$IP_RULE1" ]; then
IP_RULE1="$IP_RULE1 -j ACCEPT"
fi
fi
schedule_added="0"
# check if schedule is defined for this access_control instance
# and if yes, create rule accordingly
config_foreach handle_schedule ac_schedule "$ac_section"
# for access rule to work, need to have default drop rule as last rule
if [ "$schedule_added" == "1" ]; then
IP_RULE="$ACCESS_RULE -j DROP"
add_access_rule "$IP_RULE"
iptables -w -A hosts_forward ${IP_RULE}
ip6tables -w -A hosts_forward ${IP_RULE}
if [ -n "$IP_RULE1" ]; then
iptables -w -A hosts_forward ${IP_RULE1}
ip6tables -w -A hosts_forward ${IP_RULE1}
fi
day=""
next_days=""
prev_days=""
}
ACL_FILE="/tmp/hosts_access_control/access_control.rules"
iptables -w -F hosts_forward
ip6tables -w -F hosts_forward
rm -f $ACL_FILE
mkdir -p /tmp/hosts_access_control/
touch $ACL_FILE
echo "iptables -w -F hosts_forward" >> $ACL_FILE
echo "ip6tables -w -F hosts_forward" >> $ACL_FILE
hosts_forward=$(iptables -t filter --list | grep hosts_forward)
if [ -z "$hosts_forward" ]; then
echo "iptables -w -t filter -N hosts_forward" >> $ACL_FILE
hosts_ipv4_forward=$(iptables -t filter --list -n | grep hosts_forward)
if [ -z "$hosts_ipv4_forward" ]; then
iptables -w -t filter -N hosts_forward
ret=$?
[ $ret -eq 0 ] && echo "iptables -w -t filter -I FORWARD -j hosts_forward" >> $ACL_FILE
echo "ip6tables -w -t filter -N hosts_forward" >> $ACL_FILE
[ $ret -eq 0 ] && iptables -w -t filter -I FORWARD -j hosts_forward
fi
hosts_ipv6_forward=$(ip6tables -t filter --list -n | grep hosts_forward)
if [ -z "$hosts_ipv6_forward" ]; then
ip6tables -w -t filter -N hosts_forward
ret=$?
[ $ret -eq 0 ] && echo "ip6tables -w -t filter -I FORWARD -j hosts_forward" >> $ACL_FILE
[ $ret -eq 0 ] && ip6tables -w -t filter -I FORWARD -j hosts_forward
fi
# Load /etc/config/hosts UCI file
config_load hosts
config_foreach handle_access_control access_control
# apply the rules
sh $ACL_FILE
config_foreach process_ac_schedule ac_schedule

View File

@@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=9.6.8
PKG_VERSION:=9.5.29.18
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
PKG_SOURCE_VERSION:=7ff419cefc314156a0ac518972096ef0dfb87162
PKG_SOURCE_VERSION:=816033a14672e8e9c3566ce06fa19fb422eeb546
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -26,21 +26,68 @@ include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
include ../bbfdm/bbfdm.mk
define Package/icwmp
define Package/icwmp/default
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=TR069 CWMP client
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml +libuuid +libbbfdm-api +libopenssl
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml +libuuid +libbbfdm-api
endef
define Package/icwmp
$(Package/icwmp/default)
VARIANT:=default
DEFAULT_VARIANT:=1
DEPENDS += +PACKAGE_icwmp-openssl:libopenssl
endef
define Package/icwmp-openssl
$(Package/icwmp/default)
TITLE += (openssl)
VARIANT:=openssl
DEPENDS += +PACKAGE_icwmp-openssl:libopenssl
CONFLICTS := icwmp icwmp-mbedtls icwmp-wolfssl
endef
define Package/icwmp-wolfssl
$(Package/icwmp/default)
TITLE += (wolfssl)
VARIANT:=wolfssl
DEPENDS += +PACKAGE_icwmp-wolfssl:libwolfssl
CONFLICTS := icwmp icwmp-mbedtls icwmp-openssl
endef
define Package/icwmp-mbedtls
$(Package/icwmp/default)
TITLE += (mbedtls)
DEPENDS += +PACKAGE_icwmp-mbedtls:libmbedtls
VARIANT:=mbedtls
CONFLICTS := icwmp icwmp-wolfssl icwmp-openssl
endef
ifeq ($(BUILD_VARIANT),default)
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
endif
ifeq ($(BUILD_VARIANT),openssl)
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
endif
ifeq ($(BUILD_VARIANT),wolfssl)
CMAKE_OPTIONS += -DWITH_WOLFSSL=ON
endif
ifeq ($(BUILD_VARIANT),mbedtls)
CMAKE_OPTIONS += -DWITH_MBEDTLS=ON
endif
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/icwmp/* $(PKG_BUILD_DIR)/
endef
endif
define Package/icwmp/install
define Package/icwmp/default/install
$(INSTALL_DIR) $(1)/etc/icwmpd
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/config
@@ -62,4 +109,12 @@ define Package/icwmp/install
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libcwmpdm.so)
endef
Package/icwmp/install = $(Package/icwmp/default/install)
Package/icwmp-openssl/install = $(Package/icwmp/default/install)
Package/icwmp-wolfssl/install = $(Package/icwmp/default/install)
Package/icwmp-mbedtls/install = $(Package/icwmp/default/install)
$(eval $(call BuildPackage,icwmp))
$(eval $(call BuildPackage,icwmp-openssl))
$(eval $(call BuildPackage,icwmp-wolfssl))
$(eval $(call BuildPackage,icwmp-mbedtls))

View File

@@ -5,7 +5,6 @@ config acs 'acs'
option periodic_inform_interval '1800'
option periodic_inform_time '0001-01-01T00:00:00Z'
option dhcp_discovery 'enable'
option ssl_capath "/etc/ssl/certs"
# compression possible configs: GZIP, Deflate, Disabled
option compression 'Disabled'
#­ possible configs interval :[1:65535]

View File

@@ -15,24 +15,32 @@ log() {
echo "${@}"|logger -t cwmp.init -p info
}
regenerate_ssl_link() {
local cert_dir="${1%/}"
[ ! -d "${cert_dir}" ] || [ "${cert_dir}" = "/etc/ssl/certs" ] && return 0
regenerate_ssl_link()
{
local cert_dir all_file rehash
generate_links() {
local file_type="$1"
local files="${cert_dir}"/*."${file_type}"
for cfile in ${files}; do
if [ -f "${cfile}" ]; then
rehash="$(openssl x509 -hash -noout -in "${cfile}")"
[ -f "${cert_dir}/${rehash}.0" ] || \
ln -s "${cfile}" "${cert_dir}/${rehash}.0"
fi
cert_dir="${1}"
[ ! -d "${cert_dir}" ] && return 0;
### Generate all ssl link for pem certicates ###
all_file=$(ls "${cert_dir}"/*.pem 2>/dev/null)
if [ -n "${all_file}" ]; then
for cfile in $all_file; do
rehash="$(openssl x509 -hash -noout -in "${cfile}")"
[ -f "${cert_dir}"/"${rehash}".0 ] || \
ln -s "${cfile}" "${cert_dir}"/"${rehash}".0
done
}
fi
generate_links "pem"
generate_links "crt"
### Generate all ssl link for crt certicates ###
all_file=$(ls "${cert_dir}"/*.crt 2>/dev/null)
if [ -n "${all_file}" ]; then
for cfile in $all_file; do
rehash="$(openssl x509 -hash -noout -in "${cfile}")"
[ -f "${cert_dir}"/"${rehash}".0 ] || \
ln -s "${cfile}" "${cert_dir}"/"${rehash}".0
done
fi
}
enable_dhcp_option43() {
@@ -428,14 +436,13 @@ validate_cpe_section()
'notification:bool' \
'exec_download:bool' \
'periodic_notify_enable:bool' \
'enable:bool:1' \
'enable:bool' \
'periodic_notify_interval:uinteger' \
'fw_upgrade_keep_settings:bool'
}
validate_defaults() {
local ssl_capath enable url dhcp_url
local ssl_capath
config_load cwmp
validate_acs_section || {
@@ -443,17 +450,13 @@ validate_defaults() {
return 1;
}
if [ -z "${url}" ] && [ -z "${dhcp_url}" ]; then
log "No ACS URL is configured"
return 1
fi
ssl_capath="${ssl_capath%/}"
# Put the cert pem file in keep list
if [ -d "${ssl_capath}" ] && [ "${ssl_capath}" != "/etc/ssl/certs" ]; then
if [ -d "${ssl_capath}" ]; then
if ! grep "*.pem\|*.crt" /lib/upgrade/keep.d/icwmp; then
echo "${ssl_capath}"'/*.pem' >> /lib/upgrade/keep.d/icwmp
echo "${ssl_capath}"'/*.crt' >> /lib/upgrade/keep.d/icwmp
echo "${ssl_capath}"'/*.0' >> /lib/upgrade/keep.d/icwmp
fi
fi
@@ -462,11 +465,6 @@ validate_defaults() {
return 1;
}
if [ "$enable" = "0" ]; then
log "CWMP service disabled"
return 1
fi
return 0;
}
@@ -514,17 +512,30 @@ boot() {
}
start_service() {
local enable_cwmp url dhcp_url
config_load cwmp
config_get_bool enable_cwmp cpe enable 1
config_get url acs url ""
config_get dhcp_url acs dhcp_url ""
procd_open_instance icwmp
if [ "$enable_cwmp" = "0" ]; then
procd_close_instance
return 0
fi
validate_defaults || {
log "Validation of defaults failed"
procd_close_instance
return 1;
}
procd_set_param command "$PROG"
procd_append_param command -b
if [ -n "${url}" ] || [ -n "${dhcp_url}" ]; then
procd_set_param command "$PROG"
procd_append_param command -b
fi
procd_set_param respawn \
"${respawn_threshold:-5}" \
@@ -541,14 +552,16 @@ stop_service()
reload_service() {
local ret
config_load cwmp
config_get_bool enable_cwmp cpe enable 1
log "Reload service $ret"
ret="0"
validate_defaults || {
if [ "$enable_cwmp" = "0" ]; then
stop
start
return 0;
}
return 0
fi
ret=$(ubus call service list '{"name":"icwmpd"}' | jsonfilter -qe '@.icwmpd.instances.icwmp.running')
if [ "$ret" != "true" ]; then

View File

@@ -1,16 +1,16 @@
#
# Copyright (C) 2020-2024 IOPSYS Software Solutions AB
# Copyright (C) 2020-2023 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ieee1905
PKG_VERSION:=8.3.7.1
PKG_VERSION:=8.3.4.15
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=490979bd8ec0395795801f3bfb9dc47af1eb4ade
PKG_SOURCE_VERSION:=bdf808d9b2c74e2613f1e2842cb01e62e2d1a3e1
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/ieee1905.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
@@ -60,12 +60,12 @@ define Package/libieee1905/description
endef
plugins := \
$(if $(CONFIG_PACKAGE_ieee1905-map-plugin),map) \
$(if $(CONFIG_PACKAGE_ieee1905-snoop-plugin),snoop) \
$(if $(CONFIG_PACKAGE_ieee1905-topology-plugin),topology)
$(if $(CONFIG_PACKAGE_map-plugin),map) \
$(if $(CONFIG_PACKAGE_snoop-plugin),snoop) \
$(if $(CONFIG_PACKAGE_topology-plugin),topology)
ppkg:=$(patsubst plugins/%.mk,ieee1905-%-plugin,$(wildcard plugins/*.mk))
ppkg:=$(patsubst plugins/%.mk,%-plugin,$(wildcard plugins/*.mk))
TARGET_CFLAGS += \

View File

@@ -1,12 +1,12 @@
define Package/ieee1905-map-plugin
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/ieee1905-map-plugin/config
if (PACKAGE_ieee1905-map-plugin)
define Package/map-plugin/config
if (PACKAGE_map-plugin)
menu "Configuration"
@@ -32,7 +32,7 @@ ifeq ($(CONFIG_MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG),y)
TARGET_CFLAGS += -DDYNAMIC_CNTLR_SYNC_CONFIG
endif
define Build/InstallDev/ieee1905-map-plugin
define Build/InstallDev/map-plugin
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
@@ -43,7 +43,7 @@ define Build/InstallDev/ieee1905-map-plugin
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/libmaputil.so $(1)/usr/lib/libmaputil.so
endef
define Package/ieee1905-map-plugin/install
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

View File

@@ -1,11 +1,11 @@
define Package/ieee1905-snoop-plugin
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/ieee1905-snoop-plugin/install
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

View File

@@ -1,11 +1,11 @@
define Package/ieee1905-topology-plugin
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/ieee1905-topology-plugin/install
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

View File

@@ -71,7 +71,7 @@ CONFIG_PACKAGE_wifimngr=y
# Multi-AP #
CONFIG_PACKAGE_ieee1905=y
CONFIG_IEEE1905_CMDU_SA_IS_ALMAC=y
CONFIG_PACKAGE_ieee1905-topology-plugin=y
CONFIG_PACKAGE_topology-plugin=y
CONFIG_PACKAGE_decollector=y
CONFIG_PACKAGE_map-agent=y
CONFIG_PACKAGE_map-controller=y
@@ -79,6 +79,7 @@ CONFIG_PACKAGE_map-controller=y
# Network #
CONFIG_PACKAGE_hostmngr=y
CONFIG_PACKAGE_netmode=y
CONFIG_PACKAGE_testnet=y
CONFIG_PACKAGE_urlfilter=y
# System #
@@ -149,6 +150,7 @@ CONFIG_PACKAGE_ssdpd=y
CONFIG_PACKAGE_miniupnpd-iptables=y
CONFIG_PACKAGE_mosquitto-client-ssl=y
CONFIG_PACKAGE_mosquitto-ssl=y
# CONFIG_MOSQUITTO_BRIDGE_SUPPORT is not set
CONFIG_PACKAGE_nginx=y
CONFIG_PACKAGE_openvpn-easy-rsa=y
CONFIG_PACKAGE_openvpn-openssl=y

View File

@@ -33,8 +33,7 @@ _iop()
prev="${COMP_WORDS[COMP_CWORD-1]}"
iopcmds="bootstrap cfe_upgrade cfe_upgrade_latest extract_core \
feeds_update feeds_update-legacy genconfig genconfig-legacy \
generate_tarballs install_key \
feeds_update genconfig generate_tarballs install_key \
scp_changes setup_host ssh_install_key status \
update_package update_feed_branches ssh_upgrade smoketest"

View File

@@ -1,88 +0,0 @@
#!/bin/bash
function feeds_update-legacy {
heads=1
developer=0
override=1
force=1
function update_failure {
if [ $force == 1 ]; then
echo "WARNING: Failed to update feed(s). Forced update, proceeding anyway." >&2
else
echo "ERROR: Failed to update feed(s). Omit -F to proceed anyway." >&2
exit 1
fi
}
while getopts "inFh" opt; do
case $opt in
i)
heads=0
;;
n)
override=0
;;
F)
force=0
;;
h|\?)
echo "Usage: ./iop feeds_update-legacy [-i] [-n] [-F] [-h]"
echo
echo "OPTIONS:"
echo " -i - Only update index. Do not change HEAD in feeds."
echo " -n - Do not replace core packages with iopsys versions."
echo " -F - Do not force update if there are inaccessible feeds."
echo " -h - Display this help message and exit."
exit 1
;;
esac
done
git remote -v | grep -qE '(git@|ssh://)' && developer=1
cp .config .genconfig_config_bak
if [ $heads == 1 ]; then
if [ $developer == 1 ]; then
./scripts/feeds update -g || update_failure
else
./scripts/feeds update || update_failure
fi
fi
./scripts/feeds update -ai || exit 1
# replace core packages with iopsys versions
if [ $override == 1 ]; then
./scripts/feeds install -f -p openwrt_core -a || exit 1
./scripts/feeds install -f -p qualcomm -a || exit 1
fi
(
echo '# DO NOT EDIT. Autogenerated file by ./iop feeds_update'
echo 'FEED_DEVICES_DIRS:='
find feeds -type f -name .is-feed-devices-dir -printf 'FEED_DEVICES_DIRS+=$(TOPDIR)/%h\n'
) > target/linux/feed-devices/feed-devices-list.mk || exit 1
# targets need to be installed explicitly
for target in $(ls ./feeds/targets); do
./scripts/feeds install -f -p targets $target || exit 1
done
# install all packages
./scripts/feeds install -a || exit 1
# remove broken symlinks ( for packages that are no longer in the feed )
find -L package/feeds -maxdepth 2 -type l -delete || exit 1
cp .genconfig_config_bak .config
make defconfig || exit 1
# record when we last run this script
touch tmp/.iop_bootstrap || exit 1
# always return true
exit 0
}
register_command "feeds_update-legacy" "Update feeds to point to commit hashes from feeds.conf - legacy mode"

View File

@@ -1,9 +1,88 @@
#!/bin/bash
function feeds_update {
heads=1
developer=0
override=1
force=1
function update_failure {
if [ $force == 1 ]; then
echo "WARNING: Failed to update feed(s). Forced update, proceeding anyway." >&2
else
echo "ERROR: Failed to update feed(s). Omit -F to proceed anyway." >&2
exit 1
fi
}
while getopts "inFh" opt; do
case $opt in
i)
heads=0
;;
n)
override=0
;;
F)
force=0
;;
h|\?)
echo "Usage: ./iop feeds_update [-i] [-n] [-F] [-h]"
echo
echo "OPTIONS:"
echo " -i - Only update index. Do not change HEAD in feeds."
echo " -n - Do not replace core packages with iopsys versions."
echo " -F - Do not force update if there are inaccessible feeds."
echo " -h - Display this help message and exit."
exit 1
;;
esac
done
git remote -v | grep -qE '(git@|ssh://)' && developer=1
cp .config .genconfig_config_bak
if [ $heads == 1 ]; then
if [ $developer == 1 ]; then
./scripts/feeds update -g || update_failure
else
./scripts/feeds update || update_failure
fi
fi
./scripts/feeds update -ai || exit 1
# replace core packages with iopsys versions
if [ $override == 1 ]; then
./scripts/feeds install -f -p openwrt_core -a || exit 1
./scripts/feeds install -f -p qualcomm -a || exit 1
fi
(
echo '# DO NOT EDIT. Autogenerated file by ./iop feeds_update'
echo 'FEED_DEVICES_DIRS:='
find feeds -type f -name .is-feed-devices-dir -printf 'FEED_DEVICES_DIRS+=$(TOPDIR)/%h\n'
) > target/linux/feed-devices/feed-devices-list.mk || exit 1
# targets need to be installed explicitly
for target in $(ls ./feeds/targets); do
./scripts/feeds install -f -p targets $target || exit 1
done
# install all packages
./scripts/feeds install -a || exit 1
# remove broken symlinks ( for packages that are no longer in the feed )
find -L package/feeds -maxdepth 2 -type l -delete || exit 1
cp .genconfig_config_bak .config
make defconfig || exit 1
# record when we last run this script
touch tmp/.iop_bootstrap || exit 1
# always return true
exit 0
}
register_command "feeds_update" "Compatibility function only"
register_command "feeds_update" "Update feeds to point to commit hashes from feeds.conf"

View File

@@ -1,6 +1,6 @@
#!/bin/bash
function genconfig-legacy {
function genconfig {
export CLEAN=0
export DIRTY="--dirty"
export IMPORT=1
@@ -196,7 +196,7 @@ function genconfig-legacy {
usage() {
echo
echo 1>&2 "Usage: $0 genconfig-legacy [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
echo
echo -e " -c|--clean\t\tRemove all files under ./files and import from config "
echo -e " -D|--no-dirty\t\tIgnore dirty tree"
@@ -210,7 +210,7 @@ function genconfig-legacy {
echo -e " -a|--list-all\t\tList all Customers and their board types"
echo -e " -b|--boards\t\tList all board types"
echo
echo "Example ./iop genconfig-legacy eg400 OPERATORX"
echo "Example ./iop genconfig eg400 OPERATORX"
echo "(if no customerconfig is chosen, iopsys config will be used)"
echo
exit 0
@@ -399,8 +399,6 @@ function genconfig-legacy {
echo "CONFIG_TARGET_${target}=y" >> .config
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
;;
*)
echo "CONFIG_TARGET_${target}=y" >> .config
@@ -433,6 +431,15 @@ function genconfig-legacy {
fi
done
fi
# Ensure strict file permissions, for when provided through the above
if [ -f "$FILEDIR/etc/shadow" ]; then
v "chmod 0600 $FILEDIR/etc/shadow"
chmod 0600 "$FILEDIR/etc/shadow"
fi
if [ -d "$FILEDIR/etc/ssl/private" ]; then
v "find $FILEDIR/etc/ssl/private -type d -exec chmod 0700 '{}' ';' -o -type f -exec chmod 0600 '{}' ';'"
find "$FILEDIR/etc/ssl/private" -type d -exec chmod 0700 '{}' ';' -o -type f -exec chmod 0600 '{}' ';'
fi
# Set target version
local git_version
@@ -496,7 +503,7 @@ function genconfig-legacy {
if [ $# -eq 0 ]; then
echo Current profile:
cat $CURRENT_CONFIG_FILE
echo "Try ./iop genconfig-legacy -h' to get instructions if you want to change current config"
echo "Try ./iop genconfig -h' to get instructions if you want to change current config"
exit 0
else
while [ -n "$1" ]; do
@@ -532,4 +539,4 @@ function genconfig-legacy {
fi
}
register_command "genconfig-legacy" "Generate configuration for board and customer - legacy mode"
register_command "genconfig" "Generate configuration for board and customer"

View File

@@ -1,6 +1,6 @@
#!/bin/bash
function genconfig_min-legacy {
function genconfig_min {
export CLEAN=0
export DIRTY="--dirty"
export SRCTREEOVERR=0
@@ -195,7 +195,7 @@ function genconfig_min-legacy {
usage() {
echo
echo 1>&2 "Usage: $0 genconfig_min-legacy [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
echo
echo -e " -c|--clean\t\tRemove all files under ./files and import from config "
echo -e " -D|--no-dirty\t\tIgnore dirty tree"
@@ -209,7 +209,7 @@ function genconfig_min-legacy {
echo -e " -a|--list-all\t\tList all Customers and their board types"
echo -e " -b|--boards\t\tList all board types"
echo
echo "Example ./iop genconfig_min-legacy eg400 OPERATORX"
echo "Example ./iop genconfig eg400 OPERATORX"
echo "(if no customerconfig is chosen, iopsys config will be used)"
echo
exit 0
@@ -373,8 +373,6 @@ function genconfig_min-legacy {
echo "CONFIG_TARGET_${target}=y" >> .config
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
;;
*)
echo "CONFIG_TARGET_${target}=y" >> .config
@@ -407,6 +405,15 @@ function genconfig_min-legacy {
fi
done
fi
# Ensure strict file permissions, for when provided through the above
if [ -f "$FILEDIR/etc/shadow" ]; then
v "chmod 0600 $FILEDIR/etc/shadow"
chmod 0600 "$FILEDIR/etc/shadow"
fi
if [ -d "$FILEDIR/etc/ssl/private" ]; then
v "find $FILEDIR/etc/ssl/private -type d -exec chmod 0700 '{}' ';' -o -type f -exec chmod 0600 '{}' ';'"
find "$FILEDIR/etc/ssl/private" -type d -exec chmod 0700 '{}' ';' -o -type f -exec chmod 0600 '{}' ';'
fi
# Set target version
local git_version
@@ -464,7 +471,7 @@ function genconfig_min-legacy {
if [ $# -eq 0 ]; then
echo Current profile:
cat $CURRENT_CONFIG_FILE
echo "Try ./iop genconfig_min-legacy -h' to get instructions if you want to change current config"
echo "Try ./iop genconfig -h' to get instructions if you want to change current config"
exit 0
else
while [ -n "$1" ]; do
@@ -500,4 +507,4 @@ function genconfig_min-legacy {
fi
}
register_command "genconfig_min-legacy" "Generate configuration for customer with manual board configuration - legacy mode"
register_command "genconfig_min" "Generate configuration for customer with manual board configuration"

View File

@@ -1,29 +0,0 @@
#!/bin/bash
# Function to convert parameters to lowercase
function to_lowercase {
local params=()
for param in "$@"; do
params+=("$(tr '[:upper:]' '[:lower:]' <<< "$param")")
done
echo "${params[@]}"
}
function genconfig {
target_script="./scripts/gen_config.py"
# First convert all to lowercase
args=$(to_lowercase "$@")
# Check if an option is provided
if [[ ${args[0]} == -* ]]; then
# Convert options for target script
if [[ ${args[0]} == "-b" || ${args[0]} == "--boards" ]]; then
args=("--list")
fi
fi
${target_script} ${args[@]}
}
register_command "genconfig" "Generate configuration for board and customer"

View File

@@ -1,10 +1,646 @@
# Exported interface
update_package() {
echo "update_package is no longer supported." >&2
echo "Its replacement will come soon." >&2
echo >&2
echo "For now update references in profiles/include/*.yml and feeds.conf.io manually." >&2
return 1
#!/bin/bash
print_git_update()
{
echo "pkg -> ${PKG_NAME}"
echo " PKG_BUILD_DIR = ${PKG_BUILD_DIR}"
echo " PKG_DIR = ${PKG_DIR}"
echo " PKG_SOURCE = ${PKG_SOURCE}"
echo " PKG_NAME = ${PKG_NAME}"
echo " PKG_SOURCE_URL = ${PKG_SOURCE_URL}"
echo " PKG_SOURCE_PROTO= ${PKG_SOURCE_PROTO}"
echo " PKG_SOURCE_VERSION= ${PKG_SOURCE_VERSION}"
echo " PKG_SOURCE = ${PKG_SOURCE}"
echo " PKG_SOURCE_VERSION_FILE=${PKG_SOURCE_VERSION_FILE}"
}
register_command "update_package" "No longer used command"
is_git_same()
{
git_last=$(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)
#echo "$PKG_NAME $git_last = ${PKG_SOURCE_VERSION}"
if [ "$git_last" == "${PKG_SOURCE_VERSION}" ]
then
return 0
fi
return 1
}
update_this_pkg()
{
mk_hash=$(get_makefile_hash)
if [ "$mk_hash" != "${PKG_SOURCE_VERSION}" ]
then
echo "${PKG_NAME}:"
echo " build dir = ${PKG_BUILD_DIR}"
echo " feed makefile = ${mk_hash}"
echo " stale hash = ${PKG_SOURCE_VERSION}"
echo " build git = $(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)"
echo " Git hash in package makefile and the git hash recorded from last compile of"
echo " package is different. You probably want to recompile the package"
echo " to get an up to date version in ${PKG_BUILD_DIR}/.git_update"
echo ""
echo -n " Should we continue with the update anyway? [y/N]:"
read answer
echo ""
case $answer in
y|Y)
;;
n|N|*)
return 1;;
esac
fi
echo "${PKG_NAME}:"
echo " build dir = ${PKG_BUILD_DIR}"
echo " pkg dir = ${PKG_DIR}"
echo " feed makefile = ${PKG_SOURCE_VERSION}"
echo " build git = $(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)"
echo " package is at a different git commit in build compared to feed"
echo -n " Should we update the feed and top project to reflect the new version ? [y/N]:"
read answer
echo ""
case $answer in
y|Y)
return 0;;
*)
echo ""
return 1;;
esac
}
get_makefile_hash()
{
if [ -n "$PKG_SOURCE_VERSION_FILE" ]
then
name="$PKG_SOURCE_VERSION_FILE"
else
name=Makefile
fi
grep "PKG_SOURCE_VERSION:=" ${PKG_DIR}/${name} | sed -e "s/\(^PKG_SOURCE_VERSION:=\)\(.*\)/\2/"
}
insert_hash_in_feed_makefile()
{
if [ -n "$PKG_SOURCE_VERSION_FILE" ]
then
name="$PKG_SOURCE_VERSION_FILE"
else
name=Makefile
fi
git_last=$(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)
sed -i -e "s/\(^PKG_SOURCE_VERSION:=\).*/\1${git_last}/" ${PKG_DIR}/${name}
(cd ${PKG_DIR}; git add ${name})
}
insert_version_in_feed_makefile()
{
if [ -n "$PKG_SOURCE_VERSION_FILE" ]
then
name="$PKG_SOURCE_VERSION_FILE"
else
name=Makefile
fi
last_version=$(awk -F '=' '/PKG_VERSION:=/ {print $2}' ${PKG_DIR}/${name})
echo -n "please enter version: "
read -ei "$last_version" answer
if [ -z ${answer} ]; then
return
fi
sed -i -e "s/\(^PKG_VERSION:=\).*/\1${answer}/" ${PKG_DIR}/${name}
(cd ${PKG_DIR}; git add ${name})
}
# BUG: fix if only local branche name!
branch_uptodate()
{
# $1 git repo
# $2 if it exist dont abort do the pull
(cd $1
git remote update 2>&1 >/dev/null
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse @{u})
BASE=$(git merge-base @ @{u})
if [ -z "$REMOTE" ]; then
BRANCH=$(basename $(git symbolic-ref -q HEAD))
echo "You need to setup a tracking branch for $BRANCH"
exit 99
fi
if [ $LOCAL = $REMOTE ]; then
return
elif [ $LOCAL = $BASE ]; then
if [ -n "$2" ]
then
echo "Doing automatic pull on [ $1 ]"
if git pull
then
return
else
echo "Something wrong with pull. aborting, repo at"
echo " [ $1 ]"
exit 99
fi
else
echo "Local repo behind remote:"
echo "do git pull at repo"
echo " [ $1 ]"
exit 99
fi
elif [ $REMOTE = $BASE ]; then
echo "Local repo ahead of remote. A push is needed"
echo "Repo is at: $1"
echo ""
echo -n "Should we try a push ? [Y/n]:"
read answer
echo ""
case $answer in
n|N|q|Q)
exit 99;;
*)
echo -e "${Yellow}"
if ! git push origin HEAD
then
echo -e "${Color_Off}"
exit 99
fi
echo -e "${Color_Off}Push done."
;;
esac
else
echo "Diverged. not sure what you did but there is no tracking branch. "
echo "repo at [ $1 ]. fix it so that there is a tracking branch remote."
echo "Often this is related to somebody having commited to the same branch"
echo "on the server so a simple push wont work, try a 'git rebase'."
exit 99
fi
)
}
on_a_branch()
{
local repo=$1
local type=$2
(
cd $repo
name=$(git symbolic-ref -q HEAD)
if [ -z "$name" ]
then
echo "git $type repo [ $repo ] is detached."
branches=($(git branch -r --contains $(git rev-parse HEAD)))
if [ 0 == ${#branches[@]} ]
then
echo "It needs to be on a branch but git could not find any associated branch"
echo ""
echo "you need to make sure that the commit is not on a detached branch"
echo "and that the branch exist in the remote repo also. it can not be a local name"
echo "as it is about to get pushed so it can be part of system release"
exit 99
fi
echo "It needs to be on a branch. Please select one or quit if it is not in list."
echo ""
i=0
for branch in ${branches[*]}
do
echo "$i: $branch"
i=$((i + 1))
done
echo ""
echo -n "Select what branch to checkout. Q/q or N/n to quit? "
read answer
case $answer in
q|Q|n|N)
echo "Aborting!"
exit 99;;
esac
echo -e "${Yellow}"
pwd
echo "git checkout ${branches[$answer]}"
if ! git checkout -t ${branches[$answer]}
then
local_branch=$(basename ${branches[$answer]})
if ! git checkout ${local_branch}
then
echo -e "${Color_Off}"
echo "update_git aborting! something was wrong changing to branch ${branches[$answer]}"
echo "go to [ $repo ] and fix it."
exit 99
fi
fi
echo -e "${Color_Off}"
fi
)
}
git_repos_uptodate()
{
on_a_branch ${PKG_BUILD_DIR} package
on_a_branch ${PKG_DIR} feed
on_a_branch ${PWD} top
branch_uptodate ${PKG_BUILD_DIR}
branch_uptodate ${PKG_DIR} do_pull
branch_uptodate ${PWD} do_pull
}
get_feed_name()
{
echo $1 |sed -e "s|.*feeds/\([^/]*\).*|\1|"
# rest=$(dirname $1)
# base=$(basename $1)
# prev=$base
# while [ -n "$rest" ]
# do
# if [ "$base" == "feeds" ]
# then
# echo "$prev"
# fi
# done
}
create_message()
{
FORMAT="commit %H%n\
Author: %aN <%aE>%n\
Date: %ai%n\
%n\
%w(80,4,4)%s%n
%b%n\
%w()Base directory -> ${repo_PATH}/"
local FROM=${PKG_SOURCE_VERSION}
local TO=$(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)
local commits=$(cd ${PKG_BUILD_DIR};git rev-list ${FROM}..${TO})
local feed=$(get_feed_name ${PKG_DIR})
echo "Update feed [ $feed ] package [ $PKG_NAME ]"
echo ""
echo "-------------------------------------------------------------------------------"
(cd ${PKG_BUILD_DIR}; git log --graph --oneline ${FROM}..${TO})
echo "-------------------------------------------------------------------------------"
for commit in $commits
do
(cd ${PKG_BUILD_DIR}; git show --stat --pretty=format:"$FORMAT" $commit)
echo "-------------------------------------------------------------------------------"
done
}
edit_file()
{
echo -en "${Red}"
echo "Here is the commit message we are going to use!"
echo "-------------------------------------------------------------------------------"
echo -en "${Color_Off}"
cat $1
echo -en "${Red}"
echo "-------------------------------------------------------------------------------"
echo -en "${Color_Off}"
echo -n "Do you want to edit the message [y/N]? "
read answer
case $answer in
y|Y)
$EDITOR $1;;
esac
}
commit_feed()
{
template=$(readlink -f $1)
edit_file $template
echo -e "${Yellow}"
(
cd ${PKG_DIR}
if git commit -F $template
then
if git push origin HEAD
then
echo -e "${Color_Off} Feed Updated!"
return
else
echo -e "${Color_Off}"
echo "something wrong push feed git ${PKG_DIR}"
exit 99
fi
else
echo -e "${Color_Off}"
echo "something wrong committing to feed git ${PKG_DIR}"
exit 99
fi
)
}
commit_feeds_config()
{
template=$(readlink -f $1)
edit_file $template
echo -e "${Yellow}"
if git commit -F $template
then
if git push origin HEAD
then
echo -e "${Color_Off}Feeds.conf updated!"
return
else
echo -e "${Color_Off}"
echo "something wrong push change to feeds.conf"
echo "try \"git remote update ; git stash ;git rebase; git push;git stash pop\""
exit 99
fi
else
echo -e "${Color_Off}"
echo "something wrong committing to feed git"
exit 99
fi
}
insert_hash_in_feeds_config()
{
local feed=$(get_feed_name ${PKG_DIR})
local TO=$(cd ${PKG_DIR}; git rev-parse HEAD)
sed -i feeds.conf -e "/ ${feed} / s/\(.*\)[;^].*/\1^${TO}/"
git add feeds.conf
}
check_packages()
{
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
echo "Now checking if any changes have been done to the packages."
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
# only scan in the build directory that is currently in use.
CPU=$(grep "CONFIG_CPU_TYPE=" .config| cut -f2 -d\")
LIBC=$(grep "CONFIG_LIBC=" .config| cut -f2 -d\")
# First scan all files in build dir for packages that have .git directories.
all_pkgs=$(find build_dir/*${CPU}*${LIBC}* -name ".git")
for pkg in `echo "$all_pkgs"`
do
pkg=$(dirname $pkg)
# check if the git in build is at same commit id as the feed makefile points out
if [ -e ${pkg}/.git_update ]
then
source ${pkg}/.git_update
fi
# print_git_update
if [ -n "${PKG_NAME}" ]
then
if ! is_git_same
then
if update_this_pkg
then
# print_git_update
git_repos_uptodate
insert_hash_in_feed_makefile
[ ${UPDATE} -eq 1 ] && insert_version_in_feed_makefile
create_message >tmp/msg
commit_feed tmp/msg
insert_hash_in_feeds_config
commit_feeds_config tmp/msg
fi
fi
fi
done
}
# now handle the target git. we have only one
feeds_hash()
{
grep -v "^#" feeds.conf | grep " $1 " | grep "\^" | sed -e "s/.*[;^]\(.*\)/\1/"
}
insert_feed_hash_in_feeds_config()
{
local feed=$1
local TO=$(cd feeds/${feed}; git rev-parse HEAD)
sed -i feeds.conf -e "/ ${feed} / s/\(.*\)[;^].*/\1^${TO}/"
git add feeds.conf
}
create_feed_message()
{
local feed=$1
local FROM=$2
local TO=$3
local FORMAT="commit %H%n\
Author: %aN <%aE>%n\
Date: %ai%n\
%n\
%w(80,4,4)%s%n
%b%n\
%w()Base directory -> feeds/$feed/"
local commits=$(cd feeds/$feed;git rev-list ${FROM}..${TO})
echo "Update feed [ $feed ]"
echo ""
echo "-------------------------------------------------------------------------------"
(cd feeds/$feed; git log --graph --oneline ${FROM}..${TO})
echo "-------------------------------------------------------------------------------"
for commit in $commits
do
(cd feeds/$feed; git show --stat --pretty=format:"$FORMAT" $commit)
echo "-------------------------------------------------------------------------------"
done
}
check_feeds()
{
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
echo "Now checking if any changes have been done to the feeds."
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
feeds="$1"
[ -n "$feeds" ] || feeds=$(grep -v "^#" feeds.conf| awk '{print $2}')
for feed in `echo $feeds`
do
feed_hash=$(feeds_hash $feed)
[ -n "$feed_hash" ] || continue
if [ -d feeds/$feed ]; then
in_git=$(cd feeds/$feed; git rev-parse HEAD)
if [ "$feed_hash" != "$in_git" ]
then
name=$(cd feeds/$feed;git symbolic-ref -q HEAD)
if [ -z "$name" ]
then
echo "Feed feeds/${feed} is at a git commit which is different from feeds.conf"
#echo "git id from feeds.conf [$feed_hash] git id from feeds/${feed} [$in_git]"
on_a_branch feeds/${feed} feed
#redo the test here and see if the feeds.conf and git is still different.
in_git=$(cd feeds/$feed; git rev-parse HEAD)
if [ "$feed_hash" = "$in_git" ]
then
continue
fi
fi
LOCAL=$(cd feeds/$feed;git rev-parse @)
REMOTE=$(cd feeds/$feed;git rev-parse @{u})
BASE=$(cd feeds/$feed;git merge-base @ @{u})
# if we are behind the remote automatically do a pull
if [ $LOCAL = $BASE ]; then
(cd feeds/$feed ; git pull 1>/dev/null)
#redo the test here and see if the feeds.conf and git is still different.
in_git=$(cd feeds/$feed; git rev-parse HEAD)
if [ "$feed_hash" = "$in_git" ]
then
continue
fi
fi
echo "Feed feeds/${feed} is at different commit than what is in feeds.conf"
#echo "git id from feeds.conf [$feed_hash] git id from feeds/${feed} [$in_git]"
echo -n "Should we update feeds.conf to reflect the new version ? [y/N]:"
read answer
case $answer in
n|N|'')
continue;;
esac
branch_uptodate feeds/${feed}
create_feed_message ${feed} $feed_hash $in_git >tmp/msg
insert_feed_hash_in_feeds_config ${feed}
commit_feeds_config tmp/msg
fi
fi
done
}
is_local_and_remote_same()
{
git remote update 2>/dev/null 1>/dev/null
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse @{u})
if [ $LOCAL = $REMOTE ]
then
return
fi
local_name=$(git rev-parse --abbrev-ref @ )
remote_name=$(git rev-parse --abbrev-ref @{u} )
echo "Top repo local branch \"$local_name\" is not at same point as remote \"$remote_name\""
echo "This update script will update the feeds.conf file and for that to work it needs to"
echo "be up to date with the remote."
echo ""
echo "please run:"
echo " git pull"
echo " ./iop feeds_update"
echo ""
echo "do not forget the bootstrap. but do not run make it can delete your package in build"
exit 0
}
usage(){
echo -e "$0 [flags]"
echo -e "flags:"
echo -e " -f\tFeed to update"
echo -e " -h\tShow this help"
echo -e " -u\tUpdate package version\n"
}
# Exported interface
function update_package {
UPDATE=0
Color_Off='\033[0m' # Text Reset
# Regular Colors
Black='\033[0;30m' # Black
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
Yellow='\033[0;33m' # Yellow
Blue='\033[0;34m' # Blue
Purple='\033[0;35m' # Purple
Cyan='\033[0;36m' # Cyan
White='\033[0;37m' # White
while getopts "f:hu" opt; do
case $opt in
f)
feed=$OPTARG
;;
h)
usage
exit 1
;;
u)
UPDATE=1
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
if [ -z "$EDITOR" ]
then
if [ -f /usr/bin/vi ]; then
EDITOR=vi
else
echo "env variable EDITOR needs to be set"
exit 1
fi
fi
# allow subshells to abort the whole program by exiting with "exit 99"
set -E
trap '[ "$?" -ne 99 ] || exit 99' ERR
is_local_and_remote_same
[ -n "$feed" ] || check_packages
check_feeds $feed
}
register_command "update_package" "Publish changes to packages and feeds"

View File

@@ -1,50 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=iopsys-analytics
PKG_RELEASE:=$(COMMITCOUNT)
PKG_LICENSE:=PROPRIETARY
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=88dd7997ed78b1ab02c2904ed90518c46a8fa26b
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/iopsys-analytics.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
CATEGORY:=Utilities
TITLE:=Analytics tweaks for IOPSYS CI/CD purposes
# setting core dump limit
DEPENDS+= \
+prlimit \
# monitoring
DEPENDS+= \
+collectd \
+collectd-mod-cpu \
+collectd-mod-exec \
+collectd-mod-load \
+collectd-mod-memory \
+collectd-mod-network \
+collectd-mod-processes \
+collectd-mod-write-http \
+@PACKAGE_COLLECTD_ENCRYPTED_NETWORK \
# remote syslog
DEPENDS+= \
+syslog-ng \
+@SYSLOGNG_LOGROTATE \
endef
define Package/$(PKG_NAME)/description
Analytics tweaks for IOPSYS internal CI/CD purposes
e.g. syslog, system health, coredumps...
endef
Build/Compile=
define Package/$(PKG_NAME)/install
$(CP) -r $(PKG_BUILD_DIR)/files/* $(1)/
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -10,7 +10,7 @@ PKG_VERSION:=7.4.3
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=ba80dcc51056772c906cac8022a2537b74959e6a
PKG_SOURCE_VERSION:=0f16f1bd7d995427f0c4601b4e1e595224321df2
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libeasy.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
@@ -28,12 +28,6 @@ TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include/openssl \
-I$(STAGING_DIR)/usr/include/libnl3
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -r --exclude=.* ~/git/libeasy/ $(PKG_BUILD_DIR)/
endef
endif
MAKE_FLAGS += \
CFLAGS="$(TARGET_CFLAGS) -Wall"
@@ -62,7 +56,6 @@ define Build/InstallDev/libeasy
$(CP) $(PKG_BUILD_DIR)/if_utils.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/debug.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/hlist.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/timestamp.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/libeasy*.so* $(1)/usr/lib/
endef

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libethernet
PKG_VERSION:=7.2.107
PKG_VERSION:=7.2.112.1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=9c0e9ecd62b79d4e89b4f013f04124870d237395
PKG_SOURCE_VERSION:=938752e3bd4c524aa518fc247d186ebdf282e1c0
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libethernet.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip

View File

@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libvoice-airoha
PKG_RELEASE:=1
PKG_VERSION:=1.0.12
PKG_VERSION:=1.0.13
PKG_LICENSE:=PROPRIETARY
PKG_LICENSE_FILES:=LICENSE
@@ -17,7 +17,7 @@ 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:=68f0b4f3edecea9b8f05e72b6bbf3952d3946b7c
PKG_SOURCE_VERSION:=c22f9b2e5348c3e4c99840314f68f35b379a3549
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -0,0 +1,21 @@
#!/bin/sh
hasVoice=$(db -q get hw.board.hasVoice)
[ "$hasVoice" = "1" ] || { rm -f "/etc/config/asterisk"; return; }
source /lib/voice/config_asterisk.sh
default_asterisk_config
SLIC=`cat /proc/device-tree/airoha-voice/slic-type`
[ "${SLIC#pef}" != "${SLIC}" ] || return
echo Configure TxGain and RxGain for MXL SLIC $SLIC
ports=$(db -q get hw.board.VoicePorts)
for p in $(seq 0 $((ports-1))); do
uci set asterisk.extension${p}.txgain='10'
uci set asterisk.extension${p}.rxgain='-15'
done
uci commit asterisk

View File

@@ -17,7 +17,7 @@ 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:=3a8d0954ca351a1f8f669dc2f3d294409b90f091
PKG_SOURCE_VERSION:=99ed0ea5ef83cebb444d135909573ccb2b37fe45
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -0,0 +1,10 @@
#!/bin/sh
hasVoice=$(db -q get hw.board.hasVoice)
[ "$hasVoice" = "1" ] || { rm -f "/etc/config/asterisk"; return; }
source /lib/voice/config_asterisk.sh
default_asterisk_config

View File

@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libvoice-d2
PKG_RELEASE:=1
PKG_VERSION:=1.1.4
PKG_VERSION:=1.1.2
PKG_LICENSE:=PROPRIETARY
PKG_LICENSE_FILES:=LICENSE
@@ -17,7 +17,7 @@ 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:=17388c54e14d8505254c0640067cf697760310ee
PKG_SOURCE_VERSION:=e6d689334000bc57498d9a3f203a8933160e1ef4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libwifi
PKG_VERSION:=7.4.42
PKG_VERSION:=7.4.16.18
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=c3efa4ecd3bbf8247bc1b4c3e0ff512e42649531
PKG_SOURCE_VERSION:=b8adef24b294279bf07c0f9d00813b51fae7107f
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libwifi.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
@@ -76,6 +76,10 @@ ifeq ($(CONFIG_LIBWIFI_USE_CTRL_IFACE),y)
TARGET_CFLAGS +=-DLIBWIFI_USE_CTRL_IFACE
endif
ifeq ($(CONFIG_LIBWIFI_SKIP_PROBES),y)
TARGET_CFLAGS +=-DLIBWIFI_BRCM_SKIP_PROBES
endif
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/openssl \
@@ -143,7 +147,12 @@ define Package/libwifi/config
config LIBWIFI_USE_CTRL_IFACE
bool "Create UNIX sockets to interface with hostapd/wpa_supplicant"
default n
config LIBWIFI_SKIP_PROBES
bool "Don't create probe-req events"
default y
endif
endef

View File

@@ -55,5 +55,8 @@ config AGENT_OPER_CHANNEL_CHANGE_RELAY_MCAST
config AGENT_USE_LIBDPP
bool "Depend on libdpp for DPP EasyConnect"
config DYNBHD_DYNAMICALLY_PERSIST_CONTROLLER
bool "Let dynbhd through AP-Autoconfiguration Search and DHCP Discovery determine the controller or agent role"
endmenu
endif

View File

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-agent
PKG_VERSION:=4.5.1.15.1
PKG_VERSION:=4.5.0.34
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=e0538bb1eb0b85ac085e6abb61ebbf8e1712f1e7
PKG_SOURCE_VERSION:=8a73986f67c717961dc62cf11c8b0458ab04cc05
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@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 \
+ieee1905-map-plugin +ip-bridge +AGENT_USE_LIBDPP:libdpp
+map-plugin +ip-bridge +AGENT_USE_LIBDPP:libdpp
endef
ifeq ($(CONFIG_AGENT_USE_LIBDPP),y)
@@ -40,7 +40,7 @@ define Package/dynbhd
CATEGORY:=Utilities
TITLE:=Dynamic Backhaul Daemon
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
+ieee1905-map-plugin +map-agent
+map-plugin +map-agent
endef
@@ -105,6 +105,10 @@ ifeq ($(CONFIG_AGENT_OPER_CHANNEL_CHANGE_RELAY_MCAST),y)
TARGET_CFLAGS += -DOPER_CHAN_CHANGE_RELAY_MCAST
endif
ifeq ($(CONFIG_DYNBHD_DYNAMICALLY_PERSIST_CONTROLLER),y)
TARGET_CFLAGS += -DPERSIST_CONTROLLER
endif
MAKE_PATH:=src
define Package/map-agent/install

View File

@@ -1,14 +1,14 @@
config agent 'agent'
option enabled '0'
option enabled '1'
option debug '0'
option profile '3'
option al_bridge 'br-lan'
option netdev 'wlan'
option island_prevention '0'
option island_prevention '1'
option eth_onboards_wifi_bhs '1'
option scan_on_boot_only '0'
option chan_ch_relay_mcast '0'
option chan_ch_relay_mcast '1'
option guest_isolation '1'
option dyn_cntlr_sync '0'
list map_port 'all'
# option controller_macaddr '0a:1b:2c:3d:4e:50'

View File

@@ -1,17 +1,19 @@
#!/bin/sh
. /lib/network/utils.sh
conn_ports_file="/var/run/multiap/map.connected.ports"
map_bh_file="/var/run/multiap/multiap.backhaul"
# Exit if AL Bridge is not configured to be a bridge device
al_bridge="$(uci -q get mapagent.agent.al_bridge)"
[ "${al_bridge:0:3}" = "br-" ] || exit 0
al_brnet="${al_bridge:3}"
# Exit if the PORT is not member of the AL Bridge
[ "$(get_network_of $PORT)" = "$al_brnet" ] || exit 0
port_bridge_sec="$(uci show network | grep -w $PORT | grep '\.ports' | cut -d'.' -f2)"
port_bridge_name="$(uci -q get network.$port_bridge_sec.name)"
[ "$port_bridge_name" = "$al_bridge" ] || exit 0
# Exit if the device is not operating in extender/repeater mode
al_brnet="${al_bridge:3}"
[ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ] || exit 0
############## Dynamic Backhaul Daemon ##############

View File

@@ -5,8 +5,8 @@
generate_mapagent_config=0
generate_wireless_sta_config=0
network_mode="$(fw_printenv -n netmode)"
multiap_mode="$(fw_printenv -n multiap_mode)"
network_mode="$(fw_printenv -n netmode)" # default is layer3
multiap_mode="$(fw_printenv -n multiap_mode)" # default is full
is_airoha() {
[ -f /proc/device-tree/compatible ] || return
@@ -181,20 +181,19 @@ map_genconf () {
elif [ "$multiap_mode" == "auto" ]; then
uci -q set mapagent.@controller_select[0].autostart=1
uci -q set mapagent.@controller_select[0].local=0
elif [ "$multiap_mode" == "full" ]; then
uci -q set mapagent.@controller_select[0].autostart=1
uci -q set mapagent.@controller_select[0].local=1
elif [ "$multiap_mode" == "none" ]; then
uci set mapagent.agent.enabled="0"
else # default to full
uci -q set mapagent.@controller_select[0].autostart=1
uci -q set mapagent.@controller_select[0].local=1
fi
uci -q commit mapagent
fi
if [ "$multiap_mode" == "agent" -o "$multiap_mode" == "none" ]; then
uci set mapcontroller.controller.enabled="0"
else
uci set mapcontroller.controller.enabled="1"
if [ "$multiap_mode" == "agent" -o "$multiap_mode" == "none" ]; then
uci set mapcontroller.controller.enabled="0"
else
uci set mapcontroller.controller.enabled="1"
fi
uci -q commit mapcontroller
fi
uci -q commit mapcontroller
}

View File

@@ -29,6 +29,10 @@ config CONTROLLER_EASYMESH_VENDOR_EXT_OUI
config CONTROLLER_USE_LIBDPP
bool "Depend on libdpp for DPP EasyConnect"
config CONTROLLER_PROPAGATE_PROBE_REQ
depends on CONTROLLER_EASYMESH_VENDOR_EXT
bool "Enable publishing probe requests vendor specific messages as UBUS events"
default y
endmenu
endif

View File

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-controller
PKG_VERSION:=4.6.0.5.2
PKG_VERSION:=4.5.0.23
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=27b2dabe45811909122a90e185bab3860a340084
PKG_SOURCE_VERSION:=ea159dee9536889171fe6f2463c2259ac48c4a97
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
LOCAL_DEV=0
@@ -27,7 +27,7 @@ define Package/map-controller
SECTION:=utils
CATEGORY:=Utilities
TITLE:=WiFi Multi-AP Controller (EasyMesh R2)
DEPENDS:=+libuci +libubox +ubus +libeasy +libwifiutils +libieee1905 +ieee1905 +ieee1905-map-plugin \
DEPENDS:=+libuci +libubox +ubus +libeasy +libwifiutils +libieee1905 +ieee1905 +map-plugin \
+CONTROLLER_USE_LIBDPP:libdpp
endef
@@ -63,6 +63,10 @@ TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=$(CONFIG_CONTROLLER_EASYMESH_VENDOR_E
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT
endif
ifeq ($(CONFIG_CONTROLLER_PROPAGATE_PROBE_REQ),y)
TARGET_CFLAGS += -DPROPAGATE_PROBE_REQ
endif
define Package/map-controller/install
$(INSTALL_DIR) $(1)/etc
$(CP) ./files/* $(1)/

View File

@@ -39,7 +39,6 @@ config_snooping_upstream_interface() {
local snooping_upstream_intf=""
json_load "$(devstatus $1)"
logger -t "mcastconf" "$(devstatus $1)"
itr=1
json_select bridge-members
@@ -49,7 +48,7 @@ config_snooping_upstream_interface() {
*.*)
port="$(echo "$dev" | cut -d'.' -f 1)"
if [ $port == $ethwan ]; then
ifconfig $dev | grep RUNNING >/dev/null && $snooping_upstream_intf="$dev" && break
ifconfig $dev | grep RUNNING >/dev/null && snooping_upstream_intf="$dev" && break
fi
;;
esac

View File

@@ -91,7 +91,7 @@ interfaces_ok(){
for itf in $up_interf; do
# check if there exist a interface section for this upstream interface, if yes the
# do nothing, if no then generate config as mcast config is outdated
local dev_section=$(uci show network | grep -E "\.device=\'$itf\'" | cut -d'.' -f2)
local dev_section=$(uci show network | grep -E "\.device=\'$itf\'" | head -n 1 | cut -d'.' -f2)
# mcast config is outdated, simply generate as per new logic
if [ -z "$dev_section" ]; then

View File

@@ -62,7 +62,7 @@ read_snooping() {
local proto
config_get sec_enable "$config" enable 0
config_get proto "$config" proto
config_get proto "$config" proto "igmp"
if [ "$sec_enable" == "0" ]; then
return
@@ -103,7 +103,7 @@ read_proxy() {
local proto
config_get sec_enable "$config" enable 0
config_get proto "$config" proto
config_get proto "$config" proto "igmp"
if [ "$sec_enable" == "0" ]; then
return

View File

@@ -46,9 +46,6 @@ device_has_ip() {
# Read the openwrt interface for the device.
# Device can have multiple logical interfaces like wan and wan6
# but same l3 device
# NB. Don't use 'get_network_of' here.
# This function fails in some uci configurations for interfaces that refer
# to a device indirectly.
local ifaces=$(ubus call network.interface dump | jsonfilter -e "@.interface[@.device='$device'].interface")
for iface in $ifaces; do
local ip=
@@ -88,9 +85,8 @@ config_mcproxy_interfaces() {
echo -e "pinstance main:$str_up ==>$str_down;\n" >> $CONFFILE
local filter=""
for excp in $exceptions; do
local filter=""
case $excp in
*/*)
ip_start="$(ipcalc.sh $excp | grep IP | awk '{print substr($0,4)}')"
@@ -101,16 +97,16 @@ config_mcproxy_interfaces() {
filter="$filter ($excp | *)"
;;
esac
done
for upstream in $str_up; do
echo "pinstance main upstream $upstream in blacklist table{$filter };" >> $CONFFILE
echo "pinstance main upstream $upstream out blacklist table{$filter };" >> $CONFFILE
done
for upstream in $str_up; do
echo "pinstance main upstream $upstream in blacklist table{$filter };" >> $CONFFILE
echo "pinstance main upstream $upstream out blacklist table{$filter };" >> $CONFFILE
done
for downstream in $str_down; do
echo "pinstance main downstream $downstream in blacklist table{$filter };" >> $CONFFILE
echo "pinstance main downstream $downstream out blacklist table{$filter };" >> $CONFFILE
done
for downstream in $str_down; do
echo "pinstance main downstream $downstream in blacklist table{$filter };" >> $CONFFILE
echo "pinstance main downstream $downstream out blacklist table{$filter };" >> $CONFFILE
done
}
@@ -120,6 +116,7 @@ config_sysfs_mcast_snooping() {
for downstream in $downstreams; do
if device_is_bridge "$downstream"; then
echo 0 > /sys/class/net/$downstream/bridge/multicast_snooping
echo $snooping > /sys/class/net/$downstream/bridge/multicast_snooping
fi
done
@@ -264,10 +261,6 @@ config_mcproxy_instance() {
downstreams=$igmp_p_down_interfaces
mcast_mode=$igmp_p_mode
# mcproxy reserves two multicast subscriptions for igmp router service groups
local mg=$(cat /proc/sys/net/ipv4/igmp_max_memberships)
mg=$((mg+2))
echo $mg > /proc/sys/net/ipv4/igmp_max_memberships
elif [ "$protocol" == "mld" ]; then
case "$version" in
[1-2])

View File

@@ -98,6 +98,10 @@ l2_network_config() {
# Update CWMP Agent WAN Interface
uci -q set cwmp.cpe.default_wan_interface="lan"
uci -q commit cwmp
# disable firewall
uci -q set firewall.globals.enabled="0"
uci -q commit firewall
}
network_mode="$(fw_printenv -n netmode 2>/dev/null)"

View File

@@ -22,6 +22,11 @@ config OBUSPA_CONTROLLER_MTP_VERIFY
config OBUSPA_ENABLE_TEST_CONTROLLER
bool "Adds a test controller by default"
default n
select OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL
config OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL
bool "Adds a test controller by default (local access only)"
default n
config OBUSPA_MAX_CONTROLLERS_NUM
int "The maximum number of controllers to be supported"

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=obuspa
PKG_VERSION:=7.0.5.16
PKG_VERSION:=7.0.5.6.12
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
PKG_SOURCE_VERSION:=8249b1e9ae996ed45ec5edcd1adc128bd810a45b
PKG_SOURCE_VERSION:=131e04ec5c6ddd8c2fb47f95fe7da2b9836ed925
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
@@ -32,7 +32,9 @@ define Package/obuspa
SUBMENU:=TRx69
TITLE:=USP agent
MENU:=1
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl +ca-certificates
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl +ca-certificates \
+OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL:mosquitto-ssl +OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL:mosquitto-client-ssl \
+OBUSPA_ENABLE_TEST_CONTROLLER:mosquitto-auth-shadow
endef
define Package/obuspa/description
@@ -104,12 +106,14 @@ define Package/obuspa/install
$(INSTALL_DATA) ./files/etc/config/obuspa $(1)/etc/config/
$(INSTALL_DATA) ./files/etc/obuspa/roles.json $(1)/etc/obuspa/roles.json
$(INSTALL_DATA) ./files/etc/obuspa/dmcaching_exclude.json $(1)/etc/obuspa/dmcaching_exclude.json
$(INSTALL_BIN) ./files/etc/uci-defaults/00-obuspa-extender-mode $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-upgrade-uci $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/uci-defaults/02-obuspa-dhcp-option $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user
$(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/USPAgent.json)
ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER),y)
$(INSTALL_BIN) ./files/etc/uci-defaults/54-test-usp-remote $(1)/etc/uci-defaults/
endif
ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL),y)
$(INSTALL_BIN) ./files/etc/init.d/usptest $(1)/etc/init.d/
$(INSTALL_BIN) ./files/etc/uci-defaults/55-test-usp-controller $(1)/etc/uci-defaults/
endif

View File

@@ -2,12 +2,13 @@ config obuspa 'global'
option enabled '1'
option debug '1'
option dhcp_discovery '1'
option log_level '1'
option log_level '2'
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'
option trust_cert '/etc/ssl/cert.pem'
#option trust_cert '/etc/ssl/cert.pem'
#option client_cert '/etc/obuspa/client.pem'
#option log_dest '/tmp/obuspa.log'
option max_cache_time '120'

View File

@@ -217,12 +217,10 @@ 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:string' \
@@ -230,7 +228,7 @@ validate_controller_section()
'Path:string' \
'EnableEncryption:bool' \
'PeriodicNotifInterval:uinteger' \
'SessionMode:string:Allow' \
'SessionMode:string' \
'ProvisioningCode:string'
}
@@ -255,7 +253,6 @@ validate_mtp_section()
'Path:string' \
'mqtt:string' \
'stomp:string' \
'Reference:string' \
'PublishQoS:uinteger' \
'EnableEncryption:bool'
}
@@ -324,7 +321,7 @@ configure_controller()
local EndpointID Enable
local Protocol Destination
local Topic mqtt stomp assigned_role_name AssignedRole ParameterName ProvisioningCode
local Host Port Path EnableEncryption Reference SessionMode PeriodicNotifInterval
local Host Port Path EnableEncryption PeriodicNotifInterval
local dm_ref sec
sec="${1}"
@@ -346,16 +343,12 @@ configure_controller()
fi
dm_ref=""
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}"
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
db_set "${BASEPATH}.Alias" "${sec}"
@@ -370,16 +363,15 @@ configure_controller()
db_set "${BASEPATH}.PeriodicNotifInterval" "${PeriodicNotifInterval}"
fi
if [ -n "${SessionMode}" ]; then
db_set "${BASEPATH}.E2ESession.SessionMode" "${SessionMode}"
fi
#if [ -n "${SessionMode}" ]; then
# db_set "${BASEPATH}.E2ESession.SessionMode" "${SessionMode}"
#fi
if [ -n "${assigned_role_name}" ]; then
AssignedRole=$(get_role_index "${assigned_role_name}")
fi
if [ -n "${AssignedRole}" ]; then
db_set "${BASEPATH}.AssignedRole" "${AssignedRole}"
if [ -n "${AssignedRole}" ]; then
db_set "${BASEPATH}.AssignedRole" "${AssignedRole}"
fi
fi
db_set "${BASEPATH}.MTP.1.Alias" "${sec}"
@@ -559,16 +551,12 @@ configure_mtp() {
fi
dm_ref=""
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}"
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
db_set "${BASEPATH}.Alias" "${sec}"
@@ -776,8 +764,8 @@ sync_db_controller()
{
local cntrs copts sec pvalue protocol
copts="Enable EndpointID AssignedRole PeriodicNotifInterval"
popts="Destination Topic Reference Host Port Path EnableEncryption"
copts="Enable EndpointID PeriodicNotifInterval"
popts="Destination Topic Host Port Path EnableEncryption"
cntrs="$(get_instances_from_db_dump Device.LocalAgent.Controller.)"
for cntr in $cntrs; do
@@ -809,8 +797,7 @@ sync_db_localagent_mtp()
local mtps opts popts sec pvalue protocol
opts="Enable"
popts="ResponseTopicConfigured Destination Port Path Reference EnableEncryption PublishQoS"
ropts="mqtt stomp"
popts="ResponseTopicConfigured Destination Port Path EnableEncryption PublishQoS"
mtps="$(get_instances_from_db_dump Device.LocalAgent.MTP.)"
for inst in $mtps; do
@@ -833,9 +820,6 @@ sync_db_localagent_mtp()
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
}
@@ -1002,6 +986,9 @@ db_init()
reverse_update_db_with_uci
fi
# Remove ControllerTrust.Role., if present in db for backward compatibility
delete_sql_db_entry_with_pattern "^Device.LocalAgent.ControllerTrust.Role."
# Remove reset file if present
[ -f "${RESET_FILE}" ] && mv ${RESET_FILE} ${RESET_FILE}.old
@@ -1034,11 +1021,17 @@ db_init()
}
start_service() {
local enabled
local enabled role_file
mkdir -p /tmp/obuspa/
config_load obuspa
config_get_bool enabled global enabled 0
config_get role_file global role_file ""
# Use the default role file if not defined in uci, but present in path
if [ -z "${role_file}" ] && [ -f "/etc/obuspa/roles.json" ] ; then
uci -q set obuspa.global.role_file="/etc/obuspa/roles.json"
uci_commit obuspa
fi
procd_open_instance ${CONFIGURATION}
if [ "${enabled}" -eq 1 ]; then

View File

@@ -1,7 +1,6 @@
{
"dmcaching_exclude": [
"Device.Hosts.Host.",
"Device.IEEE1905.",
"Device.WiFi.DataElements."
"Device.Services.VoiceService."
]
}

View File

@@ -260,6 +260,40 @@
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.Schedules.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SET",
"PERMIT_ADD",
"PERMIT_DEL",
"PERMIT_OPER",
"PERMIT_SUBS_VAL_CHANGE",
"PERMIT_SUBS_OBJ_ADD",
"PERMIT_SUBS_OBJ_DEL",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.{BBF_VENDOR_PREFIX}ParentalControl.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SET",
"PERMIT_ADD",
"PERMIT_DEL",
"PERMIT_OPER",
"PERMIT_SUBS_VAL_CHANGE",
"PERMIT_SUBS_OBJ_ADD",
"PERMIT_SUBS_OBJ_DEL",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.NAT.",
"perm": [
@@ -584,6 +618,40 @@
"PERMIT_NONE"
]
},
{
"object":"Device.Schedules.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SET",
"PERMIT_ADD",
"PERMIT_DEL",
"PERMIT_OPER",
"PERMIT_SUBS_VAL_CHANGE",
"PERMIT_SUBS_OBJ_ADD",
"PERMIT_SUBS_OBJ_DEL",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.{BBF_VENDOR_PREFIX}ParentalControl.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SET",
"PERMIT_ADD",
"PERMIT_DEL",
"PERMIT_OPER",
"PERMIT_SUBS_VAL_CHANGE",
"PERMIT_SUBS_OBJ_ADD",
"PERMIT_SUBS_OBJ_DEL",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object": "Device.DeviceInfo.",
"perm": [
@@ -598,12 +666,29 @@
"object":"Device.Hosts.",
"perm": [
"PERMIT_GET",
"PERMIT_SET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SUBS_VAL_CHANGE",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.Hosts.AccessControl.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SET",
"PERMIT_ADD",
"PERMIT_DEL",
"PERMIT_SUBS_VAL_CHANGE",
"PERMIT_SUBS_OBJ_ADD",
"PERMIT_SUBS_OBJ_DEL"
]
},
{
"object":"Device.IEEE1905.",
"perm": [
@@ -614,6 +699,15 @@
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object": "Device.IP.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO"
]
},
{
"object":"Device.DynamicDNS.",
"perm": [

View File

@@ -1,13 +0,0 @@
#!/bin/sh
. /lib/functions.sh
config_load obuspa
config_get interface global interface ""
if command -v fw_printenv; then
mode="$(fw_printenv -n netmode)"
if [ "${mode}" == "extender" -a -z "$interface" ] ; then
uci_set obuspa global interface "lan"
fi
fi

View File

@@ -0,0 +1,20 @@
#!/bin/sh
. /lib/functions.sh
if [ ! -f "/etc/config/mosquitto" ]; then
echo "Local mosquitto broker not available"
return 0
fi
add_usp_test()
{
uci_add mosquitto listener usptest
uci_set mosquitto usptest enabled 1
uci_set mosquitto usptest port '9001'
uci_set mosquitto usptest protocol 'websockets'
uci_set mosquitto usptest auth_plugin '/usr/lib/mosquitto_auth_shadow.so'
}
# Install test MQTT over WS listener
add_usp_test

View File

@@ -40,16 +40,6 @@ add_obuspa_test_controller()
uci_set obuspa testcontroller assigned_role_name 'full_access'
}
add_usp_test()
{
uci_add mosquitto listener usptest
uci_set mosquitto usptest enabled 1
uci_set mosquitto usptest port '9001'
uci_set mosquitto usptest protocol 'websockets'
uci_set mosquitto usptest require_certificates '0'
uci_set mosquitto usptest auth_plugin '/usr/lib/mosquitto_auth_shadow.so'
}
add_obuspa_config()
{
uci_add mosquitto listener obuspa
@@ -60,11 +50,8 @@ add_obuspa_config()
}
# Install test usp controller config
uci_load mosquitto
add_usp_test
add_obuspa_config
uci_load obuspa
add_obuspa_test_mtp
add_obuspa_test_mqtt
add_obuspa_test_controller

View File

@@ -129,15 +129,15 @@ get_vivsoi() {
done
}
get_netmode()
get_access_role()
{
local mode
local mode lan_proto
if command -v fw_printenv; then
mode="$(fw_printenv -n netmode)"
fi
lan_proto="$(uci -q get network.lan.proto)"
if [ "$mode" != "extender" ]; then
if [ "${lan_proto}" == "dhcp" ]; then
mode="extender"
else
mode="full_access"
fi
@@ -146,13 +146,25 @@ get_netmode()
config_load obuspa
config_get_bool enable_obuspa global enabled 1
config_get wan_intf global interface "wan"
config_get wan_intf global interface
config_get_bool dhcp_discovery global dhcp_discovery 1
if [ "$enable_obuspa" = "0" ] || [ "$dhcp_discovery" = "0" ]; then
return 0
fi
if [ -z "${wan_intf}" ]; then
role="$(get_access_role)"
if [ "${role}" = "extender" ]; then
wan_intf="lan"
uci -q set obuspa.global.interface="lan"
uci commit obuspa
else
wan_intf="wan"
fi
fi
if [ "${wan_intf}" == "${INTERFACE}" ]; then
if [ -n "$opt125" ]; then
len=$(printf "$opt125"|wc -c)
@@ -231,7 +243,7 @@ if [ "${wan_intf}" == "${INTERFACE}" ]; then
fi
fi
uci -q set obuspa.dhcpcontroller.assigned_role_name="$(get_netmode)"
uci -q set obuspa.dhcpcontroller.assigned_role_name="$(get_access_role)"
uci -q set obuspa.dhcpcontroller.Enable='1'
uci_change=1
fi

View File

@@ -59,7 +59,7 @@
+**************************************************************************/
+void SetControllerDummyID()
+{
+ cur_msg_controller_info.endpoint_id = "";
+ cur_msg_controller_info.endpoint_id = "CLI_Utility";
+}
+
+/*********************************************************************//**

View File

@@ -0,0 +1,95 @@
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
index 04a1a9c..00b95a4 100644
--- a/src/core/mqtt.c
+++ b/src/core/mqtt.c
@@ -2124,6 +2124,75 @@ exit:
}
}
+static int _check_host_rechability(CURL *handle, curl_infotype type, char *data, size_t size, void *userp)
+{
+ bool *palive = (bool *)userp;
+
+ USP_ASSERT(palive != NULL);
+ switch(type) {
+ case CURLINFO_HEADER_OUT:
+ case CURLINFO_HEADER_IN:
+ *palive = true;
+ break;
+ case CURLINFO_TEXT:
+ {
+ USP_LOG_Debug("CURL DATA:: [%s]", data);
+ if (strstr(data, "Connected to ") != NULL) {
+ *palive = true;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+int check_mqtt_host_reachability(mqtt_client_t *client)
+{
+ CURL *curl;
+ mqtt_conn_params_t *cparam = &client->conn_params;
+ char buffer[128] = {0};
+ int ret = USP_ERR_INTERNAL_ERROR;
+ bool is_alive = false;
+
+ curl = curl_easy_init();
+ if(curl) {
+ USP_SNPRINTF(buffer, 128, "mqtt://%s:%d", cparam->host, cparam->port);
+ curl_easy_setopt(curl, CURLOPT_URL, buffer);
+
+ if (strlen(cparam->username) > 0) {
+ curl_easy_setopt(curl, CURLOPT_USERNAME, cparam->username);
+ }
+
+ if (strlen(cparam->password) > 0) {
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, cparam->password);
+ }
+
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &is_alive);
+ curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, _check_host_rechability);
+
+ /* complete within 2 seconds */
+ curl_easy_setopt(curl, CURLOPT_TIMEOUT, 2L);
+
+ ret = curl_easy_perform(curl);
+ /* Check for errors */
+ if(ret == CURLE_OK || ret == CURLE_URL_MALFORMAT || is_alive == true) {
+ USP_LOG_Debug("CURL MQTT host %s, ret %d, alive %d ...", buffer, ret, is_alive);
+ ret = USP_ERR_OK;
+ } else {
+ USP_LOG_Info("# CURL MQTT host %s unreachable: %d=>%s ...", buffer, ret, curl_easy_strerror(ret));
+ }
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return ret;
+}
+
/*********************************************************************//**
**
** PerformMqttClientConnect
@@ -2193,6 +2262,14 @@ int PerformMqttClientConnect(mqtt_client_t *client)
keep_alive = 5;
}
+ // Below function is a workaround to check the host reachability with a timeout
+ // mosquitto_connect_* API block the thread for 2 mins if host is not reachable,
+ // which halts other clients connectivity
+ err = check_mqtt_host_reachability(client);
+ if (err != USP_ERR_OK) {
+ err = USP_ERR_INTERNAL_ERROR;
+ goto exit;
+ }
// Release the access mutex temporarily whilst performing the connect call
// We do this to prevent the data model thread from potentially being blocked, whilst the connect call is taking place
OS_UTILS_UnlockMutex(&mqtt_access_mutex);

View File

@@ -0,0 +1,76 @@
diff --git a/src/core/device_mqtt.c b/src/core/device_mqtt.c
index 7b3c3df7eb..7beb78ef86 100755
--- a/src/core/device_mqtt.c
+++ b/src/core/device_mqtt.c
@@ -1602,14 +1602,23 @@ int Validate_MQTTConnectRetryTime(dm_req_t *req, char *value)
int NotifyChange_MQTTConnectRetryTime(dm_req_t *req, char *value)
{
mqtt_conn_params_t *mp;
+ bool schedule_reconnect = false;
// Determine mqtt client to be updated
mp = FindMqttParamsByInstance(inst1);
USP_ASSERT(mp != NULL);
// Set the new value.
+ if ((mp->retry.connect_retrytime != val_uint) && (mp->enable)) {
+ schedule_reconnect = true;
+ }
+
mp->retry.connect_retrytime = val_uint;
+ if (schedule_reconnect) {
+ ScheduleMqttReconnect(mp);
+ }
+
return USP_ERR_OK;
}
@@ -1645,14 +1654,23 @@ int Validate_MQTTConnectRetryIntervalMultiplier(dm_req_t *req, char *value)
int NotifyChange_MQTTConnectRetryIntervalMultiplier(dm_req_t *req, char *value)
{
mqtt_conn_params_t *mp;
+ bool schedule_reconnect = false;
// Determine mqtt client to be updated
mp = FindMqttParamsByInstance(inst1);
USP_ASSERT(mp != NULL);
+ if ((mp->retry.interval_multiplier != val_int) && (mp->enable)) {
+ schedule_reconnect = true;
+ }
+
// Set the new value.
mp->retry.interval_multiplier = val_int;
+ if (schedule_reconnect) {
+ ScheduleMqttReconnect(mp);
+ }
+
return USP_ERR_OK;
}
@@ -1688,14 +1706,23 @@ int Validate_MQTTConnectRetryMaxInterval(dm_req_t *req, char *value)
int NotifyChange_MQTTConnectRetryMaxInterval(dm_req_t *req, char *value)
{
mqtt_conn_params_t *mp;
+ bool schedule_reconnect = false;
// Determine mqtt client to be updated
mp = FindMqttParamsByInstance(inst1);
USP_ASSERT(mp != NULL);
+ if ((mp->retry.max_interval != val_uint) && (mp->enable)) {
+ schedule_reconnect = true;
+ }
+
// Set the new value.
mp->retry.max_interval = val_uint;
+ if (schedule_reconnect) {
+ ScheduleMqttReconnect(mp);
+ }
+
return USP_ERR_OK;
}

View File

@@ -0,0 +1,90 @@
diff --git a/src/core/device_controller.c b/src/core/device_controller.c
index a6335f5..57b8486 100644
--- a/src/core/device_controller.c
+++ b/src/core/device_controller.c
@@ -2340,6 +2340,26 @@ int Notify_ControllerEnable(dm_req_t *req, char *value)
}
}
}
+#endif
+
+#ifdef ENABLE_MQTT
+{
+ // Reconnect MQTT client since it may need to update MQTT reference and Topic
+ if (cont->enable)
+ {
+ int i;
+ for (i=0; i<MAX_CONTROLLER_MTPS; i++)
+ {
+ controller_mtp_t *mtp;
+
+ mtp = &cont->mtps[i];
+ if ((mtp->protocol == kMtpProtocol_MQTT) && (mtp->mqtt_connection_instance != INVALID) && (mtp->enable))
+ {
+ DEVICE_MQTT_ScheduleReconnect(mtp->mqtt_connection_instance);
+ }
+ }
+ }
+}
#endif
return USP_ERR_OK;
@@ -2468,6 +2488,17 @@ int Notify_ControllerMtpEnable(dm_req_t *req, char *value)
}
}
}
+#endif
+
+#ifdef ENABLE_MQTT
+{
+ // Reconnect MQTT client since it may need to update MQTT reference and Topic
+ if ((mtp->protocol == kMtpProtocol_MQTT) && (mtp->enable) && (cont->enable) &&
+ (mtp->mqtt_connection_instance != INVALID))
+ {
+ DEVICE_MQTT_ScheduleReconnect(mtp->mqtt_connection_instance);
+ }
+}
#endif
// NOTE: We do not have to do anything for STOMP, as these parameters are only searched when we send
@@ -2559,6 +2590,16 @@ int Notify_ControllerMtpProtocol(dm_req_t *req, char *value)
WSCLIENT_StartClient(cont->instance, mtp->instance, cont->endpoint_id, &mtp->websock);
}
}
+#endif
+
+#ifdef ENABLE_MQTT
+{
+ // Reconnect MQTT client since it may need to update MQTT reference and Topic
+ if ((mtp->protocol == kMtpProtocol_MQTT) && (mtp->mqtt_connection_instance != INVALID))
+ {
+ DEVICE_MQTT_ScheduleReconnect(mtp->mqtt_connection_instance);
+ }
+}
#endif
// NOTE: We don't need to do anything explicitly for STOMP
diff --git a/src/core/device_mtp.c b/src/core/device_mtp.c
index e78a305..d690978 100644
--- a/src/core/device_mtp.c
+++ b/src/core/device_mtp.c
@@ -964,6 +964,9 @@ int NotifyChange_AgentMtpProtocol(dm_req_t *req, char *value)
}
#endif
+ // Cache the changed value
+ mtp->protocol = new_protocol;
+
#ifdef ENABLE_MQTT
// Schedule the affected MQTT connection to reconnect (because it might have lost or gained a agent queue to subscribe to)
if ((mtp->enable) && (mtp->mqtt_connection_instance != INVALID))
@@ -972,9 +975,6 @@ int NotifyChange_AgentMtpProtocol(dm_req_t *req, char *value)
}
#endif
- // Cache the changed value
- mtp->protocol = new_protocol;
-
#ifndef DISABLE_STOMP
// Schedule the affected STOMP connection to reconnect (because it might have lost or gained a agent queue to subscribe to)
if ((mtp->enable) && (mtp->stomp_connection_instance != INVALID))

9
periodicstats/Config.in Normal file
View File

@@ -0,0 +1,9 @@
if PACKAGE_periodicstats
config PERIODICSTAT_INTERNAL_SAMPLING_RATE
int "Number of times statistics will be measured within a sample interval"
range 3 10
default 3
depends on PACKAGE_periodicstats
help
This value must be in range of 3 to 10. (default 3)
endif

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=periodicstats
PKG_VERSION:=1.5.3
PKG_VERSION:=1.5.8.2
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/periodicstats.git
PKG_SOURCE_VERSION:=28bea5be686013af0ba8e54cf4871f10015e4b06
PKG_SOURCE_VERSION:=6bee158e3a4d56d573fb8f26fe06fe59b75138ca
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -32,6 +32,12 @@ define Package/periodicstats/description
Manage periodic statistics
endef
define Package/periodicstats/config
source "$(SOURCE)/Config.in"
endef
TARGET_CFLAGS += -DINTERNAL_SAMPLING_RATE=$(CONFIG_PERIODICSTAT_INTERNAL_SAMPLING_RATE)
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/periodicstats/* $(PKG_BUILD_DIR)/

View File

@@ -1,4 +1,4 @@
config globals 'globals'
option enable '0'
option enable '1'
option base_interval '5'

View File

@@ -17,16 +17,19 @@ start_service() {
bbfdm_add_service "bbfdm.periodicstats" "${PERIODICSTATS_JSON_INPUT}"
if [ "${enable}" -ne "1" ]; then
return 0;
fi
procd_open_instance periodicstatsd
procd_set_param command ${PROG}
procd_set_param respawn
if [ "${enable}" -eq "1" ]; then
procd_set_param command ${PROG}
procd_set_param respawn
fi
procd_close_instance
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger periodicstats
}

View File

@@ -3,39 +3,34 @@
. /lib/functions.sh
set_serial_number() {
vendor_id=$1
vssn=$2
local vendor_id="$1"
local vssn="$2"
# Vendor id is not taken from serial automatically, propagate it as well
/userfs/bin/omcicfgCmd set vendorId ${vendor_id}
/userfs/bin/omcicfgCmd set sn ${vendor_id}${vssn}
/userfs/bin/omcicfgCmd set vendorId "${vendor_id}"
/userfs/bin/omcicfgCmd set sn "${vendor_id}${vssn}"
}
set_equipment_id() {
local eqid=$1
local eq_id_default="KE2.119.241R2B"
local eqid="$1"
if [ -z "$eqid" ]; then
if [ -z "${eqid}" ]; then
return
fi
if [ "$eqid" = "$eq_id_default" ]; then
return
fi
/userfs/bin/omcicfgCmd set equipmentId ${eqid}
/userfs/bin/omcicfgCmd set equipmentId "${eqid}"
}
set_loid_authentication() {
local loid=$1
local loid_pwd=$2
local loid="$1"
local loid_pwd="$2"
[ -z "$loid" ] && return
[ -z "${loid}" ] && return
/userfs/bin/omcicfgCmd set loid ${loid}
/userfs/bin/omcicfgCmd set loid "${loid}"
if [ -n "$loid_pwd" ]; then
/userfs/bin/omcicfgCmd set loid_password ${loid_pwd}
if [ -n "${loid_pwd}" ]; then
/userfs/bin/omcicfgCmd set loidPasswd "${loid_pwd}"
fi
}

View File

@@ -3,37 +3,39 @@
. /lib/functions.sh
set_serial_number() {
vendor_id=$1
vssn=$2
local vendor_id="$1"
local vssn="$2"
vendor_id="$(echo $vendor_id | hexdump -e '4/1 "%02X" "\n"')"
vendor_id=${vendor_id:0:8}
vendor_id="$(echo "${vendor_id}" | hexdump -e '4/1 "%02X" "\n"')"
vendor_id="${vendor_id:0:8}"
bs /b/c gpon onu_sn={vendor_id=$vendor_id,vendor_specific=$vssn}
}
set_equipment_id() {
equipment_id=$1
local equipment_id="$1"
[ -z "$equipment_id" ] && return
json_add_string "equipment_id" $equipment_id
json_add_string "equipment_id" "$equipment_id"
}
set_loid_authentication() {
loid=$1
loid_password=$2
local loid="$1"
local loid_password="$2"
[ -z "$loid" ] && return
json_add_string "loid" $loid
json_add_string "loid_password" $loid_password
json_add_string "loid" "$loid"
json_add_string "loid_password" "$loid_password"
}
apply_xpon_uci_config() {
local sn
json_init
json_add_object 'ani'
sn="$(uci -q get xpon.ani.serial_number)"
json_add_string "serial_number" $sn
json_add_string "serial_number" "$sn"
configure_loid_authentication
configure_equipment_id
json_close_object

View File

@@ -11,21 +11,21 @@ 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)"
local 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}"
local vendor_id="${serial_number:0:4}"
local vssn="${serial_number:4:8}"
else
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"
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
set_serial_number "${vendor_id}" "${vssn}"
}
start_service() {
if [ "$(uci -q get xpon.ani.enable)" == "1" ]; then
if [ "$(uci -q get xpon.ani.enable)" = "1" ]; then
configure_serial_number
apply_xpon_uci_config
init_xpon

View File

@@ -3,14 +3,15 @@
configure_serial_number() {
# check if serial number is present in the production data
production_sn="$(fw_printenv -n gponsn)"
local production_sn="$(fw_printenv -n gponsn)"
if [ ${#production_sn} -eq 12 ]; then
uci set xpon.ani.serial_number=$production_sn
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
local macaddr="$(fw_printenv -n ethaddr | tr -d ':' | tr 'a-z' 'A-Z')"
local vendor_id="IOPS"
local vssn="${macaddr:4:8}"
uci set xpon.ani.serial_number="${vendor_id}${vssn}"
fi
}
@@ -18,37 +19,38 @@ configure_loid_authentication() {
local production_loid
local production_loidpwd
loid="$(uci -q get xpon.ani.loid)"
loidpwd="$(uci -q get xpon.ani.loid_password)"
if [ -z $loid ]; then
local loid="$(uci -q get xpon.ani.loid)"
local loidpwd="$(uci -q get xpon.ani.loid_password)"
if [ -z "${loid}" ]; then
production_loid="$(fw_printenv -n gponloid)"
fi
if [ -z $loidpwd ]; then
if [ -z "${loidpwd}" ]; then
production_loidpwd="$(fw_printenv -n gponloid_password)"
fi
if [ -n $production_loid ]; then
uci set xpon.ani.loid=$production_loid
if [ -n "${production_loid}" ]; then
uci set xpon.ani.loid="${production_loid}"
fi
if [ -n $production_loidpwd ]; then
uci set xpon.ani.loid_password=$production_loidpwd
if [ -n "${production_loidpwd}" ]; then
uci set xpon.ani.loid_password="${production_loidpwd}"
fi
}
if [ -s "/etc/config/xpon" ]; then
if uci -q get xpon.ani >/dev/null; then
# 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
if uci -q get xpon.ani >/dev/null; then
# 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
configure_loid_authentication
exit
else
rm -f /etc/config/xpon
fi
fi
exit
else
rm -f /etc/config/xpon
fi
fi
touch /etc/config/xpon
uci set xpon.ani=ani

View File

@@ -1,13 +1,15 @@
#!/bin/sh
configure_equipment_id() {
eqid="$(uci -q get xpon.ani.equipment_id)"
set_equipment_id $eqid
}
configure_loid_authentication() {
loid="$(uci -q get xpon.ani.loid)"
loid_pwd="$(uci -q get xpon.ani.loid_password)"
set_loid_authentication $loid $loid_pwd
configure_equipment_id() {
local eqid="$(uci -q get xpon.ani.equipment_id)"
set_equipment_id "${eqid}"
}
configure_loid_authentication() {
local loid="$(uci -q get xpon.ani.loid)"
local loid_pwd="$(uci -q get xpon.ani.loid_password)"
set_loid_authentication "${loid}" "${loid_pwd}"
}

View File

@@ -16,6 +16,10 @@ broute_rule_set_traffic_class() {
fi
}
broute_filter_on_dscp() {
BR_RULE="$BR_RULE --ip-tos $1"
}
broute_ipv4_rule_options()
{
local cid="$1"
@@ -25,7 +29,12 @@ broute_ipv4_rule_options()
set_ip_addr "$cid" ebt_match_src_ip ebt_match_dst_ip
if [ -n "$dscp_filter" ]; then
echo "DSCP filter is not supporter"
local tos_val
local tos_hex
tos_val=$((dscp_filter<<2))
tos_hex=$(printf "%x" $tos_val)
broute_filter_on_dscp "$tos_hex"
fi
if [ -n "$protocol" ]; then

View File

@@ -15,6 +15,10 @@ include /lib/ethernet
. /lib/qos/shaper.sh
. /lib/qos/airoha.sh
get_burst_size_per_queue() {
echo "0"
}
# marking value be decimal for linux target as it uses set-mark whereas other
# targets uses set-xmark, hence this function can't make it common
ip_rule_get_converted_tos() {

View File

@@ -34,6 +34,10 @@ get_port_number() {
done
}
get_burst_size_per_queue() {
echo "0"
}
# Function to handle a queue order and
# update total number of queues
handle_q_order() {

View File

@@ -32,7 +32,7 @@ generate_queue(){
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].burst_size=$(get_burst_size_per_queue)
uci set qos.@queue[-1].weight="1"
done

View File

@@ -15,6 +15,10 @@ Q_COUNT=0
SP_Q_PRIO=7
SOQ_wgt=0
get_burst_size_per_queue() {
echo "1500"
}
get_max_burst_size_per_queue() {
# maximum burst size for tc class
echo "4289999999"
@@ -133,11 +137,10 @@ handle_queue() {
config_get sc_alg "$qid" "scheduling"
config_get wgt "$qid" "weight" 1
config_get rate "$qid" "rate"
config_get bs "$qid" "burst_size" 1500
config_get bs "$qid" "burst_size"
config_get qsize "$qid" "queue_size" 1024
[ "$rate" == "0" ] && rate="$port_bw"
[ "$bs" == "0" ] && bs=1500
bs=$(( bs * 8 ))
rate_bs=$(( rate * 25 ))
@@ -217,12 +220,7 @@ ebt_match_ipv6_dscp() {
}
broute_filter_on_dscp() {
# The broadcom option --ip-dscp-extend actually accepts tos
# and not dscp and that too in hex, hence, perform the conversion
# from dscp in uci to tos first and then convert to hex
tos_val=$(($1<<2))
tos_hex=$(printf "%x" $tos_val)
BR_RULE="$BR_RULE --ip-dscp-extend $tos_hex"
BR_RULE="$BR_RULE --ip-tos $1"
}
broute_ipv4_rule_options()
@@ -234,7 +232,12 @@ broute_ipv4_rule_options()
set_ip_addr $cid ebt_match_src_ip ebt_match_dst_ip
if [ ! -z $dscp_filter ]; then
broute_filter_on_dscp "$dscp_filter"
local tos_val
local tos_hex
tos_val=$((dscp_filter<<2))
tos_hex=$(printf "%x" $tos_val)
broute_filter_on_dscp "$tos_hex"
fi
if [ ! -z $protocol ]; then

View File

@@ -5,14 +5,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=rulengd
PKG_VERSION:=1.2.10
PKG_VERSION:=1.2.11
PKG_RELEASE:=1
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/rulengd.git
PKG_SOURCE_VERSION:=a32e325090d4303fe9aec786f81f0699006d21ab
PKG_SOURCE_VERSION:=8fabf294cc056fd9a85cad06e81bd11df64e23a3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=stunc
PKG_RELEASE:=1
PKG_VERSION:=1.4.0
PKG_VERSION:=1.3.3.1
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/stunc.git
PKG_SOURCE_VERSION:=335f52d51b3b988917f0130303d571ac1fd9636c
PKG_SOURCE_VERSION:=242326500576f644e7c730f556ce4a896c47be8c
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -27,25 +27,77 @@ include ../bbfdm/bbfdm.mk
MAKE_PATH:=src
define Package/stunc
define Package/stunc/default
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=BBF STUN Client
DEPENDS:=+libubus +libuci +libubox +libjson-c +libblobmsg-json +libbbfdm-api +libopenssl
DEPENDS:=+libubus +libuci +libubox +libjson-c +libblobmsg-json +libbbfdm-api
endef
define Package/stunc
$(Package/stunc/default)
TITLE += (default)
DEPENDS += +libopenssl
VARIANT:=default
DEFAULT_VARIANT:=1
endef
define Package/stunc-mbedtls
$(Package/stunc/default)
TITLE += (mbedtls)
DEPENDS += +PACKAGE_stunc-mbedtls:libmbedtls
VARIANT:=mbedtls
CONFLICTS := stunc stunc-openssl stunc-wolfssl
endef
define Package/stunc-openssl
$(Package/stunc/default)
TITLE += (openssl)
DEPENDS += +PACKAGE_stunc-openssl:libopenssl
VARIANT:=openssl
CONFLICTS := stunc stunc-mbedtls stunc-wolfssl
endef
define Package/stunc-wolfssl
$(Package/stunc/default)
TITLE += (wolfssl)
DEPENDS += +PACKAGE_stunc-wolfssl:libwolfssl
VARIANT:=wolfssl
CONFLICTS := stunc stunc-openssl stunc-mbedtls
endef
TARGET_CFLAGS += \
-D_GNU_SOURCE \
-Wall -Werror
ifeq ($(BUILD_VARIANT),default)
MAKE_FLAGS += \
USE_OPENSSL="yes"
endif
ifeq ($(BUILD_VARIANT),wolfssl)
MAKE_FLAGS += \
USE_WOLFSSL="yes"
endif
ifeq ($(BUILD_VARIANT),mbedtls)
MAKE_FLAGS += \
USE_MBEDTLS="yes"
endif
ifeq ($(BUILD_VARIANT),openssl)
MAKE_FLAGS += \
USE_OPENSSL="yes"
endif
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/stunc/* $(PKG_BUILD_DIR)/
endef
endif
define Package/stunc/install
define Package/stunc/default/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
@@ -55,4 +107,12 @@ define Package/stunc/install
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/src/libstunc.so)
endef
Package/stunc/install = $(Package/stunc/default/install)
Package/stunc-openssl/install = $(Package/stunc/default/install)
Package/stunc-wolfssl/install = $(Package/stunc/default/install)
Package/stunc-mbedtls/install = $(Package/stunc/default/install)
$(eval $(call BuildPackage,stunc))
$(eval $(call BuildPackage,stunc-openssl))
$(eval $(call BuildPackage,stunc-wolfssl))
$(eval $(call BuildPackage,stunc-mbedtls))

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=swmodd
PKG_VERSION:=2.5.5
PKG_VERSION:=2.5.3.2
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/lcm/swmodd.git
PKG_SOURCE_VERSION:=723d3597ef0f1b20fd3212b3e1ced3242f2491f1
PKG_SOURCE_VERSION:=d8cc9a7a3749975720c9b748adadb2b6c920acdc
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -3,3 +3,7 @@ config globals 'globals'
option debug '1'
option log_level '3'
option lan_bridge 'br-lan'
option root '/container'
config execenv 'execenv_1'
option name 'oci'

18
swmodd/files/etc/init.d/crun Normal file → Executable file
View File

@@ -56,8 +56,8 @@ configure_lxc_container() {
}
configure_crun_container() {
local name type autostart du_status requested_state url username password
local BRIDGE BUNDLE BOOT
local name type autostart du_status requested_state url username password capability
local BRIDGE BUNDLE BOOT PERM
local RUNNER="/etc/swmodd/run.sh"
BUNDLE="${2}"
@@ -73,6 +73,10 @@ configure_crun_container() {
config_get url "${1}" url ""
config_get username "${1}" username ""
config_get password "${1}" password ""
config_get capability "${1}" capability ""
if [ -n "${capability}" ]; then
PERM="-p ${capability// /,}"
fi
if [ -z "${name}" ] || [ -z "${type}" ] || [ -z "${du_status}" ]; then
return 0;
@@ -148,7 +152,7 @@ configure_crun_container() {
if [ "${BOOT}" -eq "1" ]; then
if [ "${autostart}" -eq 1 ]; then
${RUNNER} -U -b "${BUNDLE}" -n "${name}"
${RUNNER} -U -b "${BUNDLE}" -n "${name}" ${PERM}
result=$(cat ${BUNDLE}/${name}/config.json |jq ".annotations.org_opencontainers_image_description")
if [ "${result}" != "null" ]; then
uci_set ocicontainer "${1}" description "${result}"
@@ -178,10 +182,10 @@ configure_crun_container() {
fi
elif [ "${requested_state}" = "Active" ]; then
if is_container_running "${name}"; then
${RUNNER} -u -n "${name}" -i "${BRIDGE}"
${RUNNER} -u -n "${name}" -i "${BRIDGE}" ${PERM}
crun resume "${name}"
else
${RUNNER} -U -b "${BUNDLE}" -n "${name}"
${RUNNER} -U -b "${BUNDLE}" -n "${name}" ${PERM}
result=$(cat ${BUNDLE}/${name}/config.json |jq ".annotations.org_opencontainers_image_description")
if [ "${result}" != "null" ]; then
uci_set ocicontainer "${1}" description "${result}"
@@ -207,7 +211,7 @@ configure_crun_container() {
procd_set_param stderr 1
procd_set_param command "${RUNNER}"
procd_append_param command -b "${BUNDLE}" -n "${name}" -i "${BRIDGE}"
procd_set_param respawn
#procd_set_param respawn
procd_close_instance "${name}"
}
@@ -237,7 +241,7 @@ start_service() {
env=$(uci -q get swmodd.@execenv[0].name)
if [ -z "${root}" ] || [ -z "${bridge}" ]; then
log "Base bundle root[$root] or bridge[$bridge] not defined"
log "# Base bundle root[$root] or bridge[$bridge] not defined"
return 0;
fi

View File

@@ -43,7 +43,7 @@ start_lxc_container() {
return 0;
fi
state=$(lxc-ls -f | tail -n +2 | grep -w "${name}" | cut -d " " -f 2)
state=$(lxc-info -n "$name" -s -H)
if [ -z "${state}" ]; then
return 0;
fi
@@ -91,13 +91,8 @@ start_service() {
[ ! -d "/run" ] && ln -fs /var/run /run
if [ ! -d "${root}" ]; then
log "# root [${root}] not present, creating ..."
if [ -n "${root}" ]; then
mkdir -p "${root}"
else
log "# Not starting, root [${root}] not defined"
return 1
fi
log "# Not starting, Base root [${root}] not accessible/defined"
return 1
fi
# Currently only one execenv supported

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