Compare commits

...

44 Commits

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

Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
2022-12-02 14:05:12 +01:00
Filip Matusiak
8c2421018a map-agent: add On Boot Only scan config option
Signed-off-by: Filip Matusiak <filip.matusiak@iopsys.eu>
2022-12-02 12:57:30 +00:00
vdutta
a4f7d4650b usermngr: 1.0.1 2022-12-02 17:36:39 +05:30
44 changed files with 1196 additions and 96 deletions

View File

@@ -5,11 +5,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libbbfdm
PKG_VERSION:=6.8.7
PKG_VERSION:=6.8.9
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
PKG_SOURCE_VERSION:=90ac63e15ac446b387d25eb0469645bbac8c8bf7
PKG_SOURCE_VERSION:=4ad900a9bb6b4a0dd38edc1d14e1b6cbfeaa8e9b
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.7.8
PKG_VERSION:=6.8.0
PKG_RELEASE:=1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=bbc8a189dd6855a80279c9f2fdd08bcb139b9dde
PKG_SOURCE_VERSION:=ddc7b272bec5e3b5c2a216a1f86cd5589a1a4a19
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz

View File

@@ -83,6 +83,7 @@ define Package/icwmp/default/install
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_DIR) $(1)/etc/bbfdm/json/
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/icwmpd $(1)/usr/sbin/icwmpd
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
$(INSTALL_BIN) ./files/etc/firewall.cwmp $(1)/etc/firewall.cwmp
@@ -92,6 +93,7 @@ define Package/icwmp/default/install
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
$(INSTALL_BIN) ./files/etc/icwmpd/update.sh $(1)/etc/icwmpd/update.sh
$(INSTALL_DATA) ./files/etc/bbfdm/json/CWMPManagementServer.json $(1)/etc/bbfdm/json/
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_icwmp.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp.user
endef
Package/icwmp-openssl/install = $(Package/icwmp/default/install)

View File

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

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ieee1905
PKG_VERSION:=6.0.2
PKG_VERSION:=6.0.16
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=30068401b9591a286b8b76da47730142de342545
PKG_SOURCE_VERSION:=3b12bdd1b0e75f4e5b744e18f00ab5ac703382e6
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ieee1905.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip

View File

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

View File

@@ -76,6 +76,7 @@ CONFIG_PACKAGE_urlfilter=y
CONFIG_PACKAGE_imonitor=m
CONFIG_PACKAGE_questd=y
CONFIG_PACKAGE_rulengd=y
CONFIG_PACKAGE_usermngr=y
# TR-x69 #
CONFIG_PACKAGE_uspd-mbedtls=y

View File

@@ -393,10 +393,10 @@ function genconfig {
echo "ERROR: Failed getting version via git describe, exiting." >&2
return 1
fi
local customers_lower="${CUSTOMERS,,}"
local version="${git_version}${customers_lower:+-${customers_lower// /}}"
echo "CONFIG_TARGET_VERSION=\"${version}\"" >> .config
echo "CONFIG_VERSION_CODE=\"${version}\"" >> .config
local version="${git_version,,}${CUSTOMERS:+-${CUSTOMERS// /}}"
local version_lower="${version,,}"
echo "CONFIG_TARGET_VERSION=\"${version_lower}\"" >> .config
echo "CONFIG_VERSION_CODE=\"${version_lower}\"" >> .config
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
# Enable Package source tree override if selected

View File

@@ -384,10 +384,10 @@ function genconfig_min {
echo "ERROR: Failed getting version via git describe, exiting." >&2
return 1
fi
local customers_lower="${CUSTOMERS,,}"
local version="${git_version}${customers_lower:+-${customers_lower// /}}"
echo "CONFIG_TARGET_VERSION=\"${version}\"" >> .config
echo "CONFIG_VERSION_CODE=\"${version}\"" >> .config
local version="${git_version,,}${CUSTOMERS:+-${CUSTOMERS// /}}"
local version_lower="${version,,}"
echo "CONFIG_TARGET_VERSION=\"${version_lower}\"" >> .config
echo "CONFIG_VERSION_CODE=\"${version_lower}\"" >> .config
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
# Enable Package source tree override if selected

View File

@@ -16,7 +16,7 @@ LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
PKG_SOURCE_VERSION:=2d3f39d517e89df0f3e80f85b7efedd3efc6705c
PKG_SOURCE_VERSION:=b53e93ca1a2fdda56ca9caffb6020e158e684f3d
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -47,7 +47,6 @@ endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
@echo "Building from the local source. TARGET_PLATFORM=$(TARGET_PLATFORM)"
rsync -av --exclude=.* $(LOCAL_SRC_DIR)/* $(PKG_BUILD_DIR)/
endef
endif

58
libvoice-d2/Makefile Normal file
View File

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

View File

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

View File

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-agent
PKG_VERSION:=2.10.4.1
PKG_VERSION:=2.10.4.11
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=29aabbeb0d96c76fa1a7ea2faffc2bd001efa800
PKG_SOURCE_VERSION:=0852c7803475f7fb919f680d02437ba9672c42fc
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_LICENSE:=BSD-3-Clause
@@ -59,6 +59,8 @@ TARGET_CFLAGS += \
-Wno-error=deprecated-declarations \
-D_GNU_SOURCE
TARGET_CFLAGS += -DEASYMESH_VERSION=$(CONFIG_AGENT_EASYMESH_VERSION)
ifeq ($(CONFIG_AGENT_SYNC_DYNAMIC_CNTLR_CONFIG),y)
TARGET_CFLAGS += -DAGENT_SYNC_DYNAMIC_CNTLR_CONFIG
endif

View File

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

View File

@@ -34,7 +34,8 @@ validate_agent_section() {
'resend_num:uinteger:0' \
'dyn_cntlr_sync:bool:true' \
'island_prevention:bool:false' \
'eth_onboards_wifi_bhs:bool:false'
'eth_onboards_wifi_bhs:bool:false' \
'scan_on_boot_only:bool:false'
[ "$?" -ne 0 ] && {

View File

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

View File

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-controller
PKG_VERSION:=2.11.0.14
PKG_VERSION:=2.11.0.20
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=8a71dffdd66b2dcacf67353efcb09cb9127c1ea9
PKG_SOURCE_VERSION:=5ff7f037c040d337982a1e3a51693fb8e0682046
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
@@ -45,6 +45,8 @@ TARGET_CFLAGS += \
MAKE_PATH:=src
TARGET_CFLAGS += -DEASYMESH_VERSION=$(CONFIG_CONTROLLER_EASYMESH_VERSION)
ifeq ($(CONFIG_CONTROLLER_SYNC_DYNAMIC_CNTLR_CONFIG),y)
TARGET_CFLAGS += -DCONTROLLER_SYNC_DYNAMIC_CNTLR_CONFIG
endif

View File

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

308
mqttmngr/LICENSE Normal file
View File

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

44
mqttmngr/Makefile Normal file
View File

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

4
mqttmngr/README.md Normal file
View File

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

View File

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

17
mqttmngr/src/Makefile Normal file
View File

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

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

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

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

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

View File

@@ -13,7 +13,7 @@ menu "SULU_CORE"
config SULU_CORE_VERSION
string "SULU repo version"
default "59426b891fd66711b99a5b941cd40c87f0da1744"
default "c7e62f7f7cda1961012e8149d220ac1eb26d362f"
endmenu
menu "SULU_PLUGIN_LCM"
@@ -35,7 +35,7 @@ menu "SULU_PLUGIN_LCM"
config SULU_PLUGIN_LCM_VERSION
depends on SULU_PLUGIN_LCM_ENABLE
string "Version"
default "aae9064570e42cbb5f667fad824a992c812dd984"
default "ccd70b399b31530dc1af6a871eee94fbb179d794"
endmenu
menu "SULU_PLUGIN_MULTIAP"
@@ -57,7 +57,7 @@ menu "SULU_PLUGIN_MULTIAP"
config SULU_PLUGIN_MULTIAP_VERSION
depends on SULU_PLUGIN_MULTIAP_ENABLE
string "Version"
default "53eef156a02b9e93bd566997b5ff6f47fba29e46"
default "3c79d57bee453e7b62c7b7626e33bf273212bbc9"
endmenu
menu "SULU_THEME_IOPSYS"

View File

@@ -5,11 +5,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-builder
PKG_VERSION:=1.3.12
PKG_VERSION:=1.3.16
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-builder.git
PKG_SOURCE_VERSION:=f48e4fc60f8b3a34fceaa25aadd1c9f6941a16f5
PKG_SOURCE_VERSION:=81d4bb268914dc3822293e93519ae6adbd6ddbea
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
@@ -22,7 +22,7 @@ define Package/${PKG_NAME}
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Build sulu from source
DEPENDS:=+nginx +mosquitto-auth-shadow +usermngr
DEPENDS:=+nginx +mosquitto-auth-shadow +usermngr +jq
CONFLICTS:=sulu
endef

View File

@@ -1,4 +1,7 @@
config global 'global'
option root '/sulu'
option port '8080'
option ws_port '9001'
option enabled '1'
option enable_system_credentials '1'
option role_based_access '1'

View File

@@ -34,7 +34,8 @@ start_service() {
fi
configure_sulu "${enable_system_credentials}" "${role_based_access}" 1
update_nginx_config "${enabled}"
update_nginx_config "${enabled}" 1
update_sulu_connection_port
procd_close_instance
}

View File

@@ -3,7 +3,7 @@ server {
listen [::]:8080;
server_name _sulu;
root /sulu;
location /config/ {
location / {
autoindex on;
expires -1;

View File

@@ -2,9 +2,7 @@
. /lib/functions.sh
SULU_CONFIG="/sulu/config/connectionConfig.json"
ACL_FILE="/tmp/sulu/mqtt.acl"
MB_SULU_CONF="/etc/mosquitto/conf.d/sulu.conf"
_RESTART_SERVICES="0"
mkdir -p /tmp/sulu/
@@ -47,12 +45,37 @@ function _get_sulu_users()
echo "$(uci -q get sulu.global.user)"
}
function _get_sulu_root()
{
local root
root="$(uci -q get sulu.global.root)"
echo "${root:-/sulu}"
}
function _get_sulu_port()
{
local port
port="$(uci -q get sulu.global.port)"
echo "${port:-8080}"
}
function _get_sulu_ws_port()
{
local port
port="$(uci -q get sulu.global.ws_port)"
echo "${port:-9001}"
}
function generate_sulu_conn_config()
{
local rbac users
local rbac users SCONFIG
rbac="${1}"
users="$(_get_sulu_users)"
SCONFIG="$(_get_sulu_root)/config/connectionConfig.json"
json_init;
if [ "${rbac}" -eq "1" ]; then
@@ -63,7 +86,7 @@ function generate_sulu_conn_config()
json_add_object 'connections';
json_add_object 'rbac';
json_add_string 'toId' "$(_get_endpoint_id)";
json_add_int 'port' 9001;
json_add_int 'port' "$(_get_sulu_ws_port)";
json_add_string 'protocol' 'ws';
json_add_array 'auth';
json_close_array;
@@ -83,7 +106,7 @@ function generate_sulu_conn_config()
json_add_object 'main';
json_add_string 'fromId' 'proto::interop-usp-controller';
json_add_string 'toId' "$(_get_endpoint_id)";
json_add_int 'port' 9001;
json_add_int 'port' "$(_get_sulu_ws_port)";
json_add_string 'protocol' 'ws';
json_add_string 'publishEndpoint' "/usp/endpoint";
json_add_string 'subscribeEndpoint' "/usp/controller";
@@ -92,24 +115,40 @@ function generate_sulu_conn_config()
json_close_object;
json_close_object;
json_dump > ${SULU_CONFIG}
json_dump > ${SCONFIG}
}
function set_sulu_connection_mode()
{
local rbac profile config
local rbac profile config SCONFIG
SCONFIG="$(_get_sulu_root)/config/connectionConfig.json"
rbac="${1}"
profile="$(jq '.currentConnection' ${SULU_CONFIG})"
profile="$(jq '.currentConnection' ${SCONFIG})"
if [ "$rbac" -eq "1" -a "${profile}" == "\"main\"" ]; then
config="$(jq '.currentConnection = "rbac"' ${SULU_CONFIG})"
echo "${config}" > ${SULU_CONFIG}
config="$(jq '.currentConnection = "rbac"' ${SCONFIG})"
echo "${config}" > ${SCONFIG}
elif [ "$rbac" -eq "0" -a "${profile}" == "\"rbac\"" ]; then
config="$(jq '.currentConnection = "main"' ${SULU_CONFIG})"
echo "${config}" > ${SULU_CONFIG}
config="$(jq '.currentConnection = "main"' ${SCONFIG})"
echo "${config}" > ${SCONFIG}
fi
}
function update_sulu_connection_port()
{
local port ws_port SCONF
SCONF="$(_get_sulu_root)/config/connectionConfig.json"
ws_port="$(_get_sulu_ws_port)"
port="$(jq '.connections.rbac.port' ${SCONF})"
if [ "${port}" -ne "${ws_port}" ]; then
jq ".connections.main.port = ${ws_port} | .connections.rbac.port = ${ws_port}" ${SCONF} > /tmp/sulu/ss_port.json
mv /tmp/sulu/ss_port.json ${SCONF}
fi
}
function _update_obuspa_config()
{
local restart
@@ -175,7 +214,7 @@ function _update_obuspa_config_rbac() {
# Add mqtt
sec="mqtt_sulu_${f}"
if ! uci_get obuspa mqtt ${sec} >/dev/null 2>&1; then
if ! uci_get obuspa ${sec} >/dev/null 2>&1; then
uci_add obuspa mqtt ${sec}
uci_set obuspa ${sec} BrokerAddress "127.0.0.1"
uci_set obuspa ${sec} BrokerPort "1883"
@@ -185,7 +224,7 @@ function _update_obuspa_config_rbac() {
# Add mtp
sec="mtp_sulu_${f}"
if ! uci_get obuspa mtp ${sec} >/dev/null 2>&1; then
if ! uci_get obuspa ${sec} >/dev/null 2>&1; then
uci_add obuspa mtp ${sec}
uci_set obuspa ${sec} Protocol "MQTT"
uci_set obuspa ${sec} ResponseTopicConfigured "/usp/${agent}/${f}/endpoint"
@@ -195,7 +234,7 @@ function _update_obuspa_config_rbac() {
# Add controller
sec="controller_sulu_${f}"
if ! uci_get obuspa controller ${sec} >/dev/null 2>&1; then
if ! uci_get obuspa ${sec} >/dev/null 2>&1; then
uci_add obuspa controller ${sec}
uci_set obuspa ${sec} EndpointID "self::sulu-${f}"
uci_set obuspa ${sec} Protocol "MQTT"
@@ -262,11 +301,13 @@ function _create_acl() {
function update_mosquitto_broker_config()
{
local system_cred rbac restart
local system_cred rbac restart ws_port
MB_SULU_CONF="/etc/mosquitto/conf.d/sulu.conf"
system_cred="${1}"
rbac="${2}"
restart=0
ws_port="$(_get_sulu_ws_port)"
if [ "${system_cred}" -eq "1" ]; then
if grep -q "password_file " ${MB_SULU_CONF}; then
@@ -301,6 +342,11 @@ function update_mosquitto_broker_config()
fi
fi
if ! grep -q "listener ${ws_port}" ${MB_SULU_CONF}; then
sed -i "s/listener [0-9]\+/listener ${ws_port}/" ${MB_SULU_CONF}
restart=1
fi
if [ "${_RESTART_SERVICES}" -eq "1" -a "${restart}" -eq "1" ]; then
slog "Restarting mqtt broker..."
/etc/init.d/mosquitto restart &
@@ -336,21 +382,36 @@ function update_obuspa_config()
function update_nginx_config()
{
local enabled restart
local enabled restart port
NCONF="/etc/nginx/conf.d/sulu.conf"
restart=0
enabled="${1:-0}"
_RESTART_SERVICES="${2:-0}"
port="$(_get_sulu_port)"
root="$(_get_sulu_root)"
if [ "${enabled}" -eq "1" ]; then
if [ ! -f "/etc/nginx/conf.d/sulu.conf" ]; then
cp /etc/sulu/nginx.conf /etc/nginx/conf.d/sulu.conf
if [ ! -f "${NCONF}" ]; then
cp /etc/sulu/nginx.conf ${NCONF}
restart=1
fi
if ! grep -q "listen ${port}" ${NCONF}; then
sed -i "s/listen [0-9]\+/listen ${port}/" ${NCONF}
sed -i "s/listen \[::\]:[0-9]\+/listen [::]:${port}/" ${NCONF}
restart=1
fi
if ! grep -q "root ${root}" ${NCONF}; then
sed -i "s/root .*;/root ${root//\//\\/};/" ${NCONF}
restart=1
fi
else
if [ -f "/etc/nginx/conf.d/sulu.conf" ]; then
rm -f /etc/nginx/conf.d/sulu.conf
if [ -f "${NCONF}" ]; then
rm -f ${NCONF}
restart=1
fi
fi
if [ "${_RESTART_SERVICES}" -eq "1" -a "${restart}" -eq "1" ]; then
slog "Restarting nginx..."
ubus call uci commit '{"config":"nginx"}'

View File

@@ -8,5 +8,4 @@ config_get role_based_access global role_based_access 0
config_get enabled global enabled 0
configure_sulu "${enable_system_credentials}" "${role_based_access}" 0
update_nginx_config "${enabled}"
generate_sulu_conn_config "${role_based_access}"

View File

@@ -5,11 +5,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu
PKG_VERSION:=1.3.12
PKG_VERSION:=1.3.16
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
PKG_SOURCE_VERSION:=f48e4fc60f8b3a34fceaa25aadd1c9f6941a16f5
PKG_SOURCE_VERSION:=81d4bb268914dc3822293e93519ae6adbd6ddbea
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
@@ -27,7 +27,7 @@ define Package/sulu
SECTION:=sulu
CATEGORY:=Utilities
TITLE:=SULU-CE ReactJS based Web UI Package
DEPENDS:=+nginx +mosquitto-auth-shadow +usermngr
DEPENDS:=+nginx +mosquitto-auth-shadow +usermngr +jq
endef
define Package/sulu/description

View File

@@ -1,4 +1,7 @@
config global 'global'
option root '/sulu'
option port '8080'
option ws_port '9001'
option enabled '1'
option enable_system_credentials '1'
option role_based_access '1'

View File

@@ -34,7 +34,8 @@ start_service() {
fi
configure_sulu "${enable_system_credentials}" "${role_based_access}" 1
update_nginx_config "${enabled}"
update_nginx_config "${enabled}" 1
update_sulu_connection_port
procd_close_instance
}

View File

@@ -3,7 +3,7 @@ server {
listen [::]:8080;
server_name _sulu;
root /sulu;
location /config/ {
location / {
autoindex on;
expires -1;

View File

@@ -2,9 +2,7 @@
. /lib/functions.sh
SULU_CONFIG="/sulu/config/connectionConfig.json"
ACL_FILE="/tmp/sulu/mqtt.acl"
MB_SULU_CONF="/etc/mosquitto/conf.d/sulu.conf"
_RESTART_SERVICES="0"
mkdir -p /tmp/sulu/
@@ -47,12 +45,37 @@ function _get_sulu_users()
echo "$(uci -q get sulu.global.user)"
}
function _get_sulu_root()
{
local root
root="$(uci -q get sulu.global.root)"
echo "${root:-/sulu}"
}
function _get_sulu_port()
{
local port
port="$(uci -q get sulu.global.port)"
echo "${port:-8080}"
}
function _get_sulu_ws_port()
{
local port
port="$(uci -q get sulu.global.ws_port)"
echo "${port:-9001}"
}
function generate_sulu_conn_config()
{
local rbac users
local rbac users SCONFIG
rbac="${1}"
users="$(_get_sulu_users)"
SCONFIG="$(_get_sulu_root)/config/connectionConfig.json"
json_init;
if [ "${rbac}" -eq "1" ]; then
@@ -63,7 +86,7 @@ function generate_sulu_conn_config()
json_add_object 'connections';
json_add_object 'rbac';
json_add_string 'toId' "$(_get_endpoint_id)";
json_add_int 'port' 9001;
json_add_int 'port' "$(_get_sulu_ws_port)";
json_add_string 'protocol' 'ws';
json_add_array 'auth';
json_close_array;
@@ -83,7 +106,7 @@ function generate_sulu_conn_config()
json_add_object 'main';
json_add_string 'fromId' 'proto::interop-usp-controller';
json_add_string 'toId' "$(_get_endpoint_id)";
json_add_int 'port' 9001;
json_add_int 'port' "$(_get_sulu_ws_port)";
json_add_string 'protocol' 'ws';
json_add_string 'publishEndpoint' "/usp/endpoint";
json_add_string 'subscribeEndpoint' "/usp/controller";
@@ -92,24 +115,40 @@ function generate_sulu_conn_config()
json_close_object;
json_close_object;
json_dump > ${SULU_CONFIG}
json_dump > ${SCONFIG}
}
function set_sulu_connection_mode()
{
local rbac profile config
local rbac profile config SCONFIG
SCONFIG="$(_get_sulu_root)/config/connectionConfig.json"
rbac="${1}"
profile="$(jq '.currentConnection' ${SULU_CONFIG})"
profile="$(jq '.currentConnection' ${SCONFIG})"
if [ "$rbac" -eq "1" -a "${profile}" == "\"main\"" ]; then
config="$(jq '.currentConnection = "rbac"' ${SULU_CONFIG})"
echo "${config}" > ${SULU_CONFIG}
config="$(jq '.currentConnection = "rbac"' ${SCONFIG})"
echo "${config}" > ${SCONFIG}
elif [ "$rbac" -eq "0" -a "${profile}" == "\"rbac\"" ]; then
config="$(jq '.currentConnection = "main"' ${SULU_CONFIG})"
echo "${config}" > ${SULU_CONFIG}
config="$(jq '.currentConnection = "main"' ${SCONFIG})"
echo "${config}" > ${SCONFIG}
fi
}
function update_sulu_connection_port()
{
local port ws_port SCONF
SCONF="$(_get_sulu_root)/config/connectionConfig.json"
ws_port="$(_get_sulu_ws_port)"
port="$(jq '.connections.rbac.port' ${SCONF})"
if [ "${port}" -ne "${ws_port}" ]; then
jq ".connections.main.port = ${ws_port} | .connections.rbac.port = ${ws_port}" ${SCONF} > /tmp/sulu/ss_port.json
mv /tmp/sulu/ss_port.json ${SCONF}
fi
}
function _update_obuspa_config()
{
local restart
@@ -175,7 +214,7 @@ function _update_obuspa_config_rbac() {
# Add mqtt
sec="mqtt_sulu_${f}"
if ! uci_get obuspa mqtt ${sec} >/dev/null 2>&1; then
if ! uci_get obuspa ${sec} >/dev/null 2>&1; then
uci_add obuspa mqtt ${sec}
uci_set obuspa ${sec} BrokerAddress "127.0.0.1"
uci_set obuspa ${sec} BrokerPort "1883"
@@ -185,7 +224,7 @@ function _update_obuspa_config_rbac() {
# Add mtp
sec="mtp_sulu_${f}"
if ! uci_get obuspa mtp ${sec} >/dev/null 2>&1; then
if ! uci_get obuspa ${sec} >/dev/null 2>&1; then
uci_add obuspa mtp ${sec}
uci_set obuspa ${sec} Protocol "MQTT"
uci_set obuspa ${sec} ResponseTopicConfigured "/usp/${agent}/${f}/endpoint"
@@ -195,7 +234,7 @@ function _update_obuspa_config_rbac() {
# Add controller
sec="controller_sulu_${f}"
if ! uci_get obuspa controller ${sec} >/dev/null 2>&1; then
if ! uci_get obuspa ${sec} >/dev/null 2>&1; then
uci_add obuspa controller ${sec}
uci_set obuspa ${sec} EndpointID "self::sulu-${f}"
uci_set obuspa ${sec} Protocol "MQTT"
@@ -262,11 +301,13 @@ function _create_acl() {
function update_mosquitto_broker_config()
{
local system_cred rbac restart
local system_cred rbac restart ws_port
MB_SULU_CONF="/etc/mosquitto/conf.d/sulu.conf"
system_cred="${1}"
rbac="${2}"
restart=0
ws_port="$(_get_sulu_ws_port)"
if [ "${system_cred}" -eq "1" ]; then
if grep -q "password_file " ${MB_SULU_CONF}; then
@@ -301,6 +342,11 @@ function update_mosquitto_broker_config()
fi
fi
if ! grep -q "listener ${ws_port}" ${MB_SULU_CONF}; then
sed -i "s/listener [0-9]\+/listener ${ws_port}/" ${MB_SULU_CONF}
restart=1
fi
if [ "${_RESTART_SERVICES}" -eq "1" -a "${restart}" -eq "1" ]; then
slog "Restarting mqtt broker..."
/etc/init.d/mosquitto restart &
@@ -336,21 +382,36 @@ function update_obuspa_config()
function update_nginx_config()
{
local enabled restart
local enabled restart port
NCONF="/etc/nginx/conf.d/sulu.conf"
restart=0
enabled="${1:-0}"
_RESTART_SERVICES="${2:-0}"
port="$(_get_sulu_port)"
root="$(_get_sulu_root)"
if [ "${enabled}" -eq "1" ]; then
if [ ! -f "/etc/nginx/conf.d/sulu.conf" ]; then
cp /etc/sulu/nginx.conf /etc/nginx/conf.d/sulu.conf
if [ ! -f "${NCONF}" ]; then
cp /etc/sulu/nginx.conf ${NCONF}
restart=1
fi
if ! grep -q "listen ${port}" ${NCONF}; then
sed -i "s/listen [0-9]\+/listen ${port}/" ${NCONF}
sed -i "s/listen \[::\]:[0-9]\+/listen [::]:${port}/" ${NCONF}
restart=1
fi
if ! grep -q "root ${root}" ${NCONF}; then
sed -i "s/root .*;/root ${root//\//\\/};/" ${NCONF}
restart=1
fi
else
if [ -f "/etc/nginx/conf.d/sulu.conf" ]; then
rm -f /etc/nginx/conf.d/sulu.conf
if [ -f "${NCONF}" ]; then
rm -f ${NCONF}
restart=1
fi
fi
if [ "${_RESTART_SERVICES}" -eq "1" -a "${restart}" -eq "1" ]; then
slog "Restarting nginx..."
ubus call uci commit '{"config":"nginx"}'

View File

@@ -8,5 +8,4 @@ config_get role_based_access global role_based_access 0
config_get enabled global enabled 0
configure_sulu "${enable_system_credentials}" "${role_based_access}" 0
update_nginx_config "${enabled}"
generate_sulu_conn_config "${role_based_access}"

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=usermngr
PKG_VERSION:=1.0.0
PKG_VERSION:=1.0.3
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/usermngr.git
PKG_SOURCE_VERSION:=c8afaf3a275d6a3480992a3769382135ca3252d7
PKG_SOURCE_VERSION:=a1c6ed3add2edb59f0b71bffa9b8aaa8b8240a61
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -27,7 +27,7 @@ define Package/usermngr
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
DEPENDS:= +shadow-utils
DEPENDS:= +shadow-utils +libbbf_api
TITLE:=Package to add Device.Users. datamodel support
endef
@@ -48,6 +48,7 @@ define Package/usermngr/install
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/init.d/users $(1)/etc/init.d/users
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/uci-defaults/90-indicate-bootstrap $(1)/etc/uci-defaults/90-indicate-bootstrap
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/uci-defaults/91-sync-shells $(1)/etc/uci-defaults/91-sync-shells
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/libusermngr.so $(1)/usr/lib/bbfdm/libusermngr.so
$(INSTALL_BIN) ./files/etc/config/users $(1)/etc/config/users
endef

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=uspd
PKG_VERSION:=2.2.21
PKG_VERSION:=2.2.22
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/uspd.git
PKG_SOURCE_VERSION:=8c4ab6aa9d05181c4ef2a288853764dca9625c4e
PKG_SOURCE_VERSION:=828abe8f0234eb7cd36115bb2e4a5b4113c0510f
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -3,3 +3,4 @@ config uspd 'usp'
option debug '0'
option loglevel '1'
option refresh_time '5'
option transaction_timeout '10'

View File

@@ -18,7 +18,7 @@ LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
PKG_SOURCE_VERSION:=be0efc70203d0f8b83269711388c7990d53db851
PKG_SOURCE_VERSION:=8cdd77393ac6a631649eac71ff33603bfc2b55b3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -38,7 +38,8 @@ define Package/$(PKG_NAME)
CATEGORY:=Utilities
TITLE:=IOPSYS Voice Manager
URL:=
DEPENDS:= +libubox +ubus +libpicoevent +uci +TARGET_brcmbca:bcmkernel +TARGET_brcmbca:libvoice-broadcom +TARGET_iopsys_qualcomm:vtsp
DEPENDS:= +libubox +ubus +libpicoevent +uci +TARGET_brcmbca:bcmkernel +TARGET_brcmbca:libvoice-broadcom \
+TARGET_ipq95xx:libvoice-d2
endef
define Package/$(PKG_NAME)/description

View File

@@ -1,10 +1,7 @@
menu "Configuration"
config WFA_DELM_MULTIAP_MODE
bool "Enable Multi-AP mode"
default y
config DECOLLECTOR_EASYMESH_VERSION
int "Support Easymesh version"
default 2
config WIFI_DELM_DEBUG
bool "Enable debug logs"
default n
endmenu

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=wfadatad
PKG_VERSION:=2.10.0.4
PKG_VERSION:=2.11.0.4
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=b5b6e881b110d86c6ea725c30c1be4de77e9ecfb
PKG_SOURCE_VERSION:=24dcb18f3e60082c70ab17b0707073fd2981f0a9
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wfadatad.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
@@ -73,6 +73,7 @@ endif
MAKE_PATH:=src
TARGET_CFLAGS += -DEASYMESH_VERSION=$(CONFIG_DECOLLECTOR_EASYMESH_VERSION)
EXECS := \
$(if $(CONFIG_PACKAGE_wfadatad),agent/deagent) \