mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-23 10:34:03 +08:00
Compare commits
282 Commits
nmdoc
...
sysmngr_me
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4a631f0cb | ||
|
|
c0208dab2e | ||
|
|
8dca6b8e44 | ||
|
|
4b1a7859aa | ||
|
|
6f28d90916 | ||
|
|
285e24455d | ||
|
|
d0c26b4bb7 | ||
|
|
a71d90d2c7 | ||
|
|
78e1468f51 | ||
|
|
9a1e1dbd1a | ||
|
|
3ef21188b1 | ||
|
|
65daa6c56a | ||
|
|
eb63f5d74f | ||
|
|
7da09349ec | ||
|
|
b2a28a12f6 | ||
|
|
0fe5d2a232 | ||
|
|
b50f9946bb | ||
|
|
bf28778432 | ||
|
|
d6dad64328 | ||
|
|
46003fddd5 | ||
|
|
2e7fc5fa14 | ||
|
|
7fb9b397ef | ||
|
|
cbe66d6c96 | ||
|
|
57d477c1da | ||
|
|
8e774faa3e | ||
|
|
6129323ca3 | ||
|
|
6d6ecdfe92 | ||
|
|
b66ae8d605 | ||
|
|
ed97af82b5 | ||
|
|
464f037768 | ||
|
|
024442da10 | ||
|
|
b0049df366 | ||
|
|
7115c1734e | ||
|
|
9b93ffef76 | ||
|
|
225b89ab4f | ||
|
|
d4464bf430 | ||
|
|
50731e00ef | ||
|
|
f9d3d22c14 | ||
|
|
607f3c5334 | ||
|
|
925c58aeaa | ||
|
|
447acf3b27 | ||
|
|
5bff6c3854 | ||
|
|
70f4086ecc | ||
|
|
b3bafdbba9 | ||
|
|
5788d7d284 | ||
|
|
a0c226d6ea | ||
|
|
921657f464 | ||
|
|
217ee3fa77 | ||
|
|
0aef613006 | ||
|
|
63e2bb8f6d | ||
|
|
ea0059a932 | ||
|
|
a95a6d804a | ||
|
|
3fbdd08037 | ||
|
|
e04040c4ea | ||
|
|
20a85cce5f | ||
|
|
2be7a59ff0 | ||
|
|
3102c0f981 | ||
|
|
8693a8f2c9 | ||
|
|
9bc4656525 | ||
|
|
544000177c | ||
|
|
2b1dbf7e36 | ||
|
|
641ec8a9eb | ||
|
|
c18929dbae | ||
|
|
a592f34216 | ||
|
|
4e2adf77cb | ||
|
|
9fba09f00a | ||
|
|
12d377b3bd | ||
|
|
cd1f81c8d9 | ||
|
|
f6774fd554 | ||
|
|
ea248061f3 | ||
|
|
1e2894dd46 | ||
|
|
92b607bd0e | ||
|
|
b766ea958a | ||
|
|
a7074db9f8 | ||
|
|
5c819b2018 | ||
|
|
c526df5143 | ||
|
|
31ed2ae746 | ||
|
|
702065eb3d | ||
|
|
c418266af6 | ||
|
|
9c8d80d763 | ||
|
|
007a8cb8bf | ||
|
|
2fc7d55d6c | ||
|
|
b3bdcea137 | ||
|
|
4673347125 | ||
|
|
f827f9f408 | ||
|
|
6a8aed5d3f | ||
|
|
5e54477cd1 | ||
|
|
ba9fcda886 | ||
|
|
c848d93316 | ||
|
|
d00c8f1ea0 | ||
|
|
9788a135aa | ||
|
|
899e6b1417 | ||
|
|
6f7f14b241 | ||
|
|
cc0d1b5910 | ||
|
|
0b6cd8154b | ||
|
|
c4cae5d6b4 | ||
|
|
f58959842b | ||
|
|
b813c155bc | ||
|
|
98e53ae941 | ||
|
|
4d993266b3 | ||
|
|
8da27926a1 | ||
|
|
7fae7acc91 | ||
|
|
47708d34df | ||
|
|
ab322f1194 | ||
|
|
aab45b16b0 | ||
|
|
586920d8a8 | ||
|
|
ac8a1c69ae | ||
|
|
604cd52a79 | ||
|
|
37109a8531 | ||
|
|
136db7b085 | ||
|
|
c177d59b7b | ||
|
|
fa9611f4f5 | ||
|
|
859e2958c0 | ||
|
|
0dda22833d | ||
|
|
ccb40910e2 | ||
|
|
eddaa9233c | ||
|
|
a09f5a3ba6 | ||
|
|
ed78a58455 | ||
|
|
b130d50bb3 | ||
|
|
7ab286753d | ||
|
|
bc6aadb0ed | ||
|
|
fd9c8b0922 | ||
|
|
2c9b9cadfe | ||
|
|
fb1ac0994d | ||
|
|
5ba8e293eb | ||
|
|
801ed0eb9f | ||
|
|
54503f98d4 | ||
|
|
903ff637e7 | ||
|
|
82ef5f6b6e | ||
|
|
398f09a1ce | ||
|
|
f29de07d0d | ||
|
|
8524f719c1 | ||
|
|
0a73e686f5 | ||
|
|
615b3d0507 | ||
|
|
4df8574fb6 | ||
|
|
e39d51a37b | ||
|
|
598b5c8e4a | ||
|
|
135e31a3e2 | ||
|
|
8e4810baa1 | ||
|
|
acd0a7ba24 | ||
|
|
032bb6bf2e | ||
|
|
083bcd79f9 | ||
|
|
30a7c285b1 | ||
|
|
5d03bbfd20 | ||
|
|
1a167f8854 | ||
|
|
06b6b64d4c | ||
|
|
26999d2381 | ||
|
|
9fba0888eb | ||
|
|
1ce4ba836f | ||
|
|
6493720c11 | ||
|
|
dd0dec6ac4 | ||
|
|
cbfc98d85e | ||
|
|
086763919a | ||
|
|
62cbccd274 | ||
|
|
b0a8549453 | ||
|
|
757ab29b57 | ||
|
|
82eb62a9e1 | ||
|
|
66bed5a044 | ||
|
|
12449bf471 | ||
|
|
5c4f315083 | ||
|
|
0a88793328 | ||
|
|
4ea26f9bec | ||
|
|
85542591d0 | ||
|
|
91ef8ff9a2 | ||
|
|
13aa279c39 | ||
|
|
eadb87d369 | ||
|
|
f250bc3c79 | ||
|
|
eaaf653b0f | ||
|
|
4a30355aab | ||
|
|
2abd075e59 | ||
|
|
aec10de11f | ||
|
|
50e53a5b15 | ||
|
|
6a89907ddb | ||
|
|
3dae593802 | ||
|
|
5b2d26a839 | ||
|
|
3fa318c58f | ||
|
|
7dab64d1e0 | ||
|
|
99d1900c79 | ||
|
|
16bffe35f7 | ||
|
|
3efb822b6e | ||
|
|
a3463ec253 | ||
|
|
a76e7d641d | ||
|
|
ab75eaa19d | ||
|
|
2d50afe767 | ||
|
|
916ea44e1d | ||
|
|
59bbbd822e | ||
|
|
8b67c32fd8 | ||
|
|
0852b1c635 | ||
|
|
38f0ec2180 | ||
|
|
67567aeed5 | ||
|
|
5315408948 | ||
|
|
5f255090f5 | ||
|
|
2e8a62001e | ||
|
|
52add3fc14 | ||
|
|
964a1008fd | ||
|
|
5fd9145a27 | ||
|
|
988717574c | ||
|
|
23ea6da091 | ||
|
|
927442fb89 | ||
|
|
4db0f00c26 | ||
|
|
c710784038 | ||
|
|
5072d9025a | ||
|
|
b5a963c1bf | ||
|
|
608b4a2b8a | ||
|
|
ae5a982dc4 | ||
|
|
3ec6b54d46 | ||
|
|
6a34e2da97 | ||
|
|
627a4c4ad6 | ||
|
|
abbab7118c | ||
|
|
31e6887d42 | ||
|
|
fc37507afb | ||
|
|
e160b6795a | ||
|
|
5ace2f5cc9 | ||
|
|
0e54c37963 | ||
|
|
e9e118fa12 | ||
|
|
9af1de3b43 | ||
|
|
b74c2d2d17 | ||
|
|
ee779c0fd8 | ||
|
|
36fb5d5343 | ||
|
|
0d2f443da0 | ||
|
|
5dc696f7e6 | ||
|
|
6ae56f6737 | ||
|
|
76af31b457 | ||
|
|
7838b7b5c3 | ||
|
|
f98664f398 | ||
|
|
89b1584816 | ||
|
|
da0234f66b | ||
|
|
45af6700f5 | ||
|
|
c60bc158a4 | ||
|
|
b2895d8908 | ||
|
|
eb10bd6b6b | ||
|
|
af0a111b81 | ||
|
|
fc9e35c18f | ||
|
|
7d619a85b3 | ||
|
|
ded9e8d248 | ||
|
|
4b5a232a9e | ||
|
|
bbe85d77a3 | ||
|
|
172581b794 | ||
|
|
2b965738cb | ||
|
|
47fe2abfe0 | ||
|
|
5068f2ae2d | ||
|
|
479df88a67 | ||
|
|
be93ce6e1e | ||
|
|
f41f010aa9 | ||
|
|
72aa9ac89a | ||
|
|
77a4bee249 | ||
|
|
54bd79427e | ||
|
|
1d773de3ca | ||
|
|
791881dd85 | ||
|
|
fc7c6e123d | ||
|
|
e3af6258f5 | ||
|
|
0bf9cc31d0 | ||
|
|
c3a0c839a8 | ||
|
|
4b84c570b5 | ||
|
|
57a8f7e98a | ||
|
|
0483212986 | ||
|
|
96ad10a2b0 | ||
|
|
a7fbef8753 | ||
|
|
1443111081 | ||
|
|
9c78c6e78d | ||
|
|
0aa3452fdb | ||
|
|
2ca261f10d | ||
|
|
bbe62b4c7b | ||
|
|
fd08ddde07 | ||
|
|
6020c2d64b | ||
|
|
012efefbad | ||
|
|
a18d9af782 | ||
|
|
5bc6d6aaa9 | ||
|
|
bedb6b8afb | ||
|
|
3eeb24fea8 | ||
|
|
645d6d9beb | ||
|
|
20cf6d1654 | ||
|
|
5bbab3b822 | ||
|
|
0a73c8150b | ||
|
|
8619514bdb | ||
|
|
1ad9254588 | ||
|
|
2bff75633e | ||
|
|
fa9bfb428e | ||
|
|
ab2766f79b | ||
|
|
bcdb31c830 | ||
|
|
32203771f6 | ||
|
|
2ff18658c9 |
@@ -1,7 +1,4 @@
|
||||
if PACKAGE_libbbfdm
|
||||
config BBF_VENDOR_LIST
|
||||
string "Vendor List"
|
||||
default "iopsys"
|
||||
if PACKAGE_bbfdmd
|
||||
|
||||
config BBF_VENDOR_PREFIX
|
||||
string "Vendor Prefix"
|
||||
125
bbfdm/Makefile
125
bbfdm/Makefile
@@ -5,14 +5,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.10.0
|
||||
PKG_VERSION:=1.12.21
|
||||
|
||||
USE_LOCAL:=0
|
||||
ifneq ($(USE_LOCAL),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=75195a112e3aef2b07e224afbbffcb15368be58f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_VERSION:=062c13e83387e3ad37d6caaffd47cf57a1db7c7f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -32,21 +32,28 @@ define Package/libbbfdm-api
|
||||
ABI_VERSION:=1.0
|
||||
endef
|
||||
|
||||
define Package/libbbfdm
|
||||
define Package/libbbfdm-ubus
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Library for broadband forum data model support
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +libopenssl
|
||||
MENU:=1
|
||||
TITLE:=BBF datamodel ubus library, provides API to expose datamodel over ubus
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api
|
||||
endef
|
||||
|
||||
define Package/bbfdmd
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Datamodel ubus backend
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libbbfdm-api +libbbfdm +jq +bbf_configmngr
|
||||
TITLE:=Datamodel ubus backend to expose core tree
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +libopenssl +libbbfdm-ubus +bbf_configmngr
|
||||
endef
|
||||
|
||||
define Package/dm-service
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Datamodel ubus backend to expose micro-service tree
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +libbbfdm-ubus +bbf_configmngr
|
||||
endef
|
||||
|
||||
define Package/bbf_configmngr
|
||||
@@ -55,11 +62,10 @@ define Package/bbf_configmngr
|
||||
SUBMENU:=TRx69
|
||||
TITLE:= BBF Config Manager
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/config
|
||||
source "$(SOURCE)/Config_bbfdm.in"
|
||||
define Package/bbfdmd/config
|
||||
source "$(SOURCE)/Config_bbfdmd.in"
|
||||
endef
|
||||
|
||||
define Package/bbf_configmngr/config
|
||||
@@ -70,8 +76,16 @@ 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 basic TR181 nodes.
|
||||
define Package/libbbfdm-ubus/description
|
||||
Library contains the APIs to expose data model over ubus
|
||||
endef
|
||||
|
||||
define Package/bbfdmd/description
|
||||
Daemon to expose Datamodel core tree
|
||||
endef
|
||||
|
||||
define Package/dm-service/description
|
||||
Daemon to expose Datamodel micro-service tree
|
||||
endef
|
||||
|
||||
define Package/bbf_configmngr/description
|
||||
@@ -85,17 +99,9 @@ endef
|
||||
endif
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR181=ON
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_VENDOR_LIST:String="$(CONFIG_BBF_VENDOR_LIST)" \
|
||||
-DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)" \
|
||||
-DBBF_MAX_OBJECT_INSTANCES:Integer=$(CONFIG_BBF_MAX_OBJECT_INSTANCES)
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_bbfdmd),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_MAX_OBJECT_INSTANCES:Integer=$(CONFIG_BBF_MAX_OBJECT_INSTANCES) \
|
||||
-DBBFDMD_MAX_MSG_LEN:Integer=10485760
|
||||
endif
|
||||
|
||||
define Package/libbbfdm-api/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
@@ -112,45 +118,41 @@ define Package/libbbfdm-api/install
|
||||
echo "$(CONFIG_BBF_OBFUSCATION_KEY)" > $(1)/etc/bbfdm/.secure_hash
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/install
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm/
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm/libbbfdm.so $(1)/usr/share/bbfdm/libbbfdm.so
|
||||
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/bbf $(1)/lib/upgrade/keep.d/bbf
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/91-fix-bbfdmd-enabled-option $(1)/etc/uci-defaults/
|
||||
|
||||
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/
|
||||
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_activate_handler.sh $(1)/usr/share/bbfdm/scripts/
|
||||
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_check_idle.sh $(1)/usr/share/bbfdm/scripts/
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/prerm
|
||||
#!/bin/sh
|
||||
rm -rf /etc/bbfdm/dmmap/*
|
||||
exit 0
|
||||
define Package/libbbfdm-ubus/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm-ubus/libbbfdm-ubus.so $(1)/lib/
|
||||
endef
|
||||
|
||||
define Package/bbfdmd/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
|
||||
$(INSTALL_CONF) ./files/etc/config/schedules $(1)/etc/config/schedules
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbfdmd/ubus/bbfdmd $(1)/usr/sbin/
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/input.json $(1)/etc/bbfdm/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bbfdmd $(1)/etc/init.d/bbfdmd
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bbfdm.services $(1)/etc/init.d/
|
||||
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
|
||||
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/bbf $(1)/lib/upgrade/keep.d/bbf
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/91-fix-bbfdmd-enabled-option $(1)/etc/uci-defaults/
|
||||
endef
|
||||
|
||||
define Package/dm-service/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bbfdm.services $(1)/etc/init.d/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dm-service/dm-service $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/bbf_configmngr/install
|
||||
@@ -159,6 +161,8 @@ 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
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm/scripts
|
||||
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_config_notify.sh $(1)/usr/share/bbfdm/scripts/
|
||||
endif
|
||||
ifeq ($(CONFIG_BBF_CONFIGMNGR_SCRIPT_BACKEND),y)
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
||||
@@ -166,15 +170,26 @@ ifeq ($(CONFIG_BBF_CONFIGMNGR_SCRIPT_BACKEND),y)
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/bbfdmd/prerm
|
||||
#!/bin/sh
|
||||
rm -rf /etc/bbfdm/dmmap/*
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/include/libbbfdm-api
|
||||
$(INSTALL_DIR) $(1)/usr/include/libbbfdm-ubus
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/*.h $(1)/usr/include/libbbfdm-api/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-ubus/bbfdm-ubus.h $(1)/usr/include/libbbfdm-ubus/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/include/*.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/libbbfdm-api.so $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm-ubus/libbbfdm-ubus.so $(1)/usr/lib
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,bbf_configmngr))
|
||||
$(eval $(call BuildPackage,libbbfdm-api))
|
||||
$(eval $(call BuildPackage,libbbfdm))
|
||||
$(eval $(call BuildPackage,libbbfdm-ubus))
|
||||
$(eval $(call BuildPackage,bbfdmd))
|
||||
$(eval $(call BuildPackage,dm-service))
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
{
|
||||
"daemon": {
|
||||
"config": {
|
||||
},
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/usr/share/bbfdm/libbbfdm.so",
|
||||
"plugin_dir": "/usr/share/bbfdm/plugins"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm"
|
||||
}
|
||||
},
|
||||
"cli": {
|
||||
"config": {
|
||||
"proto": "both",
|
||||
"instance_mode": 0
|
||||
},
|
||||
"input": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm"
|
||||
},
|
||||
"output": {
|
||||
"type": "CLI"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,8 @@
|
||||
config bbfdmd 'bbfdmd'
|
||||
option enable '1'
|
||||
option loglevel '1'
|
||||
option refresh_time '120'
|
||||
option transaction_timeout '30'
|
||||
option subprocess_level '2'
|
||||
option debug '0'
|
||||
option loglevel '3'
|
||||
|
||||
config micro_services 'micro_services'
|
||||
option enable '1'
|
||||
option enable_core '0'
|
||||
option enable_respawn '1'
|
||||
|
||||
2
bbfdm/files/etc/config/schedules
Normal file
2
bbfdm/files/etc/config/schedules
Normal file
@@ -0,0 +1,2 @@
|
||||
config global 'global'
|
||||
option enable '1'
|
||||
@@ -1,15 +1,36 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=64
|
||||
START=80
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/bbf_configd
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t bbf.config -p info
|
||||
}
|
||||
|
||||
create_needed_directories()
|
||||
{
|
||||
mkdir -p /tmp/bbfdm/.cwmp
|
||||
mkdir -p /tmp/bbfdm/.usp
|
||||
mkdir -p /tmp/bbfdm/.bbfdm
|
||||
}
|
||||
|
||||
start_service()
|
||||
{
|
||||
create_needed_directories
|
||||
|
||||
procd_open_instance "bbf_configd"
|
||||
procd_set_param command ${PROG}
|
||||
#procd_append_param command -ddd
|
||||
procd_set_param respawn
|
||||
procd_close_instance "bbf_configd"
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
for config_file in /etc/config/*; do
|
||||
config_name=$(basename "$config_file")
|
||||
procd_add_config_trigger "config.change" "$config_name" /usr/share/bbfdm/scripts/bbf_config_notify.sh
|
||||
done
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=40
|
||||
START=60
|
||||
STOP=8
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/bbfdmd
|
||||
PROG=/usr/sbin/dm-service
|
||||
|
||||
BBFDM_MICROSERVICE_DIR="/etc/bbfdm/micro_services"
|
||||
|
||||
@@ -18,33 +18,38 @@ validate_bbfdm_micro_service_section()
|
||||
{
|
||||
uci_validate_section bbfdm micro_services "micro_services" \
|
||||
'enable:bool:true' \
|
||||
'enable_core:bool:false' \
|
||||
'enable_respawn:bool:true'
|
||||
'enable_core:bool:false'
|
||||
}
|
||||
|
||||
_add_microservice()
|
||||
{
|
||||
local name path
|
||||
local enable enable_core enable_respawn
|
||||
local name path loglevel
|
||||
local enable enable_core
|
||||
|
||||
# Check enable from micro-service
|
||||
path="${1}"
|
||||
enable_respawn="${2}"
|
||||
enable_core="${3}"
|
||||
enable_core="${2}"
|
||||
|
||||
name="$(basename ${path})"
|
||||
name="${name//.json}"
|
||||
|
||||
enable="$(jq -r '.daemon.enable//1' ${path})"
|
||||
json_load_file "${path}"
|
||||
json_select daemon
|
||||
|
||||
json_get_var enable enable 1
|
||||
if [ "${enable}" -eq "0" ]; then
|
||||
log "datamodel micro-service ${name} not enabled"
|
||||
return 0
|
||||
fi
|
||||
|
||||
json_select config
|
||||
json_get_var loglevel loglevel 3
|
||||
|
||||
procd_open_instance "${name}"
|
||||
|
||||
procd_set_param command ${PROG}
|
||||
procd_append_param command -m "${name}"
|
||||
procd_append_param command -l "${loglevel}"
|
||||
|
||||
if [ "${enable_core}" -eq "1" ]; then
|
||||
procd_set_param limits core="unlimited"
|
||||
@@ -52,15 +57,13 @@ _add_microservice()
|
||||
procd_set_param stderr 1
|
||||
fi
|
||||
|
||||
if [ "${enable_respawn}" -eq "1" ]; then
|
||||
procd_set_param respawn "3600" "5" "5"
|
||||
fi
|
||||
procd_set_param respawn
|
||||
procd_close_instance "${name}"
|
||||
}
|
||||
|
||||
configure_bbfdm_micro_services()
|
||||
{
|
||||
local enable enable_core enable_respawn
|
||||
local enable enable_core
|
||||
|
||||
config_load bbfdm
|
||||
validate_bbfdm_micro_service_section || {
|
||||
@@ -77,7 +80,7 @@ configure_bbfdm_micro_services()
|
||||
do
|
||||
[ -e "$file" ] || continue
|
||||
|
||||
_add_microservice $file "${enable_respawn}" "${enable_core}"
|
||||
_add_microservice $file "${enable_core}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
@@ -92,7 +95,7 @@ _start_single_service()
|
||||
file="$(ls -1 ${BBFDM_MICROSERVICE_DIR}/${service}.json)"
|
||||
[ -e "$file" ] || return
|
||||
|
||||
_add_microservice $file "0" "0"
|
||||
_add_microservice $file "0"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=65
|
||||
START=97
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/bbfdmd
|
||||
|
||||
BBFDM_JSON_INPUT="/etc/bbfdm/input.json"
|
||||
BBFDM_TEMP_DIR="/tmp/bbfdm"
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
log() {
|
||||
@@ -19,17 +16,13 @@ validate_bbfdm_bbfdmd_section()
|
||||
{
|
||||
uci_validate_section bbfdm bbfdmd "bbfdmd" \
|
||||
'enable:bool:true' \
|
||||
'sock:string' \
|
||||
'debug:bool:false' \
|
||||
'loglevel:uinteger:1' \
|
||||
'refresh_time:uinteger:0' \
|
||||
'transaction_timeout:uinteger:30' \
|
||||
'subprocess_level:uinteger'
|
||||
'loglevel:uinteger:3'
|
||||
}
|
||||
|
||||
configure_bbfdmd()
|
||||
{
|
||||
local enable debug sock
|
||||
local enable debug
|
||||
local jlog jrefresh jtimeout jlevel
|
||||
|
||||
config_load bbfdm
|
||||
@@ -40,25 +33,17 @@ configure_bbfdmd()
|
||||
|
||||
[ "${enable}" -eq 0 ] && return 0
|
||||
|
||||
if [ -f "${BBFDM_JSON_INPUT}" ]; then
|
||||
echo "$(jq --arg log ${loglevel} --arg tran ${transaction_timeout} --arg refresh ${refresh_time} --arg level ${subprocess_level} '.daemon.config += {"loglevel": $log, "refresh_time": $refresh, "transaction_timeout": $tran, "subprocess_level": $level}' ${BBFDM_JSON_INPUT})" > "${BBFDM_TEMP_DIR}/input.json"
|
||||
fi
|
||||
|
||||
procd_set_param command ${PROG}
|
||||
procd_append_param command -l "${loglevel}"
|
||||
|
||||
if [ "${debug}" -eq 1 ]; then
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
fi
|
||||
|
||||
if [ -f "${sock}" ]; then
|
||||
procd_append_param command -s "${sock}"
|
||||
fi
|
||||
}
|
||||
|
||||
start_service()
|
||||
{
|
||||
mkdir -p ${BBFDM_TEMP_DIR}
|
||||
|
||||
procd_open_instance "bbfdm"
|
||||
configure_bbfdmd
|
||||
procd_set_param respawn
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
BBFDM_BASE_DM_PATH="usr/share/bbfdm"
|
||||
BBFDM_INPUT_PATH="etc/bbfdm/micro_services"
|
||||
INPUT_TEMPLATE='{"daemon":{"enable":"1","service_name":"template","config":{"loglevel":"1"}}}'
|
||||
INPUT_TEMPLATE='{"daemon":{"enable":"1","service_name":"template","config":{"loglevel":"3"}}}'
|
||||
OUT_NAME=""
|
||||
|
||||
MICRO_SERVICE=0
|
||||
@@ -79,6 +79,11 @@ bbfdm_install_dm()
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "${src}" ]; then
|
||||
echo "File $src does not exists..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "${src##*.}" = "json" ]; then
|
||||
echo "Compacting BBFDM JSON file"
|
||||
minfile=$(mktemp)
|
||||
|
||||
@@ -7,5 +7,11 @@ config BRIDGEMNGR_BRIDGE_VLAN
|
||||
help
|
||||
Set this option to use bridge-vlan as backend for VLAN objects.
|
||||
|
||||
config BRIDGEMNGR_BRIDGE_VENDOR_EXT
|
||||
bool "Use bridge BBF vendor extensions"
|
||||
default y
|
||||
help
|
||||
Set this option to use bridge BBF vendor extensions.
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bridgemngr
|
||||
PKG_VERSION:=1.0.5
|
||||
PKG_VERSION:=1.0.7
|
||||
|
||||
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:=c0f2e17f6d4f96aecfe72ab90be885939413176d
|
||||
PKG_SOURCE_VERSION:=4f22b4a4270c8d9b94b9de6f5cbe2a1dd86a3027
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -26,7 +26,8 @@ include ../bbfdm/bbfdm.mk
|
||||
define Package/bridgemngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Bridge Manager
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libbbfdm-api
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
endef
|
||||
|
||||
define Package/bridgemngr/description
|
||||
@@ -47,8 +48,9 @@ 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)
|
||||
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_EXT), y)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/libbridgeext.so $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) ./files/VLAN_Filtering_Extension.json $(1) $(PKG_NAME)
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
31
bridgemngr/files/VLAN_Filtering_Extension.json
Normal file
31
bridgemngr/files/VLAN_Filtering_Extension.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"json_plugin_version": 2,
|
||||
"Device.Bridging.Bridge.{i}.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": true,
|
||||
"array": true,
|
||||
"{BBF_VENDOR_PREFIX}VLANFiltering": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "boolean",
|
||||
"description": "Enable or disable VLAN Filtering on this bridge.",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "vlan_filtering"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=2.1.11
|
||||
PKG_VERSION:=2.1.14
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bulkdata.git
|
||||
PKG_SOURCE_VERSION:=5dd9cd3cfc95e9dce5f64fe9cadd274bb31b8fa6
|
||||
PKG_SOURCE_VERSION:=93c9e87cb9f8f635cece1473cff6f67cff9ff7c0
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -24,12 +24,17 @@ PKG_LICENSE_FILES:=LICENSE
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
define Package/bulkdata
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF BulkData Collection
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libcurl +libblobmsg-json +zlib
|
||||
DEPENDS:=+ubus +libuci +libubox +libjson-c +libcurl +libblobmsg-json +zlib
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus
|
||||
endef
|
||||
|
||||
define Package/bulkdata/description
|
||||
BulkData daemon for TR069 with bbfdm backend.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
@@ -42,16 +47,13 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
define Package/bulkdata/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
|
||||
$(INSTALL_DATA) ./files/etc/config/bulkdata $(1)/etc/config/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bulkdatad $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/95-bulkdata-translation-options $(1)/etc/uci-defaults/
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
$(eval $(call BuildPackage,bulkdata))
|
||||
|
||||
@@ -1,960 +0,0 @@
|
||||
{
|
||||
"json_plugin_version": 2,
|
||||
"Device.BulkData.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": false,
|
||||
"array": false,
|
||||
"Enable": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "boolean",
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "bulkdata",
|
||||
"section": {
|
||||
"name": "bulkdata"
|
||||
},
|
||||
"option": {
|
||||
"name": "enable"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"Status": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"Enabled",
|
||||
"Disabled",
|
||||
"Error"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "bulkdata",
|
||||
"section": {
|
||||
"name": "bulkdata"
|
||||
},
|
||||
"option": {
|
||||
"name": "enable"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"MinReportingInterval": {
|
||||
"type": "unsignedInt",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"default": "0",
|
||||
"datatype": "unsignedInt",
|
||||
"unit": "seconds"
|
||||
},
|
||||
"Protocols": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"default": "HTTP",
|
||||
"list": {
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"Streaming",
|
||||
"File",
|
||||
"HTTP",
|
||||
"MQTT"
|
||||
]
|
||||
}
|
||||
},
|
||||
"EncodingTypes": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"default": "JSON,CSV",
|
||||
"list": {
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"XML",
|
||||
"XDR",
|
||||
"CSV",
|
||||
"JSON"
|
||||
]
|
||||
}
|
||||
},
|
||||
"ParameterWildCardSupported": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"default": "1",
|
||||
"datatype": "boolean"
|
||||
},
|
||||
"MaxNumberOfProfiles": {
|
||||
"type": "int",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"default": "-1",
|
||||
"datatype": "int",
|
||||
"range": [
|
||||
{
|
||||
"min": -1
|
||||
}
|
||||
]
|
||||
},
|
||||
"MaxNumberOfParameterReferences": {
|
||||
"type": "int",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"default": "-1",
|
||||
"datatype": "int",
|
||||
"range": [
|
||||
{
|
||||
"min": -1
|
||||
}
|
||||
]
|
||||
},
|
||||
"ProfileNumberOfEntries": {
|
||||
"type": "unsignedInt",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "unsignedInt",
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "bulkdata",
|
||||
"section": {
|
||||
"type": "profile"
|
||||
},
|
||||
"option": {
|
||||
"name": "@Count"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"Device.BulkData.Profile.{i}.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": true,
|
||||
"array": true,
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "bulkdata",
|
||||
"section": {
|
||||
"type": "profile"
|
||||
},
|
||||
"dmmapfile": "dmmap_bulkdata"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Enable": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "boolean",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "enable"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Alias": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "Alias",
|
||||
"range": [
|
||||
{
|
||||
"max": 64
|
||||
}
|
||||
],
|
||||
"flags": [
|
||||
"Unique"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "alias"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Name": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"range": [
|
||||
{
|
||||
"max": 255
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "name"
|
||||
}
|
||||
]
|
||||
},
|
||||
"NumberOfRetainedFailedReports": {
|
||||
"type": "int",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "int",
|
||||
"range": [
|
||||
{
|
||||
"min": -1
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "nbre_of_retained_failed_reports"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Protocol": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"Streaming",
|
||||
"File",
|
||||
"HTTP"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "protocol"
|
||||
}
|
||||
]
|
||||
},
|
||||
"EncodingType": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"XML",
|
||||
"XDR",
|
||||
"CSV",
|
||||
"JSON"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "encoding_type"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ReportingInterval": {
|
||||
"type": "unsignedInt",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "unsignedInt",
|
||||
"range": [
|
||||
{
|
||||
"min": 1
|
||||
}
|
||||
],
|
||||
"unit": "seconds",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "reporting_interval"
|
||||
}
|
||||
]
|
||||
},
|
||||
"TimeReference": {
|
||||
"type": "dateTime",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "dateTime",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "time_reference"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ParameterNumberOfEntries": {
|
||||
"type": "unsignedInt",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "unsignedInt",
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "bulkdata",
|
||||
"section": {
|
||||
"type": "profile_parameter"
|
||||
},
|
||||
"option": {
|
||||
"name": "@Count"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"Device.BulkData.Profile.{i}.Parameter.{i}.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": true,
|
||||
"array": true,
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "bulkdata",
|
||||
"section": {
|
||||
"type": "profile_parameter"
|
||||
},
|
||||
"dmmapfile": "dmmap_bulkdata"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Name": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"range": [
|
||||
{
|
||||
"max": 64
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "name"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Reference": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"range": [
|
||||
{
|
||||
"max": 256
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "reference"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Device.BulkData.Profile.{i}.CSVEncoding.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": false,
|
||||
"array": false,
|
||||
"FieldSeparator": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "csv_encoding_field_separator"
|
||||
}
|
||||
]
|
||||
},
|
||||
"RowSeparator": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "csv_encoding_row_separator"
|
||||
}
|
||||
]
|
||||
},
|
||||
"EscapeCharacter": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "csv_encoding_escape_character"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ReportFormat": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"ParameterPerRow",
|
||||
"ParameterPerColumn"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "csv_encoding_report_format"
|
||||
}
|
||||
]
|
||||
},
|
||||
"RowTimestamp": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"Unix-Epoch",
|
||||
"ISO-8601",
|
||||
"None"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "csv_encoding_row_time_stamp"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Device.BulkData.Profile.{i}.JSONEncoding.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": false,
|
||||
"array": false,
|
||||
"ReportFormat": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"ObjectHierarchy",
|
||||
"NameValuePair"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "json_encoding_report_format"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ReportTimestamp": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"Unix-Epoch",
|
||||
"ISO-8601",
|
||||
"None"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "json_encoding_report_time_stamp"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Device.BulkData.Profile.{i}.HTTP.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": false,
|
||||
"array": false,
|
||||
"URL": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "URL",
|
||||
"range": [
|
||||
{
|
||||
"max": 2048
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_url"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Username": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"range": [
|
||||
{
|
||||
"max": 256
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_username"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Password": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"range": [
|
||||
{
|
||||
"max": 256
|
||||
}
|
||||
],
|
||||
"flags": [
|
||||
"Secure"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_password"
|
||||
}
|
||||
]
|
||||
},
|
||||
"CompressionsSupported": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"default": "GZIP",
|
||||
"list": {
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"GZIP",
|
||||
"Compress",
|
||||
"Deflate"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Compression": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"GZIP",
|
||||
"Compress",
|
||||
"Deflate"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_compression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"MethodsSupported": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"default": "POST,PUT",
|
||||
"list": {
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"POST",
|
||||
"PUT"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Method": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"POST",
|
||||
"PUT"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_method"
|
||||
}
|
||||
]
|
||||
},
|
||||
"UseDateHeader": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "boolean",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_use_date_header"
|
||||
}
|
||||
]
|
||||
},
|
||||
"RetryEnable": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "boolean",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_retry_enable"
|
||||
}
|
||||
]
|
||||
},
|
||||
"RetryMinimumWaitInterval": {
|
||||
"type": "unsignedInt",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "unsignedInt",
|
||||
"range": [
|
||||
{
|
||||
"min": 1,
|
||||
"max": 65535
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_retry_minimum_wait_interval"
|
||||
}
|
||||
]
|
||||
},
|
||||
"RetryIntervalMultiplier": {
|
||||
"type": "unsignedInt",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "unsignedInt",
|
||||
"range": [
|
||||
{
|
||||
"min": 1000,
|
||||
"max": 65535
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_retry_interval_multiplier"
|
||||
}
|
||||
]
|
||||
},
|
||||
"RequestURIParameterNumberOfEntries": {
|
||||
"type": "unsignedInt",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "unsignedInt",
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "bulkdata",
|
||||
"section": {
|
||||
"type": "profile_http_request_uri_parameter"
|
||||
},
|
||||
"option": {
|
||||
"name": "@Count"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"PersistAcrossReboot": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "boolean",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_persist_across_reboot"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Device.BulkData.Profile.{i}.HTTP.RequestURIParameter.{i}.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": true,
|
||||
"array": true,
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "bulkdata",
|
||||
"section": {
|
||||
"type": "profile_http_request_uri_parameter"
|
||||
},
|
||||
"dmmapfile": "dmmap_bulkdata"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Name": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"range": [
|
||||
{
|
||||
"max": 64
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "name"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Reference": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"range": [
|
||||
{
|
||||
"max": 256
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "reference"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,34 +7,24 @@ USE_PROCD=1
|
||||
PROG="/usr/sbin/bulkdatad"
|
||||
|
||||
start_service() {
|
||||
local enable
|
||||
|
||||
config_load bulkdata
|
||||
config_get_bool enable bulkdata enable 1
|
||||
|
||||
if [ ! -f "/var/state/bulkdatad" ]; then
|
||||
touch /var/state/bulkdatad
|
||||
uci -q -c /var/state set bulkdatad.global='global'
|
||||
uci -q -c /var/state commit bulkdatad
|
||||
fi
|
||||
|
||||
if [ "$enable" -eq "1" ]; then
|
||||
procd_open_instance "bulkdata"
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn
|
||||
procd_close_instance "bulkdata"
|
||||
else
|
||||
uci -q -c /var/state set bulkdatad.global.status='Disabled'
|
||||
uci -q -c /var/state commit bulkdatad
|
||||
fi
|
||||
procd_open_instance "bulkdata"
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn
|
||||
procd_close_instance "bulkdata"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
ret=$(ubus call service list '{"name":"bulkdatad"}' | jsonfilter -qe '@.bulkdatad.instances.bulkdata.running')
|
||||
if [ "$ret" != "true" ]; then
|
||||
stop
|
||||
start
|
||||
else
|
||||
ubus send bulkdata.reload
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger bulkdata
|
||||
}
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
PROFILE_COUNT=1
|
||||
|
||||
get_next_count()
|
||||
{
|
||||
local config="$1"
|
||||
local default_name="${2}"
|
||||
local count=${3}
|
||||
local found=0
|
||||
|
||||
if [ -z "$count" ]; then
|
||||
count=1
|
||||
fi
|
||||
|
||||
while [ "${found}" -ne 1 ]; do
|
||||
uci -q get "${config}"."${default_name}"_${count} >/dev/null
|
||||
if [ "$?" -eq 0 ]; then
|
||||
count=$((count + 1))
|
||||
else
|
||||
found=1;
|
||||
fi
|
||||
done
|
||||
|
||||
echo "${default_name}_${count}"
|
||||
}
|
||||
|
||||
translate_profile_id_to_profile_name() {
|
||||
local section="${1}"
|
||||
local profile_id="${2}"
|
||||
local profile_name="${3}"
|
||||
local curr_profile_id
|
||||
|
||||
config_get curr_profile_id "${section}" profile_id
|
||||
|
||||
[ -n "${curr_profile_id}" ] || return
|
||||
|
||||
[ "${curr_profile_id}" != "${profile_id}" ] && return
|
||||
|
||||
uci -q set bulkdata."${section}".profile_name="${profile_name}"
|
||||
uci -q set bulkdata."${section}".profile_id=""
|
||||
}
|
||||
|
||||
update_profile_sections() {
|
||||
local section="${1}"
|
||||
local default="${2}"
|
||||
local profile_name
|
||||
|
||||
config_get profile_id "${section}" profile_id
|
||||
|
||||
[ -n "${profile_id}" ] || return
|
||||
|
||||
case "${section}" in
|
||||
"cfg"*)
|
||||
profile_name="$(get_next_count bulkdata "${default}" ${PROFILE_COUNT})"
|
||||
uci_rename bulkdata "${section}" "${profile_name}"
|
||||
;;
|
||||
esac
|
||||
PROFILE_COUNT=$((PROFILE_COUNT + 1))
|
||||
|
||||
[ -n "$profile_name" ] && section="${profile_name}"
|
||||
|
||||
uci -q set bulkdata."${section}".profile_id=""
|
||||
|
||||
config_foreach translate_profile_id_to_profile_name profile_parameter "${profile_id}" "${profile_name}"
|
||||
config_foreach translate_profile_id_to_profile_name profile_http_request_uri_parameter "${profile_id}" "${profile_name}"
|
||||
}
|
||||
|
||||
config_load bulkdata
|
||||
config_foreach update_profile_sections profile profile
|
||||
uci commit bulkdata
|
||||
|
||||
exit 0
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ddnsmngr
|
||||
PKG_VERSION:=1.0.7
|
||||
PKG_VERSION:=1.0.9
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/ddnsmngr.git
|
||||
PKG_SOURCE_VERSION:=4b0c679c4dc3e3725de5c0c55ed60f24b87c6edd
|
||||
PKG_SOURCE_VERSION:=5144e73fad92d23ae706894a4357436c3fe89355
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -28,7 +28,8 @@ define Package/$(PKG_NAME)
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Dynamic DNS manager
|
||||
DEPENDS:=+libbbfdm-api +DDNSMNGR_BACKEND_DDNSSCRIPT:ddns-scripts +DDNSMNGR_BACKEND_INADYN:inadyn
|
||||
DEPENDS:=+DDNSMNGR_BACKEND_DDNSSCRIPT:ddns-scripts +DDNSMNGR_BACKEND_INADYN:inadyn
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=decollector
|
||||
PKG_VERSION:=6.0.0.13
|
||||
PKG_VERSION:=6.1.0.3
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=d75639d9ae82538103123b32fc0de9280e84cabb
|
||||
PKG_SOURCE_VERSION:=005a48c7a40c3fcf89d031fda0e109a25431b20e
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.6.7
|
||||
PKG_VERSION:=3.7.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=98999eb75755f79a3c8a7e802e024b42914d1efc
|
||||
PKG_SOURCE_VERSION:=daf66f6f2098a343fefb304e7ce9440f55ea1cd1
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -28,7 +28,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/$(PKG_NAME)
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=DECT Manager
|
||||
DEPENDS:= +libubox +ubus +uci +libxml2 +libjson-c +gpiod-tools
|
||||
DEPENDS:= +libubox +ubus +uci +libxml2 +libjson-c +gpiod-tools +voicemngr
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dhcpmngr
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_VERSION:=1.0.4
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dhcpmngr.git
|
||||
PKG_SOURCE_VERSION:=4c89a3f12686343e3cca23819255744ac06dfb22
|
||||
PKG_SOURCE_VERSION:=2a517188211849bcc324a9f9727eeb34d076c032
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -28,7 +28,10 @@ define Package/dhcpmngr
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Package to add Device.DHCPv4 and v6 data model support.
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +dnsmasq
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +odhcpd
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
DEPENDS+=+DNSMNGR_DNS_SD:umdns
|
||||
DEPENDS+=+DNSMNGR_BACKEND_DNSMASQ:dnsmasq
|
||||
endef
|
||||
|
||||
define Package/dhcpmngr/description
|
||||
@@ -44,6 +47,10 @@ endif
|
||||
define Package/dhcpmngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
|
||||
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_lease_start_time.user $(1)/etc/udhcpc.user.d/udhcpc_lease_start_time.user
|
||||
ifeq ($(CONFIG_DNSMNGR_BACKEND_UNBOUND),y)
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/unbound.odhcpd.uci_default $(1)/etc/uci-defaults/16-set-unbound-as-odhcpd-leasetrigger
|
||||
endif
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libdhcpmngr.so $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
|
||||
18
dhcpmngr/files/etc/uci-defaults/unbound.odhcpd.uci_default
Normal file
18
dhcpmngr/files/etc/uci-defaults/unbound.odhcpd.uci_default
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
# update odhcpd uci to use unbound's script as leasetrigger
|
||||
uci -q get dhcp.odhcpd >/dev/null 2>&1 && {
|
||||
maindhcp="$(uci -q get dhcp.odhcpd.maindhcp)"
|
||||
|
||||
# if odhcpd is the main dhcp
|
||||
[ "$maindhcp" = "1" ] || [ "$maindhcp" = "true" ] || [ "$maindhcp" = "on" ] && {
|
||||
# if unbound daemon and unbound script file is present
|
||||
[ -e /usr/lib/unbound/odhcpd.sh ] && [ -e /usr/sbin/unbound ] && {
|
||||
# then set unbound script as leasetrigger in dhcp UCI
|
||||
uci -q set dhcp.odhcpd.leasetrigger='/usr/lib/unbound/odhcpd.sh'
|
||||
uci commit dhcp
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exit 0
|
||||
30
dnsmngr/Config.in
Normal file
30
dnsmngr/Config.in
Normal file
@@ -0,0 +1,30 @@
|
||||
if PACKAGE_dnsmngr
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config DNSMNGR_DNS_SD
|
||||
bool "Include Device.DNS.SD. TR-181 support"
|
||||
default y
|
||||
help
|
||||
Set this option to include support for TR-181 DNS.SD. object.
|
||||
|
||||
choice
|
||||
prompt "Select backend for DNS management"
|
||||
default DNSMNGR_BACKEND_DNSMASQ
|
||||
depends on PACKAGE_dnsmngr
|
||||
help
|
||||
Select which backend daemon to use for DNS
|
||||
|
||||
config DNSMNGR_BACKEND_DNSMASQ
|
||||
bool "Use dnsmasq for dns and dhcp"
|
||||
help
|
||||
Enable this option to use dnsmasq + odhcpd for dns and dhcp.
|
||||
|
||||
config DNSMNGR_BACKEND_UNBOUND
|
||||
bool "Use unbound with odhcpd-full for dns and dhcp"
|
||||
help
|
||||
Enable this option to use unbound + odhcpd for dns and dhcp.
|
||||
|
||||
endchoice
|
||||
endmenu
|
||||
endif
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dnsmngr
|
||||
PKG_VERSION:=1.0.8
|
||||
PKG_VERSION:=1.0.12
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dnsmngr.git
|
||||
PKG_SOURCE_VERSION:=e46f27dd2be08775909a69ac58917213549c7704
|
||||
PKG_SOURCE_VERSION:=fb49088ddb498980e2c91f03aea10bd502caeca1
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -27,23 +27,48 @@ MAKE_PATH:=src
|
||||
define Package/dnsmngr
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +dnsmasq +umdns
|
||||
TITLE:=Package to add Device.DNS. datamodel support
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +odhcpd
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
DEPENDS+=+DNSMNGR_DNS_SD:umdns
|
||||
DEPENDS+=+DNSMNGR_BACKEND_DNSMASQ:dnsmasq
|
||||
DEPENDS+=+DNSMNGR_BACKEND_UNBOUND:unbound-daemon +DNSMNGR_BACKEND_UNBOUND:unbound-control
|
||||
TITLE:=Package to configure DNS backend and TR-181 support
|
||||
endef
|
||||
|
||||
define Package/dnsmngr/description
|
||||
Package to add Device.DNS. datamodel support.
|
||||
Package to configure DNS backend and TR-181 support.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_DNSMNGR_DNS_SD),y)
|
||||
define Build/Compile
|
||||
$(call Build/Compile/Default,all)
|
||||
endef
|
||||
else
|
||||
define Build/Compile
|
||||
$(call Build/Compile/Default,dns)
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/dnsmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DNSMNGR_BACKEND_DNSMASQ),y)
|
||||
TARGET_CFLAGS += -DDNSMASQ_BACKEND
|
||||
endif
|
||||
|
||||
define Package/dnsmngr/install
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libdnsmngr.so $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_SCRIPT) -d $(PKG_BUILD_DIR)/scripts/nslookup $(1)
|
||||
ifeq ($(CONFIG_DNSMNGR_DNS_SD),y)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/libdns_sd.so $(1) $(PKG_NAME)
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dnsmngr))
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dslmngr
|
||||
PKG_VERSION:=1.2.6
|
||||
PKG_VERSION:=1.2.8
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/dslmngr.git
|
||||
PKG_SOURCE_VERSION:=2b1ecbd2079dbd88ed6d58b277b91dcf5038d869
|
||||
PKG_SOURCE_VERSION:=5340cb31f759301f5aca3fd848fc3a63b0b4663f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -40,7 +40,8 @@ define Package/dslmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=XDSL status and configration utility
|
||||
DEPENDS:=+libdsl +libuci +libubox +ubus +libpthread +libnl-genl +libeasy +libbbfdm-api
|
||||
DEPENDS:=+libdsl +libuci +libubox +ubus +libpthread +libnl-genl +libeasy
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
endef
|
||||
|
||||
define Package/dslmngr/description
|
||||
|
||||
@@ -27,7 +27,8 @@ define Package/ethmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Ethernet status and configration utility
|
||||
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_ipq53xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl +libeasy +libbbfdm-api
|
||||
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_ipq53xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl +libeasy
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
endef
|
||||
|
||||
define Package/ethmngr/description
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=firewallmngr
|
||||
PKG_VERSION:=1.0.5
|
||||
PKG_VERSION:=1.0.6
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/firewallmngr.git
|
||||
PKG_SOURCE_VERSION:=94246676dc2e2db29b94fcffec1be3cee3ec8e9f
|
||||
PKG_SOURCE_VERSION:=2cac05871f7a8d93c144157c5f3f129deecf1a29
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -28,9 +28,10 @@ define Package/firewallmngr
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Package to add Device.Firewall and Device.NAT. data model support.
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +firewall
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +firewall
|
||||
DEPENDS+=+FIREWALLMNGR_PORT_TRIGGER:kmod-ipt-trigger +FIREWALLMNGR_PORT_TRIGGER:kmod-ip6t-trigger
|
||||
DEPENDS+=+FIREWALLMNGR_PORT_TRIGGER:iptables-mod-nfqueue
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
endef
|
||||
|
||||
define Package/firewallmngr/description
|
||||
|
||||
@@ -6,14 +6,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fluent-bit
|
||||
PKG_VERSION:=3.1.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/fluent/fluent-bit.git
|
||||
PKG_SOURCE_VERSION=v$(PKG_VERSION)
|
||||
PKG_MIRROR_HASH:=9bedfabf859b88a2cfcf51cc17669b83a170e85427ce562131366cb1542b52ae
|
||||
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/fluent/fluent-bit/archive/v$(PKG_VERSION)
|
||||
PKG_HASH:=7a49e110cf3050b6c29c911063494b8081f3c743274d1d95e52562d0476ba1eb
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
|
||||
45
fluent-bit/patches/0002-add_hostname_to_log_dump.patch
Normal file
45
fluent-bit/patches/0002-add_hostname_to_log_dump.patch
Normal file
@@ -0,0 +1,45 @@
|
||||
diff --git a/plugins/out_file/file.c b/plugins/out_file/file.c
|
||||
index 2e47c9666..95d28e438 100644
|
||||
--- a/plugins/out_file/file.c
|
||||
+++ b/plugins/out_file/file.c
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <msgpack.h>
|
||||
|
||||
#include <stdio.h>
|
||||
+#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
@@ -55,6 +56,7 @@ struct flb_file_conf {
|
||||
int csv_column_names;
|
||||
int mkdir;
|
||||
struct flb_output_instance *ins;
|
||||
+ char hostname[256];
|
||||
};
|
||||
|
||||
static char *check_delimiter(const char *str)
|
||||
@@ -141,6 +143,9 @@ static int cb_file_init(struct flb_output_instance *ins,
|
||||
}
|
||||
}
|
||||
|
||||
+ if (gethostname(ctx->hostname, sizeof(ctx->hostname)) != 0)
|
||||
+ snprintf(ctx->hostname, sizeof(ctx->hostname), "%s", "localhost");
|
||||
+
|
||||
tmp = flb_output_get_property("delimiter", ins);
|
||||
ret_str = check_delimiter(tmp);
|
||||
if (ret_str != NULL) {
|
||||
@@ -233,12 +238,8 @@ static int template_output_write(struct flb_file_conf *ctx,
|
||||
int i;
|
||||
msgpack_object_kv *kv;
|
||||
|
||||
- /*
|
||||
- * Right now we treat "{time}" specially and fill the placeholder
|
||||
- * with the metadata timestamp (formatted as float).
|
||||
- */
|
||||
- if (!strncmp(key, "time", size)) {
|
||||
- fprintf(fp, "%f", flb_time_to_double(tm));
|
||||
+ if (!strncmp(key, "hostname", size)) {
|
||||
+ fprintf(fp, "%s", ctx->hostname);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostmngr
|
||||
PKG_VERSION:=1.2.6
|
||||
PKG_VERSION:=1.2.9
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=aa365710b227ba82b1c43f9cdf497261edb21852
|
||||
PKG_SOURCE_VERSION:=27b2d7c3ef0ccb4e2c30f790f2b51881b6884d9c
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/hostmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -31,9 +31,8 @@ define Package/hostmngr
|
||||
DEPENDS= +libubox +libuci +libubus +ubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +libnfnetlink +libmnl \
|
||||
+libnetfilter-conntrack \
|
||||
+HOSTMNGR_PLATFORM_HAS_WIFI:libwifi +libbbfdm-api \
|
||||
+libwifiutils
|
||||
|
||||
+HOSTMNGR_PLATFORM_HAS_WIFI:libwifi +libwifiutils
|
||||
DEPENDS+= +libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
endef
|
||||
|
||||
define Package/hostmngr/config
|
||||
|
||||
@@ -3,4 +3,8 @@ menu "Configuration"
|
||||
config ICWMP_MGMT_FROM_USP
|
||||
bool "Support configuration of ManagementServer from USP"
|
||||
default y
|
||||
|
||||
config ICWMP_BACKUP_EVENTS
|
||||
bool "Create backup of session events to persistent storage after each successful session"
|
||||
default y
|
||||
endmenu
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.8.8
|
||||
PKG_VERSION:=9.8.22
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=580f923cfc89aa9f151096d8606dde71e4604d08
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_VERSION:=2eeb0990616df846da55a154d2fed05c828d168f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -31,7 +31,8 @@ define Package/icwmp
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=TR069 CWMP client
|
||||
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml +libuuid +libbbfdm-api +libopenssl
|
||||
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml +libuuid +libopenssl
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
@@ -47,6 +48,10 @@ ifeq ($(CONFIG_ICWMP_MGMT_FROM_USP),y)
|
||||
EXTRA_CFLAGS += -DCWMP_DUAL_SUPPORT=BBFDM_BOTH
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ICWMP_BACKUP_EVENTS),y)
|
||||
EXTRA_CFLAGS += -DPERSIST_BACKUP_SESSION_EVENTS
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/icwmp/* $(PKG_BUILD_DIR)/
|
||||
@@ -63,12 +68,13 @@ define Package/icwmp/install
|
||||
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/icwmpd $(1)/usr/sbin/icwmpd
|
||||
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
|
||||
$(INSTALL_BIN) ./files/etc/firewall.cwmp $(1)/etc/firewall.cwmp
|
||||
$(INSTALL_BIN) ./files/etc/critical_services.json $(1)/etc/icwmpd/critical_services.json
|
||||
$(INSTALL_BIN) ./files/etc/init.d/icwmpd $(1)/etc/init.d/icwmpd
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/85-cwmp-set-userid $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/95-set-random-inform-time $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/icwmpd/vendor_log.sh $(1)/etc/icwmpd/vendor_log.sh
|
||||
$(INSTALL_BIN) ./files/etc/icwmpd/firewall.cwmp $(1)/etc/icwmpd/firewall.cwmp
|
||||
$(INSTALL_BIN) ./files/etc/icwmpd/critical_services.json $(1)/etc/icwmpd/critical_services.json
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
|
||||
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user
|
||||
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user
|
||||
|
||||
29
icwmp/files/etc/icwmpd/vendor_log.sh
Normal file
29
icwmp/files/etc/icwmpd/vendor_log.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
# This script handles '2 Vendor Log File' of Download RPC
|
||||
# Vendors can replace this file if they need to collect more logs
|
||||
|
||||
VENDOR_LOG_FILE="/tmp/icwmp/2_vendor_log"
|
||||
ret=""
|
||||
|
||||
if [ -n "$(which logread)" ]; then
|
||||
mkdir -p /tmp/icwmp
|
||||
|
||||
logread > "${VENDOR_LOG_FILE}"
|
||||
|
||||
arch_file="${VENDOR_LOG_FILE}.tar"
|
||||
|
||||
if [ -f "${arch_file}" ]; then
|
||||
rm -f ${arch_file}
|
||||
fi
|
||||
|
||||
if [ -f "${VENDOR_LOG_FILE}" ]; then
|
||||
tar -cf "${arch_file}" "${VENDOR_LOG_FILE}" 2> /dev/null
|
||||
if [ -f "${arch_file}" ]; then
|
||||
ret="${arch_file}"
|
||||
fi
|
||||
|
||||
rm -rf "${VENDOR_LOG_FILE}"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "${ret}"
|
||||
@@ -3,7 +3,7 @@
|
||||
uci -q batch <<-EOT
|
||||
delete firewall.cwmp
|
||||
set firewall.cwmp=include
|
||||
set firewall.cwmp.path=/etc/firewall.cwmp
|
||||
set firewall.cwmp.path=/etc/icwmpd/firewall.cwmp
|
||||
set firewall.cwmp.reload=1
|
||||
commit firewall
|
||||
EOT
|
||||
|
||||
@@ -21,6 +21,9 @@ config IEEE1905_WIFI_EASYMESH
|
||||
config IEEE1905_CMDU_FRAGMENT_TLV_BOUNDARY
|
||||
bool "Fragment large CMDU frame at TLV boundary instead of octet boundary"
|
||||
|
||||
config IEEE1905_BUILD_TR181_PLUGIN
|
||||
bool "Build TR-181 mapping module (responsible for Device.IEEE1905.)"
|
||||
|
||||
endmenu
|
||||
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.5.1
|
||||
PKG_VERSION:=8.6.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b0e9ef0934888281ba7db7843738e56e6541665a
|
||||
PKG_SOURCE_VERSION:=5f7e6e30cbda36e431ecb7150d7494bce0c26f6f
|
||||
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
|
||||
@@ -48,7 +48,8 @@ define Package/ieee1905
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +ubus +libpthread \
|
||||
+libieee1905 +IEEE1905_PLATFORM_HAS_WIFI:libwifi \
|
||||
+libwifiutils +libbbfdm-api
|
||||
+libwifiutils
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
endef
|
||||
|
||||
include $(wildcard plugins/*.mk)
|
||||
@@ -96,6 +97,7 @@ TARGET_CFLAGS += -DEXTENSION_ALLOWED
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -DHAS_UBUS
|
||||
TARGET_CFLAGS += -DBUILD_TR181_PLUGIN
|
||||
|
||||
MAKE_FLAGS += \
|
||||
extmod_subdirs="$(patsubst %,extensions/%,$(plugins))"
|
||||
|
||||
@@ -36,7 +36,7 @@ _iop()
|
||||
feeds_update genconfig \
|
||||
generate_tarballs install_key \
|
||||
scp_changes setup_host ssh_install_key status \
|
||||
update_feed_branches ssh_upgrade smoketest"
|
||||
ssh_upgrade smoketest"
|
||||
|
||||
if [ $COMP_CWORD -eq 1 ] ; then
|
||||
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function disable_add_config () {
|
||||
local COPTION="$1"
|
||||
|
||||
HAVE_OPTION=`grep $COPTION .config | wc -l`
|
||||
HAVE_OPTION_DISABLED=`grep "# $COPTION" .config | wc -l`
|
||||
if [ "$HAVE_OPTION" = "1" ]
|
||||
then
|
||||
if [ "$HAVE_OPTION_DISABLED" = "0" ]
|
||||
then
|
||||
sed -i -e "s,$COPTION=y,# $COPTION is not set,g" .config
|
||||
fi
|
||||
else
|
||||
echo "# $COPTION is not set" >> .config
|
||||
fi
|
||||
}
|
||||
|
||||
function enable_option () {
|
||||
local COPTION="$1"
|
||||
# cat .config| grep DSL
|
||||
sed -i -e "s,# $COPTION is not set,$COPTION=y,g" .config
|
||||
# cat .config| grep DSL
|
||||
}
|
||||
|
||||
function annexconfig {
|
||||
|
||||
v() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
}
|
||||
|
||||
local ANNEX="$1"
|
||||
|
||||
disable_add_config CONFIG_TARGET_NO_DSL
|
||||
disable_add_config CONFIG_TARGET_DSL_ANNEX_A
|
||||
disable_add_config CONFIG_TARGET_DSL_ANNEX_B
|
||||
disable_add_config CONFIG_TARGET_DSL_ANNEX_C
|
||||
disable_add_config CONFIG_TARGET_DSL_SADSL
|
||||
disable_add_config CONFIG_TARGET_DSL_GFAST
|
||||
|
||||
|
||||
if [ "$ANNEX" = "no" ]
|
||||
then
|
||||
echo "No DSL"
|
||||
enable_option CONFIG_TARGET_NO_DSL
|
||||
elif [ "$ANNEX" = "a" ]
|
||||
then
|
||||
echo "Annex A"
|
||||
enable_option CONFIG_TARGET_DSL_ANNEX_A
|
||||
elif [ "$ANNEX" = "b" ]
|
||||
then
|
||||
echo "Annex B"
|
||||
enable_option CONFIG_TARGET_DSL_ANNEX_B
|
||||
elif [ "$ANNEX" = "c" ]
|
||||
then
|
||||
echo "Annex C"
|
||||
enable_option CONFIG_TARGET_DSL_ANNEX_C
|
||||
elif [ "$ANNEX" = "sadsl" ]
|
||||
then
|
||||
echo "sadsl"
|
||||
enable_option CONFIG_TARGET_DSL_SADSL
|
||||
elif [ "$ANNEX" = "gfast" ]
|
||||
then
|
||||
echo "G.fast"
|
||||
enable_option CONFIG_TARGET_DSL_GFAST
|
||||
else
|
||||
echo "Only option no,a,b,c,sadsl,gfast supported"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
register_command "annexconfig" "Select configuration annex"
|
||||
@@ -1,42 +0,0 @@
|
||||
# this is a developer helper script to install firmware on a remote host running in CFE mode
|
||||
|
||||
function usage {
|
||||
echo "usage: $0 cfe_upgrade <host> <file>"
|
||||
}
|
||||
|
||||
function cfe_upgrade {
|
||||
if [ -z "$1" ] ; then
|
||||
usage
|
||||
echo "Error: host required"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$2" ] ; then
|
||||
usage
|
||||
echo "Error: firmware filename required"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -e $2 ] ; then
|
||||
usage
|
||||
echo "Error: firmware file does not exist"
|
||||
exit 1
|
||||
fi
|
||||
IMAGE=`basename $2`
|
||||
echo "CFE upgrade host: $1 with file $IMAGE"
|
||||
[ "$2" ] && [ -e "$2" ] && curl -i -F filedata=@$2 http://$1/upload.cgi && echo "upgrade done!"
|
||||
}
|
||||
|
||||
register_command "cfe_upgrade" "<host> <file> Install firmware on remote host in CFE mode"
|
||||
|
||||
function cfe_upgrade_latest {
|
||||
if [ -z "$1" ] ; then
|
||||
echo "usage: $0 cfe_upgrade_latest <host>"
|
||||
echo "Error: host required"
|
||||
exit 1
|
||||
fi
|
||||
{ cd `dirname $0`
|
||||
IMAGE=`ls -Art bin/*/*.w | tail -n1`
|
||||
[ "$IMAGE" ] && [ -e "$IMAGE" ] && ./iop cfe_upgrade $1 $IMAGE
|
||||
}
|
||||
}
|
||||
|
||||
register_command "cfe_upgrade_latest" "<host> Install latest firmware on remote host in CFE mode"
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Function to convert parameters to lowercase
|
||||
function to_lowercase {
|
||||
local params=()
|
||||
for param in "$@"; do
|
||||
params+=("$(tr '[:upper:]' '[:lower:]' <<< "$param")")
|
||||
done
|
||||
echo "${params[@]}"
|
||||
}
|
||||
|
||||
function genconfig {
|
||||
target_script="./scripts/gen_config.py"
|
||||
|
||||
# First convert all to lowercase
|
||||
args=$(to_lowercase "$@")
|
||||
|
||||
# Check if an option is provided
|
||||
if [[ ${args[0]} == -* ]]; then
|
||||
# Convert options for target script
|
||||
if [[ ${args[0]} == "-b" || ${args[0]} == "--boards" ]]; then
|
||||
args=("--list")
|
||||
fi
|
||||
fi
|
||||
|
||||
${target_script} ${args[@]}
|
||||
}
|
||||
|
||||
register_command "genconfig" "Generate configuration for board and customer"
|
||||
@@ -1,283 +0,0 @@
|
||||
# this is a developer helper script to install firmware on a remote host with SSH
|
||||
|
||||
function upd_usage {
|
||||
echo "usage: $0 ssh_upgrade [-t <host>] [-f <file>] [opts] "
|
||||
echo ""
|
||||
echo " Default host is 192.168.1.1"
|
||||
echo " Default firmware file is the latest one (last.{itb,pkgtb})"
|
||||
echo " Default is to not keep configuration"
|
||||
echo "opts:"
|
||||
echo ""
|
||||
echo " -i Interactive use, allows to select firmware file"
|
||||
echo " -n Do not do the final reboot of the target board"
|
||||
echo " -c Keep configuration"
|
||||
echo " -x Force install even if firmware is not for this board"
|
||||
echo " -b Force install of bootloader regardless of version installed"
|
||||
}
|
||||
|
||||
function set_config_string {
|
||||
eval $(grep $1 .config)
|
||||
}
|
||||
|
||||
function upd_ask_ok {
|
||||
echo "Will continue with the following settings:"
|
||||
echo "-----------------------------------------"
|
||||
printf "%20s: %s\n" "Firmware file" "$upd_fw_base"
|
||||
printf "%20s: %s\n" "Host IP" "$upd_host"
|
||||
printf "%20s: " "Reboot"
|
||||
if [ "$upd_noreboot" == "0" ]; then printf "Yes\n"; else printf "No\n"; fi
|
||||
printf "%20s: " "Keep config"
|
||||
if [ "$upd_keepconf" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi
|
||||
printf "%20s: " "Force bootloader"
|
||||
if [ "$upd_forceboot" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi
|
||||
printf "%20s: " "Force image upgrade"
|
||||
if [ "$upd_forceimage" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi
|
||||
echo "-----------------------------------------"
|
||||
|
||||
echo -n "Continue? [Y/n/q]:"
|
||||
read answer
|
||||
|
||||
case $answer in
|
||||
n | N)
|
||||
return 1
|
||||
;;
|
||||
q | Q)
|
||||
exit 1
|
||||
;;
|
||||
y | Y | *)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select_file {
|
||||
dialog --keep-tite --title "To select a file, use TAB/ARROW to highlight then press SPACEBAR -> RETURN" \
|
||||
--fselect "${upd_fw:-bin/targets/$CONFIG_TARGET_BOARD/$CONFIG_TARGET_SUBTARGET/}" \
|
||||
$((lines - 10)) $((cols - 5)) \
|
||||
2>$tempfile
|
||||
|
||||
new_file=$(cat $tempfile)
|
||||
if [ -n "$new_file" ]; then
|
||||
upd_fw="$new_file"
|
||||
upd_fw_base=$(basename $upd_fw)
|
||||
fi
|
||||
}
|
||||
|
||||
function upd_select_target {
|
||||
dialog --keep-tite --title "Input the hostname/IP of the target board" \
|
||||
--inputbox "Name/IP" \
|
||||
$((lines - 10)) $((cols - 5)) \
|
||||
"$upd_host" \
|
||||
2>$tempfile
|
||||
|
||||
new_file=$(cat $tempfile)
|
||||
if [ -n "$new_file" ]; then
|
||||
upd_host="$new_file"
|
||||
fi
|
||||
}
|
||||
|
||||
function upd_select_reboot {
|
||||
dialog --keep-tite --radiolist "Should the board reboot after download finished" \
|
||||
$((lines - 5)) $((cols - 5)) $((lines - 5 - 5)) \
|
||||
"Reboot" "Restart board after done" $(if [ "$upd_noreboot" == "0" ]; then echo "ON"; else echo "OFF"; fi) \
|
||||
"No reboot" "Continue running old system" $(if [ "$upd_noreboot" == "1" ]; then echo "ON"; else echo "OFF"; fi) \
|
||||
2>$tempfile
|
||||
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
"No reboot")
|
||||
upd_noreboot=1
|
||||
;;
|
||||
"Reboot")
|
||||
upd_noreboot=0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select_config {
|
||||
dialog --keep-tite --radiolist "Should the configuration be kept" \
|
||||
$((lines - 5)) $((cols - 5)) $((lines - 5 - 5)) \
|
||||
"Keep" "Keep the config from old system" $(if [ "$upd_keepconf" == "1" ]; then echo "ON"; else echo "OFF"; fi) \
|
||||
"Default" "Use default config for new system" $(if [ "$upd_keepconf" == "0" ]; then echo "ON"; else echo "OFF"; fi) \
|
||||
2>$tempfile
|
||||
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
"Keep")
|
||||
upd_keepconf=1
|
||||
;;
|
||||
"Default")
|
||||
upd_keepconf=0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select_forceboot {
|
||||
dialog --keep-tite --radiolist "Should the boot loader be updated regardless of the version installed" \
|
||||
$((lines - 5)) $((cols - 5)) $((lines - 5 - 5)) \
|
||||
"Force" "Always update boot loader" $(if [ "$upd_forceboot" == "1" ]; then echo "ON"; else echo "OFF"; fi) \
|
||||
"Version check" "Only upgrade if version is newer" $(if [ "$upd_forceboot" == "0" ]; then echo "ON"; else echo "OFF"; fi) \
|
||||
2>$tempfile
|
||||
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
"Force")
|
||||
upd_forceboot=1
|
||||
;;
|
||||
"Version check")
|
||||
upd_forceboot=0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select_forceimage {
|
||||
dialog --keep-tite --radiolist "Should the image be stored in flash even if sanity checks would reject it" \
|
||||
$((lines - 5)) $((cols - 5)) $((lines - 5 - 5)) \
|
||||
"Force" "Disable sanity check and force use of image (dangerous)" $(if [ "$upd_forceimage" == "1" ]; then echo "ON"; else echo "OFF"; fi) \
|
||||
"Only compatible" "Normal checks apply" $(if [ "$upd_forceimage" == "0" ]; then echo "ON"; else echo "OFF"; fi) \
|
||||
2>$tempfile
|
||||
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
"Force")
|
||||
upd_forceimage=1
|
||||
;;
|
||||
"Only compatible")
|
||||
upd_forceimage=0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select {
|
||||
dialog --keep-tite --ok-label "Select" --cancel-label "Done" --menu "Select item to change" \
|
||||
$((lines - 5)) $((cols - 5)) $((lines - 5 - 5)) \
|
||||
"Firmware file" "$upd_fw_base" \
|
||||
"Host IP" "$upd_host" \
|
||||
"Reboot" $(if [ "$upd_noreboot" == "0" ]; then printf "Yes\n"; else printf "No\n"; fi) \
|
||||
"Keep config" $(if [ "$upd_keepconf" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi) \
|
||||
"Force bootloader" $(if [ "$upd_forceboot" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi) \
|
||||
"Force image upgrade" $(if [ "$upd_forceimage" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi) \
|
||||
2>$tempfile
|
||||
|
||||
case $(cat $tempfile) in
|
||||
"Firmware file")
|
||||
upd_select_file
|
||||
;;
|
||||
"Host IP")
|
||||
upd_select_target
|
||||
;;
|
||||
"Reboot")
|
||||
upd_select_reboot
|
||||
;;
|
||||
"Keep config")
|
||||
upd_select_config
|
||||
;;
|
||||
"Force bootloader")
|
||||
upd_select_forceboot
|
||||
;;
|
||||
"Force image upgrade")
|
||||
upd_select_forceimage
|
||||
;;
|
||||
*)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
upd_select
|
||||
}
|
||||
function upd_select_start {
|
||||
lines=$(tput lines)
|
||||
cols=$(tput cols)
|
||||
tempfile="$(mktemp)"
|
||||
trap "rm -f $tempfile" 0 1 2 5 15
|
||||
upd_select
|
||||
|
||||
}
|
||||
|
||||
function ssh_upgrade {
|
||||
upd_noreboot=0
|
||||
upd_forceboot=0
|
||||
upd_keepconf=0
|
||||
upd_forceimage=0
|
||||
upd_fw_base=""
|
||||
upd_fw=""
|
||||
upd_host="192.168.1.1"
|
||||
do_dialog=0
|
||||
|
||||
while getopts "f:hnxt:icb" opt; do
|
||||
case $opt in
|
||||
n)
|
||||
upd_noreboot=1
|
||||
;;
|
||||
x)
|
||||
upd_forceimage=1
|
||||
;;
|
||||
b)
|
||||
upd_forceboot=1
|
||||
;;
|
||||
c)
|
||||
upd_keepconf=1
|
||||
;;
|
||||
v)
|
||||
verbose=$OPTARG
|
||||
;;
|
||||
f)
|
||||
upd_fw=$OPTARG
|
||||
;;
|
||||
t)
|
||||
upd_host=$OPTARG
|
||||
;;
|
||||
i)
|
||||
do_dialog=1
|
||||
;;
|
||||
h)
|
||||
upd_usage
|
||||
exit 1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$upd_fw" ]; then
|
||||
set_config_string CONFIG_TARGET_BOARD
|
||||
set_config_string CONFIG_TARGET_SUBTARGET
|
||||
upd_fw="$(realpath -q --canonicalize-existing --relative-to=. "bin/targets/$CONFIG_TARGET_BOARD/$CONFIG_TARGET_SUBTARGET/"last.{pkgtb,itb})"
|
||||
if [ -z "$upd_fw" ] && [ $do_dialog -eq 0 ]; then
|
||||
echo "Could not find image. Check that last.{itb,pkgtb} exists or specify an image using -f <image> or -i (interactive)." >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
upd_fw_base="$(basename "$upd_fw")"
|
||||
|
||||
[ $do_dialog -eq 1 ] && upd_select_start
|
||||
|
||||
if ! upd_ask_ok; then
|
||||
upd_select_start
|
||||
if ! upd_ask_ok; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f $upd_fw ]; then
|
||||
echo "Firmware file $firmware does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
extra_args=""
|
||||
[ $upd_noreboot -eq 1 ] && extra_args="$extra_args --no-reboot"
|
||||
[ $upd_forceimage -eq 1 ] && extra_args="$extra_args --force"
|
||||
[ $upd_keepconf -eq 0 ] && extra_args="$extra_args -n"
|
||||
[ $upd_forceboot -eq 1 ] && extra_args="$extra_args --force-loader-upgrade"
|
||||
|
||||
pv "$upd_fw" |
|
||||
ssh \
|
||||
-o ConnectTimeout=60 \
|
||||
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
||||
root@"$upd_host" \
|
||||
sh -c "cat > '/tmp/$upd_fw_base' && (set -x && sysupgrade -v $extra_args /tmp/$upd_fw_base)" ||
|
||||
echo "Sysupgrade failed" >&2 && return 1
|
||||
}
|
||||
|
||||
register_command "ssh_upgrade" "-t <host> -f <file> [opts] Install firmware on remote host with SSH"
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/sh
|
||||
function license_report {
|
||||
LICDIR="/tmp/licenses-generator/"
|
||||
LICBIN="${LICDIR}/bin"
|
||||
|
||||
|
||||
dpkg -s python3 python3-requests python3-yaml python3-mako python3-six &> /dev/null
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Missing dependencies"
|
||||
sudo apt-get update
|
||||
sudo apt-get install python3 python3-requests python3-yaml python3-mako python3-six
|
||||
|
||||
else
|
||||
echo "Dependecy check passed"
|
||||
fi
|
||||
|
||||
|
||||
if [ -d "$LICDIR" ]; then
|
||||
### Take action if $DIR exists ###
|
||||
echo "Creating json licences file and html formated report"
|
||||
else
|
||||
### Control will jump here if $DIR does NOT exists ###
|
||||
echo "Error: licenses-generator not found. getting from iopsys repo"
|
||||
git clone git@dev.iopsys.eu:iopsys/licenses-generator.git $LICDIR
|
||||
fi
|
||||
LICGET=`${LICBIN}/licenses-generator gen-License bin/`
|
||||
echo $LICGET
|
||||
${LICBIN}/licenses-generator gen-licrprt $LICGET
|
||||
exit 0
|
||||
|
||||
}
|
||||
|
||||
|
||||
register_command "license_report" "Generate a Licence report on latest build in json format and html under reports"
|
||||
@@ -1,89 +0,0 @@
|
||||
|
||||
# Shorthand command for doing a HIL runtime smoketest on the
|
||||
# latest built image. Does the image boot up correctly?
|
||||
# More info here:
|
||||
# https://dev.iopsys.eu/iopsys/iopsys-taas
|
||||
|
||||
|
||||
#--------------------------------------------------------------
|
||||
function taas-init() {
|
||||
local f
|
||||
|
||||
# Path to TaaS binarys. Try some likely ones.
|
||||
if ! which taas-smoketest >/dev/null; then
|
||||
PATH="${PATH}:${PWD}/../iopsys-taas/bin"
|
||||
PATH="${PATH}:${PWD}/../taas/bin"
|
||||
PATH="${PATH}:${HOME}/iopsys-taas/bin"
|
||||
PATH="${PATH}:${HOME}/taas/bin"
|
||||
PATH="${PATH}:${HOME}/bin"
|
||||
PATH="${PATH}:/opt/iopsys-taas/bin"
|
||||
PATH="${PATH}:/opt/taas/bin"
|
||||
fi
|
||||
|
||||
if ! which taas-smoketest >/dev/null; then
|
||||
echo "Error; TaaS is missing! Install it with:"
|
||||
echo "git clone git@dev.iopsys.eu:iopsys/iopsys-taas.git ../iopsys-taas"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create a list of all images which might be of use.
|
||||
for f in ${PWD}/bin/targets/iopsys-*/generic/last.*; do
|
||||
[[ -s "$f" ]] && images+=("$f")
|
||||
done
|
||||
|
||||
# Convert Iopsys target name to the TaaS product name format
|
||||
# according to what is available in the remote lab for HIL.
|
||||
# Also find a suitable image.
|
||||
product=$(grep CONFIG_TARGET_PROFILE .config | \
|
||||
tr -s "=\"" " " | cut -d " " -f 2) || exit
|
||||
case "$product" in
|
||||
smarthub3)
|
||||
export product="SmartHub3a"
|
||||
;;
|
||||
dg400prime|eg400|ex600)
|
||||
export product=$(echo -n "$product" | tr [[:lower:]] [[:upper:]])
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported target; skipping!"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ ${#images[@]} -eq 0 ]]; then
|
||||
echo "No image found"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
#--------------------------------------------------------------
|
||||
function taas-smoketest {
|
||||
declare -a images
|
||||
|
||||
taas-init || return
|
||||
echo "Testing a $product with ${images[@]}..."
|
||||
command taas-smoketest "${images[@]}" "$product" "$@"
|
||||
}
|
||||
|
||||
|
||||
|
||||
#--------------------------------------------------------------
|
||||
function taas-bootstrap {
|
||||
declare -a images
|
||||
|
||||
if [[ -n "$1" ]]; then
|
||||
taas-init || return
|
||||
echo "Flashing $1..."
|
||||
command taas-bootstrap "${images[@]}" "$@"
|
||||
else
|
||||
echo "Usage: ./iop taas-bootstrap dutX"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
register_command "taas-bootstrap" "Write image to a remote lab device."
|
||||
register_command "taas-smoketest" "Write image to a remote lab device and test it."
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Exported interface
|
||||
function update_feed_branches {
|
||||
local release="$1"
|
||||
local ipath="$(pwd)"
|
||||
local branch="$2"
|
||||
local curbranch
|
||||
|
||||
[ -n "$release" ] || {
|
||||
echo "Usage: ./update_feeds <RELEASE> <BRANCH>"
|
||||
echo ""
|
||||
echo "If you do not give a branch as argument,"
|
||||
echo "<RELEASE> branch will be updated to commit"
|
||||
echo "hash given in feeds.conf for each feed repo"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ -n "$branch" ]; then
|
||||
echo "Updating release branch $release to specific commit hash given in feeds.conf for each feed repo at branch $branch"
|
||||
if git diff-index --quiet HEAD; then
|
||||
curbranch=`git symbolic-ref HEAD 2>/dev/null`
|
||||
curbranch=${curbranch##refs/heads/}
|
||||
if [ -z $curbranch ]; then
|
||||
curbranch=`git log -1 --pretty=format:"%H"`
|
||||
fi
|
||||
git checkout $branch || {
|
||||
echo "couldn't checkout branch $branch"
|
||||
exit 99
|
||||
}
|
||||
else
|
||||
echo "You have unsaved changes."
|
||||
exit 99
|
||||
fi
|
||||
else
|
||||
echo "Updating release branch $release to specific commit hash given in feeds.conf for each feed repo"
|
||||
fi
|
||||
|
||||
ifeeds="$(grep -r 'dev.iopsys.eu' feeds.conf | awk '{print$2}' | tr '\n' ' ')"
|
||||
|
||||
for f in $ifeeds; do
|
||||
commith=$(grep $f feeds.conf | cut -d'^' -f2)
|
||||
cd $ipath/feeds/$f
|
||||
git branch -D $release 2>/dev/null
|
||||
echo "$f: updating release branch $release to commit $commith"
|
||||
git checkout $commith
|
||||
git push origin :$release
|
||||
git checkout -b $release
|
||||
git push --set-upstream origin $release
|
||||
cd $ipath
|
||||
done
|
||||
|
||||
if [ -n "$branch" ]; then
|
||||
echo "Release branch $release is updated to specific commit hash given in feeds.conf in in branch $branch for each feed repo"
|
||||
git checkout $curbranch
|
||||
else
|
||||
echo "Release branch $release is updated to specific commit hash given in feeds.conf for each feed repo"
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "update_feed_branches" "<release> [branch] Update branches in feeds from the current top level commit or specified top level branch"
|
||||
@@ -4,7 +4,7 @@ PKG_NAME:=iopsys-analytics
|
||||
PKG_RELEASE:=$(COMMITCOUNT)
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=aea91816de703cf1c72490f51c2aa73c2f61640d
|
||||
PKG_SOURCE_VERSION:=00189cea0a78b7a30dbfdd363b6d8e836437d1bc
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/iopsys-analytics.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libdsl
|
||||
PKG_VERSION:=7.2.99
|
||||
PKG_VERSION:=7.2.100
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=f9f3fcd0f4140540db5bd41059bcca7ded083024
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libdsl.git
|
||||
PKG_SOURCE_VERSION:=20875ec79fcc7c546c2f1253c867d6afbc8bff75
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/libdsl.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -27,6 +27,8 @@ ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
CONFIG_ID=$(SUBTARGET:bcm%=BCM%)
|
||||
CHIP_ID=$(CONFIG_ID:BCM9%=%)
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_$(CONFIG_ID) \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/broadcom/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/shared/opensource/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
|
||||
else ifeq ($(CONFIG_TARGET_x86),y)
|
||||
@@ -55,12 +57,19 @@ define Package/libdsl
|
||||
SUBMENU:=IOPSYS HAL libs
|
||||
MENU:=1
|
||||
TITLE:= xDSL library (libdsl)
|
||||
DEPENDS+=TARGET_brcmbca:bcm963xx-bsp
|
||||
endef
|
||||
|
||||
define Package/libdsl/description
|
||||
Library provides xDSL/GFAST HAL APIs
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ./libdsl/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/libdsl/config
|
||||
if PACKAGE_libdsl
|
||||
config LIBDSL_DEBUG
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libethernet
|
||||
PKG_VERSION:=7.2.110
|
||||
PKG_VERSION:=7.2.111
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=d94e3029e4e9d14907fd6b283218defb4d319f5a
|
||||
PKG_SOURCE_VERSION:=6e7216e657dfb59e869e393ef58e6b4593c16fc7
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libethernet.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-broadcom
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.14
|
||||
PKG_VERSION:=1.0.15
|
||||
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:=7fde62b9634c63b9bc71d1c20541798971a78dc8
|
||||
PKG_SOURCE_VERSION:=baf5ebfb45404714bbfcc3068080f93265934d8a
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -38,7 +38,7 @@ define Package/$(PKG_NAME)
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=IOPSYS libvoice for Broadcom
|
||||
URL:=
|
||||
DEPENDS:=
|
||||
DEPENDS:=+bcm963xx-voice
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
@@ -56,4 +56,3 @@ define Package/$(PKG_NAME)/install
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-d2
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.1.12
|
||||
PKG_VERSION:=1.1.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:=772955d814af8bbf91cf5c76f128cd1d17755625
|
||||
PKG_SOURCE_VERSION:=0b2bef862fb5aea0b285e339459f46779224e2d0
|
||||
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.5.2
|
||||
PKG_VERSION:=7.7.8
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=e93fcd63354489846e5bb2450c7e8059774577d5
|
||||
PKG_SOURCE_VERSION:=b12d933e1cdd3b84eefbb45b0ecf2d1927f5d5dc
|
||||
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
|
||||
@@ -43,6 +43,9 @@ else ifeq ($(CONFIG_TARGET_airoha),y)
|
||||
TARGET_PLATFORM=ECONET
|
||||
TARGET_WIFI_TYPE=MEDIATEK MAC80211
|
||||
TARGET_CFLAGS +=-DIOPSYS_ECONET
|
||||
ifeq ($(CONFIG_TARGET_airoha_an7581),y)
|
||||
TARGET_CFLAGS +=-DCONFIG_MTK
|
||||
endif
|
||||
else ifeq ($(CONFIG_TARGET_ipq95xx),y)
|
||||
TARGET_PLATFORM=IPQ95XX
|
||||
TARGET_WIFI_TYPE=QUALCOMM MAC80211
|
||||
@@ -51,10 +54,6 @@ else ifeq ($(CONFIG_TARGET_ipq53xx),y)
|
||||
TARGET_PLATFORM=IPQ53XX
|
||||
TARGET_WIFI_TYPE=QUALCOMM MAC80211
|
||||
TARGET_CFLAGS +=-DIPQ53XX
|
||||
else ifeq ($(CONFIG_TARGET_mediatek),y)
|
||||
TARGET_PLATFORM=LINUX
|
||||
TARGET_WIFI_TYPE=MEDIATEK MAC80211
|
||||
TARGET_CFLAGS +=-DIOPSYS_LINUX
|
||||
else
|
||||
$(info Unexpected CONFIG_TARGET, use default MAC80211)
|
||||
TARGET_PLATFORM=MAC80211
|
||||
@@ -76,6 +75,10 @@ ifeq ($(CONFIG_LIBWIFI_USE_CTRL_IFACE),y)
|
||||
TARGET_CFLAGS +=-DLIBWIFI_USE_CTRL_IFACE
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBWIFI_SKIP_PROBES),y)
|
||||
TARGET_CFLAGS +=-DLIBWIFI_BRCM_SKIP_PROBES
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/openssl \
|
||||
@@ -144,6 +147,11 @@ define Package/libwifi/config
|
||||
config LIBWIFI_USE_CTRL_IFACE
|
||||
bool "Create UNIX sockets to interface with hostapd/wpa_supplicant"
|
||||
default y
|
||||
|
||||
config LIBWIFI_SKIP_PROBES
|
||||
bool "Don't create probe-req events"
|
||||
default y
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
@@ -17,10 +17,18 @@ config LOGMNGR_BACKEND_SYSLOG_NG
|
||||
Enable this option to use syslog-ng for log management.
|
||||
|
||||
endchoice
|
||||
|
||||
config LOGMNGR_LOGROTATE
|
||||
bool "Logrotate support"
|
||||
depends on PACKAGE_logmngr
|
||||
default y
|
||||
help
|
||||
It adds support for logrotate functionality.
|
||||
|
||||
config LOGMNGR_VENDOR_LOG_FILE
|
||||
bool "Enable Device.DeviceInfo.VendorLogFile. Object"
|
||||
depends on PACKAGE_logmngr
|
||||
default y
|
||||
help
|
||||
It adds support for Device.DeviceInfo.VendorLogFile. Object.
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=logmngr
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.6
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/system/logmngr.git
|
||||
PKG_SOURCE_VERSION:=ec10abb3cc0f3b96eb806c9c67e18d9d134287e9
|
||||
PKG_SOURCE_VERSION:=37f9eef6ad92ab4835893c6c8ee65338917071b6
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -27,8 +27,9 @@ define Package/logmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Logging Manager
|
||||
DEPENDS:=+libbbfdm-api +LOGMNGR_BACKEND_FLUENTBIT:fluent-bit +LOGMNGR_LOGROTATE:logrotate
|
||||
DEPENDS:=+LOGMNGR_BACKEND_FLUENTBIT:fluent-bit +LOGMNGR_LOGROTATE:logrotate
|
||||
DEPENDS+=+LOGMNGR_BACKEND_SYSLOG_NG:syslog-ng
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
endef
|
||||
|
||||
define Package/logmngr/description
|
||||
@@ -51,23 +52,26 @@ define Package/logmngr/install
|
||||
$(INSTALL_BIN) ./files/logmngr.init $(1)/etc/init.d/logmngr
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) ./files/logread $(1)/usr/sbin
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/10-logmngr_config_generate $(1)/etc/uci-defaults/
|
||||
|
||||
$(INSTALL_DIR) $(1)/lib/logmngr
|
||||
ifeq ($(CONFIG_LOGMNGR_BACKEND_FLUENTBIT),y)
|
||||
$(INSTALL_DATA) ./files/lib/logmngr/fluent-bit.sh $(1)/lib/logmngr/.
|
||||
$(INSTALL_DATA) ./files/lib/logmngr/fluent-bit.sh $(1)/lib/logmngr/
|
||||
$(INSTALL_BIN) ./files/logread $(1)/usr/sbin
|
||||
endif
|
||||
ifeq ($(CONFIG_LOGMNGR_BACKEND_SYSLOG_NG),y)
|
||||
$(INSTALL_DATA) ./files/lib/logmngr/syslog-ng.sh $(1)/lib/logmngr/.
|
||||
$(INSTALL_DATA) ./files/lib/logmngr/syslog-ng.sh $(1)/lib/logmngr/
|
||||
endif
|
||||
$(BBFDM_INSTALL_CORE_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libbbfsyslog.so $(1)
|
||||
ifeq ($(CONFIG_LOGMNGR_LOGROTATE),y)
|
||||
$(INSTALL_BIN) ./files/11-logmngr_logrotate_config_generate $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) ./files/lib/logmngr/logrotate.sh $(1)/lib/logmngr/.
|
||||
$(BBFDM_INSTALL_CORE_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libbbflogrotate.so $(1)
|
||||
$(INSTALL_DATA) ./files/lib/logmngr/logrotate.sh $(1)/lib/logmngr/
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libbbflogrotate.so $(1) sysmngr
|
||||
endif
|
||||
ifeq ($(CONFIG_LOGMNGR_VENDOR_LOG_FILE),y)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libbbfvendorlog.so $(1) sysmngr
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
@@ -20,4 +20,9 @@ uci set logmngr.lf1=log_file
|
||||
uci set logmngr.lf1.enable=1
|
||||
uci set logmngr.lf1.action="ac1"
|
||||
uci set logmngr.lf1.file="/var/log/messages"
|
||||
|
||||
uci set logmngr.lr1=log_remote
|
||||
uci set logmngr.lr1.enable=0
|
||||
uci set logmngr.lr1.action="ac1"
|
||||
uci set logmngr.lr1.port="514"
|
||||
uci commit logmngr
|
||||
|
||||
@@ -184,7 +184,9 @@ handle_log_file() {
|
||||
echo "[OUTPUT]" >> ${TMP_CONF_FILE}
|
||||
echo " name file" >> ${TMP_CONF_FILE}
|
||||
echo " match $match" >> ${TMP_CONF_FILE}
|
||||
echo " file $file" >> ${TMP_CONF_FILE}
|
||||
echo " file $file" >> ${TMP_CONF_FILE}
|
||||
echo " format template" >> ${TMP_CONF_FILE}
|
||||
echo " template {time} {hostname} {ident}: {message}" >> ${TMP_CONF_FILE}
|
||||
}
|
||||
|
||||
handle_log_remote() {
|
||||
|
||||
@@ -60,10 +60,12 @@ handle_logrotate() {
|
||||
local compression
|
||||
config_get compression $section compression
|
||||
if [ -n "$compression" ]; then
|
||||
cmd=$(echo "$compression" | awk '{print tolower($0)}')
|
||||
echo -e "\tcompress" >> ${LOGROTATE_TMP_FILE}
|
||||
echo -e "\tcompresscmd $compression" >> ${LOGROTATE_TMP_FILE}
|
||||
echo -e "\tcompresscmd $cmd" >> ${LOGROTATE_TMP_FILE}
|
||||
fi
|
||||
|
||||
echo -e "\taddextension _logrotate" >> ${LOGROTATE_TMP_FILE}
|
||||
echo -e "\tpostrotate" >> ${LOGROTATE_TMP_FILE}
|
||||
echo -e "\t\tservice logmngr restart" >> ${LOGROTATE_TMP_FILE}
|
||||
echo -e "\t\tsleep 1" >> ${LOGROTATE_TMP_FILE}
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=6.1.1.9
|
||||
PKG_VERSION:=6.2.1.11
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=8779b993dc8075aa48525340b9e86e13fa7ac54b
|
||||
PKG_SOURCE_VERSION:=8f7f2d4c873ef9da9c8403a9900621ff2bb0bfb3
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
|
||||
@@ -65,10 +65,40 @@ generate_multiap_config() {
|
||||
|
||||
device="$dev"
|
||||
|
||||
ifprefix_radio=""
|
||||
if is_airoha; then
|
||||
ifprefix="wlan%_%"
|
||||
ifname="wlan${devidx}_0"
|
||||
ifname_bh="wlan${devidx}_1"
|
||||
if [ -d "/sys/module/mt76" ]; then
|
||||
ifprefix="wlan%_%"
|
||||
ifname="wlan${devidx}_0"
|
||||
ifname_bh="wlan${devidx}_1"
|
||||
else
|
||||
ifname_sta=""
|
||||
case "$band" in
|
||||
2g)
|
||||
ifprefix="ra%"
|
||||
ifname="ra0"
|
||||
ifname_bh="ra1"
|
||||
ifname_sta="apcli0"
|
||||
;;
|
||||
5g)
|
||||
ifprefix="rai%"
|
||||
ifname="rai0"
|
||||
ifname_bh="rai1"
|
||||
ifname_sta="apclii0"
|
||||
;;
|
||||
6g)
|
||||
ifprefix="rax%"
|
||||
ifname="rax0"
|
||||
ifname_bh="rax1"
|
||||
ifname_sta="apclix0"
|
||||
;;
|
||||
esac
|
||||
ifprefix_radio="${ifprefix}"
|
||||
if [ "${network_mode}" == "extender" ]; then
|
||||
ifname="${ifname_sta}"
|
||||
fi
|
||||
fi
|
||||
|
||||
uci set wireless.$dev.channels="$channels"
|
||||
uci commit wireless
|
||||
elif is_broadcom; then
|
||||
@@ -86,12 +116,6 @@ generate_multiap_config() {
|
||||
[ "$disable_mlo" == "1" ] || {
|
||||
uci set wireless.$dev.mlo="1"
|
||||
uci set wireless.$dev.mlo_capable="1"
|
||||
|
||||
# Prevent driver crash for extender - remove it after fix
|
||||
[ "$network_mode" == "extender" -a "$mode_band" == "6" ] && {
|
||||
uci set wireless.$dev.mlo="0"
|
||||
uci set wireless.$dev.mlo_capable="0"
|
||||
}
|
||||
uci commit wireless
|
||||
|
||||
# Disable for MLD/MLO
|
||||
@@ -105,12 +129,17 @@ generate_multiap_config() {
|
||||
fi
|
||||
|
||||
if [ $generate_mapagent_config -eq 1 ]; then
|
||||
uci set mapagent.agent.ifprefix="$ifprefix"
|
||||
if [ -z "${ifprefix_radio}" ]; then
|
||||
uci set mapagent.agent.ifprefix="$ifprefix"
|
||||
fi
|
||||
uci set mapagent.agent.brcm_setup="$brcm_setup"
|
||||
uci set mapagent.agent.ap_follow_sta_dfs="$ap_follow_sta_dfs"
|
||||
uci add mapagent radio
|
||||
uci set mapagent.@radio[-1].device="$device"
|
||||
uci set mapagent.@radio[-1].band="$mode_band"
|
||||
if [ -n "${ifprefix_radio}" ]; then
|
||||
uci set mapagent.@radio[-1].ifprefix="${ifprefix}"
|
||||
fi
|
||||
|
||||
if [ "$network_mode" == "extender" ]; then
|
||||
uci add mapagent bsta
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=6.1.1.5
|
||||
PKG_VERSION:=6.1.2.7
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=cb27de727b787bdb58bc4bf42fdef8732cb78134
|
||||
PKG_SOURCE_VERSION:=3c9e5ff1dec3aa5c82e39069cd4c9da806877726
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
|
||||
@@ -27,6 +27,9 @@ config sta_steering
|
||||
option report_rcpi_threshold_2g '80'
|
||||
option report_rcpi_threshold_5g '96'
|
||||
option report_rcpi_threshold_6g '96'
|
||||
option steer_retry_int '30'
|
||||
option steer_int '180'
|
||||
option steer_disable_int '600'
|
||||
|
||||
###################
|
||||
# Default AP sections credentials will by updated
|
||||
|
||||
@@ -6,14 +6,14 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=mcastmngr
|
||||
PKG_VERSION:=1.2.3
|
||||
PKG_VERSION:=1.2.7
|
||||
|
||||
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/hal/mcastmngr.git
|
||||
PKG_SOURCE_VERSION:=117acf7a29e3a343756aab9b0ae330022892c15b
|
||||
PKG_SOURCE_VERSION:=275d7e5448333e53f8bc980344b39f7f577d4664
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -29,7 +29,8 @@ MAKE_PATH:=bbf_plugin
|
||||
define Package/mcastmngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Multicast Proxy/Snooping Manager
|
||||
DEPENDS:=+!TARGET_brcmbca:mcproxy +libuci +libubox +libubus +libblobmsg-json +libbbfdm-api
|
||||
DEPENDS:=+!TARGET_brcmbca:mcproxy +libuci +libubox +libubus +libblobmsg-json
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
endef
|
||||
|
||||
define Package/mcastmngr/description
|
||||
|
||||
@@ -39,7 +39,6 @@ config_snooping_upstream_interface() {
|
||||
local snooping_upstream_intf=""
|
||||
|
||||
json_load "$(devstatus $1)"
|
||||
logger -t "mcastconf" "$(devstatus $1)"
|
||||
itr=1
|
||||
json_select bridge-members
|
||||
|
||||
@@ -128,14 +127,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 +170,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
|
||||
|
||||
@@ -3,8 +3,42 @@
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
read_mcast_stats() {
|
||||
cat /proc/net/igmp_snooping > /tmp/igmp_stats
|
||||
readonly TEMPFILE="/tmp/snooping_stats_"$$
|
||||
|
||||
splitup_ipv6addr() {
|
||||
local inaddr="$1"
|
||||
local lowaddr=""
|
||||
local hiaddr=""
|
||||
local subaddr=""
|
||||
local outaddr=""
|
||||
|
||||
OIFS=$IFS
|
||||
IFS=":"
|
||||
for subaddr in $inaddr; do
|
||||
loaddr="$(printf "%x\n" 0x$(echo -n "$subaddr" | cut -b5-8))"
|
||||
hiaddr="$(printf "%x\n" 0x$(echo -n "$subaddr" | cut -b1-4))"
|
||||
if [ -z "$outaddr" ]; then
|
||||
outaddr="${hiaddr}:${loaddr}"
|
||||
else
|
||||
outaddr="${outaddr}:${hiaddr}:${loaddr}"
|
||||
fi
|
||||
done
|
||||
IFS=$OIFS
|
||||
|
||||
echo "$outaddr" | sed -e 's/0000/0/g' -e 's/00/0/g' -e 's/000/0/g'
|
||||
}
|
||||
|
||||
meld_files() {
|
||||
local type="$1"
|
||||
|
||||
if [ "$type" = "mld" ]; then
|
||||
cat "/proc/net/${type}_snooping" | awk -F' ' '{ print $1 " " $2 " " $3 " " $4 " " $5 " " $6 " " $7 " " $8 " NULL " $9 " " $10 " " $11 " " $12 " " $13 " " $12 }' >> "$TEMPFILE"
|
||||
else
|
||||
cat "/proc/net/${type}_snooping" >> "$TEMPFILE"
|
||||
fi
|
||||
}
|
||||
|
||||
read_snooping_file() {
|
||||
local mcast_addrs=""
|
||||
local ifaces=""
|
||||
|
||||
@@ -33,7 +67,7 @@ read_mcast_stats() {
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done < /tmp/igmp_stats
|
||||
done < "$TEMPFILE"
|
||||
|
||||
while read line; do
|
||||
# reading each line
|
||||
@@ -41,6 +75,7 @@ read_mcast_stats() {
|
||||
br-*)
|
||||
found_ip=0
|
||||
grp_ip="$(echo $line | awk -F ' ' '{ print $10 }')"
|
||||
|
||||
if [ -z "$mcast_addrs" ]; then
|
||||
mcast_addrs="$grp_ip"
|
||||
continue
|
||||
@@ -60,27 +95,13 @@ read_mcast_stats() {
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done < /tmp/igmp_stats
|
||||
done < "$TEMPFILE"
|
||||
|
||||
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
|
||||
@@ -98,7 +119,12 @@ read_mcast_stats() {
|
||||
fi
|
||||
if [ $grp_obj_added -eq 0 ]; then
|
||||
json_add_object ""
|
||||
gip="$(ipcalc.sh $gip_addr | grep IP | awk '{print substr($0,4)}')"
|
||||
if [ -n "$(echo $gip_addr | grep -oE "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$")" ]; then
|
||||
gip="$(ipcalc.sh $gip_addr | grep IP | awk '{print substr($0,4)}')"
|
||||
else
|
||||
gip_addr=$(splitup_ipv6addr "$gip_addr")
|
||||
gip="$(echo $gip_addr | grep -oE '^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$')"
|
||||
fi
|
||||
json_add_string "groupaddr" "$gip"
|
||||
json_add_array "clients"
|
||||
grp_obj_added=1
|
||||
@@ -106,7 +132,12 @@ read_mcast_stats() {
|
||||
|
||||
json_add_object ""
|
||||
host_ip="$(echo $line | awk -F ' ' '{ print $14 }')"
|
||||
h_ip="$(ipcalc.sh $host_ip | grep IP | awk '{print substr($0,4)}')"
|
||||
if [ -n "$(echo $host_ip | grep -oE "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$")" ]; then
|
||||
h_ip="$(ipcalc.sh $host_ip | grep IP | awk '{print substr($0,4)}')"
|
||||
else
|
||||
host_ip=$(splitup_ipv6addr "$host_ip")
|
||||
h_ip="$(echo $host_ip | grep -oE '^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$')"
|
||||
fi
|
||||
json_add_string "ipaddr" "$h_ip"
|
||||
src_port="$(echo $line | awk -F ' ' '{ print $2 }')"
|
||||
json_add_string "device" "$src_port"
|
||||
@@ -115,17 +146,29 @@ read_mcast_stats() {
|
||||
json_close_object #close the associated device object
|
||||
;;
|
||||
esac
|
||||
done < /tmp/igmp_stats
|
||||
json_close_array #close the associated devices array
|
||||
json_close_object # close the groups object
|
||||
done < "$TEMPFILE"
|
||||
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
|
||||
}
|
||||
|
||||
read_mcast_stats() {
|
||||
echo -n > "$TEMPFILE"
|
||||
|
||||
json_init
|
||||
json_add_array "snooping"
|
||||
meld_files "igmp"
|
||||
meld_files "mld"
|
||||
read_snooping_file
|
||||
json_close_array # close the snooping array
|
||||
json_dump
|
||||
|
||||
rm -f /tmp/igmp_stats
|
||||
rm -f "$TEMPFILE"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
@@ -135,7 +178,12 @@ case "$1" in
|
||||
call)
|
||||
case "$2" in
|
||||
stats)
|
||||
read_mcast_stats
|
||||
out="$(read_mcast_stats)"
|
||||
if [ -z "${out}" ]; then
|
||||
echo '{}'
|
||||
else
|
||||
echo "${out}"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
@@ -85,9 +85,8 @@ config_mcproxy_interfaces() {
|
||||
|
||||
echo -e "pinstance main:$str_up ==>$str_down;\n" >> $CONFFILE
|
||||
|
||||
local filter=""
|
||||
for excp in $exceptions; do
|
||||
local filter=""
|
||||
|
||||
case $excp in
|
||||
*/*)
|
||||
ip_start="$(ipcalc.sh $excp | grep IP | awk '{print substr($0,4)}')"
|
||||
@@ -98,16 +97,16 @@ config_mcproxy_interfaces() {
|
||||
filter="$filter ($excp | *)"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
for upstream in $str_up; do
|
||||
echo "pinstance main upstream $upstream in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main upstream $upstream out blacklist table{$filter };" >> $CONFFILE
|
||||
done
|
||||
for upstream in $str_up; do
|
||||
echo "pinstance main upstream $upstream in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main upstream $upstream out blacklist table{$filter };" >> $CONFFILE
|
||||
done
|
||||
|
||||
for downstream in $str_down; do
|
||||
echo "pinstance main downstream $downstream in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main downstream $downstream out blacklist table{$filter };" >> $CONFFILE
|
||||
done
|
||||
for downstream in $str_down; do
|
||||
echo "pinstance main downstream $downstream in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main downstream $downstream out blacklist table{$filter };" >> $CONFFILE
|
||||
done
|
||||
}
|
||||
|
||||
@@ -395,13 +394,15 @@ config_mcproxy() {
|
||||
disable_snooping
|
||||
if [ "$igmp_p_enable" == "1" ]; then
|
||||
config_mcproxy_instance igmp "$igmp_p_version"
|
||||
elif [ "$igmp_s_enable" == "1" ]; then
|
||||
fi
|
||||
if [ "$igmp_s_enable" == "1" ]; then
|
||||
config_snooping igmp "$igmp_s_version"
|
||||
fi
|
||||
|
||||
if [ "$mld_p_enable" == "1" ]; then
|
||||
config_mcproxy_instance mld "$mld_p_version"
|
||||
elif [ "$mld_s_enable" == "1" ]; then
|
||||
fi
|
||||
if [ "$mld_s_enable" == "1" ]; then
|
||||
config_snooping mld "$mld_s_version"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -3,12 +3,46 @@
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
read_mcast_stats() {
|
||||
local temp_igmp_file='/tmp/igmp_stats_'$$
|
||||
local snooping_stats='/tmp/igmp_snooping_stats'
|
||||
readonly TEMPFILE="/tmp/snooping_stats_"$$
|
||||
|
||||
mcast_snooping_interface() {
|
||||
local interface intf gip vid port
|
||||
|
||||
config_get interface "$1" interface
|
||||
|
||||
for intf in $interface; do
|
||||
[ -z "$(bridge mdb show dev "$intf" 2> /dev/null | grep -v -F "port ${intf} " | xargs)" ] && continue
|
||||
json_add_object ""
|
||||
json_add_string "interface" "$intf"
|
||||
json_add_array "groups"
|
||||
for gip in $(bridge mdb show dev "$intf" | grep -v -F "port ${intf} " | cut -f6 -d' ' | sort -u | xargs); do
|
||||
json_add_object ""
|
||||
json_add_string "groupaddr" "$gip"
|
||||
json_add_array "clients"
|
||||
for port in $(bridge mdb show dev "$intf" | grep -v -F "port ${intf} " | grep -F "grp ${gip} " | cut -f4 -d' ' | sort -u | xargs); do
|
||||
json_add_object ""
|
||||
json_add_string "device" "$port"
|
||||
for vid in $(bridge mdb show dev "$intf" | grep -F "port ${port} grp ${gip} " | grep -F ' vid ' | cut -f9 -d' ' | sort -u | xargs); do
|
||||
json_add_object ""
|
||||
json_add_string "vid" "$vid"
|
||||
json_close_object #close the associated vid object
|
||||
done
|
||||
json_close_object #close the associated device object
|
||||
done
|
||||
json_close_array #close the associated devices array
|
||||
json_close_object # close the groups object
|
||||
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
|
||||
}
|
||||
|
||||
meld_files() {
|
||||
local type="$1"
|
||||
local snooping_stats="/tmp/${type}_snooping_stats"
|
||||
local old_mod_time=$(date +%s 2>/dev/null -r "$snooping_stats")
|
||||
|
||||
# Sending signal to mcproxy to dump multicast data in /tmp/igmp_snooping_stats
|
||||
# Sending signal to mcproxy to dump multicast data in /tmp/${type}_snooping_stats
|
||||
local mcast_pids=$(pidof mcproxy)
|
||||
for pid in $mcast_pids
|
||||
do
|
||||
@@ -24,8 +58,11 @@ read_mcast_stats() {
|
||||
done
|
||||
fi
|
||||
|
||||
cat "$snooping_stats" > "$temp_igmp_file"
|
||||
[ ! -e "$snooping_stats" ] && return 0
|
||||
cat "$snooping_stats" >> "$TEMPFILE"
|
||||
}
|
||||
|
||||
read_snooping_file() {
|
||||
local mcast_addrs=""
|
||||
local ifaces=""
|
||||
|
||||
@@ -54,7 +91,7 @@ read_mcast_stats() {
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done < "$temp_igmp_file"
|
||||
done < "$TEMPFILE"
|
||||
|
||||
while read line; do
|
||||
# reading each line
|
||||
@@ -81,27 +118,13 @@ read_mcast_stats() {
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done < "$temp_igmp_file"
|
||||
done < "$TEMPFILE"
|
||||
|
||||
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 < "$temp_igmp_file"
|
||||
json_add_object ""
|
||||
json_add_string "interface" "$intf"
|
||||
json_add_array "groups"
|
||||
IFS=" "
|
||||
for gip_addr in $mcast_addrs; do
|
||||
grp_obj_added=0
|
||||
@@ -119,7 +142,11 @@ read_mcast_stats() {
|
||||
fi
|
||||
if [ $grp_obj_added -eq 0 ]; then
|
||||
json_add_object ""
|
||||
gip="$(ipcalc.sh $gip_addr | grep IP | awk '{print substr($0,4)}')"
|
||||
if [ -n "$(echo $gip_addr | grep -oE "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$")" ]; then
|
||||
gip="$(ipcalc.sh $gip_addr | grep IP | awk '{print substr($0,4)}')"
|
||||
else
|
||||
gip="$(echo $gip_addr | grep -oE '^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$')"
|
||||
fi
|
||||
json_add_string "groupaddr" "$gip"
|
||||
json_add_array "clients"
|
||||
grp_obj_added=1
|
||||
@@ -127,7 +154,11 @@ read_mcast_stats() {
|
||||
|
||||
json_add_object ""
|
||||
host_ip="$(echo $line | awk -F ' ' '{ print $3 }')"
|
||||
h_ip="$(ipcalc.sh $host_ip | grep IP | awk '{print substr($0,4)}')"
|
||||
if [ -n "$(echo $host_ip | grep -oE "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$")" ]; then
|
||||
h_ip="$(ipcalc.sh $host_ip | grep IP | awk '{print substr($0,4)}')"
|
||||
else
|
||||
h_ip="$(echo $host_ip | grep -oE '^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$')"
|
||||
fi
|
||||
json_add_string "ipaddr" "$h_ip"
|
||||
src_port="$(echo $line | awk -F ' ' '{ print $4 }')"
|
||||
json_add_string "device" "$src_port"
|
||||
@@ -136,17 +167,32 @@ read_mcast_stats() {
|
||||
json_close_object #close the associated device object
|
||||
;;
|
||||
esac
|
||||
done < "$temp_igmp_file"
|
||||
json_close_array #close the associated devices array
|
||||
json_close_object # close the groups object
|
||||
done < "$TEMPFILE"
|
||||
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
|
||||
}
|
||||
|
||||
read_mcast_stats() {
|
||||
echo -n > "$TEMPFILE"
|
||||
|
||||
json_init
|
||||
json_add_array "snooping"
|
||||
meld_files "igmp"
|
||||
meld_files "mld"
|
||||
read_snooping_file
|
||||
# L2 Snooping goes here
|
||||
config_load mcast
|
||||
config_foreach mcast_snooping_interface "snooping"
|
||||
json_close_array # close the snooping array
|
||||
json_dump
|
||||
|
||||
rm -f "$temp_igmp_file"
|
||||
rm -f "$TEMPFILE"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
@@ -156,7 +202,12 @@ case "$1" in
|
||||
call)
|
||||
case "$2" in
|
||||
stats)
|
||||
read_mcast_stats
|
||||
out="$(read_mcast_stats)"
|
||||
if [ -z "${out}" ]; then
|
||||
echo '{}'
|
||||
else
|
||||
echo "${out}"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
51
netmngr/Makefile
Normal file
51
netmngr/Makefile
Normal file
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# Copyright (C) 2020-2024 iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=netmngr
|
||||
PKG_VERSION:=1.0.5
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/netmngr.git
|
||||
PKG_SOURCE_VERSION:=4d778a577c761e5839cd6b6ade35bcc5c4588b10
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/netmngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Network Data Model Support
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
endef
|
||||
|
||||
define Package/netmngr/description
|
||||
Package to add Network data model support.
|
||||
endef
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
|
||||
|
||||
define Package/netmngr/install
|
||||
$(BBFDM_INSTALL_MS_DM) -u Network $(PKG_BUILD_DIR)/src/libnetmngr.so $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_CORE_PLUGIN) $(PKG_BUILD_DIR)/src/libinterface_stack.so $(1)
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) ~/git/netmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,netmngr))
|
||||
109
netmode/README.md
Normal file
109
netmode/README.md
Normal file
@@ -0,0 +1,109 @@
|
||||
# Creating Custom Netmodes in IOWRT
|
||||
|
||||
This guide provides developers with detailed instructions on how to create and manage custom network modes (netmodes) in IOWRT. The `netmode` script allows for flexible network configuration, and developers can define their own modes by structuring the necessary files and scripts within the `/etc/netmodes/` directory.
|
||||
|
||||
## Table of Contents
|
||||
1. [Overview of Netmodes](#overview-of-netmodes)
|
||||
2. [Directory Structure](#directory-structure)
|
||||
3. [Creating a Custom Netmode](#creating-a-custom-netmode)
|
||||
- [Step 1: Pre-Execution Scripts](#step-1-pre-execution-scripts)
|
||||
- [Step 2: UCI Configuration Files](#step-2-uci-configuration-files)
|
||||
- [Step 3: Custom Execution Scripts](#step-3-custom-execution-scripts)
|
||||
- [Step 4: Post-Execution Scripts](#step-4-post-execution-scripts)
|
||||
4. [Enabling and Switching Netmodes](#enabling-and-switching-netmodes)
|
||||
|
||||
## Overview of Netmodes
|
||||
|
||||
Netmodes in IOWRT provide a way to switch between different network configurations based on the needs of the environment. Developers can create custom netmodes by organizing scripts and configuration files in specific directories under `/etc/netmodes/<NETMODE_NAME>`.
|
||||
|
||||
## Directory Structure
|
||||
|
||||
A custom netmode is defined within the `/etc/netmodes/<NETMODE_NAME>` directory, which should contain the following subdirectories:
|
||||
|
||||
- **/lib/netmode/pre/**: Generic scripts executed before the netmode-specific configurations are applied.
|
||||
- **/etc/netmodes/<NETMODE_NAME>/uci/**: Contains UCI configuration files that will be copied to `/etc/config/` during the application of the netmode.
|
||||
- **/etc/netmodes/<NETMODE_NAME>/scripts/**: Custom scripts specific to the netmode that are executed after the UCI configurations are applied.
|
||||
- **/lib/netmode/post/**: Generic scripts executed after the netmode-specific configurations are completed.
|
||||
|
||||
## Creating a Custom Netmode
|
||||
|
||||
To create a new netmode, follow these steps:
|
||||
|
||||
### Step 1: Pre-Execution Scripts
|
||||
|
||||
Scripts located in `/lib/netmode/pre/` are executed before any mode-specific actions. These are typically used for preparing the system or cleaning up configurations from the previous netmode.
|
||||
|
||||
- **Create Pre-Execution Scripts**:
|
||||
- Place your generic pre-execution scripts in `/lib/netmode/pre/`.
|
||||
- Example script (`/lib/netmode/pre/cleanup.sh`):
|
||||
```bash
|
||||
#!/bin/sh
|
||||
echo "Cleaning up old network configurations..."
|
||||
# Add commands here
|
||||
```
|
||||
|
||||
### Step 2: UCI Configuration Files
|
||||
|
||||
The UCI configuration files stored in `/etc/netmodes/<NETMODE_NAME>/uci/` will be copied to `/etc/config/`, effectively applying the desired network configuration.
|
||||
|
||||
- **Place UCI Config Files**:
|
||||
- Create UCI configuration files under `/etc/netmodes/<NETMODE_NAME>/uci/`.
|
||||
- Example (`/etc/netmodes/bridge/uci/network`):
|
||||
````bash
|
||||
config device 'br_lan'
|
||||
option name 'br-lan'
|
||||
option type 'bridge'
|
||||
option multicast_to_unicast '0'
|
||||
option bridge_empty '1'
|
||||
list ports 'eth1'
|
||||
list ports 'eth3'
|
||||
list ports 'eth4'
|
||||
|
||||
config interface 'lan'
|
||||
option proto 'dhcp'
|
||||
option device 'br-lan'
|
||||
option force_link '1'
|
||||
option reqopts '43 125'
|
||||
````
|
||||
|
||||
### Step 3: Custom Execution Scripts
|
||||
|
||||
After the UCI files are applied, any scripts in `/etc/netmodes/<NETMODE_NAME>/scripts/` are executed. These can be used to perform additional configuration tasks that are specific to the netmode.
|
||||
|
||||
- **Create Custom Scripts**:
|
||||
- Add scripts to `/etc/netmodes/<NETMODE_NAME>/scripts/`.
|
||||
- Example (`/etc/netmodes/bridge/scripts/setup_bridge.sh`):
|
||||
```bash
|
||||
#!/bin/sh
|
||||
echo "Setting up bridge mode..."
|
||||
# Additional configuration commands here
|
||||
```
|
||||
|
||||
### Step 4: Post-Execution Scripts
|
||||
|
||||
Finally, the generic scripts in `/lib/netmode/post/` are executed. These scripts typically finalize the setup or perform any necessary cleanups.
|
||||
|
||||
- **Create Post-Execution Scripts**:
|
||||
- Place scripts in `/lib/netmode/post/`.
|
||||
- Example script (`/lib/netmode/post/restart_services.sh`):
|
||||
```bash
|
||||
#!/bin/sh
|
||||
echo "Restarting network services..."
|
||||
# Add commands here
|
||||
```
|
||||
|
||||
## Enabling and Switching Netmodes
|
||||
|
||||
The netmode mechanism can be enabled or disabled via the UCI configuration, and you can switch between netmodes using UCI commands.
|
||||
|
||||
- **Enable Netmode**:
|
||||
```bash
|
||||
uci set netmode.global.enabled=1
|
||||
uci commit netmode
|
||||
```
|
||||
|
||||
- **Switch Netmode**:
|
||||
```bash
|
||||
uci set netmode.global.mode='<NETMODE_NAME>'
|
||||
uci commit netmode
|
||||
```
|
||||
@@ -1,4 +1,3 @@
|
||||
if PACKAGE_obuspa
|
||||
config OBUSPA_MTP_ENABLE_MQTT
|
||||
bool "Enable MQTT as mtp protocol"
|
||||
default y
|
||||
@@ -56,4 +55,3 @@ config OBUSPA_SESSION_EXTENSION
|
||||
Adds Device.LocalAgent.X_IOPSYS_EU_Session. object to simulate
|
||||
a CWMP like session
|
||||
|
||||
endif
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=8.0.5.4
|
||||
PKG_VERSION:=9.0.0.14
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
|
||||
PKG_SOURCE_VERSION:=eb7bddb8c0bd00b7e5d33daa9d51725309ac50b9
|
||||
PKG_SOURCE_VERSION:=00a9001bff19e074d4896b59e8839aab9f6f961e
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -34,7 +34,8 @@ define Package/obuspa
|
||||
MENU:=1
|
||||
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
|
||||
+OBUSPA_ENABLE_TEST_CONTROLLER:mosquitto-auth-shadow +libjson-c
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
endef
|
||||
|
||||
define Package/obuspa/description
|
||||
@@ -114,20 +115,19 @@ define Package/obuspa/install
|
||||
$(INSTALL_DIR) $(1)/etc/users/roles
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspa $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/obuspa $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/config/obuspa $(1)/etc/config/
|
||||
$(INSTALL_DATA) ./files/etc/users/roles/*.json $(1)/etc/users/roles/
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/usp_utils.sh $(1)/etc/obuspa/
|
||||
echo "$(CONFIG_BBF_VENDOR_PREFIX)" > $(1)/etc/obuspa/vendor_prefix
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/dmcaching_exclude.json $(1)/etc/obuspa/dmcaching_exclude.json
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-upgrade-uci $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/60-generate-ctrust-defaults $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/obuspa-set-dhcp-option $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/92-obuspa_firewall $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/firewall.usp $(1)/etc/
|
||||
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user
|
||||
$(INSTALL_BIN) ./files/obuspa.hotplug $(1)/etc/hotplug.d/iface/21-obuspa
|
||||
$(BBFDM_INSTALL_CORE_PLUGIN) ./files/etc/bbfdm/json/USPAgent.json $(1)
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/libuspagentdm.so $(1) $(PKG_NAME)
|
||||
ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER),y)
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/54-test-usp-remote $(1)/etc/uci-defaults/
|
||||
endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,9 @@ config obuspa 'global'
|
||||
option log_level '2'
|
||||
option prototrace '0'
|
||||
option db_file '/etc/obuspa/usp.db'
|
||||
option dm_caching_exclude '/etc/obuspa/dmcaching_exclude.json'
|
||||
#option max_group_sep '2'
|
||||
#option ipc_timeout '30'
|
||||
#option max_cache_time '600'
|
||||
#option trust_cert '/etc/obuspa/ca.pem'
|
||||
#option client_cert '/etc/obuspa/client.pem'
|
||||
#option log_dest '/tmp/obuspa.log'
|
||||
|
||||
16
obuspa/files/etc/firewall.usp
Normal file
16
obuspa/files/etc/firewall.usp
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
log() {
|
||||
echo "$*"|logger -t obuspa.firewall -p debug
|
||||
}
|
||||
|
||||
config_load obuspa
|
||||
config_get_bool enable_obuspa global enabled 1
|
||||
|
||||
if [ "$enable_obuspa" = "0" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
log "Sending WakeUp! event to re-connect after firewall restart"
|
||||
obuspa -c event "Device.LocalAgent.WakeUp!"
|
||||
@@ -40,7 +40,7 @@ db_set_reset_file()
|
||||
shift
|
||||
value="$*"
|
||||
|
||||
if [ -n "${param}" ] && [ -n "${value}" ]; then
|
||||
if [ -n "${param}" ]; then
|
||||
echo "${param} \"${value}\"">>${RESET_FILE}
|
||||
else
|
||||
echo >>${RESET_FILE}
|
||||
@@ -352,9 +352,9 @@ configure_controller()
|
||||
db_set "${BASEPATH}.PeriodicNotifInterval" "${PeriodicNotifInterval}"
|
||||
fi
|
||||
|
||||
#if [ -n "${SessionMode}" ]; then
|
||||
# db_set "${BASEPATH}.E2ESession.SessionMode" "${SessionMode}"
|
||||
#fi
|
||||
if [ -n "${SessionMode}" ]; then
|
||||
db_set "${BASEPATH}.E2ESession.SessionMode" "${SessionMode}"
|
||||
fi
|
||||
|
||||
if [ -n "${assigned_role_name}" ]; then
|
||||
AssignedRole=$(get_role_index "${assigned_role_name}")
|
||||
@@ -368,9 +368,21 @@ configure_controller()
|
||||
db_set "${BASEPATH}.MTP.1.Protocol" "${Protocol}"
|
||||
# only support configuration of one mtp path per controller using uci
|
||||
if [ "${Protocol}" = "MQTT" ]; then
|
||||
# Cleanup
|
||||
db_set "${BASEPATH}.MTP.1.WebSocket.Host" ""
|
||||
db_set "${BASEPATH}.MTP.1.WebSocket.Path" ""
|
||||
db_set "${BASEPATH}.MTP.1.STOMP.Reference" ""
|
||||
db_set "${BASEPATH}.MTP.1.STOMP.Destination" ""
|
||||
|
||||
db_set "${BASEPATH}.MTP.1.MQTT.Reference" "${dm_ref}"
|
||||
db_set "${BASEPATH}.MTP.1.MQTT.Topic" "${Topic}"
|
||||
elif [ "${Protocol}" = "STOMP" ]; then
|
||||
# Cleanup
|
||||
db_set "${BASEPATH}.MTP.1.WebSocket.Host" ""
|
||||
db_set "${BASEPATH}.MTP.1.WebSocket.Path" ""
|
||||
db_set "${BASEPATH}.MTP.1.MQTT.Reference" ""
|
||||
db_set "${BASEPATH}.MTP.1.MQTT.Topic" ""
|
||||
|
||||
db_set "${BASEPATH}.MTP.1.STOMP.Reference" "${dm_ref}"
|
||||
db_set "${BASEPATH}.MTP.1.STOMP.Destination" "${Destination}"
|
||||
elif [ "${Protocol}" = "CoAP" ]; then
|
||||
@@ -379,6 +391,12 @@ configure_controller()
|
||||
db_set "${BASEPATH}.MTP.1.CoAP.Port" "${Port}"
|
||||
db_set "${BASEPATH}.MTP.1.CoAP.EnableEncryption" "${EnableEncryption}"
|
||||
elif [ "${Protocol}" = "WebSocket" ]; then
|
||||
# Cleanup
|
||||
db_set "${BASEPATH}.MTP.1.STOMP.Reference" ""
|
||||
db_set "${BASEPATH}.MTP.1.STOMP.Destination" ""
|
||||
db_set "${BASEPATH}.MTP.1.MQTT.Reference" ""
|
||||
db_set "${BASEPATH}.MTP.1.MQTT.Topic" ""
|
||||
|
||||
db_set "${BASEPATH}.MTP.1.WebSocket.Host" "${Host}"
|
||||
db_set "${BASEPATH}.MTP.1.WebSocket.Port" "${Port}"
|
||||
db_set "${BASEPATH}.MTP.1.WebSocket.Path" "${Path}"
|
||||
@@ -509,18 +527,34 @@ configure_mtp() {
|
||||
db_set "${BASEPATH}.Enable" "${Enable}"
|
||||
db_set "${BASEPATH}.Protocol" "${Protocol}"
|
||||
if [ "${Protocol}" = "MQTT" ]; then
|
||||
# cleanup
|
||||
db_set "${BASEPATH}.WebSocket.Path" ""
|
||||
db_set "${BASEPATH}.STOMP.Reference" ""
|
||||
db_set "${BASEPATH}.STOMP.Destination" ""
|
||||
|
||||
db_set "${BASEPATH}.MQTT.Reference" "${dm_ref}"
|
||||
db_set "${BASEPATH}.MQTT.ResponseTopicConfigured" "${ResponseTopicConfigured}"
|
||||
if [ -n "${PublishQoS}" ]; then
|
||||
db_set "${BASEPATH}.MQTT.PublishQoS" "${PublishQoS}"
|
||||
fi
|
||||
elif [ "${Protocol}" = "STOMP" ]; then
|
||||
# cleanup
|
||||
db_set "${BASEPATH}.WebSocket.Path" ""
|
||||
db_set "${BASEPATH}.MQTT.Reference" ""
|
||||
db_set "${BASEPATH}.MQTT.ResponseTopicConfigured" ""
|
||||
|
||||
db_set "${BASEPATH}.STOMP.Reference" "${dm_ref}"
|
||||
db_set "${BASEPATH}.STOMP.Destination" "${Destination}"
|
||||
elif [ "${Protocol}" = "CoAP" ]; then
|
||||
db_set "${BASEPATH}.CoAP.Path" "${Path}"
|
||||
db_set "${BASEPATH}.CoAP.Port" "${Port}"
|
||||
elif [ "${Protocol}" = "WebSocket" ]; then
|
||||
# cleanup
|
||||
db_set "${BASEPATH}.MQTT.Reference" ""
|
||||
db_set "${BASEPATH}.MQTT.ResponseTopicConfigured" ""
|
||||
db_set "${BASEPATH}.STOMP.Reference" ""
|
||||
db_set "${BASEPATH}.STOMP.Destination" ""
|
||||
|
||||
db_set "${BASEPATH}.WebSocket.Path" "${Path}"
|
||||
db_set "${BASEPATH}.WebSocket.Port" "${Port}"
|
||||
db_set "${BASEPATH}.WebSocket.EnableEncryption" "${EnableEncryption}"
|
||||
@@ -879,6 +913,18 @@ check_n_delete_db()
|
||||
delete_sql_db_entry_with_pattern "${path}"
|
||||
}
|
||||
|
||||
workaround_remove_download_pattern()
|
||||
{
|
||||
local inst
|
||||
|
||||
inst="$(cat ${DB_DUMP} |grep -E "Device.DeviceInfo.FirmwareImage.\d.Download()"|grep -oE "Device.LocalAgent.Request.\d.")"
|
||||
|
||||
if [ -n "${inst}" ]; then
|
||||
log "Workaround to remove the old download Request [$inst]"
|
||||
delete_sql_db_entry_with_pattern "${inst}"
|
||||
fi
|
||||
}
|
||||
|
||||
reverse_update_db_with_uci()
|
||||
{
|
||||
if [ ! -f "${DB_DUMP}" ]; then
|
||||
@@ -965,6 +1011,7 @@ db_init()
|
||||
|
||||
cp /etc/config/obuspa /tmp/obuspa/
|
||||
if [ -f "${DB_DUMP}" ]; then
|
||||
workaround_remove_download_pattern
|
||||
mv ${DB_DUMP} ${RESET_FILE}
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"dmcaching_exclude": [
|
||||
"Device.Hosts.Host.",
|
||||
"Device.IEEE1905.",
|
||||
"Device.WiFi.DataElements."
|
||||
]
|
||||
}
|
||||
12
obuspa/files/etc/uci-defaults/92-obuspa_firewall
Normal file
12
obuspa/files/etc/uci-defaults/92-obuspa_firewall
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOT
|
||||
delete firewall.usp
|
||||
set firewall.usp=include
|
||||
set firewall.usp.path=/etc/firewall.usp
|
||||
set firewall.usp.reload=1
|
||||
commit firewall
|
||||
EOT
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
get_access_role() {
|
||||
local mode lan_proto
|
||||
|
||||
lan_proto="$(uci -q get network.lan.proto)"
|
||||
|
||||
if [ "${lan_proto}" == "dhcp" ]; then
|
||||
mode="extender"
|
||||
else
|
||||
mode="full_access"
|
||||
fi
|
||||
|
||||
echo "$mode"
|
||||
}
|
||||
|
||||
config_load obuspa
|
||||
config_get_bool enable_obuspa global enabled 1
|
||||
config_get intf global interface
|
||||
|
||||
if [ "$enable_obuspa" = "0" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ -z "${intf}" ]; then
|
||||
role="$(get_access_role)"
|
||||
|
||||
if [ "${role}" = "extender" ]; then
|
||||
intf="lan"
|
||||
else
|
||||
intf="wan"
|
||||
fi
|
||||
fi
|
||||
|
||||
[ "$ACTION" = "ifup" -a "${intf}" = "${INTERFACE}" ] && {
|
||||
sleep 1
|
||||
obuspa -c event Device.LocalAgent.WakeUp!
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
--- a/src/core/device.h
|
||||
+++ b/src/core/device.h
|
||||
@@ -336,6 +336,10 @@ void DEVICE_CONTROLLER_SetInheritedRole(
|
||||
Index: obuspa-9.0.0.13/src/core/device.h
|
||||
===================================================================
|
||||
--- obuspa-9.0.0.13.orig/src/core/device.h
|
||||
+++ obuspa-9.0.0.13/src/core/device.h
|
||||
@@ -338,6 +338,10 @@ void DEVICE_CONTROLLER_SetInheritedRole(
|
||||
int DEVICE_CONTROLLER_CountEnabledWebsockClientConnections(void);
|
||||
#endif
|
||||
|
||||
@@ -11,8 +13,10 @@
|
||||
#ifndef REMOVE_USP_BROKER
|
||||
int DEVICE_SUBSCRIPTION_RouteNotification(Usp__Msg *usp, int instance);
|
||||
bool DEVICE_SUBSCRIPTION_MarkVendorLayerSubs(int broker_instance, subs_notify_t notify_type, char *path, int group_id);
|
||||
--- a/src/core/device_controller.c
|
||||
+++ b/src/core/device_controller.c
|
||||
Index: obuspa-9.0.0.13/src/core/device_controller.c
|
||||
===================================================================
|
||||
--- obuspa-9.0.0.13.orig/src/core/device_controller.c
|
||||
+++ obuspa-9.0.0.13/src/core/device_controller.c
|
||||
@@ -967,6 +967,78 @@ int DEVICE_CONTROLLER_QueueBinaryMessage
|
||||
return USP_ERR_OK;
|
||||
}
|
||||
@@ -92,8 +96,10 @@
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** DEVICE_CONTROLLER_IsMTPConfigured
|
||||
--- a/src/core/msg_handler.c
|
||||
+++ b/src/core/msg_handler.c
|
||||
Index: obuspa-9.0.0.13/src/core/msg_handler.c
|
||||
===================================================================
|
||||
--- obuspa-9.0.0.13.orig/src/core/msg_handler.c
|
||||
+++ obuspa-9.0.0.13/src/core/msg_handler.c
|
||||
@@ -1210,6 +1210,15 @@ int ValidateUspRecord(UspRecord__Record
|
||||
usp_service_instance = USP_BROKER_GetUspServiceInstance(rec->from_id, 0);
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
--- a/src/core/mqtt.c
|
||||
+++ b/src/core/mqtt.c
|
||||
@@ -241,6 +241,8 @@ void AddConnackSubscription(mqtt_client_
|
||||
Index: obuspa-9.0.0.13/src/core/mqtt.c
|
||||
===================================================================
|
||||
--- obuspa-9.0.0.13.orig/src/core/mqtt.c
|
||||
+++ obuspa-9.0.0.13/src/core/mqtt.c
|
||||
@@ -256,6 +256,8 @@ void MqttSubscriptionDestroy(mqtt_subscr
|
||||
#define DEFINE_MQTT_TrustCertVerifyCallbackIndex(index) \
|
||||
int MQTT_TrustCertVerifyCallback_##index (int preverify_ok, X509_STORE_CTX *x509_ctx) \
|
||||
{\
|
||||
@@ -9,7 +11,7 @@
|
||||
return DEVICE_SECURITY_TrustCertVerifyCallbackWithCertChain(preverify_ok, x509_ctx, &mqtt_clients[index].cert_chain);\
|
||||
}
|
||||
|
||||
@@ -251,6 +253,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex
|
||||
@@ -266,6 +268,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(2);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(3);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(4);
|
||||
@@ -21,7 +23,7 @@
|
||||
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@@ -261,10 +268,15 @@ ssl_verify_callback_t* mqtt_verify_callb
|
||||
@@ -276,10 +283,15 @@ ssl_verify_callback_t* mqtt_verify_callb
|
||||
MQTT_TrustCertVerifyCallbackIndex(2),
|
||||
MQTT_TrustCertVerifyCallbackIndex(3),
|
||||
MQTT_TrustCertVerifyCallbackIndex(4),
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
--- a/src/core/mqtt.c
|
||||
+++ b/src/core/mqtt.c
|
||||
@@ -63,6 +63,8 @@
|
||||
#include "retry_wait.h"
|
||||
#include "text_utils.h"
|
||||
#include "msg_handler.h"
|
||||
+#include "data_model.h"
|
||||
+#include "usp_api.h"
|
||||
|
||||
// Defines for MQTT Property Values
|
||||
#define PUBLISH 0x30
|
||||
@@ -2613,6 +2615,37 @@ exit:
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
+** handle_db_set_client_id
|
||||
+**
|
||||
+** Allows the caller to set client Id in DB from the data model thread
|
||||
+**
|
||||
+** \param arg1 - pointer to the client id path
|
||||
+** \param arg2 - pointer to the client id value
|
||||
+**
|
||||
+** \return None
|
||||
+**
|
||||
+**************************************************************************/
|
||||
+void handle_db_set_client_id(void *arg1, void *arg2)
|
||||
+{
|
||||
+ if ((arg1 == NULL) || (arg2 == NULL)) {
|
||||
+ USP_SAFE_FREE(arg1);
|
||||
+ USP_SAFE_FREE(arg2);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ char *param_path = (char *)arg1;
|
||||
+ char *param_val = (char *)arg2;
|
||||
+
|
||||
+ if (USP_ERR_OK != DATA_MODEL_SetParameterInDatabase(param_path, param_val)) {
|
||||
+ USP_LOG_Debug("%s: Failed to set %s=>%s from CONNACK", __FUNCTION__, param_path, param_val);
|
||||
+ }
|
||||
+
|
||||
+ USP_SAFE_FREE(param_path);
|
||||
+ USP_SAFE_FREE(param_val);
|
||||
+}
|
||||
+
|
||||
+/*********************************************************************//**
|
||||
+**
|
||||
** ConnectV5Callback
|
||||
**
|
||||
** Called by Libmosquitto when the CONNACK packet is received on an MQTTv5 connection
|
||||
@@ -2685,10 +2718,28 @@ void ConnectV5Callback(struct mosquitto
|
||||
&client_id_ptr, false /* skip first */) != NULL)
|
||||
{
|
||||
USP_LOG_Debug("%s: Received client_id: \"%s\"", __FUNCTION__, client_id_ptr);
|
||||
- USP_SAFE_FREE(client->conn_params.client_id);
|
||||
- client->conn_params.client_id = USP_STRDUP(client_id_ptr);
|
||||
- USP_SAFE_FREE(client->next_params.client_id);
|
||||
- client->next_params.client_id = USP_STRDUP(client_id_ptr);
|
||||
+
|
||||
+ if (client->conn_params.client_id == NULL || strcmp(client->conn_params.client_id, client_id_ptr) != 0) {
|
||||
+ USP_SAFE_FREE(client->conn_params.client_id);
|
||||
+ client->conn_params.client_id = USP_STRDUP(client_id_ptr);
|
||||
+ USP_SAFE_FREE(client->next_params.client_id);
|
||||
+ client->next_params.client_id = USP_STRDUP(client_id_ptr);
|
||||
+
|
||||
+ // Persist client id from CONNACK in DB
|
||||
+ char buf[128] = {0}, *param_path = NULL, *param_val = NULL;
|
||||
+
|
||||
+ snprintf(buf, 128, "Device.MQTT.Client.%d.ClientID", instance);
|
||||
+
|
||||
+ param_path = USP_STRDUP(buf);
|
||||
+ param_val = USP_STRDUP(client_id_ptr);
|
||||
+
|
||||
+ if (USP_ERR_OK != USP_PROCESS_DoWork(handle_db_set_client_id, param_path, param_val)) {
|
||||
+ USP_LOG_Debug("%s: Failed to schedule set in data model thread for client id from CONNACK", __FUNCTION__);
|
||||
+ USP_SAFE_FREE(param_path);
|
||||
+ USP_SAFE_FREE(param_val);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
free(client_id_ptr);
|
||||
}
|
||||
|
||||
32
obuspa/patches/0021-fix_e2e_session_init.patch
Normal file
32
obuspa/patches/0021-fix_e2e_session_init.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
--- a/src/core/device_controller.c 2024-08-23 18:22:55.378560809 +0530
|
||||
+++ b/src/core/device_controller.c 2024-08-23 19:09:07.130278193 +0530
|
||||
@@ -4282,6 +4282,14 @@
|
||||
goto exit;
|
||||
}
|
||||
|
||||
+#if defined(E2ESESSION_EXPERIMENTAL_USP_V_1_2)
|
||||
+ err = ProcessControllerE2ESessionAdded(cont);
|
||||
+ if (err != USP_ERR_OK)
|
||||
+ {
|
||||
+ goto exit;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
// Exit if unable to get the object instance numbers present in this controller's MTP table
|
||||
USP_SNPRINTF(path, sizeof(path), "%s.%d.MTP", device_cont_root, cont_instance);
|
||||
err = DATA_MODEL_GetInstances(path, &iv);
|
||||
@@ -4323,14 +4331,6 @@
|
||||
DEVICE_MQTT_UpdateControllerTopics();
|
||||
#endif
|
||||
|
||||
-#if defined(E2ESESSION_EXPERIMENTAL_USP_V_1_2)
|
||||
- err = ProcessControllerE2ESessionAdded(cont);
|
||||
- if (err != USP_ERR_OK)
|
||||
- {
|
||||
- goto exit;
|
||||
- }
|
||||
-#endif
|
||||
-
|
||||
// If the code gets here, then we successfully retrieved all data about the controller (even if some of the MTPs were not added)
|
||||
err = USP_ERR_OK;
|
||||
|
||||
60
obuspa/patches/0022-use-datamodel-caching.patch
Normal file
60
obuspa/patches/0022-use-datamodel-caching.patch
Normal file
@@ -0,0 +1,60 @@
|
||||
diff --git a/src/core/cli_server.c b/src/core/cli_server.c
|
||||
index d45555a..016c0b7 100644
|
||||
--- a/src/core/cli_server.c
|
||||
+++ b/src/core/cli_server.c
|
||||
@@ -753,6 +753,15 @@ int ExecuteCli_Get(char *arg1, char *arg2, char *usage)
|
||||
}
|
||||
#endif
|
||||
|
||||
+ char *path[2] = {0};
|
||||
+
|
||||
+ path[0] = arg1;
|
||||
+ if (arg1 == NULL) {
|
||||
+ vendor_create_dm_cache(path, 0);
|
||||
+ } else {
|
||||
+ vendor_create_dm_cache(path, 1);
|
||||
+ }
|
||||
+
|
||||
// Exit if unable to get a list of all parameters referenced by the expression
|
||||
STR_VECTOR_Init(¶ms);
|
||||
INT_VECTOR_Init(&group_ids);
|
||||
diff --git a/src/core/data_model.h b/src/core/data_model.h
|
||||
index b9dc686..0767d02 100755
|
||||
--- a/src/core/data_model.h
|
||||
+++ b/src/core/data_model.h
|
||||
@@ -371,5 +371,6 @@ bool DM_PRIV_IsChildOf(char *path, dm_node_t *parent_node);
|
||||
bool DM_PRIV_IsChildNodeOf(dm_node_t *node, dm_node_t *parent_node);
|
||||
bool DM_PRIV_AreAllChildrenGroupId(dm_node_t *parent, int group_id);
|
||||
|
||||
+int vendor_create_dm_cache(char *paths[], int num_paths);
|
||||
#endif
|
||||
|
||||
diff --git a/src/core/device_subscription.c b/src/core/device_subscription.c
|
||||
index a35c0d5..fb2fdcd 100644
|
||||
--- a/src/core/device_subscription.c
|
||||
+++ b/src/core/device_subscription.c
|
||||
@@ -72,10 +72,10 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Uncomment the following define to turn on extra debug which helps with debugging issues related to object
|
||||
// creation/deletion notifications not being sent
|
||||
-//#define DEBUG_OBJECT_NOTIFICATIONS
|
||||
+#define DEBUG_OBJECT_NOTIFICATIONS
|
||||
|
||||
#ifdef DEBUG_OBJECT_NOTIFICATIONS
|
||||
-#define USP_LOG_DebugNotifications(...) USP_LOG_Info(__VA_ARGS__)
|
||||
+#define USP_LOG_DebugNotifications(...) USP_LOG_Debug(__VA_ARGS__)
|
||||
#else
|
||||
#define USP_LOG_DebugNotifications(...)
|
||||
#endif
|
||||
diff --git a/src/core/handle_get.c b/src/core/handle_get.c
|
||||
index 170d27d..e4edfab 100644
|
||||
--- a/src/core/handle_get.c
|
||||
+++ b/src/core/handle_get.c
|
||||
@@ -123,6 +123,7 @@ void MSG_HANDLER_HandleGet(Usp__Msg *usp, char *controller_endpoint, mtp_conn_t
|
||||
goto exit;
|
||||
}
|
||||
|
||||
+ vendor_create_dm_cache(path_exprs, num_path_expr);
|
||||
// Calculate the number of hierarchical levels to traverse in the data model when performing partial path resolution
|
||||
// NOTE: protocol buffer has depth as an unsigned quantity, but internally we use a signed number, so limit range to that of a signed number
|
||||
depth = usp->body->request->get->max_depth;
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspc
|
||||
PKG_VERSION:=1.0.1.7
|
||||
PKG_VERSION:=1.0.1.8
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa-test-controller.git
|
||||
PKG_SOURCE_VERSION:=61f14c5a1fba8c251cf1cfb18c163eab62d5674d
|
||||
PKG_SOURCE_VERSION:=1cf32fa4cb5c07906b1e061a394cf0413a6ad750
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
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:=packet-capture-diagnostics
|
||||
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/bbf/packet-capture-diagnostics.git
|
||||
PKG_SOURCE_VERSION:=6c64e11d78b3be9990714bf5fcd97752cc15c4a8
|
||||
PKG_SOURCE_VERSION:=d1115ed0c129614192b9c4e68e7b81b52e08ea4f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -27,7 +27,8 @@ define Package/packet-capture-diagnostics
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=PacketCaptureDiagnostics datamodel
|
||||
DEPENDS:=+libbbfdm-api +tcpdump
|
||||
DEPENDS:=+tcpdump
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=periodicstats
|
||||
PKG_VERSION:=1.5.12
|
||||
PKG_VERSION:=1.5.13
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/periodicstats.git
|
||||
PKG_SOURCE_VERSION:=e59f980306e9ef4c1e3e56839906b8c5cba18338
|
||||
PKG_SOURCE_VERSION:=72974d0e22a64b2cec51857c3f17dc239fec079f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -26,7 +26,8 @@ define Package/periodicstats
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Periodic Statistics Daemon
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
endef
|
||||
|
||||
define Package/periodicstats/description
|
||||
|
||||
@@ -26,7 +26,8 @@ define Package/port-trigger
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Port Trigger Daemon
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +kmod-ipt-trigger +kmod-ip6t-trigger +iptables-mod-nfqueue
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +kmod-ipt-trigger +kmod-ip6t-trigger +iptables-mod-nfqueue
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
endef
|
||||
|
||||
define Package/port-trigger/description
|
||||
|
||||
@@ -28,8 +28,9 @@ define Package/qosmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=QoS Manager
|
||||
DEPENDS:=+libbbfdm-api +libuci +libubox +libubus +libblobmsg-json +libjson-c +libqos +!(TARGET_brcmbca||TARGET_airoha):tc-full
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libqos +!(TARGET_brcmbca||TARGET_airoha):tc-full
|
||||
DEPENDS+=+kmod-vlantranslation +kmod-dscp2pbit +!(TARGET_brcmbca):ebtables-legacy
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
endef
|
||||
|
||||
define Package/qosmngr/description
|
||||
|
||||
@@ -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
|
||||
@@ -205,4 +217,33 @@ hw_commit_all() {
|
||||
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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=self-diagnostics
|
||||
PKG_VERSION:=1.0.8
|
||||
PKG_VERSION:=1.0.11
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
@@ -13,7 +13,8 @@ define Package/self-diagnostics
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=System Report
|
||||
DEPENDS:=+@CONFIG_BUSYBOX_CONFIG_TIMEOUT +@CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PATH +@CONFIG_BUSYBOX_CONFIG_TEE \
|
||||
+@CONFIG_BUSYBOX_CONFIG_GZIP +libbbfdm-api
|
||||
+@CONFIG_BUSYBOX_CONFIG_GZIP
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@ config globals 'globals'
|
||||
option extended_spec_dir '/etc/self-diagnostics/spec'
|
||||
option exec_timeout '5'
|
||||
option report_name 'self-diagnostics-report-$MODEL-$SERIAL'
|
||||
option verbose '0'
|
||||
option verbose '1'
|
||||
option compression_level '9'
|
||||
|
||||
@@ -11,17 +11,28 @@ case "$1" in
|
||||
case "$2" in
|
||||
generate)
|
||||
read -t 1 -r input
|
||||
local out
|
||||
|
||||
json_load "${input}"
|
||||
json_get_var modules modules
|
||||
if [ -z "${modules}" ]; then
|
||||
${BIN} -j
|
||||
out="$(${BIN} -j)"
|
||||
else
|
||||
${BIN} -j -m "${modules}"
|
||||
out="$(${BIN} -j -m "${modules}")"
|
||||
fi
|
||||
if [ -z "${out}" ]; then
|
||||
echo '{}'
|
||||
else
|
||||
echo "${out}"
|
||||
fi
|
||||
;;
|
||||
list)
|
||||
${BIN} -j -l
|
||||
out="$(${BIN} -j -l)"
|
||||
if [ -z "${out}" ]; then
|
||||
echo '{}'
|
||||
else
|
||||
echo "${out}"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
@@ -5,16 +5,19 @@
|
||||
JSON_OUT=0
|
||||
SPEC_DIR="/usr/share/self-diagnostics/spec"
|
||||
SPEC_EXT_DIR="/etc/self-diagnostics/spec"
|
||||
REPORT_DIR="$(mktemp -d)"
|
||||
REPORT_PATH="/var/log/"
|
||||
REPORT_TEMP_DIR="$(mktemp -p ${REPORT_PATH} -d)"
|
||||
REPORT_NAME="self-test-diagnostics"
|
||||
VERBOSE=0
|
||||
COMPOPTS=""
|
||||
TIMEOUT=5
|
||||
JSON_OUT_BUFFER=""
|
||||
|
||||
cleanup()
|
||||
{
|
||||
[ -d "${REPORT_DIR}" ] && \
|
||||
rm -rf ${REPORT_DIR}
|
||||
if [ -d "${REPORT_TEMP_DIR}" ]; then
|
||||
rm -rf ${REPORT_TEMP_DIR}
|
||||
fi
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
@@ -35,13 +38,20 @@ help()
|
||||
|
||||
log()
|
||||
{
|
||||
log_file="${REPORT_DIR}/execution.log"
|
||||
log_file="${REPORT_TEMP_DIR}/execution.log"
|
||||
if [ "$VERBOSE" -eq 1 ]; then
|
||||
logger -t $0 "$*"
|
||||
logger -p debug -t $0 "$*"
|
||||
fi
|
||||
echo "[$(date +%Y:%m:%d-%H:%M:%S)] $*" >> ${log_file}
|
||||
}
|
||||
|
||||
err_log()
|
||||
{
|
||||
log_file="${REPORT_TEMP_DIR}/execution.log"
|
||||
logger -p err -t $0 "$*"
|
||||
echo "[$(date +%Y:%m:%d-%H:%M:%S) ERR] $*" >> ${log_file}
|
||||
}
|
||||
|
||||
# Alias ubus to have a smaller 5-second timeout on all subsequent calls
|
||||
ubus()
|
||||
{
|
||||
@@ -60,10 +70,26 @@ config_load()
|
||||
local temp
|
||||
local MODEL SERIAL
|
||||
|
||||
log "# Starting Self diagnostics tests #"
|
||||
# Default value for MODEL and SERIAL
|
||||
MODEL="XXX"
|
||||
SERIAL="FFFFFFFFFFFF"
|
||||
|
||||
MODEL="$(db get device.deviceinfo.ModelName)"
|
||||
SERIAL="$(db get device.deviceinfo.SerialNumber)"
|
||||
log "# Starting Self diagnostics tests #"
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_init
|
||||
json_add_string "report_dir" "${REPORT_PATH}"
|
||||
JSON_OUT_BUFFER="$(json_dump)"
|
||||
else
|
||||
echo "report_dir: ${REPORT_PATH}"
|
||||
fi
|
||||
|
||||
temp="$(db -q get device.deviceinfo.ModelName)"
|
||||
[ -d "${temp}" ] && \
|
||||
MODEL="${temp}"
|
||||
|
||||
temp="$(db -q get device.deviceinfo.SerialNumber)"
|
||||
[ -d "${temp}" ] && \
|
||||
SERIAL="${temp}"
|
||||
|
||||
temp="$(uci -q get self-diagnostics.globals.extended_spec_dir)"
|
||||
[ -d "${temp}" ] && \
|
||||
@@ -90,24 +116,25 @@ config_load()
|
||||
|
||||
exec_spec()
|
||||
{
|
||||
local json_file exec_skip name timeout exec_timeout rc
|
||||
local json_file exec_skip name timeout exec_timeout rc start_time end_time
|
||||
|
||||
start_time="$(date +%s)"
|
||||
json_file="$1"
|
||||
[ -z "$json_file" ] && {
|
||||
log "No/invalid spec json_file"
|
||||
err_log "No/invalid spec json_file"
|
||||
return 1
|
||||
}
|
||||
|
||||
log "Loading $json_file ..."
|
||||
log "# Loading $json_file at ${start_time} ..."
|
||||
|
||||
json_init
|
||||
json_load_file "${json_file}" || {
|
||||
log "Failed to load ${json_file} spec file"
|
||||
err_log "Failed to load ${json_file} spec file"
|
||||
return 1
|
||||
}
|
||||
|
||||
name="$(basename ${json_file})"
|
||||
export_path="${REPORT_DIR}/${name//.json/.log}"
|
||||
export_path="${REPORT_TEMP_DIR}/${name//.json/.log}"
|
||||
|
||||
exec_skip=0
|
||||
if json_is_a dependency array; then
|
||||
@@ -122,7 +149,7 @@ exec_spec()
|
||||
if [ "$type" == "file" ]; then
|
||||
json_get_var file file
|
||||
if [ ! -e "$file" ]; then
|
||||
log "${json_file} has unmet file dependency $file"
|
||||
err_log "${json_file} has unmet file dependency $file"
|
||||
exec_skip=1
|
||||
json_select ..
|
||||
continue
|
||||
@@ -135,7 +162,7 @@ exec_spec()
|
||||
fi
|
||||
|
||||
[ "${exec_skip}" -eq 1 ] && {
|
||||
log "Dependency not satisfied for ${json_file}"
|
||||
err_log "Dependency not satisfied for ${json_file}"
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -149,7 +176,10 @@ exec_spec()
|
||||
for key in $keys; do
|
||||
if json_is_a $key object; then
|
||||
json_select $key
|
||||
local cmd_skip file
|
||||
|
||||
cmd_skip=0
|
||||
file=""
|
||||
if json_is_a dependency array; then
|
||||
json_select "dependency"
|
||||
json_get_keys d_keys
|
||||
@@ -174,7 +204,7 @@ exec_spec()
|
||||
|
||||
[ $cmd_skip -eq 1 ] && {
|
||||
json_select ..
|
||||
log "Dependency not satisfied for ${file}"
|
||||
err_log "Dependency not satisfied for ${file}"
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -192,24 +222,14 @@ exec_spec()
|
||||
echo "# $description #">> $export_path
|
||||
echo "# Exec [$cmd], timeout [$exec_timeout] #" >> $export_path
|
||||
echo "##########################################" >> $export_path
|
||||
if [ "$VERBOSE" -eq 1 ]; then
|
||||
if [[ "$cmd" == *"logread "* ]]; then
|
||||
eval timeout ${exec_timeout} $cmd 2>&1 | tee -a $export_path
|
||||
rc=$?
|
||||
else
|
||||
eval timeout ${exec_timeout} $cmd 2>&1 | tee -a $export_path | logger -t self-diagnostics
|
||||
rc=$?
|
||||
fi
|
||||
else
|
||||
eval timeout ${exec_timeout} $cmd >> $export_path 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
echo "######## Execution return code $rc ######" >> $export_path
|
||||
eval timeout ${exec_timeout} $cmd >> $export_path 2>&1
|
||||
rc=$?
|
||||
echo "######## Execution done return code $rc ######" >> $export_path
|
||||
|
||||
if [ "$rc" -eq 0 ]; then
|
||||
log "Execution [$cmd] completed"
|
||||
else
|
||||
log "Execution [$cmd] Failed/Timeout with $rc exit code"
|
||||
err_log "Execution [$cmd] Failed/Timeout with $rc exit code"
|
||||
fi
|
||||
|
||||
echo >> $export_path
|
||||
@@ -219,7 +239,8 @@ exec_spec()
|
||||
json_select ..
|
||||
fi
|
||||
|
||||
log "Handling of $json_file done"
|
||||
end_time="$(date +%s)"
|
||||
log "# Handling of $json_file done, time: ${end_time}, time_spent: $((end_time - start_time)) sec"
|
||||
log ""
|
||||
}
|
||||
|
||||
@@ -314,38 +335,51 @@ list_modules()
|
||||
|
||||
generate_report()
|
||||
{
|
||||
local filename report_path
|
||||
local filename
|
||||
|
||||
report_path="$(dirname "${REPORT_DIR}")"
|
||||
filename="${report_path}/${REPORT_NAME}"
|
||||
filename="${REPORT_PATH}/${REPORT_NAME}"
|
||||
|
||||
[ -f "${filename}.tar" ] && rm "${filename}.tar"
|
||||
[ -f "${filename}.tar.gz" ] && rm "${filename}.tar.gz"
|
||||
|
||||
log "# Report generation completed #"
|
||||
cd ${REPORT_DIR} && {
|
||||
cd ${REPORT_TEMP_DIR} && {
|
||||
filename="${filename}.tar"
|
||||
tar -cf "${filename}" *
|
||||
}
|
||||
|
||||
rm -r "$REPORT_DIR"
|
||||
|
||||
if [ -n "$COMPOPTS" ]; then
|
||||
gzip -${COMPOPTS} -f "${filename}"
|
||||
filename="${filename}.gz"
|
||||
fi
|
||||
|
||||
# Move logs if failed to generate tar
|
||||
if [ ! -f "${filename}" ]; then
|
||||
mv ${REPORT_TEMP_DIR}/*.log ${REPORT_PATH}/
|
||||
fi
|
||||
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_init
|
||||
json_add_string result "${filename}"
|
||||
json_load "${JSON_OUT_BUFFER}"
|
||||
if [ -f "${filename}" ]; then
|
||||
json_add_string result "${filename}"
|
||||
else
|
||||
log "error: Failed to generate report tar, check logs in ${REPORT_PATH}"
|
||||
json_add_string error "Failed to generate report tar, check logs in ${REPORT_PATH}"
|
||||
fi
|
||||
json_dump
|
||||
else
|
||||
echo "${filename}"
|
||||
if [ -f "${filename}" ]; then
|
||||
echo "result: ${filename}"
|
||||
else
|
||||
log "error: Failed to generate report tar, check logs in ${REPORT_PATH}"
|
||||
echo "error: Failed to generate report tar, check logs in ${REPORT_PATH}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
[ ! -d "${SPEC_DIR}" ] && {
|
||||
log "# ${SPEC_DIR} does not exits"
|
||||
log "# ${SPEC_DIR} does not exist"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
13
self-diagnostics/files/usr/share/self-diagnostics/helper/var_state_dump.sh
Executable file
13
self-diagnostics/files/usr/share/self-diagnostics/helper/var_state_dump.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
function dump_var_state_file()
|
||||
{
|
||||
for f in `ls -1 /var/state/`; do
|
||||
if [ -f "var/state/$f" ]; then
|
||||
echo "cat /var/state/$f"
|
||||
cat "/var/state/$f"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
dump_var_state_file
|
||||
0
self-diagnostics/files/usr/share/self-diagnostics/helper/wifi_assoclist.sh
Normal file → Executable file
0
self-diagnostics/files/usr/share/self-diagnostics/helper/wifi_assoclist.sh
Normal file → Executable file
0
self-diagnostics/files/usr/share/self-diagnostics/helper/wifi_radio_scan.sh
Normal file → Executable file
0
self-diagnostics/files/usr/share/self-diagnostics/helper/wifi_radio_scan.sh
Normal file → Executable file
0
self-diagnostics/files/usr/share/self-diagnostics/helper/wifi_radio_status.sh
Normal file → Executable file
0
self-diagnostics/files/usr/share/self-diagnostics/helper/wifi_radio_status.sh
Normal file → Executable file
@@ -18,8 +18,8 @@
|
||||
"cmd": "uci export"
|
||||
},
|
||||
{
|
||||
"description": "Runtime Configuration",
|
||||
"cmd": "cat /var/state/*"
|
||||
"description": "Runtime Configuration (/var/state/)",
|
||||
"cmd": "sh /usr/share/self-diagnostics/helper/var_state_dump.sh"
|
||||
},
|
||||
{
|
||||
"description": "Firmware Environment",
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
"description": "Board Info",
|
||||
"cmd": "ubus call system board"
|
||||
},
|
||||
{
|
||||
"description": "System Log",
|
||||
"cmd": "logread"
|
||||
},
|
||||
{
|
||||
"description": "Running Processes",
|
||||
"cmd": "top -b -n 1"
|
||||
@@ -21,13 +25,9 @@
|
||||
"description": "Kernel Parameters",
|
||||
"cmd": "sysctl -A 2>/dev/null"
|
||||
},
|
||||
{
|
||||
"description": "System Log",
|
||||
"cmd": "timeout 5 logread -l 1000"
|
||||
},
|
||||
{
|
||||
"description": "Driver Message",
|
||||
"cmd": "timeout 5 dmesg"
|
||||
"cmd": "dmesg"
|
||||
},
|
||||
{
|
||||
"description": "PCI Devices",
|
||||
|
||||
@@ -17,15 +17,18 @@
|
||||
},
|
||||
{
|
||||
"description": "WiFi Radio Status",
|
||||
"cmd": "sh /usr/share/self-diagnostics/helper/wifi_radio_status.sh"
|
||||
"cmd": "sh /usr/share/self-diagnostics/helper/wifi_radio_status.sh",
|
||||
"timeout": 10
|
||||
},
|
||||
{
|
||||
"description": "Get radio scan",
|
||||
"cmd": "sh /usr/share/self-diagnostics/helper/wifi_radio_scan.sh"
|
||||
"cmd": "sh /usr/share/self-diagnostics/helper/wifi_radio_scan.sh",
|
||||
"timeout": 10
|
||||
},
|
||||
{
|
||||
"description": "Get Assoc List",
|
||||
"cmd": "sh /usr/share/self-diagnostics/helper/wifi_assoclist.sh"
|
||||
"cmd": "sh /usr/share/self-diagnostics/helper/wifi_assoclist.sh",
|
||||
"timeout": 10
|
||||
},
|
||||
{
|
||||
"description": "List Wireless Devices",
|
||||
|
||||
@@ -17,8 +17,9 @@ static char *get_selftest_log_instance(struct dmctx *ctx)
|
||||
{
|
||||
char *file_name = NULL;
|
||||
char *path = NULL;
|
||||
char *file_uri = NULL;
|
||||
|
||||
struct uci_section *s = get_origin_section_from_config("system", "system", "self_test_log");
|
||||
struct uci_section *s = get_origin_section_from_dmmap("dmmap_logmngr", "self_test", "self_test_log");
|
||||
if (s == NULL)
|
||||
goto err;
|
||||
|
||||
@@ -26,7 +27,8 @@ static char *get_selftest_log_instance(struct dmctx *ctx)
|
||||
if (DM_STRLEN(file_name) == 0)
|
||||
goto err;
|
||||
|
||||
_bbfdm_get_references(ctx, "Device.DeviceInfo.VendorLogFile.", "Name", file_name, &path);
|
||||
dmasprintf(&file_uri, "file://%s", file_name);
|
||||
_bbfdm_get_references(ctx, "Device.DeviceInfo.VendorLogFile.", "Name", file_uri, &path);
|
||||
|
||||
err:
|
||||
return path ? path : dmstrdup("");
|
||||
@@ -65,15 +67,15 @@ int operate_Device_SelfTest(char *refparam, struct dmctx *ctx, void *data, char
|
||||
if (!file_exists(output))
|
||||
goto err;
|
||||
|
||||
/* Add in vendor log */
|
||||
struct uci_section *s = get_origin_section_from_config("system", "system", "self_test_log");
|
||||
/* Add in dmmap_logmngr */
|
||||
struct uci_section *s = get_origin_section_from_dmmap("dmmap_logmngr", "self_test", "self_test_log");
|
||||
if (s == NULL) {
|
||||
dmuci_add_section("system", "system", &s);
|
||||
dmuci_add_section_bbfdm("dmmap_logmngr", "self_test", &s);
|
||||
dmuci_rename_section_by_section(s, "self_test_log");
|
||||
}
|
||||
|
||||
dmuci_set_value_by_section(s, "log_file", output);
|
||||
dmuci_commit_package("system");
|
||||
dmuci_commit_package_bbfdm("dmmap_logmngr");
|
||||
|
||||
/* Get self test log instance */
|
||||
char *result = get_selftest_log_instance(ctx);
|
||||
@@ -133,7 +135,7 @@ static int get_SelfTest_Results(char *refparam, struct dmctx *ctx, void *data, c
|
||||
DMLEAF tSelfTestParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"DiagnosticsState", &DMWRITE, DMT_STRING, get_SelfTest_DiagnosticsState, set_SelfTest_DiagnosticsState, BBFDM_CWMP},
|
||||
{"Results", &DMREAD, DMT_STRING, get_SelfTest_Results, NULL, BBFDM_CWMP},
|
||||
{"Results", &DMREAD, DMT_STRING, get_SelfTest_Results, NULL, BBFDM_CWMP, DM_FLAG_REFERENCE},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user