Compare commits

..

172 Commits

Author SHA1 Message Date
Jakob Olsson
b3f83bf364 map-agent: introduce config option that passes PERSIST_CONTROLLER CLFLAG 2024-06-03 17:05:37 +02:00
Jakob Olsson
170c394d05 map-agent: 4.5.0.21 2024-06-03 16:58:22 +02:00
Jakob Olsson
b1805bc8c9 map-controller: 4.5.0.7 2024-06-03 16:57:41 +02:00
Jakob Olsson
7848a0cecc map-agent: map_genconfig: don't modify mapcontroller enabled unconditionally 2024-06-03 16:57:04 +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
93 changed files with 1175 additions and 1007 deletions

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bbfdm
PKG_VERSION:=1.5.4
PKG_VERSION:=1.4.23.19
USE_LOCAL:=0
ifneq ($(USE_LOCAL),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
PKG_SOURCE_VERSION:=cd2066de6781ace66d3165937a138a0f12353d8c
PKG_SOURCE_VERSION:=bfd50fe626d97f325bda6ea66fd57b0e9dd97ba9
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -31,13 +31,45 @@ define Package/libbbfdm-api
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 +libcurl +libbbfdm-api \
+BBF_TR471:obudpst +libopenssl
+BBF_TR471:obudpst
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
@@ -45,7 +77,9 @@ 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
@@ -102,6 +136,22 @@ CMAKE_OPTIONS += \
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
@@ -110,9 +160,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
@@ -133,7 +185,7 @@ ifeq ($(CONFIG_BBF_TR143),y)
endif
endef
define Package/libbbfdm/prerm
define Package/libbbfdm/default/prerm
#!/bin/sh
rm -rf /etc/bbfdm/dmmap/*
exit 0
@@ -145,12 +197,14 @@ 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_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
@@ -166,6 +220,16 @@ define Package/userinterface/install
$(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
@@ -183,6 +247,9 @@ 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,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

@@ -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

64
csmngr/Makefile Normal file
View File

@@ -0,0 +1,64 @@
#
# Copyright (C) 2020-2024 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=csmngr
PKG_VERSION:=1.0.1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
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
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_CONFIG_DEPENDS := \
CONFIG_PACKAGE_libwifiutils \
CONFIG_PACKAGE_libwifi
PKG_BUILD_DEPENDS := libwifi
include $(INCLUDE_DIR)/package.mk
MAKE_PATH:=src
define Package/csmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=WiFi channel selection manager
DEPENDS:=+libwifiutils +libwifi +libuci +libubox +ubus +libnl-genl
endef
define Package/csmngr/description
WiFi Auto Channel Selection manager.
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl3 \
-D_GNU_SOURCE
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -r --exclude=.* ~/git/csmngr/ $(PKG_BUILD_DIR)/
endef
endif
define Package/csmngr/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/csmngr $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,csmngr))

21
csmngr/files/etc/init.d/csmngr Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/sh /etc/rc.common
START=95
STOP=10
USE_PROCD=1
PROG=/usr/sbin/csmngr
start_service() {
procd_open_instance
procd_set_param command ${PROG}
# procd_set_param stderr 1 #for debugging only
# procd_set_param respawn
procd_close_instance
}
reload_service() {
stop
start
}

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=decollector
PKG_VERSION:=4.2.1.1
PKG_VERSION:=4.2.1.1.2
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=ae836adb0779979686d0dad34b941f319ffed1b8
PKG_SOURCE_VERSION:=caa2c1dc89c5f75455a0346f44ae80097b8e2e29
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip

View File

@@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dectmngr
PKG_RELEASE:=3
PKG_VERSION:=3.6.4
PKG_VERSION:=3.6.5
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=d9cc11c81ce1ff625e4e789afa180b301c7fcf74
PKG_SOURCE_VERSION:=192e74db2082e3f89f6defe9d752d752b0b09079
PKG_MIRROR_HASH:=skip
endif

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ethmngr
PKG_VERSION:=2.1.2
PKG_VERSION:=2.1.3
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=e5cccdd45a93d969d51c4085cb52b543df544811
PKG_SOURCE_VERSION:=5b40a8167d3e0e5c8fc9229abccd5c6acecbe814
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

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=hostmngr
PKG_VERSION:=1.1.4
PKG_VERSION:=1.1.7
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=edb5bbe57c5bc83035e217c73071c9b3e878dc22
PKG_SOURCE_VERSION:=79a6649995752da3501808debeed9e3ddfdf4d59
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
@@ -57,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

@@ -218,11 +218,15 @@ process_ac_schedule() {
iptables -w -F hosts_forward
ip6tables -w -F hosts_forward
hosts_forward=$(iptables -t filter --list | grep hosts_forward)
if [ -z "$hosts_forward" ]; then
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 ] && 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 ] && ip6tables -w -t filter -I FORWARD -j hosts_forward

View File

@@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=9.6.1
PKG_VERSION:=9.5.29.12
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
PKG_SOURCE_VERSION:=601708dd0a2ca4fad5213e78cc456e0f355f45bc
PKG_SOURCE_VERSION:=9c85416648a1da63c1085a5c2dc635ed13776ef2
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

@@ -21,7 +21,7 @@ config cpe 'cpe'
option log_to_file 'disable'
# log_severity: INFO (Default)
# log_severity possible configs: EMERG, ALERT, CRITIC ,ERROR, WARNING, NOTICE, INFO, DEBUG
option log_severity 'DEBUG'
option log_severity 'ERROR'
option log_file_name '/var/log/icwmpd.log'
option log_max_size '102400'
option userid '' #$OUI-$SER

View File

@@ -436,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 || {
@@ -451,11 +450,6 @@ 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}" ]; then
@@ -471,11 +465,6 @@ validate_defaults() {
return 1;
}
if [ "$enable" = "0" ]; then
log "CWMP service disabled"
return 1
fi
return 0;
}
@@ -523,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}" \
@@ -550,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

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ieee1905
PKG_VERSION:=8.3.4
PKG_VERSION:=8.3.4.10
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=526690993c93720ee1707bba6b7a08e8c28f2dd9
PKG_SOURCE_VERSION:=4231e9496e63fb6d0ab74870c06f9345b001c5bf
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

View File

@@ -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 #
@@ -142,7 +143,6 @@ CONFIG_PACKAGE_wwan=y
CONFIG_PACKAGE_xl2tpd=y
# Services #
CONFIG_PACKAGE_atftp=y
CONFIG_PACKAGE_atftpd=y
CONFIG_PACKAGE_ddns-scripts=y
CONFIG_PACKAGE_dnsmasq=y

View File

@@ -399,8 +399,6 @@ function genconfig {
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 {
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

View File

@@ -373,8 +373,6 @@ function genconfig_min {
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 {
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

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libeasy
PKG_VERSION:=7.4.2
PKG_VERSION:=7.4.3
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=11eb263666556c419220e2a50c3a67422e79f884
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

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libethernet
PKG_VERSION:=7.2.107
PKG_VERSION:=7.2.109
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=9c0e9ecd62b79d4e89b4f013f04124870d237395
PKG_SOURCE_VERSION:=cc72f5ab0171cd0fc29bb48dafff6751ab2f0d9c
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.10
PKG_VERSION:=1.0.12
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:=e6ba6fca814f6c83a3d6ff4a5b7560fbc36d3101
PKG_SOURCE_VERSION:=a9ea70b6c0adb246685f7632e38853e0d803a7c3
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

@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libvoice-broadcom
PKG_RELEASE:=1
PKG_VERSION:=1.0.8
PKG_VERSION:=1.0.9
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:=e1de60c2c05935fb2f4adfc1f73feba0bb32ade6
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

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libwifi
PKG_VERSION:=7.4.18
PKG_VERSION:=7.4.16.13
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=4f6d22e0afa199bcff63f084a022c6142883973f
PKG_SOURCE_VERSION:=38b946b847a6d8e12dbc12a2b1a8f16b9c59ae33
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
@@ -143,7 +143,7 @@ define Package/libwifi/config
config LIBWIFI_USE_CTRL_IFACE
bool "Create UNIX sockets to interface with hostapd/wpa_supplicant"
default y
default n
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.0
PKG_VERSION:=4.5.0.21
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=6d74ca3c6a4a2893160a5de2f7f455a8d8596fec
PKG_SOURCE_VERSION:=04c7eee40442677eba79efce50669a0464ea8b14
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
PKG_LICENSE:=BSD-3-Clause
@@ -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 '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 ##############
@@ -69,7 +71,7 @@ fi
remove_from_bridge() {
config_get ifname "$section" ifname
[ -n "$ifname" ] && ubus call network.interface.${al_brnet} remove_device '{"name":"$ifname"}'
[ -n "$ifname" ] && brctl delif ${al_bridge} ${ifname}
}
update_bstas() {

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

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-controller
PKG_VERSION:=4.5.0.4
PKG_VERSION:=4.5.0.7
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=59a3bb0e2cbd0f37f60bd121e4b30289a64d310e
PKG_SOURCE_VERSION:=f232f934bcfea0c5900598988e039a4e110ecaf6
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
LOCAL_DEV=0

View File

@@ -49,7 +49,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

@@ -15,7 +15,7 @@ snooping_bridges=
__device_is_bridge() {
local device="$2"
local devsec__="$(uci show network | grep name=.*$device | grep -v ifname | cut -d'.' -f2)"
local devsec__="$(uci show network | grep -F ".name='$device'" | cut -d'.' -f2)"
local sectype="$(uci -q get network.$devsec__)"
local devtype="$(uci -q get network.$devsec__.type)"
[ "$sectype" != "device" -o "$devtype" != "bridge" ] && return 1
@@ -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=
@@ -120,6 +117,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
@@ -302,7 +300,12 @@ config_mcproxy_instance() {
# for snooping to work we should enable it on the bridge, doing it from
# here instead of from inside network config
if [ "$downstreams" != "$snooping_bridges" ]; then
config_sysfs_mcast_snooping "$downstreams" 1
if [ "$mcast_mode" == "0" ]; then
config_sysfs_mcast_snooping "$downstreams" 0
else
config_sysfs_mcast_snooping "$downstreams" 1
fi
[ -n $fast_leave ] &&
config_sysfs_mcast_fastleave "$downstreams" "$fast_leave"
config_sysfs_mcast_flood "$downstreams" "$mcast_mode"

View File

@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=netmode
PKG_VERSION:=0.3.0
PKG_VERSION:=1.0.1
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0-only

View File

@@ -1,10 +1,3 @@
config netmode global
option enabled 0
# option mode 'router'
#config testnet testnet
# option enabled 1
# option destination '8.8.8.8'
#config shiftrange shiftrange
# option enabled 1

View File

@@ -1,252 +0,0 @@
#!/bin/sh
# this scripts shifts the lan network prefixes
# if a wan interface has the same network prefix.
# do not shift range if the feature is explicitly disabled
[ "$(uci -q get netmode.shiftrange.enabled)" == "0" ] && exit 0
. /lib/functions.sh
. /lib/functions/network.sh
LOCKFILE="/tmp/70-shiftrange.lock"
RESTRICTED_NETS=""
ALL_NETS=""
#####
##### initial functions
#####
initial_check()
{
# run only on ifup
[ "$ACTION" == "ifup" ] || exit 0
# run only for uplink (not is_lan) interfaces
local islan="$(uci -q get network.$INTERFACE.is_lan)"
[ "$islan" != "1" ] || exit 0
# run only if the uplink interface has a configured protocol
local proto="$(uci -q get network.$INTERFACE.proto)"
[ "$proto" != "none" ] || exit 0
}
finish()
{
lock -u $LOCKFILE
rm -f $LOCKFILE
}
# just one instance of this script at a time
just_one_instance()
{
local counter=0
local limit=10
#wait for the lock to become free
while [ -e $LOCKFILE ] ; do
sleep 1
counter=$((counter + 1))
[ "$counter" -gt "$limit" ] && exit 1
done
lock $LOCKFILE
trap finish EXIT INT TERM
}
#####
##### helper functions
#####
#given a an ip and a mask in the form of "192.168.1.1/24"
#return the network address like "192.168.1.0/24"
get_network_address()
{
local ip="$1"
[ -z "$ip" ] && return
local prefix=${ip##*/}
local ip1=${ip%%.*} ; ip=${ip#*.*}
local ip2=${ip%%.*} ; ip=${ip#*.*}
local ip3=${ip%%.*} ; ip=${ip#*.*}
local ip4=${ip%%/*}
local ip=$((($ip1 << 24) + ($ip2 << 16) + ($ip3 << 8) + $ip4))
local mask=$((0xFFFFFFFF >> (32 - $prefix) << (32 - $prefix)))
local network=$(($ip & $mask))
local n1=$((($network & 0xFF000000) >> 24))
local n2=$((($network & 0x00FF0000) >> 16))
local n3=$((($network & 0x0000FF00) >> 8))
local n4=$(( $network & 0x000000FF))
echo "$n1.$n2.$n3.$n4/$prefix"
}
#given a network address (192.168.1.0/24)
#find the next network address (192.168.2.0/24)
next_network_address()
{
local ip=$1
local prefix=${ip##*/}
local ip1=${ip%%.*} ; ip=${ip#*.*}
local ip2=${ip%%.*} ; ip=${ip#*.*}
local ip3=${ip%%.*} ; ip=${ip#*.*}
local ip4=${ip%%/*}
local ip=$((($ip1 << 24) + ($ip2 << 16) + ($ip3 << 8) + $ip4))
local one="$((1 << (32-$prefix)))"
local new=$(($ip + $one))
local n1=$((($new & 0xFF000000) >> 24))
local n2=$((($new & 0x00FF0000) >> 16))
local n3=$((($new & 0x0000FF00) >> 8))
local n4=$(( $new & 0x000000FF))
echo "$n1.$n2.$n3.$n4/$prefix"
}
# given a network address and a prefix (192.168.2.0/24)
# return the first host ip available (192.168.2.1)
first_host_in_network ()
{
local ip=$1
local prefix=${ip##*/}
local ip1=${ip%%.*} ; ip=${ip#*.*}
local ip2=${ip%%.*} ; ip=${ip#*.*}
local ip3=${ip%%.*} ; ip=${ip#*.*}
local ip4=${ip%%/*}
local ip=$((($ip1 << 24) + ($ip2 << 16) + ($ip3 << 8) + $ip4))
local new=$(($ip + 1))
local n1=$((($new & 0xFF000000) >> 24))
local n2=$((($new & 0x00FF0000) >> 16))
local n3=$((($new & 0x0000FF00) >> 8))
local n4=$(( $new & 0x000000FF))
echo "$n1.$n2.$n3.$n4"
}
# given a network address,
# find the next available network address.
shift_range()
{
local net="$1"
while true ; do
if [ "$RESTRICTED_NETS" == "${RESTRICTED_NETS//$net/}" ] && [ "$ALL_NETS" == "${ALL_NETS//$net/}" ]; then
# found a net that is not in restricted nets nor in all nets
break
fi
net=$(next_network_address $net)
done
echo "$net"
}
#####
##### parse all interfaces section
#####
# RESTRICTED_NETS = all the IPs on wan interfaces
# ALL_NETS = all the IPs on any interface
parse_interface()
{
local interface=$1
local nets="" # "192.168.1.1/24"
local networks="" # "192.168.1.0/24"
config_get is_lan $interface is_lan
network_get_subnets nets $interface
for n in $nets ; do
networks="$networks $(get_network_address $n)"
done
[ "$is_lan" != "1" ] && RESTRICTED_NETS="$RESTRICTED_NETS $networks"
ALL_NETS="$ALL_NETS $networks"
}
# parse all the interfaces
# get all the IPs on wan interfaces and store them in restrict_nets
# get all the IPs on all interfaces and store them in ALL_NETS
parse_interfaces()
{
config_foreach parse_interface "interface"
}
#####
##### parse all lan interfaces section
#####
parse_lan()
{
local interface=$1
local nets=""
local ips=""
local newips=""
local ips_changed=0
[ "$interface" == "loopback" ] && return
config_get is_lan $interface is_lan
[ "$is_lan" == "1" ] || return
network_get_subnets ips $interface
for ip in $ips ; do
net="$(get_network_address $ip)"
if [ "$RESTRICTED_NETS" == "${RESTRICTED_NETS//$net/}" ] ; then
# net is not in restricted nets
# append ip to newips
[ -z "$newips" ] && newips="${ip%/*}" || newips="$newips ${ip%/*}"
continue
fi
#net is in RESTRICTED_NETS
local newnet=$(shift_range $net)
local newip="$(first_host_in_network $newnet)"
# append newip to newips
[ -z "$newips" ] && newips="$newip" || newips="$newips $newip"
ips_changed=1
logger "$0: Changing the ip on interface $interface from $ip to $newip/${newnet##*/}"
echo "$0: Changing the ip on interface $interface from $ip to $newip/${newnet##*/}" >/dev/console
done
#assign the new ips
if [ "$ips_changed" == "1" ] ; then
uci -q set network.$interface.ipaddr="$newips"
fi
}
# parse all the interface with is_lan=1
parse_lans()
{
config_foreach parse_lan "interface"
}
#####
##### main
#####
main()
{
initial_check
just_one_instance
config_load network
parse_interfaces
parse_lans
if [ -n "$(uci changes network)" ] ; then
ubus call uci commit '{"config":"network"}'
fi
}
main $@

View File

@@ -0,0 +1,114 @@
#!/bin/sh
. /lib/functions.sh
. /usr/share/libubox/jshn.sh
source "/etc/device_info"
l2_mcast_config() {
# configure L2 mcast config for snooping
logger -s -p user.info -t "netmode" "Generating L2 mcast configuration"
# remove proxy sections
uci -q delete mcast.igmp_proxy_1
uci -q delete mcast.mc_proxy_MLD
# add igmp_snooping section
uci -q set mcast.igmp_snooping_1=snooping
uci -q set mcast.igmp_snooping_1.enable='1'
uci -q set mcast.igmp_snooping_1.proto='igmp'
uci -q set mcast.igmp_snooping_1.version='2'
uci -q set mcast.igmp_snooping_1.robustness='2'
uci -q set mcast.igmp_snooping_1.query_interval='125'
uci -q set mcast.igmp_snooping_1.query_response_interval='100'
uci -q set mcast.igmp_snooping_1.last_member_query_interval='10'
uci -q set mcast.igmp_snooping_1.fast_leave='1'
uci -q set mcast.igmp_snooping_1.snooping_mode='2'
uci -q set mcast.igmp_snooping_1.interface='br-lan'
uci -q add_list mcast.igmp_snooping_1.filter='239.0.0.0/8'
# add mld_snooping section
uci -q set mcast.mld_snooping_1=snooping
uci -q set mcast.mld_snooping_1.enable='1'
uci -q set mcast.mld_snooping_1.proto='mld'
uci -q set mcast.mld_snooping_1.version='2'
uci -q set mcast.mld_snooping_1.robustness='2'
uci -q set mcast.mld_snooping_1.query_interval='125'
uci -q set mcast.mld_snooping_1.query_response_interval='100'
uci -q set mcast.mld_snooping_1.last_member_query_interval='10'
uci -q set mcast.mld_snooping_1.fast_leave='1'
uci -q set mcast.mld_snooping_1.snooping_mode='2'
uci -q set mcast.mld_snooping_1.interface='br-lan'
uci -q commit mcast
}
l2_network_config() {
logger -s -p user.info -t "netmode" "Generating L2 network configuration"
# Configure L2 Network Mode
uci -q delete network.lan
uci -q delete network.wan
uci -q delete network.wan6
uci -q set network.lan=interface
uci -q set network.lan.proto='dhcp'
uci -q set network.lan.device='br-lan'
uci -q set network.lan.force_link='1'
uci -q set network.lan6=interface
uci -q set network.lan6.proto='dhcpv6'
uci -q set network.lan6.device='@lan'
uci -q set network.lan6.reqprefix='no'
uci -q delete network.br_lan.ports
uci -q set network.br_lan.bridge_empty='1'
add_port_to_br_lan() {
port="$1"
[ -n "$port" -a -d /sys/class/net/$port ] || continue
uci add_list network.br_lan.ports="$port"
}
if [ -f /etc/board.json ]; then
json_load_file /etc/board.json
json_select network
json_select lan
if json_is_a ports array; then
json_for_each_item add_port_to_br_lan ports
else
json_get_var device device
[ -n "$device" ] && uci add_list network.br_lan.ports="$device"
fi
json_select ..
json_select wan 2>/dev/null
json_get_var device device
[ -n "$device" ] && uci add_list network.br_lan.ports="$device"
json_cleanup
fi
uci -q commit network
# Disable DHCP Server
uci -q set dhcp.lan.ignore=1
uci -q commit dhcp
/etc/init.d/odhcpd disable
# Disable SSDPD
uci -q set ssdpd.ssdp.enabled="0"
uci -q commit ssdpd
# 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)"
case "$network_mode" in
layer2|extender)
l2_network_config
l2_mcast_config
;;
esac

View File

@@ -22,4 +22,12 @@ config OBUSPA_CONTROLLER_MTP_VERIFY
config OBUSPA_ENABLE_TEST_CONTROLLER
bool "Adds a test controller by default"
default n
config OBUSPA_MAX_CONTROLLERS_NUM
int "The maximum number of controllers to be supported"
range 1 10
default 5
help
This value must be in range of 1 to 10. (default 5)
endif

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=obuspa
PKG_VERSION:=7.0.5.8
PKG_VERSION:=7.0.5.6.3
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
PKG_SOURCE_VERSION:=d11c8505ffddb4c840d630632b0bb7dda04ca5b2
PKG_SOURCE_VERSION:=0bb1ddd46e4a2abf93dadfc34e6bc44bf6a3f063
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,7 @@ define Package/obuspa
SUBMENU:=TRx69
TITLE:=USP agent
MENU:=1
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl +ca-certificates
endef
define Package/obuspa/description
@@ -81,10 +81,14 @@ else
CMAKE_OPTIONS += -DENABLE_WEBSOCKETS=OFF
endif
ifdef $(CONFIG_OBUSPA_MAX_CONTROLLERS_NUM)
TARGET_CFLAGS += -DOBUSPA_MAX_CONTROLLERS_NUM=$(CONFIG_OBUSPA_MAX_CONTROLLERS_NUM)
endif
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/obuspa/* $(PKG_BUILD_DIR)/
$(Build/Patch)
$(CP) -rf ~/git/obuspa/* $(PKG_BUILD_DIR)/
$(Build/Patch)
endef
endif

View File

@@ -7,7 +7,7 @@ config obuspa 'global'
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/obuspa/rootCA.pem'
#option trust_cert '/etc/ssl/cert.pem'
#option client_cert '/etc/obuspa/client.pem'
#option log_dest '/tmp/obuspa.log'

View File

@@ -92,10 +92,10 @@ get_base_path()
count=0
if [ -f "${DB_DUMP}" ]; then
path=$(grep "${refpath}\d.Alias \"${value}\"" ${DB_DUMP})
path=$(grep -E "${refpath}\d+.Alias \"${value}\"" ${DB_DUMP})
path=${path%.*}
if [ -z "${path}" ]; then
path=$(grep -o "${refpath}\d" ${DB_DUMP} |sort -r|head -n 1)
path=$(grep -oE "${refpath}\d+" ${DB_DUMP} |sort -r|head -n 1)
if [ -n "${path}" ]; then
count=${path##*.}
count=$(( count + 1 ))
@@ -122,9 +122,9 @@ get_refrence_path()
path=""
if [ -f "${DB_DUMP}" ]; then
path=$(grep "${dmref}\d.Alias " ${DB_DUMP}|grep -w "${value}")
path=$(grep -E "${dmref}\d+.Alias " ${DB_DUMP}|grep -w "${value}")
elif [ -f "${RESET_FILE}" ]; then
path=$(grep "${dmref}\d.Alias " ${RESET_FILE}|grep -w "${value}")
path=$(grep -E "${dmref}\d+.Alias " ${RESET_FILE}|grep -w "${value}")
fi
path=${path%.*}
echo "${path}"
@@ -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}"
@@ -728,13 +716,13 @@ get_instances_from_db_dump()
{
local obj inst
obj="${1}\d"
obj="${1}\d+"
if [ ! -f "${DB_DUMP}" ]; then
echo ""
return 0;
fi
inst="$(grep -oe "${obj}" "${DB_DUMP}"|uniq)"
inst="$(grep -oE "${obj}" "${DB_DUMP}"|uniq)"
echo "$inst"
}
@@ -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
}
@@ -942,7 +926,7 @@ check_n_delete_db()
r="${3}"
sec="${sec/${t}_/cpe-}"
path=$(grep "${r}\d.Alias \"${sec}\"" ${DB_DUMP})
path=$(grep -E "${r}\d+.Alias \"${sec}\"" ${DB_DUMP})
path=${path%.*}
delete_sql_db_entry_with_pattern "${path}"
@@ -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

@@ -82,6 +82,17 @@
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object": "Device.SelfTestDiagnostics()",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_OPER",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object": "Device.FactoryReset()",
"perm": [
@@ -570,8 +581,7 @@
{
"object": "Device.",
"perm": [
"PERMIT_NONE",
"PERMIT_SUBS_EVT_OPER_COMP"
"PERMIT_NONE"
]
},
{
@@ -584,66 +594,6 @@
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.Time.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.UPnP.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.Bridging.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.Ethernet.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.DHCPv4.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.DHCPv6.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.Hosts.",
"perm": [
@@ -655,34 +605,18 @@
]
},
{
"object":"Device.NAT.",
"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_EVT_OPER_COMP"
]
},
{
"object":"Device.PPP.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.Routing.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SUBS_EVT_OPER_COMP"
"PERMIT_SUBS_OBJ_ADD",
"PERMIT_SUBS_OBJ_DEL"
]
},
{
@@ -696,13 +630,12 @@
]
},
{
"object":"Device.InterfaceStack.",
"object": "Device.IP.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SUBS_EVT_OPER_COMP"
"PERMIT_CMD_INFO"
]
},
{
@@ -715,56 +648,6 @@
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.LANConfigSecurity.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.Security.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.RouterAdvertisement.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.Services.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.UserInterface.",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object":"Device.PeriodicStatistics.",
"perm": [
@@ -801,30 +684,16 @@
]
},
{
"object": "Device.DNS.",
"object": "Device.WiFi.AccessPoint.{i}.WPS.InitiateWPSPBC()",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_OPER",
"PERMIT_SUBS_VAL_CHANGE",
"PERMIT_SUBS_OBJ_ADD",
"PERMIT_SUBS_OBJ_DEL",
"PERMIT_SUBS_EVT_OPER_COMP"
]
},
{
"object": "Device.IP.",
"object": "Device.WiFi.DataElements.Network.SetSSID()",
"perm": [
"PERMIT_GET",
"PERMIT_GET_INST",
"PERMIT_OBJ_INFO",
"PERMIT_CMD_INFO",
"PERMIT_OPER",
"PERMIT_SUBS_VAL_CHANGE",
"PERMIT_SUBS_OBJ_ADD",
"PERMIT_SUBS_OBJ_DEL",
"PERMIT_SUBS_EVT_OPER_COMP"
]
}

View File

@@ -1,29 +1,69 @@
--- a/src/core/cli_server.c
+++ b/src/core/cli_server.c
@@ -787,6 +787,7 @@ int ExecuteCli_Set(char *arg1, char *arg
@@ -780,6 +780,7 @@ int ExecuteCli_Set(char *arg1, char *arg
goto exit;
}
+ SetControllerRoleForInternal();
// Iterate over all objects to set
for (i=0; i < objects.num_entries; i++)
{
// Exit if unable to start a transaction
err = DM_TRANS_Start(&trans);
if (err != USP_ERR_OK)
@@ -865,6 +866,7 @@ int ExecuteCli_Add(char *arg1, char *arg
goto exit;
}
+ SetControllerRoleForInternal();
// Exit if unable to start a transaction
err = DM_TRANS_Start(&trans);
if (err != USP_ERR_OK)
@@ -976,6 +978,7 @@ int ExecuteCli_Del(char *arg1, char *arg
goto exit;
}
+ SetControllerRoleForInternal();
// Exit if unable to start a transaction
err = DM_TRANS_Start(&trans);
if (err != USP_ERR_OK)
--- a/src/core/data_model.h
+++ b/src/core/data_model.h
@@ -325,6 +325,7 @@ void DATA_MODEL_DumpSchema(void);
@@ -325,6 +325,8 @@ void DATA_MODEL_DumpSchema(void);
void DATA_MODEL_DumpInstances(void);
char DATA_MODEL_GetJSONParameterType(char *path);
int DATA_MODEL_SetParameterInDatabase(char *path, char *value);
+void SetControllerRoleForInternal();
+void SetControllerDummyID();
int DM_PRIV_InitSetRequest(dm_req_t *req, dm_node_t *node, char *path, dm_instances_t *inst, char *new_value);
void DM_PRIV_RequestInit(dm_req_t *req, dm_node_t *node, char *path, dm_instances_t *inst);
--- a/src/core/dm_exec.c
+++ b/src/core/dm_exec.c
@@ -1207,6 +1207,7 @@ void ProcessMessageQueueSocketActivity(s
return;
}
+ SetControllerDummyID(); // To make sure session handler does not break with internal services
switch(msg.type)
{
case kDmExecMsg_ProcessUspRecord:
--- a/src/core/msg_handler.c
+++ b/src/core/msg_handler.c
@@ -902,6 +902,20 @@ char *MtpSendItemToString(mtp_send_item_
@@ -902,6 +902,34 @@ char *MtpSendItemToString(mtp_send_item_
/*********************************************************************//**
**
+** SetControllerDummyID
+**
+** Sets the role for internal user
+**
+**
+**************************************************************************/
+void SetControllerDummyID()
+{
+ cur_msg_controller_info.endpoint_id = "CLI_Utility";
+}
+
+/*********************************************************************//**
+**
+** SetControllerRoleForInternal
+**
+** Sets the role for internal user
@@ -34,6 +74,7 @@
+{
+ cur_msg_combined_role.inherited = kCTrustRole_Untrusted;
+ cur_msg_combined_role.assigned = kCTrustRole_FullAccess;
+ SetControllerDummyID();
+}
+
+/*********************************************************************//**

View File

@@ -0,0 +1,42 @@
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
index 04a1a9c..8cb2ad7 100644
--- a/src/core/mqtt.c
+++ b/src/core/mqtt.c
@@ -234,6 +234,8 @@ void HandleMqttDisconnect(mqtt_client_t *client);
#define DEFINE_MQTT_TrustCertVerifyCallbackIndex(index) \
int MQTT_TrustCertVerifyCallback_##index (int preverify_ok, X509_STORE_CTX *x509_ctx) \
{\
+ if (index >= MAX_MQTT_CLIENTS) \
+ return 0; \
return DEVICE_SECURITY_TrustCertVerifyCallbackWithCertChain(preverify_ok, x509_ctx, &mqtt_clients[index].cert_chain);\
}
@@ -244,6 +246,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex(1);
DEFINE_MQTT_TrustCertVerifyCallbackIndex(2);
DEFINE_MQTT_TrustCertVerifyCallbackIndex(3);
DEFINE_MQTT_TrustCertVerifyCallbackIndex(4);
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(5);
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(6);
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(7);
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(8);
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(9);
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
//------------------------------------------------------------------------------------
@@ -254,10 +261,15 @@ ssl_verify_callback_t* mqtt_verify_callbacks[] = {
MQTT_TrustCertVerifyCallbackIndex(2),
MQTT_TrustCertVerifyCallbackIndex(3),
MQTT_TrustCertVerifyCallbackIndex(4),
+ MQTT_TrustCertVerifyCallbackIndex(5),
+ MQTT_TrustCertVerifyCallbackIndex(6),
+ MQTT_TrustCertVerifyCallbackIndex(7),
+ MQTT_TrustCertVerifyCallbackIndex(8),
+ MQTT_TrustCertVerifyCallbackIndex(9),
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
};
-USP_COMPILEASSERT( ((sizeof(mqtt_verify_callbacks)/sizeof(ssl_verify_callback_t*)) == MAX_MQTT_CLIENTS),
+USP_COMPILEASSERT( ((sizeof(mqtt_verify_callbacks)/sizeof(ssl_verify_callback_t*)) >= MAX_MQTT_CLIENTS),
"There must be MAX_MQTT_CLIENTS callbacks defined");
/*********************************************************************//**

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);

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

@@ -1,56 +0,0 @@
#
# Copyright (C) 2021-2023 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=porttrigger
PKG_VERSION:=1.0.0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
LOCAL_DEV:=1
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/port-trigger.git
PKG_SOURCE_VERSION:=
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
include $(INCLUDE_DIR)/package.mk
include ../bbfdm/bbfdm.mk
define Package/porttrigger
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Port Trigger Daemon
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api
endef
define Package/porttrigger/description
Manage port trigger
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ./port-trigger/* $(PKG_BUILD_DIR)/
endef
endif
define Package/porttrigger/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/lib/porttrigger
$(INSTALL_BIN) ./files/etc/init.d/porttrigger $(1)/etc/init.d/
$(INSTALL_DATA) ./files/etc/config/porttrigger $(1)/etc/config/
$(INSTALL_DATA) ./files/lib/port_trigger.sh $(1)/lib/porttrigger/
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/bbf_plugin/libporttrigger.so)
endef
$(eval $(call BuildPackage,porttrigger))

View File

@@ -1 +0,0 @@
#port trigger uci file

View File

@@ -1,20 +0,0 @@
#!/bin/sh /etc/rc.common
START=65
STOP=20
USE_PROCD=1
. /lib/porttrigger/port_trigger.sh
start_service() {
port_trigger_handling
}
service_triggers()
{
procd_add_reload_trigger "firewall"
}
reload_service() {
start
}

View File

@@ -1,99 +0,0 @@
#!/bin/sh
. /lib/functions.sh
process_port_trigger() {
local rule_id="$1"
local is_enabled=""
local duration=""
local trigger_dport=""
local trigger_dport_end=""
local protocol=""
local interface=""
local open_dport=""
local open_dport_end=""
local open_protocol=""
local ptg_id=""
config_get ptg_id "$rule_id" "dm_parent"
is_enabled=$(uci -q get porttrigger."$ptg_id".enable)
if [ -z "$is_enabled" ] || [ "$is_enabled" = "0" ]; then
return
fi
IP_RULE=""
protocol=$(uci -q get porttrigger."$ptg_id".protocol)
[ -z "$protocol" ] && return
if [ "$protocol" = "UDP" ] || [ "$protocol" = "udp" ]; then
IP_RULE="$IP_RULE -p udp"
elif [ "$protocol" = "TCP" ] || [ "$protocol" = "tcp" ]; then
IP_RULE="$IP_RULE -p tcp"
else
return
fi
trigger_dport=$(uci -q get porttrigger."$ptg_id".port)
[ -z "$trigger_dport" ] && return
IP_RULE="$IP_RULE --dport $trigger_dport"
trigger_dport_end=$(uci -q get porttrigger."$ptg_id".end_port_range)
if [ -n "$trigger_dport_end" ]; then
IP_RULE="$IP_RULE:$trigger_dport"
fi
config_get open_protocol "$rule_id" "protocol"
if [ "$open_protocol" = "UDP" ] || [ "$open_protocol" = "udp" ]; then
IP_RULE="$IP_RULE -j TRIGGER --trigger-type out --trigger-proto udp"
elif [ "$open_protocol" = "TCP" ] || [ "$open_protocol" = "tcp" ]; then
IP_RULE="$IP_RULE -j TRIGGER --trigger-type out --trigger-proto tcp"
else
return
fi
config_get open_dport "$rule_id" "port"
[ -z "$open_dport" ] && return
IP_RULE="$IP_RULE --trigger-match $open_dport"
config_get open_dport_end "$rule_id" "end_port_range"
if [ -z "$open_dport_end" ]; then
IP_RULE="$IP_RULE --trigger-relate $open_dport"
else
IP_RULE="$IP_RULE-$open_dport_end --trigger-relate $open_dport-$open_dport_end"
fi
duration=$(uci -q get porttrigger."$ptg_id".auto_disable_duration)
if [ -n "$duration" ]; then
IP_RULE="$IP_RULE --trigger-timeout $duration"
fi
interface=$(uci -q get porttrigger."$ptg_id".src)
[ -z "$interface" ] && return
device=$(uci show network | grep -w "name='.*$interface'" | cut -d'.' -f2)
ports=$(uci -q get network."$device".ports)
for port in ${ports}; do
IP_RULE_1="iptables -t nat -A prerouting_porttrigger -i $port $IP_RULE"
echo "$IP_RULE_1">>/tmp/port_trigger_iptables
done
}
port_trigger_handling() {
rm /tmp/port_trigger_iptables
iptables -w -t nat -F prerouting_porttrigger
touch /tmp/port_trigger_iptables
prerouting_porttrigger=$(iptables -t nat --list | grep prerouting_porttrigger)
if [ -z "$prerouting_porttrigger" ]; then
iptables -w -t nat -N prerouting_porttrigger
ret=$?
[ $ret -eq 0 ] && iptables -w -t nat -I PREROUTING -j prerouting_porttrigger
fi
# Load /etc/config/porttrigger UCI file
config_load porttrigger
config_foreach process_port_trigger rule
sh /tmp/port_trigger_iptables
}

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,10 +15,6 @@ include /lib/ethernet
. /lib/qos/shaper.sh
. /lib/qos/airoha.sh
get_rate_per_queue() {
echo "0"
}
get_burst_size_per_queue() {
echo "0"
}

View File

@@ -34,10 +34,6 @@ get_port_number() {
done
}
get_rate_per_queue() {
echo "0"
}
get_burst_size_per_queue() {
echo "0"
}

View File

@@ -31,7 +31,7 @@ generate_queue(){
uci set qos.@queue[-1].ifname="$ifname"
uci set qos.@queue[-1].precedence="$order"
uci set qos.@queue[-1].scheduling="SP"
uci set qos.@queue[-1].rate=$(get_rate_per_queue)
uci set qos.@queue[-1].rate="0"
uci set qos.@queue[-1].burst_size=$(get_burst_size_per_queue)
uci set qos.@queue[-1].weight="1"
done

View File

@@ -15,10 +15,6 @@ Q_COUNT=0
SP_Q_PRIO=7
SOQ_wgt=0
get_rate_per_queue() {
echo "1000000"
}
get_burst_size_per_queue() {
echo "1500"
}
@@ -224,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()
@@ -241,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
@@ -405,18 +401,20 @@ pre_configure_queue() {
}
get_link_rate() {
intf="$1"
speed=1000
local ifname="$1"
local phycap="$(ethtool $ifname | grep -A 10 "Supported link modes" | grep 00 | tail -n 1 | awk '{print$NF}')"
local speed=1000
if [ -d "/sys/class/net/$intf/" ]; then
speed=$(cat /sys/class/net/$intf/speed 2>/dev/null)
[ -z "$speed" ] & speed=1000
fi
if [ $speed -le 0 ]; then
# assuming default 1000
speed=1000
fi
# Get the max capability of this port
case "$phycap" in
10000*) speed=10000 ;;
5000*) speed=5000 ;;
2500*) speed=2500 ;;
1000*) speed=1000 ;;
100*) speed=100 ;;
10*) speed=10 ;;
*) speed=1000 ;;
esac
echo "$speed"
}

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,11 +5,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-base
PKG_VERSION:=3.1.45
PKG_VERSION:=3.1.53
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
PKG_SOURCE_VERSION:=9f3525957ac203c8900996c467032c2be6343ae5
PKG_SOURCE_VERSION:=0108f9c192a168936ee223dbf4d85a7ceba7093d
PKG_MIRROR_HASH:=skip
SULU_MOD:=core

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-builder
PKG_VERSION:=3.1.45
PKG_VERSION:=3.1.53
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-builder.git
PKG_SOURCE_VERSION:=32f297540eca2d80aea425968d3503b3c41d86eb
PKG_SOURCE_VERSION:=5d0336f678a116cdf4c73fec7c0d8ab06c0f65d6
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/sulu-$(PKG_VERSION)/sulu-builder-$(PKG_SOURCE_VERSION)

View File

@@ -4,11 +4,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-lcm
PKG_VERSION:=3.1.27
PKG_VERSION:=3.1.52
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-lcm.git
PKG_SOURCE_VERSION:=6b1d30d7918adeb19c5177dd7c5472cb0dac9896
PKG_SOURCE_VERSION:=af612edb4ea186d9c71fc2157883bf686b14e376
PKG_MIRROR_HASH:=skip
include ../sulu-builder/sulu.mk

View File

@@ -4,11 +4,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-multi-ap
PKG_VERSION:=3.1.42
PKG_VERSION:=3.1.52
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-multi-ap.git
PKG_SOURCE_VERSION:=e209cbc04a92494b96c74cee443e1b385c6687fe
PKG_SOURCE_VERSION:=ac4a73768844796be5678559b64269e6fe073192
PKG_MIRROR_HASH:=skip
include ../sulu-builder/sulu.mk

View File

@@ -4,11 +4,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-parental-control
PKG_VERSION:=3.1.38
PKG_VERSION:=3.1.52
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-parental-control.git
PKG_SOURCE_VERSION:=dd9dab9fb8aca87991cd2cc02c5fedd8baee3b97
PKG_SOURCE_VERSION:=e1c5b4473fba9d42ef7d1e95e634416585bf5887
PKG_MIRROR_HASH:=skip
include ../sulu-builder/sulu.mk

View File

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

16
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}"
}

View File

@@ -22,20 +22,20 @@ validate_globals_section()
}
start_lxc_container() {
local root
local root_dir
config_get name "${1}" name ""
config_get type "${1}" type ""
config_get autostart "${1}" autostart "0"
config_get timeout "${1}" timeout "300"
root="${2}"
root_dir="${2}"
if [ -z "${name}" ] || [ -z "${type}" ]; then
return 0;
fi
# workaround to install lxc container with installdu and autostart them
if [ -f "${root}/$name/config" ]; then
if [ -f "${root_dir}/$name/config" ]; then
type=lxc
fi
@@ -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
@@ -81,31 +81,29 @@ start_service() {
local enabled debug log_level sock root
config_load swmodd
validate_globals_section || {
return 1;
}
[ "${enabled}" -eq 0 ] && return 0
# crun default runtime directory /run, if not present then create
[ ! -d "/run" ] && ln -fs /var/run /run
if [ ! -d "${root}" ]; then
log "# Not staring root [${root}] not present/defined"
return 1
fi
env_name=""
execenvs=$(uci show swmodd | grep "=execenv" | cut -d'=' -f 1 | cut -d'.' -f 2)
for env in ${execenvs}; do
name=$(uci get swmodd.${env}.name)
if [ -n "${name}" ]; then
env_name="${name}"
break
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
done
fi
# Currently only one execenv supported
env_name="$(uci -q get swmodd.@execenv[0].name)"
if [ -z "${env_name}" ]; then
log "# Not starting execenv name [${env_name}] not defined"
log "# Not starting, execenv name [${env_name}] not defined"
return 1
fi
@@ -115,10 +113,14 @@ start_service() {
fi
bundle_root="${bundle_root}${env_name}"
if [ ! -d "${bundle_root}" ]; then
log "# Not staring execenv [${bundle_root}] not present"
return 1
fi
if [ ! -d "${bundle_root}" ]; then
if [ -n "${bundle_root}" ]; then
mkdir -p "${bundle_root}"
else
log "# Not starting, execenv [${bundle_root}] not defined"
return 1
fi
fi
procd_open_instance swmodd
procd_set_param command ${PROG}
@@ -154,5 +156,5 @@ reload_service() {
}
service_triggers() {
procd_add_reload_trigger "swmodd"
procd_add_reload_trigger "swmodd"
}

62
swmodd/files/etc/swmodd/run.sh Normal file → Executable file
View File

@@ -123,12 +123,57 @@ update_config_json() {
fi
cd "${BUNDLE}/${NAME}"
if cat config.json |jq '.linux.namespaces[] |select (.type == "network") |.path' |grep -q ${NAME}; then
exit 0;
# If netns already configured and no additional permission bit assigned, exit from here
if [ -z "${PERM}" ]; then
exit 0;
fi
fi
mv config.json config_orig.json
json_init
json_load_file "config_orig.json"
# update hostname to container name
if [ -n "${NAME}" ]; then
json_add_string hostname "${NAME}"
fi
# Update cabalities
if [ -n "${PERM}" ]; then
log "Updating Permission in the json ..."
PERM="${PERM//,/ }"
json_select process
json_select capabilities
json_select bounding
for p in ${PERM}; do
json_add_string "" ${p}
done
json_select ..
json_select effective
for p in ${PERM}; do
json_add_string "" ${p}
done
json_select ..
json_select inheritable
for p in ${PERM}; do
json_add_string "" ${p}
done
json_select ..
json_select permitted
for p in ${PERM}; do
json_add_string "" ${p}
done
json_select ..
json_select ambient
for p in ${PERM}; do
json_add_string "" ${p}
done
json_select ..
json_select ..
json_select ..
fi
# update additional capabilities
json_select linux
json_for_each_item update_network_ns namespaces
json_dump >config.json
@@ -212,16 +257,19 @@ pull_image_from_registry() {
clean=0
net_update=0
update_json=0
while getopts b:n:i:r:l:t:cuU options
PERM=""
while getopts b:n:i:r:l:t:p:cuU options
do
case "${options}" in
b) BUNDLE=${OPTARG};;
n) NAME=${OPTARG};;
c) clean=1;;
i) BRIDGE=${OPTARG};;
n) NAME=${OPTARG};;
p) PERM="${OPTARG}";;
r) REGURL=${OPTARG};;
l) LOGIN=${OPTARG};;
t) TIMEOUT=${OPTARG};;
c) clean=1;;
u) net_update=1;;
U) update_json=1;;
*) log "Invalid options";;
@@ -233,7 +281,7 @@ if [ -z "${NAME}" ]; then
return 0;
fi
if [ "${update_json}" -eq 1 ]; then
if [ "${update_json}" -eq "1" ]; then
update_config_json
return 0;
fi
@@ -243,7 +291,7 @@ if [ -n "${REGURL}" ]; then
return 0;
fi
if [ "$clean" -eq 1 ]; then
if [ "$clean" -eq "1" ]; then
clean_container_network "${NAME}"
return 0;
fi
@@ -253,7 +301,7 @@ if [ -z "${BRIDGE}" ]; then
return 0;
fi
if [ "${net_update}" -eq 1 ]; then
if [ "${net_update}" -eq "1" ]; then
get_veth_name "${NAME}"
brctl addif "${BRIDGE}" "${VETHNAME}"
return 0;

27
testnet/Makefile Normal file
View File

@@ -0,0 +1,27 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=testnet
PKG_VERSION:=1.0.0
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0-only
include $(INCLUDE_DIR)/package.mk
define Package/testnet
CATEGORY:=Utilities
TITLE:=Check WAN IP Connection
DEPENDS:=+ndisc6
endef
define Package/testnet/description
Check WAN IP connection
endef
define Build/Compile
endef
define Package/testnet/install
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,testnet))

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# do not start testnet if the feature is explicitly disabled
[ "$(uci -q get netmode.testnet.enabled)" = "0" ] && exit 0
[ "$(uci -q get testnet.global.enabled)" = "0" ] && exit 0
[ "$ACTION" == "ifup" -o "$ACTION" == "ifdown" ] || exit 0
@@ -14,8 +14,4 @@ interface_check() {
}
interface_check
if [ -n "$(pgrep -f testnet)" ]; then
testnet once
else
testnet &
fi
/etc/init.d/testnet reload

View File

@@ -0,0 +1,23 @@
#!/bin/sh /etc/rc.common
START=21
STOP=10
USE_PROCD=1
TESTNET=$(which testnet)
start_service() {
# do not start testnet if the feature is explicitly disabled
[ "$(uci -q get testnet.global.enabled)" = "0" ] && return 0
[ -n "$TESTNET" ] && {
procd_open_instance
procd_set_param command "$TESTNET"
procd_set_param respawn
procd_close_instance
}
}
reload_service() {
procd_send_signal testnet
}

View File

@@ -1,7 +1,7 @@
#!/bin/sh
. /lib/functions.sh
. /lib/network/utils.sh
RELOAD=0
WAITING=0
NETCON=0
LASTSTATUS=""
@@ -14,29 +14,32 @@ test_connection() {
local defroute="$(ip r | grep default | awk '{print$3}' | head -1)"
local def6route="$(ip -f inet6 r | grep default | awk '{print$3}')"
local ping6dev="$(ip -f inet6 r | grep default | awk '{print$5}')"
local resolvfile="$(uci -q get 'dhcp.@dnsmasq[0].resolvfile')"
if [ -n "$addr" ]; then
ping -q -w 5 -c 1 $addr >/dev/null 2>&1 && return 0
ping -q -w 5 -c 1 "$addr" >/dev/null 2>&1 && return 0
elif [ -n "$defroute" ]; then
ping -q -w 5 -c 1 $defroute >/dev/null 2>&1 && return 0
for nmsrv in $(grep nameserver /var/resolv.conf.auto | awk '{print$2}'); do
ping -q -w 5 -c 1 $nmsrv >/dev/null 2>&1 && return 0
done
ping -q -w 5 -c 1 "$defroute" >/dev/null 2>&1 && return 0
if [ -e "$resolvfile" ]; then
for nmsrv in $(grep nameserver "$resolvfile" | awk '{print$2}'); do
ping -q -w 5 -c 1 "$nmsrv" >/dev/null 2>&1 && return 0
done
fi
elif [ -n "$def6route" -a -n "$ping6dev" ]; then
ndisc6 -w 5 -1 $def6route $ping6dev >/dev/null 2>&1 && return 0
ndisc6 -w 5 -1 "$def6route" "$ping6dev" >/dev/null 2>&1 && return 0
fi
return 1
}
internet_test() {
local link dest
local dest
# use the destination address given in config for connectivity check
dest="$(uci -q get netmode.testnet.destination)"
dest="$(uci -q get testnet.global.destination)"
# for backwards compatibility
[ -n "$dest" ] || dest="$(uci -q get diagnostics.@connectivity[0].destination)"
[ -n "$dest" ] || dest="$(uci -q get 'system.@system[0].netping_addr')"
test_connection $dest
test_connection "$dest"
if [ "$?" -eq 0 ]; then
NETCON=1
@@ -50,7 +53,7 @@ internet_test() {
connectivity_test() {
internet_test
if [ $NETCON -eq 1 ]; then
if [ "$NETCON" -eq 1 ]; then
CURSTATUS=1
[ "$CURSTATUS" == "$LASTSTATUS" ] || ubus send internet '{"status" : "online"}'
LASTSTATUS=1
@@ -61,12 +64,14 @@ connectivity_test() {
fi
}
if [ "$1" == "once" ]; then
connectivity_test
exit 0
fi
trap RELOAD=1 HUP
while true; do
if [ "$WAITING" -eq 0 ]; then
sleep "$SLEEP_TIME" &
WAITING=1
fi
RELOAD=0
connectivity_test
sleep $SLEEP_TIME
[ "$RELOAD" -eq 0 ] && wait && WAITING=0
done

View File

@@ -1,7 +1,7 @@
config TR104_RUNAS_BBFDM_MICROSERVICE
bool "Use bbfdmd datamodel microservice to run tr104, preferred if TR104 and BBFDMD are on different base"
depends on PACKAGE_tr104
default n
default y
config TR104_VENDOR_EXTENSIONS
bool "Use TR104 vendor extensions"

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=tr104
PKG_VERSION:=1.0.14
PKG_VERSION:=1.0.13.4
LOCAL_DEV:=0
ifeq ($(LOCAL_DEV),0)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/voice/tr104.git
PKG_SOURCE_VERSION:=fa19217fbd589d064e1f32ec20d0df53e31fb610
PKG_SOURCE_VERSION:=9d8e68f237207723b446f614a2233dccf3c4dc09
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -32,7 +32,7 @@ define Package/$(PKG_NAME)
SUBMENU:=TRx69
TITLE:=TR104 Datamodel Daemon
MENU:=1
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +asterisk
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +asterisk +libcurl +PACKAGE_libbbfdm-api:libbbfdm-api
endef
define Package/$(PKG_NAME)/description
@@ -54,7 +54,7 @@ CMAKE_OPTIONS += \
-DTR104_EXTENSION_DIR:String="iowrt"
endif
ifeq ($(CONFIG_RUNAS_BBFDM_MICROSERVICE),y)
ifeq ($(CONFIG_TR104_RUNAS_BBFDM_MICROSERVICE),y)
MAKE_PATH:=libdm
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/libbbfdm-api
CMAKE_OPTIONS += -DRUNAS_BBFDM_MICROSERVICE:BOOL=ON
@@ -76,7 +76,7 @@ define Package/$(PKG_NAME)/install
ifeq ($(CONFIG_TR104_VENDOR_EXTENSIONS),y)
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libdm/extensions/iowrt/libtr104ext.so $(1)/etc/tr104/plugins/
endif
ifeq ($(CONFIG_RUNAS_BBFDM_MICROSERVICE),y)
ifeq ($(CONFIG_TR104_RUNAS_BBFDM_MICROSERVICE),y)
$(INSTALL_BIN) ./files/etc/init.d/tr104d.bbfdm $(1)/etc/init.d/tr104d
else
$(INSTALL_DIR) $(1)/usr/sbin

View File

@@ -6,13 +6,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=twamp
PKG_VERSION:=1.4.3
PKG_VERSION:=1.4.2
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/twamp-light.git
PKG_SOURCE_VERSION:=d31b2128e6ea4ab42538b88db91b2cc84091ef4d
PKG_SOURCE_VERSION:=f3d35a5499e8815721ba384e79fda8181f76b8f8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=urlfilter
PKG_VERSION:=1.1.9
PKG_VERSION:=1.1.14
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/urlfilter.git
PKG_SOURCE_VERSION:=75077256211644443ca30cc994ef16b013c4131c
PKG_SOURCE_VERSION:=ebf8afb44ff808d3b99c45a7c636fb12a774f357
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=usermngr
PKG_VERSION:=1.2.12
PKG_VERSION:=1.2.10
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/usermngr.git
PKG_SOURCE_VERSION:=b09414824b95f2a73e6f02b06d4efd15bfab77e0
PKG_SOURCE_VERSION:=4f429e25c6e7a69c5171186731bc560befa5a660
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -6,11 +6,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=usp-js
PKG_VERSION:=1.2.3
PKG_VERSION:=1.2.4
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/usp-js.git
PKG_SOURCE_VERSION:=61cf7adb3258820f12f5dc02c69c5bdd612ed4cd
PKG_SOURCE_VERSION:=fa4586a0fc5fe13bc83165c8401e63d84db89e72
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip

View File

@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=voicemngr
PKG_RELEASE:=1
PKG_VERSION:=1.1.2
PKG_VERSION:=1.1.8
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
@@ -19,7 +19,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:=25571796f18c91a2070f98881bd1205f15575fea
PKG_SOURCE_VERSION:=3eff99d3bd62cbbc176c71f77a2df495f4e46e62
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:=wifimngr
PKG_VERSION:=16.2.3
PKG_VERSION:=16.2.1.5
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=3e5799f9cae80b3f9a1bc1fa6503020005f76aa9
PKG_SOURCE_VERSION:=5696f739e765e221e2f882a659cf509296572250
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wifimngr.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz

View File

@@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=xmppc
PKG_VERSION:=2.2.4
PKG_VERSION:=2.2.3
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/xmppc.git
PKG_SOURCE_VERSION:=543c7a780544d195dd8d0357e453c0ce4fa62454
PKG_SOURCE_VERSION:=23a7f6005b84fc4d4a1432057ecd2b5a74f9ea3e
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif