mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-01-10 22:54:12 +08:00
Compare commits
107 Commits
dynamic-co
...
genexos-12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2ab11a91f | ||
|
|
f8c3251781 | ||
|
|
f565ac8144 | ||
|
|
8273a96de8 | ||
|
|
2c4376abee | ||
|
|
c7928d3a6d | ||
|
|
07ab330524 | ||
|
|
0fcc3f8612 | ||
|
|
01c1b0d832 | ||
|
|
75ebeb9012 | ||
|
|
c22ff2c6bc | ||
|
|
4ab2f04b73 | ||
|
|
9477208611 | ||
|
|
98cbdf50fc | ||
|
|
210cf3cab6 | ||
|
|
e4be368914 | ||
|
|
d9c30a8e87 | ||
|
|
d2f5a51510 | ||
|
|
8944abb486 | ||
|
|
d5e6639aa2 | ||
|
|
3b84a3c547 | ||
|
|
a0a88c5265 | ||
|
|
affb07b513 | ||
|
|
4ea324f493 | ||
|
|
156acb308d | ||
|
|
e9237858b1 | ||
|
|
42cf056d57 | ||
|
|
a16bde6dae | ||
|
|
8b24b648c7 | ||
|
|
df9f5f97af | ||
|
|
8766ee44d6 | ||
|
|
1ab0c5b13d | ||
|
|
90dfcd0ad3 | ||
|
|
72e4b4f0cb | ||
|
|
633519ac3a | ||
|
|
7b4db3d325 | ||
|
|
305dd1d6a2 | ||
|
|
5a4eb4d297 | ||
|
|
8f81c1c4c3 | ||
|
|
5d6ae3fc2d | ||
|
|
faf133212e | ||
|
|
3c170edee3 | ||
|
|
736885c999 | ||
|
|
b9d8faff99 | ||
|
|
74fec650f6 | ||
|
|
c24ffb6b7c | ||
|
|
280c4e2592 | ||
|
|
88b31df121 | ||
|
|
fdd67171bd | ||
|
|
826d023608 | ||
|
|
925f6217ce | ||
|
|
7c12473940 | ||
|
|
44315a3d75 | ||
|
|
ebcbc1b2b5 | ||
|
|
1fb471872f | ||
|
|
5a890b32dc | ||
|
|
8cc10e6634 | ||
|
|
11f68bdac7 | ||
|
|
6751b6667b | ||
|
|
7b1786d7fe | ||
|
|
04fb442a7a | ||
|
|
0e4f81b7f4 | ||
|
|
b7e0196aa7 | ||
|
|
2fdfb8900d | ||
|
|
251a9925d2 | ||
|
|
59e8c4d89f | ||
|
|
49930e3f6a | ||
|
|
4021324465 | ||
|
|
b6930a2056 | ||
|
|
1821af8963 | ||
|
|
f33d9e7d53 | ||
|
|
879e38773b | ||
|
|
c4d0b985e3 | ||
|
|
6a8c438907 | ||
|
|
0e38151087 | ||
|
|
3766d14b0c | ||
|
|
9fcfe8f85d | ||
|
|
6c7c2e456c | ||
|
|
23fb6bc837 | ||
|
|
191bab4b36 | ||
|
|
3f9665531b | ||
|
|
3535170fa1 | ||
|
|
2129df6d5f | ||
|
|
f6fdaafe42 | ||
|
|
b2d07e6e30 | ||
|
|
1ae6eb33e9 | ||
|
|
f0d9a40f59 | ||
|
|
4ef5f5427d | ||
|
|
7ac03aa9d0 | ||
|
|
07c69b34ea | ||
|
|
d2c3cda897 | ||
|
|
8456cf37e3 | ||
|
|
2f1d7d5f6c | ||
|
|
6e87362a85 | ||
|
|
36de4ee5a2 | ||
|
|
63b6ff0f27 | ||
|
|
78e9f55363 | ||
|
|
9845ba6d83 | ||
|
|
d0c1e957f9 | ||
|
|
8c4a5584b9 | ||
|
|
0100fa1c93 | ||
|
|
38118de339 | ||
|
|
95b9097a3e | ||
|
|
8765ea2733 | ||
|
|
b3f019ed98 | ||
|
|
bd92591b7b | ||
|
|
e6178dfa65 |
@@ -1,3 +1,4 @@
|
||||
if PACKAGE_libbbfdm
|
||||
config BBF_VENDOR_LIST
|
||||
string "Vendor List"
|
||||
default "iopsys"
|
||||
@@ -13,3 +14,4 @@ config BBF_OBFUSCATION_KEY
|
||||
config BBF_MAX_OBJECT_INSTANCES
|
||||
int "Maximum number of instances per object"
|
||||
default 255
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.8.26
|
||||
PKG_VERSION:=1.9.4
|
||||
|
||||
USE_LOCAL:=0
|
||||
ifneq ($(USE_LOCAL),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=6df8fecbcc72e55f2ba06ae933dcddb6f725b204
|
||||
PKG_SOURCE_VERSION:=094ee2ecb7135827848e5325cb0b8e4e209056f9
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -38,6 +38,7 @@ define Package/libbbfdm
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Library for broadband forum data model support
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +libopenssl
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/bbfdmd
|
||||
@@ -45,19 +46,36 @@ define Package/bbfdmd
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Datamodel ubus backend
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libbbfdm-api +libbbfdm +jq
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libbbfdm-api +libbbfdm +jq +bbf_configmngr
|
||||
endef
|
||||
|
||||
define Package/bbf_configmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:= BBF Config Manager
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/config
|
||||
source "$(SOURCE)/Config_bbfdm.in"
|
||||
endef
|
||||
|
||||
define Package/bbf_configmngr/config
|
||||
source "$(SOURCE)/bbf_configmngr.in"
|
||||
endef
|
||||
|
||||
define Package/libbbfdm-api/description
|
||||
Library contains the API(UCI, UBUS, JSON, CLI and Browse) of libbbfdm
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/description
|
||||
Library contains the data model tree. It includes TR181, TR143 data models
|
||||
Library contains the data model tree, It includes basic TR181 nodes.
|
||||
endef
|
||||
|
||||
define Package/bbf_configmngr/description
|
||||
Daemon for handling bbf reload services via ubus bbf.config
|
||||
endef
|
||||
|
||||
ifeq ($(USE_LOCAL),1)
|
||||
@@ -83,11 +101,11 @@ define Package/libbbfdm-api/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/libbbfdm-api.so $(1)/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/scripts/bbf.secure $(1)/usr/libexec/rpcd/bbf.secure
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/scripts/bbf.config $(1)/usr/libexec/rpcd/bbf.config
|
||||
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/libexec/rpcd/bbf.secure $(1)/usr/libexec/rpcd/bbf.secure
|
||||
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/libexec/rpcd/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
echo "$(CONFIG_BBF_OBFUSCATION_KEY)" > $(1)/etc/bbfdm/.secure_hash
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/certificates
|
||||
echo "$(CONFIG_BBF_OBFUSCATION_KEY)" > $(1)/etc/bbfdm/.secure_hash
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/install
|
||||
@@ -110,9 +128,7 @@ ifeq ($(findstring iopsys,$(CONFIG_BBF_VENDOR_LIST)),iopsys)
|
||||
$(BBFDM_INSTALL_CORE_PLUGIN) $(PKG_BUILD_DIR)/libbbfdm/dmtree/vendor/iopsys/libbbfdm_iopsys_ext.so $(1)
|
||||
endif
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm/scripts/
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm/scripts/* $(1)/usr/share/bbfdm/scripts/
|
||||
$(LN) /usr/share/bbfdm/scripts/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/prerm
|
||||
@@ -135,6 +151,19 @@ define Package/bbfdmd/install
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
|
||||
endef
|
||||
|
||||
define Package/bbf_configmngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
ifeq ($(CONFIG_BBF_CONFIGMNGR_C_BACKEND),y)
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/bbf_configd $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bbf_configd $(1)/etc/init.d/bbf_configd
|
||||
endif
|
||||
ifeq ($(CONFIG_BBF_CONFIGMNGR_SCRIPT_BACKEND),y)
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
||||
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/libexec/rpcd/bbf.config $(1)/usr/libexec/rpcd/bbf.config
|
||||
endif
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
@@ -143,6 +172,7 @@ define Build/InstallDev
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/include/*.h $(1)/usr/include/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,bbf_configmngr))
|
||||
$(eval $(call BuildPackage,libbbfdm-api))
|
||||
$(eval $(call BuildPackage,libbbfdm))
|
||||
$(eval $(call BuildPackage,bbfdmd))
|
||||
|
||||
19
bbfdm/bbf_configmngr.in
Normal file
19
bbfdm/bbf_configmngr.in
Normal file
@@ -0,0 +1,19 @@
|
||||
if PACKAGE_bbf_configmngr
|
||||
choice
|
||||
prompt "Select backend daemon for bbf.config"
|
||||
default BBF_CONFIGMNGR_C_BACKEND
|
||||
help
|
||||
Select which backend daemon should be used for ubus bbf.config
|
||||
|
||||
config BBF_CONFIGMNGR_SCRIPT_BACKEND
|
||||
bool "Use shell script backend"
|
||||
help
|
||||
Enable this option to use shell script as the backend for bbf.config. This can be useful for quick and easy scripting of configuration tasks.
|
||||
|
||||
config BBF_CONFIGMNGR_C_BACKEND
|
||||
bool "Use C code backend"
|
||||
help
|
||||
Enable this option to use a C code implementation as the backend for bbf.config. This option is generally preferred for performance-critical tasks and scenarios requiring more robust and efficient handling.
|
||||
|
||||
endchoice
|
||||
endif
|
||||
15
bbfdm/files/etc/init.d/bbf_configd
Normal file
15
bbfdm/files/etc/init.d/bbf_configd
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=64
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/bbf_configd
|
||||
|
||||
start_service()
|
||||
{
|
||||
procd_open_instance "bbf_configd"
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance "bbf_configd"
|
||||
}
|
||||
11
bridgemngr/Config.in
Normal file
11
bridgemngr/Config.in
Normal file
@@ -0,0 +1,11 @@
|
||||
if PACKAGE_bridgemngr
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config BRIDGEMNGR_BRIDGE_VLAN
|
||||
bool "Use bridge-vlan backend"
|
||||
help
|
||||
Set this option to use bridge-vlan as backend for VLAN objects.
|
||||
|
||||
endmenu
|
||||
endif
|
||||
@@ -5,14 +5,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bridgemngr
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_VERSION:=1.0.5
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/bridgemngr
|
||||
PKG_SOURCE_VERSION:=9cddf87b527ef1614a8a39db67e6578ff1810031
|
||||
PKG_SOURCE_VERSION:=c0f2e17f6d4f96aecfe72ab90be885939413176d
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -33,10 +33,18 @@ define Package/bridgemngr/description
|
||||
Package to add Device.Bridging. data model support.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
|
||||
|
||||
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VLAN),y)
|
||||
TARGET_CFLAGS += -DBRIDGE_VLAN_BACKEND
|
||||
endif
|
||||
|
||||
define Package/bridgemngr/install
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libbridgemngr.so $(1) $(PKG_NAME)
|
||||
ifeq ($(findstring iopsys,$(CONFIG_BBF_VENDOR_LIST)),iopsys)
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ddnsmngr
|
||||
PKG_VERSION:=1.0.5
|
||||
PKG_VERSION:=1.0.7
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/ddnsmngr.git
|
||||
PKG_SOURCE_VERSION:=f3c818322747922035a9eafe5de05d148ce15b4b
|
||||
PKG_SOURCE_VERSION:=4b0c679c4dc3e3725de5c0c55ed60f24b87c6edd
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=decollector
|
||||
PKG_VERSION:=6.0.0.9
|
||||
PKG_VERSION:=6.0.0.13
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=08cd179438b8085c19e7d7523c9b26adfcb93129
|
||||
PKG_SOURCE_VERSION:=d75639d9ae82538103123b32fc0de9280e84cabb
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dhcpmngr
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dhcpmngr.git
|
||||
PKG_SOURCE_VERSION:=d15d21766c1a1e5054b2391de1cfc4708be7a14c
|
||||
PKG_SOURCE_VERSION:=4c89a3f12686343e3cca23819255744ac06dfb22
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dslmngr
|
||||
PKG_VERSION:=1.2.4
|
||||
PKG_VERSION:=1.2.5
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/dslmngr.git
|
||||
PKG_SOURCE_VERSION:=d71bef278b8222dee1c278723f8264aa8faf5e40
|
||||
PKG_SOURCE_VERSION:=4a6f6f829006e481eeb20bcb121f7938d12c60ec
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 iopsys Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-qos
|
||||
PKG_VERSION:=1.1
|
||||
PKG_RELEASE:=0
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=none
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/easy-qos
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Easy QoS
|
||||
DEPENDS:=@(TARGET_brcmbca||TARGET_airoha)
|
||||
endef
|
||||
|
||||
define Package/easy-qos/description
|
||||
This package contains Easy QoS utility
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./files/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/easy-qos/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(CP) ./files/etc/config/easy_qos $(1)/etc/config/
|
||||
$(CP) ./files/etc/init.d/easy_qos.iptables $(1)/etc/init.d/easy_qos
|
||||
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
|
||||
$(CP) ./files/etc/firewall.easyqos $(1)/etc/firewall.easyqos
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,easy-qos))
|
||||
@@ -1 +0,0 @@
|
||||
/etc/init.d/easy_qos reload
|
||||
@@ -1,140 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t easy_qos.ebtable -p debug
|
||||
}
|
||||
|
||||
exec_log() {
|
||||
${@}
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
log "Failed to create ${@}";
|
||||
fi
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr 'A-Z' 'a-z');
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 0;;
|
||||
"low")
|
||||
echo 1;;
|
||||
"besteffort")
|
||||
echo 2;;
|
||||
"normal")
|
||||
echo 3;;
|
||||
"video")
|
||||
echo 4;;
|
||||
"medium")
|
||||
echo 5;;
|
||||
"high")
|
||||
echo 6;;
|
||||
"highest")
|
||||
echo 7;;
|
||||
esac
|
||||
}
|
||||
|
||||
validate_rule_section()
|
||||
{
|
||||
uci_validate_section easy_qos rule "${1}" \
|
||||
'priority:string' \
|
||||
'macaddr:string' \
|
||||
'proto:string:none' \
|
||||
'port:list(uinteger)' \
|
||||
'comment:string:none'
|
||||
}
|
||||
|
||||
# Clear existing rules before applying new rules
|
||||
clear_existing_rules() {
|
||||
local rule=$(ebtables --concurrent -t broute -L BROUTING|grep -m 1 mark)
|
||||
while [ -n "${rule}" ]; do
|
||||
exec_log ebtables --concurrent -t broute -D BROUTING ${rule}
|
||||
rule=$(ebtables --concurrent -t broute -L BROUTING|grep -m 1 mark)
|
||||
done
|
||||
}
|
||||
|
||||
create_rule() {
|
||||
local protocol=$1; shift
|
||||
local mac=$1; shift
|
||||
local mark="0x$1"; shift
|
||||
local forward_port=$1;
|
||||
local cmd="";
|
||||
local protocol_number
|
||||
|
||||
cmd="-j mark --mark-or ${mark}";
|
||||
if [ -n "${forward_port}" ]; then
|
||||
cmd="--ip-destination-port ${forward_port} ${cmd}";
|
||||
fi
|
||||
|
||||
case "${protocol}" in
|
||||
"tcp")
|
||||
protocol_number=6;;
|
||||
"udp")
|
||||
protocol_number=17;;
|
||||
"dccp")
|
||||
protocol_number=33;;
|
||||
"sctp")
|
||||
protocol_number=132;;
|
||||
*)
|
||||
log "Protocol ${protocol} not supported in ebtables"
|
||||
return;;
|
||||
esac
|
||||
|
||||
cmd="--ip-proto ${protocol_number} $cmd"
|
||||
cmd="-p ip $cmd"
|
||||
|
||||
cmd="-s ${mac} $cmd"
|
||||
exec_log ebtables --concurrent -t broute -A BROUTING ${cmd}
|
||||
}
|
||||
|
||||
manage_rule() {
|
||||
local cfg="$1"
|
||||
local priority macaddr proto port comment prio_num protocol
|
||||
|
||||
validate_rule_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
protocol=$(echo ${proto}|tr 'A-Z' 'a-z')
|
||||
prio_num=$(get_priority ${priority})
|
||||
if [ -n "${macaddr}" -a -n "${prio_num}" ]; then
|
||||
for p in ${port}; do
|
||||
if [ "${protocol}" == "none" -o "${protocol}" == "tcpudp" ]; then
|
||||
create_rule tcp ${macaddr} ${prio_num} ${p}
|
||||
create_rule udp ${macaddr} ${prio_num} ${p}
|
||||
else
|
||||
create_rule ${protocol} ${macaddr} ${prio_num} ${p}
|
||||
fi
|
||||
done
|
||||
# Create rule for all ports if port is not mentioned in uci
|
||||
if [ -z "${port}" ]; then
|
||||
if [ "${protocol}" == "none" -o "${protocol}" == "tcpudp" ]; then
|
||||
create_rule tcp ${macaddr} ${prio_num}
|
||||
create_rule udp ${macaddr} ${prio_num}
|
||||
else
|
||||
create_rule ${protocol} ${macaddr} ${prio_num}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
# Do not apply rules if ebtables is not present in system
|
||||
[ -x /usr/sbin/ebtables ] || return;
|
||||
|
||||
clear_existing_rules
|
||||
config_load easy_qos
|
||||
config_foreach manage_rule rule
|
||||
}
|
||||
|
||||
start_service() {
|
||||
reload_service
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "easy_qos"
|
||||
}
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
CLIENT_LIST="/tmp/easy_qos_client.list"
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t easy_qos -p debug
|
||||
}
|
||||
|
||||
exec_log() {
|
||||
${@}
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
log "Failed to create ${@}";
|
||||
fi
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr 'A-Z' 'a-z');
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 0;;
|
||||
"low")
|
||||
echo 1;;
|
||||
"besteffort")
|
||||
echo 2;;
|
||||
"normal")
|
||||
echo 3;;
|
||||
"video")
|
||||
echo 4;;
|
||||
"medium")
|
||||
echo 5;;
|
||||
"high")
|
||||
echo 6;;
|
||||
"highest")
|
||||
echo 7;;
|
||||
esac
|
||||
}
|
||||
|
||||
clean_client_entries() {
|
||||
[ -f ${CLIENT_LIST} ] && rm ${CLIENT_LIST}
|
||||
}
|
||||
|
||||
map_client_entries() {
|
||||
local clients ip mac host
|
||||
|
||||
json_load "$(ubus call router.network 'clients')"
|
||||
json_get_keys keys
|
||||
|
||||
for key in ${keys};
|
||||
do
|
||||
json_select ${key}
|
||||
json_get_vars ipaddr macaddr hostname
|
||||
clients="${macaddr} ${ipaddr} ${hostname};${clients}"
|
||||
json_select ..
|
||||
done
|
||||
|
||||
json_init
|
||||
|
||||
# json_add_array "clients"
|
||||
IFS=";"
|
||||
for client in ${clients};
|
||||
do
|
||||
macaddr=$(echo ${client} | cut -d" " -f1)
|
||||
json_add_object "${macaddr//:/_}"
|
||||
json_add_string "ip" "$(echo ${client} | cut -d" " -f2)"
|
||||
json_add_string "macaddr" "$(echo ${client} | cut -d" " -f1)"
|
||||
json_add_string "host" "$(echo ${client} | cut -d" " -f3)"
|
||||
json_close_object
|
||||
done
|
||||
|
||||
IFS=' '
|
||||
echo `json_dump` > ${CLIENT_LIST}
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
# Find the IP of a corresponding mac from arp table
|
||||
get_ipaddress() {
|
||||
local clients ip mac host
|
||||
|
||||
json_load "$(cat ${CLIENT_LIST})"
|
||||
json_get_keys keys
|
||||
|
||||
# jshn seems a bit iffy on having : in key, replace by _
|
||||
json_select "${1//:/_}" 2 > /dev/null
|
||||
json_get_var ip ip
|
||||
|
||||
echo "$ip"
|
||||
}
|
||||
|
||||
validate_rule_section()
|
||||
{
|
||||
uci_validate_section easy_qos rule "${1}" \
|
||||
'priority:string' \
|
||||
'macaddr:string' \
|
||||
'proto:string:none' \
|
||||
'port:list(uinteger)' \
|
||||
'comment:string:none'
|
||||
}
|
||||
|
||||
# Clear existing rules before applying new rules
|
||||
clear_existing_rules() {
|
||||
local rule=$(iptables -t mangle -S PREROUTING | grep -m 1 MARK |sed 's/-A/-D/1')
|
||||
while [ -n "${rule}" ]; do
|
||||
exec_log iptables -t mangle ${rule}
|
||||
rule=$(iptables -t mangle -S PREROUTING | grep -m 1 MARK |sed 's/-A/-D/1')
|
||||
done
|
||||
}
|
||||
|
||||
check_and_create() {
|
||||
iptables -t mangle -C PREROUTING ${@} 2>/dev/null
|
||||
# Create rule if not exists
|
||||
if [ ${?} -ne 0 ]; then
|
||||
exec_log iptables -t mangle -A PREROUTING ${@}
|
||||
else
|
||||
log "Rule exists for ${@}"
|
||||
fi
|
||||
}
|
||||
|
||||
create_rule() {
|
||||
local proto=$1; shift
|
||||
local src_ip=$1; shift
|
||||
local mark="0x$1/0x$1"; shift
|
||||
local ports=$1;
|
||||
local cmd="";
|
||||
|
||||
cmd="-j MARK --set-xmark ${mark}";
|
||||
if [ -n "${ports}" ]; then
|
||||
cmd="--match multiport --dports ${ports} ${cmd}";
|
||||
fi
|
||||
|
||||
if [ "${proto}" == "icmp" ]; then
|
||||
cmd="-p icmp -m icmp --icmp-type 8 $cmd"
|
||||
elif [ "${proto}" == "all" ]; then
|
||||
cmd="-p all $cmd"
|
||||
else
|
||||
cmd="-p ${proto} -m ${proto} $cmd"
|
||||
fi
|
||||
cmd="-s ${src_ip} $cmd"
|
||||
|
||||
check_and_create ${cmd}
|
||||
}
|
||||
|
||||
manage_rule() {
|
||||
local cfg="$1"
|
||||
local priority macaddr proto port comment prio_num ip port_list
|
||||
|
||||
validate_rule_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
prio_num=$(get_priority ${priority})
|
||||
ip=$(get_ipaddress ${macaddr})
|
||||
port_list=$(echo ${port}|sed 's/ /,/g')
|
||||
|
||||
if [ -n "${ip}" -a -n "${prio_num}" ]; then
|
||||
if [ "${proto}" == "none" -o "${proto}" == "tcpudp" ]; then
|
||||
create_rule tcp ${ip} ${prio_num} ${port_list}
|
||||
create_rule udp ${ip} ${prio_num} ${port_list}
|
||||
else
|
||||
create_rule ${proto} ${ip} ${prio_num} ${port_list}
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
clear_existing_rules
|
||||
map_client_entries
|
||||
config_load easy_qos
|
||||
config_foreach manage_rule rule
|
||||
clean_client_entries
|
||||
}
|
||||
|
||||
start_service() {
|
||||
reload_service
|
||||
echo "Easy QoS installed">/dev/console;
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "easy_qos"
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
# Add firewall include
|
||||
uci -q batch <<-EOT
|
||||
delete firewall.easyqos
|
||||
set firewall.easyqos=include
|
||||
set firewall.easyqos.path=/etc/firewall.easyqos
|
||||
set firewall.easyqos.reload=1
|
||||
commit firewall
|
||||
EOT
|
||||
@@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ebtables-extensions
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=a23a70f5518a42d663156a156c1e3356f695b5ad
|
||||
PKG_SOURCE_VERSION:=d3de8b0ac52ce9f96ef5a0a6277a6730879fc793
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/ebtables-extensions.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ethmngr
|
||||
PKG_VERSION:=2.1.7
|
||||
PKG_VERSION:=2.1.9
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/ethmngr.git
|
||||
PKG_SOURCE_VERSION:=d029ce86fe99b7896f096f68eda3f6caa000ee5f
|
||||
PKG_SOURCE_VERSION:=2d35e86cc8dfd7ef4e0d8579f5d314e90faadc90
|
||||
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=firewallmngr
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/firewallmngr.git
|
||||
PKG_SOURCE_VERSION:=f5c3e2c93a8a992ab24291eb2c67adf77de7f896
|
||||
PKG_SOURCE_VERSION:=d4bdd162cf37b3373df2448a70dcb4fbc1113535
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
165
fluentbit/Makefile
Normal file
165
fluentbit/Makefile
Normal file
@@ -0,0 +1,165 @@
|
||||
#
|
||||
# Copright (C) 2018 The Internet Foundation In Sweden
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fluentbit
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/fluent/fluent-bit.git
|
||||
PKG_SOURCE_VERSION:=v3.0.5
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/fluentbit
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:= +libyaml +libopenssl +libcurl +libatomic +musl-fts
|
||||
TITLE:=FluentBit
|
||||
endef
|
||||
|
||||
define Package/fluentbit/description
|
||||
Fluent Bit is a super fast, lightweight, and highly scalable logging and metrics processor and forwarder.
|
||||
endef
|
||||
|
||||
# General options
|
||||
TARGET_LDFLAGS+=-lfts -latomic
|
||||
|
||||
CMAKE_OPTIONS+= \
|
||||
-DFLB_RELEASE=Yes \
|
||||
-DFLB_SMALL=Yes \
|
||||
-DEXCLUDE_FROM_ALL=true \
|
||||
-DBUILD_SHAREDD_LIBS=Yes \
|
||||
-DFLB_DEBUG=No \
|
||||
-DFLB_ALL=No \
|
||||
-DFLB_JEMALLOC=No \
|
||||
-DFLB_EXAMPLES=No \
|
||||
-DFLB_CHUNK_TRACE=No \
|
||||
-DFLB_BACKTRACE=No \
|
||||
-DFLB_WASM=No \
|
||||
-DFLB_LUAJIT=No
|
||||
|
||||
# In plugins
|
||||
CMAKE_OPTIONS += \
|
||||
-DFLB_IN_SYSLOG=Yes \
|
||||
-DFLB_IN_CPU=Yes \
|
||||
-DFLB_IN_MEM=Yes \
|
||||
-DFLB_IN_DISK=Yes \
|
||||
-DFLB_IN_EXEC=Yes \
|
||||
-DFLB_IN_HEAD=Yes \
|
||||
-DFLB_IN_FORWARD=No \
|
||||
-DFLB_IN_KMSG=No \
|
||||
-DFLB_IN_PROC=No \
|
||||
-DFLB_IN_RANDOM=No \
|
||||
-DFLB_IN_SERIAL=No \
|
||||
-DFLB_IN_MQTT=No \
|
||||
-DFLB_IN_STDIN=No \
|
||||
-DFLB_IN_SYSTEMD=No \
|
||||
-DFLB_IN_TAIL=No \
|
||||
-DFLB_IN_TCP=No \
|
||||
-DFLB_IN_THERMAL=No \
|
||||
-DFLB_IN_UDP=No \
|
||||
-DFLB_IN_DOCKER=No \
|
||||
-DFLB_IN_EXEC_WASI=No \
|
||||
-DFLB_IN_EVENT_TYPE=No \
|
||||
-DFLB_IN_FLUENTBIT_METRICS=No \
|
||||
-DFLB_IN_KUBERNETES_EVENTS=No \
|
||||
-DFLB_IN_KAFKA=No \
|
||||
-DFLB_IN_LIB=No \
|
||||
-DFLB_IN_SYSTEMD=No \
|
||||
-DFLB_IN_DUMMY=No \
|
||||
-DFLB_IN_NETIF=No \
|
||||
-DFLB_IN_COLLECTD=No \
|
||||
-DFLB_IN_PROMETHEUS_SCRAPE=No \
|
||||
-DFLB_IN_STATSD=No \
|
||||
-DFLB_IN_STORAGE_BACKLOG=No \
|
||||
-DFLB_IN_PODMAN_METRICS=No \
|
||||
-DFLB_IN_OPENTELEMETRY=No \
|
||||
-DFLB_IN_ELASTICSEARCH=No \
|
||||
-DFLB_IN_CALYPTIA_FLEET=No \
|
||||
-DFLB_IN_SPLUNK=No
|
||||
-DFLB_IN_HEALTH=No \
|
||||
-DFLB_IN_WINLOG=No \
|
||||
-DFLB_IN_WINEVTLOG=No
|
||||
|
||||
|
||||
# Filter options
|
||||
CMAKE_OPTIONS +=
|
||||
-DFLB_FILTER_AWS=No \
|
||||
-DFLB_FILTER_ECS=No \
|
||||
-DFLB_FILTER_KUBERNETES=No \
|
||||
-DFLB_FILTER_LUA=No \
|
||||
-DFLB_FILTER_NEST=No \
|
||||
-DFLB_FILTER_RECORD_MODIFIER=No \
|
||||
-DFLB_FILTER_THROTTLE=No \
|
||||
-DFLB_FILTER_TYPE_CONVERTER=No \
|
||||
-DFLB_FILTER_WASM=No \
|
||||
-DFLB_FILTER_TENSORFLOW=No \
|
||||
-DFLB_FILTER_GEOIP2=No \
|
||||
-DFLB_FILTER_NIGHTFALL=No
|
||||
|
||||
# out plugins
|
||||
CMAKE_OPTIONS += \
|
||||
-DFLB_OUT_EXIT=Yes \
|
||||
-DFLB_OUT_FORWARD=Yes \
|
||||
-DFLB_OUT_HTTP=Yes \
|
||||
-DFLB_OUT_NATS=Yes \
|
||||
-DFLB_OUT_TCP=Yes \
|
||||
-DFLB_OUT_UDP=Yes \
|
||||
-DFLB_OUT_FILE=Yes \
|
||||
-DFLB_OUT_STDOUT=Yes \
|
||||
-DFLB_OUT_SYSLOG=Yes \
|
||||
-DFLB_OUT_NULL=Yes \
|
||||
-DFLB_OUT_PLOT=No \
|
||||
-DFLB_OUT_AZURE=No \
|
||||
-DFLB_OUT_AZURE_BLOB=No \
|
||||
-DFLB_OUT_AZURE_LOGS_INGESTION=No \
|
||||
-DFLB_OUT_AZURE_KUSTO=No \
|
||||
-DFLB_OUT_BIGQUERY=No \
|
||||
-DFLB_OUT_CALYPTIA=No \
|
||||
-DFLB_OUT_COUNTER=No \
|
||||
-DFLB_OUT_DATADOG=No \
|
||||
-DFLB_OUT_ES=No \
|
||||
-DFLB_OUT_GELF=No \
|
||||
-DFLB_OUT_INFLUXDB=No \
|
||||
-DFLB_OUT_NRLOGS=No \
|
||||
-DFLB_OUT_OPENSEARCH=No \
|
||||
-DFLB_OUT_TD=No \
|
||||
-DFLB_OUT_SKYWALKING=No \
|
||||
-DFLB_OUT_SLACK=No \
|
||||
-DFLB_OUT_SPLUNK=No \
|
||||
-DFLB_OUT_STACKDRIVER=No \
|
||||
-DFLB_OUT_LIB=No \
|
||||
-DFLB_OUT_FLOWCOUNTER=No \
|
||||
-DFLB_OUT_LOGDNA=No \
|
||||
-DFLB_OUT_LOKI=No \
|
||||
-DFLB_OUT_KAFKA=No \
|
||||
-DFLB_OUT_KAFKA_REST=No \
|
||||
-DFLB_OUT_CLOUDWATCH_LOGS=No \
|
||||
-DFLB_OUT_KINESIS_FIREHOSE=No \
|
||||
-DFLB_OUT_KINESIS_STREAMS=No \
|
||||
-DFLB_OUT_OPENTELEMETRY=No \
|
||||
-DFLB_OUT_PROMETHEUS_EXPORTER=No \
|
||||
-DFLB_OUT_PROMETHEUS_REMOTE_WRITE=No \
|
||||
-DFLB_OUT_S3=No \
|
||||
-DFLB_OUT_VIVO_EXPORTER=No \
|
||||
-DFLB_OUT_WEBSOCKET=No \
|
||||
-DFLB_OUT_ORACLE_LOG_ANALYTICS=No \
|
||||
-DFLB_OUT_CHRONICLE=No \
|
||||
-DFLB_OUT_PGSQL=No
|
||||
|
||||
define Package/fluentbit/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/fluent-bit $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fluentbit))
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostmngr
|
||||
PKG_VERSION:=1.2.5
|
||||
PKG_VERSION:=1.2.6
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=20402c9fb60afa0678d844b0401e1b89699ff8b3
|
||||
PKG_SOURCE_VERSION:=aa365710b227ba82b1c43f9cdf497261edb21852
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/hostmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.7.15
|
||||
PKG_VERSION:=9.7.19
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=fb3c8833f3fce7fe3659395cab48e7078f2007d5
|
||||
PKG_SOURCE_VERSION:=db40cb6311003c9a49e78f0e2f740aae465266a8
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.4.2
|
||||
PKG_VERSION:=8.4.6
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4d60d4a9b55940fffa39b7799abf2a7962ae2113
|
||||
PKG_SOURCE_VERSION:=e2f68a0ba54a6abf3481cdbb24d2dcc81e7f199c
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/ieee1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -24,6 +24,10 @@ function genconfig {
|
||||
fi
|
||||
|
||||
${target_script} ${args[@]}
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "Testing ./feeds/customerprofiles"
|
||||
PROFILES="./feeds/customerprofiles,profiles" ${target_script} ${args[@]}
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "genconfig" "Generate configuration for board and customer"
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From be00aa9bd064d1defd94e78835249d0ca04c0440 Mon Sep 17 00:00:00 2001
|
||||
From: Markus Gothe <markus.gothe@genexis.eu>
|
||||
Date: Sun, 21 Apr 2024 15:30:18 +0200
|
||||
Subject: [PATCH] econet: Handle unbound HSGMII LAN interfaces.
|
||||
|
||||
---
|
||||
econet/ecnt_prvt.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/econet/ecnt_prvt.c b/econet/ecnt_prvt.c
|
||||
index 12c537f..a37fb49 100644
|
||||
--- a/econet/ecnt_prvt.c
|
||||
+++ b/econet/ecnt_prvt.c
|
||||
@@ -212,6 +212,7 @@ int hsgmii_lan_prvt_get_port_statistics(char *ifname, struct eth_stats *stats, s
|
||||
if (!strncmp(driver_name, DRIVER_NAME, DRIVER_NAME_LEN)) {
|
||||
int i = 0, hsgmii_index = -1;
|
||||
const char *hsgmii_iftype;
|
||||
+ char cmdbuf[512] = {0};
|
||||
|
||||
for (; i < ARRAY_SIZE(hsgmii_lookup_tbl); i++) {
|
||||
int j = 0;
|
||||
@@ -235,6 +236,11 @@ int hsgmii_lan_prvt_get_port_statistics(char *ifname, struct eth_stats *stats, s
|
||||
memset(&tx_stats, 0, sizeof(ECNT_FEMGR_GDMA2_TX_STATISTICS));
|
||||
memset(&rx_stats, 0, sizeof(ECNT_FEMGR_GDMA2_RX_STATISTICS));
|
||||
|
||||
+ /* Handle unbound interface statistics */
|
||||
+ chrCmd(cmdbuf, sizeof(cmdbuf), "cat /proc/tc3162/%s_rebind | awk '{ print $3 }'", ifname);
|
||||
+ if (cmdbuf[0] != '\0' && strtoul(cmdbuf, NULL, 0) == 1)
|
||||
+ return 0;
|
||||
+
|
||||
if (!fe_lib_get_hsgmii_tx_statistics(&tx_stats, hsgmii_index)) {
|
||||
fill_stats_tx_from_gdma(stats, rstats, &tx_stats);
|
||||
}
|
||||
--
|
||||
2.43.2
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libqos
|
||||
PKG_VERSION:=7.2.107
|
||||
PKG_VERSION:=7.2.108
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=de659f50c0ae1cd4ec64315b301c53595eaf39de
|
||||
PKG_SOURCE_VERSION:=6a72e35e1a662e2f707e4901679676a9c09b3bc2
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libqos.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-broadcom
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.13
|
||||
PKG_VERSION:=1.0.14
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=f1509651217d027376b5b7fc3f64ca86662e9b2d
|
||||
PKG_SOURCE_VERSION:=7fde62b9634c63b9bc71d1c20541798971a78dc8
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-d2
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.1.11
|
||||
PKG_VERSION:=1.1.12
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=95fb29a31f7665abbe87af4a74cf52b7e5f22a29
|
||||
PKG_SOURCE_VERSION:=772955d814af8bbf91cf5c76f128cd1d17755625
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libwifi
|
||||
PKG_VERSION:=7.4.69
|
||||
PKG_VERSION:=7.4.75
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=8a5d8b5defb7cedc5876bb5fbee5c1ad185de889
|
||||
PKG_SOURCE_VERSION:=92176d664063be63c03bfe2e353193b3291b714a
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libwifi.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
|
||||
@@ -59,5 +59,8 @@ config AGENT_CHECK_PARTIAL_WIFI_RELOAD
|
||||
bool "Option that allow SSID/PSK simple reload"
|
||||
default y
|
||||
|
||||
config DYNBHD_DYNAMICALLY_PERSIST_CONTROLLER
|
||||
bool "Let dynbhd through AP-Autoconfiguration Search and DHCP Discovery determine the controller or agent role"
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=6.1.1.1
|
||||
PKG_VERSION:=6.1.1.4
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=9701d5b50dfa194bd24eefdec025b76996fb1309
|
||||
PKG_SOURCE_VERSION:=cd3caa0fc30cdfc5b9392bce8ecaebb4b17f3b3d
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
@@ -109,6 +109,10 @@ ifeq ($(CONFIG_AGENT_CHECK_PARTIAL_WIFI_RELOAD),y)
|
||||
TARGET_CFLAGS += -DCHECK_PARTIAL_WIFI_RELOAD
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DYNBHD_DYNAMICALLY_PERSIST_CONTROLLER),y)
|
||||
TARGET_CFLAGS += -DPERSIST_CONTROLLER
|
||||
endif
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/map-agent/install
|
||||
|
||||
@@ -193,19 +193,24 @@ map_genconf () {
|
||||
uci -q set mapagent.@controller_select[0].local=1
|
||||
fi
|
||||
uci -q commit mapagent
|
||||
fi
|
||||
|
||||
if [ "$multiap_mode" == "agent" -o "$multiap_mode" == "none" ]; then
|
||||
uci set mapcontroller.controller.enabled="0"
|
||||
else
|
||||
uci set mapcontroller.controller.enabled="1"
|
||||
[ "$disable_mlo" == "1" ] && {
|
||||
mapcontroller_disable_mld() {
|
||||
uci set mapcontroller.$1.enabled='0'
|
||||
if [ "$multiap_mode" == "agent" -o "$multiap_mode" == "none" ]; then
|
||||
uci set mapcontroller.controller.enabled="0"
|
||||
else
|
||||
uci set mapcontroller.controller.enabled="1"
|
||||
[ "$disable_mlo" == "1" ] && {
|
||||
mapcontroller_remove_mld() {
|
||||
uci delete mapcontroller.$1
|
||||
}
|
||||
mapcontroller_remove_mld_id() {
|
||||
uci delete mapcontroller.$1.mld_id
|
||||
}
|
||||
|
||||
config_load mapcontroller
|
||||
config_foreach mapcontroller_remove_mld mld
|
||||
config_foreach mapcontroller_remove_mld_id ap
|
||||
}
|
||||
config_load mapcontroller
|
||||
config_foreach mapcontroller_disable_mld mld
|
||||
}
|
||||
fi
|
||||
uci -q commit mapcontroller
|
||||
fi
|
||||
uci -q commit mapcontroller
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=6.1.1.1
|
||||
PKG_VERSION:=6.1.1.4
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=b6b7343fee124ab42bfccbe9c46523e0b01c3c10
|
||||
PKG_SOURCE_VERSION:=dfa994dbb956b355cad26fbc33b5be04f37e0064
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
|
||||
@@ -128,14 +128,14 @@ configure_mcpd_snooping() {
|
||||
config_snooping_common_params $protocol $igmp_s_version $igmp_s_robustness $igmp_s_mode
|
||||
config_mcast_querier_params $protocol $igmp_s_query_interval $igmp_s_q_resp_interval $igmp_s_last_mem_q_int
|
||||
config_snooping_upstream_interface "$igmp_s_iface"
|
||||
config_snooping_on_bridge $protocol $igmp_s_iface $igmp_s_mode
|
||||
config_snooping_on_bridge $protocol "$igmp_s_iface" $igmp_s_mode
|
||||
exceptions=$igmp_s_exceptions
|
||||
fast_leave=$igmp_s_fast_leave
|
||||
elif [ "$protocol" == "mld" ]; then
|
||||
config_snooping_common_params $protocol $mld_s_version $mld_s_robustness $mld_s_mode
|
||||
config_mcast_querier_params $protocol $mld_s_query_interval $mld_s_q_resp_interval $mld_s_last_mem_q_int
|
||||
config_snooping_upstream_interface "$mld_s_iface"
|
||||
config_snooping_on_bridge $protocol $mld_s_iface $mld_s_mode
|
||||
config_snooping_on_bridge $protocol "$mld_s_iface" $mld_s_mode
|
||||
exceptions=$mld_s_exceptions
|
||||
fast_leave=$mld_s_fast_leave
|
||||
fi
|
||||
@@ -171,14 +171,14 @@ configure_mcpd_proxy() {
|
||||
config_snooping_common_params $protocol $igmp_p_version $igmp_p_robustness $igmp_p_mode
|
||||
config_mcast_querier_params $protocol $igmp_query_interval $igmp_q_resp_interval $igmp_last_mem_q_int
|
||||
config_mcast_proxy_interface $protocol "$igmp_p_up_interfaces"
|
||||
config_snooping_on_bridge $protocol $igmp_p_down_interfaces $igmp_p_mode
|
||||
config_snooping_on_bridge $protocol "$igmp_p_down_interfaces" $igmp_p_mode
|
||||
fast_leave=$igmp_fast_leave
|
||||
exceptions=$igmp_p_exceptions
|
||||
elif [ "$protocol" == "mld" ]; then
|
||||
config_snooping_common_params $protocol $mld_p_version $mld_p_robustness $mld_p_mode
|
||||
config_mcast_querier_params $protocol $mld_query_interval $mld_q_resp_interval $mld_last_mem_q_int
|
||||
config_mcast_proxy_interface $protocol "$mld_p_up_interfaces"
|
||||
config_snooping_on_bridge $protocol $mld_p_down_interfaces $mld_p_mode
|
||||
config_snooping_on_bridge $protocol "$mld_p_down_interfaces" $mld_p_mode
|
||||
fast_leave=$mld_fast_leave
|
||||
exceptions=$mld_p_exceptions
|
||||
fi
|
||||
@@ -236,7 +236,7 @@ configure_mcpd() {
|
||||
|
||||
setup_mcast_mode() {
|
||||
# set the mode at chip to allow both tagged and untagged multicast forwarding
|
||||
bs /b/c iptv lookup_method=group_ip_src_ip
|
||||
bs /b/c iptv lookup_method=group_ip_src_ip_vid
|
||||
}
|
||||
|
||||
configure_mcast() {
|
||||
|
||||
@@ -64,23 +64,11 @@ read_mcast_stats() {
|
||||
|
||||
json_init
|
||||
json_add_array "snooping"
|
||||
json_add_object ""
|
||||
IFS=" "
|
||||
for intf in $ifaces; do
|
||||
while read line; do
|
||||
# reading each line
|
||||
case $line in
|
||||
br-*)
|
||||
snoop_iface="$(echo $line | awk -F ' ' '{ print $1 }')"
|
||||
if [ "$snoop_iface" != "$intf" ]; then
|
||||
continue
|
||||
fi
|
||||
json_add_string "interface" "$intf"
|
||||
json_add_array "groups"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done < /tmp/igmp_stats
|
||||
json_add_object ""
|
||||
json_add_string "interface" "$intf"
|
||||
json_add_array "groups"
|
||||
IFS=" "
|
||||
for gip_addr in $mcast_addrs; do
|
||||
grp_obj_added=0
|
||||
@@ -116,12 +104,14 @@ read_mcast_stats() {
|
||||
;;
|
||||
esac
|
||||
done < /tmp/igmp_stats
|
||||
json_close_array #close the associated devices array
|
||||
json_close_object # close the groups object
|
||||
if [ $grp_obj_added -eq 1 ]; then
|
||||
json_close_array #close the associated devices array
|
||||
json_close_object # close the groups object
|
||||
fi
|
||||
done # close the loop for group addresses
|
||||
json_close_array #close the groups array
|
||||
json_close_object # close the snooping object
|
||||
done # close the loop for interfaces
|
||||
json_close_object # close the snooping object
|
||||
json_close_array # close the snooping array
|
||||
json_dump
|
||||
|
||||
|
||||
24
mcastmngr/files/common/etc/hotplug.d/ethernet/mcast.hotplug
Executable file
24
mcastmngr/files/common/etc/hotplug.d/ethernet/mcast.hotplug
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$LINK" = "up" -a -n "$PORT" ] || exit 0
|
||||
|
||||
compare_mcast_snooping_interface() {
|
||||
local interface dev running
|
||||
|
||||
config_get interface "$1" interface
|
||||
|
||||
for dev in $interface; do
|
||||
if [ "$PORT" = "$dev" ]; then
|
||||
running=$(ubus call service list '{"name": "mcast"}' | jsonfilter -e '@.mcast.instances')
|
||||
if [ -z "${running}" ]; then
|
||||
/etc/init.d/mcast start
|
||||
else
|
||||
ubus call uci commit '{"config":"mcast"}'
|
||||
fi
|
||||
exit
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
config_load mcast
|
||||
config_foreach compare_mcast_snooping_interface "snooping"
|
||||
20
mcastmngr/files/common/etc/hotplug.d/iface/mcast.hotplug
Normal file → Executable file
20
mcastmngr/files/common/etc/hotplug.d/iface/mcast.hotplug
Normal file → Executable file
@@ -1,27 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$ACTION" = ifup ] || exit 0
|
||||
[ "$ACTION" = "ifup" -a -n "$INTERFACE" ] || exit 0
|
||||
|
||||
. /lib/functions/network.sh
|
||||
|
||||
network_get_device l3device $INTERFACE
|
||||
network_get_device l3device "$INTERFACE"
|
||||
|
||||
[ -n "$l3device" ] || exit 0
|
||||
|
||||
compare_mcast_proxy_upstream() {
|
||||
local upstream
|
||||
local mode="$2"
|
||||
local upstream dev running
|
||||
|
||||
if [ "$mode" == "proxy" ]; then
|
||||
config_get upstream $1 upstream_interface
|
||||
else
|
||||
config_get upstream $1 interface
|
||||
fi
|
||||
config_get upstream "$1" upstream_interface
|
||||
|
||||
for dev in $upstream; do
|
||||
if [ "$l3device" == "$dev" ]; then
|
||||
if [ "$l3device" = "$dev" ]; then
|
||||
running=$(ubus call service list '{"name": "mcast"}' | jsonfilter -e '@.mcast.instances')
|
||||
if [ -z "${running}" ];then
|
||||
if [ -z "${running}" ]; then
|
||||
/etc/init.d/mcast start
|
||||
else
|
||||
ubus call uci commit '{"config":"mcast"}'
|
||||
@@ -32,5 +27,4 @@ compare_mcast_proxy_upstream() {
|
||||
}
|
||||
|
||||
config_load mcast
|
||||
config_foreach compare_mcast_proxy_upstream "proxy" "proxy"
|
||||
config_foreach compare_mcast_proxy_upstream "snooping" "snooping"
|
||||
config_foreach compare_mcast_proxy_upstream "proxy"
|
||||
|
||||
@@ -262,10 +262,6 @@ config_mcproxy_instance() {
|
||||
downstreams=$igmp_p_down_interfaces
|
||||
mcast_mode=$igmp_p_mode
|
||||
|
||||
# mcproxy reserves two multicast subscriptions for igmp router service groups
|
||||
local mg=$(cat /proc/sys/net/ipv4/igmp_max_memberships)
|
||||
mg=$((mg+2))
|
||||
echo $mg > /proc/sys/net/ipv4/igmp_max_memberships
|
||||
elif [ "$protocol" == "mld" ]; then
|
||||
case "$version" in
|
||||
[1-2])
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
diff --git a/bbf_plugin/x_iopsys_eu_igmp.c b/bbf_plugin/x_iopsys_eu_igmp.c
|
||||
index 576099c..a6b0e5e 100644
|
||||
--- a/bbf_plugin/x_iopsys_eu_igmp.c
|
||||
+++ b/bbf_plugin/x_iopsys_eu_igmp.c
|
||||
@@ -60,7 +60,7 @@ static void sync_mcast_dmmap_iface_sec(struct uci_list *proxy_iface, char *s_mod
|
||||
struct uci_section *d_sec;
|
||||
int found = 0;
|
||||
char key[1024] = "";
|
||||
- char *s_name;
|
||||
+ char *s_name, *intf_dir, *intf_smode;
|
||||
|
||||
uci_foreach_element(proxy_iface, e) {
|
||||
char *p_ifname = dmstrdup(e->name);
|
||||
@@ -75,7 +75,12 @@ static void sync_mcast_dmmap_iface_sec(struct uci_list *proxy_iface, char *s_mod
|
||||
// file corresponding to this interface
|
||||
uci_path_foreach_option_eq(bbfdm, dmmap_package, dmmap_sec, "ifname", key, d_sec) {
|
||||
dmuci_get_value_by_section_string(d_sec, "section_name", &s_name);
|
||||
- if (strcmp(s_name, section_name(s)) == 0) {
|
||||
+ dmuci_get_value_by_section_string(d_sec, "upstream", &intf_dir);
|
||||
+ dmuci_get_value_by_section_string(d_sec, "snooping_mode", &intf_smode);
|
||||
+
|
||||
+ if (strcmp(s_name, section_name(s)) == 0 &&
|
||||
+ strcmp(intf_dir, up_iface) == 0 &&
|
||||
+ strcmp(intf_smode, s_mode) == 0) {
|
||||
add_dmmap_config_dup_list(dup_list, s, d_sec);
|
||||
found = 1;
|
||||
break;
|
||||
@@ -1640,12 +1645,6 @@ static void sync_proxy_interface_sections(struct uci_section *s, char *section,
|
||||
val = dmstrdup(e->name);
|
||||
if (DM_STRCMP(val, pch) == 0) {
|
||||
found = 1;
|
||||
- if (!up_iface) {
|
||||
- // if entry is found and upstream was set to
|
||||
- // false, then, remove this entry
|
||||
- dmuci_del_list_value_by_section(s, section, val);
|
||||
- }
|
||||
-
|
||||
// Further action is not required
|
||||
break;
|
||||
}
|
||||
@@ -22,6 +22,11 @@ config OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
config OBUSPA_ENABLE_TEST_CONTROLLER
|
||||
bool "Adds a test controller by default"
|
||||
default n
|
||||
select OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL
|
||||
|
||||
config OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL
|
||||
bool "Adds a test controller by default (local access only)"
|
||||
default n
|
||||
|
||||
config OBUSPA_MAX_CONTROLLERS_NUM
|
||||
int "The maximum number of controllers to be supported"
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=8.0.1.6
|
||||
PKG_VERSION:=8.0.1.9
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
|
||||
PKG_SOURCE_VERSION:=0997eebe269d766eb738b80e4d5ccd40baf79090
|
||||
PKG_SOURCE_VERSION:=aebe4c8e306f89026daf5a987dc1db98befd3474
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -32,7 +32,9 @@ define Package/obuspa
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=USP agent
|
||||
MENU:=1
|
||||
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl
|
||||
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl +ca-certificates \
|
||||
+OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL:mosquitto-ssl +OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL:mosquitto-client-ssl \
|
||||
+OBUSPA_ENABLE_TEST_CONTROLLER:mosquitto-auth-shadow
|
||||
endef
|
||||
|
||||
define Package/obuspa/description
|
||||
@@ -127,6 +129,9 @@ define Package/obuspa/install
|
||||
$(INSTALL_BIN) ./files/obuspa.hotplug $(1)/etc/hotplug.d/iface/21-obuspa
|
||||
$(BBFDM_INSTALL_CORE_PLUGIN) ./files/etc/bbfdm/json/USPAgent.json $(1)
|
||||
ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER),y)
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/54-test-usp-remote $(1)/etc/uci-defaults/
|
||||
endif
|
||||
ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL),y)
|
||||
$(INSTALL_BIN) ./files/etc/init.d/usptest $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/55-test-usp-controller $(1)/etc/uci-defaults/
|
||||
endif
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"dmcaching_exclude": [
|
||||
"Device.Hosts.Host.",
|
||||
"Device.IEEE1905.",
|
||||
"Device.WiFi.DataElements."
|
||||
"Device.WiFi.DataElements.",
|
||||
"Device.NAT.InterfaceSetting."
|
||||
]
|
||||
}
|
||||
|
||||
20
obuspa/files/etc/uci-defaults/54-test-usp-remote
Normal file
20
obuspa/files/etc/uci-defaults/54-test-usp-remote
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
if [ ! -f "/etc/config/mosquitto" ]; then
|
||||
echo "Local mosquitto broker not available"
|
||||
return 0
|
||||
fi
|
||||
|
||||
add_usp_test()
|
||||
{
|
||||
uci_add mosquitto listener usptest
|
||||
uci_set mosquitto usptest enabled 1
|
||||
uci_set mosquitto usptest port '9001'
|
||||
uci_set mosquitto usptest protocol 'websockets'
|
||||
uci_set mosquitto usptest auth_plugin '/usr/lib/mosquitto_auth_shadow.so'
|
||||
}
|
||||
|
||||
# Install test MQTT over WS listener
|
||||
add_usp_test
|
||||
@@ -40,16 +40,6 @@ add_obuspa_test_controller()
|
||||
uci_set obuspa testcontroller assigned_role_name 'full_access'
|
||||
}
|
||||
|
||||
add_usp_test()
|
||||
{
|
||||
uci_add mosquitto listener usptest
|
||||
uci_set mosquitto usptest enabled 1
|
||||
uci_set mosquitto usptest port '9001'
|
||||
uci_set mosquitto usptest protocol 'websockets'
|
||||
uci_set mosquitto usptest require_certificates '0'
|
||||
uci_set mosquitto usptest auth_plugin '/usr/lib/mosquitto_auth_shadow.so'
|
||||
}
|
||||
|
||||
add_obuspa_config()
|
||||
{
|
||||
uci_add mosquitto listener obuspa
|
||||
@@ -60,11 +50,8 @@ add_obuspa_config()
|
||||
}
|
||||
|
||||
# Install test usp controller config
|
||||
uci_load mosquitto
|
||||
add_usp_test
|
||||
add_obuspa_config
|
||||
|
||||
uci_load obuspa
|
||||
add_obuspa_test_mtp
|
||||
add_obuspa_test_mqtt
|
||||
add_obuspa_test_controller
|
||||
|
||||
@@ -7,7 +7,7 @@ index 5e367b7..db154a5 100644
|
||||
char *DEVICE_CONTROLLER_GetControllerTopic(int mqtt_instance);
|
||||
|
||||
+#ifdef OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
+bool DEVICE_CONTROLLER_IsMTPAllowed(char *endpoint_id, mtp_reply_to_t *mrt);
|
||||
+bool DEVICE_CONTROLLER_IsMTPAllowed(char *endpoint_id, mtp_conn_t *mpc);
|
||||
+#endif
|
||||
+
|
||||
#ifndef REMOVE_USP_BROKER
|
||||
@@ -30,12 +30,12 @@ index 97ca11d..19c91f1 100644
|
||||
+** This function is used by ValidateUspRecord() to determine whether to process a received USP message
|
||||
+**
|
||||
+** \param endpoint_id - Endpoint ID of controller that sent a USP message
|
||||
+** \param mrt - pointer to structure specifying on which MTP the message was received
|
||||
+** \param mpc - pointer to structure specifying on which MTP the message was received
|
||||
+**
|
||||
+** \return true if the MTP is allowed, false otherwise
|
||||
+**
|
||||
+**************************************************************************/
|
||||
+bool DEVICE_CONTROLLER_IsMTPAllowed(char *endpoint_id, mtp_reply_to_t *mrt)
|
||||
+bool DEVICE_CONTROLLER_IsMTPAllowed(char *endpoint_id, mtp_conn_t *mpc)
|
||||
+{
|
||||
+ controller_t *cont = FindEnabledControllerByEndpointId(endpoint_id);
|
||||
+ controller_mtp_t *mtp;
|
||||
@@ -46,18 +46,18 @@ index 97ca11d..19c91f1 100644
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ mtp = FindFirstEnabledMtp(cont, mrt->protocol);
|
||||
+ mtp = FindFirstEnabledMtp(cont, mpc->protocol);
|
||||
+
|
||||
+#ifdef ENABLE_WEBSOCKETS
|
||||
+ // Allow websocket server if no other MTP is configured
|
||||
+ if ((mrt->protocol == kMtpProtocol_WebSockets) && (mrt->wsserv_conn_id != INVALID))
|
||||
+ if ((mpc->protocol == kMtpProtocol_WebSockets) && (mpc->ws.serv_conn_id != INVALID))
|
||||
+ {
|
||||
+ return mtp == NULL;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+ // Disallow if there is no MTP configured with matching protocol
|
||||
+ if ((mtp == NULL) || (mtp->protocol != mrt->protocol))
|
||||
+ if ((mtp == NULL) || (mtp->protocol != mpc->protocol))
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
@@ -67,7 +67,7 @@ index 97ca11d..19c91f1 100644
|
||||
+ {
|
||||
+#ifndef DISABLE_STOMP
|
||||
+ case kMtpProtocol_STOMP:
|
||||
+ return mtp->stomp_connection_instance == mrt->stomp_instance;
|
||||
+ return mtp->stomp_connection_instance == mpc->stomp.instance;
|
||||
+#endif
|
||||
+
|
||||
+#ifdef ENABLE_COAP
|
||||
@@ -77,12 +77,12 @@ index 97ca11d..19c91f1 100644
|
||||
+
|
||||
+#ifdef ENABLE_MQTT
|
||||
+ case kMtpProtocol_MQTT:
|
||||
+ return mtp->mqtt_connection_instance == mrt->mqtt_instance;
|
||||
+ return mtp->mqtt_connection_instance == mpc->mqtt.instance;
|
||||
+#endif
|
||||
+
|
||||
+#ifdef ENABLE_WEBSOCKETS
|
||||
+ case kMtpProtocol_WebSockets:
|
||||
+ return (mrt->wsclient_cont_instance == cont->instance) && (mrt->wsclient_mtp_instance == mtp->instance);
|
||||
+ return (mpc->ws.client_cont_instance == cont->instance) && (mpc->ws.client_mtp_instance == mtp->instance);
|
||||
+#endif
|
||||
+ default:
|
||||
+ TERMINATE_BAD_CASE(mtp->protocol);
|
||||
@@ -106,7 +106,7 @@ index 2a04d39..0b3074b 100644
|
||||
|
||||
+#ifdef OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
+ // Exit if the controller is not allowed to use the MTP on which the message was received
|
||||
+ if (DEVICE_CONTROLLER_IsMTPAllowed(rec->from_id, mrt) == false)
|
||||
+ if (DEVICE_CONTROLLER_IsMTPAllowed(rec->from_id, mtpc) == false)
|
||||
+ {
|
||||
+ USP_ERR_SetMessage("%s: Ignoring message from endpoint_id=%s (unauthorized MTP)", __FUNCTION__, rec->from_id);
|
||||
+ return USP_ERR_PERMISSION_DENIED;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
diff --git a/src/core/cli_server.c b/src/core/cli_server.c
|
||||
index 701cbd9..103361e 100644
|
||||
--- a/src/core/cli_server.c
|
||||
+++ b/src/core/cli_server.c
|
||||
@@ -733,10 +733,6 @@ int ExecuteCli_Get(char *arg1, char *arg2, char *usage)
|
||||
@@ -758,10 +758,6 @@ int ExecuteCli_Get(char *arg1, char *arg
|
||||
USP_ASSERT(gge->value != NULL);
|
||||
SendCliResponse("%s => %s\n", gge->path, gge->value);
|
||||
}
|
||||
@@ -13,11 +11,9 @@ index 701cbd9..103361e 100644
|
||||
}
|
||||
|
||||
GROUP_GET_VECTOR_Destroy(&ggv);
|
||||
diff --git a/src/core/handle_get.c b/src/core/handle_get.c
|
||||
index e1055e0..16b9ceb 100755
|
||||
--- a/src/core/handle_get.c
|
||||
+++ b/src/core/handle_get.c
|
||||
@@ -260,26 +260,16 @@ void FormPathExprResponse(int get_expr_index, char *path_expr, get_expr_info_t *
|
||||
@@ -260,26 +260,16 @@ void FormPathExprResponse(int get_expr_i
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -47,3 +43,4 @@ index e1055e0..16b9ceb 100755
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/core/data_model.c
|
||||
+++ b/src/core/data_model.c
|
||||
@@ -1243,7 +1243,7 @@ int DATA_MODEL_NotifyInstanceAdded(char
|
||||
@@ -1316,7 +1316,7 @@ int DATA_MODEL_NotifyInstanceAdded(char
|
||||
// Exit if instance already exists - nothing to do
|
||||
if (exists)
|
||||
{
|
||||
@@ -9,7 +9,7 @@
|
||||
return USP_ERR_CREATION_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1328,7 +1328,7 @@ int DATA_MODEL_NotifyInstanceDeleted(cha
|
||||
@@ -1404,7 +1404,7 @@ int DATA_MODEL_NotifyInstanceDeleted(cha
|
||||
// Exit if instance does not exist - nothing to do
|
||||
if (exists == false)
|
||||
{
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
--- a/src/core/data_model.c
|
||||
+++ b/src/core/data_model.c
|
||||
@@ -137,6 +137,7 @@ int GetVendorParam(dm_node_t *node, char
|
||||
int SetVendorParam(dm_node_t *node, char *path, dm_instances_t *inst, char *value, dm_req_t *req);
|
||||
@@ -160,6 +160,7 @@ int SetVendorParam(dm_node_t *node, char
|
||||
double_link_t *FindLinkToFirstObject(double_linked_list_t *list);
|
||||
int OverrideNodeType(dm_node_t *node, dm_node_type_t type, char *schema_path, dm_instances_t *inst);
|
||||
|
||||
+extern bool is_running_cli_local_command;
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** DATA_MODEL_Init
|
||||
@@ -224,7 +225,9 @@ int DATA_MODEL_Init(void)
|
||||
@@ -267,7 +268,9 @@ int DATA_MODEL_Init(void)
|
||||
}
|
||||
|
||||
// Set the default values of OUI, Serial Number and (LocalAgent) EndpointID, and cache EndpointID
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
diff --git a/src/core/bdc_exec.c b/src/core/bdc_exec.c
|
||||
index 6b5c11d..3670361 100644
|
||||
--- a/src/core/bdc_exec.c
|
||||
+++ b/src/core/bdc_exec.c
|
||||
@@ -548,9 +548,14 @@ int StartSendingReport(bdc_connection_t *bc)
|
||||
@@ -549,9 +549,14 @@ int StartSendingReport(bdc_connection_t
|
||||
// Set the list of headers
|
||||
bc->headers = NULL;
|
||||
bc->headers = curl_slist_append(bc->headers, "Content-Type: application/json; charset=UTF-8");
|
||||
@@ -18,8 +16,6 @@ index 6b5c11d..3670361 100644
|
||||
bc->headers = curl_slist_append(bc->headers, "Content-Encoding: gzip");
|
||||
}
|
||||
|
||||
diff --git a/src/core/bdc_exec.h b/src/core/bdc_exec.h
|
||||
index c58c6d5..ff37a2d 100644
|
||||
--- a/src/core/bdc_exec.h
|
||||
+++ b/src/core/bdc_exec.h
|
||||
@@ -53,6 +53,6 @@ void BDC_EXEC_ScheduleExit(void);
|
||||
@@ -30,11 +26,9 @@ index c58c6d5..ff37a2d 100644
|
||||
+#define BDC_FLAG_HEADER_OBJ_HIER 0x00000008 // If set, report format in header would be ObjectHierarchy otherwise NameValuePair
|
||||
|
||||
#endif
|
||||
diff --git a/src/core/device_bulkdata.c b/src/core/device_bulkdata.c
|
||||
index 5b1aff2..a7d1b3e 100755
|
||||
--- a/src/core/device_bulkdata.c
|
||||
+++ b/src/core/device_bulkdata.c
|
||||
@@ -68,7 +68,8 @@
|
||||
@@ -71,7 +71,8 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Definitions for formats that we support
|
||||
#define BULKDATA_ENCODING_TYPE "JSON"
|
||||
@@ -44,7 +38,7 @@ index 5b1aff2..a7d1b3e 100755
|
||||
|
||||
|
||||
// Definitions for Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp
|
||||
@@ -159,6 +160,7 @@ typedef struct
|
||||
@@ -162,6 +163,7 @@ typedef struct
|
||||
char compression[9];
|
||||
char method[9];
|
||||
bool use_date_header;
|
||||
@@ -52,7 +46,7 @@ index 5b1aff2..a7d1b3e 100755
|
||||
} profile_ctrl_params_t;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -233,7 +235,7 @@ bulkdata_profile_t *bulkdata_find_free_profile(void);
|
||||
@@ -236,7 +238,7 @@ bulkdata_profile_t *bulkdata_find_free_p
|
||||
bulkdata_profile_t *bulkdata_find_profile(int profile_id);
|
||||
int bulkdata_calc_report_map(bulkdata_profile_t *bp, kv_vector_t *report_map);
|
||||
int bulkdata_reduce_to_alt_name(char *spec, char *path, char *alt_name, char *out_buf, int buf_len);
|
||||
@@ -61,7 +55,7 @@ index 5b1aff2..a7d1b3e 100755
|
||||
unsigned char *bulkdata_compress_report(profile_ctrl_params_t *ctrl, char *input_buf, int input_len, int *p_output_len);
|
||||
int bulkdata_schedule_sending_http_report(profile_ctrl_params_t *ctrl, bulkdata_profile_t *bp, unsigned char *json_report, int report_len);
|
||||
int bulkdata_start_profile(bulkdata_profile_t *bp);
|
||||
@@ -307,7 +309,7 @@ int DEVICE_BULKDATA_Init(void)
|
||||
@@ -310,7 +312,7 @@ int DEVICE_BULKDATA_Init(void)
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.Parameter.{i}.Reference", "", Validate_BulkDataReference, NULL, DM_STRING);
|
||||
|
||||
// Device.BulkData.Profile.{i}.JSONEncoding
|
||||
@@ -70,7 +64,7 @@ index 5b1aff2..a7d1b3e 100755
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp", BULKDATA_JSON_TIMESTAMP_FORMAT_EPOCH, Validate_BulkDataReportTimestamp, NULL, DM_STRING);
|
||||
|
||||
// Device.BulkData.Profile.{i}.HTTP
|
||||
@@ -661,9 +663,11 @@ int Validate_BulkDataReference(dm_req_t *req, char *value)
|
||||
@@ -698,9 +700,11 @@ int Validate_BulkDataReference(dm_req_t
|
||||
int Validate_BulkDataReportFormat(dm_req_t *req, char *value)
|
||||
{
|
||||
// Exit if trying to set a value outside of the range we accept
|
||||
@@ -84,7 +78,7 @@ index 5b1aff2..a7d1b3e 100755
|
||||
return USP_ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
@@ -1974,6 +1978,14 @@ int bulkdata_platform_get_profile_control_params(bulkdata_profile_t *bp, profile
|
||||
@@ -2008,6 +2012,14 @@ int bulkdata_platform_get_profile_contro
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -99,7 +93,7 @@ index 5b1aff2..a7d1b3e 100755
|
||||
return USP_ERR_OK;
|
||||
}
|
||||
|
||||
@@ -2249,7 +2261,7 @@ void bulkdata_process_profile_http(bulkdata_profile_t *bp)
|
||||
@@ -2283,7 +2295,7 @@ void bulkdata_process_profile_http(bulkd
|
||||
}
|
||||
|
||||
// Exit if unable to generate the report
|
||||
@@ -108,7 +102,7 @@ index 5b1aff2..a7d1b3e 100755
|
||||
if (json_report == NULL)
|
||||
{
|
||||
USP_ERR_SetMessage("%s: bulkdata_generate_json_report failed", __FUNCTION__);
|
||||
@@ -2299,7 +2311,8 @@ void bulkdata_process_profile_usp_event(bulkdata_profile_t *bp)
|
||||
@@ -2333,7 +2345,8 @@ void bulkdata_process_profile_usp_event(
|
||||
kv_pair_t kv;
|
||||
report_t *cur_report;
|
||||
char *json_report;
|
||||
@@ -118,7 +112,7 @@ index 5b1aff2..a7d1b3e 100755
|
||||
|
||||
// Exit if the MTP has not been connected to successfully after bootup
|
||||
// This is to prevent BDC events being enqueued before the Boot! event is sent (the Boot! event is only sent after successfully connecting to the MTP).
|
||||
@@ -2316,6 +2329,14 @@ void bulkdata_process_profile_usp_event(bulkdata_profile_t *bp)
|
||||
@@ -2350,6 +2363,14 @@ void bulkdata_process_profile_usp_event(
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -133,7 +127,7 @@ index 5b1aff2..a7d1b3e 100755
|
||||
// When sending via USP events, only one report is ever sent in each USP event
|
||||
// So ensure all retained reports are removed. NOTE: Clearing the reports here is only necessary when switching protocol from HTTP to USP event, and where HTTP had some unsent reports
|
||||
bulkdata_clear_retained_reports(bp);
|
||||
@@ -2333,7 +2354,7 @@ void bulkdata_process_profile_usp_event(bulkdata_profile_t *bp)
|
||||
@@ -2367,7 +2388,7 @@ void bulkdata_process_profile_usp_event(
|
||||
bp->num_retained_reports = 1;
|
||||
|
||||
// Exit if unable to generate the report
|
||||
@@ -142,7 +136,7 @@ index 5b1aff2..a7d1b3e 100755
|
||||
if (json_report == NULL)
|
||||
{
|
||||
USP_ERR_SetMessage("%s: bulkdata_generate_json_report failed", __FUNCTION__);
|
||||
@@ -2545,21 +2566,7 @@ int bulkdata_reduce_to_alt_name(char *spec, char *path, char *alt_name, char *ou
|
||||
@@ -2579,21 +2600,7 @@ int bulkdata_reduce_to_alt_name(char *sp
|
||||
return USP_ERR_OK;
|
||||
}
|
||||
|
||||
@@ -165,7 +159,7 @@ index 5b1aff2..a7d1b3e 100755
|
||||
{
|
||||
JsonNode *top; // top of report
|
||||
JsonNode *array; // array of reports (retained + current)
|
||||
@@ -2574,7 +2581,6 @@ char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timesta
|
||||
@@ -2608,7 +2615,6 @@ char *bulkdata_generate_json_report(bulk
|
||||
long long value_as_ll;
|
||||
unsigned long long value_as_ull;
|
||||
bool value_as_bool;
|
||||
@@ -173,7 +167,7 @@ index 5b1aff2..a7d1b3e 100755
|
||||
int i, j;
|
||||
char buf[32];
|
||||
kv_pair_t *kv;
|
||||
@@ -2597,7 +2603,7 @@ char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timesta
|
||||
@@ -2631,7 +2637,7 @@ char *bulkdata_generate_json_report(bulk
|
||||
}
|
||||
else if (strcmp(report_timestamp, "ISO-8601")==0)
|
||||
{
|
||||
@@ -182,16 +176,16 @@ index 5b1aff2..a7d1b3e 100755
|
||||
if (result != NULL)
|
||||
{
|
||||
json_append_member(element, "CollectionTime", json_mkstring(buf));
|
||||
@@ -2656,11 +2662,174 @@ char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timesta
|
||||
@@ -2690,11 +2696,174 @@ char *bulkdata_generate_json_report(bulk
|
||||
json_append_member(top, "Report", array);
|
||||
|
||||
// Serialize the JSON tree
|
||||
- result = json_stringify(top, " ");
|
||||
+ char *output = json_stringify(top, " ");
|
||||
+
|
||||
+ // Clean up the JSON tree
|
||||
+ json_delete(top); // Other JsonNodes which are children of this top level tree will be deleted
|
||||
+
|
||||
|
||||
// Clean up the JSON tree
|
||||
json_delete(top); // Other JsonNodes which are children of this top level tree will be deleted
|
||||
|
||||
+ return output;
|
||||
+}
|
||||
+
|
||||
@@ -324,10 +318,10 @@ index 5b1aff2..a7d1b3e 100755
|
||||
+
|
||||
+ // Serialize the JSON tree
|
||||
+ char *output = json_stringify(top, " ");
|
||||
|
||||
// Clean up the JSON tree
|
||||
json_delete(top); // Other JsonNodes which are children of this top level tree will be deleted
|
||||
|
||||
+
|
||||
+ // Clean up the JSON tree
|
||||
+ json_delete(top); // Other JsonNodes which are children of this top level tree will be deleted
|
||||
+
|
||||
+ return output;
|
||||
+}
|
||||
+
|
||||
@@ -358,7 +352,7 @@ index 5b1aff2..a7d1b3e 100755
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2817,6 +2986,11 @@ int bulkdata_schedule_sending_http_report(profile_ctrl_params_t *ctrl, bulkdata_
|
||||
@@ -2851,6 +3020,11 @@ int bulkdata_schedule_sending_http_repor
|
||||
flags |= BDC_FLAG_DATE_HEADER;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/core/bdc_exec.c
|
||||
+++ b/src/core/bdc_exec.c
|
||||
@@ -547,11 +547,19 @@
|
||||
@@ -548,11 +548,19 @@ int StartSendingReport(bdc_connection_t
|
||||
|
||||
// Set the list of headers
|
||||
bc->headers = NULL;
|
||||
@@ -25,7 +25,7 @@
|
||||
{
|
||||
--- a/src/core/bdc_exec.h
|
||||
+++ b/src/core/bdc_exec.h
|
||||
@@ -53,6 +53,9 @@
|
||||
@@ -53,6 +53,9 @@ void BDC_EXEC_ScheduleExit(void);
|
||||
#define BDC_FLAG_PUT 0x00000001 // If set, HTTP PUT should be used instead of HTTP POST when sending the report to the BDC server
|
||||
#define BDC_FLAG_GZIP 0x00000002 // If set, the reports contants are Gzipped
|
||||
#define BDC_FLAG_DATE_HEADER 0x00000004 // If set, the date header should be included in the HTTP post.
|
||||
@@ -38,7 +38,7 @@
|
||||
#endif
|
||||
--- a/src/core/device_bulkdata.c
|
||||
+++ b/src/core/device_bulkdata.c
|
||||
@@ -67,9 +67,12 @@
|
||||
@@ -70,9 +70,12 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Definitions for formats that we support
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
|
||||
// Definitions for Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp
|
||||
@@ -153,6 +156,7 @@
|
||||
@@ -156,6 +159,7 @@ static char *profile_push_event_args[] =
|
||||
typedef struct
|
||||
{
|
||||
int num_retained_failed_reports;
|
||||
@@ -60,7 +60,7 @@
|
||||
char report_timestamp[33];
|
||||
char url[1025];
|
||||
char username[257];
|
||||
@@ -161,6 +165,11 @@
|
||||
@@ -164,6 +168,11 @@ typedef struct
|
||||
char method[9];
|
||||
bool use_date_header;
|
||||
char report_format[20];
|
||||
@@ -72,7 +72,7 @@
|
||||
} profile_ctrl_params_t;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -208,6 +217,7 @@
|
||||
@@ -211,6 +220,7 @@ int Validate_BulkDataEncodingType(dm_req
|
||||
int Validate_BulkDataReportingInterval(dm_req_t *req, char *value);
|
||||
int Validate_BulkDataReference(dm_req_t *req, char *value);
|
||||
int Validate_BulkDataReportFormat(dm_req_t *req, char *value);
|
||||
@@ -80,7 +80,7 @@
|
||||
int Validate_BulkDataReportTimestamp(dm_req_t *req, char *value);
|
||||
int Validate_BulkDataCompression(dm_req_t *req, char *value);
|
||||
int Validate_BulkDataHTTPMethod(dm_req_t *req, char *value);
|
||||
@@ -236,6 +246,8 @@
|
||||
@@ -239,6 +249,8 @@ bulkdata_profile_t *bulkdata_find_profil
|
||||
int bulkdata_calc_report_map(bulkdata_profile_t *bp, kv_vector_t *report_map);
|
||||
int bulkdata_reduce_to_alt_name(char *spec, char *path, char *alt_name, char *out_buf, int buf_len);
|
||||
char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timestamp, char *report_format);
|
||||
@@ -89,7 +89,7 @@
|
||||
unsigned char *bulkdata_compress_report(profile_ctrl_params_t *ctrl, char *input_buf, int input_len, int *p_output_len);
|
||||
int bulkdata_schedule_sending_http_report(profile_ctrl_params_t *ctrl, bulkdata_profile_t *bp, unsigned char *json_report, int report_len);
|
||||
int bulkdata_start_profile(bulkdata_profile_t *bp);
|
||||
@@ -250,6 +262,8 @@
|
||||
@@ -253,6 +265,8 @@ char *bulkdata_platform_calc_uri_query_s
|
||||
int bulkdata_platform_get_param_refs(int profile_id, param_ref_vector_t *param_refs);
|
||||
void bulkdata_expand_param_ref(param_ref_entry_t *pr, group_get_vector_t *ggv);
|
||||
void bulkdata_append_to_result_map(param_ref_entry_t *pr, group_get_vector_t *ggv, kv_vector_t *report_map);
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
@@ -282,7 +296,7 @@
|
||||
@@ -285,7 +299,7 @@ int DEVICE_BULKDATA_Init(void)
|
||||
err |= USP_REGISTER_VendorParam_ReadOnly("Device.BulkData.Status", Get_BulkDataGlobalStatus, DM_STRING);
|
||||
err |= USP_REGISTER_Param_Constant("Device.BulkData.MinReportingInterval", BULKDATA_MINIMUM_REPORTING_INTERVAL_STR, DM_UINT);
|
||||
err |= USP_REGISTER_Param_SupportedList("Device.BulkData.Protocols", bdc_protocols, NUM_ELEM(bdc_protocols));
|
||||
@@ -107,7 +107,7 @@
|
||||
err |= USP_REGISTER_Param_Constant("Device.BulkData.ParameterWildCardSupported", "true", DM_BOOL);
|
||||
err |= USP_REGISTER_Param_Constant("Device.BulkData.MaxNumberOfProfiles", BULKDATA_MAX_PROFILES_STR, DM_INT);
|
||||
err |= USP_REGISTER_Param_Constant("Device.BulkData.MaxNumberOfParameterReferences", "-1", DM_INT);
|
||||
@@ -297,7 +311,7 @@
|
||||
@@ -300,7 +314,7 @@ int DEVICE_BULKDATA_Init(void)
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.Name", "", NULL, NULL, DM_STRING);
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.NumberOfRetainedFailedReports", "0", Validate_NumberOfRetainedFailedReports, NULL, DM_INT);
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.Protocol", BULKDATA_PROTOCOL_HTTP, Validate_BulkDataProtocol, NULL, DM_STRING);
|
||||
@@ -116,7 +116,7 @@
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.ReportingInterval", "86400", Validate_BulkDataReportingInterval, NotifyChange_BulkDataReportingInterval, DM_UINT);
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.TimeReference", UNKNOWN_TIME_STR, NULL, NotifyChange_BulkDataTimeReference, DM_DATETIME);
|
||||
|
||||
@@ -312,6 +326,13 @@
|
||||
@@ -315,6 +329,13 @@ int DEVICE_BULKDATA_Init(void)
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.JSONEncoding.ReportFormat", BULKDATA_JSON_REPORT_FORMAT_NAME_VALUE, Validate_BulkDataReportFormat, NULL, DM_STRING);
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp", BULKDATA_JSON_TIMESTAMP_FORMAT_EPOCH, Validate_BulkDataReportTimestamp, NULL, DM_STRING);
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
// Device.BulkData.Profile.{i}.HTTP
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.HTTP.URL", "", NULL, NotifyChange_BulkDataURL, DM_STRING);
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.HTTP.Username", "", NULL, NULL, DM_STRING);
|
||||
@@ -591,9 +612,10 @@
|
||||
@@ -594,9 +615,10 @@ int Validate_BulkDataProtocol(dm_req_t *
|
||||
int Validate_BulkDataEncodingType(dm_req_t *req, char *value)
|
||||
{
|
||||
// Exit if trying to set a value outside of the range we accept
|
||||
@@ -143,7 +143,7 @@
|
||||
return USP_ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
@@ -676,6 +698,32 @@
|
||||
@@ -713,6 +735,32 @@ int Validate_BulkDataReportFormat(dm_req
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
@@ -176,7 +176,7 @@
|
||||
** Validate_BulkDataReportTimestamp
|
||||
**
|
||||
** Validates Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp
|
||||
@@ -1970,6 +2018,14 @@
|
||||
@@ -2004,6 +2052,14 @@ int bulkdata_platform_get_profile_contro
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
// Exit if unable to get ReportTimestamp
|
||||
USP_SNPRINTF(path, sizeof(path), "Device.BulkData.Profile.%d.JSONEncoding.ReportTimestamp", bp->profile_id);
|
||||
err = DATA_MODEL_GetParameterValue(path, ctrl_params->report_timestamp, sizeof(ctrl_params->report_timestamp), 0);
|
||||
@@ -1986,6 +2042,46 @@
|
||||
@@ -2020,6 +2076,46 @@ int bulkdata_platform_get_profile_contro
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
return USP_ERR_OK;
|
||||
}
|
||||
|
||||
@@ -2222,7 +2318,7 @@
|
||||
@@ -2256,7 +2352,7 @@ void bulkdata_process_profile_http(bulkd
|
||||
{
|
||||
int err;
|
||||
report_t *cur_report;
|
||||
@@ -247,7 +247,7 @@
|
||||
profile_ctrl_params_t ctrl;
|
||||
unsigned char *compressed_report;
|
||||
int compressed_len;
|
||||
@@ -2261,10 +2357,23 @@
|
||||
@@ -2295,10 +2391,23 @@ void bulkdata_process_profile_http(bulkd
|
||||
}
|
||||
|
||||
// Exit if unable to generate the report
|
||||
@@ -275,7 +275,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2273,14 +2382,14 @@
|
||||
@@ -2307,14 +2416,14 @@ void bulkdata_process_profile_http(bulkd
|
||||
USP_LOG_Info("BULK DATA: using compression method=%s", ctrl.compression);
|
||||
if (enable_protocol_trace)
|
||||
{
|
||||
@@ -294,7 +294,7 @@
|
||||
}
|
||||
// NOTE: From this point on, only the compressed_report exists
|
||||
|
||||
@@ -2310,9 +2419,15 @@
|
||||
@@ -2344,9 +2453,15 @@ void bulkdata_process_profile_usp_event(
|
||||
kv_vector_t event_args;
|
||||
kv_pair_t kv;
|
||||
report_t *cur_report;
|
||||
@@ -311,7 +311,7 @@
|
||||
|
||||
// Exit if the MTP has not been connected to successfully after bootup
|
||||
// This is to prevent BDC events being enqueued before the Boot! event is sent (the Boot! event is only sent after successfully connecting to the MTP).
|
||||
@@ -2321,20 +2436,62 @@
|
||||
@@ -2355,20 +2470,62 @@ void bulkdata_process_profile_usp_event(
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@
|
||||
}
|
||||
|
||||
// When sending via USP events, only one report is ever sent in each USP event
|
||||
@@ -2354,10 +2511,16 @@
|
||||
@@ -2388,10 +2545,16 @@ void bulkdata_process_profile_usp_event(
|
||||
bp->num_retained_reports = 1;
|
||||
|
||||
// Exit if unable to generate the report
|
||||
@@ -405,7 +405,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2365,15 +2528,15 @@
|
||||
@@ -2399,15 +2562,15 @@ void bulkdata_process_profile_usp_event(
|
||||
|
||||
// Construct event_args manually to avoid the overhead of a malloc and copy of the report in KV_VECTOR_Add()
|
||||
kv.key = "Data";
|
||||
@@ -424,7 +424,7 @@
|
||||
|
||||
// From the point of view of this code, the report(s) have been successfully sent, so don't retain them
|
||||
// NOTE: Sending of the reports successfully is delegated to the USP notification retry mechanism
|
||||
@@ -2835,6 +2998,319 @@
|
||||
@@ -2869,6 +3032,319 @@ char *bulkdata_generate_json_report(bulk
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
@@ -744,7 +744,7 @@
|
||||
** bulkdata_compress_report
|
||||
**
|
||||
** Compresses the report to send
|
||||
@@ -2986,9 +3462,18 @@
|
||||
@@ -3020,9 +3496,18 @@ int bulkdata_schedule_sending_http_repor
|
||||
flags |= BDC_FLAG_DATE_HEADER;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
diff --git a/src/protobuf-c/protobuf-c.c b/src/protobuf-c/protobuf-c.c
|
||||
index 3dc5473..0a6bde7 100644
|
||||
--- a/src/protobuf-c/protobuf-c.c
|
||||
+++ b/src/protobuf-c/protobuf-c.c
|
||||
@@ -1926,6 +1926,7 @@ repeated_field_pack_to_buffer(const ProtobufCFieldDescriptor *field,
|
||||
@@ -1926,6 +1926,7 @@ repeated_field_pack_to_buffer(const Prot
|
||||
buffer->append(buffer, rv, scratch);
|
||||
tmp = pack_buffer_packed_payload(field, count, array, buffer);
|
||||
assert(tmp == payload_len);
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
diff --git a/src/core/usp_err.c b/src/core/usp_err.c
|
||||
index 1626e58..6db1d42 100755
|
||||
--- a/src/core/usp_err.c
|
||||
+++ b/src/core/usp_err.c
|
||||
@@ -189,7 +189,9 @@ char *USP_ERR_ToString(int err, char *buf, int len)
|
||||
@@ -189,7 +189,9 @@ char *USP_ERR_ToString(int err, char *bu
|
||||
{
|
||||
#if HAVE_STRERROR_R && !STRERROR_R_CHAR_P
|
||||
// XSI version of strerror_r
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
|
||||
index 04a1a9c..8cb2ad7 100644
|
||||
--- a/src/core/mqtt.c
|
||||
+++ b/src/core/mqtt.c
|
||||
@@ -234,6 +234,8 @@ void HandleMqttDisconnect(mqtt_client_t *client);
|
||||
@@ -233,6 +233,8 @@ void HandleMqttDisconnect(mqtt_client_t
|
||||
#define DEFINE_MQTT_TrustCertVerifyCallbackIndex(index) \
|
||||
int MQTT_TrustCertVerifyCallback_##index (int preverify_ok, X509_STORE_CTX *x509_ctx) \
|
||||
{\
|
||||
@@ -11,7 +9,7 @@ index 04a1a9c..8cb2ad7 100644
|
||||
return DEVICE_SECURITY_TrustCertVerifyCallbackWithCertChain(preverify_ok, x509_ctx, &mqtt_clients[index].cert_chain);\
|
||||
}
|
||||
|
||||
@@ -244,6 +246,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex(1);
|
||||
@@ -243,6 +245,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(2);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(3);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(4);
|
||||
@@ -23,7 +21,7 @@ index 04a1a9c..8cb2ad7 100644
|
||||
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@@ -254,10 +261,15 @@ ssl_verify_callback_t* mqtt_verify_callbacks[] = {
|
||||
@@ -253,10 +260,15 @@ ssl_verify_callback_t* mqtt_verify_callb
|
||||
MQTT_TrustCertVerifyCallbackIndex(2),
|
||||
MQTT_TrustCertVerifyCallbackIndex(3),
|
||||
MQTT_TrustCertVerifyCallbackIndex(4),
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
|
||||
index 70a10c2..e8a39cf 100644
|
||||
--- a/src/core/mqtt.c
|
||||
+++ b/src/core/mqtt.c
|
||||
@@ -63,6 +63,8 @@
|
||||
@@ -11,7 +9,7 @@ index 70a10c2..e8a39cf 100644
|
||||
// Defines for MQTT Property Values
|
||||
#define PUBLISH 0x30
|
||||
#define CONTENT_TYPE 3
|
||||
@@ -2180,6 +2182,75 @@ exit:
|
||||
@@ -2192,6 +2194,75 @@ exit:
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +85,7 @@ index 70a10c2..e8a39cf 100644
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** PerformMqttClientConnect
|
||||
@@ -2249,6 +2320,14 @@ int PerformMqttClientConnect(mqtt_client_t *client)
|
||||
@@ -2261,6 +2332,14 @@ int PerformMqttClientConnect(mqtt_client
|
||||
keep_alive = 5;
|
||||
}
|
||||
|
||||
|
||||
76
obuspa/patches/0013-mqtt-retry-param-change.patch
Normal file
76
obuspa/patches/0013-mqtt-retry-param-change.patch
Normal file
@@ -0,0 +1,76 @@
|
||||
diff --git a/src/core/device_mqtt.c b/src/core/device_mqtt.c
|
||||
index 7438e59..231d941 100755
|
||||
--- a/src/core/device_mqtt.c
|
||||
+++ b/src/core/device_mqtt.c
|
||||
@@ -1612,14 +1612,23 @@ int NotifyChange_MQTTRequestProblemInfo(dm_req_t *req, char *value)
|
||||
int NotifyChange_MQTTConnectRetryTime(dm_req_t *req, char *value)
|
||||
{
|
||||
mqtt_conn_params_t *mp;
|
||||
+ bool schedule_reconnect = false;
|
||||
|
||||
// Determine mqtt client to be updated
|
||||
mp = FindMqttParamsByInstance(inst1);
|
||||
USP_ASSERT(mp != NULL);
|
||||
|
||||
// Set the new value.
|
||||
+ if ((mp->retry.connect_retrytime != val_uint) && (mp->enable)) {
|
||||
+ schedule_reconnect = true;
|
||||
+ }
|
||||
+
|
||||
mp->retry.connect_retrytime = val_uint;
|
||||
|
||||
+ if (schedule_reconnect) {
|
||||
+ ScheduleMqttReconnect(mp);
|
||||
+ }
|
||||
+
|
||||
return USP_ERR_OK;
|
||||
}
|
||||
|
||||
@@ -1638,14 +1647,23 @@ int NotifyChange_MQTTConnectRetryTime(dm_req_t *req, char *value)
|
||||
int NotifyChange_MQTTConnectRetryIntervalMultiplier(dm_req_t *req, char *value)
|
||||
{
|
||||
mqtt_conn_params_t *mp;
|
||||
+ bool schedule_reconnect = false;
|
||||
|
||||
// Determine mqtt client to be updated
|
||||
mp = FindMqttParamsByInstance(inst1);
|
||||
USP_ASSERT(mp != NULL);
|
||||
|
||||
+ if ((mp->retry.interval_multiplier != val_int) && (mp->enable)) {
|
||||
+ schedule_reconnect = true;
|
||||
+ }
|
||||
+
|
||||
// Set the new value.
|
||||
mp->retry.interval_multiplier = val_int;
|
||||
|
||||
+ if (schedule_reconnect) {
|
||||
+ ScheduleMqttReconnect(mp);
|
||||
+ }
|
||||
+
|
||||
return USP_ERR_OK;
|
||||
}
|
||||
|
||||
@@ -1664,14 +1682,23 @@ int NotifyChange_MQTTConnectRetryIntervalMultiplier(dm_req_t *req, char *value)
|
||||
int NotifyChange_MQTTConnectRetryMaxInterval(dm_req_t *req, char *value)
|
||||
{
|
||||
mqtt_conn_params_t *mp;
|
||||
+ bool schedule_reconnect = false;
|
||||
|
||||
// Determine mqtt client to be updated
|
||||
mp = FindMqttParamsByInstance(inst1);
|
||||
USP_ASSERT(mp != NULL);
|
||||
|
||||
+ if ((mp->retry.max_interval != val_uint) && (mp->enable)) {
|
||||
+ schedule_reconnect = true;
|
||||
+ }
|
||||
+
|
||||
// Set the new value.
|
||||
mp->retry.max_interval = val_uint;
|
||||
|
||||
+ if (schedule_reconnect) {
|
||||
+ ScheduleMqttReconnect(mp);
|
||||
+ }
|
||||
+
|
||||
return USP_ERR_OK;
|
||||
}
|
||||
|
||||
14
obuspa/patches/0020-fix_segfault_invalid_uds.patch
Normal file
14
obuspa/patches/0020-fix_segfault_invalid_uds.patch
Normal file
@@ -0,0 +1,14 @@
|
||||
--- a/src/core/device_uds.c
|
||||
+++ b/src/core/device_uds.c
|
||||
@@ -182,10 +182,7 @@ int DEVICE_UDS_Start(void)
|
||||
USP_SNPRINTF(path, sizeof(path), "%s.%d", device_uds_conn_root, instance);
|
||||
USP_LOG_Warning("%s: Deleting %s as it contained invalid parameters.", __FUNCTION__, path);
|
||||
err = DATA_MODEL_DeleteInstance(path, 0);
|
||||
- if (err != USP_ERR_OK)
|
||||
- {
|
||||
- goto exit;
|
||||
- }
|
||||
+ goto exit;
|
||||
}
|
||||
|
||||
ucp = FindUdsParamsByInstance(instance);
|
||||
62
obuspa/patches/011-increase_max_num_of_controllers.patch
Normal file
62
obuspa/patches/011-increase_max_num_of_controllers.patch
Normal file
@@ -0,0 +1,62 @@
|
||||
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
|
||||
index 8cb2ad7..b7be65f 100644
|
||||
--- a/src/core/mqtt.c
|
||||
+++ b/src/core/mqtt.c
|
||||
@@ -251,6 +251,16 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex(6);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(7);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(8);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(9);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(10);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(11);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(12);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(13);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(14);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(15);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(16);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(17);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(18);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(19);
|
||||
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@@ -266,6 +276,16 @@ ssl_verify_callback_t* mqtt_verify_callbacks[] = {
|
||||
MQTT_TrustCertVerifyCallbackIndex(7),
|
||||
MQTT_TrustCertVerifyCallbackIndex(8),
|
||||
MQTT_TrustCertVerifyCallbackIndex(9),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(10),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(11),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(12),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(13),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(14),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(15),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(16),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(17),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(18),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(19),
|
||||
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
|
||||
};
|
||||
|
||||
diff --git a/src/vendor/vendor_defs.h b/src/vendor/vendor_defs.h
|
||||
index 315bea3..50fa750 100755
|
||||
--- a/src/vendor/vendor_defs.h
|
||||
+++ b/src/vendor/vendor_defs.h
|
||||
@@ -47,7 +47,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Definitions used to size static arrays
|
||||
// You are unlikely to need to change these
|
||||
-#define MAX_DM_INSTANCE_ORDER 6 // Maximum number of instance numbers in a data model schema path (ie number of '{i}' in the schema path)
|
||||
+#define MAX_DM_INSTANCE_ORDER 21 // Maximum number of instance numbers in a data model schema path (ie number of '{i}' in the schema path)
|
||||
#define MAX_DM_PATH (256) // Maximum number of characters in a data model path
|
||||
#define MAX_DM_VALUE_LEN (4096) // Maximum number of characters in a data model parameter value
|
||||
#define MAX_DM_SHORT_VALUE_LEN (MAX_DM_PATH) // Maximum number of characters in an (expected to be) short data model parameter value
|
||||
@@ -76,8 +76,8 @@
|
||||
// Maximum number of MQTT Client Connections (Device.MQTT.Client.{i})
|
||||
#define MAX_MQTT_CLIENTS (OBUSPA_MAX_CONTROLLERS_NUM)
|
||||
#else
|
||||
-#define MAX_CONTROLLERS 5
|
||||
-#define MAX_MQTT_CLIENTS (5)
|
||||
+#define MAX_CONTROLLERS 20
|
||||
+#define MAX_MQTT_CLIENTS (20)
|
||||
#endif
|
||||
|
||||
// Maximum number of bytes allowed in a USP protobuf message.
|
||||
@@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=qosmngr
|
||||
PKG_VERSION:=1.0.11
|
||||
PKG_VERSION:=1.0.14
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=56829e15bdce24a3eb4f8dfa43355d4b25632c48
|
||||
PKG_SOURCE_VERSION:=c4db530aae2392f94494814eefc977118519089b
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/qosmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -36,6 +36,8 @@ define Package/qosmngr/description
|
||||
Configures L2 QoS and collects queue statistics
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ./qosmngr/* $(PKG_BUILD_DIR)/
|
||||
@@ -54,6 +56,7 @@ endif
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/qosmngr $(1)/usr/sbin
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/bbf_plugin/libqos_bbf.so $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libqos_vendor_bbf.so $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,qosmngr))
|
||||
|
||||
@@ -26,7 +26,17 @@ hw_intf_init() {
|
||||
|
||||
# Initialize the hardware setup library
|
||||
hw_init_all() {
|
||||
local tc=0
|
||||
|
||||
export TMP_HW_QUEUE_LIST=""
|
||||
echo clear > /proc/ifc_debug
|
||||
echo reinit > /proc/ifc_debug
|
||||
|
||||
for tc in $(seq 0 7); do
|
||||
rm -rf "/tmp/qos/dscp_values_${tc}_4"
|
||||
rm -rf "/tmp/qos/dscp_values_${tc}_6"
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -150,6 +160,8 @@ hw_commit_all() {
|
||||
local shape_rate="$TMP_HW_SHAPE_RATE"
|
||||
local q_count="0"
|
||||
local mac_qos_flag=""
|
||||
local pbit=0
|
||||
local tc=0
|
||||
|
||||
# Reorder queues
|
||||
for q in ${sorted_list} ; do
|
||||
@@ -190,12 +202,48 @@ hw_commit_all() {
|
||||
;;
|
||||
esac
|
||||
|
||||
rm -f "/tmp/qos/wan_link_shape_rate"
|
||||
rm -f "/tmp/qos/wan_link_speed"
|
||||
if [ "${glob_alg}" != "" ] ; then
|
||||
/userfs/bin/qosrule discpline $(hw_sc_alg2str ${glob_alg}) ${weight_list} \
|
||||
uplink-bandwidth ${shape_rate:-10000000} \
|
||||
queuemask "$(((1 << q_count) - 1))"
|
||||
echo ${mac_qos_flag} > /proc/qdma_wan/mac_qos_flag
|
||||
if [ -n "${shape_rate}" ]; then
|
||||
echo "${shape_rate}" > "/tmp/qos/wan_link_shape_rate"
|
||||
else
|
||||
/usr/sbin/qos-uplink-bandwidth
|
||||
fi
|
||||
else
|
||||
/userfs/bin/qosrule discpline Enable 0
|
||||
fi
|
||||
|
||||
if [ -x /userfs/bin/blapi_cmd ]; then
|
||||
echo 1 > /proc/ifc_send_to_ppe
|
||||
for tc in $(seq 0 7); do
|
||||
if [ -s "/tmp/qos/dscp_values_${tc}_4" ]; then
|
||||
sort -un "/tmp/qos/dscp_values_${tc}_4" | awk 'NR==1{first=$1;last=$1;next}
|
||||
$1 == last+1 {last=$1;next}
|
||||
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1");first=$1;last=first}
|
||||
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1")}'
|
||||
fi
|
||||
if [ -s "/tmp/qos/dscp_values_${tc}_6" ]; then
|
||||
[ -s "/tmp/qos/dscp_values_${tc}_4" ] && sort -un "/tmp/qos/dscp_values_${tc}_6" | awk 'NR==1{first=$1;last=$1;next}
|
||||
$1 == last+1 {last=$1;next}
|
||||
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 0");first=$1;last=first}
|
||||
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 0")}'
|
||||
sort -un "/tmp/qos/dscp_values_${tc}_6" | awk 'NR==1{first=$1;last=$1;next}
|
||||
$1 == last+1 {last=$1;next}
|
||||
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1");first=$1;last=first}
|
||||
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1")}'
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -x /userfs/bin/ifc ]; then
|
||||
echo 1 > /proc/ifc_send_to_ppe
|
||||
for pbit in $(seq 0 7); do
|
||||
/userfs/bin/ifc add vip pbit $pbit
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ broute_ipv4_rule_options()
|
||||
config_get protocol "$cid" "proto"
|
||||
config_get dscp_filter "$cid" "dscp_filter"
|
||||
config_get icmp_type "$cid" "icmp_type"
|
||||
config_get traffic_class "$cid" "traffic_class"
|
||||
|
||||
set_ip_addr "$cid" ebt_match_src_ip ebt_match_dst_ip
|
||||
|
||||
@@ -36,6 +37,7 @@ broute_ipv4_rule_options()
|
||||
tos_val=$((dscp_filter<<2))
|
||||
tos_hex=$(printf "%x" $tos_val)
|
||||
broute_filter_on_dscp "$tos_hex"
|
||||
[ -n "$traffic_class" -a "$dscp_filter" != "0" ] && echo "$((dscp_filter))" >> "/tmp/qos/dscp_values_${traffic_class}_4"
|
||||
fi
|
||||
|
||||
if [ -n "$protocol" ]; then
|
||||
@@ -57,6 +59,7 @@ broute_ipv6_rule_options()
|
||||
config_get protocol "$cid" "proto"
|
||||
config_get dscp_filter "$cid" "dscp_filter"
|
||||
config_get icmp_type "$cid" "icmp_type"
|
||||
config_get traffic_class "$cid" "traffic_class"
|
||||
|
||||
set_ip_addr "$cid" ebt_match_ipv6_src_ip ebt_match_ipv6_dst_ip
|
||||
|
||||
@@ -67,6 +70,7 @@ broute_ipv6_rule_options()
|
||||
tos_val=$((dscp_filter<<2))
|
||||
tos_hex=$(printf "%x" $tos_val)
|
||||
ebt_match_ipv6_dscp "$tos_hex"
|
||||
[ -n "$traffic_class" -a "$dscp_filter" != "0" ] && echo "$((dscp_filter))" >> "/tmp/qos/dscp_values_${traffic_class}_6"
|
||||
fi
|
||||
|
||||
if [ -n "$protocol" ]; then
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
readonly WANPORT="$(jsonfilter -i /etc/board.json -e @.network.wan.device)"
|
||||
readonly LINKSPEED_FILE="/tmp/qos/wan_link_speed"
|
||||
readonly LINKSHAPE_FILE="/tmp/qos/wan_link_shape_rate"
|
||||
|
||||
[ "${WANPORT}" = "${PORT}" ] || exit 0
|
||||
[ -z "${PORT}" -o "${WANPORT}" = "${PORT}" ] || exit 0
|
||||
[ -f "${LINKSHAPE_FILE}" ] && exit 0
|
||||
|
||||
LINKSPEED="$(devstatus "${WANPORT}" | jsonfilter -e '@["speed"]' | tr -d 'A-Z')"
|
||||
PREV_LINKSPEED=$(cat ${LINKSPEED_FILE} 2>/dev/null)
|
||||
|
||||
@@ -3,6 +3,23 @@
|
||||
. /lib/qos/qos.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
ethnames="$(portorder.sh)"
|
||||
ports="$(portnames.sh)"
|
||||
|
||||
get_port_by_ifname(){
|
||||
local name i n
|
||||
name="$1"
|
||||
i=1
|
||||
for n in $ethnames; do
|
||||
[ "$n" = "$name" ] && break
|
||||
i=$((i+1))
|
||||
done
|
||||
|
||||
# set the ports as input arguments
|
||||
# and echo the i:th argument
|
||||
set -- $ports
|
||||
eval echo \$$i
|
||||
}
|
||||
|
||||
cpu_model="$(cat /proc/socinfo | grep 'SoC Name' | cut -d':' -f2)"
|
||||
queue_num=8
|
||||
@@ -20,13 +37,14 @@ populate_no_of_queue(){
|
||||
generate_queue(){
|
||||
local ifname="$1"
|
||||
local no_of_q="$2"
|
||||
local port=$(get_port_by_ifname "$ifname")
|
||||
|
||||
local i=0
|
||||
local total_q=$((${no_of_q##* } + 1))
|
||||
for i in $no_of_q; do
|
||||
for i in $no_of_q; do
|
||||
local order=$((total_q - i))
|
||||
uci add qos queue
|
||||
uci rename qos.@queue[-1]="q_${i}_${ifname}"
|
||||
uci rename qos.@queue[-1]="${port}_q${order}"
|
||||
uci set qos.@queue[-1].enable="1"
|
||||
uci set qos.@queue[-1].ifname="$ifname"
|
||||
uci set qos.@queue[-1].precedence="$order"
|
||||
|
||||
@@ -43,6 +43,7 @@ sort_classify_by_order() {
|
||||
handle_classify() {
|
||||
|
||||
local corder_file="/tmp/qos/classify.order"
|
||||
local interf=""
|
||||
|
||||
while read -r line; do
|
||||
line_cid=${line#*_}
|
||||
@@ -60,6 +61,19 @@ handle_classify() {
|
||||
handle_policer_rules $line_cid
|
||||
fi
|
||||
done < "$corder_file"
|
||||
# Handling config for DSCP to pbit conversion:
|
||||
# For a given port there can be 64 dscp2pbit mapping and each mapping is
|
||||
# represented by one UCI config classify section. So there can be 64 possible
|
||||
# config classify.
|
||||
#
|
||||
# For each port, traverse all config classify section and
|
||||
# extract DSCP to P-bit conversion info.
|
||||
# generate, dscp2pbit mapping list.
|
||||
# Then apply dscp2pbit rule
|
||||
for interf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs); do
|
||||
handle_ebtables_dscp2pbit "$interf"
|
||||
[ -n "$BR_RULE_DSCP2PBIT" ] && broute_apply_dscp2pbit_rule
|
||||
done
|
||||
}
|
||||
|
||||
# Configure classifier based on UCI subtree 'qos.classify'
|
||||
@@ -107,7 +121,7 @@ setup_qos() {
|
||||
touch /tmp/qos/qos
|
||||
cp /etc/config/qos /tmp/qos/qos
|
||||
fi
|
||||
|
||||
|
||||
create_ebtables_chains
|
||||
create_iptables_chains
|
||||
}
|
||||
|
||||
@@ -3,12 +3,23 @@
|
||||
|
||||
BR_RULE=""
|
||||
BR6_RULE=""
|
||||
BR_RULE_DSCP2PBIT=""
|
||||
DSCP2PBIT_MAPPING=""
|
||||
|
||||
init_broute_rule() {
|
||||
BR_RULE=""
|
||||
BR6_RULE=""
|
||||
}
|
||||
|
||||
init_broute_dscp2pbit_rule() {
|
||||
BR_RULE_DSCP2PBIT=""
|
||||
DSCP2PBIT_MAPPING=""
|
||||
}
|
||||
|
||||
broute_filter_on_l3_if() {
|
||||
BR_RULE="$BR_RULE --logical-in $1"
|
||||
}
|
||||
|
||||
broute_filter_on_src_if() {
|
||||
BR_RULE="$BR_RULE --in-if $1"
|
||||
}
|
||||
@@ -103,7 +114,7 @@ ebt_match_ip_icmp_type() {
|
||||
ebt_match_ipv6_protocol() {
|
||||
#when ethertype is not configured by user then both proto rules of ipv4
|
||||
#and ipv6 to be installed so update BR6_RULE string as well otherwise
|
||||
#update BR_RULE only for installation of ipv6 proto rule only.
|
||||
#update BR_RULE only for installation of ipv6 proto rule only.
|
||||
if [ -n "$BR6_RULE" ]; then
|
||||
BR6_RULE="$BR6_RULE --ip6-proto $1"
|
||||
else
|
||||
@@ -139,14 +150,30 @@ broute_filter_on_vid() {
|
||||
}
|
||||
|
||||
broute_append_rule() {
|
||||
local broute_chain="$1"
|
||||
#when ethertype is not configured by user then both proto rules of ipv4
|
||||
#and ipv6 to be installed otherwise install ipv6 proto rule only.
|
||||
echo "ebtables --concurrent -t broute -A qos $BR_RULE" >> /tmp/qos/classify.ebtables
|
||||
echo "ebtables --concurrent -t broute -A $broute_chain $BR_RULE" >> /tmp/qos/classify.ebtables
|
||||
if [ -n "$BR6_RULE" ]; then
|
||||
echo "ebtables --concurrent -t broute -A qos $BR6_RULE" >> /tmp/qos/classify.ebtables
|
||||
echo "ebtables --concurrent -t broute -A $broute_chain $BR6_RULE" >> /tmp/qos/classify.ebtables
|
||||
fi
|
||||
}
|
||||
|
||||
broute_apply_dscp2pbit_rule() {
|
||||
# Write dscp2pbit broute rule to classify.ebtables file
|
||||
echo "ebtables --concurrent -t broute -A dscp2pbits -p 0x8100 $BR_RULE_DSCP2PBIT" >> /tmp/qos/classify.ebtables
|
||||
}
|
||||
|
||||
broute_rule_set_xlate_vid_pbit() {
|
||||
local vid_mark="$1"
|
||||
local pcp_mark="$2"
|
||||
|
||||
BR_RULE="$BR_RULE -j vlantranslation"
|
||||
[ -n "$vid_mark" ] && BR_RULE="$BR_RULE --vlanxlate-vid-set $vid_mark"
|
||||
[ -n "$pcp_mark" ] && BR_RULE="$BR_RULE --vlanxlate-prio-set $pcp_mark"
|
||||
BR_RULE="$BR_RULE --vlanxlate-target CONTINUE"
|
||||
}
|
||||
|
||||
set_ip_addr()
|
||||
{
|
||||
local cid="$1"
|
||||
@@ -234,12 +261,18 @@ handle_ebtables_rules() {
|
||||
local protocol=""
|
||||
local ip_version=""
|
||||
|
||||
config_get pcp_mark "$sid" "pcp_mark"
|
||||
config_get dscp_filter "$sid" "dscp_filter"
|
||||
# return if its a classfy section for DSCP to p-bit mapping
|
||||
if [ -n "$pcp_mark" ] && [ -n "$dscp_filter" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
init_broute_rule
|
||||
|
||||
config_get src_if "$sid" "ifname"
|
||||
config_get src_mac "$sid" "src_mac"
|
||||
config_get dst_mac "$sid" "dst_mac"
|
||||
config_get dscp_filter "$sid" "dscp_filter"
|
||||
config_get pcp_check "$sid" "pcp_check"
|
||||
config_get eth_type "$sid" "ethertype"
|
||||
config_get vid "$sid" "vid_check"
|
||||
@@ -253,6 +286,13 @@ handle_ebtables_rules() {
|
||||
config_get traffic_class "$sid" "traffic_class"
|
||||
config_get protocol "$sid" "proto"
|
||||
config_get all_interfaces "$sid" "all_interfaces"
|
||||
config_get l3_ifname "$sid" "l3_ifname"
|
||||
config_get vid_mark "$sid" "vid_mark"
|
||||
|
||||
if [ -n "$l3_ifname" ]; then
|
||||
broute_filter_on_l3_if "$l3_ifname"
|
||||
is_l2_rule=1
|
||||
fi
|
||||
|
||||
if [ "$all_interfaces" == "1" ]; then
|
||||
is_l2_rule=1
|
||||
@@ -403,11 +443,74 @@ handle_ebtables_rules() {
|
||||
|
||||
[ -n "$traffic_class" ] && broute_rule_set_traffic_class "$traffic_class"
|
||||
|
||||
[ -n "$BR_RULE" ] && broute_append_rule
|
||||
if [ -n "$vid_mark" ] || [ -n "$pcp_mark" ]; then
|
||||
broute_rule_set_xlate_vid_pbit "$vid_mark" "$pcp_mark"
|
||||
fi
|
||||
|
||||
if [ -n "$BR_RULE" ]; then
|
||||
if [ -n "$vid_mark" ] || [ -n "$pcp_mark" ]; then
|
||||
broute_append_rule "prevlanxlate"
|
||||
else
|
||||
broute_append_rule "qos"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
handle_ebtables_dscp2pbit() {
|
||||
local in_if=$1
|
||||
local dscp_filter=""
|
||||
local pcp_mark=""
|
||||
local ifname=""
|
||||
local dscp2pbit_mapping_list=""
|
||||
local corder_file="/tmp/qos/classify.order"
|
||||
|
||||
if [ -z "$in_if" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
init_broute_dscp2pbit_rule
|
||||
while read -r line; do
|
||||
line_cid=${line#*_}
|
||||
config_get dscp_filter "$line_cid" "dscp_filter"
|
||||
config_get pcp_mark "$line_cid" "pcp_mark"
|
||||
|
||||
# return if not a dscp to p-bit rule
|
||||
if [ -z "$dscp_filter" ] || [ -z "$pcp_mark" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
config_get ifname "$line_cid" "ifname"
|
||||
|
||||
# return if this config is not for the currently processing interface (in_if)
|
||||
if [ -n "$ifname" ] && [ "$ifname" != "$in_if" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
dscp2pbit_mapping_list="$dscp2pbit_mapping_list,$dscp_filter=$pcp_mark"
|
||||
done < "$corder_file"
|
||||
|
||||
# if not dscp2pbit config found for our interface, return
|
||||
[ -z "$dscp2pbit_mapping_list" ] && return
|
||||
|
||||
# remove first character(comma) from the dscp2pbit_mapping_list, not required.
|
||||
dscp2pbit_mapping_list="${dscp2pbit_mapping_list:1}"
|
||||
|
||||
# construct ebtables rule:
|
||||
BR_RULE_DSCP2PBIT=" -i $in_if -j dscp2pbit --dscp2pbit-mapping $dscp2pbit_mapping_list --dscp2pbit-target CONTINUE"
|
||||
}
|
||||
|
||||
create_ebtables_chains() {
|
||||
ebtables --concurrent -t broute -N qos 2> /dev/null
|
||||
|
||||
ebtables --concurrent -t broute -N dscp2pbits -P RETURN 2> /dev/null
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ]; then
|
||||
ebtables --concurrent -t broute -A BROUTING -j dscp2pbits
|
||||
else
|
||||
ebtables --concurrent -t broute -D BROUTING -j dscp2pbits
|
||||
ebtables --concurrent -t broute -A BROUTING -j dscp2pbits
|
||||
fi
|
||||
|
||||
ebtables --concurrent -t broute -N qos -P RETURN 2> /dev/null
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ]; then
|
||||
ebtables --concurrent -t broute -A BROUTING -j qos
|
||||
@@ -415,9 +518,21 @@ create_ebtables_chains() {
|
||||
ebtables --concurrent -t broute -D BROUTING -j qos
|
||||
ebtables --concurrent -t broute -A BROUTING -j qos
|
||||
fi
|
||||
|
||||
ebtables --concurrent -t broute -N prevlanxlate -P RETURN 2> /dev/null
|
||||
ret=$?
|
||||
|
||||
if [ $ret -eq 0 ]; then
|
||||
ebtables --concurrent -t broute -I BROUTING -j prevlanxlate
|
||||
else
|
||||
ebtables --concurrent -t broute -D BROUTING -j prevlanxlate
|
||||
ebtables --concurrent -t broute -I BROUTING -j prevlanxlate
|
||||
fi
|
||||
}
|
||||
|
||||
flush_ebtables_chains() {
|
||||
echo "ebtables -t broute -F qos" > /tmp/qos/classify.ebtables
|
||||
echo "ebtables -t broute -F dscp2pbits" >> /tmp/qos/classify.ebtables
|
||||
echo "ebtables -t broute -F prevlanxlate" >> /tmp/qos/classify.ebtables
|
||||
}
|
||||
|
||||
|
||||
@@ -137,6 +137,7 @@ handle_iptables_rules() {
|
||||
config_get ifname "$cid" "ifname"
|
||||
config_get all_interfaces "$cid" "all_interfaces"
|
||||
config_get icmp_type "$cid" "icmp_type"
|
||||
config_get l3_ifname "$cid" "l3_ifname"
|
||||
|
||||
#check version of ip
|
||||
case $src_ip$dest_ip in
|
||||
@@ -154,6 +155,8 @@ handle_iptables_rules() {
|
||||
if ! [ "$all_interfaces" == "1" ]; then
|
||||
if [ -n "$ifname" -a "$ifname" != "lo" ]; then
|
||||
iptables_filter_intf "$ifname"
|
||||
elif [ -n "$l3_ifname" -a "$l3_ifname" != "lo" ]; then
|
||||
iptables_filter_intf "$l3_ifname"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ struct upnpdiscovery {
|
||||
char *uuid;
|
||||
char *urn;
|
||||
char *descurl;
|
||||
struct uci_section *dmmap_sect;
|
||||
};
|
||||
|
||||
struct upnp_device_inst {
|
||||
@@ -32,7 +31,6 @@ struct upnp_device_inst {
|
||||
char *preentation_url;
|
||||
char *parentudn;
|
||||
char *upc;
|
||||
struct uci_section *dmmap_sect;
|
||||
};
|
||||
|
||||
struct upnp_service_inst {
|
||||
@@ -42,12 +40,10 @@ struct upnp_service_inst {
|
||||
char *scpdurl;
|
||||
char *controlurl;
|
||||
char *eventsuburl;
|
||||
struct uci_section *dmmap_sect;
|
||||
};
|
||||
|
||||
struct upnp_description_file_info {
|
||||
char *desc_url;
|
||||
struct uci_section *dmmap_sect;
|
||||
};
|
||||
|
||||
/*************************************************************
|
||||
@@ -58,9 +54,9 @@ static int browseUPnPDiscoveryRootDeviceInst(struct dmctx *dmctx, DMNODE *parent
|
||||
json_object *res = NULL, *root_devices = NULL, *device = NULL;
|
||||
struct upnpdiscovery upnp_dev = {0};
|
||||
char *descurl = NULL, *st = NULL, *usn = NULL, *inst = NULL;
|
||||
struct uci_section *dmmap_sect = NULL;
|
||||
char buf[512] = {0};
|
||||
int root_inst = 0;
|
||||
struct dm_data data = {0};
|
||||
|
||||
dmubus_call("upnp", "discovery", UBUS_ARGS{{}}, 0, &res);
|
||||
if (res == NULL)
|
||||
@@ -97,16 +93,11 @@ static int browseUPnPDiscoveryRootDeviceInst(struct dmctx *dmctx, DMNODE *parent
|
||||
upnp_dev.st = dmstrdup(st);
|
||||
upnp_dev.usn = dmstrdup(usn);
|
||||
|
||||
if ((dmmap_sect = get_dup_section_in_dmmap_opt("dmmap_upnp", "upnp_root_device", "uuid", upnp_dev.urn)) == NULL) {
|
||||
dmuci_add_section_bbfdm("dmmap_upnp", "upnp_root_device", &dmmap_sect);
|
||||
dmuci_set_value_by_section_bbfdm(dmmap_sect, "uuid", upnp_dev.urn);
|
||||
}
|
||||
|
||||
upnp_dev.dmmap_sect = dmmap_sect;
|
||||
data.additional_data = (void *)&upnp_dev;
|
||||
|
||||
inst = handle_instance_without_section(dmctx, parent_node, ++root_inst);
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, &upnp_dev, inst) == DM_STOP)
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&data, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -117,8 +108,8 @@ static int browseUPnPDiscoveryDeviceInst(struct dmctx *dmctx, DMNODE *parent_nod
|
||||
json_object *res = NULL, *devices = NULL, *device = NULL;
|
||||
struct upnpdiscovery upnp_dev = {0};
|
||||
char *dev_descurl = NULL, *dev_st = NULL, *dev_usn = NULL, *inst = NULL;
|
||||
struct uci_section *dmmap_sect = NULL;
|
||||
char buf[512] = {0};
|
||||
struct dm_data data = {0};
|
||||
|
||||
dmubus_call("upnp", "discovery", UBUS_ARGS{{}}, 0, &res);
|
||||
if (res == NULL)
|
||||
@@ -155,16 +146,11 @@ static int browseUPnPDiscoveryDeviceInst(struct dmctx *dmctx, DMNODE *parent_nod
|
||||
upnp_dev.st = dmstrdup(dev_st);
|
||||
upnp_dev.usn = dmstrdup(dev_usn);
|
||||
|
||||
if ((dmmap_sect = get_dup_section_in_dmmap_opt("dmmap_upnp", "upnp_device", "uuid", upnp_dev.uuid)) == NULL) {
|
||||
dmuci_add_section_bbfdm("dmmap_upnp", "upnp_device", &dmmap_sect);
|
||||
dmuci_set_value_by_section_bbfdm(dmmap_sect, "uuid", upnp_dev.uuid);
|
||||
}
|
||||
|
||||
upnp_dev.dmmap_sect = dmmap_sect;
|
||||
data.additional_data = (void *)&upnp_dev;
|
||||
|
||||
inst = handle_instance_without_section(dmctx, parent_node, i+1);
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, &upnp_dev, inst) == DM_STOP)
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&data, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -175,8 +161,8 @@ static int browseUPnPDiscoveryServiceInst(struct dmctx *dmctx, DMNODE *parent_no
|
||||
json_object *res = NULL, *services = NULL, *service = NULL;
|
||||
struct upnpdiscovery upnp_dev = {0};
|
||||
char *srv_descurl = NULL, *srv_st = NULL, *srv_usn = NULL, *inst = NULL;
|
||||
struct uci_section* dmmap_sect = NULL;
|
||||
char buf[512] = {0};
|
||||
struct dm_data data = {0};
|
||||
|
||||
dmubus_call("upnp", "discovery", UBUS_ARGS{{}}, 0, &res);
|
||||
if (res == NULL)
|
||||
@@ -214,16 +200,11 @@ static int browseUPnPDiscoveryServiceInst(struct dmctx *dmctx, DMNODE *parent_no
|
||||
upnp_dev.st = dmstrdup(srv_st);
|
||||
upnp_dev.usn = dmstrdup(srv_usn);
|
||||
|
||||
if ((dmmap_sect = get_dup_section_in_dmmap_opt("dmmap_upnp", "upnp_service", "usn", srv_usn)) == NULL) {
|
||||
dmuci_add_section_bbfdm("dmmap_upnp", "upnp_service", &dmmap_sect);
|
||||
dmuci_set_value_by_section_bbfdm(dmmap_sect, "usn", srv_usn);
|
||||
}
|
||||
|
||||
upnp_dev.dmmap_sect = dmmap_sect;
|
||||
data.additional_data = (void *)&upnp_dev;
|
||||
|
||||
inst = handle_instance_without_section(dmctx, parent_node, i+1);
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, &upnp_dev, inst) == DM_STOP)
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&data, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -234,7 +215,7 @@ static int browseUPnPDescriptionDeviceDescriptionInst(struct dmctx *dmctx, DMNOD
|
||||
json_object *res = NULL, *descriptions = NULL, *description = NULL;
|
||||
struct upnp_description_file_info upnp_desc = {0};
|
||||
char *descurl = NULL, *inst = NULL;
|
||||
struct uci_section* dmmap_sect = NULL;
|
||||
struct dm_data data = {0};
|
||||
|
||||
dmubus_call("upnp", "description", UBUS_ARGS{{}}, 0, &res);
|
||||
if (res == NULL)
|
||||
@@ -249,15 +230,11 @@ static int browseUPnPDescriptionDeviceDescriptionInst(struct dmctx *dmctx, DMNOD
|
||||
descurl = dmjson_get_value(description, 1, "desc_url");
|
||||
upnp_desc.desc_url = dmstrdup(descurl);
|
||||
|
||||
if ((dmmap_sect = get_dup_section_in_dmmap_opt("dmmap_upnp", "upnp_description", "descurl", descurl)) == NULL) {
|
||||
dmuci_add_section_bbfdm("dmmap_upnp", "upnp_description", &dmmap_sect);
|
||||
dmuci_set_value_by_section_bbfdm(dmmap_sect, "descurl", descurl);
|
||||
}
|
||||
upnp_desc.dmmap_sect = dmmap_sect;
|
||||
data.additional_data = (void *)&upnp_desc;
|
||||
|
||||
inst = handle_instance_without_section(dmctx, parent_node, i+1);
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, &upnp_desc, inst) == DM_STOP)
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&data, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -268,8 +245,8 @@ static int browseUPnPDescriptionDeviceInstanceInst(struct dmctx *dmctx, DMNODE *
|
||||
json_object *res = NULL, *devices_instances = NULL, *device_inst = NULL;
|
||||
struct upnp_device_inst upnp_dev_inst = {};
|
||||
char *inst = NULL;
|
||||
struct uci_section* dmmap_sect = NULL;
|
||||
int i;
|
||||
struct dm_data data = {0};
|
||||
|
||||
dmubus_call("upnp", "description", UBUS_ARGS{{}}, 0, &res);
|
||||
if (res == NULL)
|
||||
@@ -294,16 +271,11 @@ static int browseUPnPDescriptionDeviceInstanceInst(struct dmctx *dmctx, DMNODE *
|
||||
dmasprintf(&upnp_dev_inst.udn, "%s", dmjson_get_value(device_inst, 1, "UDN"));
|
||||
dmasprintf(&upnp_dev_inst.upc, "%s", dmjson_get_value(device_inst, 1, "UPC"));
|
||||
|
||||
if ((dmmap_sect = get_dup_section_in_dmmap_opt("dmmap_upnp", "upnp_device_inst", "udn", dmjson_get_value(device_inst, 1, "UDN"))) == NULL) {
|
||||
dmuci_add_section_bbfdm("dmmap_upnp", "upnp_device_inst", &dmmap_sect);
|
||||
dmuci_set_value_by_section_bbfdm(dmmap_sect, "udn", dmjson_get_value(device_inst, 1, "UDN"));
|
||||
}
|
||||
|
||||
upnp_dev_inst.dmmap_sect = dmmap_sect;
|
||||
data.additional_data = (void *)&upnp_dev_inst;
|
||||
|
||||
inst = handle_instance_without_section(dmctx, parent_node, i+1);
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, &upnp_dev_inst, inst) == DM_STOP)
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&data, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -314,8 +286,8 @@ static int browseUPnPDescriptionServiceInstanceInst(struct dmctx *dmctx, DMNODE
|
||||
json_object *res = NULL, *services_instances = NULL, *service_inst = NULL;
|
||||
struct upnp_service_inst upnp_services_inst = {};
|
||||
char *inst = NULL;
|
||||
struct uci_section* dmmap_sect = NULL;
|
||||
int i;
|
||||
struct dm_data data = {0};
|
||||
|
||||
dmubus_call("upnp", "description", UBUS_ARGS{{}}, 0, &res);
|
||||
if (res == NULL)
|
||||
@@ -333,16 +305,11 @@ static int browseUPnPDescriptionServiceInstanceInst(struct dmctx *dmctx, DMNODE
|
||||
dmasprintf(&upnp_services_inst.controlurl, "%s", dmjson_get_value(service_inst, 1, "controlURL"));
|
||||
dmasprintf(&upnp_services_inst.eventsuburl, "%s", dmjson_get_value(service_inst, 1, "eventSubURL"));
|
||||
|
||||
if ((dmmap_sect = get_dup_section_in_dmmap_opt("dmmap_upnp", "upnp_service_inst", "serviceid", dmjson_get_value(service_inst, 1, "serviceId"))) == NULL) {
|
||||
dmuci_add_section_bbfdm("dmmap_upnp", "upnp_service_inst", &dmmap_sect);
|
||||
dmuci_set_value_by_section_bbfdm(dmmap_sect, "serviceid", dmjson_get_value(service_inst, 1, "serviceId"));
|
||||
}
|
||||
|
||||
upnp_services_inst.dmmap_sect = dmmap_sect;
|
||||
data.additional_data = (void *)&upnp_services_inst;
|
||||
|
||||
inst = handle_instance_without_section(dmctx, parent_node, i+1);
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, &upnp_services_inst, inst) == DM_STOP)
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&data, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -417,67 +384,76 @@ static int get_UPnPDiscovery_ServiceNumberOfEntries(char *refparam, struct dmctx
|
||||
/*#Device.UPnP.Discovery.RootDevice.{i}.UUID!UBUS:upnpc/discovery//devices[i-1].st*/
|
||||
static int get_UPnPDiscoveryRootDevice_UUID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnpdiscovery *)data)->uuid;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnpdiscovery *)(p->additional_data))->uuid;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Discovery.RootDevice.{i}.USN!UBUS:upnpc/discovery//devices[i-1].usn*/
|
||||
static int get_UPnPDiscoveryRootDevice_USN(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnpdiscovery *)data)->usn;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnpdiscovery *)(p->additional_data))->usn;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Discovery.RootDevice.{i}.Location!UBUS:upnpc/discovery//devices[i-1].descurl*/
|
||||
static int get_UPnPDiscoveryRootDevice_Location(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnpdiscovery *)data)->descurl;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnpdiscovery *)(p->additional_data))->descurl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Discovery.Device.{i}.UUID!UBUS:upnpc/discovery//devices[i-1].st*/
|
||||
static int get_UPnPDiscoveryDevice_UUID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnpdiscovery *)data)->uuid;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnpdiscovery *)(p->additional_data))->uuid;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Discovery.Device.{i}.USN!UBUS:upnpc/discovery//devices[i-1].usn*/
|
||||
static int get_UPnPDiscoveryDevice_USN(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnpdiscovery *)data)->usn;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnpdiscovery *)(p->additional_data))->usn;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Discovery.Device.{i}.Location!UBUS:upnpc/discovery//devices[i-1].descurl*/
|
||||
static int get_UPnPDiscoveryDevice_Location(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnpdiscovery *)data)->descurl;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnpdiscovery *)(p->additional_data))->descurl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Discovery.Service.{i}.USN!UBUS:upnpc/discovery//services[i-1].usn*/
|
||||
static int get_UPnPDiscoveryService_USN(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnpdiscovery *)data)->usn;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnpdiscovery *)(p->additional_data))->usn;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Discovery.Service.{i}.Location!UBUS:upnpc/discovery//services[i-1].descurl*/
|
||||
static int get_UPnPDiscoveryService_Location(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnpdiscovery *)data)->descurl;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnpdiscovery *)(p->additional_data))->descurl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_UPnPDiscoveryService_ParentDevice(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char buf[256] = {0};
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
|
||||
bbfdm_get_references(ctx, MATCH_FIRST, "Device.UPnP.Discovery.Device.", "UUID", ((struct upnpdiscovery *)data)->uuid, buf, sizeof(buf));
|
||||
bbfdm_get_references(ctx, MATCH_FIRST, "Device.UPnP.Discovery.Device.", "UUID", ((struct upnpdiscovery *)(p->additional_data))->uuid, buf, sizeof(buf));
|
||||
|
||||
if (!DM_STRLEN(buf))
|
||||
bbfdm_get_references(ctx, MATCH_FIRST, "Device.UPnP.Discovery.RootDevice.", "UUID", ((struct upnpdiscovery *)data)->uuid, buf, sizeof(buf));
|
||||
bbfdm_get_references(ctx, MATCH_FIRST, "Device.UPnP.Discovery.RootDevice.", "UUID", ((struct upnpdiscovery *)(p->additional_data))->uuid, buf, sizeof(buf));
|
||||
|
||||
*value = dmstrdup(buf);
|
||||
return 0;
|
||||
@@ -507,26 +483,30 @@ static int get_UPnPDescription_ServiceInstanceNumberOfEntries(char *refparam, st
|
||||
/*#Device.UPnP.Description.DeviceDescription.{i}.URLBase!UBUS:upnpc/description//descriptions[i-1].descurl*/
|
||||
static int get_UPnPDescriptionDeviceDescription_URLBase(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_description_file_info *)data)->desc_url;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_description_file_info *)(p->additional_data))->desc_url;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.UDN!UBUS:upnpc/description//devicesinstances[i-1].UDN*/
|
||||
static int get_UPnPDescriptionDeviceInstance_UDN(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->udn;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->udn;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_UPnPDescriptionDeviceInstance_ParentDevice(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
_bbfdm_get_references(ctx, "Device.UPnP.Description.DeviceInstance.", "UDN", ((struct upnp_device_inst *)data)->parentudn, value);
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
_bbfdm_get_references(ctx, "Device.UPnP.Description.DeviceInstance.", "UDN", ((struct upnp_device_inst *)(p->additional_data))->parentudn, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_UPnPDescriptionDeviceInstance_DiscoveryDevice(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct upnp_device_inst *upnpdevinst = (struct upnp_device_inst *)data;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
struct upnp_device_inst *upnpdevinst = (struct upnp_device_inst *)(p->additional_data);
|
||||
|
||||
if (upnpdevinst->udn && upnpdevinst->udn[0]) {
|
||||
char buf[256] = {0};
|
||||
@@ -551,98 +531,112 @@ static int get_UPnPDescriptionDeviceInstance_DiscoveryDevice(char *refparam, str
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.DeviceType!UBUS:upnpc/description//devicesinstances[i-1].deviceType*/
|
||||
static int get_UPnPDescriptionDeviceInstance_DeviceType(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->device_type;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->device_type;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.FriendlyName!UBUS:upnpc/description//devicesinstances[i-1].friendlyName*/
|
||||
static int get_UPnPDescriptionDeviceInstance_FriendlyName(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->friendly_name;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->friendly_name;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.Manufacturer!UBUS:upnpc/description//devicesinstances[i-1].manufacturer*/
|
||||
static int get_UPnPDescriptionDeviceInstance_Manufacturer(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->manufacturer;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->manufacturer;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.ManufacturerURL!UBUS:upnpc/description//devicesinstances[i-1].manufacturerURL*/
|
||||
static int get_UPnPDescriptionDeviceInstance_ManufacturerURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->manufacturer_url;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->manufacturer_url;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.ModelDescription!UBUS:upnpc/description//devicesinstances[i-1].modelDescription*/
|
||||
static int get_UPnPDescriptionDeviceInstance_ModelDescription(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->model_description;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->model_description;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.ModelName!UBUS:upnpc/description//devicesinstances[i-1].modelName*/
|
||||
static int get_UPnPDescriptionDeviceInstance_ModelName(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->model_name;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->model_name;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.ModelNumber!UBUS:upnpc/description//devicesinstances[i-1].modelNumber*/
|
||||
static int get_UPnPDescriptionDeviceInstance_ModelNumber(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->model_number;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->model_number;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.ModelURL!UBUS:upnpc/description//devicesinstances[i-1].modelURL*/
|
||||
static int get_UPnPDescriptionDeviceInstance_ModelURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->model_url;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->model_url;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.SerialNumber!UBUS:upnpc/description//devicesinstances[i-1].serialNumber*/
|
||||
static int get_UPnPDescriptionDeviceInstance_SerialNumber(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->serial_number;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->serial_number;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.UPC!UBUS:upnpc/description//devicesinstances[i-1].UPC*/
|
||||
static int get_UPnPDescriptionDeviceInstance_UPC(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->upc;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->upc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.PresentationURL!UBUS:upnpc/description//devicesinstances[i-1].preentation_url*/
|
||||
static int get_UPnPDescriptionDeviceInstance_PresentationURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->preentation_url;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->preentation_url;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_UPnPDescriptionServiceInstance_ParentDevice(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
_bbfdm_get_references(ctx, "Device.UPnP.Description.DeviceInstance.", "UDN", ((struct upnp_service_inst *)data)->parentudn, value);
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
_bbfdm_get_references(ctx, "Device.UPnP.Description.DeviceInstance.", "UDN", ((struct upnp_service_inst *)(p->additional_data))->parentudn, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.ServiceInstance.{i}.ServiceId!UBUS:upnpc/description//servicesinstances[i-1].serviceId*/
|
||||
static int get_UPnPDescriptionServiceInstance_ServiceId(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_service_inst *)data)->serviceid;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_service_inst *)(p->additional_data))->serviceid;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_UPnPDescriptionServiceInstance_ServiceDiscovery(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char usn[512] = {0};
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
|
||||
snprintf(usn, sizeof(usn), "%s::%s", ((struct upnp_service_inst *)data)->parentudn, ((struct upnp_service_inst *)data)->servicetype);
|
||||
snprintf(usn, sizeof(usn), "%s::%s", ((struct upnp_service_inst *)(p->additional_data))->parentudn, ((struct upnp_service_inst *)(p->additional_data))->servicetype);
|
||||
|
||||
_bbfdm_get_references(ctx, "Device.UPnP.Discovery.Service.", "USN", usn, value);
|
||||
return 0;
|
||||
@@ -651,28 +645,32 @@ static int get_UPnPDescriptionServiceInstance_ServiceDiscovery(char *refparam, s
|
||||
/*#Device.UPnP.Description.ServiceInstance.{i}.ServiceType!UBUS:upnpc/description//servicesinstances[i-1].serviceType*/
|
||||
static int get_UPnPDescriptionServiceInstance_ServiceType(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_service_inst *)data)->servicetype;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_service_inst *)(p->additional_data))->servicetype;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.ServiceInstance.{i}.SCPDURL!UBUS:upnpc/description//servicesinstances[i-1].SCPDURL*/
|
||||
static int get_UPnPDescriptionServiceInstance_SCPDURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_service_inst *)data)->scpdurl;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_service_inst *)(p->additional_data))->scpdurl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.ServiceInstance.{i}.ControlURL!UBUS:upnpc/description//servicesinstances[i-1].controlURL*/
|
||||
static int get_UPnPDescriptionServiceInstance_ControlURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_service_inst *)data)->controlurl;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_service_inst *)(p->additional_data))->controlurl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.ServiceInstance.{i}.EventSubURL!UBUS:upnpc/description//servicesinstances[i-1].eventSubURL*/
|
||||
static int get_UPnPDescriptionServiceInstance_EventSubURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_service_inst *)data)->eventsuburl;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_service_inst *)(p->additional_data))->eventsuburl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sshmngr
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_VERSION:=1.0.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/sshmngr.git
|
||||
PKG_SOURCE_VERSION:=790689b6ccc89ca90623b6b93b95ee4642cb789e
|
||||
PKG_SOURCE_VERSION:=c56a09b2ffd7b944dff4ef7c9ae3a98c68e2427f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-builder
|
||||
PKG_VERSION:=3.1.60
|
||||
PKG_VERSION:=3.1.61
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-builder.git
|
||||
PKG_SOURCE_VERSION:=51c0d46343b3b1122b4f1df73399526160f968dd
|
||||
PKG_SOURCE_VERSION:=31fecc47a3d4100e00e8545ea861bb7362938e98
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/sulu-$(PKG_VERSION)/sulu-builder-$(PKG_SOURCE_VERSION)
|
||||
|
||||
@@ -81,3 +81,11 @@ config SWMODD_NETWORKING
|
||||
select PACKAGE_kmod-macvlan
|
||||
help
|
||||
Enable "veth pair device" and "macvlan"
|
||||
|
||||
config SWMODD_LEGACY_CGROUPS
|
||||
bool "Enables CGroups V1 Support"
|
||||
depends on PACKAGE_swmodd
|
||||
default y
|
||||
help
|
||||
If this option is selected, it selects swmod-cgroup package, which mounts
|
||||
GGroupV1 hierarchy on system start
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=swmodd
|
||||
PKG_VERSION:=2.5.7
|
||||
PKG_VERSION:=2.5.12
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/lcm/swmodd.git
|
||||
PKG_SOURCE_VERSION:=4d228d6be9759d285b49a20e191c6ca23ab40a51
|
||||
PKG_SOURCE_VERSION:=088ac916a87b4faf1aaafadc6ee77ae56674fd1c
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -33,7 +33,8 @@ define Package/swmodd
|
||||
DEPENDS:=+libuci +libubox +ubus +libuuid +opkg +libcurl \
|
||||
+PACKAGE_lxc:lxc +PACKAGE_liblxc:liblxc +@BUSYBOX_CONFIG_BUSYBOX \
|
||||
+@BUSYBOX_CONFIG_FEATURE_SHOW_SCRIPT +@BUSYBOX_CONFIG_SCRIPT \
|
||||
+swmodd-cgroup +jq +libbbfdm-api
|
||||
+jq +libbbfdm-api +@CONFIG_KERNEL_CGROUPS \
|
||||
+SWMODD_LEGACY_CGROUPS:swmodd-cgroup
|
||||
endef
|
||||
|
||||
define Package/swmodd/description
|
||||
@@ -49,7 +50,6 @@ define Package/swmodd-cgroup
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:= Cgroup mount handler for Software modules daemon
|
||||
DEPENDS:=+@CONFIG_KERNEL_CGROUPS
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
|
||||
@@ -3,3 +3,7 @@ config globals 'globals'
|
||||
option debug '1'
|
||||
option log_level '3'
|
||||
option lan_bridge 'br-lan'
|
||||
option root '/container'
|
||||
|
||||
config execenv 'execenv_1'
|
||||
option name 'oci'
|
||||
|
||||
@@ -241,7 +241,7 @@ start_service() {
|
||||
|
||||
env=$(uci -q get swmodd.@execenv[0].name)
|
||||
if [ -z "${root}" ] || [ -z "${bridge}" ]; then
|
||||
log "Base bundle root[$root] or bridge[$bridge] not defined"
|
||||
log "# Base bundle root[$root] or bridge[$bridge] not defined"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
|
||||
@@ -90,16 +90,17 @@ start_service() {
|
||||
# crun default runtime directory /run, if not present then create
|
||||
[ ! -d "/run" ] && ln -fs /var/run /run
|
||||
|
||||
if [ ! -d "${root}" ]; then
|
||||
log "# root [${root}] not present, creating ..."
|
||||
if [ -n "${root}" ]; then
|
||||
mkdir -p "${root}"
|
||||
else
|
||||
log "# Not starting, root [${root}] not defined"
|
||||
return 1
|
||||
if [ -L "${root}" ]; then
|
||||
if [ ! -d "${root}" ]; then
|
||||
mkdir -p $(realpath ${root})
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -d "${root}" ]; then
|
||||
log "# Not starting, Base root [${root}] not accessible/defined"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Currently only one execenv supported
|
||||
env_name="$(uci -q get swmodd.@execenv[0].name)"
|
||||
if [ -z "${env_name}" ]; then
|
||||
|
||||
@@ -74,7 +74,7 @@ setup_container_network() {
|
||||
}
|
||||
|
||||
run_container() {
|
||||
local bundle name bridge
|
||||
local bundle name bridge network
|
||||
|
||||
bundle="${1}"
|
||||
name="${2}"
|
||||
@@ -85,7 +85,13 @@ run_container() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
setup_container_network "${name}" "${bridge}"
|
||||
# Only do the network setup if defined in config
|
||||
network="$(cat ${BUNDLE}/${NAME}/config.json |jq '.linux.namespaces[] |select (.type == "network")')"
|
||||
if [ -n "${network}" ] ; then
|
||||
setup_container_network "${name}" "${bridge}"
|
||||
else
|
||||
log "Network not defined in config, using host network..."
|
||||
fi
|
||||
|
||||
script -q -c "crun run -b ${bundle}/${name} ${name}" /dev/null
|
||||
}
|
||||
@@ -139,7 +145,6 @@ update_config_json() {
|
||||
fi
|
||||
|
||||
# Update cabalities
|
||||
log "## PERM [$PERM], Name [${NAME}] ##"
|
||||
if [ -n "${PERM}" ]; then
|
||||
log "Updating Permission in the json ..."
|
||||
PERM="${PERM//,/ }"
|
||||
|
||||
@@ -10,32 +10,31 @@ configure_ee_path() {
|
||||
config_get oci_bundle globals oci_bundle_root ""
|
||||
|
||||
mkdir -p /etc/lxc
|
||||
if [ -n "${lxc_bundle}" ]; then
|
||||
# if lxc_bundle_root define in swmodd, then remove it
|
||||
name=$(echo ${lxc_bundle##/*/})
|
||||
root=$(echo ${lxc_bundle%/$name})
|
||||
echo "lxc.lxcpath = ${lxc_bundle}" > /etc/lxc/lxc.conf
|
||||
uci_set swmodd globals lxc_bundle_root ""
|
||||
fi
|
||||
|
||||
if [ -n "${oci_bundle}" ]; then
|
||||
# if oci_bundle_root define in swmodd, then remove it
|
||||
name=$(echo ${oci_bundle##/*/})
|
||||
root=$(echo ${oci_bundle%/$name})
|
||||
echo "lxc.lxcpath = ${oci_bundle}" > /etc/lxc/lxc.conf
|
||||
elif [ -n "${lxc_bundle}" ]; then
|
||||
# if lxc_bundle_root define in swmodd, then remove it
|
||||
name=$(echo ${lxc_bundle##/*/})
|
||||
root=$(echo ${lxc_bundle%/$name})
|
||||
echo "lxc.lxcpath = ${lxc_bundle}" > /etc/lxc/lxc.conf
|
||||
elif [ -f /etc/lxc/lxc.conf ]; then
|
||||
bundle_path=$(cat /etc/lxc/lxc.conf | grep "lxc.lxcpath" | cut -d "=" -f 2 | sed 's/[[:blank:]]//g')
|
||||
name=$(echo ${bundle_path##/*/})
|
||||
root=$(echo ${bundle_path%/$name})
|
||||
else
|
||||
name="lxc"
|
||||
root="/srv"
|
||||
echo "lxc.lxcpath = /srv/lxc" > /etc/lxc/lxc.conf
|
||||
uci_set swmodd globals oci_bundle_root ""
|
||||
fi
|
||||
|
||||
uci_set swmodd globals oci_bundle_root ""
|
||||
uci_set swmodd globals lxc_bundle_root ""
|
||||
|
||||
# configure root in globals section
|
||||
if ! uci_get swmodd globals root >/dev/null; then
|
||||
uci_set swmodd globals root ${root}
|
||||
if [ -n "${root}" ]; then
|
||||
if ! uci_get swmodd globals root >/dev/null; then
|
||||
uci_set swmodd globals root ${root}
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "${name}" ]; then
|
||||
name="oci"
|
||||
fi
|
||||
|
||||
# configure execenv in swmodd
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=timemngr
|
||||
PKG_VERSION:=1.0.19
|
||||
PKG_VERSION:=1.0.20
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/timemngr.git
|
||||
PKG_SOURCE_VERSION:=c9fb0a58c5a928dd397edc5d3f5c1ccf0485dccc
|
||||
PKG_SOURCE_VERSION:=f0b026bb5fffbd1c9a18b6814251b4c724aabad6
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tr104
|
||||
PKG_VERSION:=1.0.28
|
||||
PKG_VERSION:=1.0.31
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifeq ($(LOCAL_DEV),0)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/voice/tr104.git
|
||||
PKG_SOURCE_VERSION:=8792d5bf496a4c25c31f4e84ec825b02bf097cc2
|
||||
PKG_SOURCE_VERSION:=57a713d6dbb4a39b41f0f0fd4674e7bcd3562852
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=twamp
|
||||
PKG_VERSION:=1.4.4
|
||||
PKG_VERSION:=1.4.5
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/twamp-light.git
|
||||
PKG_SOURCE_VERSION:=d31b2128e6ea4ab42538b88db91b2cc84091ef4d
|
||||
PKG_SOURCE_VERSION:=678a980b9433e34c3ea24af003e6ee987f2bce75
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=usbmngr
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/system/usbmngr.git
|
||||
PKG_SOURCE_VERSION:=bace625f9bba99c2093982878dfe08cab2b920d4
|
||||
PKG_SOURCE_VERSION:=4f5f5dd701d40cdb134b98734db75446e5736a2e
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=userinterface
|
||||
PKG_VERSION:=1.1.3
|
||||
PKG_VERSION:=1.1.4
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/userinterface.git
|
||||
PKG_SOURCE_VERSION:=07dd97620309df416ff449c64fdd73dc4c5950c1
|
||||
PKG_SOURCE_VERSION:=98f016c93c162f0f4c4854398ff5936f040e5a77
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=usermngr
|
||||
PKG_VERSION:=1.2.16
|
||||
PKG_VERSION:=1.2.17
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/usermngr.git
|
||||
PKG_SOURCE_VERSION:=8eeff3205a0e2705a9cede28ed215af64aa97e26
|
||||
PKG_SOURCE_VERSION:=4ea2dfc2843b4cdf87e48deff512ee358c93298f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=usp-js
|
||||
PKG_VERSION:=1.2.5
|
||||
PKG_VERSION:=1.2.6
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/usp-js.git
|
||||
@@ -23,7 +23,7 @@ define Package/usp-js
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=A JS library for USP(TR369) protocol
|
||||
DEPENDS:=+quickjs +quickjs-websocket +@OBUSPA_ENABLE_TEST_CONTROLLER
|
||||
DEPENDS:=+quickjs +quickjs-websocket +@OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL
|
||||
EXTRA_DEPENDS:=obuspa mosquitto-ssl
|
||||
endef
|
||||
|
||||
@@ -37,9 +37,7 @@ endef
|
||||
|
||||
define Package/usp-js/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/usp-js
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(CP) $(PKG_BUILD_DIR)/qjs/* $(1)/usr/lib/usp-js/
|
||||
$(CP) ./files/etc/* $(1)/etc/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,usp-js))
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=01
|
||||
USE_PROCD=1
|
||||
|
||||
log()
|
||||
{
|
||||
echo "$*"|logger -t usp-js -p debug
|
||||
}
|
||||
|
||||
get_oui_from_db()
|
||||
{
|
||||
db -q get device.deviceinfo.ManufacturerOUI
|
||||
}
|
||||
|
||||
get_serial_from_db()
|
||||
{
|
||||
db -q get device.deviceinfo.SerialNumber
|
||||
}
|
||||
|
||||
publish_endpoint()
|
||||
{
|
||||
local AgentEndpointID serial oui user pass
|
||||
|
||||
if ! uci -q get obuspa.testmqtt; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# return if mosquitto_pub is not present
|
||||
if [ ! "$(command -v 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_db)
|
||||
oui=$(get_oui_from_db)
|
||||
AgentEndpointID="os::${oui}-${serial//+/%2B}"
|
||||
fi
|
||||
|
||||
config_get user testmqtt Username ""
|
||||
config_get pass testmqtt Password ""
|
||||
|
||||
# publish Agent's EndpointID in mosquito broker for discovery by usp-js
|
||||
# This is a work around till obuspa adds supports for mDNS discovery
|
||||
if [ -n "${user}" ] && [ -n "${pass}" ]; then
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker with username, password"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}" -u "${user}" -P "${pass}"
|
||||
elif [ -n "${user}" ]; then
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker with username only"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}" -u "${user}"
|
||||
else
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}"
|
||||
fi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
publish_endpoint
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "obuspa"
|
||||
}
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wifidmd
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_VERSION:=1.0.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/wifidmd.git
|
||||
PKG_SOURCE_VERSION:=fb68ef09a6faea7b3bce1f29a8ab44d31b8ae5b5
|
||||
PKG_SOURCE_VERSION:=eb3a21f1baec749cfd2d53fd3e38fdab3a6d7a4c
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wifimngr
|
||||
PKG_VERSION:=17.2.7
|
||||
PKG_VERSION:=17.2.8
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=0faf8b741fb52c21dbfe63a08c811cbda8ec3cad
|
||||
PKG_SOURCE_VERSION:=780c224342a3aa238504eebef1e816fac8bd4498
|
||||
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
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
"method":"set",
|
||||
"args" : {
|
||||
"state": "ok",
|
||||
"timeout": 120
|
||||
"timeout": 5
|
||||
},
|
||||
"timeout": 1
|
||||
}
|
||||
@@ -102,11 +102,35 @@
|
||||
"object": "led.wps",
|
||||
"method":"set",
|
||||
"args" : {
|
||||
"state": "error",
|
||||
"timeout": 120
|
||||
"state": "off"
|
||||
},
|
||||
"timeout": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"wps_off": {
|
||||
"if_operator" : "OR",
|
||||
"if" : [
|
||||
{
|
||||
"event": "ubus.object.remove",
|
||||
"regex": true,
|
||||
"match": {
|
||||
"path":"^hostapd\\."
|
||||
}
|
||||
},
|
||||
{
|
||||
"event": "ubus.object.remove",
|
||||
"regex": true,
|
||||
"match": {
|
||||
"path":"^wpa_supplicant\\."
|
||||
}
|
||||
}
|
||||
],
|
||||
"then" : [
|
||||
{
|
||||
"cli": "ubus -S call led.wps status | jsonfilter -e @.state | grep -qxF notice && ubus -S call led.wps set '{\"state\": \"off\"}'",
|
||||
"timeout": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=xmppc
|
||||
PKG_VERSION:=2.2.7
|
||||
PKG_VERSION:=2.2.9
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/xmppc.git
|
||||
PKG_SOURCE_VERSION:=c50c7ddb92967f3ee1518e40eee776bd62bc745a
|
||||
PKG_SOURCE_VERSION:=ff76b296e767a5732d7b07ad94c141a4a6e50ed5
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user