Compare commits

..

316 Commits

Author SHA1 Message Date
Jakob Olsson
49b4762dc4 map-agent: 6.3.2: mapagent config changes 2021-12-13 16:25:51 +01:00
Jakob Olsson
0eaba859a7 map-agent: remove uplink tmp file when restarting dynbhd 2021-12-13 16:24:44 +01:00
Jakob Olsson
7828e67308 map-controller: 5.2.2 2021-12-13 13:48:37 +01:00
vdutta
985ccf339f icwmp: 8.2.18 2021-12-13 16:11:10 +05:30
vdutta
b8f36d23ec bbf: 6.3.6 2021-12-13 15:45:57 +05:30
Amin Ben Ramdhane
4f7aeaaec2 bbf: 6.3.5 2021-12-13 09:26:47 +01:00
Anjan Chanda
d976140484 iop: config: add wfadatad-collector to build 2021-12-11 10:19:12 +01:00
vdutta
747436ce8f obuspa: Handle retries and lockout for challenges 2021-12-10 21:29:53 +05:30
Jakob Olsson
dde560d314 map-agent: 6.3.1 2021-12-10 15:45:22 +01:00
Amin Ben Ramdhane
34ec63d1f2 bbf: 6.3.4 2021-12-10 14:39:59 +01:00
vdutta
d4465d81f7 uspd: 2.1.39 2021-12-10 18:19:20 +05:30
vdutta
022ec4d6bb icwmp: 8.2.17 2021-12-10 17:50:31 +05:30
vdutta
6c68ff3be7 swmodd: Added auto-boot for lxc containers 2021-12-10 17:48:18 +05:30
Jakob Olsson
9e1e0eb0df map-controller: 5.2.14 2021-12-10 13:13:39 +01:00
Jakob Olsson
63ba56b87e map-agent: 6.3.0: introduce dynbhd 2021-12-10 13:13:08 +01:00
Anjan Chanda
53ab41ea2f ieee1905: 4.1.1 2021-12-10 12:58:31 +01:00
Anjan Chanda
d1477636f9 wfadatad: 6.10.0 (deagent + decollector) 2021-12-10 12:57:10 +01:00
Grzegorz Sluja
b2e8affb08 dectmngr: Do not create new LineDiagnostic entry each startup 2021-12-10 12:44:35 +01:00
Hemlata Bhatt
2dc9b89cd5 Voice : fix extension provider value type 2021-12-10 12:41:43 +01:00
Anjan Chanda
77acc69dbe wfadatad: 5.1.1 2021-12-09 20:09:43 +01:00
Anjan Chanda
5ac418113e map-controller: 5.2.13 2021-12-09 20:09:18 +01:00
Anjan Chanda
1ba55b753e map-agent: 6.2.12 2021-12-09 20:08:50 +01:00
Anjan Chanda
d483abe7d2 ieee1905: 4.1.0 2021-12-09 20:08:20 +01:00
Anjan Chanda
511d471d54 wifimngr: 14.0.3 2021-12-09 20:07:56 +01:00
Anjan Chanda
206ecd46db easy-soc-libs: 6.4.32 2021-12-09 20:07:29 +01:00
Andreas Gnau
f9f31384c2 Update feed [ iopsys ] package [ fdtextract ]
-------------------------------------------------------------------------------
* 7e013f0 Do not read entire file into buffer when extracting
-------------------------------------------------------------------------------
commit 7e013f0afa68378d38a6bdc9b0c5a342bd3dd0a5
Author: Erik Karlsson <erik.karlsson@genexis.eu>
Date: 2021-11-30 00:09:44 +0100

    Do not read entire file into buffer when extracting

    Only read FDT into buffer, and then in case of external image, use lseek
    followed by sendfile if supported or otherwise read/write.

    Remove unnecessary strdup of option arguments that would leak memory in case
    options are repeated.

    Fix confusing error message with --attribute when --image is used to specify
    a non-existing image.

Base directory -> /
 fdtextract.c | 169 +++++++++++++++++++++++++++++++++++++----------------------
 1 file changed, 106 insertions(+), 63 deletions(-)
-------------------------------------------------------------------------------
2021-12-09 18:24:19 +01:00
vdutta
2c4e50ab10 swmodd: optimize du_list get time 2021-12-09 21:04:40 +05:30
vdutta
ac46849475 obuspa: 4.1.0.15 2021-12-09 21:01:14 +05:30
Amin Ben Ramdhane
4db7061884 bbf: 6.3.3 2021-12-09 12:14:09 +01:00
Grzegorz Sluja
de40d120e2 dectmngr: Fix unitialized ptr value causing crash 2021-12-09 10:03:10 +01:00
Wenpeng Song
e54e20de45 dectmngr: Add the option to direct CMBS debug messages to syslog 2021-12-08 17:02:15 +00:00
Wenpeng Song
7add2a163d merge together with dectmngr feeds update 2021-12-08 16:32:34 +00:00
Yalu Zhang
499709e2df dectmngr-3.4.0: Support implicit intrusion call 2021-12-08 15:53:03 +01:00
vdutta
c566d23c78 sulu: 0.2.21 2021-12-07 19:49:30 +05:30
vdutta
a5c8b7145f rulengd: 1.2.4 2021-12-07 17:56:52 +05:30
vdutta
0419beb911 periodicstats: 1.0.5 2021-12-07 17:46:29 +05:30
vdutta
8bb22efe7d swmodd: Improved memoryinfo and SetRequestedState 2021-12-07 17:37:48 +05:30
vdutta
bff8f75bbb icwmp: Remove manual seeding of openssl RAND generator 2021-12-07 17:29:22 +05:30
Jakob Olsson
be57a189f7 map-controller: 5.2.3 2021-12-07 12:48:42 +01:00
Grzegorz Sluja
9c365459bb dectmngr: Update uci when DECT hs name is changed from hs menu 2021-12-07 11:53:18 +01:00
Amin Ben Ramdhane
f4e9f29d3d bbf: 6.3.2 2021-12-07 11:18:23 +01:00
Jakob Olsson
ac56460fec map-agent: 6.2.2 2021-12-07 10:52:49 +01:00
Omar Kallel
cb2077377a icwmp: 8.2.15 2021-12-06 18:25:04 +01:00
Amin Ben Ramdhane
673dfc8589 bbf: 6.3.1 2021-12-06 12:18:44 +01:00
Jakob Olsson
a287107ee1 map-controller: 5.2.2 2021-12-06 11:32:21 +01:00
vdutta
47396a4e4f obuspa: Boot time improvements 2021-12-03 19:38:37 +05:30
vdutta
d82756305c icwmp: Boot time improvements 2021-12-03 19:35:38 +05:30
Omar Kallel
5bd754fc9a icwmp: 8.2.13 2021-12-03 11:40:34 +01:00
Dominic Lake
bed5379108 obuspa: Add NotifRetry option to UCI
Added support for NotifRetry in UCI for use with subscriptions.
2021-12-03 09:47:41 +00:00
Yalu Zhang
d8e5dcf859 dectmngr 3.3.1: add some extensions to Line Settings List defined in CAT-iq 2.0
- /etc/init.d/dectmngr: set model id from hw.board.dect_model_id if the value in the database
  is valid. Otherwise set to 30.3B.06
- Add a config option: ENABLE_LINE_SETTINGS_EXTENSION in the package
2021-12-02 18:15:51 +01:00
Jakob Olsson
64f9e23850 map-agent: 6.2.1 2021-12-01 17:28:54 +01:00
Suru Dissanaike
aaffffdba2 quickjs-websocket: 1.1 2021-12-01 16:22:58 +01:00
arne.jonsson
0d6980e0ec Disabled and removed DEVTMPS from config 2021-12-01 15:00:27 +00:00
arne.jonsson
61f454043d Disabled and removed DEVTMPS from config 2021-12-01 15:00:27 +00:00
Janusz Dziedzic
defe48e4e8 ieee1905: allow local dev build
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2021-12-01 08:30:54 +00:00
Janusz Dziedzic
4d893499a5 map-controller: add local dev build option
After that ~/git/map-controller code will
be used/compiled.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2021-12-01 08:30:54 +00:00
Grzegorz Sluja
e32f2f09be dectmngr: Move DECT chip independent functions to dect_common.h 2021-11-30 18:51:39 +01:00
Jakob Olsson
183ba5d634 map-controller: 5.2.1 2021-11-30 17:30:41 +01:00
Grzegorz Sluja
809113d4b2 dectmngr: Remove handset's name section from config on deregistration 2021-11-30 12:24:12 +01:00
vdutta
927b002aa6 obuspa: Updated uci schema
- prototrace uci option to enable protocol trace
 - Added BootParamName for controller boot parameters
2021-11-29 17:54:25 +05:30
vdutta
c5654ad9ab icwmp: 8.2.12-2021-11-29 2021-11-29 11:14:46 +05:30
vdutta
2e3013dc56 uspd: 2.1.38 2021-11-26 19:19:43 +05:30
suvendhu
a7dd783b49 swmodd: use curl for du_install 2021-11-26 18:48:23 +05:30
Jakob Olsson
d3451b7bd4 ieee1905: 4.0.6 2021-11-26 13:18:39 +01:00
vdutta
776860187d icwmp: Fix race condition in dhcp ACS provisioning 2021-11-26 17:27:56 +05:30
Grzegorz Sluja
d2dda88aad dectmngr: Do not restart dectmngr on dect config change 2021-11-26 12:37:49 +01:00
Yalu Zhang
22871d2410 Update package dectmngr 3.3.0
Multiple line support with m:n mapping between extensions and DECT handsets
2021-11-26 11:59:42 +01:00
Amin Ben Ramdhane
707203b42a bbf: 6.3.0 2021-11-26 10:41:55 +01:00
Omar Kallel
60fb332fff icwmp: Remove set dhcp reqopt from uci-defaults && set dhcp_url to icwmp config 2021-11-25 18:05:39 +01:00
Omar Kallel
bd0d27ebc9 Start icwmp only if EnableCWMP is true 2021-11-25 17:39:51 +01:00
Jakob Olsson
0af83a4892 wfadatad: 5.1.0 2021-11-25 17:15:35 +01:00
Jakob Olsson
715f58db4d map-topology: 3.1.0 2021-11-25 16:49:23 +01:00
Jakob Olsson
cdfa0a7313 map-controller: 5.2.0 2021-11-25 15:57:06 +01:00
Jakob Olsson
9b12400c0b map-agent: 6.2.0 2021-11-25 15:54:00 +01:00
Dominic Lake
b59e3250af obuspa: Support different boot params per controller
Added support to specify the boot params for each controller separately in the controller UCI section.
2021-11-24 16:35:50 +00:00
vdutta
f742ce11ae obuspa: Publish endpoint id to mqtt broker for usp-js 2021-11-24 19:52:25 +05:30
vdutta
7a6ff46b8a swmodd: 2.0.11 2021-11-24 19:22:14 +05:30
Amin Ben Ramdhane
e3d9a24ed7 bbf: 6.2.6 2021-11-24 12:13:42 +01:00
vdutta
88fcb2e4df uspd: Fix schema updater 2021-11-24 13:55:39 +05:30
vdutta
0f05633d74 obuspa: updated default interface to loopback 2021-11-24 13:20:38 +05:30
Jakob Olsson
5173b01cb2 map-controller: make uci wireless to mapcontroller sync configurable 2021-11-23 17:16:24 +01:00
Omar Kallel
86cf6fc81e icwmp: 8.2.11-2021-11-23 2021-11-23 16:44:28 +01:00
Omar Kallel
2ee29d8252 Add BOOT event when starting icwmp 2021-11-23 16:38:16 +01:00
Omar Kallel
ef178897ba Add BOOT event when starting icwmp 2021-11-23 15:24:33 +01:00
Suru Dissanaike
1d4b28acd4 quickjs: added quickjs package graciously provided by Genexis 2021-11-23 10:34:34 +01:00
Anjan Chanda
2b6e74fb80 map-topology: include libnl3 in target-cflags 2021-11-23 09:21:34 +01:00
Janusz Dziedzic
32cfd29d74 map-agent: add local dev build option
After that ~/git/map-agent code will
be used/compiled.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2021-11-22 17:18:54 +00:00
Omar Kallel
63959e908e icwmp: 8.2.10-2021-11-22 2021-11-22 15:50:33 +01:00
vdutta
80e2035662 uspd: 2.1.36 2021-11-22 20:06:12 +05:30
Amin Ben Ramdhane
7527faca9c bbf: 6.2.5 2021-11-22 14:18:27 +01:00
Erik Karlsson
b7e010be3b gryphon-led-module: use the right toolchain on Broadcom targets
Userspace toolchain was being used to build the kernel module which
although not correct happened to work on 32-bit kernel but obviously
does not work on 64-bit kernel with 32-bit userspace.

Ideally, it should but enough to set KERNEL_CROSS if Build/Compile is
updated to use KERNEL_CROSS instead of TARGET_CROSS, but not changing
TARGET_CROSS breaks scripts/strip-kmod.sh which for some reason uses
TARGET_CROSS rather than KERNEL_CROSS.
2021-11-19 16:16:19 +01:00
Amin Ben Ramdhane
84ad0eec4e bbf: 6.2.4 2021-11-19 14:49:31 +01:00
vdutta
bd188aaed2 swmodd: Multiple fixes
- Handle frozen containers
 - Handle libgcc package name miss-match
2021-11-19 11:08:38 +05:30
Amit Kumar
4d244eb31e mcastmngr: corrected P1 break of mcast stats 2021-11-18 06:48:52 +00:00
nevadita.chatterjee
14aab50849 easy-soc-libs: 6.4.28 2021-11-17 16:53:40 +05:30
sverma
3a605fd8f5 bbf: 6.2.3 2021-11-17 15:57:12 +05:30
Amin Ben Ramdhane
f9bbce19dd bbf: 6.2.2 2021-11-16 18:10:45 +01:00
Omar Kallel
a1677793d3 icwmp: Remove the use of .icwmpd_boot file 2021-11-16 11:51:50 +01:00
Grzegorz Sluja
d7a8913072 dectmngr: Refresh Contact List on handset after change from ubus 2021-11-16 09:51:05 +01:00
Omar Kallel
34c5ea3c75 Ticket refs #5876: icwmp: Init scripts enhancements and cleanup 2021-11-15 15:58:56 +01:00
Grzegorz Sluja
c006db0e21 dectmngr: Remove dependency to libiconv from dectmngr 2021-11-15 14:59:33 +01:00
Amin Ben Ramdhane
4e42968aca bbf: 6.2.1 2021-11-15 13:39:36 +01:00
vdutta
9b48e54734 icwmp: Fix random crashes 2021-11-13 16:21:52 +05:30
Amin Ben Ramdhane
77a41d56a1 bbf: 6.2.0 2021-11-12 14:11:43 +01:00
Andreas Gnau
90fa843074 gryphon-led-module: Build against bcmkernel on Broadcom platforms
Due to the complexity of the Broadcom build system which amongst others
puts dynamically generated symlinks into the kernel dir, we have a fake
kernel "bcmlinux" to please the OpenWrt build system. This kernel is not
used for anything but building the OpenWrt toolchain. To compile against
the right kernel that is running on the target, we need to compile the
kernel module against the kernel inside bcmkernel which is the one
compiled by the BCM SDK.
2021-11-12 12:11:08 +00:00
Jakob Olsson
524c718242 map-agent: 6.1.1 2021-11-12 11:21:52 +01:00
Jakob Olsson
e00102c2b9 map-controller: 5.1.1 2021-11-12 11:19:38 +01:00
Anjan Chanda
2c0b6b76e2 wfadatad: 5.0.5 2021-11-12 09:38:15 +01:00
Anjan Chanda
9e9dc5b1a9 wifimngr: 14.0.0 2021-11-12 09:37:33 +01:00
Anjan Chanda
4535b14305 easy-soc-libs: 6.4.27 2021-11-12 09:36:29 +01:00
Yalu Zhang
478e3a5c8b dectmngr: keep /etc/dect/LA_DB during sysupgrade 2021-11-11 15:24:40 +01:00
Amin Ben Ramdhane
98302e0523 periodicstats: 1.0.4 2021-11-11 13:57:02 +01:00
Amin Ben Ramdhane
4dc45c779a bbf: 6.1.9 2021-11-11 13:56:06 +01:00
Yalu Zhang
c1bef47f50 dectmngr: update Makefile to include the path for external libraries 2021-11-11 12:14:03 +01:00
Andreas Gnau
9fb0c48a22 dectmngr: Add missing iconv-full dependency
dectmngr has required libiconv-full, but did not declare the dependency.
This creates a risk for the build failing due to race conditions. After
we removed another config-option that depended on libiconv-full the
build started to fail because nothing depended on libiconv-full anymore.

Fixes: f6f1644b (iop: config: Don't enable CONFIG_BUILD_NLS, 2021-11-04)
2021-11-11 10:56:08 +01:00
Anjan Chanda
d8e35df684 wfa-capi: 1.1.0 2021-11-11 10:51:12 +01:00
Yalu Zhang
d0189d605f dectmngr: bump the package version to 3.2.0 2021-11-10 14:37:35 +00:00
Grzegorz Sluja
8de1704440 dectmngr: Add phonebook support 2021-11-10 11:18:09 +01:00
Andreas Gnau
f6f1644bab iop: config: Don't enable CONFIG_BUILD_NLS
It seems like CONFIG_BUILD_NLS it is not needed by anything, so disable
it. On an embedded device, we do not need localised output. End-users
will probably never interact via SSH with the device. So it is unclear
why it had been enabled in the first place.
2021-11-10 09:47:40 +00:00
vdutta
b1c705544b Added ifupdate in hotplug 2021-11-09 17:58:36 +01:00
Omar Kallel
bd8d574177 Remove init script logs 2021-11-09 17:57:02 +01:00
Omar Kallel
4b5c88b015 icwmp: Reduce I/O on filesystem 2021-11-09 17:51:48 +01:00
Omar Kallel
32245d37c3 Revert "Added ifupdate in hotplug"
This reverts commit 08244c5392.
2021-11-09 16:35:09 +01:00
Omar Kallel
56d2b9c4e3 Revert "icwmp: Reduce I/O on filesystem"
This reverts commit 146bc95709.
2021-11-09 16:34:59 +01:00
vdutta
08244c5392 Added ifupdate in hotplug 2021-11-09 16:24:21 +01:00
Omar Kallel
146bc95709 icwmp: Reduce I/O on filesystem 2021-11-09 16:23:31 +01:00
Amin Ben Ramdhane
25a861a55f bbf: 6.1.7 2021-11-09 15:49:15 +01:00
vdutta
86fab6969f uspd: Option to configure dm version to use 2021-11-08 11:26:01 +05:30
Amin Ben Ramdhane
5463df37e1 bbf: 6.1.6 2021-11-05 10:55:41 +01:00
Grzegorz Sluja
a480a0c95d dectmngr: Update package dectmngr
c2b5452 Disable dectmngr logging to file by default
6d0af6c SUOTA implementation
79fa843 Fix the bug of syslog messages with incorrect ident and facility
2021-11-04 07:52:37 +01:00
vdutta
89068fa876 icwmp: 8.2.6-2021-11-03 2021-11-03 21:23:20 +05:30
vdutta
c3cee3431c uspd: Enable caching of ubus data 2021-11-03 21:17:08 +05:30
Amin Ben Ramdhane
bf70b518bd bbf: 6.1.5 2021-11-03 16:42:09 +01:00
nevadita.chatterjee
ad293962c1 topology: 3.0.4 2021-11-03 13:36:41 +05:30
nevadita.chatterjee
6badc20bcc map-topology:3.0.3 2021-11-02 16:43:43 +05:30
vdutta
f8b51b9ca5 uspd: Add TransferComplete event with bbf plugin 2021-11-01 16:23:46 +05:30
Jakob Olsson
a5c390efdd ieee1905: 4.0.5 2021-10-29 16:08:31 +02:00
vdutta
6d011f8626 uspd: Extend TransferComplete with json plugin 2021-10-29 18:48:12 +05:30
vdutta
f1d5e5d7cd bbf: Support operate and events with json plugins 2021-10-29 18:45:12 +05:30
vdutta
0fed56903c icwmp: 8.2.6-2021-10-29 2021-10-29 17:20:09 +05:30
Jakob Olsson
2ac7be4652 map-agent: 6.1.0 2021-10-29 13:36:55 +02:00
Jakob Olsson
7e34649ce7 map-controller: 5.1.0 2021-10-29 13:36:26 +02:00
Amit Kumar
a404da9124 libqos: updated broadcom header file 2021-10-29 16:43:19 +05:30
Amit Kumar
d152eb0f17 qosmngr: porttminit added before qcfg 2021-10-29 10:45:10 +00:00
Hemlata Bhatt
fb8ed439b8 Adjustment for the restructure of asterisk UCI config 2021-10-29 11:58:40 +02:00
nevadita.chatterjee
6b23da2314 map-topology: 3.0.2 2021-10-29 13:19:02 +05:30
sverma
bc90649202 wfadatad: 5.0.3 2021-10-28 20:56:19 +05:30
Jakob Olsson
0f31eb632f map-agent: rename map-loop-detection to map-dynamic-backhaul 2021-10-28 16:23:13 +02:00
Stanislaw Gruszka
5c37dc2165 ieee1905: export cmdu_ackq.h 2021-10-28 12:48:19 +00:00
Erik Karlsson
b4ce04d317 map-controller: fix enabling via uci
The service must be started but without any instance in case it is
disabled via uci. If it is stopped entirely, the reload trigger does
not work and it is impossible to re-enable mapcontroller via uci
without explicit reload.
2021-10-28 07:09:23 +00:00
Erik Karlsson
1f817c4e8f map-agent: trigger reload on the right configuration file
Trigger reload, which is currently implemented as restart, when
mapagent rather than ieee1905 configuration is changed.
2021-10-28 07:09:23 +00:00
vdutta
26599ba94e uspd: Added get_supported_dm 2021-10-27 20:17:38 +05:30
vdutta
26fe0bc7de bbf: 6.1.3 2021-10-27 20:16:44 +05:30
Marek Puzyniak
37493eb8be easy-soc-libs: 6.4.6
Signed-off-by: Marek Puzyniak <marek.puzyniak@iopsys.eu>
2021-10-27 09:54:18 +00:00
vdutta
b3dda9b4e5 uspd: align with bbf changes 2021-10-27 13:27:00 +05:30
vdutta
94879c6de9 bbf: 6.1.2 2021-10-27 13:25:55 +05:30
vdutta
a15f586ecf icwmp: Fix raise condition for con-req 2021-10-26 20:04:02 +05:30
nevadita.chatterjee
f3c5face44 ieee1905: version 4.0.4 2021-10-26 15:43:00 +05:30
Jakob Olsson
4488510e4b map-agent: 6.0.8 2021-10-25 11:20:00 +02:00
vdutta
4685cb49d4 icwmpd: 8.2.4-2021-10-25 2021-10-25 12:16:35 +05:30
vdutta
6ad633cbf4 uspd: 2.1.29 2021-10-25 12:14:32 +05:30
vdutta
d97c335cb5 obuspa: Fix compilation errors for gcc 11 2021-10-25 12:03:48 +05:30
vdutta
3563683cec swmodd: Fix compilation error on gcc v11 2021-10-25 11:59:24 +05:30
vdutta
330bb08d1b bbf: 6.1.1 2021-10-25 11:57:29 +05:30
Jakob Olsson
93f2090d0e map-agent: 6.0.7 2021-10-22 16:58:33 +02:00
Jakob Olsson
d9ae18761b map-agent: map-loop-detection: speed up interface removal from bridge and harmonize disconnection 2021-10-22 16:56:15 +02:00
Jakob Olsson
40a1a45412 wifimngr: 05-wifi: publish wps over fronthauls when eth connected 2021-10-22 16:51:41 +02:00
Jakob Olsson
f459eaafb9 map-agent: 6.0.6 2021-10-22 15:21:56 +02:00
Jakob Olsson
a80ed328c3 map-controller: get source url from https 2021-10-22 15:19:04 +02:00
Jakob Olsson
15d9fc0339 map-agent: get source url from https 2021-10-22 15:11:26 +02:00
Amin Ben Ramdhane
916edb4ba3 bbf: 6.1.0 2021-10-22 12:56:13 +01:00
Amin Ben Ramdhane
eb67d5ab6e icwmp: 8.2.4-2021-10-22 2021-10-22 11:13:24 +01:00
Amin Ben Ramdhane
dd43b90e91 bulkdata: 1.0.3 2021-10-22 11:11:46 +01:00
Jakob Olsson
5fee9aa7b4 map-agent: multiap: enable bsta being swapped to 2021-10-22 10:28:32 +02:00
Jakob Olsson
b821c760df map-agent: multiap: implement swap to link function 2021-10-21 17:09:30 +02:00
Andreas Gnau
2dbcf3c75c Update feed [ iopsys ] package [ endptmngr ]
-------------------------------------------------------------------------------
* 6d7b2e9 Adapt Broadcom SDK 5.04 workaround version check to 5.04L.02p1
* f28a1b7 BCM: Adapt to SDK 5.04L.02p1 endpoint_api changes
-------------------------------------------------------------------------------
commit 6d7b2e9c90234767cb56a1e7885f42825bd6287a
Author: Andreas Gnau <andreas.gnau@iopsys.eu>
Date: 2021-10-20 17:43:37 +0200

    Adapt Broadcom SDK 5.04 workaround version check to 5.04L.02p1

    Adapt the version check for the workaround for BCM SDK 5.04 a9e612c (Add a
    workaround need for building with Broadcom 5.04., 2020-11-08) to cover BCM
    SDK 5.04L.02p1.

Base directory -> /
 src/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit f28a1b7b08a0bcc8faa2b25e1acebf811e05e87c
Author: Andreas Gnau <andreas.gnau@iopsys.eu>
Date: 2021-09-21 16:32:17 +0200

    BCM: Adapt to SDK 5.04L.02p1 endpoint_api changes

    In SDK 5.04L.02p1, Broadcom has changed rtcpXRMode in struct EPZCNXPARAM
    with a bitfield rtcpXRConfig which enables a more fine-grained control of
    the RTCP XR configuration.

    For now, set it to HAPI_RTP_RTCP_XR_GENERATE_VOIP_REPORT as recommended by
    the comment in endpoint_api.h. More bits to set can be found in hapi_rtp.h
    in the SDK.

Base directory -> /
 src/connection.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2021-10-20 17:59:05 +02:00
Jakob Olsson
952366cbc6 map-agent: multiap: write bssid for same bands when writing bsta section 2021-10-20 12:49:09 +02:00
Jakob Olsson
23a18999d5 ieee1905: 4.0.3 2021-10-20 10:11:43 +02:00
Jakob Olsson
2d2dffbec2 map-agent: 6.0.5 2021-10-20 10:08:24 +02:00
Sukru Senli
758ee8ec9f sulu: 0.2.20 2021-10-19 17:18:48 +02:00
Amin Ben Ramdhane
c38ce1be3b bbf: 6.0.9 2021-10-19 14:43:55 +01:00
Andreas Gnau
2b5332adc3 Update feed [ iopsys ] package [ fdtextract ]
-------------------------------------------------------------------------------
* ef46eb3 Add --image switch for getting attributes from image nodes. Also update the indentation and fix some minor naming issues.
-------------------------------------------------------------------------------
commit ef46eb3be68ae1216d8699234f237fb2243289f1
Author: Markus Gothe <markus.gothe@genexis.eu>
Date: 2021-10-14 10:22:48 +0200

    Add --image switch for getting attributes from image nodes. Also update the
    indentation and fix some minor naming issues.

Base directory -> /
 fdtextract.c  | 122 +++++++++++++++++++++++++++++++++++-----------------------
 util.c        |   2 +-
 version_gen.h |   2 +-
 3 files changed, 76 insertions(+), 50 deletions(-)
-------------------------------------------------------------------------------
2021-10-18 16:56:32 +02:00
Jakob Olsson
70c3d5d5e1 map-agent: multiap: comment out debug print 2021-10-18 13:17:09 +02:00
vdutta
df41990929 icwmp: Revert Init scripts enhancements and cleanup 2021-10-15 20:41:25 +05:30
Jakob Olsson
6edc7cbb94 map-controller: 5.0.3 2021-10-15 10:21:05 +02:00
Jakob Olsson
d7bffebd5b map-agent: 6.0.4 2021-10-15 10:21:05 +02:00
Jakob Olsson
8f81a71b57 ieee1905: 4.0.2 2021-10-15 10:21:05 +02:00
Jakob Olsson
9452ada64f map-agent: 6.0.3 2021-10-15 09:42:41 +02:00
Jakob Olsson
1a3d267ee1 map-agent: map-loop-detection: reconnect enabled supplicants 2021-10-15 09:35:46 +02:00
Jakob Olsson
2f6b40bdd2 map-agent: multiap: add dynamic backhaul funcs 2021-10-15 09:35:46 +02:00
Jakob Olsson
d1c2be5b08 map-agent: multiap: supress uci errors 2021-10-15 09:35:46 +02:00
vdutta
fdee0c734c icwmp: 8.2.4-2021-10-14 2021-10-14 22:01:48 +05:30
Sukru Senli
88513db735 questd: remove reload trigger 2021-10-14 16:12:01 +02:00
Amin Ben Ramdhane
8bdbefcc80 bbf: 6.0.8 2021-10-14 13:51:20 +01:00
Omar Kallel
ee33f0ae7d icwmp: 8.2.4-2021-10-13 2021-10-13 16:21:33 +01:00
Omar Kallel
5cd57a3ee9 Ticket refs #5876: icwmp: Init scripts enhancements and cleanup 2021-10-13 16:11:27 +01:00
Amin Ben Ramdhane
56a6cbf04a bbf: 6.0.7 2021-10-13 14:35:36 +01:00
Omar Kallel
1fb879fca0 icwmp: get dhcp 43 option in icwmp hotplug script instead of netifd package 2021-10-13 11:17:51 +01:00
Omar Kallel
a3fd03c390 icwmp: use both ipv4 and ipv6 addresses for firewall rules 2021-10-12 11:41:07 +01:00
Amin Ben Ramdhane
00594ba01e bbf: 6.0.6 2021-10-11 16:13:33 +01:00
Anjan Chanda
132bba5c20 wfa-capi: 1.0.0 2021-10-11 16:34:22 +02:00
Grzegorz Sluja
06f160af35 dectmngr: Fixes for registration and set HS name
0e937cf Set the HS name during registration if it has the name set in uci
62421c0 Do not send LocateSuggest req when registration mode is opened
2021-10-11 14:42:52 +02:00
Sukru Senli
04bf025b8f questd: remove deprecated router.network object 2021-10-11 09:54:59 +02:00
Sukru Senli
1daa8d7f1a iop: genconfig: remove references to juci 2021-10-11 09:49:07 +02:00
Sukru Senli
97a302a20a juci: remove deprecated package 2021-10-11 09:40:05 +02:00
Anjan Chanda
87a0fbe8bf wfadatad: 5.0.2 2021-10-08 21:48:36 +02:00
Yalu Zhang
54b4140e09 dectmngr 3.1.18: support DECT multiple line mode 2021-10-08 17:16:10 +02:00
vdutta
99267f902b bbf: 6.0.5 2021-10-08 12:45:53 +05:30
vdutta
0338a2fd7c uspd: Configure option for subprocess on get cmd 2021-10-08 11:12:10 +05:30
vdutta
e134a5ed08 obuspa: Align permission for set 2021-10-08 11:08:30 +05:30
vdutta
0d8f4a3de8 obuspa: Fail init if required data is missing 2021-10-08 11:01:47 +05:30
Jakob Olsson
d5e7cb1a28 map-controller: 5.0.2 2021-10-07 17:15:50 +02:00
Jakob Olsson
e995fcb14d map-agent: 6.0.2 2021-10-07 17:12:22 +02:00
vdutta
f865531fa5 bbf: 6.0.4 2021-10-07 17:11:26 +05:30
Markus Gothe
104f3e2e83 qosmngr: updated broadcom.sh to get the ports from the runner.
When using the runner accelerator we need to check how to
map between ethernet interfaces (i.e eth0) and the internal
names used by the runner (i.e. port/index=lan2). Depending on
the hardware the mapping is not always 1:1 as assumed earlier.

This commit also fixes a minor bug with resetting traffic
shaping for the archer accelerator.
2021-10-07 05:12:04 +00:00
Sukru Senli
d298757300 obudpst: install as udpst 2021-10-06 18:48:39 +02:00
vdutta
b66ade378a bbf: 6.0.3 2021-10-06 10:33:58 +05:30
Omar Kallel
be36f2e3e8 icwmp: uci enhancements 2021-10-05 14:37:52 +01:00
Anjan Chanda
00dc43eb39 map-agent: 6.0.1 2021-10-04 14:34:58 +02:00
Anjan Chanda
efeeb00a0a map-topology: 3.0.1 2021-10-04 14:18:57 +02:00
Anjan Chanda
cc5b7a8a17 wfadatad: 5.0.1 2021-10-04 14:18:19 +02:00
Anjan Chanda
ce8425ce70 map-controller: 5.0.1 2021-10-04 14:16:53 +02:00
Anjan Chanda
ce5b916828 ieee1905: 4.0.1 2021-10-04 14:01:39 +02:00
Anjan Chanda
7f04196f58 easy-soc-libs: 6.4.5 2021-10-04 14:01:13 +02:00
Stanislaw Gruszka
762d5a5daa map-agent: fix configuring ssid's and keys with spaces 2021-10-04 10:21:58 +00:00
Anjan Chanda
abc997d3f3 easy-soc-libs: 6.4.1 2021-10-03 21:16:14 +02:00
Markus Gothe
924b54d8d3 grpyhon-led-module: Add ability to read back color
To aid remote debugging we want to be able to
read back the set color on the RGB LED. This commit
implements this functionality.
2021-10-01 16:16:32 +00:00
Jakob Olsson
bd8dd65766 map-topology: 2.1.10 2021-10-01 16:08:21 +02:00
Jakob Olsson
5372956a9a map-agent: multiap: func to sync mapcontroller from wireless
To accomodate datamodel
2021-10-01 10:52:44 +02:00
Jakob Olsson
bf0ddc5321 map-agent: 5.4.2 2021-09-30 16:37:58 +02:00
Jakob Olsson
7895966aa2 map-agent: 5.4.1 2021-09-30 16:28:54 +02:00
Jakob Olsson
0f716b5197 map-controller: 4.2.6 2021-09-30 16:28:19 +02:00
Jakob Olsson
dd56712aa4 map-controller: 4.2.5 2021-09-30 16:28:19 +02:00
Jani Juvan
b7de0cf4bb map-agent: 5.4: traffic separation 2021-09-30 16:28:19 +02:00
Amin Ben Ramdhane
09f6449a6e bbf: 6.0.0 2021-09-30 15:19:19 +01:00
Andreas Gnau
f00e7fe965 iop: config: Use OpenSSL instead of WolfSSL for libustream
In IOPSYSWRT, we use OpenSSL. Instead of shipping WolfSSL just for the
OpenWrt libustream library (which powers the uclient-fetch / wget
commands), make libustream use OpenSSL as well. This decreases security
maintenance and reduces overhead in image size and memory usage.
2021-09-30 15:05:04 +02:00
vdutta
dd7aac2a8c swmodd: Fix compilation issues 2021-09-30 18:27:32 +05:30
vdutta
49ffec4bc9 swmodd: Improve get time 2021-09-30 16:21:32 +05:30
Grzegorz Sluja
0a638e202b dectmngr: Fix some compilation warnings 2021-09-30 12:39:56 +02:00
Grzegorz Sluja
82676d8390 dectmngr: Fixes for setting DECT HS name and setting MWI 2021-09-30 09:24:06 +02:00
Yalu Zhang
95d6cadee1 dectmngr 3.1.17: Fix an issue that the call can't be released properly 2021-09-29 17:34:56 +02:00
vdutta
4672442d50 obuspa: Startup improvements 2021-09-29 16:26:49 +05:30
Amin Ben Ramdhane
7a8759e46a bbf: 5.0.8 2021-09-28 13:39:26 +01:00
Grzegorz Sluja
f28659ebe0 dectmngr: Change uci config file from dectmngr to dect 2021-09-28 13:26:50 +02:00
Grzegorz Sluja
f10457c8cb dectmngr: fixup! Implementation for setting DECT Handset's name 2021-09-27 10:50:12 +02:00
Grzegorz Sluja
bd3f962614 dectmngr: Add dectmngr trigger so that change in uci config reloads it 2021-09-27 10:49:13 +02:00
Grzegorz Sluja
a4aa0b3521 Revert "dectmngr: Add handset name to uci configuration"
This reverts commit 67169eff2a.
2021-09-27 10:49:13 +02:00
Anjan Chanda
06204d8523 wifimngr: 13.0.1 2021-09-26 21:33:52 +02:00
Anjan Chanda
4b5dbec851 easy-soc-libs: 6.3.4 2021-09-26 21:31:51 +02:00
vdutta
ab6035acbd icwmp: Default incoming rule based on port only 2021-09-25 17:22:00 +05:30
vdutta
72b7726f1e icwmp: 8.1.10-2021-09-24 2021-09-24 19:26:16 +05:30
Jakob Olsson
56ab101640 map-controller: 4.2.4 2021-09-24 15:50:33 +02:00
Amin Ben Ramdhane
4ee030a2ea bbf: 5.0.7 2021-09-24 14:10:26 +01:00
Jakob Olsson
ec402a2ea1 map-controller: 4.2.3 2021-09-24 14:32:43 +02:00
Jakob Olsson
52466671ab map-controller: 4.2.2 2021-09-24 13:41:02 +02:00
Jakob Olsson
3a54432533 map-controller: update default pkg config 2021-09-24 12:26:11 +02:00
Jakob Olsson
7a8e1b9076 map-controller: 4.2.1 2021-09-24 12:23:03 +02:00
Jakob Olsson
237e8d7b6d map-agent: 5.3.1 2021-09-24 12:22:31 +02:00
Grzegorz Sluja
bd468e4761 dctmngr: Implementation for setting DECT Handset's name 2021-09-24 10:18:56 +02:00
Grzegorz Sluja
67169eff2a dectmngr: Add handset name to uci configuration 2021-09-24 10:18:47 +02:00
Jakob Olsson
1ad1ef12b4 map-controller: 4.2.0: update default config 2021-09-24 10:11:27 +02:00
Jakob Olsson
a012f98b4c map-agent: bump version 5.3.0 2021-09-24 10:10:51 +02:00
Yalu Zhang
1f3c696867 dectmngr: fix an error in Makefile for PKG_SOURCE_SUBDIR 2021-09-23 15:37:57 +02:00
Sukru Senli
b861a89031 Revert "dectmngr: avoid multiple directories in build_dir when lifting versions"
This reverts commit a94c701f66.
2021-09-23 15:19:31 +02:00
Amin Ben Ramdhane
ca9e4f1765 bbf: 5.0.6 2021-09-23 13:52:44 +01:00
Yalu Zhang
a94c701f66 dectmngr: avoid multiple directories in build_dir when lifting versions 2021-09-23 12:35:09 +02:00
Yalu Zhang
13684e1ce6 dectmngr: 3.1.16
Fix issues in ubus dect status
2021-09-23 11:56:27 +02:00
vdutta
00d5c0849c uspd: module test enhancements 2021-09-22 19:56:41 +05:30
Amin Ben Ramdhane
2ae25830e7 bbf: 5.0.5 2021-09-22 13:47:00 +01:00
nevadita.chatterjee
645a3bb5e5 topology:2.1.9 2021-09-22 14:31:43 +05:30
vdutta
85fbea1d40 Revert "uspd: Fix memory leak"
This reverts commit bb6131b1f7.
2021-09-21 22:28:19 +05:30
Sukru Senli
4be8594678 sulu-0.2.19 2021-09-21 18:17:00 +02:00
Yalu Zhang
1cb7520cb9 Update package dectmngr
Fix compilation error when set ENABLE_DECTMNGR_DEBUG to 1
2021-09-21 17:18:20 +02:00
vdutta
bb6131b1f7 uspd: Fix memory leak 2021-09-21 19:51:21 +05:30
Jakob Olsson
f268b27622 map-agent: 5.3.0 2021-09-21 16:11:15 +02:00
Jakob Olsson
85387d16b1 map-agent: multiap - add backhaul priority sync for bstas 2021-09-21 16:04:30 +02:00
vdutta
566a5ebcc7 obuspa: 4.1.0.5 2021-09-21 14:53:34 +05:30
vdutta
48104e2831 icwmp: Code enhancement 2021-09-21 14:44:48 +05:30
vdutta
f9e6d17778 obuspa: Reverting interface trigger 2021-09-20 20:34:43 +05:30
Sukru Senli
47ffb81c08 obudpst: remove unnecessary Build/InstallDev section 2021-09-19 17:57:43 +02:00
Erik Karlsson
fd050bc759 Revert "owsd: hotplug: map aliases against interface on ifup"
This reverts commit 051826305e.

Reason for revert: This appears unnecessary as individual ifup events
are already being generated for main and alias interfaces. The logic
is also broken. It causes owsd to be reloaded every time there is ifup
event on alias interface, regardless of owsd configuration.
2021-09-19 14:38:18 +00:00
Sukru Senli
76d1fd9cb3 obudpst-7.2.1 2021-09-19 16:32:39 +02:00
vdutta
3bf86b8652 icwmp: 8.1.9-2021-09-17 2021-09-17 20:26:23 +05:30
Yalu Zhang
c914639104 Update package dectmngr
Play dial tone when handset goes off hook without called number
2021-09-17 16:24:38 +02:00
Omar Kallel
425d48e974 icwmp: firewall improvement 2021-09-17 11:33:35 +01:00
Amin Ben Ramdhane
c339eae256 icwmp: 8.1.7-2021-09-17 2021-09-17 10:49:26 +01:00
suvendhu
fa7ef67b91 uspd: Added config option for max blob msg len 2021-09-17 14:36:05 +05:30
sverma
fc374d0f29 ieee1905: 3.3.7 2021-09-17 12:49:58 +05:30
Sukru Senli
01808d21b2 iop: sync genconfig_min versioning with genconfig 2021-09-17 09:06:37 +02:00
Amit Kumar
5a1fdc0b07 qosmngr: updated broadcom.sh for queue shapingrate 2021-09-16 18:19:00 +00:00
Amin Ben Ramdhane
6a84c4511a bbf: 5.0.4 2021-09-16 17:19:40 +01:00
vdutta
11704f2f91 obuspa: Init script enhancement 2021-09-16 19:08:31 +05:30
Amin Ben Ramdhane
d48965a03f bbf: 5.0.3 2021-09-15 15:12:53 +01:00
Janusz Dziedzic
bd12c3d6e8 onboarding, start wps on all available sta ifaces
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2021-09-15 10:11:09 +00:00
Sukru Senli
249072f280 iop: genconfig: update TARGET_VERSION generation
for non-tagged commits, TARGET_VERSION becomes <LAST_TAG>_<SHORT_COMMIT_HASH>
2021-09-14 19:47:38 +02:00
Yalu Zhang
ece01dd366 Update package dectmngr
Show boolean parameters correctly in ubus outputs
2021-09-14 14:52:39 +02:00
Yalu Zhang
2d82d20613 Update package dectmngr
Add two parameters to UBUS "dect status" for base station
2021-09-14 14:14:40 +02:00
Amin Ben Ramdhane
e6371c74d6 bbf: 5.0.1 2021-09-14 12:03:32 +01:00
Andreas Gnau
aa25a78ff1 iop: feeds_update: Make dev-check check for SSH instead of non-HTTP
Similarly to 986fc5ea (Make dev-check check for SSH instead of non-HTTP,
2020-06-23), check for SSH instead of whether the repo was cloned via
HTTP. Developers might have other remotes such as OpenWrt's configured.
2021-09-14 09:57:48 +02:00
jjoseph
60d1c43735 Update feed [iopsys] package [dslmngr] 2021-09-14 13:10:38 +05:30
vdutta
795fc9e805 icwmp: Reverted uci validation
- Partially reverted ae186df3c9
2021-09-13 19:53:47 +05:30
Hemlata Bhatt
1af894cba6 Digitmap DM parameters implemented 2021-09-13 14:26:48 +02:00
vdutta
4ba1558caa obuspa: Fix read only db warning 2021-09-10 17:08:33 +05:30
Jakob Olsson
cfb06f61d0 map-controller: 4.1.1 2021-09-10 11:01:11 +02:00
Jakob Olsson
d786c69d46 Revert "map-agent: 5.2.4"
This reverts commit 5d2b838d3e.
2021-09-10 11:00:37 +02:00
Jakob Olsson
5d2b838d3e map-agent: 5.2.4 2021-09-10 10:58:23 +02:00
Amit Kumar
88060bc42a libqos: updated log level 2021-09-10 13:03:59 +05:30
Jakob Olsson
16c3f49ff5 map-agent: 5.2.3 2021-09-10 08:44:23 +02:00
Omar Kallel
4b6eaad9a8 icwmp: 8.1.6-2021-09-10 2021-09-10 06:59:22 +01:00
Amit Kumar
af241bb222 qosmngr: corrected portid and unit for rxratecrtl 2021-09-10 05:03:02 +00:00
Amin Ben Ramdhane
ae621822c4 periodicstats: 1.0.3 2021-09-09 18:24:06 +01:00
Amin Ben Ramdhane
1a6ac9fa87 swmodd: 2.0.6 2021-09-09 18:21:46 +01:00
Amin Ben Ramdhane
749e38735a xmppc: 1.0.2 2021-09-09 18:19:54 +01:00
Amin Ben Ramdhane
292276ce75 bulkdata: 1.0.2 2021-09-09 18:17:04 +01:00
Amin Ben Ramdhane
1bcc2854af twamp: 1.0.1 2021-09-09 18:14:40 +01:00
Amin Ben Ramdhane
cee063223e bbf: 5.0.0 2021-09-09 18:13:02 +01:00
90 changed files with 3597 additions and 1348 deletions

View File

@@ -1,5 +1,7 @@
if PACKAGE_libbbfdm
menu "Configuration"
config BBF_VENDOR_EXTENSION
bool "Enable Vendor Extension"
default y
@@ -24,4 +26,12 @@ config BBF_TR143
bool "Enable TR-143 Data Model Support"
default y
config BBFDM_ENABLE_JSON_PLUGIN
bool "Enable json plugin to extend datamodel"
default n
config BBFDM_ENABLE_DOTSO_PLUGIN
bool "Enable shared library plugin to extend datamodel"
default n
endmenu
endif

View File

@@ -5,11 +5,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libbbfdm
PKG_VERSION:=4.5.9
PKG_VERSION:=6.3.6
PKG_FIXUP:=autoreconf
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=0e101a4c48e6a27f3f0a71eab434d8590bc0560a
PKG_SOURCE_VERSION:=b22628c0ddd294bc04f3768e7c1559ab6ad4192f
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
@@ -23,19 +23,19 @@ PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/libbbf_api
SECTION:=libs
CATEGORY:=Libraries
SUBMENU:=BBF
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Library for libbbfdm API
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
endef
define Package/libbbfdm
SECTION:=libs
CATEGORY:=Libraries
SUBMENU:=BBF
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Library for broadband-forum data model
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libbbf_api +libopenssl +libmbedtls +libcurl
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libbbf_api +libopenssl +libcurl
endef
define Package/libbbfdm/config
@@ -81,11 +81,6 @@ CONFIGURE_ARGS += \
--enable-libopenssl
endif
ifeq ($(CONFIG_PACKAGE_libmbedtls),y)
CONFIGURE_ARGS += \
--enable-libmbedtls
endif
ifeq ($(CONFIG_BBF_VENDOR_EXTENSION),y)
CONFIGURE_ARGS += \
--enable-vendor-extension
@@ -96,36 +91,46 @@ CONFIGURE_ARGS += \
endif ##CONFIG_BBF_VENDOR_EXTENSION
ifeq ($(CONFIG_BBFDM_ENABLE_JSON_PLUGIN),y)
CONFIGURE_ARGS += \
--enable-json-plugin
endif
ifeq ($(CONFIG_BBFDM_ENABLE_DOTSO_PLUGIN),y)
CONFIGURE_ARGS += \
--enable-shared-library
endif
define Package/libbbf_api/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.so* $(1)/lib/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.so* $(1)/lib/
endef
define Package/libbbfdm/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.so* $(1)/lib/
$(INSTALL_DIR) $(1)/usr/share/bbfdm
$(CP) $(PKG_BUILD_DIR)/scripts/* $(1)/usr/share/bbfdm
$(INSTALL_DIR) $(1)/etc/bbfdm
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
$(INSTALL_DIR) $(1)/etc/bbfdm/json
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.so* $(1)/lib/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/* $(1)/usr/share/bbfdm
endef
define Package/libbbfdm/prerm
#!/bin/sh
rm -rf /etc/bbfdm/*
rm -rf /etc/bbfdm/dmmap/*
exit 0
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include/libbbfdm
$(INSTALL_DIR) $(1)/usr/include/libbbf_api
$(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
$(CP) $(PKG_BUILD_DIR)/libbbf_api/*.h $(1)/usr/include/libbbf_api/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.{a,so*} $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.{a,so*} $(1)/usr/lib/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbf_api/*.h $(1)/usr/include/libbbf_api/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.{a,so*} $(1)/usr/lib/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.{a,so*} $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libbbf_api))

View File

@@ -8,9 +8,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bulkdata
PKG_VERSION:=1.0.1
PKG_VERSION:=1.0.3
PKG_SOURCE_VERSION:=e4f39d1bf4678fc05b9d02e81b194c70719909e4
PKG_SOURCE_VERSION:=b35e7862bc17fc11dc1f757c7b93900995a28633
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bulkdata.git

11
dectmngr/Config.in Normal file
View File

@@ -0,0 +1,11 @@
if PACKAGE_dectmngr
menu "Configuration"
config ENABLE_LINE_SETTINGS_EXTENSION
bool "Enable Line Settings List extension "
default y
endmenu
endif

View File

@@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dectmngr
PKG_RELEASE:=3
PKG_VERSION:=3.1.12
PKG_VERSION:=3.4.0
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=3de3dd2c45a0e95d875880c084f468a2f4010e2b
PKG_SOURCE_VERSION:=6d85dfeb2e29eb7a05069c11e850195b2d283494
PKG_MIRROR_HASH:=skip
endif
@@ -34,29 +34,40 @@ include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
CATEGORY:=Utilities
TITLE:=DECT Manager
DEPENDS:= +libubox +ubus
DEPENDS:= +libubox +ubus +uci +libxml2
endef
define Package/$(PKG_NAME)/description
DECT manager is a daemon that provides UBUS RPC objects and sends UBUS events for communication with the DECT chip.
endef
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -av --exclude=.* ~/git/voip/dectmngr/* $(PKG_BUILD_DIR)/
endef
endif
MAKE_FLAGS += \
CFLAGS+="-Wall"
TARGET_CFLAGS += \
-Wall \
-I$(STAGING_DIR)/usr/include/libxml2
ifeq ($(CONFIG_ENABLE_LINE_SETTINGS_EXTENSION),y)
TARGET_CFLAGS += -DENABLE_LINE_SETTINGS_EXTENSION
endif
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/app/dectmngr $(1)/usr/sbin/
$(STRIP) $(1)/usr/sbin/dectmngr
$(CP) ./files/etc/* $(1)/etc/
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/dect $(1)/lib/upgrade/keep.d/dect
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -0,0 +1,2 @@
config dect 'global'
option log_dect_cmbs 'syslog'

View File

@@ -1,2 +0,0 @@
config dectmngr 'general'
option log_dect_cmbs '0'

View File

@@ -34,24 +34,30 @@ start_service() {
rfpi=$(db -q get hw.board.dect_rfpi)
[ -n "$rfpi" -a ${#rfpi} -eq 14 ] && opt_ext="$opt_ext -rfpi $rfpi"
# model_id=$(db -q get hw.board.dect_model_id)
# Setting model_id to 0x010203 is a workaround to reduce synchronisation time of some handset
# TODO: remove below line and uncomment the line above to get value from db when the problem is solved
model_id="01.02.03"
[ -n "$model_id" -a ${#model_id} -eq 8 ] && opt_ext="$opt_ext -model $model_id"
model_id=$(db -q get hw.board.dect_model_id)
[ -n "$model_id" -a ${#model_id} -eq 8 ] || {
echo "Invalid hw.board.dect_model_id:$model_id. Set to 30.3B.06"
model_id="30.3B.06"
}
opt_ext="$opt_ext -model $model_id"
config_load dectmngr
config_get_bool log_dect_cmbs general log_dect_cmbs 0
config_load dect
config_get log_dect_cmbs global log_dect_cmbs syslog
procd_open_instance
if [ $log_dect_cmbs -eq 0 ]; then
if [ "$log_dect_cmbs" = "none" ]; then
echo "Starting dectmngr with cmbs logging disabled"
procd_set_param command $PROG -comname ttyH0 $opt_ext
rm -f $LOG_PATH/*
else
echo "Starting dectmngr with cmbs logging enabled"
elif [ "$log_dect_cmbs" = "file" ]; then
echo "Starting dectmngr with cmbs logging enabled to file"
procd_set_param command $PROG -comname ttyH0 -log $LOG_PATH/dect-cmbs.log $opt_ext
else
echo "Starting dectmngr with cmbs logging enabled to syslog"
procd_set_param command $PROG -comname ttyH0 -syslog $opt_ext
rm -f $LOG_PATH/*
fi
procd_set_param respawn 6 2 3
procd_set_param term_timeout 20
procd_set_param triggers asterisk
@@ -66,13 +72,13 @@ stop_service() {
}
reload_service() {
stop_and_wait_dectmngr
start
ubus call dect reload
}
service_triggers()
{
procd_add_reload_trigger asterisk
procd_add_config_trigger "config.change" "asterisk" /etc/init.d/dectmngr restart
procd_add_config_trigger "config.change" "dect" /etc/init.d/dectmngr reload
}
boot() {

View File

@@ -0,0 +1 @@
/etc/dect/LA_DB

View File

@@ -13,7 +13,7 @@ PKG_VERSION:=1.1.2
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=82d7208b3182a9cd1e6aec70872bf30f2fa8c82b
PKG_SOURCE_VERSION:=bb754ae620a9fc66fd6fc0745f0fead0708c7a17
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dslmngr.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip

View File

@@ -7,13 +7,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=easy-soc-libs
PKG_VERSION:=6.3.2
PKG_VERSION:=6.4.32
PKG_RELEASE:=1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=a1eedd39d2a1444045fc2a772fd62795cd6d2017
PKG_SOURCE_VERSION:=88577dd44871eb5d5eafc696b73b1972ada8432a
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz

View File

@@ -18,6 +18,7 @@ define Build/InstallDev/libeasy
$(CP) $(PKG_BUILD_DIR)/libeasy/utils.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/libeasy/if_utils.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/libeasy/debug.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/libeasy/hlist.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/
endef

View File

@@ -7,13 +7,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=endptmngr
PKG_VERSION:=0.5
PKG_VERSION:=0.6
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/endptmngr.git
PKG_SOURCE_VERSION:=debfc47348d6e1fc1c8b126ad50a7f5f8db3e19d
PKG_SOURCE_VERSION:=1d4f1aafcb929e64597d226a710fd0c1b949ba08
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -30,7 +30,7 @@ PKG_BUILD_PARALLEL:=1
# indirectly. This ensures that the package is rebuilt on config-changes.
PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD
export CONFIG_BRCM_SDK_VER_504002
export CONFIG_BRCM_SDK_VER_504021
export CONFIG_BCM_CHIP_ID
include $(INCLUDE_DIR)/package.mk

View File

@@ -12,7 +12,7 @@ PKG_VERSION:=1.0
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/fdtextract.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=45575262de7a9690bcb2c760f35e2c74e88e1176
PKG_SOURCE_VERSION:=7e013f0afa68378d38a6bdc9b0c5a342bd3dd0a5
PKG_MIRROR_HASH:=skip
PKG_LICENSE:=GPLv2

View File

@@ -28,6 +28,7 @@ define KernelPackage/$(PKG_NAME)
FILES:=$(PKG_BUILD_DIR)/$(PKG_NAME).$(LINUX_KMOD_SUFFIX)
KCONFIG:=CONFIG_PACKAGE_kmod-gryphon-led-kernel-module=y
AUTOLOAD:=$(call AutoLoad,60,$(PKG_NAME))
DEPENDS:= +(TARGET_iopsys_brcm63xx_arm):bcmkernel
PKG_LICENSE:=GPLv2
PKG_LICENSE_URL:=
endef
@@ -40,6 +41,21 @@ EXTRA_KCONFIG:= CONFIG_RGB_LED=m
MODULE_INCLUDE=-I$(PKG_BUILD_DIR)
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
LINUX_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-4.19
MODULES_SUBDIR:=lib/modules/4.19.183
TARGET_CROSS:=$(CONFIG_BCM_TOOLCHAIN)/bin/$(CONFIG_BCM_TOOLTUPLE)
ifeq ($(CONFIG_BCM_CHIP_ID),$(filter $(CONFIG_BCM_CHIP_ID),"63158" "6856" "6858"))
# These targets use a 64-bit kernel
LINUX_KARCH:=arm64
TARGET_CROSS:=/opt/toolchains/crosstools-aarch64-gcc-9.2-linux-4.19-glibc-2.30-binutils-2.32/bin/aarch64-buildroot-linux-gnu-
endif
# For some reason, Broadcom's kernel does not set the include paths correctly when compiling out-of-tree modules
EXTRA_KCPPFLAGS:="-I $(LINUX_DIR)/../bcmkernel/include -I $(LINUX_DIR)/arch/arm/mach-bcm963xx/include"
endif
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)/kdevlinks/
$(CP) -s `pwd`/src/* $(PKG_BUILD_DIR)/kdevlinks/

View File

@@ -43,10 +43,15 @@
static ssize_t get_led_color(struct device *dev,
struct device_attribute *attr, char *buf)
{
/* [ln] todo: dummy implementation */
int len;
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
len = scnprintf(buf, PAGE_SIZE, "%d\n", 123);
if (IS_ERR(sk9822)) {
printk(KERN_ERR "Platform get drvdata returned NULL\n");
return -EIO;
}
len = scnprintf(buf, PAGE_SIZE, "%02x%02x%02x\n", sk9822->led_colors[0].r, sk9822->led_colors[0].g, sk9822->led_colors[0].b);
if (len <= 0) {
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
return -EIO;

View File

@@ -1,5 +1,6 @@
if PACKAGE_icwmp
menu "Configuration"
choice
prompt "Select ACS sever"
default CWMP_ACS_MULTI
@@ -18,6 +19,6 @@ config CWMP_DEBUG
config CWMP_DEVEL_DEBUG
bool "Compile with development debug options"
default n
endmenu
endif

View File

@@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=8.1.5-2021-09-03
PKG_VERSION:=8.2.18
PKG_FIXUP:=autoreconf
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=393e67dec2a1a924423761e73fb376209b871a10
PKG_SOURCE_VERSION:=00e48a59436160b1692f2da3590904bf296f1ab4
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
@@ -29,8 +29,6 @@ PKG_CONFIG_DEPENDS:= \
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
CWMP_REVISION=$(shell svnversion ./src/ -n|cut -f2 -d:)
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
@@ -57,24 +55,8 @@ endef
endif
TARGET_CFLAGS += \
-D_GNU_SOURCE -D_AADJ
ifneq ($(CWMP_REVISION)_,_)
ifneq ($(CWMP_REVISION),exported)
ifneq ($(CWMP_REVISION),Unversioned directory)
TARGET_CFLAGS += "-DCWMP_REVISION=\\\"$(CWMP_REVISION)\\\""
TARGET_LDFLAGS += "-DCWMP_REVISION=\\\"$(CWMP_REVISION)\\\""
endif
endif
endif
TARGET_LDFLAGS += \
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
CONFIGURE_ARGS += \
--with-uci-include-path=$(STAGING_DIR)/usr/include \
--with-libubox-include-path=$(STAGING_DIR)/usr/include \
--with-libubus-include-path=$(STAGING_DIR)/usr/include
-D_GNU_SOURCE \
"-DCWMP_REVISION=\\\"$(PKG_SOURCE_VERSION)\\\""
ifeq ($(CONFIG_CWMP_ACS_MULTI),y)
CONFIGURE_ARGS += \
@@ -99,26 +81,19 @@ endif
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/icwmpd
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmpd $(1)/usr/sbin/
$(CP) ./files/* $(1)/
endef
define Package/$(PKG_NAME)/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
echo "Enabling rc.d symlink for icwmpd"
/etc/init.d/icwmpd enable
fi
exit 0
endef
define Package/$(PKG_NAME)/prerm
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
echo "Disabling rc.d symlink for icwmpd"
/etc/init.d/icwmpd disable
fi
exit 0
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmpd $(1)/usr/sbin/icwmpd
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
$(INSTALL_BIN) ./files/etc/firewall.cwmp $(1)/etc/firewall.cwmp
$(INSTALL_BIN) ./files/etc/init.d/icwmpd $(1)/etc/init.d/icwmpd
$(INSTALL_BIN) ./files/etc/uci-defaults/85-cwmp-set-userid $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/uci-defaults/95-icwmp-generate-ssl $(1)/etc/uci-defaults/
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
$(INSTALL_BIN) ./files/etc/icwmpd/update.sh $(1)/etc/icwmpd/update.sh
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -1,11 +1,9 @@
config acs 'acs'
option url ''
option userid '' #$OUI-$SER
option passwd 'iopsys'
option periodic_inform_enable 'true'
option periodic_inform_interval '1800'
option periodic_inform_time '0001-01-01T00:00:00Z'
option ParameterKey ''
option dhcp_discovery 'enable'
# compression possible configs: GZIP, Deflate, Disabled
option compression 'Disabled'
@@ -39,6 +37,7 @@ config cpe 'cpe'
option exec_download '0'
option periodic_notify_enable '1'
option periodic_notify_interval '10'
option incoming_rule 'Port_Only'
config lwn 'lwn'
option enable '1'

View File

@@ -1,6 +1,15 @@
#created by the icwmp package
zone_name=""
port=""
#created by the icwmp package
if [ ! -f "/var/state/cwmp" ]; then
exit 0;
fi
zone_name=$(uci -c /var/state -q get cwmp.acs.zonename)
port=$(uci -q get cwmp.cpe.port)
ipaddr=$(uci -c /var/state -q get cwmp.acs.ip)
ip6addr=$(uci -c /var/state -q get cwmp.acs.ip6)
incoming_rule=$(uci -q get cwmp.cpe.incoming_rule|tr [A-Z] [a-z])
if [ "$zone_name" = "" ]; then
exit 0
elif [ "$zone_name" = "icwmp" ]; then
@@ -18,4 +27,48 @@ else
iptables -t filter -D INPUT -j zone_icwmp_input 2> /dev/null
iptables -X zone_icwmp_input 2> /dev/null
fi
#iptables -I FW_ZONE -p tcp -s ACS_ADDRESS --dport PORT -j ACCEPT --comment "Open ACS port"
cmd="iptables -w 1 -I zone_${zone_name}_input -p tcp"
cmd6="ip6tables -w 1 -I zone_${zone_name}_input -p tcp"
# default incoming rule is Port only
if [ -z "${incoming_rule}" ]; then
incoming_rule="port_only"
fi
if [ "${incoming_rule}" = "ip_only" ]; then
if [ -n "${ipaddr}" ]; then
cmd="${cmd} -s ${ipaddr}"
cmd6="${cmd6} -s ${ip6addr}"
fi
elif [ "${incoming_rule}" = "port_only" ]; then
if [ -n "${port}" ]; then
cmd="${cmd} --dport ${port}"
cmd6="${cmd6} --dport ${port}"
fi
else
if [ -n "${ipaddr}" ]; then
cmd="${cmd} -s ${ipaddr}"
cmd6="${cmd6} -s ${ip6addr}"
fi
if [ -n "${port}" ]; then
cmd="${cmd} --dport ${port}"
cmd6="${cmd6} --dport ${port}"
fi
fi
echo ${cmd}|grep -q "\-\-dport \|\-s "
if [ "$?" -eq 0 ]; then
cmd="${cmd} -j ACCEPT -m comment --comment=Open_ACS_port"
${cmd}
fi
echo ${cmd6}|grep -q "\-\-dport \|\-s "
if [ "$?" -eq 0 ]; then
cmd6="${cmd6} -j ACCEPT -m comment --comment=Open_ACS_port"
${cmd6}
fi
uci -c /var/state -q set cwmp.cpe.firewall_restart="init"
uci -c /var/state -q commit cwmp

View File

@@ -1,87 +0,0 @@
#!/bin/sh
. /lib/functions/network.sh
[ "$ACTION" == "ifup" ] || exit 0
[ -f /etc/config/cwmp ] || exit 0
handle_icwmp_restart() {
[ -f /tmp/switching_mode ] && exit 0
[ -f /tmp/wificontrol.txt -a -f /tmp/netmode-conf.pid ] && exit 0
[ "$INTERFACE" == "loopback" ] && exit 0
local defwan=$(uci -q get cwmp.cpe.default_wan_interface)
[ -n "$defwan" -a "$(uci -q get network.$defwan)" == "interface" -a "$defwan" != "$INTERFACE" ] && exit 0
local islan="$(uci -q get network.$INTERFACE.is_lan)"
[ "$islan" == "1" ] && exit 0
local proto="$(uci -q get network.$INTERFACE.proto)"
[ "$proto" == "none" ] && exit 0
local ifname="$(uci -q get network.$INTERFACE.ifname)"
[ "${ifname:0:1}" == "@" ] && exit 0
mkdir -p /tmp/ipv4
network_flush_cache
local previpaddr=""
local curipaddr=""
local ipaddrfile=/tmp/ipv4/$INTERFACE-ipaddr
previpaddr=$(cat $ipaddrfile 2>/dev/null)
network_get_ipaddr curipaddr $INTERFACE
[ -n "$curipaddr" ] && echo $curipaddr > $ipaddrfile || rm -f $ipaddrfile
local prevgateway=""
local curgateway=""
local gatewayfile=/tmp/ipv4/$INTERFACE-gateway
prevgateway=$(cat $gatewayfile 2>/dev/null)
network_get_gateway curgateway $INTERFACE
[ -n "$curgateway" ] && echo $curgateway > $gatewayfile || rm -f $gatewayfile
local prevsubnets=""
local cursubnets=""
local subnetsfile=/tmp/ipv4/$INTERFACE-subnets
prevsubnets=$(cat $subnetsfile 2>/dev/null)
network_get_subnets cursubnets $INTERFACE
[ -n "$cursubnets" ] && echo $cursubnets > $subnetsfile || rm -f $subnetsfile
local prevdnsservers=""
local curdnsservers=""
local dnsserverfile=/tmp/ipv4/$INTERFACE-dnsservers
prevdnsservers=$(cat $dnsserverfile 2>/dev/null)
network_get_dnsserver curdnsservers $INTERFACE
[ -n "$curdnsservers" ] && echo $curdnsservers > $dnsserverfile || rm -f $dnsserverfile
local prevdev=""
local curdev=""
local devfile=/tmp/ipv4/$INTERFACE-dev
prevdev=$(cat $devfile 2>/dev/null)
network_get_device curdev $INTERFACE
[ -n "$curdev" ] && echo $curdev > $devfile || rm -f $devfile
local prevopt43url=""
local curopt43url=""
local opt43urlfile=/tmp/ipv4/$INTERFACE-opt43url
prevopt43url=$(cat $opt43urlfile 2>/dev/null)
curopt43url="$(uci -P /var/state -q get cwmp.acs.dhcp_url)"
[ -n "$curopt43url" ] && echo $curopt43url > $opt43urlfile || rm -f $opt43urlfile
[ \
"$prevdev" == "$curdev" -a \
"$previpaddr" = "$curipaddr" -a \
"$prevgateway" = "$curgateway" -a \
"$prevsubnets" = "$cursubnets" -a \
"$prevdnsservers" = "$curdnsservers" \
] && {
[ "$prevopt43url" = "$curopt43url" ] && exit 0
[ -z "$prevopt43url" ] && exit 0
}
/etc/init.d/icwmpd reload &
}
handle_icwmp_restart

View File

@@ -0,0 +1,42 @@
#!/bin/sh
log() {
echo $@ |logger -t cwmp.update -p info
}
handle_icwmp_update() {
local defwan=$(uci -q get cwmp.cpe.default_wan_interface)
local vendorspecinf=`ubus call network.interface.${defwan} status | jsonfilter -e "@.data.vendorspecinf"`
log "Handling dhcp option value ${vendorspecinf}"
[ -n "$vendorspecinf" ] && {
local url=""
local old_url=$(uci -q get cwmp.acs.dhcp_url)
case $vendorspecinf in
http://*|https://*)
url="$vendorspecinf"
;;
*)
for optval in $vendorspecinf; do
case $optval in
1=*)
url="$(echo $optval | cut -d"=" -f2-)"
;;
esac
done
;;
esac
if [ -n "$url" ]; then
log "## icwmp url[${old_url}] changed to [${url}]"
if [ -z "${old_url}" -o "${url}" != "${old_url}" ]; then
log "Restarting icwmp url[${old_url}] changed to [${url}]"
uci -q set cwmp.acs.dhcp_url="$url"
ubus call uci commit '{"config":"cwmp"}'
fi
fi
}
}
handle_icwmp_update

View File

@@ -6,125 +6,41 @@ include /lib/network
. /usr/share/libubox/jshn.sh
START=99
STOP=10
STOP=2
USE_PROCD=1
PROG="/usr/sbin/icwmpd"
EXTRA_HELP=" start [GetRPCMethods] Start icwmpd service and send GetRPCMethods"
log() {
echo "${@}"|logger -t cwmp.init -p info
}
validate_url() {
# SCHEMA_LIST: contain list of possible schemas that could be present in the acs url
# Example: SCHEMA_LIST="http https"
SCHEMA_LIST="http"
for schema in $SCHEMA_LIST; do
dest=`echo $1 | sed 's/$schema:\/\///g' | cut -f1 -d \/ | cut -f1 -d:`
if [ "_$dest" != "_" ]; then
return 0
fi
done
return 1
}
get_acs_url() {
local default_acs="http://10.10.1.6:8000/openacs/acs"
local acs_dhcp_discovery="$(uci -q get cwmp.acs.dhcp_discovery)"
local url="$(uci -q get cwmp.acs.url)"
local dhcp_url="$(uci -P /var/state -q get cwmp.acs.dhcp_url)"
if [ "$acs_dhcp_discovery" == "enable" -a -n "$dhcp_url" -o -z "$url" ]; then
url="$dhcp_url"
log "ACS URL from DHCP server: $url"
[ -n "$url" ] && uci -P /var/state -q set cwmp.acs.url="$url" || url="$default_acs"
elif [ -n "$url" ];then
url="$(uci -q get cwmp.acs.url)"
log "ACS URL from configuration: $url"
else
url="$default_acs"
log "Using default ACS URL: $url"
[ -n "$url" ] && uci -P /var/state -q set cwmp.acs.url="$url"
fi
validate_url "$url"
if [ "$?" != "0" ];then
echo "Invalid ACS URL: $url"
exit 1
fi
}
enable_dhcp_option43() {
local wan=$1
local discovery=0
case $2 in
enable|1) discovery=1 ;;
esac
local wan="${1}"
### Ask for DHCP Option 43 only if CWMP is enabled ###
local enabled
local newreqopts=
local baseopts=
local reqopts="$(uci -q get network.$wan.reqopts)"
local proto="$(uci -q get network.$wan.proto)"
local tropts="43"
local oldreqopts="$reqopts"
local ropt iopt
local newreqopts=""
local option43_present=0
for ropt in $reqopts; do
case $ropt in
43) ;;
*) baseopts="$baseopts $ropt" ;;
esac
done
ropt=""
reqopts="$baseopts $tropts"
for ropt in $reqopts; do
case $ropt in
43) [ $discovery -eq 1 ] && newreqopts="$newreqopts $ropt" ;;
*) newreqopts="$newreqopts $ropt" ;;
43) option43_present=1 ;;
*) ;;
esac
done
if [ ${option43_present} -eq 1 ]; then
return;
fi
newreqopts="$reqopts 43"
if [ $proto == "dhcp" ]; then
newreqopts="$(echo $newreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
oldreqopts="$(echo $oldreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
[ "$newreqopts" == "$oldreqopts" ] && return
uci -q set network.$wan.reqopts="$newreqopts"
uci commit network
ubus call network reload
fi
########################################################
}
wait_for_option43() {
local time=$1
local default_wan_interface dhcp_discovery url
config_get default_wan_interface cpe default_wan_interface "wan"
config_get dhcp_discovery acs dhcp_discovery "0"
config_get url acs url
enable_dhcp_option43 $default_wan_interface $dhcp_discovery
local tm=0
if [ "$dhcp_discovery" == "enable" -o "$dhcp_discovery" == "1" ]
then
log "Waiting for discovery of ACS URL from dhcp server ..."
while [ $tm -le $time ]
do
acs_url=`uci -P /var/state -q get cwmp.acs.dhcp_url`
if [ "$acs_url" != "" ]
then
break
else
sleep 1
fi
tm=$((tm+1))
done
fi
}
wait_for_resolvfile() {
@@ -141,19 +57,70 @@ wait_for_resolvfile() {
done
}
set_wan_interface() {
local l3_device=""
local default_wan_interface=""
get_default_wan_interface() {
local default_wan_interface
config_load cwmp
config_get default_wan_interface cpe default_wan_interface "wan"
json_load "$(ifstatus $default_wan_interface)"
echo ${default_wan_interface}
}
set_wan_interface() {
local wan_interface="${1}"
local l3_device=""
if [ -z "${wan_interface}" ]; then
return 0;
fi
json_load "$(ifstatus ${wan_interface})"
json_get_var l3_device l3_device
if [ "$l3_device" != "" ];then
uci -q set cwmp.cpe.interface="$l3_device"
if [ -n "$l3_device" ]; then
uci -q set cwmp.cpe.interface="${l3_device}"
uci -q commit cwmp
fi
}
copy_cwmp_etc_files_to_varstate() {
if [ ! -f /var/state/cwmp ]
then
if [ -f /etc/icwmpd/cwmp ]
then
uci -q -c /etc/icwmpd delete cwmp.acs
uci -q -c /etc/icwmpd commit cwmp
cp /etc/icwmpd/cwmp /var/state/cwmp
else
touch /var/state/cwmp
fi
fi
mkdir -p /var/state/icwmpd
if [ -f /etc/icwmpd/.icwmpd_backup_session.xml ]
then
mv /etc/icwmpd/.icwmpd_backup_session.xml /var/state/icwmpd 2>/dev/null
fi
if [ -f /etc/icwmpd/.dm_enabled_notify.xml ]
then
mv /etc/icwmpd/.dm_enabled_notify /var/state/icwmpd 2>/dev/null
fi
}
copy_cwmp_varstate_files_to_etc() {
if [ -f /var/state/cwmp ]
then
cp /var/state/cwmp /etc/icwmpd 2>/dev/null
fi
if [ -f /var/state/icwmpd/.icwmpd_backup_session.xml ]
then
cp /var/state/icwmpd/.icwmpd_backup_session.xml /etc/icwmpd 2>/dev/null
fi
if [ -f /var/state/icwmpd/.dm_enabled_notify.xml ]
then
cp /var/state/icwmpd/.dm_enabled_notify /etc/icwmpd 2>/dev/null
fi
}
validate_acs_section()
{
uci_validate_section cwmp acs "acs" \
@@ -161,14 +128,15 @@ validate_acs_section()
'periodic_inform_enable:bool' \
'periodic_inform_interval:uinteger' \
'periodic_inform_time:string' \
'url:string:http://192.168.1.1' \
'url:string' \
'dhcp_url:string' \
'dhcp_discovery:or("enable", "disable")' \
'compression:or("GZIP","Deflate","Disabled")' \
'retry_min_wait_interval:range(1, 65535)' \
'retry_interval_multiplier:range(1000, 65535)' \
'https_ssl_capath:file' \
'ipv6_enable:bool'
}
validate_cpe_section()
@@ -191,45 +159,102 @@ validate_cpe_section()
'notification:bool' \
'exec_download:bool' \
'periodic_notify_enable:bool' \
'periodic_notify_interval:uinteger'
'enable:bool' \
'periodic_notify_interval:uinteger'
}
start_service() {
validate_defaults() {
config_load cwmp
set_wan_interface
wait_for_option43 20
get_acs_url
validate_acs_section || {
log "Validation of acs section failed"
return 1;
}
[ -z "${url}" -a -z "${dhcp_url}" ] && {
log "ACS url is empty can't start"
return 1;
}
validate_cpe_section || {
log "Validation of cpe section failed"
return 1;
}
[ -z "${default_wan_interface}" ] && {
log "Wan interface is empty"
return 1;
}
return 0;
}
start_service() {
local enable_cwmp=`uci -q get cwmp.cpe.enable`
local wan_interface=$(get_default_wan_interface)
local dhcp_discovery=`uci -q get cwmp.acs.dhcp_discovery`
if [ "$enable_cwmp" = "0" -o "$enable_cwmp" = "false" ]; then
log "CWMP is not enabled"
return 0
fi
# Set wan interface if not configured
set_wan_interface "${wan_interface}"
# Set dhcp option 43 if dhcp discovery enabled
if [ "${dhcp_discovery}" == "enable" -o "${dhcp_discovery}" == "1" ]; then
enable_dhcp_option43 "${wan_interface}"
fi
[ -f /sbin/netifd ] && log "Waiting for Network to be started ..." && ubus -t 5 wait_for network.interface
[ -f /usr/sbin/dnsmasq ] && log "Waiting for DNS Proxy to be started ..." && ubus -t 5 wait_for dnsmasq
[ -f /etc/config/dhcp ] && log "Waiting for DNS Server(s) ..." && wait_for_resolvfile 20
# Copy backup data so that if it restart latter on it gets the info
copy_cwmp_etc_files_to_varstate
validate_defaults || {
log "Validation of defaults failed"
return 1;
}
procd_open_instance icwmp
procd_set_param command "$PROG"
if [ "$1" = "GetRPCMethods" ]; then
procd_append_param command -g
fi
procd_append_param command -b
procd_set_param respawn \
${respawn_threshold:-5} \
${respawn_timeout:-10} ${respawn_retry:-3}
procd_set_param watch network.interface
procd_close_instance
}
stop_service()
{
copy_cwmp_varstate_files_to_etc
}
reload_service() {
log "Restarting CWMP client"
stop
start
}
service_triggers() {
procd_add_config_trigger "config.change" "cwmp" /etc/init.d/icwmpd reload
procd_add_reload_trigger "cwmp"
procd_open_trigger
json_add_array
json_add_string "" "interface.update"
json_add_array
json_add_array
json_add_string "" "run_script"
json_add_string "" "/etc/icwmpd/update.sh"
json_close_array
json_close_array
json_add_int "" "2000"
json_close_array
procd_close_trigger
}

View File

@@ -1,54 +0,0 @@
#!/bin/sh
. /lib/functions.sh
set_cwmp_reqopts() {
### Ask for DHCP Option 43 only if CWMP is enabled ###
local wan=$(uci -q get cwmp.cpe.default_wan_interface)
local dhcp_discovery=$(uci -q get cwmp.acs.dhcp_discovery)
local discovery=0
case $dhcp_discovery in
enable|1) discovery=1 ;;
esac
local newreqopts=
local baseopts=
local reqopts="$(uci -q get network.$wan.reqopts)"
local proto="$(uci -q get network.$wan.proto)"
local tropts="43"
local oldreqopts="$reqopts"
local ropt iopt
for ropt in $reqopts; do
case $ropt in
43) ;;
*) baseopts="$baseopts $ropt" ;;
esac
done
ropt=""
reqopts="$baseopts $tropts"
for ropt in $reqopts; do
case $ropt in
43) [ $discovery -eq 1 ] && newreqopts="$newreqopts $ropt" ;;
*) newreqopts="$newreqopts $ropt" ;;
esac
done
if [ "$proto" == "dhcp" ]; then
newreqopts="$(echo $newreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
oldreqopts="$(echo $oldreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
[ "$newreqopts" == "$oldreqopts" ] && return
uci -q set network.$wan.reqopts="$newreqopts"
uci commit network
fi
}
regenerate_ssl_link(){
local cert_dir="/etc/ssl/certs"
local all_file=$(ls $cert_dir/*.pem)
for cfile in $all_file
do
ln -s $cfile $cert_dir/$(openssl x509 -hash -noout -in $cfile).0
done
}
set_cwmp_reqopts
regenerate_ssl_link

View File

@@ -0,0 +1,18 @@
#!/bin/sh
. /lib/functions.sh
regenerate_ssl_link(){
[ ! -d "/etc/ssl/certs" ] && return 0;
[ ! -f "/etc/ssl/certs/*.pem" ] && return 0;
local cert_dir="/etc/ssl/certs"
local all_file=$(ls $cert_dir/*.pem)
for cfile in $all_file
do
ln -s $cfile $cert_dir/$(openssl x509 -hash -noout -in $cfile).0
done
}
regenerate_ssl_link

View File

@@ -1 +1 @@
/etc/icwmpd/.icwmpd_backup_session.xml
/var/state/icwmpd/.icwmpd_backup_session.xml

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ieee1905
PKG_VERSION:=3.3.6
PKG_VERSION:=4.1.1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=e224f6280173aa0e190f10d38aa0ae3714667c9b
PKG_SOURCE_VERSION:=28dbe8330ba82f131771a0cfd502c41867f0ad83
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ieee1905.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
@@ -110,6 +110,7 @@ define Build/InstallDev/libieee1905
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
$(CP) $(PKG_BUILD_DIR)/src/cmdu.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/src/cmdu_ackq.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/src/1905_tlvs.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/src/i1905_wsc.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/src/bufutil.h $(1)/usr/include/
@@ -123,6 +124,11 @@ define Build/InstallDev
$(call Build/InstallDev/map-plugin,$(1),$(2))
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -r --exclude=.* ~/git/ieee1905/ $(PKG_BUILD_DIR)/
endef
endif
$(eval $(call BuildPackage,ieee1905))
$(eval $(call BuildPackage,libieee1905))

View File

@@ -1,4 +1,3 @@
CONFIG_BUILD_NLS=y
CONFIG_BUSYBOX_CUSTOM=y
CONFIG_CCACHE=y
CONFIG_DEBUG=y
@@ -26,6 +25,7 @@ CONFIG_PACKAGE_map-topology=y
CONFIG_PACKAGE_mosquitto-client-ssl=y
CONFIG_PACKAGE_mosquitto-ssl=y
CONFIG_PACKAGE_wfadatad=y
CONFIG_PACKAGE_wfadatad-collector=y
CONFIG_PACKAGE_imonitor=m
CONFIG_PACKAGE_inbd=y
CONFIG_PACKAGE_ip-full=y
@@ -189,8 +189,6 @@ CONFIG_LIBCURL_CRYPTO_AUTH=y
CONFIG_LIBCURL_OPENSSL=y
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
# CONFIG_SIGNED_PACKAGES is not set
CONFIG_KERNEL_DEVTMPFS=y
CONFIG_KERNEL_DEVTMPFS_MOUNT=y
# CONFIG_BUSYBOX_CONFIG_IP is not set
CONFIG_LOCALMIRROR="https://download.iopsys.eu/iopsys/mirror/"
@@ -219,3 +217,7 @@ CONFIG_TARGET_ROOTFS_TARGZ=y
# Disable it. Most SoCs nowadays has HW random generators anyway.
# CONFIG_PACKAGE_urandom-seed is not set
# CONFIG_PACKAGE_urngd is not set
# We use OpenSSL, no need to ship multiple TLS libraries
CONFIG_PACKAGE_libustream-openssl=y
# CONFIG_PACKAGE_libustream-wolfssl is not set

View File

@@ -14,7 +14,7 @@ function feeds_update {
done
git remote -v | grep -q http || developer=1
git remote -v | grep -qE '(git@|ssh://)' && developer=1
cp .config .genconfig_config_bak

View File

@@ -5,7 +5,6 @@ function genconfig {
export IMPORT=1
export SRCTREEOVERR=0
export FILEDIR="files/"
export THEMEDIR="tmp/juci-themes"
CURRENT_CONFIG_FILE=".current_config_file"
export CONFIGPATH="package/feeds/iopsys/iop"
CUSTPATH="customerconfigs"
@@ -238,7 +237,7 @@ function genconfig {
local ALL="$1"
local CUSTOMER="$2"
if [ "$CUSTOMER" -a -d "$CUSTCONF/$CUSTOMER" ]; then
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common | grep -v juci-theme)"
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common)"
if [ "$boards" ]; then
echo "$CUSTOMER has following boards:"
for board in $boards; do
@@ -255,7 +254,7 @@ function genconfig {
if [ "$customers" -a "$ALL" == 1 ]; then
for customer in $customers; do
echo $customer
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common | grep -v juci-theme)"
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common)"
if [ "$boards" ]; then
for board in $boards; do
echo -e "\t$board"
@@ -309,13 +308,6 @@ function genconfig {
v "rm -rf $FILEDIR*"
rm -rf $FILEDIR*
fi
if [ ! -d "$THEMEDIR" ]; then
mkdir -p $THEMEDIR
elif [ -d "$THEMEDIR" -a $CLEAN -eq 1 ]; then
v "rm -rf $THEMEDIR/*"
rm -rf $THEMEDIR/*
fi
}
create_and_copy_files()
@@ -404,11 +396,6 @@ function genconfig {
v "cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR"
cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR
fi
if [ -d "$CUSTCONF/$CUSTOMER/juci-theme" ]; then
customer="$(echo $CUSTOMER | tr 'A-Z' 'a-z')"
v "cp -ar $CUSTCONF/$CUSTOMER/juci-theme $THEMEDIR/juci-theme-$customer"
cp -ar $CUSTCONF/$CUSTOMER/juci-theme $THEMEDIR/juci-theme-$customer
fi
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
@@ -424,8 +411,11 @@ function genconfig {
# Set target version
local GIT_TAG=$(git describe --abbrev=0 --tags)
echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
echo "CONFIG_VERSION_CODE=\"${GIT_TAG}\"" >> .config
local GIT_REV=$(git rev-parse --short HEAD)
local GIT_VER="$GIT_TAG"
git describe --contains $GIT_REV >/dev/null 2>&1 || GIT_VER="${GIT_TAG}_${GIT_REV}"
echo "CONFIG_TARGET_VERSION=\"${GIT_VER}\"" >> .config
echo "CONFIG_VERSION_CODE=\"${GIT_VER}\"" >> .config
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
# Enable Package source tree override if selected

View File

@@ -404,11 +404,13 @@ function genconfig_min {
# Set target version
local GIT_TAG=$(git describe --abbrev=0 --tags)
echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
echo "CONFIG_VERSION_CODE=\"${GIT_TAG}\"" >> .config
local GIT_REV=$(git rev-parse --short HEAD)
local GIT_VER="$GIT_TAG"
git describe --contains $GIT_REV >/dev/null 2>&1 || GIT_VER="${GIT_TAG}_${GIT_REV}"
echo "CONFIG_TARGET_VERSION=\"${GIT_VER}\"" >> .config
echo "CONFIG_VERSION_CODE=\"${GIT_VER}\"" >> .config
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
# Enable Package source tree override if selected
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config

View File

@@ -1,122 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=juci
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/juci.git
PKG_SOURCE_VERSION:=70b66bfc7f0e25e77b6920c3d44e5b05f4bfcf95
PKG_VERSION:=2020-05-27
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_RELEASE=$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/juci
$(Package/juci/default)
SECTION:=juci
CATEGORY:=JUCI
MENU=1
TITLE:=JUCI Core Package (select this to select default plugins)
DEPENDS:=+libubox +libubus +owsd +rpcd +rpcd-mod-file +questd
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/src/
ln -s $(PKG_BUILD_DIR) $(1)/usr/src/juci
endef
define Build/Compile
$(call Build/Compile/Default,THEME_PATH="$(TOPDIR)/tmp/juci-themes/")
endef
define Package/juci/description
JUCI Javascript UCI Web interface.
endef
define Package/juci/install
$(INSTALL_DIR) $(1)/
$(CP) $(PKG_BUILD_DIR)/bin/juci/* $(1)/
$(CP) ./files/* $(1)/
endef
define Package/juci/postinst
#!/bin/sh
juci-update
exit 0
endef
$(eval $(call BuildPackage,juci))
####### Extensions / Themes and Plugins
define RegisterAddonInner
define Package/$(2)
SECTION:=juci
CATEGORY:=JUCI
TITLE:=default
SUBMENU:=$(1)
TITLE:=$(if $(3),$(3),JUCI $(2) plugin)
DEPENDS:=$(4)
endef
define Package/$(2)/install
$(INSTALL_DIR) $$(1)/
$(CP) $(PKG_BUILD_DIR)/bin/$(2)/* $$(1)/
endef
endef
define RegisterAddon
$(eval $(call RegisterAddonInner,$(1),$(2),$(3),$(4),$(5)))
$(eval $(call BuildPackage,$(2)))
endef
$(eval $(call RegisterAddon,Plugins,juci-catv, CATV Module,@(PACKAGE_catv)))
$(eval $(call RegisterAddon,Plugins,juci-cgroups, CGroups Module,@(PACKAGE_icgroupd)))
$(eval $(call RegisterAddon,Plugins,juci-ddns, DDNS Configuration,@(PACKAGE_ddns-scripts)))
$(eval $(call RegisterAddon,Plugins,juci-diagnostics, Simple Diagnostics,@(PACKAGE_busybox)))
$(eval $(call RegisterAddon,Plugins,juci-ndt, NDT Speed Test client,@(PACKAGE_ndt)))
$(eval $(call RegisterAddon,Plugins,juci-dnsmasq-dhcp, DHCP/DNSMasq Configuration,@(PACKAGE_dnsmasq||PACKAGE_dnsmasq-full)))
$(eval $(call RegisterAddon,Plugins,juci-dropbear, Dropbear Configuration,@(PACKAGE_dropbear)))
$(eval $(call RegisterAddon,Plugins,juci-easyqos, Easy QoS module,@(PACKAGE_easy-qos)))
$(eval $(call RegisterAddon,Plugins,juci-event, Event Module,@(PACKAGE_owsd)))
$(eval $(call RegisterAddon,Plugins,juci-firewall-fw3, Firewall Configuration,@(PACKAGE_firewall)))
$(eval $(call RegisterAddon,Plugins,juci-icwmp, TR-069 Module,@(PACKAGE_icwmp)))
$(eval $(call RegisterAddon,Plugins,juci-config-backup, Config Backup Module))
$(eval $(call RegisterAddon,Plugins,juci-qos, QoS module,@(PACKAGE_qos-scripts)))
$(eval $(call RegisterAddon,Plugins,juci-voice-client, Asterisk Voice Client Module,@(PACKAGE_asterisk)))
$(eval $(call RegisterAddon,Plugins,juci-minidlna, MiniDLNA Configuration,@(PACKAGE_minidlna)))
$(eval $(call RegisterAddon,Plugins,juci-mcproxy, Multicast Proxy Configuration,@(PACKAGE_mcproxy)))
$(eval $(call RegisterAddon,Plugins,juci-mod-status, Status Reporting Module,@(PACKAGE_questd)))
$(eval $(call RegisterAddon,Plugins,juci-mod-system, System Administration Module))
$(eval $(call RegisterAddon,Plugins,juci-mwan3, mwan3 Configuration,@(PACKAGE_mwan3)))
$(eval $(call RegisterAddon,Plugins,juci-natalie-dect, DECT Module,@(PACKAGE_dectmngr2)))
$(eval $(call RegisterAddon,Plugins,juci-netmode, Netmode Module,@(PACKAGE_netmode)))
$(eval $(call RegisterAddon,Plugins,juci-network-device, Network Device Configuration,@(PACKAGE_netifd)))
$(eval $(call RegisterAddon,Plugins,juci-network-dsl, DSL Module))
$(eval $(call RegisterAddon,Plugins,juci-network-netifd, Network Module,@(PACKAGE_netifd)))
$(eval $(call RegisterAddon,Plugins,juci-network-port, Ethernet Port Configuration,@(PACKAGE_port-management)))
$(eval $(call RegisterAddon,Plugins,juci-openvpn, OpenVPN configuration,@(PACKAGE_openvpn)))
$(eval $(call RegisterAddon,Plugins,juci-owsd, OWSD configuration,@(PACKAGE_owsd)))
$(eval $(call RegisterAddon,Plugins,juci-printer, p910nd Printer Server Configuration,@(PACKAGE_p910nd)))
#$(eval $(call RegisterAddon,Plugins,juci-realtime-graphs, Realtime Graphs))
$(eval $(call RegisterAddon,Plugins,juci-samba, Samba Configuration,@(PACKAGE_samba3)))
$(eval $(call RegisterAddon,Plugins,juci-sfp, SFP Configuration,@(PACKAGE_peripheral_manager)))
$(eval $(call RegisterAddon,Plugins,juci-snmpd, SNMP Module,@(PACKAGE_snmpd)))
$(eval $(call RegisterAddon,Plugins,juci-sysupgrade, Sysupgrade Firmware Upgrade,@(PACKAGE_rpcd-mod-rpcsys)))
$(eval $(call RegisterAddon,Plugins,juci-uhttpd, uHTTPD Configuration,@(PACKAGE_uhttpd)))
$(eval $(call RegisterAddon,Plugins,juci-upnp, UPnP Configuration Module,@(PACKAGE_miniupnpd)))
#$(eval $(call RegisterAddon,Plugins,juci-usb, USB Module))
$(eval $(call RegisterAddon,Plugins,juci-wireless, Wireless Management Module))
$(eval $(call RegisterAddon,Plugins,juci-wifilife, WiFi Life Module,@(PACKAGE_wifilife)))
$(eval $(call RegisterAddon,Themes,juci-theme-iopsys))
####### dynamically publish themes as packages #######
$(foreach th,$(wildcard $(TOPDIR)/tmp/juci-themes/*),$(eval $(call RegisterAddon,Themes,$(notdir $(th)))))

View File

@@ -1,66 +0,0 @@
config juci 'juci'
option homepage 'overview'
option theme 'juci-theme-iopsys'
option favicon 'favicon.ico'
config login 'login'
option showusername '1'
option defaultuser 'user'
config localization 'localization'
option default_language 'en'
list languages 'en'
config wiki 'wiki'
option visible '0'
option version 'v4.2.x'
config widget
list name 'overviewWidget11WAN'
list require 'ubus:network.interface'
config widget
list name 'overviewWidget10Network'
list require 'ubus:network.interface'
list require 'ubus:router.network->hosts'
config widget
list name 'overviewWidget00WiFi'
list require 'ubus:wifi'
list require 'ubus:wifi.wps'
config menu
option path 'overview'
option page 'overview'
config menu
option path 'system'
option page 'system'
option redirect 'first'
config menu
option path 'status'
option page 'status'
option redirect 'first'
config menu
option path 'status/system'
option page 'status-system'
list require 'ubus:router.system->info'
config menu
option path 'status/network'
option page 'status-network'
list require 'ubus:network.interface'
config menu
option path 'status/dsl'
option page 'network-dsl-status'
list require 'ubus:dsl->stats'
list require 'ubus:dsl->status'
config menu
option path 'system/upgrade'
option page 'settings-upgrade'
list expose 'admin'

View File

@@ -1,41 +0,0 @@
#!/bin/sh /etc/rc.common
. /lib/functions.sh
START=94
STOP=06
USE_PROCD=1
NAME=juci
start_service() {
mkdir -p /tmp/juci
touch /www/index.html.gz
chmod 755 /www/cgi-bin/luci
# this will simply update index.html to include any files that are for some reason not included
# a good way to make sure all plugins are properly included at each boot
config_load juci
local theme
config_get theme juci theme
if [ "$theme" ]
then
if [ -f /www/themes/theme.js.gz ]
then
rm -f /www/themes/theme.js.gz
fi
if [ -f /www/themes/*$theme.js.gz ]
then
ln -s /www/themes/*$theme.js.gz /www/themes/theme.js.gz
fi
fi
juci-update
}
stop() {
service_stop /sbin/juci
}
service_triggers()
{
procd_add_reload_trigger juci
}

View File

@@ -1,49 +0,0 @@
#!/bin/sh
. /lib/functions.sh
USER_SECTION=""
USER_EXISTS=0
find_user(){
local section="$1"
local user="$2"
config_get username $section username
if [ "$username" == "$user" ]; then
USER_SECTION="$section"
USER_EXISTS=1
fi
}
config_load rpcd
USER_EXISTS=0
config_foreach find_user login root
if [ $USER_EXISTS -eq 1 ]; then
uci delete rpcd.$USER_SECTION
fi
USER_EXISTS=0
config_foreach find_user login admin
if [ $USER_EXISTS -eq 0 ]; then
uci -q add rpcd login >/dev/null
uci -q set rpcd.@login[-1].username="admin"
uci -q set rpcd.@login[-1].password="\$p\$admin"
uci -q add_list rpcd.@login[-1].read="enduser"
uci -q add_list rpcd.@login[-1].read="administrator"
uci -q add_list rpcd.@login[-1].write="enduser"
uci -q add_list rpcd.@login[-1].write="administrator"
fi
USER_EXISTS=0
config_foreach find_user login user
if [ $USER_EXISTS -eq 0 ]; then
uci -q add rpcd login >/dev/null
uci -q set rpcd.@login[-1].username="user"
uci -q set rpcd.@login[-1].password="\$p\$user"
uci -q add_list rpcd.@login[-1].read="enduser"
uci -q add_list rpcd.@login[-1].write="enduser"
fi
uci commit rpcd

View File

@@ -1,21 +0,0 @@
{
"administrator": {
"description": "Administrator Access Rights",
"read": {
"ubus": {
"file": [
"write"
],
"rpc-sys": [
"upgrade_start",
"upgrade_test"
]
}
},
"write": {
"file": {
"/tmp/firmware.bin": ["write"]
}
}
}
}

View File

@@ -1,217 +0,0 @@
{
"enduser": {
"description": "End User Access Rights",
"read": {
"ubus": {
"dect": [
"state",
"handset",
"status",
"call"
],
"dsl": [
"status",
"stats"
],
"network.device": [
"status"
],
"network.interface*": [
"status",
"dump",
"up",
"down"
],
"router.network": [
"clients",
"hosts",
"dump"
],
"router.system": [
"info",
"memory",
"filesystem",
"process",
"processes"
],
"session": [
"access",
"list",
"destroy",
"login"
],
"system": [
"info",
"board",
"reboot"
],
"testnet": [
"status"
],
"uci": [
"*"
],
"voice.asterisk": [
"status",
"call_log",
"platform",
"supported_countries"
],
"wifi": [
"status"
],
"wifi.ap.*": [
"status",
"stats",
"assoclist",
"stations"
],
"wifi.radio.*": [
"status",
"stats",
"scan",
"scanresults",
"autochannel"
],
"wifi.wps": [
"start",
"stop",
"status",
"showpin"
]
},
"uci": [
"dhcp",
"firewall",
"juci",
"network",
"voice_client",
"wireless"
],
"owsd": [
"client",
"wifi.radio",
"wifi.sta",
"wifi.wps"
]
},
"write": {
"uci": [
"dhcp",
"firewall",
"network",
"wireless"
],
"uci_granular": {
"dhcp": [
{
"match": {
".type": "dhcp"
},
"option": [
"*"
]
},
{
"match": {
".type": "host"
},
"option": [
"*"
]
}
],
"firewall": [
{
"match": {
".type": "settings",
".name": "settings"
},
"option": [
"disabled"
]
},
{
"match": {
".type": "zone"
},
"option": [
"masq",
"name",
"network"
]
},
{
"match": {
".type": "redirect"
},
"option": [
"*"
]
},
{
"match": {
".type": "rule"
},
"option": [
"*"
]
},
{
"match": {
".type": "dmz"
},
"option": [
"enabled",
"host",
"ip6addr"
]
}
],
"network": [
{
"match": {
".type": "interface"
},
"option": [
"*"
]
}
],
"wireless": [
{
"match": {
".type": "wifi-status"
},
"option": [
"wps"
]
},
{
"match": {
".type": "wifi-iface",
"mode": "ap"
},
"option": [
"*"
]
},
{
"match": {
".type": "wifi-device"
},
"option": [
"channel"
]
}
]
},
"owsd": [
"client",
"wifi.radio",
"wifi.sta",
"wifi.wps"
]
}
}
}

View File

@@ -5,18 +5,21 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-agent
PKG_VERSION:=5.2.2
PKG_VERSION:=6.3.2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=621236484f923cbfbecb8608b86aa1e585f935fe
PKG_SOURCE_VERSION:=39193fccea6493c57d169611d8f21256753f7a3b
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_LICENSE:=PROPRIETARY IOPSYS
PKG_LICENSE_FILES:=LICENSE
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/map-agent.git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-agent
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
endif
PKG_BUILD_DEPENDS:=map-plugin
@@ -30,10 +33,24 @@ define Package/map-agent
+map-plugin
endef
define Package/dynbhd
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Dynamic Backhaul Daemon
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
+map-plugin +map-agent
endef
define Package/map-agent/description
This package implements EasyMesh R2 compliant WiFi Agent.
endef
define Package/dynbhd/description
Dyanmic LAN/WAN port detection and loop avoidance.
endef
define Package/map-agent/config
#source "$(SOURCE)/Config.in"
endef
@@ -53,4 +70,21 @@ define Package/map-agent/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mapagent $(1)/usr/sbin/
endef
define Package/dynbhd/install
$(INSTALL_DIR) $(1)/etc
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/lib/wifi/dynbhd
$(INSTALL_DIR) $(1)/etc/hotplug.d/ethernet
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dynbh/dynbhd $(1)/usr/sbin/dynbhd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dynbh/api $(1)/lib/wifi/dynbhd/api
# $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dynbh/map-dynamic-backhaul $(1)/etc/hotplug.d/ethernet/map-dynamic-backhaul
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -r --exclude=.* ~/git/map-agent/ $(PKG_BUILD_DIR)/
endef
endif
$(eval $(call BuildPackage,map-agent))
$(eval $(call BuildPackage,dynbhd))

View File

@@ -4,7 +4,7 @@ config agent 'agent'
option profile '2'
option al_bridge 'br-lan'
#config fh-iface
#config ap
# option ifname 'wl0'
# option steer 'rssi bssload'
# list exclude '00:11:22:33:44:55'
@@ -18,7 +18,7 @@ config agent 'agent'
# option assoc_ctrl_secs '30'
# option band '2'
#config fh-iface
#config ap
# option ifname 'wl1'
# option steer 'rssi bssload'
# list exclude '00:11:22:33:44:55'

View File

@@ -0,0 +1,45 @@
#!/bin/sh
wan=$(db -q get hw.board.ethernetWanPort)
[ -z "$wan" ] && exit 1 # no configuration
[ "$PORT" != "$wan" ] && exit 0
remove_from_bridge() {
config_get ifname "$section" ifname
ubus call network.interface.$bridge remove_device '{"name":"$ifname"}'
}
update_bstas() {
local section="$1"
local action="$2"
local ifname onboarded
config_get ifname "$section" ifname
config_get_bool enabled "$section" enabled 0
if [ "$action" = "down" ]; then
wpa_cli -i "$ifname" disconnect > /dev/null 2>&1
wpa_cli -i "$ifname" disable_network 0 > /dev/null 2>&1
# wpa_cli -i "$ifname" save_config > /dev/null 2>&1
elif [ "$action" = "up" ]; then
[ "$enabled" -eq 0 ] && return
wpa_cli -i "$ifname" reconnect > /dev/null 2>&1
wpa_cli -i "$ifname" enable_network 0 > /dev/null 2>&1
# wpa_cli -i "$ifname" save_config > /dev/null 2>&1
fi
}
if [ "$LINK" = "up" ]; then
touch /tmp/map.agent.bsta_global_disable
config_load "mapagent"
bridge=$(uci get mapagent.agent.al_bridge | cut -d '-' -f2)
config_foreach remove_from_bridge bsta $bridge
config_foreach update_bstas bsta down
else
rm -f /tmp/map.agent.bsta_global_disable
config_load "mapagent"
config_foreach update_bstas bsta up
fi

View File

@@ -1,29 +0,0 @@
#!/bin/sh
wan=$(db -q get hw.board.ethernetWanPort)
[ -z "$wan" ] && exit 1 # no configuration
[ "$PORT" != "$wan" ] && exit 0
update_bstas() {
local section="$1"
local action="$2"
local ifname onboarded
config_get ifname "$section" ifname
config_get_bool onboarded "$section" onboarded 0
[ "$onboarded" -eq 0 ] && return
wpa_cli -i "$ifname" "$action" > /dev/null 2>&1
}
if [ "$LINK" = "up" ]; then
touch /tmp/map.agent.bsta_global_disable
config_load "mapagent"
config_foreach update_bstas bk-iface disconnect
else
rm -f /tmp/map.agent.bsta_global_disable
config_load "mapagent"
config_foreach update_bstas bk-iface reconnect
fi

View File

@@ -5,7 +5,60 @@ STOP=20
USE_PROCD=1
MAP_DEV="map_dev"
MAP_IF="map"
MAP_VETH="lei"
create_map() {
uci -q set network.${MAP_DEV}=device
uci -q set network.${MAP_DEV}.name=br-map
uci -q set network.${MAP_DEV}.type=bridge
uci -q set network.${MAP_DEV}.bridge_empty=1
uci -q set network.${MAP_IF}=interface
uci -q set network.${MAP_IF}.device=br-map
uci -q set network.${MAP_IF}.is_lan=1
uci -q set mapagent.agent.al_bridge=br-map
uci -q commit
ubus call network reload
ubus -t 5 wait_for network.device
ip link add ${MAP_VETH} type veth peer name ${MAP_VETH}_lan 2>/dev/null
brctl addif br-map ${MAP_VETH} 2>/dev/null
brctl addif br-lan ${MAP_VETH}_lan 2>/dev/null
ip link set ${MAP_VETH} up 2>/dev/null
ip link set ${MAP_VETH}_lan up 2>/dev/null
}
remove_map() {
ip link delete ${MAP_VETH} &>/dev/null
uci -q delete network.${MAP_DEV}
uci -q delete network.${MAP_IF}
uci -q set mapagent.agent.al_bridge=br-lan
uci -q commit
ubus call network reload
}
start_dynbhd_service() {
rm -f /tmp/map.agent.bsta_global_disable
procd_open_instance
procd_set_param command "/usr/sbin/dynbhd"
procd_set_param respawn
# procd_set_param stdout 1
# procd_set_param stderr 1
procd_close_instance
}
start_service() {
[ -f /usr/sbin/dynbhd ] && start_dynbhd_service
config_load "mapagent"
ubus -t 5 wait_for wifi
@@ -16,6 +69,10 @@ start_service() {
config_get_bool enabled agent enabled 1
[ "$enabled" -eq 0 ] && return 1
local ts
config_get_bool ts agent vlan_segregation 0
[ "$ts" -eq 1 ] && create_map #|| remove_map
procd_open_instance
procd_set_param command "/usr/sbin/mapagent" "-d"
procd_set_param respawn
@@ -24,9 +81,13 @@ start_service() {
procd_close_instance
}
#stop_service() {
# remove_map
#}
service_triggers()
{
procd_add_reload_trigger "ieee1905"
procd_add_reload_trigger "mapagent"
}
reload_service() {

View File

@@ -7,6 +7,8 @@
# write_credentials - write bBSS credentials to fBSS
. /lib/functions.sh
. /usr/share/libubox/jshn.sh
. /lib/wifi/traffic_separation
diff=0
@@ -23,12 +25,41 @@ EOF
exit 1
}
type_to_multi_ap () {
type="$1"
if [ "$type" = "backhaul" ]; then
echo "1"
return
elif [ "$type" = "fronthaul" ]; then
echo "2"
return
elif [ "$type" = "combined" ]; then
echo "3"
return
fi
echo "0"
}
get_type_by_section() {
section="$1"
config_get type $section type "0"
echo "$(type_to_multi_ap $type)"
}
brcm_sync_credentials() {
bands=""
mapagent_process_fh() {
local section=$1
local dev=$2
multi_ap=$(get_type_by_section $section)
[ "$multi_ap" == "0" ] && return
config_get device $section device
[ "$dev" != "$device" ] && return
@@ -41,10 +72,10 @@ brcm_sync_credentials() {
section=$(uci add ieee1905 ap)
[ "$section" == "" ] && return
uci set ieee1905.${section}.band=$band
uci set ieee1905.${section}.ssid=$ssid
uci set ieee1905.${section}.encryption=$encryption
uci set ieee1905.${section}.key=$key
uci -q set ieee1905.${section}.band=$band
uci -q set ieee1905.${section}.ssid="$ssid"
uci -q set ieee1905.${section}.encryption=$encryption
uci -q set ieee1905.${section}.key="$key"
}
mapagent_process_radio() {
@@ -62,7 +93,7 @@ brcm_sync_credentials() {
fi
done
config_foreach mapagent_process_fh fh-iface $device
config_foreach mapagent_process_fh ap $device
bands="$bands $band"
}
@@ -76,7 +107,7 @@ brcm_sync_credentials() {
config_foreach ieee1905_del_ap ap
config_load mapagent
config_foreach mapagent_process_radio wifi-radio
config_foreach mapagent_process_radio radio
uci commit ieee1905
}
@@ -89,8 +120,8 @@ brcm_write_credentials() {
write_wireless() {
local section=$1
local map_ifname=$2
local bk_ssid=$3
local bk_key=$4
local bk_ssid="$3"
local bk_key="$4"
config_get ifname $section ifname
@@ -98,24 +129,26 @@ brcm_write_credentials() {
[ "$ifname" != "$map_ifname" ] && return
#echo applying bk_ssid = $bk_ssid bk_key = $bk_key
#echo applying bk_ssid = "$bk_ssid" bk_key = "$bk_key"
uci -q set wireless.${section}.multi_ap_backhaul_ssid="$bk_ssid"
uci -q set wireless.${section}.multi_ap_backhaul_key="$bk_key"
}
config_load wireless
config_foreach write_wireless wifi-iface $1 $2 $3
config_foreach write_wireless wifi-iface "$1" "$2" "$3"
}
mapagent_find_fbss() {
local section=$1
local dev=$2
local bk_ssid=$3
local bk_key=$4
local bk_ssid="$3"
local bk_key="$4"
multi_ap=$(get_type_by_section $section)
[ "$multi_ap" == "0" ] && return
config_get device $section device
config_get multi_ap $section multi_ap "0"
#echo found dev=$dev device=$device map=$multi_ap
@@ -124,18 +157,20 @@ brcm_write_credentials() {
config_get ifname $section ifname
#echo applying bk_ssid = $bk_ssid bk_key = $bk_key
#echo applying bk_ssid = "$bk_ssid" bk_key = "$bk_key"
# subshell in hopes to maintain mapagent config loaded
$(mapagent_apply_wireless $ifname $bk_ssid $bk_key)
echo $(mapagent_apply_wireless $ifname "$bk_ssid" "$bk_key") 2> /dev/null
}
mapagent_find_bbss() {
local section=$1
local dev=$2
multi_ap=$(get_type_by_section $section)
[ "$multi_ap" == "0" ] && return
config_get device $section device
config_get multi_ap $section multi_ap "0"
config_get enabled $section enabled "1"
#echo found dev=$dev device=$device map=$multi_ap
@@ -147,9 +182,9 @@ brcm_write_credentials() {
config_get ssid $1 ssid
config_get key $1 key
#echo found ssid=$ssid key=$key
#echo found ssid="$ssid" key="$key"
config_foreach mapagent_find_fbss fh-iface $dev $ssid $key
config_foreach mapagent_find_fbss ap $dev "$ssid" "$key"
}
mapagent_process_radio() {
@@ -159,11 +194,11 @@ brcm_write_credentials() {
#echo found dev=$dev
config_foreach mapagent_find_bbss fh-iface $device
config_foreach mapagent_find_bbss ap $device
}
config_foreach mapagent_process_radio wifi-radio
config_foreach mapagent_process_radio radio
uci commit wireless
}
@@ -210,7 +245,7 @@ write_bsta_config() {
[ "$bsta" == "$ifname" ] || return
#echo setting diff = $diff > /dev/console
uci set wireless.${section}.bssid=$bssid
uci -q set wireless.${section}.bssid=$bssid
echo 1
}
config_load wireless
@@ -235,7 +270,7 @@ write_bsta_config() {
}
config_foreach mapagent_process_bk bk-iface $ifname
config_foreach mapagent_process_bk bsta $ifname
#echo result diff = $diff > /dev/console
[ "$diff" == "1" ] && {
@@ -275,6 +310,9 @@ brcm_teardown_iface() {
local section=$1
local iface=$2
multi_ap=$(get_type_by_section $section)
[ "$multi_ap" == "0" ] && return
config_get ifname $section ifname
[ "$iface" != "$ifname" ] && return
@@ -289,13 +327,12 @@ brcm_teardown_iface() {
}
config_foreach mapagent_teardown_bss fh-iface $iface
config_foreach mapagent_teardown_bss ap $iface
uci commit wireless
uci commit mapagent
}
brcm_bsta_to_wireless() {
config_load mapagent
@@ -315,12 +352,12 @@ brcm_bsta_to_wireless() {
local sec=""
local prio="-1"
config_foreach mapagent_process_bk bk-iface
config_foreach mapagent_process_bk bsta
echo $sec
}
mapagent_enable_best() {
echo 1=$1 best=$best > /dev/console
#echo 1=$1 best=$best > /dev/console
if [ "$1" = "$best" ]; then
uci -q set mapagent.$1.enabled='1'
else
@@ -333,10 +370,11 @@ brcm_bsta_to_wireless() {
apply_config() {
local section=$1
local bsta=$2
local ssid=$3
local key=$4
local ssid="$3"
local key="$4"
local encryption=$5
local enabled=$6
local bssid=$7
local disabled="0"
config_get ifname $section ifname
@@ -345,10 +383,17 @@ brcm_bsta_to_wireless() {
[ "$bsta" == "$ifname" ] || return
uci set wireless.${section}.ssid=$ssid
uci set wireless.${section}.key=$key
uci set wireless.${section}.encryption=$encryption
uci set wireless.${section}.disabled=$disabled
uci -q set wireless.${section}.ssid="$ssid"
uci -q set wireless.${section}.key="$key"
uci -q set wireless.${section}.encryption=$encryption
uci -q set wireless.${section}.bssid="$bssid"
#uci -q set wireless.${section}.disabled=$disabled
[ "$disabled" != "1" ] && return
wpa_cli -i "$bsta" disconnect > /dev/null 2>&1
wpa_cli -i "$bsta" disable_network 0 > /dev/null 2>&1
wpa_cli -i "$bsta" save_config > /dev/null 2>&1
echo 1
}
@@ -359,8 +404,7 @@ brcm_bsta_to_wireless() {
}
mapagent_find_other_creds() {
echo "trying to find other creds for $2" > /dev/console
#echo "trying to find other creds for $2" > /dev/console
config_get band $1 band
config_get onboarded $1 onboarded "0"
@@ -370,8 +414,9 @@ brcm_bsta_to_wireless() {
config_get key $1 key
config_get encryption $1 encryption
config_get enabled $1 enabled "0"
config_get bssid $1 bssid
echo "$(mapagent_apply_wl_bsta $2 $ssid $key $encryption $4)"
echo $(mapagent_apply_wl_bsta $2 "$ssid" "$key" $encryption $4 "$bssid")
}
config_get band $1 band
@@ -380,35 +425,252 @@ brcm_bsta_to_wireless() {
config_get enabled $1 enabled "0"
if [ "$onboarded" = "0" ]; then
config_foreach mapagent_find_other_creds bk-iface $ifname $band $enabled
config_foreach mapagent_find_other_creds bsta $ifname $band $enabled
else
config_get ssid $1 ssid
config_get key $1 key
config_get encryption $1 encryption
config_get bssid $1 bssid
echo "$(mapagent_apply_wl_bsta $ifname $ssid $key $encryption $enabled)"
echo $(mapagent_apply_wl_bsta $ifname "$ssid" "$key" $encryption $enabled "$bssid")
fi
}
best=$(mapagent_find_lowest_prio_onboarded)
[ -z "$best" ] && return
band=$1
sec=""
prio=""
config_foreach mapagent_enable_best bk-iface $best
uci commit mapagent
# best=$(mapagent_find_lowest_prio_onboarded)
#
# [ -z "$best" ] && return
#
# band=$1
# sec=""
# prio=""
#
# config_foreach mapagent_enable_best bsta $best
# uci commit mapagent
config_load mapagent
diff=$(config_foreach mapagent_bsta_to_wireless bk-iface)
diff=$(config_foreach mapagent_bsta_to_wireless bsta)
[ "$diff" != "" ] && {
# [ "$diff" != "" ] && {
ubus call uci commit '{"config":"wireless"}'
# }
}
sync_mapcontroller_from_wireless() {
ubus -t 5 wait_for wifi
[ "$?" != "0" ] && return
[ ! -f "/etc/config/wireless" ] && return
status=$(ubus -S call wifi status)
device_to_band() {
local ifname=$1
json_load "$status"
json_select "radios"
json_get_keys keys
for key in $keys; do
json_select $key
json_get_var name name
if [ "$name" != "$ifname" ]; then
json_select ..
continue
fi
json_get_var band band
if [ "$band" == "5GHz" ]; then
echo "5"
elif [ "$band" == "2.4GHz" ]; then
echo "2"
fi
break
done
json_cleanup
}
wireless_process_iface() {
local section=$1
local type="ap"
local enabled="1"
config_get multi_ap $section multi_ap 0
[ "$multi_ap" != "1" ] && [ "$multi_ap" != "2" ] && return
config_get mode $section mode "ap"
[ "$mode" != "ap" ] && return
config_get device $section device
band=$(device_to_band $device)
[ "$band" == "" ] && return
config_get ssid $section ssid
config_get key $section key
config_get encryption $section encryption
config_get start_disabled $section start_disabled "0"
config_get network $section network
cntlr_section=$(uci add mapcontroller ${type})
uci -q set mapcontroller.${cntlr_section}.ssid="$ssid"
uci -q set mapcontroller.${cntlr_section}.key="$key"
uci -q set mapcontroller.${cntlr_section}.encryption="$encryption"
uci -q set mapcontroller.${cntlr_section}.band="$band"
uci -q set mapcontroller.${cntlr_section}.vid="1"
uci -q set mapcontroller.${cntlr_section}.network="$network"
[ "$multi_ap" == "1" ] && map_type="backhaul" || map_type="fronthaul"
uci -q set mapcontroller.${cntlr_section}.type="$map_type"
[ "$start_disabled" == "1" ] && enabled="0"
uci -q set mapcontroller.${cntlr_section}.enabled="$enabled"
}
mapcontroller_teardown() {
local section=$1
uci delete mapcontroller.$1
}
config_load mapcontroller
config_foreach mapcontroller_teardown ap
config_load wireless
config_foreach wireless_process_iface wifi-iface
uci commit mapcontroller
}
bsta_scan_on_enabled() {
config_load mapagent
mapagent_enable_bk() {
config_get ifname $1 ifname
config_get enabled $1 enabled
echo ifname $ifname enabled $enabled
[ "$enabled" = "0" ] && return
wpa_cli -i "$ifname" enable_network 0 > /dev/null 2>&1
wpa_cli -i "$ifname" reconnect > /dev/null 2>&1
wpa_cli -i "$ifname" save_config > /dev/null 2>&1
}
config_foreach mapagent_enable_bk bsta
}
bsta_enable_all() {
mapagent_enable_bk() {
config_get ifname $1 ifname "2"
uci -q set mapagent.$1.enabled="1"
}
config_load mapagent
config_foreach mapagent_enable_bk bsta
uci commit mapagent
bsta_scan_on_enabled
}
bsta_disable_lower_priority() {
config_load mapagent
mapagent_get_priority() {
config_get ifname $1 ifname
[ "$ifname" != "$2" ] && return
config_get priority $1 priority "2"
echo "$priority"
}
mapagent_disable_lower_bk() {
mapagent_apply_wl_bsta() {
apply_config() {
local section="$1"
local bsta="$2"
local enabled="$3"
config_get ifname $section ifname
[ "$bsta" == "$ifname" ] || return
[ "$enabled" != "0" ] && return
wpa_cli -i "$ifname" disconnect > /dev/null 2>&1
wpa_cli -i "$ifname" disable_network 0 > /dev/null 2>&1
wpa_cli -i "$ifname" save_config > /dev/null 2>&1
}
local ifname="$1"
local enabled="$2"
[ "$enabled" != "0" ] && return
config_load wireless
config_foreach apply_config wifi-iface $ifname $enabled
}
local enabled="1"
config_get ifname $1 ifname
config_get priority $1 priority
[ "$ifname" != "$2" -a "$priority" -gt "$3" ] && enabled="0"
uci -q set mapagent.$1.enabled="$enabled"
echo $(mapagent_apply_wl_bsta $ifname $enabled) > /dev/null
}
local bsta=$1
prio=$(config_foreach mapagent_get_priority bsta $bsta)
#echo bsta $bsta has prio $prio > /dev/console
config_foreach mapagent_disable_lower_bk bsta $bsta $prio
uci commit mapagent
# ubus call uci commit '{"config":"wireless"}'
}
bsta_use_link() {
config_load mapagent
mapagent_disable_bk() {
local bsta="$2"
config_get ifname $1 ifname
config_get enabled $1 enabled
[ "$bsta" = "$ifname" ] && return
wpa_cli -i "$ifname" disconnect > /dev/null 2>&1
wpa_cli -i "$ifname" disable_network 0 > /dev/null 2>&1
wpa_cli -i "$ifname" save_config > /dev/null 2>&1
}
local bsta=$1
config_foreach mapagent_disable_bk bsta $bsta
}
bsta_swap_to_link() {
bsta_disable_lower_priority $1
bsta_use_link $1
wpa_cli -i "$1" enable_network 0 > /dev/null
wpa_cli -i "$1" reconnect > /dev/null
wpa_cli -i "$1" save_config > /dev/null
}
func=$1
shift
@@ -423,6 +685,13 @@ case "$func" in
write_bsta_config) write_bsta_config $@;;
teardown_iface) brcm_teardown_iface $@;;
bsta_to_wireless) brcm_bsta_to_wireless $@;;
sync_mapcontroller_from_wireless) sync_mapcontroller_from_wireless $@;;
ts) ts_sub $@;;
bsta_enable_all) bsta_enable_all $@;;
bsta_disable_lower_priority) bsta_disable_lower_priority $@;;
bsta_scan_on_enabled) bsta_scan_on_enabled $@;;
bsta_use_link) bsta_use_link $@;;
bsta_swap_to_link) bsta_swap_to_link $@;;
--help|help) usage;;
*) usage; exit 1;;
esac

View File

@@ -0,0 +1,381 @@
#!/bin/sh
. /lib/functions.sh
### Traffic Separation ###
ts_sub() {
ts_usage() {
cat <<EOF
Usage: $0 [create|delete|populate]
Traffic Separation related functions.
create fh <iface> <vid> - create vlan device and rules for wifi fronthaul
create bh <iface> <vid> <profile> - create vlan device and rules for wifi backhaul
create eth <iface> <vid> <pbits> - create vlan device and rules for logical ethernet interface
delete <iface> - delete vlan device
populate eth <iface> <vid> - add secondary network rules for logical ethernet interface
primary get <iface> - read primary VID for interface from driver (from Association Response frame IE)
EOF
exit 1
}
_get_bridge() {
local bridge=$(ip link show $1 | grep -o "master [^\s]*" | cut -d ' ' -f 2)
echo $bridge
}
ts_create() {
_create_vlan_dev() {
iface=$1 # real iface
vid=$2 # Vlan ID
bridge="$(_get_bridge $iface)" # bridge iface is connected to
vlan_dev=${iface}_vlan${vid} # name of vlan device to create
# remove interface from bridge if it is in one
[ -n "$bridge" ] && brctl delif $bridge $iface &> /dev/null
# create vlan device
vlanctl --mcast --if-create-name $iface $vlan_dev --if $iface --set-if-mode-rg
# bring the vlan device up and add back to bridge if it was in one
[ -n "$bridge" ] && brctl addif $bridge $vlan_dev &> /dev/null
ip link set dev $vlan_dev up
echo $vlan_dev
}
ts_create_fh() {
iface=$1 # fh iface
vid=$2 # SSID specific (secondary) or primary vid
[ -n "$iface" ] && [ -n "$vid" ] || {
cat <<EOF
Adding FH device requires IFACE and VID.
EOF
exit 1
}
# create vlan device
vlan_dev=$(_create_vlan_dev $iface $vid)
# add rules
# Note: removing these for now since these packets are read directly from the iface anyway
# vlanctl --if $iface --rx --tags 0 --filter-ethertype 0x888e --set-rxif $vlan_dev --rule-append # incoming EAPOL
# vlanctl --if $iface --rx --tags 0 --filter-ethertype 0x886c --set-rxif $vlan_dev --rule-append # incoming brcm
vlanctl --if $iface --rx --tags 0 --set-rxif $vlan_dev --push-tag --set-vid $vid 0 --rule-append
vlanctl --if $iface --tx --tags 1 --filter-txif $vlan_dev --filter-vid $vid 0 --pop-tag --dscp2pbits 0 --rule-append
}
# Note: Currently not used (will be needed for Profile 1)
ts_create_bh() {
iface=$1 # bh iface
vid=$2 # primary vid
profile=$3 # agent profile (1 or 2)
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$profile" ] || {
cat <<EOF
Adding BH device requires IFACE, VID and PROFILE (1 or 2).
EOF
exit 1
}
# create vlan device
vlan_dev=$(_create_vlan_dev $iface $vid)
# add rules
case "$profile" in
1 | profile_1 | profile1 | Profile_1 | Profile1)
vlanctl --if $iface --rx --tags 0 --set-rxif $vlan_dev --push-tag --set-vid $vid 0 --rule-append
vlanctl --if $iface --tx --tags 1 --filter-txif $vlan_dev --pop-tag --rule-append
;;
2 | profile_2 | profile2 | Profile_2 | Profile2)
vlanctl --if $iface --rx --tags 1 --set-rxif $vlan_dev --rule-append
vlanctl --if $iface --tx --tags 1 --filter-txif $vlan_dev --rule-append # note: already default
vlanctl --if $iface --tx --tags 0 --filter-ethertype 0x893a --filter-txif $vlan_dev --push-tag --set-vid $vid 0 --rule-append # note: outgoing IEEE1905.1
vlanctl --if $iface --tx --tags 0 --filter-ethertype 0x888e --filter-txif $vlan_dev --push-tag --set-vid $vid 0 --rule-append # note: outgoing EAPOL
;;
*)
ts_delete $iface
ts_usage
exit 1
;;
esac
}
ts_create_bh_drv() {
iface=$1 # bh iface
vid=$2 # primary vid
profile=$3 # agent profile (1 or 2)
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$profile" ] || {
cat <<EOF
Adding BH device requires IFACE, VID and PROFILE (1 or 2).
EOF
exit 1
}
wl vlan_mode 0 &> /dev/null # make sure this is OFF, else driver won't handle vlan
wl -i $iface down &> /dev/null
wl -i $iface map_profile $profile &> /dev/null # only has effect on profile 2
wl -i $iface map_8021q_settings $vid &> /dev/null # can only be set on bBSS (read-only on bSTA)
wl -i $iface up &> /dev/null
}
ts_create_eth() {
_ts_setup() {
vlan_bridge=$1
lan_bridge=$2
vlan_dev=$3
lan_dev=${vlan_dev}_lan
ip link show $vlan_dev &> /dev/null || ip link add $vlan_dev type veth peer name $lan_dev
brctl addif $vlan_bridge $vlan_dev &> /dev/null
brctl addif $lan_bridge $lan_dev &> /dev/null
ip link set $vlan_dev up
ip link set $lan_dev up
}
iface=$1 # Multi-AP Logical Ethernet Interface
vid=$2 # primary vid
pbits=$3 # default pbits to apply
vlan_bridge=$4 # name of ts subsystem bridge
lan_bridge=$5 # name of node local bridge
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$pbits" ] && [ -n "$vlan_bridge" ] && [ -n "$lan_bridge" ] || {
cat <<EOF
Adding ETH device requires IFACE, VID, PBITS and name of vlan and lan bridges.
EOF
exit 1
}
# create virtual eth device between bridges (if it doesn't exist))
_ts_setup $vlan_bridge $lan_bridge $iface
# create vlan device
vlan_dev=$(_create_vlan_dev $iface $vid)
# TODO: how to disable returning traffic back to incoming interface?
# add rules
vlanctl --if $iface --rx --tags 0 --set-rxif $vlan_dev --push-tag --set-vid $vid 0 --set-pbits $pbits 0 --rule-append
vlanctl --if $iface --tx --tags 1 --filter-vid $vid 0 --filter-txif $vlan_dev --pop-tag --rule-append
}
ts_create_dhcp() {
_br_setup() {
local name=$1
local sinkname=$2
local vid=$3
local diff=""
[ -z "$(uci -q get network.${name}_dev)" ] && {
uci -q set network.${name}_dev="device"
uci -q set network.${name}_dev.name="br-${name}"
uci -q set network.${name}_dev.type="bridge"
uci -q set network.${name}_dev.bridge_empty="1"
uci -q add_list network.${name}_dev.ports="${sinkname}"
diff="1"
}
[ -z "$(uci -q get network.${name})" ] && {
uci -q set network.${name}="interface"
uci -q set network.${name}.device="br-${name}"
uci -q set network.${name}.is_lan="1"
uci -q set network.${name}.proto="static"
uci -q set network.${name}.ipaddr="192.168.${vid}.1"
uci -q set network.${name}.netmask="255.255.255.0"
diff="1"
}
[ "$diff" = "1" ] && {
uci -q commit network
ubus call network reload
ubus -t 5 wait_for network.device
}
}
_dhcp_setup() {
local name=$1
[ -n "$(uci -q get dhcp.${name})" ] && return
uci -q set dhcp.${name}=dhcp
uci -q set dhcp.${name}.interface="${name}"
uci -q set dhcp.${name}.start="100"
uci -q set dhcp.${name}.limit="150"
uci -q set dhcp.${name}.leasetime="1h"
uci -q set dhcp.${name}.dhcpv4="server"
uci -q set dhcp.${name}.dhcpv6="server"
uci -q set dhcp.${name}.ra="server"
uci -q set dhcp.${name}.ra_slaac="1"
uci -q add_list dhcp.${name}.ra_flags="managed-config"
uci -q add_list dhcp.${name}.ra_flags="other-config"
uci -q commit dhcp
ubus call uci commit '{"config":"dhcp"}'
}
_wan_setup() {
local name=$1
config_load firewall
_process_zone() {
local section=$1
local sink=$2
local name
local exists=false
config_get name $section name
[ "$name" == "lan" ] || return
_process_list() {
local value=$1
[ "$value" == "$sink" ] && exists=true && return 1
}
config_list_foreach "$section" network _process_list
[ $exists = false ] && {
uci -q add_list firewall.${section}.network="${sink}"
uci -q commit firewall
ubus call uci commit '{"config":"firewall"}'
}
return 1
}
config_foreach _process_zone zone $name
}
vid=$1 # primary vid
[ -n "$vid" ] || {
cat <<EOF
VID required to configure DHCP.
EOF
exit 1
}
br_dev=sink_vlan${vid} # name of vlan device to create
ip l a sink1_vlan${vid} type veth peer name sink2_vlan${vid}
vlanctl --mcast --if-create-name sink2_vlan${vid} sink3_vlan${vid} --if sink2_vlan${vid} --set-if-mode-rg
vlanctl --if sink2_vlan${vid} --rx --tags 1 --filter-vid ${vid} 0 --set-rxif sink3_vlan${vid} --pop-tag --rule-append
vlanctl --if sink2_vlan${vid} --tx --tags 0 --filter-txif sink3_vlan${vid} --push-tag --set-vid ${vid} 0 --rule-append
ip l s sink1_vlan${vid} up
ip l s sink2_vlan${vid} up
ip l s sink3_vlan${vid} up
_br_setup $br_dev sink3_vlan${vid} $vid
_dhcp_setup $br_dev
_wan_setup $br_dev
}
local type=$1
shift
case "$type" in
fh) ts_create_fh $@;;
# bh) ts_create_bh $@;;
bh) ts_create_bh_drv $@;;
eth) ts_create_eth $@;;
dhcp) ts_create_dhcp $@;;
--help|help) ts_usage;;
*) ts_usage; exit 1;;
esac
}
ts_delete() {
iface=$1
path=$(ls -d /sys/class/net/${iface}/upper_*)
[ -z "$path" ] && exit 0
vlan_dev=${path##*upper_}
bridge="$(_get_bridge $vlan_dev)"
vlanctl --if-delete $vlan_dev # note: also removes rules and removes from bridge
brctl addif $bridge $iface &> /dev/null
}
ts_populate() {
local type=$1
shift
[ "$type" == "eth" ] || {
cat <<EOF
Populating ETH rules requires IFACE and VID.
EOF
exit 1
}
iface=$1 # Multi-AP Logical Ethernet Interface
vid=$2 # secondary vid
path=$(ls -d /sys/class/net/${iface}/upper_*)
[ -z "$path" ] && exit 1
vlan_dev=${path##*upper_}
# add rules
vlanctl --if $iface --rx --tags 1 --filter-vid $vid 0 --set-rxif $vlan_dev --rule-append # note: retain secondary vids
vlanctl --if $iface --tx --tags 1 --filter-vid $vid 0 --filter-txif $vlan_dev --rule-append # note: already default
}
ts_primary() {
local func=$1
shift
case "$func" in
get) vid=$(wl -i $1 map_8021q_settings); echo ${vid##* };;
*) ts_usage; exit 1;;
esac
}
ts_unicast() {
local mac=$1
local iface=$2
# TODO: improve?
res=$(ebtables -t broute -L | grep -i "$mac" | grep "$iface")
[ -n "$res" ] && return
ebtables -t broute -D BROUTING -d "$mac" -p 0x893a -j DROP
ebtables -t broute -I BROUTING -i "$iface" -d "$mac" -p 0x893a -j DROP
}
ts_multicast() {
local iface=$1
# TODO: improve?
res=$(ebtables -t broute -L | grep -i "1:80:C2:00:00:13" | grep "$iface")
[ -n "$res" ] && return
ebtables -t broute -D BROUTING -d 01:80:C2:00:00:13 -p 0x893a -j DROP
ebtables -t broute -D BROUTING -i "$iface" -d 01:80:C2:00:00:13 -p 0x893a -j DROP
ebtables -t broute -I BROUTING -i "$iface" -d 01:80:C2:00:00:13 -p 0x893a -j DROP
}
local func=$1
shift
case "$func" in
create) ts_create $@;;
delete) ts_delete $@;;
populate) ts_populate $@;;
primary) ts_primary $@;;
unicast) ts_unicast $@;;
multicast) ts_multicast $@;;
--help|help) ts_usage;;
*) ts_usage; exit 1;;
esac
}

View File

@@ -5,17 +5,20 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-controller
PKG_VERSION:=4.1.0
PKG_VERSION:=5.2.2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=34e239d8bb0dfade22bce3a4fb583ada826d3736
PKG_SOURCE_VERSION:=827cb6e25e7428c7d7c4ed07dd0e018d2f727abc
PKG_LICENSE:=PROPRIETARY IOPSYS
PKG_LICENSE_FILES:=LICENSE
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/map-controller.git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-controller
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
endif
PKG_BUILD_DEPENDS:=map-plugin
@@ -51,4 +54,10 @@ define Package/map-controller/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mapcontroller $(1)/usr/sbin/
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -r --exclude=.* ~/git/map-controller/ $(PKG_BUILD_DIR)/
endef
endif
$(eval $(call BuildPackage,map-controller))

View File

@@ -2,43 +2,66 @@ config controller 'controller'
option enabled '1'
option registrar '5 2' #bands on which wps registrar supported
option debug '6'
option al_bridge 'br-lan'
option enable_sta_steer '0'
option enable_bsta_steer '0'
option primary_vid '1'
option primary_pcp '0'
config vlan 'lan'
option network 'lan'
option id '1'
config interface 'lan'
option 'dhcp'
config fh-credentials
config ap
option band '5'
option encryption 'psk2'
option encryption 'sae-mixed'
option key '1234567890'
option ssid 'map-net5'
option vlan '1'
option vid '1'
option type 'fronthaul'
option network 'lan'
config fh-credentials
config ap
option band '2'
option encryption 'psk2'
option encryption 'sae-mixed'
option key '1234567890'
option ssid 'map-net2'
# option bk_ssid 'multiap_ssid123'
# option bk_key 'multiap_key123'
option vlan '1'
option vid '1'
option type 'fronthaul'
option network 'lan'
config bk-credentials
config ap
option band '5'
option encryption 'psk2'
option encryption 'sae'
option key '5555555555'
option ssid 'map-bkhaul-5'
option multi_ap '2'
option type 'backhaul'
option disallow_bsta '1' # bitmap, 1 for disallow p1, 2 to disallow p2, 3 to disallow both (probably never applicable)
option vlan '1'
option vid '1'
option network 'lan'
config bk-credentials
config ap
option band '2'
option encryption 'psk2'
option encryption 'sae'
option key '2222222222'
option ssid 'map-bkhaul-2'
option multi_ap '2'
option disallow_bsta '0' # 0 or 1 profile-1 bSTA
option vlan '1'
list disallow_bsta '0' # 0 or 1 profile-1 bSTA
option vid '1'
option type 'backhaul'
option network 'lan'
config policy 'policy'
list steer_exclude '00:11:22:33:44:55'
list steer_exclude_btm '00:aa:bb:cc:dd:ee'
option steer_policy '2' # 0, 1, 2 - see MultiAP spec
option util_threshold '200' # channel-util as in BSS load
option rcpi_threshold '30' # 0 - 220 valid range
option report_scan '0' # 0 or 1 for independent scans
option report_sta_assocfails '1' # 0 or 1 - stas assoc failure
option report_sta_assocfails_rate '2' # reporting rate for STA assoc fails (attempts per minute)
option report_metric_periodic '0' # 0, or 1 - 255 in secs
option report_rcpi_threshold '0' # 0, or 1 - 220
option report_util_threshold '0' # 0, or channel-util value
option rcpi_hysteresis_margin '0' # 0, or > 0 - hysteresis margin
option include_sta_stats '0' # sta stats in AP metric resp
option include_sta_metric '0' # sta metric in AP metric resp
option disallow_bsta_p1 '0' # 0 or 1 profile-1 bSTA
option disallow_bsta_p2 '0' # 0 or 1 profile-2 bSTA

View File

@@ -19,6 +19,12 @@ start_service() {
config_get_bool enabled controller enabled 1
[ "$enabled" -eq 0 ] && return
config_get_bool sync_from_uci_wireless controller sync_from_uci_wireless 0
if [ "$sync_from_uci_wireless" -eq 1 ]; then
/lib/wifi/multiap sync_mapcontroller_from_wireless
fi
procd_open_instance
procd_set_param command "/usr/sbin/mapcontroller" "-d"
@@ -38,16 +44,30 @@ start_service() {
service_triggers()
{
config_load "mapcontroller"
procd_add_reload_trigger "mapcontroller"
config_get_bool sync_from_uci_wireless controller sync_from_uci_wireless 0
if [ "$sync_from_uci_wireless" -eq 1 ]; then
procd_add_reload_trigger "wireless"
fi
}
reload_service() {
local enabled
config_load "mapcontroller"
config_get_bool sync_from_uci_wireless controller sync_from_uci_wireless 0
if [ "$sync_from_uci_wireless" -eq 1 ]; then
/lib/wifi/multiap sync_mapcontroller_from_wireless
fi
config_get_bool enabled controller enabled 1
if [ "$enabled" -eq 0 ]; then
stop
# Start but without instance so reload trigger works.
start
return
fi

View File

@@ -6,11 +6,11 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=map-topology
PKG_VERSION:=2.1.8
PKG_VERSION:=3.1.0
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_VERSION:=68c8ebb9ffd72873bb35971b9ea854a6c1e1df5c
PKG_SOURCE_VERSION:=b7556dcfb023acccbfd293f14ff036814bf25daf
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-topology.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
@@ -30,7 +30,9 @@ define Package/map-topology
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl3 \
-D_GNU_SOURCE
define Package/map-topology/description
Constructs network topology and show it as json structure over UBUS

View File

@@ -458,7 +458,7 @@ read_mcast_stats() {
case $line in
br-*)
found_ip=0
grp_ip="$(echo $line | awk -F ' ' '{ print $9 }')"
grp_ip="$(echo $line | awk -F ' ' '{ print $10 }')"
if [ -z "$mcast_addrs" ]; then
mcast_addrs="$grp_ip"
continue
@@ -510,7 +510,7 @@ read_mcast_stats() {
if [ "$snoop_iface" != "$intf" ]; then
continue
fi
grp_ip="$(echo $line | awk -F ' ' '{ print $9 }')"
grp_ip="$(echo $line | awk -F ' ' '{ print $10 }')"
if [ "$grp_ip" != "$gip_addr" ]; then
continue
fi
@@ -523,12 +523,12 @@ read_mcast_stats() {
fi
json_add_object ""
host_ip="$(echo $line | awk -F ' ' '{ print $13 }')"
host_ip="$(echo $line | awk -F ' ' '{ print $14 }')"
h_ip="$(ipcalc.sh $host_ip | grep IP | awk '{print substr($0,4)}')"
json_add_string "ipaddr" "$h_ip"
src_port="$(echo $line | awk -F ' ' '{ print $2 }')"
json_add_string "device" "$src_port"
timeout="$(echo $line | awk -F ' ' '{ print $14 }')"
timeout="$(echo $line | awk -F ' ' '{ print $15 }')"
json_add_int "timeout" "$timeout"
json_close_object #close the associated device object
;;

42
obudpst/Makefile Normal file
View File

@@ -0,0 +1,42 @@
#
# Copyright (c) 2020, Broadband Forum
# Copyright (c) 2020, AT&T Communications
#
include $(TOPDIR)/rules.mk
PKG_NAME:=obudpst
PKG_VERSION:=7.2.1
PKG_SOURCE_VERSION:=9c448095c9773bd7e5cea143af07817ad9f3c6ba
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/BroadbandForum/obudpst.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/obudpst
CATEGORY:=Utilities
DEPENDS+=+libopenssl
TITLE:=Open Broadband-UDP Speed Test (OB-UDPST)
endef
define Build/Install
:
endef
define Package/obudpst/description
Open Broadband-UDP Speed Test (OB-UDPST) is a client/server software utility to demonstrate
one approach of doing IP capacity measurements described by Broadband Forum TR-471.
endef
define Package/obudpst/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/udpst $(1)/usr/sbin/udpst
endef
$(eval $(call BuildPackage,obudpst))

View File

@@ -1,5 +1,7 @@
if PACKAGE_obuspa
menu "Configuration"
config OBUSPA_MTP_ENABLE_STOMP
bool "Enable STOMP as mtp protocol"
default y
@@ -11,5 +13,5 @@ config OBUSPA_MTP_ENABLE_MQTT
config OBUSPA_MTP_ENABLE_COAP
bool "Enable CoAP as mtp protocol"
default y
endmenu
endif

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=obuspa
PKG_VERSION:=4.1.0.1
PKG_VERSION:=4.1.0.16
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=bb552093a94b0e6afd01a815cfad08236b2ea7e2
PKG_SOURCE_VERSION:=9db79a21298becd2c6a133abad3063f532fc281b
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/obuspa.git
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
@@ -29,6 +29,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/obuspa
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=USP agent
DEPENDS:=+libopenssl +libcurl +libsqlite3 +libubox +libubus +uspd +libmosquitto
endef
@@ -80,13 +81,11 @@ define Package/obuspa/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/obuspa
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspa $(1)/usr/sbin/
$(INSTALL_BIN) ./files/etc/init.d/obuspa $(1)/etc/init.d/
$(INSTALL_DATA) ./files/etc/config/obuspa $(1)/etc/config/
$(INSTALL_DATA) ./files/etc/obuspa/roles.json $(1)/etc/obuspa/roles.json
$(INSTALL_DATA) ./files/etc/obuspa/dmcaching_exclude.json $(1)/etc/obuspa/dmcaching_exclude.json
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-obuspa $(1)/etc/hotplug.d/iface/
endef
$(eval $(call BuildPackage,obuspa))

View File

@@ -1,9 +1,10 @@
config obuspa 'global'
option enabled '1'
option interface 'wan'
#option ifname 'eth0.1'
option debug '0'
option interface 'loopback'
#option ifname 'lo'
option debug '1'
option log_level '1'
option prototrace '0'
#option db_file '/etc/obuspa/usp.db'
#option role_file '/etc/obuspa/roles.json'
option dm_caching_exclude '/etc/obuspa/dmcaching_exclude.json'
@@ -46,7 +47,7 @@ config subscription
# option Description 'Request to get Administrative access'
# option role_name 'full_access'
# option Enable '1'
# option Value 'admin'
# option Value 'YWRtaW4='
# option Retries 2
# option LockoutPeriod 60
@@ -54,6 +55,6 @@ config subscription
# option Description 'Request to get User access'
# option role_name 'user'
# option Enable '1'
# option Value 'user'
# option Value 'dXNlcg=='
# option Retries 3
# option LockoutPeriod 30

View File

@@ -1,9 +0,0 @@
#!/bin/sh
[ "$(uci -q get obuspa.global.interface)" == "$INTERFACE" ] || exit 0
[ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0
[ "$ACTION" = ifupdate -a -z "$IFUPDATE_ADDRESSES" ] && exit 0
/etc/init.d/obuspa reload

View File

@@ -1,14 +1,12 @@
#!/bin/sh /etc/rc.common
START=99
STOP=2
USE_PROCD=1
PROG=/usr/sbin/obuspa
EXTRA_COMMANDS="remove_db"
EXTRA_HELP=" remove_db Removes obuspa persistent db before restarting, self trigger with uci change"
PARAM_FILE="/tmp/obuspa_param_reset.txt"
CONFIGURATION=obuspa
PARAM_FILE="/tmp/obuspa_param_reset.txt"
KEEP_FILES="/lib/upgrade/keep.d/obuspa"
USP_TEMP_FILE="/tmp/usp.tmp"
controller_num=0
@@ -19,6 +17,7 @@ subs_num=0
challenge_num=0
index=0
role_def_file=""
PROFILE="/root/.profile"
. /lib/functions/network.sh
. /usr/share/libubox/jshn.sh
@@ -43,6 +42,19 @@ db_set() {
fi
}
update_keep() {
keep_file=${1}
if [ -z "${keep_file}" ]; then
return;
fi
grep -q "${keep_file}" ${KEEP_FILES}
if [ "$?" -ne 0 ]; then
echo ${keep_file} >> ${KEEP_FILES}
fi
}
get_index() {
index=$(( index + 1 ))
if [ "$1" = "$2" ]; then
@@ -55,7 +67,7 @@ get_role_index_from_json() {
local num=0
# In case of role is empty or file not present
if [ -z "${role}" -o ! -f ${role_def_file} ]; then
if [ -z "${role}" -o ! -f "${role_def_file}" ]; then
return 0
fi
@@ -86,7 +98,7 @@ get_role_index_from_json() {
get_uci_ref_index() {
local val;
[ -f ${USP_TEMP_FILE} ] && rm -f ${USP_TEMP_FILE}
[ -f "${USP_TEMP_FILE}" ] && rm -f ${USP_TEMP_FILE}
index=0
config_load $CONFIGURATION
@@ -111,6 +123,7 @@ validate_obuspa_section()
'interface:string' \
'ifname:string:br-lan' \
'debug:bool:false' \
'prototrace:bool:false' \
'log_level:uinteger' \
'log_dest:string' \
'db_file:string' \
@@ -121,7 +134,6 @@ validate_localagent_section()
{
uci_validate_section ${CONFIGURATION} localagent "${1}" \
'Enable:bool:true' \
'ParameterName:string:Device.DeviceInfo.SoftwareVersion' \
'EndpointID:string'
}
@@ -141,6 +153,7 @@ validate_controller_section()
'Reference:string' \
'Destination:string:controller-notify-dest' \
'Topic:string' \
'ParameterName:list(string)' \
'coap_host:host' \
'coap_path:string' \
'coap_port:port' \
@@ -210,9 +223,59 @@ validate_mqtt_client_section()
'ConnectRetryMaxInterval:uinteger:60'
}
get_oui_from_hw() {
local oui=$(uci -q get cwmp.cpe.manufacturer_oui)
if [ -z "${oui}" ]; then
oui="$(db get device.deviceinfo.ManufacturerOUI)"
fi
echo "${oui}"
}
get_serial_from_hw() {
local serial="$(db get hw.board.serial_number)"
# this can encoded further
echo "${serial}"
}
publish_endpoint() {
local AgentEndpointID serial oui user pass
local opt=""
# return if mosquitto_pub is not present
if [ ! "$(which mosquitto_pub)" ]; then
log "mosquitto_pub not present can't publish EndpointID"
return 0;
fi
# Get endpoint id from obuspa config first
config_load obuspa
config_get AgentEndpointID localagent EndpointID ""
if [ -z "${AgentEndpointID}" ]; then
serial=$(get_serial_from_hw)
oui=$(get_oui_from_hw)
AgentEndpointID="os::${oui}-${serial}"
fi
config_get user localmqtt Username
if [ -n "${user}" ]; then
opt="-u ${user}"
fi
config_get pass localmqtt Password
if [ -n "${pass}" ]; then
opt="${opt} -P ${pass}"
fi
# publish Agent's EndpointID in mosquito broker for discovery by usp-js
# This is a work around till obuspa adds supports for mDNS discovery
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker"
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}" ${opt}
}
configure_localagent() {
local Enable ParameterName EndpointID
local _num
validate_localagent_section 'localagent' || {
log "Validation of localagent section failed"
@@ -223,14 +286,6 @@ configure_localagent() {
db_set Device.LocalAgent.EndpointID "${EndpointID}"
fi
_num=1
while [ ${_num} -le ${controller_num} ]
do
db_set Device.LocalAgent.Controller.${_num}.BootParameter.1.Enable "${Enable}"
db_set Device.LocalAgent.Controller.${_num}.BootParameter.1.ParameterName "${ParameterName}"
_num=$(( ${_num} + 1 ))
done
db_set
}
@@ -254,17 +309,17 @@ configure_controller() {
return 1;
fi
if [ -z ${Reference} ]; then
if [ ${Protocol} = "STOMP" ]; then
if [ -z "${Reference}" ]; then
if [ "${Protocol}" = "STOMP" ]; then
val=$(get_uci_ref_index stomp ${stomp})
if [ ${val} -eq 0 ]; then
if [ "${val}" -eq 0 ]; then
log "Not able to find the referred stomp section"
return 1;
fi
Reference="Device.STOMP.Connection.${val}"
elif [ ${Protocol} = "MQTT" ]; then
elif [ "${Protocol}" = "MQTT" ]; then
val=$(get_uci_ref_index mqtt ${mqtt})
if [ ${val} -eq 0 ]; then
if [ "${val}" -eq 0 ]; then
log "Not able to find the referred mqtt section"
return 1;
fi
@@ -314,6 +369,17 @@ configure_controller() {
log "Unsupported Protocol ${Protocol}"
fi
local param
local _pnum=1
for param in ${ParameterName}
do
db_set Device.LocalAgent.Controller.${controller_num}.BootParameter.${_pnum}.Alias "cpe-${_pnum}"
db_set Device.LocalAgent.Controller.${controller_num}.BootParameter.${_pnum}.Enable "${Enable}"
db_set Device.LocalAgent.Controller.${controller_num}.BootParameter.${_pnum}.ParameterName "${param}"
_pnum=$(( ${_pnum} + 1 ))
done
db_set
}
@@ -330,9 +396,9 @@ configure_subscription(){
log "No recipient for subscription"
fi
if [ -z ${Recipient} ]; then
if [ -z "${Recipient}" ]; then
val=$(get_uci_ref_index controller ${controller})
if [ ${val} -eq 0 ]; then
if [ "${val}" -eq 0 ]; then
log "Not able to find the referred controller section"
return 1;
fi
@@ -366,9 +432,9 @@ validate_challenge_section()
check_json_load()
{
local ret=0
if [ -f ${role_def_file} ]; then
if [ -f "${role_def_file}" ]; then
json_init
json_load_file ${role_def_file} 2>&1 |grep -q Failed
json_load_file "${role_def_file}" 2>&1 |grep -q Failed
if [ $? -eq 0 ]; then # In case of invalid json file
log "failed to load [${role_def_file}]"
ret=1
@@ -412,7 +478,7 @@ configure_challenges() {
exit 1;
}
if [ -z "${role_name}" -a -z ${Role} ]; then
if [ -z "${role_name}" -a -z "${Role}" ]; then
log "Either role_name or Role must defined for a challenge";
return 1;
fi
@@ -448,17 +514,17 @@ configure_mtp() {
return 1;
}
if [ -z ${Reference} ]; then
if [ ${Protocol} = "STOMP" ]; then
if [ -z "${Reference}" ]; then
if [ "${Protocol}" = "STOMP" ]; then
val=$(get_uci_ref_index stomp ${stomp})
if [ ${val} -eq 0 ]; then
if [ "${val}" -eq 0 ]; then
log "Referred stomp section not found"
return 1;
fi
Reference="Device.STOMP.Connection.${val}"
elif [ ${Protocol} = "MQTT" ]; then
elif [ "${Protocol}" = "MQTT" ]; then
val=$(get_uci_ref_index mqtt ${mqtt})
if [ ${val} -eq 0 ]; then
if [ "${val}" -eq 0 ]; then
log "Referred mqtt section not found"
return 1;
fi
@@ -554,7 +620,7 @@ configure_mqtt_client(){
configure_obuspa() {
local enabled trust_cert ifname interface debug log_level db_file log_dest role_file
local enabled trust_cert ifname interface debug prototrace log_level db_file log_dest role_file
validate_obuspa_section "global" || {
log "Validation of global section failed"
@@ -563,15 +629,18 @@ configure_obuspa() {
role_def_file="${role_file}"
if [ ${debug} -eq 1 ]; then
if [ "${debug}" -eq 1 ]; then
# Forward stdout of the command to logd
procd_set_param stdout 1
# Same for stderr
procd_set_param stderr 1
fi
if [ "${debug}" -eq 1 -a "${prototrace}" -eq 1 ]; then
procd_append_param command -p
fi
if [ -n ${log_level} ]; then
if [ "${debug}" -eq 1 -a -n "${log_level}" ]; then
procd_append_param command -v ${log_level}
fi
@@ -580,28 +649,37 @@ configure_obuspa() {
fi
if [ -n "${interface}" ]; then
network_get_device ifname ${interface}
log "ifname from ${interface} is ${ifname}"
network_get_physdev ifname ${interface}
fi
# Set this variable for root user and obuspa -c tool
grep -q "export USP_BOARD_IFNAME=${ifname}" /root/.profile || \
echo "export USP_BOARD_IFNAME=${ifname}" >> /root/.profile
if [ -f "${PROFILE}" ]; then
grep -q "export USP_BOARD_IFNAME=${ifname}" ${PROFILE}
if [ "$?" -ne 0 ]; then
grep -q "export USP_BOARD_IFNAME" ${PROFILE}
if [ "$?" -eq 0 ]; then
sed -i "g/export USP_BOARD_IFNAME/d" ${PROFILE}
fi
echo "export USP_BOARD_IFNAME=${ifname}" >> ${PROFILE}
fi
else
echo "export USP_BOARD_IFNAME=${ifname}" > ${PROFILE}
fi
if [ -n "${db_file}" ]; then
echo "${db_file}" >>${KEEP_FILES}
update_keep "${db_file}"
procd_append_param command -f ${db_file}
fi
if [ -n "${trust_cert}" ]; then
echo "${trust_cert}" >>${KEEP_FILES}
update_keep "${trust_cert}"
if [ -f "${trust_cert}" ]; then
procd_append_param command -t ${trust_cert}
fi
fi
if [ -n "${client_cert}" ]; then
echo "${client_cert}" >>${KEEP_FILES}
update_keep "${client_cert}"
if [ -f "${client_cert}" ]; then
procd_append_param command -a ${client_cert}
fi
@@ -612,10 +690,6 @@ configure_obuspa() {
# Create factory reset file
db_init() {
[ -f ${PARAM_FILE} ] && rm -f ${PARAM_FILE}
[ -f /tmp/usp.db ] && rm -f /tmp/usp.db
[ -f ${KEEP_FILES} ] && rm -f ${KEEP_FILES}
# Load configuration
config_load $CONFIGURATION
config_foreach configure_obuspa obuspa
@@ -630,26 +704,8 @@ db_init() {
db_set Internal.Reboot.Cause "LocalFactoryReset"
}
# if uci changes for obuspa remove persistent db and then reload
remove_db() {
local db_file
config_load obuspa
config_get db_file global db_file
log "Removing db file (${db_file})"
[ -f ${db_file} ] && rm -f ${db_file}
sed -i "g/export USP_BOARD_IFNAME/d" /root/.profile
log "Restarting service"
stop
start
}
service_running() {
ubus -t 10 wait_for usp.raw
procd_running ${CONFIGURATION}
publish_endpoint
}
start_service() {
@@ -663,12 +719,6 @@ start_service() {
return 0;
fi
ubus wait_for usp.raw
if [ "$?" -ne 0 ]; then
log "OBUSPA failed to start usp.raw not available"
return 0
fi
procd_open_instance ${CONFIGURATION}
procd_set_param command ${PROG}
db_init
@@ -682,7 +732,19 @@ start_service() {
}
stop_service() {
local db_file
config_load obuspa
config_get db_file global db_file
${PROG} -c stop 2>&1 >/dev/null
if [ -z "${db_file}" ]; then
db_file="/tmp/usp.db"
fi
[ -f "${db_file}" ] && rm -f ${db_file}
[ -f "${PARAM_FILE}" ] && rm -f ${PARAM_FILE}
}
reload_service() {
@@ -691,8 +753,7 @@ reload_service() {
}
service_triggers() {
procd_add_reload_trigger "uspd" "mosquitto"
procd_add_config_trigger "config.change" "${CONFIGURATION}" /etc/init.d/obuspa remove_db
procd_add_reload_trigger "obuspa" "mosquitto"
# Create a reload trigger if schema update avaialble
procd_open_trigger
@@ -711,13 +772,7 @@ service_triggers() {
json_add_string "" "reload"
json_close_array
json_close_array
json_add_int "" "1000"
json_add_int "" "2000"
json_close_array
procd_close_trigger
# local interface
# config_load obuspa
# config_get interface global interface
# [ -n "$interface" ] && procd_add_interface_trigger "interface.*" "$interface" /etc/init.d/obuspa reload
}

View File

@@ -2,19 +2,6 @@
[ "$ACTION" = ifup ] || exit 0
handle_interface() {
ifname=$(uci get network.$1.ifname)
case "$ifname" in
@*)
alias_interface="$1 $alias_interface"
;;
esac
}
config_load network
config_foreach handle_interface "interface"
compare_owsd_iface() {
local interface
@@ -24,13 +11,6 @@ compare_owsd_iface() {
/etc/init.d/owsd reload
exit
fi
for i in $alias_interface; do
if [ "$INTERFACE" == "$i" ]; then
/etc/init.d/owsd reload
exit
fi
done
}
config_load owsd

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=periodicstats
PKG_VERSION:=1.0.2
PKG_VERSION:=1.0.5
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=d53b540a89165753922707ed624b315d58abd10a
PKG_SOURCE_VERSION:=26d65740dad0fd4e295a1bd88cd059b2bfaaf5af
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/periodicstats.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip

View File

@@ -4,26 +4,23 @@ START=99
STOP=10
USE_PROCD=1
NAME=periodicstatsd
PROG=/usr/sbin/periodicstatsd
. /lib/functions.sh
start_service() {
ubus wait_for usp
if [ -f "/etc/config/periodicstats" ]; then
if [ "$(uci -q get periodicstats.globals.enable)" == "1" ]; then
procd_open_instance periodicstatsd
procd_set_param command ${PROG}
procd_set_param respawn
procd_close_instance
fi
fi
service_running() {
ubus -t 10 wait_for usp.raw
}
stop() {
#stop_service() is called after procd killed the service
echo ;
start_service() {
enable=$(uci -q get periodicstats.globals.enable)
if [ "$(enable)" != "1" ]; then
return 0;
fi
procd_open_instance periodicstatsd
procd_set_param command ${PROG}
procd_set_param respawn
procd_close_instance
}
service_triggers() {

View File

@@ -1,5 +1,6 @@
#!/bin/sh
. /lib/functions.sh
. /lib/network/port.sh
IP_RULE=""
BR_RULE=""
@@ -13,6 +14,7 @@ PREV_ORDER=""
CURR_ORDER=""
MAX_ORDER=""
# Function to handle a queue order and
# update total number of queues
handle_q_order() {
@@ -671,17 +673,20 @@ assign_policer_to_port() {
local pindex="$2"
local portorder="$(db -q get hw.board.ethernetPortOrder)"
local wanport="$(db -q get hw.board.ethernetWanPort)"
local runner_lan_ports="$(bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/examine port | grep ': port/index=lan' | sed -e 's#\.##g' | cut -f2 -d' ' | sort -u | xargs)"
local i=1
for port in $portorder; do
if [ "$ifname" == "$port" ]; then
if [ "$wanport" == "$port" ]; then
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure port/index=wan0 ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
else
local i="${port: -1}"
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure port/index=lan$i ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
local lanport="$(echo -n "$runner_lan_ports" | cut -f${i} -d' ')"
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure $lanport ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
fi
break
fi
i=$((i+1))
done
}
@@ -745,11 +750,6 @@ config_ingress_rate_limit() {
local in_burst_size=$3
local wanport="$(db -q get hw.board.ethernetWanPort)"
if [ "$ifname" == "$wanport" ]; then
logger -t qosmngr "policing is not support on port $ifname"
return
fi
# Unit in uci file is in bps while that accepted by ethswctl is kbits
if [ $ingress_rate -lt 1000 ]; then
return
@@ -763,7 +763,10 @@ config_ingress_rate_limit() {
in_burst_size=$((in_burst_size / 1000))
fi
ethswctl -c rxratectrl -n 1 -p $ifname -x $ingress_rate -y $in_burst_size
local unitport="$(get_port_number $ifname)"
local unit=$(echo $unitport | cut -d ' ' -f 1)
local port=$(echo $unitport | cut -d ' ' -f 2)
ethswctl -c rxratectrl -n $unit -p $port -x $ingress_rate -y $in_burst_size
}
#function to handle a classify section
@@ -836,6 +839,7 @@ configure_queue() {
for i in 0 1 2 3 4 5 6 7; do
tmctl delqcfg --devtype 0 --if $intf --qid $i &>/dev/null
done
tmctl porttminit --devtype 0 --if $intf --flag 0 --numqueues 8
mkdir -p /tmp/qos/$intf
touch /tmp/qos/$intf/q_order
@@ -854,10 +858,14 @@ configure_policer() {
# the old config if any and return
if [ $POLICER_SKIP -eq 0 ]; then
for intf in $(db get hw.board.ethernetPortOrder); do
local unitport="$(get_port_number $intf)"
local unit=$(echo $unitport | cut -d ' ' -f 1)
local port=$(echo $unitport | cut -d ' ' -f 2)
# setting rate and burst size to 0 disables rate limiting
ethswctl -c rxratectrl -n 1 -p $intf -x 0 -y 0
if [ $port != "" -a $unit != "" ]; then
ethswctl -c rxratectrl -n $unit -p $port -x 0 -y 0
fi
done
return
fi
# Delete policer
@@ -885,8 +893,11 @@ configure_policer() {
}
configure_qos() {
configure_queue
#queue configuration is being done after shaper configuration,
#If port shapingrate configuration on DISC device is called after queue configuration then
#driver overwrites the queue shaping rate with default value of port shaping rate.
configure_shaper
configure_queue
configure_policer
configure_classify
}

View File

@@ -12,12 +12,3 @@ start_service() {
procd_set_param respawn
procd_close_instance
}
service_triggers()
{
procd_add_reload_trigger network wireless
}
reload_service() {
ubus -t 5 call router.network reload
}

View File

@@ -1,54 +0,0 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
. /lib/functions/network.sh
. /lib/functions.sh
case "$1" in
list)
echo '{ "dump" : {}, "hosts" : {} }'
;;
call)
case "$2" in
dump)
dump_network() {
local cfg="$1"
local is_lan type bool proto ipaddr netmask ifname
[ "$cfg" == "loopback" ] && return
config_get_bool is_lan $cfg is_lan 0
config_get type $cfg type
config_get_bool defaultroute $cfg defaultroute 1
config_get proto $cfg proto none
config_get ipaddr $cfg ipaddr
[ -z "$ipaddr" ] && network_get_ipaddr ipaddr $cfg
config_get netmask $cfg netmask "255.255.255.255"
config_get ifname $cfg ifname
json_add_object "$cfg"
json_add_boolean is_lan $is_lan
json_add_string type "$type"
json_add_boolean defaultroute $defaultroute
json_add_string proto "$proto"
json_add_string ipaddr "$ipaddr"
json_add_string netmask "$netmask"
json_add_string ifname "$ifname"
json_select ..
}
config_load network
json_init
config_foreach dump_network interface
json_dump
;;
hosts)
ubus call topology hosts | \
sed 's/interface_type/type/g' | \
sed 's/Ethernet/ethernet/g' | \
sed 's/Wi-Fi/wifi/g'
;;
esac
;;
esac

View File

@@ -0,0 +1,55 @@
#
# Copyright (c) 2020 Genexis B.V.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use, copy,
# modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=quickjs-websocket
PKG_LICENSE:=MIT
PKG_VERSION:=1
PKG_RELEASE:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/quickjs-websocket
SECTION:=libs
CATEGORY:=Libraries
TITLE:=WebSocket API for QuickJS
MAINTAINER:=Erik Karlsson <erik.karlsson@genexis.eu>
DEPENDS:=+quickjs +libwebsockets
endef
define Package/quickjs-websocket/description
Implementation of the W3C WebSocket API in QuickJS on top of the
libwebsockets C library.
endef
define Package/quickjs-websocket/install
$(INSTALL_DIR) $(1)/usr/lib/quickjs
$(CP) $(PKG_BUILD_DIR)/lws-client.so $(1)/usr/lib/quickjs/
$(CP) $(PKG_BUILD_DIR)/websocket.js $(1)/usr/lib/quickjs/
endef
$(eval $(call BuildPackage,quickjs-websocket))

23
quickjs-websocket/README Executable file
View File

@@ -0,0 +1,23 @@
WebSocket API for QuickJS
===============
Introduction
------------
This is an implementation of the W3C WebSocket API for the QuickJS
JavaScript engine on top of the libwebsockets C library.
Usage
------------
import { WebSocket } from '/usr/lib/quickjs/websocket.js'
const w = new WebSocket('wss://example.com/', ['protocol1', 'protocol2'])
globalThis.WebSocket = WebSocket // To make the API available globally
Limitations
------------
Events emitted by WebSocket objects do not implement the full DOM
event specification. Only a subset of properties is available. The
EventTarget interface, i.e. addEventListener/removeEventListener, is
unimplemented. The onopen/onerror/onclose/onmesseage handlers have to
be used instead.

View File

@@ -0,0 +1,38 @@
#
# Copyright (c) 2020 Genexis B.V.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use, copy,
# modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
TARGETS = lws-client.so
CFLAGS += -Os -Wall -Werror
all: $(TARGETS)
%.pic.o: %.c
$(CC) $(CFLAGS) -fPIC -c -o $@ $<
lws-client.so: lws-client.pic.o
$(CC) $(LDFLAGS) -shared -o $@ $^ -lwebsockets
clean:
rm -f *.o $(TARGETS)

View File

@@ -0,0 +1,958 @@
/*
* Copyright (c) 2020 Genexis B.V.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <stdint.h>
#include <string.h>
#include <quickjs/quickjs.h>
#include <quickjs/quickjs-libc.h>
#include <libwebsockets.h>
#define countof(x) (sizeof(x) / sizeof((x)[0]))
#define CDEF(name) JS_PROP_INT32_DEF(#name, name, JS_PROP_CONFIGURABLE)
#if LWS_LIBRARY_VERSION_NUMBER < 3002000
#define MAX_WAIT 1000
#else
#define MAX_WAIT INT32_MAX
#ifndef LWS_WITH_EXTERNAL_POLL
#error "LWS_WITH_EXTERNAL_POLL is needed for LWS versions >= 3.2.0"
#endif
#if LWS_LIBRARY_VERSION_NUMBER < 4001002
#error "External poll is broken for 3.2.0 <= LWS version < 4.1.2"
#endif
#endif
#define WSI_DATA_USE_OBJECT (1 << 0)
#define WSI_DATA_USE_LINKED (1 << 1)
typedef struct js_lws_wsi_data {
struct js_lws_wsi_data *next;
struct lws *wsi;
JSValue object;
JSValue context;
JSValue user;
uint8_t in_use;
} js_lws_wsi_data_t;
typedef struct {
struct lws_context *context;
JSContext *ctx;
JSValue callback;
js_lws_wsi_data_t *wsi_list;
} js_lws_context_data_t;
static JSClassID js_lws_context_class_id;
static JSClassID js_lws_wsi_class_id;
static void free_wsi_data_rt(JSRuntime *rt, js_lws_wsi_data_t *data)
{
JS_FreeValueRT(rt, data->object);
JS_FreeValueRT(rt, data->context);
JS_FreeValueRT(rt, data->user);
js_free_rt(rt, data);
}
static void unlink_wsi_rt(JSRuntime *rt, js_lws_context_data_t *data,
js_lws_wsi_data_t *wsi_data)
{
js_lws_wsi_data_t **p;
for (p = &data->wsi_list; *p; p = &(*p)->next) {
if (*p == wsi_data) {
*p = (*p)->next;
break;
}
}
wsi_data->next = NULL;
wsi_data->wsi = NULL;
JS_FreeValueRT(rt, wsi_data->object);
wsi_data->object = JS_UNDEFINED;
wsi_data->in_use &= ~WSI_DATA_USE_LINKED;
if (wsi_data->in_use == 0)
free_wsi_data_rt(rt, wsi_data);
}
static void unlink_wsi(JSContext *ctx, js_lws_context_data_t *data,
js_lws_wsi_data_t *wsi_data)
{
unlink_wsi_rt(JS_GetRuntime(ctx), data, wsi_data);
}
static JSValue convert_pollargs(JSContext *ctx, const struct lws_pollargs *pa)
{
JSValue obj;
if (pa == NULL)
return JS_NULL;
obj = JS_NewObject(ctx);
if (JS_IsException(obj))
return obj;
if (JS_SetPropertyStr(ctx, obj, "fd", JS_NewInt32(ctx, pa->fd)) < 0
|| JS_SetPropertyStr(ctx, obj, "events",
JS_NewInt32(ctx, pa->events)) < 0
|| JS_SetPropertyStr(ctx, obj, "prev_events",
JS_NewInt32(ctx, pa->prev_events)) < 0) {
JS_FreeValue(ctx, obj);
return JS_EXCEPTION;
}
return obj;
}
static JSValue convert_close_payload(JSContext *ctx,
uint8_t *payload, size_t len)
{
JSValue array;
uint16_t status;
JSValue reason;
if (payload == NULL || len < 2)
return JS_NULL;
array = JS_NewArray(ctx);
if (JS_IsException(array))
return array;
status = (payload[0] << 8) | payload[1];
if (JS_SetPropertyUint32(ctx, array, 0, JS_NewInt32(ctx, status)) < 0) {
JS_FreeValue(ctx, array);
return JS_EXCEPTION;
}
reason = JS_NewStringLen(ctx, (const char *)(payload + 2), len - 2);
if (JS_IsException(reason)
|| JS_SetPropertyUint32(ctx, array, 1, reason) < 0) {
JS_FreeValue(ctx, array);
return JS_EXCEPTION;
}
return array;
}
static int client_callback(struct lws *wsi, enum lws_callback_reasons reason,
void *user, void *in, size_t len)
{
js_lws_context_data_t *data = lws_context_user(lws_get_context(wsi));
js_lws_wsi_data_t *wsi_data = lws_wsi_user(wsi);
JSContext *ctx;
JSValue args[3];
JSValue ret;
int32_t ret_int;
int i;
if (data == NULL || data->ctx == NULL || JS_IsUndefined(data->callback))
return 0;
ctx = data->ctx;
args[0] = wsi_data ? JS_DupValue(ctx, wsi_data->object) : JS_NULL;
args[1] = JS_NewInt32(ctx, reason);
args[2] = JS_NULL;
switch (reason) {
case LWS_CALLBACK_ADD_POLL_FD:
case LWS_CALLBACK_DEL_POLL_FD:
case LWS_CALLBACK_CHANGE_MODE_POLL_FD:
args[2] = convert_pollargs(ctx, in);
break;
case LWS_CALLBACK_CLIENT_CONNECTION_ERROR:
if (in)
args[2] = JS_NewStringLen(ctx, in, len);
break;
case LWS_CALLBACK_WS_PEER_INITIATED_CLOSE:
args[2] = convert_close_payload(ctx, in, len);
break;
case LWS_CALLBACK_RECEIVE:
case LWS_CALLBACK_CLIENT_RECEIVE:
if (in)
args[2] = JS_NewArrayBufferCopy(ctx, in, len);
break;
case LWS_CALLBACK_WSI_DESTROY:
if (wsi_data)
unlink_wsi(ctx, data, wsi_data);
break;
default:
break;
}
if (JS_IsException(args[2]))
ret = JS_EXCEPTION;
else
ret = JS_Call(ctx, data->callback, JS_UNDEFINED, countof(args), args);
if (JS_IsException(ret) || JS_ToInt32(ctx, &ret_int, ret) < 0) {
js_std_dump_error(ctx);
ret_int = -1;
}
JS_FreeValue(ctx, ret);
for (i = 0; i < countof(args); i++) {
JS_FreeValue(ctx, args[i]);
}
return ret_int;
}
static const struct lws_protocols client_protocols[] = {
{ "lws-client", client_callback, 0, 0, 0, NULL, 0 },
{ NULL, NULL, 0, 0, 0, NULL, 0 }
};
static JSValue js_decode_utf8(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv)
{
size_t size;
uint8_t *ptr = JS_GetArrayBuffer(ctx, &size, argv[0]);
if (ptr == NULL)
return JS_EXCEPTION;
return JS_NewStringLen(ctx, (const char *)ptr, size);
}
static JSValue js_lws_set_log_level(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv)
{
int32_t level;
if (JS_ToInt32(ctx, &level, argv[0]) < 0)
return JS_EXCEPTION;
lws_set_log_level(level, NULL);
return JS_UNDEFINED;
}
static JSValue js_lws_create_context(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv)
{
int secure;
JSValue obj;
js_lws_context_data_t *data;
struct lws_context_creation_info info;
struct lws_context *context;
if (!JS_IsFunction(ctx, argv[0]))
return JS_ThrowTypeError(ctx, "not a function");
secure = JS_ToBool(ctx, argv[1]);
if (secure < 0)
return JS_EXCEPTION;
obj = JS_NewObjectClass(ctx, js_lws_context_class_id);
if (JS_IsException(obj))
return obj;
data = js_mallocz(ctx, sizeof(js_lws_context_data_t));
if (data == NULL) {
JS_FreeValue(ctx, obj);
return JS_EXCEPTION;
}
data->callback = JS_UNDEFINED;
memset(&info, 0, sizeof(info));
info.port = CONTEXT_PORT_NO_LISTEN;
info.protocols = client_protocols;
info.gid = -1;
info.uid = -1;
info.options = secure ? LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT : 0;
info.user = data;
context = lws_create_context(&info);
if (context == NULL) {
JS_FreeValue(ctx, obj);
js_free(ctx, data);
return JS_ThrowOutOfMemory(ctx);
}
data->context = context;
data->ctx = JS_DupContext(ctx);
data->callback = JS_DupValue(ctx, argv[0]);
JS_SetOpaque(obj, data);
return obj;
}
static void js_lws_context_finalizer(JSRuntime *rt, JSValue val)
{
js_lws_context_data_t *data = JS_GetOpaque(val, js_lws_context_class_id);
if (data) {
JS_FreeContext(data->ctx);
data->ctx = NULL;
JS_FreeValueRT(rt, data->callback);
data->callback = JS_UNDEFINED;
lws_context_destroy(data->context);
while (data->wsi_list) {
unlink_wsi_rt(rt, data, data->wsi_list);
}
js_free_rt(rt, data);
}
}
static void js_lws_context_mark(JSRuntime *rt, JSValue val,
JS_MarkFunc *mark_func)
{
js_lws_context_data_t *data = JS_GetOpaque(val, js_lws_context_class_id);
if (data) {
js_lws_wsi_data_t *wd;
mark_func(rt, (JSGCObjectHeader *)data->ctx);
JS_MarkValue(rt, data->callback, mark_func);
for (wd = data->wsi_list; wd; wd = wd->next) {
JS_MarkValue(rt, wd->object, mark_func);
}
}
}
static JSValue js_lws_context_get_connections(JSContext *ctx,
JSValueConst this_val)
{
js_lws_context_data_t *data = JS_GetOpaque2(ctx, this_val,
js_lws_context_class_id);
int32_t connections = 0;
js_lws_wsi_data_t *wd;
if (data == NULL)
return JS_EXCEPTION;
for (wd = data->wsi_list; wd; wd = wd->next) {
connections++;
}
return JS_NewInt32(ctx, connections);
}
static JSValue js_lws_client_connect(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv)
{
js_lws_context_data_t *data = JS_GetOpaque2(ctx, this_val,
js_lws_context_class_id);
const char *address = NULL;
int32_t port;
int secure;
const char *path = NULL, *host = NULL, *origin = NULL, *protocol = NULL;
JSValue obj = JS_UNDEFINED, ret = JS_EXCEPTION;
js_lws_wsi_data_t *wsi_data;
struct lws_client_connect_info info;
if (data == NULL)
return JS_EXCEPTION;
address = JS_ToCString(ctx, argv[0]);
if (address == NULL)
goto exception;
if (JS_ToInt32(ctx, &port, argv[1]) < 0)
goto exception;
if (port < 1 || port > 65535) {
JS_ThrowRangeError(ctx, "port must be between 1 and 65535");
goto exception;
}
secure = JS_ToBool(ctx, argv[2]);
if (secure < 0)
goto exception;
path = JS_ToCString(ctx, argv[3]);
if (path == NULL)
goto exception;
host = JS_ToCString(ctx, argv[4]);
if (host == NULL)
goto exception;
if (!JS_IsUndefined(argv[5]) && !JS_IsNull(argv[5])) {
origin = JS_ToCString(ctx, argv[5]);
if (origin == NULL)
goto exception;
}
if (!JS_IsUndefined(argv[6]) && !JS_IsNull(argv[6])) {
protocol = JS_ToCString(ctx, argv[6]);
if (protocol == NULL)
goto exception;
}
obj = JS_NewObjectClass(ctx, js_lws_wsi_class_id);
if (JS_IsException(obj))
goto exception;
wsi_data = js_mallocz(ctx, sizeof(js_lws_wsi_data_t));
if (wsi_data == NULL)
goto exception;
wsi_data->next = data->wsi_list;
wsi_data->object = JS_DupValue(ctx, obj);
wsi_data->context = JS_DupValue(ctx, this_val);
wsi_data->user = JS_DupValue(ctx, argv[7]);
wsi_data->in_use = WSI_DATA_USE_OBJECT | WSI_DATA_USE_LINKED;
data->wsi_list = wsi_data;
JS_SetOpaque(obj, wsi_data);
memset(&info, 0, sizeof(info));
info.context = data->context;
info.address = address;
info.port = port;
info.ssl_connection = secure ? LCCSCF_USE_SSL : 0;
info.local_protocol_name = "lws-client";
info.path = path;
info.host = host;
info.origin = origin;
info.protocol = protocol;
info.ietf_version_or_minus_one = -1;
info.userdata = wsi_data;
info.pwsi = &wsi_data->wsi;
lws_client_connect_via_info(&info);
if (wsi_data->wsi) {
ret = JS_DupValue(ctx, obj);
} else {
unlink_wsi(ctx, data, wsi_data);
JS_ThrowReferenceError(ctx, "cannot connect to [%s]:%d (%s)",
address, port, secure ? "wss" : "ws");
}
exception:
JS_FreeCString(ctx, address);
JS_FreeCString(ctx, path);
JS_FreeCString(ctx, host);
JS_FreeCString(ctx, origin);
JS_FreeCString(ctx, protocol);
JS_FreeValue(ctx, obj);
return ret;
}
static JSValue js_lws_service_fd(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv)
{
js_lws_context_data_t *data = JS_GetOpaque2(ctx, this_val,
js_lws_context_class_id);
int32_t fd, events, revents;
struct lws_pollfd pfd;
if (data == NULL)
return JS_EXCEPTION;
if (JS_ToInt32(ctx, &fd, argv[0]) < 0)
return JS_EXCEPTION;
if (JS_ToInt32(ctx, &events, argv[1]) < 0)
return JS_EXCEPTION;
if (JS_ToInt32(ctx, &revents, argv[2]) < 0)
return JS_EXCEPTION;
pfd.fd = fd;
pfd.events = events;
pfd.revents = revents;
lws_service_fd(data->context, &pfd);
return JS_NewInt32(ctx,
lws_service_adjust_timeout(data->context, MAX_WAIT, 0));
}
static JSValue js_lws_service_periodic(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv)
{
js_lws_context_data_t *data = JS_GetOpaque2(ctx, this_val,
js_lws_context_class_id);
int timeout;
if (data == NULL)
return JS_EXCEPTION;
#if LWS_LIBRARY_VERSION_NUMBER < 3002000
lws_service_fd(data->context, NULL);
#endif
timeout = lws_service_adjust_timeout(data->context, MAX_WAIT, 0);
if (timeout == 0) {
lws_service(data->context, -1);
timeout = lws_service_adjust_timeout(data->context, MAX_WAIT, 0);
}
return JS_NewInt32(ctx, timeout);
}
static void js_lws_wsi_finalizer(JSRuntime *rt, JSValue val)
{
js_lws_wsi_data_t *data = JS_GetOpaque(val, js_lws_wsi_class_id);
if (data) {
JS_FreeValueRT(rt, data->context);
data->context = JS_UNDEFINED;
JS_FreeValueRT(rt, data->user);
data->user = JS_UNDEFINED;
data->in_use &= ~WSI_DATA_USE_OBJECT;
if (data->in_use == 0)
free_wsi_data_rt(rt, data);
}
}
static void js_lws_wsi_mark(JSRuntime *rt, JSValue val,
JS_MarkFunc *mark_func)
{
js_lws_wsi_data_t *data = JS_GetOpaque(val, js_lws_wsi_class_id);
if (data) {
JS_MarkValue(rt, data->context, mark_func);
JS_MarkValue(rt, data->user, mark_func);
}
}
static JSValue js_lws_wsi_get_context(JSContext *ctx, JSValueConst this_val)
{
js_lws_wsi_data_t *data = JS_GetOpaque2(ctx, this_val, js_lws_wsi_class_id);
if (data == NULL)
return JS_EXCEPTION;
return JS_DupValue(ctx, data->context);
}
static JSValue js_lws_wsi_get_user(JSContext *ctx, JSValueConst this_val)
{
js_lws_wsi_data_t *data = JS_GetOpaque2(ctx, this_val, js_lws_wsi_class_id);
if (data == NULL)
return JS_EXCEPTION;
return JS_DupValue(ctx, data->user);
}
static JSValue js_lws_wsi_get_hdr(JSContext *ctx, JSValueConst this_val,
int magic)
{
js_lws_wsi_data_t *data = JS_GetOpaque2(ctx, this_val, js_lws_wsi_class_id);
int len;
char *str;
JSValue ret;
if (data == NULL)
return JS_EXCEPTION;
if (data->wsi == NULL)
return JS_ThrowTypeError(ctx, "defunct WSI");
len = lws_hdr_total_length(data->wsi, magic);
if (len < 0)
return JS_ThrowReferenceError(ctx, "HTTP headers unavailable");
len++;
str = js_mallocz(ctx, len);
if (str == NULL)
return JS_EXCEPTION;
len = lws_hdr_copy(data->wsi, str, len, magic);
if (len < 0)
ret = JS_ThrowReferenceError(ctx, "HTTP headers unavailable");
else
ret = JS_NewStringLen(ctx, str, len);
js_free(ctx, str);
return ret;
}
static JSValue js_lws_is_final_fragment(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv)
{
js_lws_wsi_data_t *data = JS_GetOpaque2(ctx, this_val, js_lws_wsi_class_id);
if (data == NULL)
return JS_EXCEPTION;
if (data->wsi == NULL)
return JS_ThrowTypeError(ctx, "defunct WSI");
return JS_NewBool(ctx, lws_is_final_fragment(data->wsi));
}
static JSValue js_lws_is_first_fragment(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv)
{
js_lws_wsi_data_t *data = JS_GetOpaque2(ctx, this_val, js_lws_wsi_class_id);
if (data == NULL)
return JS_EXCEPTION;
if (data->wsi == NULL)
return JS_ThrowTypeError(ctx, "defunct WSI");
return JS_NewBool(ctx, lws_is_first_fragment(data->wsi));
}
static JSValue js_lws_frame_is_binary(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv)
{
js_lws_wsi_data_t *data = JS_GetOpaque2(ctx, this_val, js_lws_wsi_class_id);
if (data == NULL)
return JS_EXCEPTION;
if (data->wsi == NULL)
return JS_ThrowTypeError(ctx, "defunct WSI");
return JS_NewBool(ctx, lws_frame_is_binary(data->wsi));
}
static JSValue js_lws_callback_on_writable(JSContext *ctx,
JSValueConst this_val,
int argc, JSValueConst *argv)
{
js_lws_wsi_data_t *data = JS_GetOpaque2(ctx, this_val, js_lws_wsi_class_id);
if (data == NULL)
return JS_EXCEPTION;
if (data->wsi == NULL)
return JS_ThrowTypeError(ctx, "defunct WSI");
lws_callback_on_writable(data->wsi);
return JS_UNDEFINED;
}
static JSValue js_lws_write(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv)
{
js_lws_wsi_data_t *data = JS_GetOpaque2(ctx, this_val, js_lws_wsi_class_id);
const char *str = NULL;
const uint8_t *ptr;
uint8_t *buf;
size_t size;
enum lws_write_protocol protocol;
int ret;
if (data == NULL)
return JS_EXCEPTION;
if (data->wsi == NULL)
return JS_ThrowTypeError(ctx, "defunct WSI");
if (JS_IsString(argv[0])) {
str = JS_ToCStringLen(ctx, &size, argv[0]);
if (str == NULL)
return JS_EXCEPTION;
ptr = (const uint8_t *)str;
protocol = LWS_WRITE_TEXT;
} else {
ptr = JS_GetArrayBuffer(ctx, &size, argv[0]);
if (ptr == NULL)
return JS_EXCEPTION;
protocol = LWS_WRITE_BINARY;
}
buf = js_malloc(ctx, LWS_PRE + size);
if (buf)
memcpy(buf + LWS_PRE, ptr, size);
if (str)
JS_FreeCString(ctx, str);
if (buf == NULL)
return JS_EXCEPTION;
ret = lws_write(data->wsi, buf + LWS_PRE, size, protocol);
js_free(ctx, buf);
if (ret < 0)
return JS_ThrowTypeError(ctx, "WSI not writable");
return JS_UNDEFINED;
}
static JSValue js_lws_close_reason(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv)
{
js_lws_wsi_data_t *data = JS_GetOpaque2(ctx, this_val, js_lws_wsi_class_id);
int32_t status;
const char *reason = NULL;
size_t len = 0;
if (data == NULL)
return JS_EXCEPTION;
if (data->wsi == NULL)
return JS_ThrowTypeError(ctx, "defunct WSI");
if (JS_ToInt32(ctx, &status, argv[0]) < 0)
return JS_EXCEPTION;
if (status < 0 || status > 65535)
return JS_ThrowRangeError(ctx, "status must be between 0 and 65535");
if (!JS_IsUndefined(argv[1])) {
reason = JS_ToCStringLen(ctx, &len, argv[1]);
if (reason == NULL)
return JS_EXCEPTION;
if (len > 123) {
JS_FreeCString(ctx, reason);
return JS_ThrowTypeError(ctx, "reason too long (%zu > 123)", len);
}
}
lws_close_reason(data->wsi, status, (uint8_t *)reason, len);
if (reason)
JS_FreeCString(ctx, reason);
return JS_UNDEFINED;
}
static const JSCFunctionListEntry js_lws_funcs[] = {
CDEF(LLL_ERR),
CDEF(LLL_WARN),
CDEF(LLL_NOTICE),
CDEF(LLL_INFO),
CDEF(LLL_DEBUG),
CDEF(LLL_PARSER),
CDEF(LLL_HEADER),
CDEF(LLL_EXT),
CDEF(LLL_CLIENT),
CDEF(LLL_LATENCY),
CDEF(LLL_USER),
CDEF(LLL_THREAD),
CDEF(LLL_COUNT),
CDEF(LWS_CALLBACK_PROTOCOL_INIT),
CDEF(LWS_CALLBACK_PROTOCOL_DESTROY),
CDEF(LWS_CALLBACK_WSI_CREATE),
CDEF(LWS_CALLBACK_WSI_DESTROY),
CDEF(LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS),
CDEF(LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS),
CDEF(LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION),
CDEF(LWS_CALLBACK_OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY),
CDEF(LWS_CALLBACK_SSL_INFO),
CDEF(LWS_CALLBACK_OPENSSL_PERFORM_SERVER_CERT_VERIFICATION),
CDEF(LWS_CALLBACK_SERVER_NEW_CLIENT_INSTANTIATED),
CDEF(LWS_CALLBACK_HTTP),
CDEF(LWS_CALLBACK_HTTP_BODY),
CDEF(LWS_CALLBACK_HTTP_BODY_COMPLETION),
CDEF(LWS_CALLBACK_HTTP_FILE_COMPLETION),
CDEF(LWS_CALLBACK_HTTP_WRITEABLE),
CDEF(LWS_CALLBACK_CLOSED_HTTP),
CDEF(LWS_CALLBACK_FILTER_HTTP_CONNECTION),
CDEF(LWS_CALLBACK_ADD_HEADERS),
CDEF(LWS_CALLBACK_CHECK_ACCESS_RIGHTS),
CDEF(LWS_CALLBACK_PROCESS_HTML),
CDEF(LWS_CALLBACK_HTTP_BIND_PROTOCOL),
CDEF(LWS_CALLBACK_HTTP_DROP_PROTOCOL),
CDEF(LWS_CALLBACK_HTTP_CONFIRM_UPGRADE),
CDEF(LWS_CALLBACK_ESTABLISHED_CLIENT_HTTP),
CDEF(LWS_CALLBACK_CLOSED_CLIENT_HTTP),
CDEF(LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ),
CDEF(LWS_CALLBACK_RECEIVE_CLIENT_HTTP),
CDEF(LWS_CALLBACK_COMPLETED_CLIENT_HTTP),
CDEF(LWS_CALLBACK_CLIENT_HTTP_WRITEABLE),
CDEF(LWS_CALLBACK_CLIENT_HTTP_BIND_PROTOCOL),
CDEF(LWS_CALLBACK_CLIENT_HTTP_DROP_PROTOCOL),
CDEF(LWS_CALLBACK_ESTABLISHED),
CDEF(LWS_CALLBACK_CLOSED),
CDEF(LWS_CALLBACK_SERVER_WRITEABLE),
CDEF(LWS_CALLBACK_RECEIVE),
CDEF(LWS_CALLBACK_RECEIVE_PONG),
CDEF(LWS_CALLBACK_WS_PEER_INITIATED_CLOSE),
CDEF(LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION),
CDEF(LWS_CALLBACK_CONFIRM_EXTENSION_OKAY),
CDEF(LWS_CALLBACK_WS_SERVER_BIND_PROTOCOL),
CDEF(LWS_CALLBACK_WS_SERVER_DROP_PROTOCOL),
CDEF(LWS_CALLBACK_CLIENT_CONNECTION_ERROR),
CDEF(LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH),
CDEF(LWS_CALLBACK_CLIENT_ESTABLISHED),
CDEF(LWS_CALLBACK_CLIENT_CLOSED),
CDEF(LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER),
CDEF(LWS_CALLBACK_CLIENT_RECEIVE),
CDEF(LWS_CALLBACK_CLIENT_RECEIVE_PONG),
CDEF(LWS_CALLBACK_CLIENT_WRITEABLE),
CDEF(LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED),
CDEF(LWS_CALLBACK_WS_EXT_DEFAULTS),
CDEF(LWS_CALLBACK_FILTER_NETWORK_CONNECTION),
CDEF(LWS_CALLBACK_WS_CLIENT_BIND_PROTOCOL),
CDEF(LWS_CALLBACK_WS_CLIENT_DROP_PROTOCOL),
CDEF(LWS_CALLBACK_GET_THREAD_ID),
CDEF(LWS_CALLBACK_ADD_POLL_FD),
CDEF(LWS_CALLBACK_DEL_POLL_FD),
CDEF(LWS_CALLBACK_CHANGE_MODE_POLL_FD),
CDEF(LWS_CALLBACK_LOCK_POLL),
CDEF(LWS_CALLBACK_UNLOCK_POLL),
CDEF(LWS_CALLBACK_CGI),
CDEF(LWS_CALLBACK_CGI_TERMINATED),
CDEF(LWS_CALLBACK_CGI_STDIN_DATA),
CDEF(LWS_CALLBACK_CGI_STDIN_COMPLETED),
CDEF(LWS_CALLBACK_CGI_PROCESS_ATTACH),
CDEF(LWS_CALLBACK_SESSION_INFO),
CDEF(LWS_CALLBACK_GS_EVENT),
CDEF(LWS_CALLBACK_HTTP_PMO),
CDEF(LWS_CALLBACK_RAW_RX),
CDEF(LWS_CALLBACK_RAW_CLOSE),
CDEF(LWS_CALLBACK_RAW_WRITEABLE),
CDEF(LWS_CALLBACK_RAW_ADOPT),
CDEF(LWS_CALLBACK_RAW_SKT_BIND_PROTOCOL),
CDEF(LWS_CALLBACK_RAW_SKT_DROP_PROTOCOL),
CDEF(LWS_CALLBACK_RAW_ADOPT_FILE),
CDEF(LWS_CALLBACK_RAW_RX_FILE),
CDEF(LWS_CALLBACK_RAW_WRITEABLE_FILE),
CDEF(LWS_CALLBACK_RAW_CLOSE_FILE),
CDEF(LWS_CALLBACK_RAW_FILE_BIND_PROTOCOL),
CDEF(LWS_CALLBACK_RAW_FILE_DROP_PROTOCOL),
CDEF(LWS_CALLBACK_TIMER),
CDEF(LWS_CALLBACK_EVENT_WAIT_CANCELLED),
CDEF(LWS_CALLBACK_CHILD_CLOSING),
CDEF(LWS_CALLBACK_VHOST_CERT_AGING),
CDEF(LWS_CALLBACK_VHOST_CERT_UPDATE),
CDEF(LWS_CALLBACK_USER),
CDEF(LWS_POLLHUP),
CDEF(LWS_POLLIN),
CDEF(LWS_POLLOUT),
JS_CFUNC_DEF("decode_utf8", 1, js_decode_utf8),
JS_CFUNC_DEF("set_log_level", 1, js_lws_set_log_level),
JS_CFUNC_DEF("create_context", 2, js_lws_create_context),
};
static const JSClassDef js_lws_context_class = {
"Context",
.finalizer = js_lws_context_finalizer,
.gc_mark = js_lws_context_mark,
};
static const JSCFunctionListEntry js_lws_context_proto_funcs[] = {
JS_CGETSET_DEF("connections", js_lws_context_get_connections, NULL),
JS_CFUNC_DEF("client_connect", 8, js_lws_client_connect),
JS_CFUNC_DEF("service_fd", 3, js_lws_service_fd),
JS_CFUNC_DEF("service_periodic", 0, js_lws_service_periodic),
};
static const JSClassDef js_lws_wsi_class = {
"WSI",
.finalizer = js_lws_wsi_finalizer,
.gc_mark = js_lws_wsi_mark,
};
#define HDRGET(name) JS_CGETSET_MAGIC_DEF(#name, js_lws_wsi_get_hdr, NULL, name)
static const JSCFunctionListEntry js_lws_wsi_proto_funcs[] = {
JS_CGETSET_DEF("context", js_lws_wsi_get_context, NULL),
JS_CGETSET_DEF("user", js_lws_wsi_get_user, NULL),
HDRGET(WSI_TOKEN_GET_URI),
HDRGET(WSI_TOKEN_POST_URI),
HDRGET(WSI_TOKEN_OPTIONS_URI),
HDRGET(WSI_TOKEN_HOST),
HDRGET(WSI_TOKEN_CONNECTION),
HDRGET(WSI_TOKEN_UPGRADE),
HDRGET(WSI_TOKEN_ORIGIN),
HDRGET(WSI_TOKEN_DRAFT),
HDRGET(WSI_TOKEN_CHALLENGE),
HDRGET(WSI_TOKEN_EXTENSIONS),
HDRGET(WSI_TOKEN_KEY1),
HDRGET(WSI_TOKEN_KEY2),
HDRGET(WSI_TOKEN_PROTOCOL),
HDRGET(WSI_TOKEN_ACCEPT),
HDRGET(WSI_TOKEN_NONCE),
HDRGET(WSI_TOKEN_HTTP),
HDRGET(WSI_TOKEN_HTTP2_SETTINGS),
HDRGET(WSI_TOKEN_HTTP_ACCEPT),
HDRGET(WSI_TOKEN_HTTP_AC_REQUEST_HEADERS),
HDRGET(WSI_TOKEN_HTTP_IF_MODIFIED_SINCE),
HDRGET(WSI_TOKEN_HTTP_IF_NONE_MATCH),
HDRGET(WSI_TOKEN_HTTP_ACCEPT_ENCODING),
HDRGET(WSI_TOKEN_HTTP_ACCEPT_LANGUAGE),
HDRGET(WSI_TOKEN_HTTP_PRAGMA),
HDRGET(WSI_TOKEN_HTTP_CACHE_CONTROL),
HDRGET(WSI_TOKEN_HTTP_AUTHORIZATION),
HDRGET(WSI_TOKEN_HTTP_COOKIE),
HDRGET(WSI_TOKEN_HTTP_CONTENT_LENGTH),
HDRGET(WSI_TOKEN_HTTP_CONTENT_TYPE),
HDRGET(WSI_TOKEN_HTTP_DATE),
HDRGET(WSI_TOKEN_HTTP_RANGE),
HDRGET(WSI_TOKEN_HTTP_REFERER),
HDRGET(WSI_TOKEN_KEY),
HDRGET(WSI_TOKEN_VERSION),
HDRGET(WSI_TOKEN_SWORIGIN),
HDRGET(WSI_TOKEN_HTTP_COLON_AUTHORITY),
HDRGET(WSI_TOKEN_HTTP_COLON_METHOD),
HDRGET(WSI_TOKEN_HTTP_COLON_PATH),
HDRGET(WSI_TOKEN_HTTP_COLON_SCHEME),
HDRGET(WSI_TOKEN_HTTP_COLON_STATUS),
HDRGET(WSI_TOKEN_HTTP_ACCEPT_CHARSET),
HDRGET(WSI_TOKEN_HTTP_ACCEPT_RANGES),
HDRGET(WSI_TOKEN_HTTP_ACCESS_CONTROL_ALLOW_ORIGIN),
HDRGET(WSI_TOKEN_HTTP_AGE),
HDRGET(WSI_TOKEN_HTTP_ALLOW),
HDRGET(WSI_TOKEN_HTTP_CONTENT_DISPOSITION),
HDRGET(WSI_TOKEN_HTTP_CONTENT_ENCODING),
HDRGET(WSI_TOKEN_HTTP_CONTENT_LANGUAGE),
HDRGET(WSI_TOKEN_HTTP_CONTENT_LOCATION),
HDRGET(WSI_TOKEN_HTTP_CONTENT_RANGE),
HDRGET(WSI_TOKEN_HTTP_ETAG),
HDRGET(WSI_TOKEN_HTTP_EXPECT),
HDRGET(WSI_TOKEN_HTTP_EXPIRES),
HDRGET(WSI_TOKEN_HTTP_FROM),
HDRGET(WSI_TOKEN_HTTP_IF_MATCH),
HDRGET(WSI_TOKEN_HTTP_IF_RANGE),
HDRGET(WSI_TOKEN_HTTP_IF_UNMODIFIED_SINCE),
HDRGET(WSI_TOKEN_HTTP_LAST_MODIFIED),
HDRGET(WSI_TOKEN_HTTP_LINK),
HDRGET(WSI_TOKEN_HTTP_LOCATION),
HDRGET(WSI_TOKEN_HTTP_MAX_FORWARDS),
HDRGET(WSI_TOKEN_HTTP_PROXY_AUTHENTICATE),
HDRGET(WSI_TOKEN_HTTP_PROXY_AUTHORIZATION),
HDRGET(WSI_TOKEN_HTTP_REFRESH),
HDRGET(WSI_TOKEN_HTTP_RETRY_AFTER),
HDRGET(WSI_TOKEN_HTTP_SERVER),
HDRGET(WSI_TOKEN_HTTP_SET_COOKIE),
HDRGET(WSI_TOKEN_HTTP_STRICT_TRANSPORT_SECURITY),
HDRGET(WSI_TOKEN_HTTP_TRANSFER_ENCODING),
HDRGET(WSI_TOKEN_HTTP_USER_AGENT),
HDRGET(WSI_TOKEN_HTTP_VARY),
HDRGET(WSI_TOKEN_HTTP_VIA),
HDRGET(WSI_TOKEN_HTTP_WWW_AUTHENTICATE),
HDRGET(WSI_TOKEN_PATCH_URI),
HDRGET(WSI_TOKEN_PUT_URI),
HDRGET(WSI_TOKEN_DELETE_URI),
HDRGET(WSI_TOKEN_HTTP_URI_ARGS),
HDRGET(WSI_TOKEN_PROXY),
HDRGET(WSI_TOKEN_HTTP_X_REAL_IP),
HDRGET(WSI_TOKEN_HTTP1_0),
HDRGET(WSI_TOKEN_X_FORWARDED_FOR),
HDRGET(WSI_TOKEN_CONNECT),
HDRGET(WSI_TOKEN_HEAD_URI),
HDRGET(WSI_TOKEN_TE),
HDRGET(WSI_TOKEN_REPLAY_NONCE),
HDRGET(WSI_TOKEN_COLON_PROTOCOL),
HDRGET(WSI_TOKEN_X_AUTH_TOKEN),
JS_CFUNC_DEF("is_final_fragment", 0, js_lws_is_final_fragment),
JS_CFUNC_DEF("is_first_fragment", 0, js_lws_is_first_fragment),
JS_CFUNC_DEF("frame_is_binary", 0, js_lws_frame_is_binary),
JS_CFUNC_DEF("callback_on_writable", 0, js_lws_callback_on_writable),
JS_CFUNC_DEF("write", 1, js_lws_write),
JS_CFUNC_DEF("close_reason", 2, js_lws_close_reason),
};
static int js_lws_init(JSContext *ctx, JSModuleDef *m)
{
JSValue proto;
JS_NewClassID(&js_lws_context_class_id);
JS_NewClass(JS_GetRuntime(ctx), js_lws_context_class_id,
&js_lws_context_class);
proto = JS_NewObject(ctx);
JS_SetPropertyFunctionList(ctx, proto, js_lws_context_proto_funcs,
countof(js_lws_context_proto_funcs));
JS_SetClassProto(ctx, js_lws_context_class_id, proto);
JS_NewClassID(&js_lws_wsi_class_id);
JS_NewClass(JS_GetRuntime(ctx), js_lws_wsi_class_id, &js_lws_wsi_class);
proto = JS_NewObject(ctx);
JS_SetPropertyFunctionList(ctx, proto, js_lws_wsi_proto_funcs,
countof(js_lws_wsi_proto_funcs));
JS_SetClassProto(ctx, js_lws_wsi_class_id, proto);
return JS_SetModuleExportList(ctx, m, js_lws_funcs, countof(js_lws_funcs));
}
JSModuleDef *js_init_module(JSContext *ctx, const char *module_name)
{
JSModuleDef *m = JS_NewCModule(ctx, module_name, js_lws_init);
if (m == NULL)
return NULL;
JS_AddModuleExportList(ctx, m, js_lws_funcs, countof(js_lws_funcs));
return m;
}

View File

@@ -0,0 +1,415 @@
/*
* Copyright (c) 2020 Genexis B.V.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import * as os from 'os'
import * as lws from './lws-client.so'
const CONNECTING = 0
const OPEN = 1
const CLOSING = 2
const CLOSED = 3
const CLOSING1 = 0x10 | CLOSING
const CLOSING2 = 0x20 | CLOSING
function serviceScheduler (context) {
let running = false
let timeout = null
function schedule (time) {
if (timeout) os.clearTimeout(timeout)
timeout = running ? os.setTimeout(callback, time) : null
}
function callback () {
schedule(context.service_periodic())
}
return {
start: function () {
running = true
schedule(0)
},
stop: function () {
running = false
schedule(0)
},
reschedule: schedule
}
}
function fdHandler (fd, events, revents) {
return function () {
service.reschedule(context.service_fd(fd, events, revents))
}
}
function contextCallback (wsi, reason, arg) {
switch (reason) {
case lws.LWS_CALLBACK_ADD_POLL_FD:
service.start()
// fallthrough
case lws.LWS_CALLBACK_CHANGE_MODE_POLL_FD:
os.setReadHandler(
arg.fd,
(arg.events & lws.LWS_POLLIN)
? fdHandler(arg.fd, arg.events, lws.LWS_POLLIN)
: null
)
os.setWriteHandler(
arg.fd,
(arg.events & lws.LWS_POLLOUT)
? fdHandler(arg.fd, arg.events, lws.LWS_POLLOUT)
: null
)
break
case lws.LWS_CALLBACK_DEL_POLL_FD:
os.setReadHandler(arg.fd, null)
os.setWriteHandler(arg.fd, null)
break
case lws.LWS_CALLBACK_CLIENT_CONNECTION_ERROR:
wsi.user.error(typeof arg === 'string' ? arg : '')
break
case lws.LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH:
if (wsi.user.readyState !== CONNECTING) {
return -1
}
wsi.user.protocol = wsi.WSI_TOKEN_PROTOCOL
wsi.user.extensions = wsi.WSI_TOKEN_EXTENSIONS
break
case lws.LWS_CALLBACK_CLIENT_ESTABLISHED:
if (wsi.user.readyState !== CONNECTING) {
return -1
}
wsi.user.wsi = wsi
wsi.user.open()
break
case lws.LWS_CALLBACK_WS_PEER_INITIATED_CLOSE:
if (wsi.user.readyState === CLOSED) {
return -1
}
if (arg instanceof Array) {
wsi.user.closeEvent.code = arg[0]
wsi.user.closeEvent.reason = arg[1]
} else {
wsi.user.closeEvent.code = 1005
wsi.user.closeEvent.reason = ''
}
wsi.user.readyState = CLOSING2
break
case lws.LWS_CALLBACK_CLIENT_CLOSED:
wsi.user.close()
break
case lws.LWS_CALLBACK_CLIENT_RECEIVE:
if (!(arg instanceof ArrayBuffer) ||
wsi.user.readyState === CONNECTING ||
wsi.user.readyState === CLOSED) {
return -1
}
if (wsi.is_first_fragment()) {
wsi.user.inbuf = []
}
wsi.user.inbuf.push(arg)
if (wsi.is_final_fragment()) {
wsi.user.message(wsi.frame_is_binary())
}
break
case lws.LWS_CALLBACK_CLIENT_WRITEABLE:
if ((wsi.user.readyState === OPEN || wsi.user.readyState === CLOSING1) &&
wsi.user.outbuf.length > 0) {
const msg = wsi.user.outbuf.shift()
if (msg === null) {
wsi.user.readyState = CLOSING2
return -1
}
wsi.write(msg)
if (wsi.user.outbuf.length > 0) {
wsi.callback_on_writable()
}
}
break
case lws.LWS_CALLBACK_WSI_DESTROY:
if (wsi.context.connections === 0) service.stop()
break
}
return 0
}
lws.set_log_level(lws.LLL_ERR | lws.LLL_WARN)
const context = lws.create_context(contextCallback, true)
const service = serviceScheduler(context)
function arrayBufferJoin (bufs) {
if (!(bufs instanceof Array)) {
throw new TypeError('Array expected')
}
if (!bufs.every(function (val) { return val instanceof ArrayBuffer })) {
throw new TypeError('ArrayBuffer expected')
}
const len = bufs.reduce(function (acc, val) {
return acc + val.byteLength
}, 0)
const array = new Uint8Array(len)
let offset = 0
for (const b of bufs) {
array.set(new Uint8Array(b), offset)
offset += b.byteLength
}
return array.buffer
}
export function WebSocket (url, protocols) {
const pattern = /^(ws|wss):\/\/([^/?#]*)([^#]*)$/i
const match = pattern.exec(url)
if (match === null) {
throw new TypeError('invalid WebSocket URL')
}
const secure = match[1].toLowerCase() === 'wss'
const host = match[2]
const path = match[3].startsWith('/') ? match[3] : '/' + match[3]
const hostPattern = /^(?:([a-z\d.-]+)|\[([\da-f:]+:[\da-f.]*)\])(?::(\d*))?$/i
const hostMatch = hostPattern.exec(host)
if (hostMatch === null) {
throw new TypeError('invalid WebSocket URL')
}
const address = hostMatch[1] || hostMatch[2]
const port = hostMatch[3] ? parseInt(hostMatch[3]) : (secure ? 443 : 80)
const validPath = /^\/[A-Za-z0-9_.!~*'()%:@&=+$,;/?-]*$/
if (!validPath.test(path)) {
throw new TypeError('invalid WebSocket URL')
}
if (!(port >= 1 && port <= 65535)) {
throw new RangeError('port must be between 1 and 65535')
}
if (protocols === undefined) {
protocols = []
} else if (!(protocols instanceof Array)) {
protocols = [protocols]
}
const validProto = /^[A-Za-z0-9!#$%&'*+.^_|~-]+$/
if (!protocols.every(function (val) { return validProto.test(val) })) {
throw new TypeError('invalid WebSocket subprotocol name')
}
const proto = protocols.length > 0 ? protocols.join(', ') : null
const self = this
const state = {
url: url,
readyState: CONNECTING,
extensions: '',
protocol: '',
onopen: null,
onerror: null,
onclose: null,
onmessage: null,
wsi: null,
inbuf: [],
outbuf: [],
closeEvent: {
type: 'close',
code: 1005,
reason: '',
wasClean: false
},
open: function () {
if (state.readyState === CONNECTING) {
state.readyState = OPEN
if (state.onopen) {
state.onopen.call(self, { type: 'open' })
}
}
},
error: function (e) {
if (state.readyState !== CLOSED) {
state.closeEvent.code = 1006
state.closeEvent.reason = String(e)
state.readyState = CLOSED
try {
if (state.onerror) {
state.onerror.call(self, { type: 'error' })
}
} finally {
if (state.onclose) {
state.onclose.call(self, Object.assign({}, state.closeEvent))
}
}
}
},
close: function () {
if (state.readyState !== CLOSED) {
state.closeEvent.wasClean = true
state.readyState = CLOSED
if (state.onclose) {
state.onclose.call(self, Object.assign({}, state.closeEvent))
}
}
},
message: function (binary) {
if (state.inbuf.length > 0) {
const msg = state.inbuf.length === 1
? state.inbuf[0]
: arrayBufferJoin(state.inbuf)
state.inbuf = []
if (state.readyState === OPEN && state.onmessage) {
state.onmessage.call(self, {
type: 'messasge',
data: binary ? msg : lws.decode_utf8(msg)
})
}
}
}
}
this._wsState = state
os.setTimeout(function () {
try {
context.client_connect(
address, port, secure, path, host, null, proto, state
)
} catch (e) {
state.error(e)
}
}, 0)
}
const readyStateConstants = {
CONNECTING: { value: CONNECTING },
OPEN: { value: OPEN },
CLOSING: { value: CLOSING },
CLOSED: { value: CLOSED }
}
Object.defineProperties(WebSocket, readyStateConstants)
Object.defineProperties(WebSocket.prototype, readyStateConstants)
function checkNullOrFunction (val) {
if (val !== null && typeof val !== 'function') {
throw new TypeError('null or Function expected')
}
}
Object.defineProperties(WebSocket.prototype, {
url: { get: function () { return this._wsState.url } },
readyState: { get: function () { return this._wsState.readyState & 0xf } },
extensions: { get: function () { return this._wsState.extensions } },
protocol: { get: function () { return this._wsState.protocol } },
bufferedAmount: {
get: function () {
return this._wsState.outbuf.reduce(function (acc, val) {
if (val instanceof ArrayBuffer) {
acc += val.byteLength
} else if (typeof val === 'string') {
acc += val.length
}
return acc
}, 0)
}
},
binaryType: {
get: function () { return 'arraybuffer' },
set: function (val) {
if (val !== 'arraybuffer') {
throw new TypeError('only "arraybuffer" allowed for "binaryType"')
}
}
},
onopen: {
get: function () { return this._wsState.onopen },
set: function (val) {
checkNullOrFunction(val)
this._wsState.onopen = val
}
},
onerror: {
get: function () { return this._wsState.onerror },
set: function (val) {
checkNullOrFunction(val)
this._wsState.onerror = val
}
},
onclose: {
get: function () { return this._wsState.onclose },
set: function (val) {
checkNullOrFunction(val)
this._wsState.onclose = val
}
},
onmessage: {
get: function () { return this._wsState.onmessage },
set: function (val) {
checkNullOrFunction(val)
this._wsState.onmessage = val
}
}
})
WebSocket.prototype.close = function (code, reason) {
if (code !== undefined) {
code = Math.trunc(code)
reason = reason === undefined ? '' : String(reason)
if (code !== 1000 && !(code >= 3000 && code <= 4999)) {
throw new RangeError('code must be 1000 or between 3000 and 4999')
}
}
const state = this._wsState
if (state.readyState === OPEN) {
if (code !== undefined) {
state.wsi.close_reason(code, reason)
state.closeEvent.code = code
state.closeEvent.reason = reason
}
state.readyState = CLOSING1
state.outbuf.push(null)
state.wsi.callback_on_writable()
} else if (state.readyState === CONNECTING) {
state.readyState = CLOSING2
}
}
WebSocket.prototype.send = function (msg) {
const state = this._wsState
if (state.readyState === CONNECTING) {
throw new TypeError('send() not allowed in CONNECTING state')
}
if (msg instanceof ArrayBuffer) {
state.outbuf.push(msg.slice(0))
} else if (ArrayBuffer.isView(msg)) {
state.outbuf.push(
msg.buffer.slice(msg.byteOffset, msg.byteOffset + msg.byteLength)
)
} else {
state.outbuf.push(String(msg))
}
if (state.readyState === OPEN) {
state.wsi.callback_on_writable()
}
}

55
quickjs/Makefile Normal file
View File

@@ -0,0 +1,55 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=quickjs
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/bellard/quickjs.git
PKG_SOURCE_DATE:=2020-11-08
PKG_SOURCE_VERSION:=204682fb87ab9312f0cf81f959ecd181180457bc
PKG_MIRROR_HASH:=skip
PKG_LICENSE:=MIT
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/quickjs
SECTION:=lang
CATEGORY:=Languages
TITLE:=QuickJS Javascript engine
URL:=https://bellard.org/quickjs/
MAINTAINER:=Erik Karlsson <erik.karlsson@genexis.eu>
DEPENDS:=+libatomic
endef
define Package/quickjs/description
QuickJS is a small and embeddable Javascript engine. It supports
the ES2020 specification including modules, asynchronous
generators, proxies and BigInt.
endef
MAKE_VARS += \
LIBS="-latomic"
MAKE_FLAGS = \
prefix=/usr \
CONFIG_SMALL=y \
CROSS_PREFIX="$(TARGET_CROSS)"
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib/quickjs
$(CP) $(PKG_INSTALL_DIR)/usr/lib/quickjs/libquickjs.a $(1)/usr/lib/quickjs/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/quickjs/libquickjs.lto.a $(1)/usr/lib/quickjs/
$(INSTALL_DIR) $(1)/usr/include/quickjs
$(CP) $(PKG_INSTALL_DIR)/usr/include/quickjs/quickjs.h $(1)/usr/include/quickjs/
$(CP) $(PKG_INSTALL_DIR)/usr/include/quickjs/quickjs-libc.h $(1)/usr/include/quickjs/
endef
define Package/quickjs/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/qjs $(1)/usr/bin/
endef
$(eval $(call BuildPackage,quickjs))

View File

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

View File

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

View File

@@ -5,14 +5,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=rulengd
PKG_VERSION:=1.2.3
PKG_VERSION:=1.2.4
PKG_RELEASE:=1
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_SOURCE_PROTO=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/rulengd.git
PKG_SOURCE_VERSION:=f5ded45562189a05f3912182d708bcb1427912f8
PKG_SOURCE_VERSION:=070a9778c2511a6f52a15904e29350aed69abdac
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}

View File

@@ -5,11 +5,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu
PKG_VERSION:=0.2.18
PKG_VERSION:=0.2.21
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/sulu.git
PKG_SOURCE_VERSION:=06411282a6c2d02d21599786c0dd12c00c711847
PKG_SOURCE_VERSION:=1cb1723f36718997968e923732fd6327a354689a
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz

View File

@@ -9,45 +9,9 @@ log() {
echo "${@}"|logger -t sulu.init -p debug
}
publish_endpoint() {
local AgentEndpointID serial oui user pass
local opt=""
# return if mosquitto_pub is not present
if ! which mosquitto_pub; then
log "mosquitto_pub not present can't publish endpointid"
return 0;
fi
ubus -t 10 wait_for usp.raw
# Get endpoint id from obuspa config first
config_load obuspa
config_get AgentEndpointID localagent EndpointID ""
if [ -z "${AgentEndpointID}" ]; then
serial=$(ubus -t 1 call usp.raw get '{"path":"Device.DeviceInfo.SerialNumber"}'|jsonfilter -e '@["parameters"][0].value')
oui=$(ubus -t 1 call usp.raw get '{"path":"Device.DeviceInfo.ManufacturerOUI"}'|jsonfilter -e '@["parameters"][0].value')
AgentEndpointID="os::${oui}-${serial}"
fi
config_get user localmqtt Username
if [ -n "${user}" ]; then
opt="-u ${user}"
fi
config_get pass localmqtt Password
if [ -n "${pass}" ]; then
opt="${opt} -P ${pass}"
fi
# publish Agent's EndpointID in mosquito broker for discovery
# This is a work around till obuspa does not support advertising
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker"
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}" ${opt}
}
start_service() {
procd_open_instance sulu
publish_endpoint
# append sulu connection injection
procd_close_instance
}

View File

@@ -1,18 +0,0 @@
# proxy required for nginx to save the file
location /upload_proxy {
return 200 "File upload is successful \n";
}
location /upload {
limit_except POST { deny all; }
client_body_temp_path /tmp/sulu; # the directory to which uploads will be saved, make sure to create the directory you wish to use
client_body_in_file_only on;
client_body_buffer_size 128K;
client_max_body_size 50M;
proxy_pass_request_headers on;
proxy_set_header X-FILE $request_body_file;
proxy_set_body $request_body_file;
proxy_redirect off;
#proxy_pass is necessary. body is only stored when being passed to middleware, so we are providing a proxy that just returns 200.
proxy_pass http://127.0.0.1:8080/upload_proxy;
}

View File

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

View File

@@ -6,14 +6,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=swmodd
PKG_VERSION:=2.0.5
PKG_VERSION:=2.0.15
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=682967eaab558d7c4e4559d3a37e3a79a5492485
PKG_SOURCE_VERSION:=39e711d51eed6d6268b18011cf7c40fc71eb332e
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/swmodd.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -22,10 +22,11 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/swmodd
SECTION:=utils
CATEGORY:=Utilities
TITLE:= Software Modules Daemon
DEPENDS:=+libuci +libubox +ubus +libuuid +libbbf_api +opkg \
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:= Software Modules Daemon
DEPENDS:=+libuci +libubox +ubus +libuuid +libbbf_api +opkg +libcurl \
+PACKAGE_liblxc:liblxc +PACKAGE_liblxc:cgroupfs-mount \
+@BUSYBOX_CONFIG_BUSYBOX +@BUSYBOX_CONFIG_FEATURE_SHOW_SCRIPT
endef
@@ -54,7 +55,6 @@ define Package/swmodd/install
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
$(INSTALL_DIR) $(1)/etc/swmod
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_CONF) ./files/map_du $(1)/etc/swmod/map_du
$(INSTALL_BIN) ./files/swmodd.init $(1)/etc/init.d/swmodd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/swmodd $(1)/usr/sbin/swmodd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libswmodd.so $(1)/usr/lib/bbfdm/libswmodd.so

View File

View File

@@ -8,9 +8,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=twamp
PKG_VERSION:=1.0.0
PKG_VERSION:=1.0.1
PKG_SOURCE_VERSION:=f6e914508aa1f7458f87bd68026f56262595d9a5
PKG_SOURCE_VERSION:=dbddaa0c4d826dfdf37bb92f98a2b2ad23035ca3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/twamp.git

14
uspd/Config.in Normal file
View File

@@ -0,0 +1,14 @@
if PACKAGE_uspd
menu "Configuration"
config USPD_MAX_MSG_LEN
int "Maximum message length"
default 10485760
help
Set the maximum data length allowed over ubus in Bytes.
This value should not be larger than UBUS_MAX_MSGLEN from ubusd.
The maximum blob message length allowed is:
(configured value - 128) bytes
endmenu
endif

View File

@@ -5,14 +5,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=uspd
PKG_VERSION:=2.1.25
PKG_VERSION:=2.1.39
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=b1c599287ee41b1af88d1fe9a5d553b3275cf225
PKG_SOURCE_VERSION:=718d0b24529d94b7bec09b6ffc6c3f84073d7bde
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/uspd.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -25,8 +25,10 @@ include $(INCLUDE_DIR)/package.mk
define Package/uspd
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=USP ubus backend
DEPENDS:=+libubox +ubus +libbbfdm
DEPENDS:=+libubox +ubus +libbbfdm +@BBFDM_ENABLE_JSON_PLUGIN +@BBFDM_ENABLE_DOTSO_PLUGIN \
+@BBF_TR181 +@BBF_TR104 +@BBF_TR143
endef
define Package/uspd/description
@@ -34,10 +36,14 @@ define Package/uspd/description
running on top of it.
endef
define Package/uspd/config
source "$(SOURCE)/Config.in"
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-D_GNU_SOURCE
-D_GNU_SOURCE \
-DUSPD_MAX_MSG_LEN=$(CONFIG_USPD_MAX_MSG_LEN)
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
@@ -48,8 +54,10 @@ endif
define Package/uspd/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_BIN) ./files/uspd.init $(1)/etc/init.d/uspd
$(INSTALL_CONF) ./files/uspd.config $(1)/etc/config/uspd
$(INSTALL_DIR) $(1)/etc/bbfdm/json/
$(INSTALL_BIN) ./files/etc/init.d/uspd $(1)/etc/init.d/uspd
$(INSTALL_CONF) ./files/etc/config/uspd $(1)/etc/config/uspd
$(INSTALL_DATA) ./files/etc/bbfdm/json/transferComplete.json $(1)/etc/bbfdm/json/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uspd $(1)/usr/sbin/
endef

View File

@@ -0,0 +1,132 @@
{
"Device.LocalAgent.": {
"type": "object",
"version": "2.12",
"protocols": [
"usp"
],
"access": false,
"array": false,
"TransferComplete!": {
"type": "event",
"version": "2.12",
"protocols": [
"usp"
],
"Command": {
"type": "string",
"read": true,
"write": true,
"version": "2.12",
"protocols": [
"usp"
],
"datatype": "string"
},
"CommandKey": {
"type": "string",
"read": true,
"write": true,
"version": "2.12",
"protocols": [
"usp"
],
"datatype": "string"
},
"Requestor": {
"type": "string",
"read": true,
"write": true,
"version": "2.12",
"protocols": [
"usp"
],
"datatype": "string"
},
"TransferType": {
"type": "string",
"read": true,
"write": true,
"version": "2.12",
"protocols": [
"usp"
],
"datatype": "string",
"enumerations": [
"Download",
"Upload"
]
},
"Affected": {
"type": "string",
"read": true,
"write": true,
"version": "2.12",
"protocols": [
"usp"
],
"datatype": "string"
},
"TransferURL": {
"type": "string",
"read": true,
"write": true,
"version": "2.12",
"protocols": [
"usp"
],
"datatype": "URL",
"range": [
{
"max": 2048
}
]
},
"StartTime": {
"type": "dateTime",
"read": true,
"write": true,
"version": "2.12",
"protocols": [
"usp"
],
"datatype": "dateTime"
},
"CompleteTime": {
"type": "dateTime",
"read": true,
"write": true,
"version": "2.12",
"protocols": [
"usp"
],
"datatype": "dateTime"
},
"FaultCode": {
"type": "unsignedInt",
"read": true,
"write": true,
"version": "2.12",
"protocols": [
"usp"
],
"datatype": "unsignedInt"
},
"FaultString": {
"type": "string",
"read": true,
"write": true,
"version": "2.12",
"protocols": [
"usp"
],
"datatype": "string",
"range": [
{
"max": 256
}
]
}
}
}
}

View File

@@ -1,6 +1,6 @@
#!/bin/sh /etc/rc.common
START=98
START=96
STOP=10
USE_PROCD=1
@@ -59,5 +59,5 @@ reload_service() {
service_triggers()
{
procd_add_config_trigger "config.change" "uspd" /etc/init.d/uspd restart
procd_add_reload_trigger "uspd"
}

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=wfa-capi
PKG_VERSION:=0.0.17
PKG_VERSION:=1.1.0
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=1079c7a76b3439f8f96ea478f34c59be4aaa99c6
PKG_SOURCE_VERSION:=189c59448ff33fd713a6a218206b18f0c613793a
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wfa-capi.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip

View File

@@ -7,7 +7,7 @@ USE_PROCD=1
start_service() {
procd_open_instance
procd_set_param command "/usr/sbin/capiagent"
procd_set_param command "/usr/sbin/capiagent" "-p 9000"
procd_set_param limits core="unlimited"
# procd_set_param respawn
# procd_set_param stdout 1

View File

@@ -5,10 +5,10 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=wfadatad
PKG_VERSION:=4.0.10
PKG_VERSION:=6.10.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=bb7d6e5ee04803bca2391c30cc035a7fab0f1353
PKG_SOURCE_VERSION:=74aa2efe7f3f835e02cab1f8965afabd918b1477
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wfadatad.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
@@ -25,19 +25,25 @@ include $(INCLUDE_DIR)/package.mk
define Package/wfadatad
SECTION:=utils
CATEGORY:=Utilities
TITLE:=WiFi Data Elements-1.0 Agent and Collector
TITLE:=WiFi DataElements Agent
DEPENDS:=+libwifi +libuci +libubox +ubus +libpthread +libnl-genl \
+!WFA_DELM_STANDALONE:map-agent +libieee1905 +map-plugin
endef
define Package/wfadatad/description
This package implements WiFi Alliance's Data Elements v.1.0.
It collects WiFi network's diagnostic data and reports them
to the Data Elements Collector.
In Data Elements Agent mode, the package by default is built
as a loadable plugin module to the MultiAP Agent.
The package can also be built as a standalone daemon running
independently of a MultiAP Agent.
This package implements WiFi DataElements Agent.
endef
define Package/wfadatad-collector
SECTION:=utils
CATEGORY:=Utilities
TITLE:=WiFi DataElements Collector
DEPENDS:=+libuci +libubox +ubus +libpthread +libnl-genl \
+libieee1905 +map-plugin
endef
define Package/wfadatad-collector/description
It implements WiFi DataElement Collector.
endef
@@ -45,7 +51,6 @@ define Package/wfadatad/config
source "$(SOURCE)/Config.in"
endef
ifeq ($(CONFIG_WFA_DELM_STANDALONE),y)
MAKE_FLAGS += CONFIG_WFA_DELM_STANDALONE=y
endif
@@ -63,12 +68,26 @@ define Package/wfadatad/install
ifeq ($(CONFIG_WFA_DELM_STANDALONE),y)
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) ./files/wfadatad.init $(1)/etc/init.d/wfadatad
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wfadatad $(1)/usr/sbin/
$(INSTALL_BIN) ./files/wfadatad.init $(1)/etc/init.d/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/agent/deagent $(1)/usr/sbin/
else
$(INSTALL_DIR) $(1)/usr/lib/map-plugins
$(CP) $(PKG_BUILD_DIR)/src/wfa_delm.so $(1)/usr/lib/map-plugins
$(CP) $(PKG_BUILD_DIR)/src/agent/deagent.so $(1)/usr/lib/map-plugins
endif
endef
define Package/wfadatad-collector/install
ifeq ($(CONFIG_WFA_DELM_STANDALONE),y)
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) ./files/wfadatad.collector.init $(1)/etc/init.d/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/collector/decollector $(1)/usr/sbin/
else
$(INSTALL_DIR) $(1)/usr/lib/map-plugins
$(CP) $(PKG_BUILD_DIR)/src/collector/decollector.so $(1)/usr/lib/map-plugins
endif
endef
$(eval $(call BuildPackage,wfadatad))
$(eval $(call BuildPackage,wfadatad-collector))

View File

@@ -0,0 +1,39 @@
#!/bin/sh /etc/rc.common
START=98
STOP=11
USE_PROCD=1
PROG=/usr/sbin/decollector
service_running() {
ubus -t 2 wait_for ieee1905 ieee1905.map
}
start_service() {
sleep 3
[ -e "/etc/config/mapcontroller" ] && {
local en
config_load mapcontroller
config_get en controller enabled "0"
[ $en -gt 0 ] && {
procd_open_instance
procd_set_param command "$PROG" "-d"
#procd_set_param stdout 1
#procd_set_param stderr 1
procd_close_instance
}
}
}
reload_service() {
stop
start
}
service_triggers()
{
procd_add_reload_trigger mapcontroller
}

View File

@@ -4,30 +4,19 @@ START=98
STOP=11
USE_PROCD=1
PROG=/usr/sbin/wfadatad
PROG=/usr/sbin/deagent
service_running() {
ubus -t 2 wait_for ieee1905 ieee1905.map
ubus -t 2 wait_for wifi ieee1905 ieee1905.map
}
start_service() {
procd_open_instance
procd_set_param command "$PROG" "-d" "-t 15"
procd_set_param command "$PROG" "-d" "-t 10"
#procd_set_param stdout 1
#procd_set_param stderr 1
#procd_set_param respawn
procd_close_instance
[ -e "/etc/config/mapcontroller" ] && {
local en
config_load mapcontroller
config_get en controller enabled "0"
[ $en -gt 0 ] && {
procd_open_instance
procd_set_param command "$PROG" "-d -C"
procd_close_instance
}
}
}
reload_service() {

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=wifimngr
PKG_VERSION:=12.0.3
PKG_VERSION:=14.0.3
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=4426f003faac796d978092419959adf4cf6440c3
PKG_SOURCE_VERSION:=0b8fe7e672e5e14519121ccba9a61591d5ea16b4
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

@@ -57,6 +57,11 @@ supp_status() {
return
fi
if [ -f "/tmp/map.agent.bsta_global_disable" ]; then
echo "CONFIGURED"
return
fi
echo "UNCONFIGURED"
}

View File

@@ -8,9 +8,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=xmppc
PKG_VERSION:=1.0.1
PKG_VERSION:=1.0.2
PKG_SOURCE_VERSION:=a98cdda759418dab1c12a18c345112d94ed4c02e
PKG_SOURCE_VERSION:=4a09b8689d67dcbf3fd1b7e80e53816b7cd12614
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/xmppc.git