mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-25 19:44:30 +08:00
Compare commits
272 Commits
system_rep
...
porttrigge
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8bada4cf3 | ||
|
|
ec165a9042 | ||
|
|
d4b2d251d6 | ||
|
|
78aecb52ca | ||
|
|
8eb17ec066 | ||
|
|
01c1899208 | ||
|
|
bec7eeaa33 | ||
|
|
dc49178002 | ||
|
|
ddf59c0756 | ||
|
|
6dc1e0de1c | ||
|
|
4dd401a0cb | ||
|
|
e60ef9d02e | ||
|
|
9f2a6f3265 | ||
|
|
36db9285f6 | ||
|
|
559ea53e69 | ||
|
|
f7ade9751e | ||
|
|
963e1ecc6c | ||
|
|
35ca583dc1 | ||
|
|
8b12debefe | ||
|
|
a0caa174d0 | ||
|
|
8bd2d74316 | ||
|
|
e6015f5db2 | ||
|
|
a227490dcb | ||
|
|
c0c5cf032d | ||
|
|
25c09589f2 | ||
|
|
22b273faf0 | ||
|
|
fd850636a5 | ||
|
|
2568cba699 | ||
|
|
2968ad5dd8 | ||
|
|
6311e0f8b0 | ||
|
|
7449779f37 | ||
|
|
459bc4f9ff | ||
|
|
a574514a41 | ||
|
|
ceb70ecefb | ||
|
|
bc0e021b3c | ||
|
|
19d372a4ad | ||
|
|
8a08dd3916 | ||
|
|
a672e1708f | ||
|
|
4b4407c3f9 | ||
|
|
2d1c7428b6 | ||
|
|
ad28f56744 | ||
|
|
a8c1c6b25f | ||
|
|
4a89da8067 | ||
|
|
386649b0bb | ||
|
|
e050489073 | ||
|
|
94895ef110 | ||
|
|
4c93c01d22 | ||
|
|
9228b44a94 | ||
|
|
7ace7892b1 | ||
|
|
f4dfdc46f1 | ||
|
|
cc8b0f70d6 | ||
|
|
d943a0e0d1 | ||
|
|
c25c241008 | ||
|
|
59aad46280 | ||
|
|
65a754935e | ||
|
|
99f0cc9a01 | ||
|
|
371e27e92e | ||
|
|
724c62684f | ||
|
|
040123d2b1 | ||
|
|
c5f26d1217 | ||
|
|
55e87e47f1 | ||
|
|
bb9b397caa | ||
|
|
e1c9006b2d | ||
|
|
b7a95f200f | ||
|
|
fb15ed7deb | ||
|
|
9535b226ce | ||
|
|
48e6c149a6 | ||
|
|
068307171c | ||
|
|
b7957f5dd4 | ||
|
|
4c40999c71 | ||
|
|
ff786da6a2 | ||
|
|
25955bfeca | ||
|
|
b9f25bcd90 | ||
|
|
b8dfa5eebe | ||
|
|
10719b6c92 | ||
|
|
cdb029dcb8 | ||
|
|
55fa399ea6 | ||
|
|
c0bdff6a1c | ||
|
|
48d35004d4 | ||
|
|
e95cc9a39d | ||
|
|
c260fb4c61 | ||
|
|
4b279a83a9 | ||
|
|
3cebc8aee5 | ||
|
|
58035970a4 | ||
|
|
707a62b678 | ||
|
|
2c738bb96c | ||
|
|
fa24932e7c | ||
|
|
b8fc416fed | ||
|
|
7ad065a756 | ||
|
|
54a54d048c | ||
|
|
28fef8f5ea | ||
|
|
92a1c1e25d | ||
|
|
34c5ae9c71 | ||
|
|
1c68b9bba0 | ||
|
|
6b7d2d7c69 | ||
|
|
3482a3e94f | ||
|
|
b96d6a5a1b | ||
|
|
01625e3382 | ||
|
|
8243861c49 | ||
|
|
744c5828a5 | ||
|
|
a33b438ddc | ||
|
|
445e50f011 | ||
|
|
e845aa2a51 | ||
|
|
39aebfc782 | ||
|
|
6441d2fd01 | ||
|
|
36f02fa5f8 | ||
|
|
e80ca4319b | ||
|
|
350186614e | ||
|
|
6caec3ea06 | ||
|
|
f45ec2b32b | ||
|
|
c361b4e589 | ||
|
|
ef4e5fbef6 | ||
|
|
d9fe7d6927 | ||
|
|
920832c5c7 | ||
|
|
a1a1dafb2f | ||
|
|
45eda81ccc | ||
|
|
83db5d1e2d | ||
|
|
71e7a8121f | ||
|
|
0368ef0498 | ||
|
|
34b8267b03 | ||
|
|
13e8f80a5d | ||
|
|
f9bbd87b5d | ||
|
|
b5150eb926 | ||
|
|
ab078ad644 | ||
|
|
676244b0c7 | ||
|
|
c1b990837d | ||
|
|
7dc38d0a4a | ||
|
|
6fdb0e1e4c | ||
|
|
4712d9be73 | ||
|
|
724c060372 | ||
|
|
45e996e2fa | ||
|
|
66f4780410 | ||
|
|
f2b3838451 | ||
|
|
17e67528cc | ||
|
|
6dfd959020 | ||
|
|
65d4d6538d | ||
|
|
63efd921ed | ||
|
|
2bbe7b1eef | ||
|
|
9c6f6acf6c | ||
|
|
6bc1456655 | ||
|
|
663412be0b | ||
|
|
272d4defc0 | ||
|
|
c7f81e4ad8 | ||
|
|
03ec0f2964 | ||
|
|
53d76aaa4d | ||
|
|
43a68cb1ed | ||
|
|
8f8c6405ea | ||
|
|
1efa6ec0aa | ||
|
|
13bbdaa1e8 | ||
|
|
feeed40395 | ||
|
|
f8022eb73b | ||
|
|
07e1c78029 | ||
|
|
d1ea18952f | ||
|
|
3b0097078d | ||
|
|
9b4c941cd4 | ||
|
|
50bee657ba | ||
|
|
8412f5d2d6 | ||
|
|
eabf5b6e8f | ||
|
|
3dd525d5ff | ||
|
|
a828671570 | ||
|
|
084cb9742a | ||
|
|
f3e4a9717c | ||
|
|
b63033eeab | ||
|
|
c52754d80e | ||
|
|
6adb45d944 | ||
|
|
2478ca8fd9 | ||
|
|
c6492dfeee | ||
|
|
5fcd32a7e8 | ||
|
|
73e7efddae | ||
|
|
a934358614 | ||
|
|
620ba60f2e | ||
|
|
f89b0b1797 | ||
|
|
bafb6f304c | ||
|
|
20e5110ac5 | ||
|
|
083ffd8a3f | ||
|
|
cf8c202d01 | ||
|
|
71bbb8281c | ||
|
|
3b3d7150bd | ||
|
|
130e5c567d | ||
|
|
ba61b6c8dd | ||
|
|
b3715aee80 | ||
|
|
4064c9b98c | ||
|
|
fea576c258 | ||
|
|
189bfe4013 | ||
|
|
2370c6e82e | ||
|
|
bfda6d619e | ||
|
|
930d777931 | ||
|
|
9565fa70d2 | ||
|
|
add4061e7f | ||
|
|
15e0d8e40d | ||
|
|
a1309b2552 | ||
|
|
283f148f74 | ||
|
|
21292de648 | ||
|
|
628872d2fd | ||
|
|
6608a10538 | ||
|
|
7eaf58237a | ||
|
|
f952712b5e | ||
|
|
03d5798ea0 | ||
|
|
4a049cfecd | ||
|
|
d36c76f4de | ||
|
|
fb04949dc3 | ||
|
|
0969cc7a24 | ||
|
|
12dff011cc | ||
|
|
5572cc2ede | ||
|
|
91f5827a4f | ||
|
|
aec92583ea | ||
|
|
63f4adcc97 | ||
|
|
82df16a8c4 | ||
|
|
237f30c3f7 | ||
|
|
2dac7741d4 | ||
|
|
0cff7d0e94 | ||
|
|
5e5abdfd21 | ||
|
|
0a755e5ea5 | ||
|
|
792e3ad20d | ||
|
|
336c5047c6 | ||
|
|
9c999de243 | ||
|
|
9a71a0bc84 | ||
|
|
7fb76b6dcd | ||
|
|
4f924bec0e | ||
|
|
ea4301bf28 | ||
|
|
99fcfcfa7e | ||
|
|
81218bc62d | ||
|
|
a71a0d4036 | ||
|
|
db578ec144 | ||
|
|
9410758de0 | ||
|
|
7b05468390 | ||
|
|
6d43b68d0b | ||
|
|
ae1fb54a3c | ||
|
|
313462e3ab | ||
|
|
be56713329 | ||
|
|
caae6916ae | ||
|
|
4e1db4f14f | ||
|
|
d2298b6097 | ||
|
|
8b1ef3cd74 | ||
|
|
05da8b4210 | ||
|
|
33cd29a47d | ||
|
|
f35b198c05 | ||
|
|
2bba5ad425 | ||
|
|
cbcb5278db | ||
|
|
be032908b0 | ||
|
|
e4d7967cd5 | ||
|
|
2fd0e37395 | ||
|
|
155ed6e0e1 | ||
|
|
4f70901a8c | ||
|
|
faf81a70fd | ||
|
|
680f324a34 | ||
|
|
718c2bdd81 | ||
|
|
d5ef59f028 | ||
|
|
881b8edaa9 | ||
|
|
2b5c30f203 | ||
|
|
1e5ff3a2fd | ||
|
|
7604786437 | ||
|
|
be752464bc | ||
|
|
fe47e30520 | ||
|
|
1623fb6559 | ||
|
|
002dceac35 | ||
|
|
b0b2874fdf | ||
|
|
378ef51ea8 | ||
|
|
241fd05d5c | ||
|
|
3267082ac3 | ||
|
|
fbc67e547c | ||
|
|
57b0cde173 | ||
|
|
222116d122 | ||
|
|
4e51f87eb0 | ||
|
|
a0fa00fd93 | ||
|
|
60989716fb | ||
|
|
a50f99634e | ||
|
|
822a6ff7a1 | ||
|
|
110da023b1 | ||
|
|
03fcf31e97 | ||
|
|
96e990ad3e | ||
|
|
6709beee6c |
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.4.4
|
||||
PKG_VERSION:=1.5.4
|
||||
|
||||
USE_LOCAL:=0
|
||||
ifneq ($(USE_LOCAL),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=3c0f416653781f04e2b73e7da6ccaddf6ab691de
|
||||
PKG_SOURCE_VERSION:=cd2066de6781ace66d3165937a138a0f12353d8c
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -31,45 +31,13 @@ define Package/libbbfdm-api
|
||||
ABI_VERSION:=1.0
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/default
|
||||
define Package/libbbfdm
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Library for broadband forum data model support
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libcurl +libbbfdm-api \
|
||||
+BBF_TR471:obudpst
|
||||
endef
|
||||
|
||||
define Package/libbbfdm
|
||||
$(Package/libbbfdm/default)
|
||||
TITLE += (default)
|
||||
VARIANT:=default
|
||||
DEPENDS += +PACKAGE_libbbfdm-openssl:libopenssl
|
||||
DEFAULT_VARIANT:=1
|
||||
endef
|
||||
|
||||
define Package/libbbfdm-mbedtls
|
||||
$(Package/libbbfdm/default)
|
||||
TITLE += (mbedtls)
|
||||
DEPENDS += +PACKAGE_libbbfdm-mbedtls:libmbedtls
|
||||
VARIANT:=mbedtls
|
||||
CONFLICTS := libbbfdm libbbfdm-openssl libbbfdm-wolfssl
|
||||
endef
|
||||
|
||||
define Package/libbbfdm-openssl
|
||||
$(Package/libbbfdm/default)
|
||||
TITLE += (openssl)
|
||||
DEPENDS += +PACKAGE_libbbfdm-openssl:libopenssl
|
||||
VARIANT:=openssl
|
||||
CONFLICTS := libbbfdm libbbfdm-mbedtls libbbfdm-wolfssl
|
||||
endef
|
||||
|
||||
define Package/libbbfdm-wolfssl
|
||||
$(Package/libbbfdm/default)
|
||||
TITLE += (wolfssl)
|
||||
DEPENDS += +PACKAGE_libbbfdm-wolfssl:libwolfssl
|
||||
VARIANT:=wolfssl
|
||||
CONFLICTS := libbbfdm libbbfdm-mbedtls libbbfdm-openssl
|
||||
+BBF_TR471:obudpst +libopenssl
|
||||
endef
|
||||
|
||||
define Package/bbfdmd
|
||||
@@ -77,9 +45,7 @@ define Package/bbfdmd
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Datamodel ubus backend
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libbbfdm-api +PACKAGE_libbbfdm-mbedtls:libbbfdm-mbedtls \
|
||||
+PACKAGE_libbbfdm-openssl:libbbfdm-openssl +PACKAGE_libbbfdm-wolfssl:libbbfdm-wolfssl \
|
||||
+PACKAGE_libbbfdm:libbbfdm
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libbbfdm-api +libbbfdm
|
||||
endef
|
||||
|
||||
define Package/userinterface
|
||||
@@ -132,27 +98,10 @@ CMAKE_OPTIONS += \
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_VENDOR_LIST:String="$(CONFIG_BBF_VENDOR_LIST)" \
|
||||
-DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)" \
|
||||
-DDAEMON_JSON_INPUT:String="/etc/bbfdm/input.json" \
|
||||
-DBBF_MAX_OBJECT_INSTANCES:Integer=$(CONFIG_BBF_MAX_OBJECT_INSTANCES)
|
||||
|
||||
endif ##CONFIG_BBF_VENDOR_EXTENSION
|
||||
|
||||
ifeq ($(BUILD_VARIANT),default)
|
||||
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),openssl)
|
||||
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),wolfssl)
|
||||
CMAKE_OPTIONS += -DWITH_WOLFSSL=ON
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),mbedtls)
|
||||
CMAKE_OPTIONS += -DWITH_MBEDTLS=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_bbfdmd),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBFDMD_MAX_MSG_LEN:Integer=10485760
|
||||
@@ -163,7 +112,7 @@ define Package/libbbfdm-api/install
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/libbbfdm-api.so $(1)/lib/
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/default/install
|
||||
define Package/libbbfdm/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
|
||||
@@ -184,7 +133,7 @@ ifeq ($(CONFIG_BBF_TR143),y)
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/default/prerm
|
||||
define Package/libbbfdm/prerm
|
||||
#!/bin/sh
|
||||
rm -rf /etc/bbfdm/dmmap/*
|
||||
exit 0
|
||||
@@ -197,7 +146,7 @@ define Package/bbfdmd/install
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbfdmd/ubus/bbfdmd $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/json/input.json $(1)/etc/bbfdm/
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/input.json $(1)/etc/bbfdm/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bbfdmd $(1)/etc/init.d/bbfdmd
|
||||
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
|
||||
$(INSTALL_BIN) ./files/etc/bbfdm/bbfdm_services.sh $(1)/etc/bbfdm/
|
||||
@@ -217,16 +166,6 @@ define Package/userinterface/install
|
||||
$(INSTALL_BIN) ./files/etc/firewall.userinterface $(1)/etc/firewall.userinterface
|
||||
endef
|
||||
|
||||
Package/libbbfdm/prerm = $(Package/libbbfdm/default/prerm)
|
||||
Package/libbbfdm-openssl/prerm = $(Package/libbbfdm/default/prerm)
|
||||
Package/libbbfdm-wolfssl/prerm = $(Package/libbbfdm/default/prerm)
|
||||
Package/libbbfdm-mbedtls/prerm = $(Package/libbbfdm/default/prerm)
|
||||
|
||||
Package/libbbfdm/install = $(Package/libbbfdm/default/install)
|
||||
Package/libbbfdm-openssl/install = $(Package/libbbfdm/default/install)
|
||||
Package/libbbfdm-wolfssl/install = $(Package/libbbfdm/default/install)
|
||||
Package/libbbfdm-mbedtls/install = $(Package/libbbfdm/default/install)
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
@@ -244,9 +183,6 @@ endef
|
||||
|
||||
$(eval $(call BuildPackage,libbbfdm-api))
|
||||
$(eval $(call BuildPackage,libbbfdm))
|
||||
$(eval $(call BuildPackage,libbbfdm-openssl))
|
||||
$(eval $(call BuildPackage,libbbfdm-wolfssl))
|
||||
$(eval $(call BuildPackage,libbbfdm-mbedtls))
|
||||
$(eval $(call BuildPackage,bbfdmd))
|
||||
|
||||
$(eval $(call BuildPackage,userinterface))
|
||||
|
||||
@@ -15,3 +15,33 @@ bbfdm_add_service()
|
||||
|
||||
ubus call service add "{'name':'bbfdm.services','instances':{'$name':{'command':['$BBFDMD','-m','$path']}}}"
|
||||
}
|
||||
|
||||
bbfdm_stop_service()
|
||||
{
|
||||
local name
|
||||
|
||||
name="${1}"
|
||||
if [ -z "${name}" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if ubus call service list '{"name":"bbfdm.services"}' |grep -q "bbfdm.$name"; then
|
||||
ubus call service delete "{'name':'bbfdm.services','instance':'bbfdm.$name'}"
|
||||
fi
|
||||
}
|
||||
|
||||
usages()
|
||||
{
|
||||
echo "Usages $0: <OPTIONS>..."
|
||||
echo
|
||||
echo " -h show help"
|
||||
echo " -k micro-service name to stop"
|
||||
echo
|
||||
}
|
||||
|
||||
while getopts "s:k:h" opts; do
|
||||
case "$opts" in
|
||||
h) usages; exit 0;;
|
||||
k) bbfdm_stop_service "${OPTARG}";;
|
||||
esac
|
||||
done
|
||||
|
||||
28
bbfdm/files/etc/bbfdm/input.json
Normal file
28
bbfdm/files/etc/bbfdm/input.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"daemon": {
|
||||
"config": {
|
||||
},
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/lib/libbbfdm.so",
|
||||
"plugin_dir": "/etc/bbfdm/plugins"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm"
|
||||
}
|
||||
},
|
||||
"cli": {
|
||||
"config": {
|
||||
"proto": "both",
|
||||
"instance_mode": 0
|
||||
},
|
||||
"input": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm"
|
||||
},
|
||||
"output": {
|
||||
"type": "CLI"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,4 +4,5 @@ config bbfdmd 'bbfdmd'
|
||||
option loglevel '1'
|
||||
option refresh_time '10'
|
||||
option transaction_timeout '30'
|
||||
option subprocess_level '2'
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ USE_PROCD=1
|
||||
PROG=/usr/sbin/bbfdmd
|
||||
|
||||
BBFDM_JSON_INPUT="/etc/bbfdm/input.json"
|
||||
BBFDM_TEMP_JSON="/tmp/bbfdm.json"
|
||||
BBFDM_TEMP_JSON="/tmp/bbfdm/input.json"
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t bbfdmd.init -p info
|
||||
@@ -28,7 +28,7 @@ validate_bbfdm_bbfdmd_section()
|
||||
configure_bbfdmd()
|
||||
{
|
||||
local enabled debug sock update
|
||||
local jlog jrefresh jtimeout
|
||||
local jlog jrefresh jtimeout jlevel
|
||||
|
||||
update=0
|
||||
config_load bbfdm
|
||||
@@ -38,26 +38,9 @@ configure_bbfdmd()
|
||||
}
|
||||
|
||||
[ "${enabled}" -eq 0 ] && return 0
|
||||
[ ! -f "${BBFDM_JSON_INPUT}" ] && return 0
|
||||
|
||||
jlog="$(jq '.daemon.config.loglevel' ${BBFDM_JSON_INPUT})"
|
||||
if [ "\"${loglevel}\"" != "${jlog}" ]; then
|
||||
update=1
|
||||
fi
|
||||
|
||||
jrefresh="$(jq '.daemon.config.refresh_time' ${BBFDM_JSON_INPUT})"
|
||||
if [ "\"${refresh_time}\"" != "${jrefresh}" ]; then
|
||||
update=1
|
||||
fi
|
||||
|
||||
jtimeout="$(jq '.daemon.config.transaction_timeout' ${BBFDM_JSON_INPUT})"
|
||||
if [ "\"${transaction_timeout}\"" != "${jtimeout}" ]; then
|
||||
update=1
|
||||
fi
|
||||
|
||||
if [ "${update}" -eq "1" ]; then
|
||||
echo "$(jq --arg log ${loglevel} --arg tran ${transaction_timeout} --arg refresh ${refresh_time} '.daemon.config += {"loglevel": $log, "refresh_time": $refresh, "transaction_timeout": $tran}' ${BBFDM_JSON_INPUT})" > ${BBFDM_TEMP_JSON}
|
||||
mv ${BBFDM_TEMP_JSON} ${BBFDM_JSON_INPUT}
|
||||
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_JSON}
|
||||
fi
|
||||
|
||||
procd_set_param command ${PROG}
|
||||
@@ -73,6 +56,7 @@ configure_bbfdmd()
|
||||
|
||||
start_service()
|
||||
{
|
||||
mkdir -p /tmp/bbfdm
|
||||
procd_open_instance "bbfdm"
|
||||
configure_bbfdmd
|
||||
procd_set_param respawn
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=2.1.2
|
||||
PKG_VERSION:=2.1.5
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bulkdata.git
|
||||
PKG_SOURCE_VERSION:=d83c42070e7f10178dc1c2d0ce078e3d6d42d889
|
||||
PKG_SOURCE_VERSION:=f03fb8682aa7efe760294e54c422f2eab856e08c
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=decollector
|
||||
PKG_VERSION:=4.2.0.1
|
||||
PKG_VERSION:=4.2.1.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=3e54fa519defa462d08d4107c115905abb929c1a
|
||||
PKG_SOURCE_VERSION:=ae836adb0779979686d0dad34b941f319ffed1b8
|
||||
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.5.19
|
||||
PKG_VERSION:=3.6.4
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=1fd0b11ad34f8f59b40c3a12e0cc07aa212eb87b
|
||||
PKG_SOURCE_VERSION:=d9cc11c81ce1ff625e4e789afa180b301c7fcf74
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2018 iopsys Software Solutions AB
|
||||
# Copyright (C) 2018-2024 iopsys Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
@@ -8,14 +8,15 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dslmngr
|
||||
PKG_VERSION:=1.2.0
|
||||
PKG_VERSION:=1.2.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=43dec92b1c86be7859521da337e7bd1168848b26
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dslmngr.git
|
||||
PKG_SOURCE_VERSION:=cb8b8fd2549751bcd38808391b76a1a9a908c4de
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/dslmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -59,7 +60,7 @@ MAKE_FLAGS += \
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/dslmngr/ $(PKG_BUILD_DIR)/
|
||||
rsync -r --exclude=.* ./dslmngr/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
#
|
||||
# Copyright (C) 2020 Iopsys
|
||||
# Copyright (C) 2020-2024 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ethmngr
|
||||
PKG_VERSION:=2.1.0
|
||||
PKG_VERSION:=2.1.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=5a0ff3bc7c49dcb05129f423ef8e0c4929f6aa03
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ethmngr.git
|
||||
|
||||
PKG_SOURCE_VERSION:=e5cccdd45a93d969d51c4085cb52b543df544811
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/ethmngr.git
|
||||
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
@@ -32,6 +35,12 @@ define Package/ethmngr/description
|
||||
It uses APIs from the libethernet.so library.
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ./ethmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostmngr
|
||||
PKG_VERSION:=1.0.7
|
||||
PKG_VERSION:=1.1.4
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=975549e01df338a90e1d1a356d22a2c7f5bf2387
|
||||
PKG_SOURCE_VERSION:=edb5bbe57c5bc83035e217c73071c9b3e878dc22
|
||||
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
|
||||
@@ -63,7 +63,8 @@ define Package/hostmngr/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/hostmngr $(1)/usr/sbin/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/bbf_plugin/libhostmngr.so $(1)/etc/hostmngr/
|
||||
$(INSTALL_DATA) ./files/etc/hostmngr/input.json $(1)/etc/hostmngr/
|
||||
$(INSTALL_DATA) ./files/lib/hosts/hosts_acl.sh $(1)/lib/hosts/
|
||||
$(INSTALL_DIR) $(1)/usr/share/hostmngr
|
||||
$(INSTALL_DATA) ./files/scripts/hosts_acl.sh $(1)/usr/share/hostmngr/
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
|
||||
@@ -1,19 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/hosts/hosts_acl.sh
|
||||
|
||||
iptables -w -F hosts_forward
|
||||
ip6tables -w -F hosts_forward
|
||||
|
||||
iptables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && iptables -w -t filter -I FORWARD -j hosts_forward
|
||||
ip6tables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && ip6tables -w -t filter -I FORWARD -j hosts_forward
|
||||
|
||||
# Load /etc/config/hosts UCI file
|
||||
config_load hosts
|
||||
config_foreach process_ac_schedule ac_schedule
|
||||
|
||||
sh /usr/share/hostmngr/hosts_acl.sh
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=97
|
||||
START=65
|
||||
STOP=20
|
||||
|
||||
. /etc/bbfdm/bbfdm_services.sh
|
||||
. /lib/hosts/hosts_acl.sh
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
@@ -20,7 +19,7 @@ start_service() {
|
||||
procd_close_instance
|
||||
|
||||
bbfdm_add_service "bbfdm.hosts" "${HOSTS_JSON_INPUT}"
|
||||
hosts_acl
|
||||
sh /usr/share/hostmngr/hosts_acl.sh
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
|
||||
35
hostmngr/files/lib/hosts/hosts_acl.sh → hostmngr/files/scripts/hosts_acl.sh
Normal file → Executable file
35
hostmngr/files/lib/hosts/hosts_acl.sh → hostmngr/files/scripts/hosts_acl.sh
Normal file → Executable file
@@ -144,6 +144,11 @@ process_ac_schedule() {
|
||||
IP_RULE=""
|
||||
IP_RULE1=""
|
||||
|
||||
config_get is_enabled "$access_control" "enable" 1
|
||||
if [ "$is_enabled" == "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
mac=$(uci -q get hosts.$access_control.macaddr)
|
||||
access_policy=$(uci -q get hosts.$access_control.access_policy)
|
||||
|
||||
@@ -210,21 +215,19 @@ process_ac_schedule() {
|
||||
prev_days=""
|
||||
}
|
||||
|
||||
hosts_acl() {
|
||||
iptables -w -F hosts_forward
|
||||
ip6tables -w -F hosts_forward
|
||||
iptables -w -F hosts_forward
|
||||
ip6tables -w -F hosts_forward
|
||||
|
||||
hosts_forward=$(iptables -t filter --list | grep hosts_forward)
|
||||
if [ -z "$hosts_forward" ]; then
|
||||
iptables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && iptables -w -t filter -I FORWARD -j hosts_forward
|
||||
ip6tables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && ip6tables -w -t filter -I FORWARD -j hosts_forward
|
||||
fi
|
||||
hosts_forward=$(iptables -t filter --list | grep hosts_forward)
|
||||
if [ -z "$hosts_forward" ]; then
|
||||
iptables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && iptables -w -t filter -I FORWARD -j hosts_forward
|
||||
ip6tables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && ip6tables -w -t filter -I FORWARD -j hosts_forward
|
||||
fi
|
||||
|
||||
# Load /etc/config/hosts UCI file
|
||||
config_load hosts
|
||||
config_foreach process_ac_schedule ac_schedule
|
||||
}
|
||||
# Load /etc/config/hosts UCI file
|
||||
config_load hosts
|
||||
config_foreach process_ac_schedule ac_schedule
|
||||
@@ -8,15 +8,16 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.5.13
|
||||
PKG_VERSION:=9.6.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=ade480d2b090e3fba952605596c9e9276e4cbd02
|
||||
PKG_SOURCE_VERSION:=601708dd0a2ca4fad5213e78cc456e0f355f45bc
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
@@ -25,69 +26,21 @@ include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/icwmp/default
|
||||
define Package/icwmp
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=TR069 CWMP client
|
||||
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml +libuuid +libbbfdm-api
|
||||
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml +libuuid +libbbfdm-api +libopenssl
|
||||
endef
|
||||
|
||||
define Package/icwmp
|
||||
$(Package/icwmp/default)
|
||||
VARIANT:=default
|
||||
DEFAULT_VARIANT:=1
|
||||
DEPENDS += +PACKAGE_icwmp-openssl:libopenssl
|
||||
endef
|
||||
|
||||
define Package/icwmp-openssl
|
||||
$(Package/icwmp/default)
|
||||
TITLE += (openssl)
|
||||
VARIANT:=openssl
|
||||
DEPENDS += +PACKAGE_icwmp-openssl:libopenssl
|
||||
CONFLICTS := icwmp icwmp-mbedtls icwmp-wolfssl
|
||||
endef
|
||||
|
||||
define Package/icwmp-wolfssl
|
||||
$(Package/icwmp/default)
|
||||
TITLE += (wolfssl)
|
||||
VARIANT:=wolfssl
|
||||
DEPENDS += +PACKAGE_icwmp-wolfssl:libwolfssl
|
||||
CONFLICTS := icwmp icwmp-mbedtls icwmp-openssl
|
||||
endef
|
||||
|
||||
define Package/icwmp-mbedtls
|
||||
$(Package/icwmp/default)
|
||||
TITLE += (mbedtls)
|
||||
DEPENDS += +PACKAGE_icwmp-mbedtls:libmbedtls
|
||||
VARIANT:=mbedtls
|
||||
CONFLICTS := icwmp icwmp-wolfssl icwmp-openssl
|
||||
endef
|
||||
|
||||
ifeq ($(BUILD_VARIANT),default)
|
||||
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),openssl)
|
||||
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),wolfssl)
|
||||
CMAKE_OPTIONS += -DWITH_WOLFSSL=ON
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),mbedtls)
|
||||
CMAKE_OPTIONS += -DWITH_MBEDTLS=ON
|
||||
endif
|
||||
|
||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||
ifneq ($(USE_LOCAL),)
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
$(CP) -rf ~/git/icwmp/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/icwmp/default/install
|
||||
define Package/icwmp/install
|
||||
$(INSTALL_DIR) $(1)/etc/icwmpd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
@@ -101,19 +54,12 @@ define Package/icwmp/default/install
|
||||
$(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_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user
|
||||
$(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
|
||||
$(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/CWMPManagementServer.json)
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libcwmpdm.so)
|
||||
endef
|
||||
|
||||
Package/icwmp/install = $(Package/icwmp/default/install)
|
||||
Package/icwmp-openssl/install = $(Package/icwmp/default/install)
|
||||
Package/icwmp-wolfssl/install = $(Package/icwmp/default/install)
|
||||
Package/icwmp-mbedtls/install = $(Package/icwmp/default/install)
|
||||
|
||||
$(eval $(call BuildPackage,icwmp))
|
||||
$(eval $(call BuildPackage,icwmp-openssl))
|
||||
$(eval $(call BuildPackage,icwmp-wolfssl))
|
||||
$(eval $(call BuildPackage,icwmp-mbedtls))
|
||||
|
||||
@@ -11,6 +11,7 @@ config acs 'acs'
|
||||
option retry_min_wait_interval '5'
|
||||
# possible configs interval :[1000:65535]
|
||||
option retry_interval_multiplier '2000'
|
||||
option skip_dhcp_boot_options '0'
|
||||
|
||||
config cpe 'cpe'
|
||||
option enable '1'
|
||||
@@ -20,7 +21,7 @@ config cpe 'cpe'
|
||||
option log_to_file 'disable'
|
||||
# log_severity: INFO (Default)
|
||||
# log_severity possible configs: EMERG, ALERT, CRITIC ,ERROR, WARNING, NOTICE, INFO, DEBUG
|
||||
option log_severity 'INFO'
|
||||
option log_severity 'DEBUG'
|
||||
option log_file_name '/var/log/icwmpd.log'
|
||||
option log_max_size '102400'
|
||||
option userid '' #$OUI-$SER
|
||||
@@ -37,6 +38,8 @@ config cpe 'cpe'
|
||||
option periodic_notify_interval '10'
|
||||
option incoming_rule 'Port_Only'
|
||||
option active_notif_throttle '0'
|
||||
option disable_gatewayinfo '0'
|
||||
option fw_upgrade_keep_settings '1'
|
||||
|
||||
config lwn 'lwn'
|
||||
option enable '0'
|
||||
|
||||
@@ -407,6 +407,7 @@ validate_acs_section()
|
||||
'periodic_inform_time:string' \
|
||||
'url:string' \
|
||||
'dhcp_discovery:string' \
|
||||
'skip_dhcp_boot_options:bool:0' \
|
||||
'dhcp_url:string' \
|
||||
'compression:or("GZIP","Deflate","Disabled")' \
|
||||
'retry_min_wait_interval:range(1, 65535)' \
|
||||
@@ -435,12 +436,14 @@ validate_cpe_section()
|
||||
'notification:bool' \
|
||||
'exec_download:bool' \
|
||||
'periodic_notify_enable:bool' \
|
||||
'enable:bool' \
|
||||
'periodic_notify_interval:uinteger'
|
||||
'enable:bool:1' \
|
||||
'periodic_notify_interval:uinteger' \
|
||||
'fw_upgrade_keep_settings:bool'
|
||||
}
|
||||
|
||||
validate_defaults() {
|
||||
local ssl_capath
|
||||
local ssl_capath enable url dhcp_url
|
||||
|
||||
config_load cwmp
|
||||
|
||||
validate_acs_section || {
|
||||
@@ -448,6 +451,11 @@ validate_defaults() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if [ -z "${url}" ] && [ -z "${dhcp_url}" ]; then
|
||||
log "No ACS URL is configured"
|
||||
return 1
|
||||
fi
|
||||
|
||||
ssl_capath="${ssl_capath%/}"
|
||||
# Put the cert pem file in keep list
|
||||
if [ -d "${ssl_capath}" ]; then
|
||||
@@ -463,29 +471,41 @@ validate_defaults() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if [ "$enable" = "0" ]; then
|
||||
log "CWMP service disabled"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
boot() {
|
||||
local dhcp_discovery="0"
|
||||
local wan_interface=""
|
||||
local dhcp_discovery wan_interface skip_dhcp_boot_options disable_gatewayinfo
|
||||
|
||||
config_load cwmp
|
||||
config_get wan_interface cpe default_wan_interface "wan"
|
||||
config_get disable_gatewayinfo cpe disable_gatewayinfo "0"
|
||||
|
||||
config_get dhcp_discovery acs dhcp_discovery "0"
|
||||
config_get dhcp_discovery acs dhcp_discovery "0"
|
||||
config_get skip_dhcp_boot_options acs skip_dhcp_boot_options "0"
|
||||
|
||||
if [ "${dhcp_discovery}" = "enable" ] || [ "${dhcp_discovery}" = "1" ]; then
|
||||
# Set dhcp option 43 if not already configured
|
||||
enable_dhcp_option43 "${wan_interface}"
|
||||
# Set dhcp option 60
|
||||
set_vendor_id "${wan_interface}"
|
||||
if [ "${skip_dhcp_boot_options}" -ne 1 ]; then
|
||||
# Set dhcp option 43 if not already configured
|
||||
enable_dhcp_option43 "${wan_interface}"
|
||||
# Set dhcp option 60
|
||||
set_vendor_id "${wan_interface}"
|
||||
fi
|
||||
fi
|
||||
|
||||
config_get lan_interface cpe default_lan_interface ""
|
||||
if [ -n "${lan_interface}" ]; then
|
||||
# Set dhcp_option 125 if not already configured
|
||||
enable_dhcp_option125 "${wan_interface}"
|
||||
enable_dnsmasq_option125 "${lan_interface}"
|
||||
if [ "${disable_gatewayinfo}" -ne 1 ]; then
|
||||
# Set dhcp_option 125 if not already configured
|
||||
enable_dhcp_option125 "${wan_interface}"
|
||||
enable_dnsmasq_option125 "${lan_interface}"
|
||||
fi
|
||||
fi
|
||||
|
||||
config_get ssl_capath acs ssl_capath
|
||||
@@ -503,33 +523,22 @@ boot() {
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enable_cwmp url dhcp_url
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
config_get url acs url ""
|
||||
config_get dhcp_url acs dhcp_url ""
|
||||
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
procd_open_instance icwmp
|
||||
|
||||
validate_defaults || {
|
||||
log "Validation of defaults failed"
|
||||
procd_close_instance
|
||||
return 1;
|
||||
}
|
||||
|
||||
procd_open_instance icwmp
|
||||
if [ -n "${url}" ] || [ -n "${dhcp_url}" ]; then
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -b
|
||||
fi
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -b
|
||||
|
||||
procd_set_param respawn \
|
||||
"${respawn_threshold:-5}" \
|
||||
"${respawn_timeout:-10}" "${respawn_retry:-3}"
|
||||
|
||||
procd_set_param watch network.interface
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
@@ -541,22 +550,35 @@ stop_service()
|
||||
reload_service() {
|
||||
local ret
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
|
||||
log "Reload service $ret"
|
||||
ret="0"
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
|
||||
validate_defaults || {
|
||||
stop
|
||||
start
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret=$(ubus call service list '{"name":"icwmpd"}' | jsonfilter -qe '@.icwmpd.instances.icwmp.running')
|
||||
if [ "$ret" != "true" ]; then
|
||||
log "Reloading cwmp service ..."
|
||||
stop
|
||||
start
|
||||
return 0
|
||||
fi
|
||||
|
||||
ret=$(ubus call service list '{"name":"icwmpd"}' | jsonfilter -qe '@.icwmpd.instances.icwmp.running')
|
||||
if [ "$ret" != "true" ]; then
|
||||
stop
|
||||
start
|
||||
tr069_status="$(ubus -t 1 call tr069 status)"
|
||||
ret="$?"
|
||||
if [ "$ret" = "7" ]; then
|
||||
# ubus timed out may be due to uloop is busy in some task so return
|
||||
log "Skipping ubus reload due to ubus timeout"
|
||||
return 0
|
||||
fi
|
||||
|
||||
status="$(echo "${tr069_status}" | jsonfilter -qe '@.cwmp.status')"
|
||||
if [ "$status" = "up" ]; then
|
||||
ubus -t 1 call tr069 command '{"command":"reload"}'
|
||||
fi
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
|
||||
20
icwmp/files/etc/uci-defaults/95-set-random-inform-time
Normal file
20
icwmp/files/etc/uci-defaults/95-set-random-inform-time
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
set_inform_time()
|
||||
{
|
||||
local sec inform_time value
|
||||
|
||||
config_load cwmp
|
||||
config_get inform_time acs periodic_inform_time '0001-01-01T00:00:00Z'
|
||||
|
||||
if [ "${inform_time}" == "0001-01-01T00:00:00Z" ]; then
|
||||
sec=$(date +%s)
|
||||
value="$(date -d @$(($sec-$RANDOM)) +%Y-%m-%dT%H:%M:%SZ)"
|
||||
|
||||
uci_set cwmp acs periodic_inform_time "$value"
|
||||
fi
|
||||
}
|
||||
|
||||
set_inform_time
|
||||
139
icwmp/files/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user
Normal file
139
icwmp/files/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user
Normal file
@@ -0,0 +1,139 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
CLASS=""
|
||||
OUI=""
|
||||
SERIAL=""
|
||||
|
||||
get_vivsoi() {
|
||||
# opt125 environment variable has data in below format
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
# | enterprise-number1 |
|
||||
# | |
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
# | data-len1 | |
|
||||
# +-+-+-+-+-+-+-+-+ option-data1 |
|
||||
# / /
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -----
|
||||
# | enterprise-number2 | ^
|
||||
# | | |
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
|
||||
# | data-len2 | | optional
|
||||
# +-+-+-+-+-+-+-+-+ option-data2 | |
|
||||
# / / |
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
|
||||
# ~ ... ~ V
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -----
|
||||
|
||||
# Enterprise Id Len Sub Op SLen Data Sub Op SLen Data Sub Op SLen Data
|
||||
# +-------------+-----+------+------+----+------+-----+----+-----+------+-----+----+
|
||||
# | id | n | 1 | n1 | D1 | 2 | n2 | D2 | ... | 6 | n6 | D6 |
|
||||
# +-------------+-----+------+------+----+------+-----+----+-----+------+-----+----+
|
||||
|
||||
local opt125="$1"
|
||||
local len="$2"
|
||||
local ent_id
|
||||
|
||||
#hex-string 2 character=1 Byte
|
||||
# length in hex string will be twice of actual Byte length
|
||||
[ "$len" -gt "8" ] || return
|
||||
|
||||
data="${opt125}"
|
||||
rem_len="${len}"
|
||||
while [ $rem_len -gt 0 ]; do
|
||||
ent_id=${data:0:8}
|
||||
ent_id=$(printf "%d\n" "0x$ent_id")
|
||||
|
||||
if [ $ent_id -ne 3561 ]; then
|
||||
len_val=${data:8:2}
|
||||
data_len=$(printf "%d\n" "0x$len_val")
|
||||
# add 4 byte for ent_id and 1 byte for len
|
||||
data_len=$(( data_len * 2 + 10 ))
|
||||
# move ahead data to next enterprise id
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
rem_len=$(( rem_len - $data_len ))
|
||||
continue
|
||||
fi
|
||||
|
||||
# read the length of enterprise data
|
||||
len_val=${data:8:2}
|
||||
data_len=$(printf "%d\n" "0x$len_val")
|
||||
# add 4 byte for ent_id and 1 byte for len
|
||||
data_len=$(( data_len * 2 + 10 ))
|
||||
|
||||
opt_len=$(printf "%d\n" "0x$len_val")
|
||||
[ $opt_len -eq 0 ] && return
|
||||
|
||||
# populate the option data of enterprise id
|
||||
sub_data_len=$(( opt_len * 2))
|
||||
# starting 10 means ahead of length field
|
||||
sub_data=${data:10:"${sub_data_len}"}
|
||||
|
||||
# parsing of suboption of option 125
|
||||
while [ $sub_data_len -gt 0 ]; do
|
||||
# get the suboption id
|
||||
sub_opt_id=${sub_data:0:2}
|
||||
sub_opt_id=$(printf "%d\n" "0x$sub_opt_id")
|
||||
|
||||
# get the length of suboption
|
||||
sub_opt_len=${sub_data:2:2}
|
||||
sub_opt_len=$(printf "%d\n" "0x$sub_opt_len")
|
||||
sub_opt_len=$(( sub_opt_len * 2 ))
|
||||
|
||||
# get the value of sub option starting 4 means starting after length
|
||||
sub_opt_val=${sub_data:4:${sub_opt_len}}
|
||||
|
||||
# assign the value found in sub option
|
||||
case "${sub_opt_id}" in
|
||||
"4") OUI=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"5") SERIAL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"6") CLASS=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
esac
|
||||
|
||||
# add 2 bytes for sub_opt id and sub_opt len field
|
||||
sub_opt_end=$(( sub_opt_len + 4 ))
|
||||
|
||||
# update the remaining sub option hex string length
|
||||
sub_data_len=$((sub_data_len - sub_opt_end))
|
||||
|
||||
# fetch next sub option hex string
|
||||
sub_data=${sub_data:${sub_opt_end}:${sub_data_len}}
|
||||
done
|
||||
|
||||
# move ahead data to next enterprise id
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
rem_len=$(( rem_len - data_len ))
|
||||
done
|
||||
}
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
config_get wan_intf cpe default_wan_interface "wan"
|
||||
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
if [ -n "$opt125" ]; then
|
||||
len=$(printf "$opt125"|wc -c)
|
||||
get_vivsoi "$opt125" "$len"
|
||||
fi
|
||||
|
||||
mkdir -p /var/state
|
||||
touch /var/state/icwmp
|
||||
sec=$(uci -q -c /var/state get icwmp.gatewayinfo)
|
||||
if [ -z "${sec}" ]; then
|
||||
sec=$(uci -q -c /var/state add icwmp gatewayinfo)
|
||||
uci -q -c /var/state rename icwmp."${sec}"="gatewayinfo"
|
||||
fi
|
||||
|
||||
uci -q -c /var/state set icwmp.gatewayinfo.class="$CLASS"
|
||||
uci -q -c /var/state set icwmp.gatewayinfo.oui="$OUI"
|
||||
uci -q -c /var/state set icwmp.gatewayinfo.serial="$SERIAL"
|
||||
uci -q -c /var/state commit icwmp
|
||||
fi
|
||||
141
icwmp/files/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user
Normal file
141
icwmp/files/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user
Normal file
@@ -0,0 +1,141 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
DHCP_ACS_URL=""
|
||||
DHCP_PROV_CODE=""
|
||||
MIN_WAIT_INVL=""
|
||||
INVL_MULTIPLIER=""
|
||||
|
||||
log() {
|
||||
echo "$@" |logger -t cwmp.update -p info
|
||||
}
|
||||
|
||||
get_opt43() {
|
||||
# Check if option value is in encapsulated form
|
||||
local opt43="$1"
|
||||
local len="$2"
|
||||
|
||||
[ "$len" -gt "2" ] || return
|
||||
|
||||
first_byte=${opt43:0:2}
|
||||
first_byte=$(printf "%d\n" "0x$first_byte")
|
||||
|
||||
if [ $len -ge 4 ] && [ $first_byte -ge 1 ] && [ $first_byte -le 4 ]; then
|
||||
# it is in encapsulated form
|
||||
# opt43 encapsulated vendor-specific option has data in below format
|
||||
# Code Len Data item Code Len Data item Code
|
||||
# +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
|
||||
# | T1 | n | d1 | d2 | ... | T2 | n | D1 | D2 | ... | ... |
|
||||
# +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
|
||||
|
||||
#hex-string 2 character=1 Byte
|
||||
# length in hex string will be twice of actual Byte length
|
||||
|
||||
data="${opt43}"
|
||||
rem_len="${len}"
|
||||
# parsing of suboption of option 43
|
||||
while [ $rem_len -gt 0 ]; do
|
||||
# get the suboption id
|
||||
sub_opt_id=${data:0:2}
|
||||
sub_opt_id=$(printf "%d\n" "0x$sub_opt_id")
|
||||
|
||||
# get the length of suboption
|
||||
sub_opt_len=${data:2:2}
|
||||
sub_opt_len=$(printf "%d\n" "0x$sub_opt_len")
|
||||
sub_opt_len=$(( sub_opt_len * 2 ))
|
||||
|
||||
# get the value of sub option starting 4 means starting after length
|
||||
sub_opt_val=${data:4:${sub_opt_len}}
|
||||
|
||||
# assign the value found in sub option
|
||||
case "${sub_opt_id}" in
|
||||
"1") DHCP_ACS_URL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"2") DHCP_PROV_CODE=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"3") MIN_WAIT_INVL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"4") INVL_MULTIPLIER=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
esac
|
||||
|
||||
# add 2 bytes for sub_opt id and sub_opt len field
|
||||
sub_opt_end=$(( sub_opt_len + 4 ))
|
||||
|
||||
# fetch next sub option hex string
|
||||
data=${data:${sub_opt_end}:${len}}
|
||||
|
||||
# update the remaining sub option hex string length
|
||||
rem_len=$((rem_len - sub_opt_end))
|
||||
done
|
||||
else
|
||||
DHCP_ACS_URL=$(echo -n $opt43 | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
fi
|
||||
}
|
||||
|
||||
config_load cwmp
|
||||
config_get wan_intf cpe default_wan_interface "wan"
|
||||
config_get dhcp_discovery acs dhcp_discovery "0"
|
||||
config_get dhcp_url acs dhcp_url ""
|
||||
config_get min_wait_intvl acs dhcp_retry_min_wait_interval "0"
|
||||
config_get intvl_multi acs dhcp_retry_interval_multiplier "0"
|
||||
|
||||
config_change=0
|
||||
discovery_enable=0
|
||||
|
||||
if [ "$dhcp_discovery" = "1" ] || [ "$dhcp_discovery" = "true" ] || [ "$dhcp_discovery" = "enable" ]; then
|
||||
discovery_enable=1
|
||||
fi
|
||||
|
||||
if [ "$discovery_enable" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
if [ -n "$opt43" ]; then
|
||||
len=$(printf "$opt43"|wc -c)
|
||||
get_opt43 "$opt43" "$len"
|
||||
fi
|
||||
|
||||
if [ -z "$DHCP_ACS_URL" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
sec=$(uci -q get cwmp.acs)
|
||||
|
||||
if [ -z "${sec}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${dhcp_url}" != "${DHCP_ACS_URL}" ]; then
|
||||
uci -q set cwmp.acs.dhcp_url="$DHCP_ACS_URL"
|
||||
config_change=1
|
||||
fi
|
||||
|
||||
if [ -n "$MIN_WAIT_INVL" ] && [ "${MIN_WAIT_INVL}" != "${min_wait_intvl}" ]; then
|
||||
uci -q set cwmp.acs.dhcp_retry_min_wait_interval="$MIN_WAIT_INVL"
|
||||
config_change=1
|
||||
fi
|
||||
|
||||
if [ -n "$INVL_MULTIPLIER" ] && [ "${INVL_MULTIPLIER}" != "${intvl_multi}" ]; then
|
||||
uci -q set cwmp.acs.dhcp_retry_interval_multiplier="$INVL_MULTIPLIER"
|
||||
config_change=1
|
||||
fi
|
||||
|
||||
sec=$(uci -q get cwmp.cpe)
|
||||
|
||||
if [ -n "${sec}" ] && [ -n "$DHCP_PROV_CODE" ]; then
|
||||
uci -q set cwmp.cpe.dhcp_provisioning_code="$DHCP_PROV_CODE"
|
||||
config_change=1
|
||||
fi
|
||||
|
||||
if [ $config_change -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# ACS url has been set, inform icwmpd to reload new configuration
|
||||
sleep 10 # wait for some time to avoid interface fluctuation
|
||||
|
||||
ubus call uci commit '{"config":"cwmp"}'
|
||||
fi
|
||||
@@ -20,7 +20,6 @@ config IEEE1905_WIFI_EASYMESH
|
||||
|
||||
config IEEE1905_CMDU_FRAGMENT_TLV_BOUNDARY
|
||||
bool "Fragment large CMDU frame at TLV boundary instead of octet boundary"
|
||||
default y
|
||||
|
||||
endmenu
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.2.22
|
||||
PKG_VERSION:=8.3.4
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=78ab0f41b76773a446bd64d6d981e2b91302c02b
|
||||
PKG_SOURCE_VERSION:=526690993c93720ee1707bba6b7a08e8c28f2dd9
|
||||
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
|
||||
@@ -123,7 +123,6 @@ define Build/InstallDev/libieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/cmdu_ackq.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/1905_tlvs.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/i1905_wsc.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/bufutil.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/timer_impl.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/i1905_extension.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/libmidgen.so $(1)/usr/lib/
|
||||
|
||||
@@ -4,6 +4,7 @@ config ieee1905 'ieee1905'
|
||||
list extmodule 'map'
|
||||
list extmodule 'topology'
|
||||
option registrar '2 5 6'
|
||||
list exclude_tagging '/eth.*'
|
||||
# option macaddress '0a:1b:2c:3d:4e:50'
|
||||
|
||||
config al-iface
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=96
|
||||
START=60
|
||||
STOP=21
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2016 iopsys
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=inbd
|
||||
PKG_VERSION:=1.2.3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=d4e910a31039e0c0b7a539311eafcd716c36be77
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/inbd
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
# support parallel build
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
#re create configure scripts if not present.
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
# run install target when cross compiling. basically, make install DESTDIR=$(PKG_INSTALL_DIR)
|
||||
# this way we don't need to pick out the resulting files from the build dir.
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/inbd
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=iopsys Netlink Bridge Daemon
|
||||
URL:=
|
||||
DEPENDS:=+libuci +libubus +libblobmsg-json +libnl-genl
|
||||
endef
|
||||
|
||||
define Package/inbd/description
|
||||
Application handling netlink messages from kernel and sending them out on ubus.
|
||||
endef
|
||||
|
||||
define Package/inbd/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/inbd $(1)/usr/bin/
|
||||
cp $(PKG_BUILD_DIR)/files/etc/init.d/inbd $(1)/etc/init.d/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,inbd))
|
||||
21
iop/config
21
iop/config
@@ -11,10 +11,19 @@ CONFIG_DEVEL=y
|
||||
CONFIG_USE_STRIP=y
|
||||
# CONFIG_SIGNED_PACKAGES is not set
|
||||
|
||||
CONFIG_JSON_CYCLONEDX_SBOM=y
|
||||
CONFIG_INCLUDE_CONFIG=y
|
||||
|
||||
# Image #
|
||||
CONFIG_TARGET_CUSTOMER="IOPSYS"
|
||||
CONFIG_TARGET_ROOTFS_TARGZ=y
|
||||
|
||||
# Although UBIFS and EXT4 images work on all non-secure-boot devices,
|
||||
# squashfs is the only officially supported rootfs filesystem.
|
||||
# A writable rootfs is useful for developping an debugging preinit code.
|
||||
# CONFIG_TARGET_ROOTFS_UBIFS is not set
|
||||
# CONFIG_TARGET_ROOTFS_EXT4FS is not set
|
||||
|
||||
# /etc/banner and /etc/device_info #
|
||||
CONFIG_IMAGEOPT=y
|
||||
CONFIG_VERSIONOPT=y
|
||||
@@ -55,7 +64,6 @@ CONFIG_LOCALMIRROR="https://download.iopsys.eu/iopsys/mirror/"
|
||||
################
|
||||
|
||||
# EasySoC HAL #
|
||||
CONFIG_PACKAGE_inbd=y
|
||||
CONFIG_PACKAGE_qosmngr=y
|
||||
CONFIG_PACKAGE_libwifiutils=y
|
||||
CONFIG_PACKAGE_wifimngr=y
|
||||
@@ -94,6 +102,7 @@ CONFIG_PACKAGE_udpecho-server=y
|
||||
CONFIG_PACKAGE_userinterface=y
|
||||
CONFIG_PACKAGE_xmppc=y
|
||||
CONFIG_PACKAGE_timemngr=y
|
||||
CONFIG_PACKAGE_self-diagnostics=y
|
||||
|
||||
# WebGUI #
|
||||
CONFIG_PACKAGE_sulu=y
|
||||
@@ -169,6 +178,8 @@ CONFIG_PACKAGE_iptables-mod-ipmark=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipopt=y
|
||||
CONFIG_PACKAGE_iptables-mod-nflog=y
|
||||
CONFIG_PACKAGE_iptables-mod-nfqueue=y
|
||||
CONFIG_PACKAGE_iputils-arping=y
|
||||
CONFIG_PACKAGE_iputils-ping=y
|
||||
CONFIG_PACKAGE_ndisc6=y
|
||||
CONFIG_PACKAGE_rdisc6=y
|
||||
CONFIG_PACKAGE_resolveip=y
|
||||
@@ -185,6 +196,7 @@ CONFIG_PACKAGE_at=y
|
||||
CONFIG_PACKAGE_ca-certificates=y
|
||||
CONFIG_PACKAGE_crun=y
|
||||
CONFIG_PACKAGE_getopt=y
|
||||
CONFIG_PACKAGE_gpiod-tools=y
|
||||
# CONFIG_PACKAGE_iwatchdog is not set
|
||||
CONFIG_PACKAGE_jq=y
|
||||
CONFIG_PACKAGE_libcap-bin=y
|
||||
@@ -237,12 +249,10 @@ CONFIG_PACKAGE_nginx-mod-luci=y
|
||||
|
||||
CONFIG_BUSYBOX_CUSTOM=y
|
||||
CONFIG_BUSYBOX_CONFIG_ADDUSER=y
|
||||
CONFIG_BUSYBOX_CONFIG_ARPING=y
|
||||
CONFIG_BUSYBOX_CONFIG_ASH_IDLE_TIMEOUT=y
|
||||
CONFIG_BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT=y
|
||||
CONFIG_BUSYBOX_CONFIG_CTTYHACK=y
|
||||
CONFIG_BUSYBOX_CONFIG_DELUSER=y
|
||||
# CONFIG_BUSYBOX_CONFIG_DEVMEM is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCP_8021Q=y
|
||||
CONFIG_BUSYBOX_CONFIG_FIRST_SYSTEM_ID=100
|
||||
# CONFIG_BUSYBOX_CONFIG_HTTPD is not set
|
||||
@@ -319,3 +329,8 @@ CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_SQUASHFS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_UBIFS=y
|
||||
CONFIG_BUSYBOX_CONFIG_TIMEOUT=y
|
||||
CONFIG_BUSYBOX_CONFIG_NOHUP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="sha512"
|
||||
# CONFIG_BUSYBOX_CONFIG_ARPING is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_PING is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_PING6 is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_PING is not set
|
||||
|
||||
@@ -4,7 +4,18 @@ function feeds_update {
|
||||
heads=1
|
||||
developer=0
|
||||
override=1
|
||||
while getopts "inh" opt; do
|
||||
force=1
|
||||
|
||||
function update_failure {
|
||||
if [ $force == 1 ]; then
|
||||
echo "WARNING: Failed to update feed(s). Forced update, proceeding anyway." >&2
|
||||
else
|
||||
echo "ERROR: Failed to update feed(s). Omit -F to proceed anyway." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
while getopts "inFh" opt; do
|
||||
case $opt in
|
||||
i)
|
||||
heads=0
|
||||
@@ -12,12 +23,16 @@ function feeds_update {
|
||||
n)
|
||||
override=0
|
||||
;;
|
||||
F)
|
||||
force=0
|
||||
;;
|
||||
h|\?)
|
||||
echo "Usage: ./iop feeds_update [-i] [-n] [-h]"
|
||||
echo "Usage: ./iop feeds_update [-i] [-n] [-F] [-h]"
|
||||
echo
|
||||
echo "OPTIONS:"
|
||||
echo " -i - Only update index. Do not change HEAD in feeds."
|
||||
echo " -n - Do not replace core packages with iopsys versions."
|
||||
echo " -F - Do not force update if there are inaccessible feeds."
|
||||
echo " -h - Display this help message and exit."
|
||||
exit 1
|
||||
;;
|
||||
@@ -30,9 +45,9 @@ function feeds_update {
|
||||
|
||||
if [ $heads == 1 ]; then
|
||||
if [ $developer == 1 ]; then
|
||||
./scripts/feeds update -g
|
||||
./scripts/feeds update -g || update_failure
|
||||
else
|
||||
./scripts/feeds update
|
||||
./scripts/feeds update || update_failure
|
||||
fi
|
||||
fi
|
||||
./scripts/feeds update -ai || exit 1
|
||||
@@ -46,7 +61,7 @@ function feeds_update {
|
||||
(
|
||||
echo '# DO NOT EDIT. Autogenerated file by ./iop feeds_update'
|
||||
echo 'FEED_DEVICES_DIRS:='
|
||||
find feeds -type f -name .is-feed-devices-dir -printf 'FEED_DEVICES_DIRS+=$(TOPDIR)/%h'
|
||||
find feeds -type f -name .is-feed-devices-dir -printf 'FEED_DEVICES_DIRS+=$(TOPDIR)/%h\n'
|
||||
) > target/linux/feed-devices/feed-devices-list.mk || exit 1
|
||||
|
||||
# targets need to be installed explicitly
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
function genconfig {
|
||||
export CLEAN=0
|
||||
export DIRTY="--dirty"
|
||||
export IMPORT=1
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
@@ -198,6 +199,7 @@ function genconfig {
|
||||
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
echo
|
||||
echo -e " -c|--clean\t\tRemove all files under ./files and import from config "
|
||||
echo -e " -D|--no-dirty\t\tIgnore dirty tree"
|
||||
echo -e " -v|--verbose\t\tVerbose"
|
||||
echo -e " -n|--no-update\tDo NOT! Update customer config before applying"
|
||||
echo -e " -t|--target\t\tExplicitly specify the linux target to build the board profile from"
|
||||
@@ -363,11 +365,27 @@ function genconfig {
|
||||
echo "" >> .config
|
||||
fi
|
||||
# hack to support custom-devices until we have deprecated this genconfig-script...
|
||||
if [ -f "feeds/custom_devices/devices/$target/config/$BOARDTYPE/config" ]; then
|
||||
cat "feeds/custom_devices/devices/$target/config/$BOARDTYPE/config" >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
|
||||
local custom_found=false
|
||||
local used_config_file
|
||||
|
||||
for config_file in feeds/*/devices/$target/config/$BOARDTYPE/config; do
|
||||
if [ "$custom_found" = "true" ]; then
|
||||
echo
|
||||
echo "Error was found!"
|
||||
echo "Please use only one path."
|
||||
echo "Two instances of $target/config/$BOARDTYPE exists:"
|
||||
echo "Path 1: $used_config_file"
|
||||
echo "Path 2: $config_file"
|
||||
return 1
|
||||
fi
|
||||
if [ -f "$config_file" ]; then
|
||||
cat "$config_file" >> .config
|
||||
echo "" >> .config
|
||||
custom_found=true
|
||||
used_config_file=$config_file
|
||||
fi
|
||||
done
|
||||
|
||||
# Special handling for targets which use TARGET_DEVICES
|
||||
case "$target" in
|
||||
airoha | mediatek | brcmbca | ipq95xx | ipq53xx)
|
||||
@@ -381,6 +399,8 @@ function genconfig {
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
;;
|
||||
*)
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
@@ -416,7 +436,7 @@ function genconfig {
|
||||
|
||||
# Set target version
|
||||
local git_version
|
||||
if ! git_version="$(git describe --always --dirty --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then
|
||||
if ! git_version="$(git describe --always $DIRTY --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then
|
||||
echo "ERROR: Failed getting version via git describe, exiting." >&2
|
||||
return 1
|
||||
fi
|
||||
@@ -483,6 +503,7 @@ function genconfig {
|
||||
case "$1" in
|
||||
|
||||
-c|--clean) export CLEAN=1;;
|
||||
-D|--no-dirty) export DIRTY="";;
|
||||
-n|--no-update) export IMPORT=0;;
|
||||
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-t|--target) export TARGET="$2"; shift;;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
function genconfig_min {
|
||||
export CLEAN=0
|
||||
export DIRTY="--dirty"
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
CURRENT_CONFIG_FILE=".current_config_file"
|
||||
@@ -197,6 +198,7 @@ function genconfig_min {
|
||||
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
echo
|
||||
echo -e " -c|--clean\t\tRemove all files under ./files and import from config "
|
||||
echo -e " -D|--no-dirty\t\tIgnore dirty tree"
|
||||
echo -e " -v|--verbose\t\tVerbose"
|
||||
echo -e " -n|--no-update\tDo NOT! Update customer config before applying"
|
||||
echo -e " -t|--target\t\tExplicitly specify the linux target to build the board profile from"
|
||||
@@ -337,10 +339,26 @@ function genconfig_min {
|
||||
echo "" >> .config
|
||||
fi
|
||||
# hack to support custom-devices until we have deprecated this genconfig-script...
|
||||
if [ -f "feeds/custom_devices/devices/$target/config/$BOARDTYPE/config" ]; then
|
||||
cat "feeds/custom_devices/devices/$target/config/$BOARDTYPE/config" >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
local custom_found=false
|
||||
local used_config_file
|
||||
|
||||
for config_file in feeds/*/devices/$target/config/$BOARDTYPE/config; do
|
||||
if [ "$custom_found" = "true" ]; then
|
||||
echo
|
||||
echo "Error was found!"
|
||||
echo "Please use only one path."
|
||||
echo "Two instances of $target/config/$BOARDTYPE exists:"
|
||||
echo "Path 1: $used_config_file"
|
||||
echo "Path 2: $config_file"
|
||||
return 1
|
||||
fi
|
||||
if [ -f "$config_file" ]; then
|
||||
cat "$config_file" >> .config
|
||||
echo "" >> .config
|
||||
custom_found=true
|
||||
used_config_file=$config_file
|
||||
fi
|
||||
done
|
||||
|
||||
# Special handling for targets which use TARGET_DEVICES
|
||||
case "$target" in
|
||||
@@ -355,6 +373,8 @@ function genconfig_min {
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
;;
|
||||
*)
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
@@ -390,7 +410,7 @@ function genconfig_min {
|
||||
|
||||
# Set target version
|
||||
local git_version
|
||||
if ! git_version="$(git describe --always --dirty --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then
|
||||
if ! git_version="$(git describe --always $DIRTY --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then
|
||||
echo "ERROR: Failed getting version via git describe, exiting." >&2
|
||||
return 1
|
||||
fi
|
||||
@@ -451,6 +471,7 @@ function genconfig_min {
|
||||
case "$1" in
|
||||
|
||||
-c|--clean) export CLEAN=1;;
|
||||
-D|--no-dirty) export DIRTY="";;
|
||||
-n|--no-update) export IMPORT=0;;
|
||||
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-t|--target) export TARGET="$2"; shift;;
|
||||
|
||||
57
libdpp/Makefile
Normal file
57
libdpp/Makefile
Normal file
@@ -0,0 +1,57 @@
|
||||
#
|
||||
# Copyright (C) 2020-2023 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libdpp
|
||||
PKG_VERSION:=2.0.0
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=f22959b107a8bf443d04d6261d00074b5514dfe8
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/libdpp.git
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=LGPL-2.1-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
define Package/libdpp/description
|
||||
Library providing APIs for DPP EasyConnect frame generation and handling
|
||||
endef
|
||||
|
||||
define Package/libdpp
|
||||
TITLE:= DPP EasyConnect library (libdpp)
|
||||
DEPENDS:= +libeasy +libopenssl +libgcrypt +libubox +libwifiutils
|
||||
endef
|
||||
|
||||
MAKE_PATH:=lib
|
||||
|
||||
|
||||
define Build/InstallDev/libdpp
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/dpp_api.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/dpputils.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libdpp.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
define Build/InstallDev
|
||||
$(call Build/InstallDev/libdpp,$(1),$(2))
|
||||
endef
|
||||
|
||||
define Package/libdpp/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libdpp.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libdpp))
|
||||
@@ -24,8 +24,9 @@ include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
|
||||
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/opensource/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
|
||||
else ifeq ($(CONFIG_TARGET_x86),y)
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libeasy
|
||||
PKG_VERSION:=7.2.100
|
||||
PKG_VERSION:=7.4.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=32db1b79bd88eba85a3e7518dbbbd1e29f4b06d9
|
||||
PKG_SOURCE_VERSION:=11eb263666556c419220e2a50c3a67422e79f884
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libeasy.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -50,6 +50,9 @@ define Build/InstallDev/libeasy
|
||||
$(CP) $(PKG_BUILD_DIR)/easy.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/event.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/utils.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/bufutil.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/cryptutil.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/ecc_cryptutil.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/if_utils.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/debug.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/hlist.h $(1)/usr/include/easy/
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libethernet
|
||||
PKG_VERSION:=7.2.105
|
||||
PKG_VERSION:=7.2.107
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4a363a699c4a8024054ca095f1b7818f8bd56ded
|
||||
PKG_SOURCE_VERSION:=9c0e9ecd62b79d4e89b4f013f04124870d237395
|
||||
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
|
||||
@@ -24,8 +24,9 @@ include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
|
||||
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/shared/opensource/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libqos
|
||||
PKG_VERSION:=7.2.105
|
||||
PKG_VERSION:=7.2.106
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=61b15e0fe345186d36d0ca3212a08f384af3609b
|
||||
PKG_SOURCE_VERSION:=02dba6571fddd9b4c5b4b671270604b4c0faf9ae
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libqos.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -24,8 +24,9 @@ include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
|
||||
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/opensource/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
|
||||
else ifeq ($(CONFIG_TARGET_x86),y)
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-airoha
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.8
|
||||
PKG_VERSION:=1.0.10
|
||||
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:=a6a70c7259ba440f7587f4f79d29e8caecafa544
|
||||
PKG_SOURCE_VERSION:=e6ba6fca814f6c83a3d6ff4a5b7560fbc36d3101
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-broadcom
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_VERSION:=1.0.8
|
||||
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:=14e626db4e8943c100602e6e73e0b1652ff3faca
|
||||
PKG_SOURCE_VERSION:=e1de60c2c05935fb2f4adfc1f73feba0bb32ade6
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -28,7 +28,7 @@ PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD
|
||||
|
||||
LIBVOICE_PKG_BUILD_DIR := $(PKG_BUILD_DIR)
|
||||
|
||||
export CONFIG_BCM_CHIP_ID
|
||||
export BCM_CHIP_ID:=$(SUBTARGET)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-d2
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.15
|
||||
PKG_VERSION:=1.1.2
|
||||
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:=499abc3c7932bf5187bce6cabeffdc0c0f6eada8
|
||||
PKG_SOURCE_VERSION:=e6d689334000bc57498d9a3f203a8933160e1ef4
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libwifi
|
||||
PKG_VERSION:=7.4.6
|
||||
PKG_VERSION:=7.4.18
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=57348d9a901c33650ebfe8b5d8f35a0b57d12a89
|
||||
PKG_SOURCE_VERSION:=4f6d22e0afa199bcff63f084a022c6142883973f
|
||||
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
|
||||
@@ -26,8 +26,9 @@ include $(INCLUDE_DIR)/package.mk
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
TARGET_WIFI_TYPE=BROADCOM
|
||||
CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
|
||||
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/opensource/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
|
||||
else ifeq ($(CONFIG_TARGET_x86),y)
|
||||
@@ -142,7 +143,7 @@ define Package/libwifi/config
|
||||
|
||||
config LIBWIFI_USE_CTRL_IFACE
|
||||
bool "Create UNIX sockets to interface with hostapd/wpa_supplicant"
|
||||
default n
|
||||
default y
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
@@ -52,5 +52,8 @@ config AGENT_OPER_CHANNEL_CHANGE_RELAY_MCAST
|
||||
bool "Use config opt to determine if Oper Channel Report CMDU is send as relayed multicast or directly to controller"
|
||||
default y
|
||||
|
||||
config AGENT_USE_LIBDPP
|
||||
bool "Depend on libdpp for DPP EasyConnect"
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=4.3.7.2
|
||||
PKG_VERSION:=4.5.1.0
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=406b484e33f5f9862f2adcc95c8e8231a7bde87c
|
||||
PKG_SOURCE_VERSION:=6d74ca3c6a4a2893160a5de2f7f455a8d8596fec
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
@@ -28,9 +28,12 @@ define Package/map-agent
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi multi-AP Agent (EasyMesh R2)
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
|
||||
+map-plugin +ip-bridge
|
||||
+map-plugin +ip-bridge +AGENT_USE_LIBDPP:libdpp
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_AGENT_USE_LIBDPP),y)
|
||||
TARGET_CFLAGS += -DUSE_LIBDPP
|
||||
endif
|
||||
|
||||
define Package/dynbhd
|
||||
SECTION:=utils
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
config agent 'agent'
|
||||
option enabled '0'
|
||||
option debug '0'
|
||||
option profile '4'
|
||||
option profile '3'
|
||||
option al_bridge 'br-lan'
|
||||
option netdev 'wlan'
|
||||
option island_prevention '0'
|
||||
|
||||
@@ -19,8 +19,8 @@ is_broadcom() {
|
||||
}
|
||||
|
||||
is_qualcomm() {
|
||||
[ -f /proc/device-tree/compatible ] || return
|
||||
strings /proc/device-tree/compatible | grep -qE '^(qcom,|ipq,)'; return
|
||||
[ -d /sys/module/ath12k ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
generate_multiap_config() {
|
||||
@@ -80,6 +80,7 @@ generate_multiap_config() {
|
||||
ifprefix="wlan0%-"
|
||||
ifname="wlan${devidx}"
|
||||
ifname_bh="wlan${devidx}-1"
|
||||
ap_follow_sta_dfs="1"
|
||||
else
|
||||
ifprefix="wlan%-"
|
||||
ifname="wlan$devidx"
|
||||
@@ -89,6 +90,7 @@ generate_multiap_config() {
|
||||
if [ $generate_mapagent_config -eq 1 ]; then
|
||||
uci set mapagent.agent.ifprefix="$ifprefix"
|
||||
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"
|
||||
|
||||
@@ -26,5 +26,9 @@ config CONTROLLER_EASYMESH_VENDOR_EXT_OUI
|
||||
enabled through CONTROLLER_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
|
||||
through which such features would be exposed.
|
||||
|
||||
config CONTROLLER_USE_LIBDPP
|
||||
bool "Depend on libdpp for DPP EasyConnect"
|
||||
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=4.3.3.1
|
||||
PKG_VERSION:=4.5.0.4
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=1faf0fce0d524f626638e08bd45348d11631f390
|
||||
PKG_SOURCE_VERSION:=59a3bb0e2cbd0f37f60bd121e4b30289a64d310e
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
@@ -27,9 +27,15 @@ define Package/map-controller
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi Multi-AP Controller (EasyMesh R2)
|
||||
DEPENDS:=+libuci +libubox +ubus +libeasy +libwifiutils +libieee1905 +ieee1905 +map-plugin
|
||||
DEPENDS:=+libuci +libubox +ubus +libeasy +libwifiutils +libieee1905 +ieee1905 +map-plugin \
|
||||
+CONTROLLER_USE_LIBDPP:libdpp
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_CONTROLLER_USE_LIBDPP),y)
|
||||
TARGET_CFLAGS += -DUSE_LIBDPP
|
||||
endif
|
||||
|
||||
|
||||
define Package/map-controller/description
|
||||
This package provides WiFi MultiAP Controller as per the EasyMesh-R2 specs.
|
||||
endef
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
config controller 'controller'
|
||||
option enabled '1' # may be modified by other package start-up scripts (i.e. map-agent)
|
||||
option profile '4'
|
||||
option profile '3'
|
||||
option registrar '2 5 6'
|
||||
option debug '0'
|
||||
option bcn_metrics_max_num '10'
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
WIFI_BH_KEY=$(openssl rand -rand /dev/urandom -hex 64 2>/dev/null | openssl dgst -hex -sha256 | cut -d " " -f 2)
|
||||
WIFI_BH_KEY=${WIFI_BH_KEY::-1}
|
||||
|
||||
BASEMAC_ADDR="$(fw_printenv -n ethaddr | tr -d ':')"
|
||||
BASEMAC_ADDR="$(fw_printenv -n ethaddr | tr -d ':' | tr 'a-z' 'A-Z')"
|
||||
[ ${#BASEMAC_ADDR} -eq 12 ] || BASEMAC_ADDR="$(db -q get device.deviceinfo.BaseMACAddress | tr -d ':')"
|
||||
|
||||
WIFI_FH_KEY="$(db get hw.board.wpa_key)"
|
||||
|
||||
@@ -89,15 +89,24 @@ interfaces_ok(){
|
||||
# check if upstream untagged
|
||||
IFS=" "
|
||||
for itf in $up_interf; do
|
||||
# check if there exist a device section for this upstream interface, if yes the
|
||||
# do nothing, if no then split the it at . and use the native interface as
|
||||
# upstream interface
|
||||
dev_section=$(ubus call uci get '{"config":"network", "type":"device", "match":{"name":"'"$itf"'"}}' | jsonfilter -e @.values | jq keys[])
|
||||
# check if there exist a interface section for this upstream interface, if yes the
|
||||
# do nothing, if no then generate config as mcast config is outdated
|
||||
local dev_section=$(uci show network | grep -E "\.device=\'$itf\'" | cut -d'.' -f2)
|
||||
|
||||
# mcast config is outdated, simply generate as per new logic
|
||||
if [ -z "$dev_section" ]; then
|
||||
# check if the itf is a native interface && return 1
|
||||
[ -f "/proc/net/vlan/$itf" ] || return 1
|
||||
return 1
|
||||
else
|
||||
section_type=$(uci get network.$dev_section)
|
||||
if [ "$section_type" == "interface" ]; then
|
||||
# interface section exits, hence, sync has already happened
|
||||
# nothing to do further, just return
|
||||
return 0
|
||||
else
|
||||
# mcast config is outdated
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
|
||||
@@ -15,7 +15,7 @@ snooping_bridges=
|
||||
|
||||
__device_is_bridge() {
|
||||
local device="$2"
|
||||
local devsec__="$(uci show network | grep name=.*$device | cut -d'.' -f2)"
|
||||
local devsec__="$(uci show network | grep name=.*$device | grep -v ifname | cut -d'.' -f2)"
|
||||
local sectype="$(uci -q get network.$devsec__)"
|
||||
local devtype="$(uci -q get network.$devsec__.type)"
|
||||
[ "$sectype" != "device" -o "$devtype" != "bridge" ] && return 1
|
||||
@@ -311,6 +311,16 @@ config_mcproxy_instance() {
|
||||
PROG_PARAMS="${PROG_PARAMS} -f ${CONFFILE}${PROG_PARAMS_SEPARATOR}"
|
||||
}
|
||||
|
||||
disable_snooping_iface() {
|
||||
local iface="$(uci -q get network.$1.name)"
|
||||
config_sysfs_mcast_snooping "$iface" 0
|
||||
}
|
||||
|
||||
disable_snooping() {
|
||||
config_load network
|
||||
config_foreach disable_snooping_iface device
|
||||
}
|
||||
|
||||
config_snooping() {
|
||||
local protocol="$1"
|
||||
|
||||
@@ -383,6 +393,7 @@ config_snooping() {
|
||||
}
|
||||
|
||||
config_mcproxy() {
|
||||
disable_snooping
|
||||
if [ "$igmp_p_enable" == "1" ]; then
|
||||
config_mcproxy_instance igmp "$igmp_p_version"
|
||||
elif [ "$igmp_s_enable" == "1" ]; then
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
* Erik Karlsson - initial implementation
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <string.h>
|
||||
#include <shadow.h>
|
||||
#include <crypt.h>
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=7.0.4.11
|
||||
PKG_VERSION:=7.0.5.8
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
|
||||
PKG_SOURCE_VERSION:=1211494650d170cc23e7d041dd5bff260530080e
|
||||
PKG_SOURCE_VERSION:=d11c8505ffddb4c840d630632b0bb7dda04ca5b2
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -61,7 +61,505 @@
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_ALL"
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.Reboot()",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.FactoryReset()",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Time.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UPnP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Bridging.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Ethernet.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv4.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv4.Server.Pool.{i}.StaticAddress.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv6.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Hosts.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.{BBF_VENDOR_PREFIX}URLFilter.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.NAT.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PPP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Routing.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.IEEE1905.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.InterfaceStack.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DynamicDNS.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.LANConfigSecurity.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Security.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.RouterAdvertisement.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Services.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UserInterface.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PeriodicStatistics.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.SoftwareModules.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Users.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.LocalAgent.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.LocalAgent.Subscription.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DNS.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.IP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.SSH.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -277,27 +775,6 @@
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.SoftwareModules.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Users.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.LocalAgent.Subscription.",
|
||||
"perm": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/core/bdc_exec.c
|
||||
+++ b/src/core/bdc_exec.c
|
||||
@@ -547,11 +547,19 @@ int StartSendingReport(bdc_connection_t
|
||||
@@ -547,11 +547,19 @@
|
||||
|
||||
// Set the list of headers
|
||||
bc->headers = NULL;
|
||||
@@ -25,7 +25,7 @@
|
||||
{
|
||||
--- a/src/core/bdc_exec.h
|
||||
+++ b/src/core/bdc_exec.h
|
||||
@@ -53,6 +53,9 @@ void BDC_EXEC_ScheduleExit(void);
|
||||
@@ -53,6 +53,9 @@
|
||||
#define BDC_FLAG_PUT 0x00000001 // If set, HTTP PUT should be used instead of HTTP POST when sending the report to the BDC server
|
||||
#define BDC_FLAG_GZIP 0x00000002 // If set, the reports contants are Gzipped
|
||||
#define BDC_FLAG_DATE_HEADER 0x00000004 // If set, the date header should be included in the HTTP post.
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
|
||||
// Definitions for Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp
|
||||
@@ -153,6 +156,7 @@ static char *profile_push_event_args[] =
|
||||
@@ -153,6 +156,7 @@
|
||||
typedef struct
|
||||
{
|
||||
int num_retained_failed_reports;
|
||||
@@ -60,7 +60,7 @@
|
||||
char report_timestamp[33];
|
||||
char url[1025];
|
||||
char username[257];
|
||||
@@ -161,6 +165,11 @@ typedef struct
|
||||
@@ -161,6 +165,11 @@
|
||||
char method[9];
|
||||
bool use_date_header;
|
||||
char report_format[20];
|
||||
@@ -72,7 +72,7 @@
|
||||
} profile_ctrl_params_t;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -208,6 +217,7 @@ int Validate_BulkDataEncodingType(dm_req
|
||||
@@ -208,6 +217,7 @@
|
||||
int Validate_BulkDataReportingInterval(dm_req_t *req, char *value);
|
||||
int Validate_BulkDataReference(dm_req_t *req, char *value);
|
||||
int Validate_BulkDataReportFormat(dm_req_t *req, char *value);
|
||||
@@ -80,7 +80,7 @@
|
||||
int Validate_BulkDataReportTimestamp(dm_req_t *req, char *value);
|
||||
int Validate_BulkDataCompression(dm_req_t *req, char *value);
|
||||
int Validate_BulkDataHTTPMethod(dm_req_t *req, char *value);
|
||||
@@ -236,6 +246,8 @@ bulkdata_profile_t *bulkdata_find_profil
|
||||
@@ -236,6 +246,8 @@
|
||||
int bulkdata_calc_report_map(bulkdata_profile_t *bp, kv_vector_t *report_map);
|
||||
int bulkdata_reduce_to_alt_name(char *spec, char *path, char *alt_name, char *out_buf, int buf_len);
|
||||
char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timestamp, char *report_format);
|
||||
@@ -89,15 +89,16 @@
|
||||
unsigned char *bulkdata_compress_report(profile_ctrl_params_t *ctrl, char *input_buf, int input_len, int *p_output_len);
|
||||
int bulkdata_schedule_sending_http_report(profile_ctrl_params_t *ctrl, bulkdata_profile_t *bp, unsigned char *json_report, int report_len);
|
||||
int bulkdata_start_profile(bulkdata_profile_t *bp);
|
||||
@@ -250,6 +262,7 @@ char *bulkdata_platform_calc_uri_query_s
|
||||
@@ -250,6 +262,8 @@
|
||||
int bulkdata_platform_get_param_refs(int profile_id, param_ref_vector_t *param_refs);
|
||||
void bulkdata_expand_param_ref(param_ref_entry_t *pr, group_get_vector_t *ggv);
|
||||
void bulkdata_append_to_result_map(param_ref_entry_t *pr, group_get_vector_t *ggv, kv_vector_t *report_map);
|
||||
+void append_string_to_target(char *str, char **output);
|
||||
+char *csv_encode(const char *str);
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
@@ -282,7 +295,7 @@ int DEVICE_BULKDATA_Init(void)
|
||||
@@ -282,7 +296,7 @@
|
||||
err |= USP_REGISTER_VendorParam_ReadOnly("Device.BulkData.Status", Get_BulkDataGlobalStatus, DM_STRING);
|
||||
err |= USP_REGISTER_Param_Constant("Device.BulkData.MinReportingInterval", BULKDATA_MINIMUM_REPORTING_INTERVAL_STR, DM_UINT);
|
||||
err |= USP_REGISTER_Param_SupportedList("Device.BulkData.Protocols", bdc_protocols, NUM_ELEM(bdc_protocols));
|
||||
@@ -106,7 +107,7 @@
|
||||
err |= USP_REGISTER_Param_Constant("Device.BulkData.ParameterWildCardSupported", "true", DM_BOOL);
|
||||
err |= USP_REGISTER_Param_Constant("Device.BulkData.MaxNumberOfProfiles", BULKDATA_MAX_PROFILES_STR, DM_INT);
|
||||
err |= USP_REGISTER_Param_Constant("Device.BulkData.MaxNumberOfParameterReferences", "-1", DM_INT);
|
||||
@@ -297,7 +310,7 @@ int DEVICE_BULKDATA_Init(void)
|
||||
@@ -297,7 +311,7 @@
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.Name", "", NULL, NULL, DM_STRING);
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.NumberOfRetainedFailedReports", "0", Validate_NumberOfRetainedFailedReports, NULL, DM_INT);
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.Protocol", BULKDATA_PROTOCOL_HTTP, Validate_BulkDataProtocol, NULL, DM_STRING);
|
||||
@@ -115,7 +116,7 @@
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.ReportingInterval", "86400", Validate_BulkDataReportingInterval, NotifyChange_BulkDataReportingInterval, DM_UINT);
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.TimeReference", UNKNOWN_TIME_STR, NULL, NotifyChange_BulkDataTimeReference, DM_DATETIME);
|
||||
|
||||
@@ -312,6 +325,13 @@ int DEVICE_BULKDATA_Init(void)
|
||||
@@ -312,6 +326,13 @@
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.JSONEncoding.ReportFormat", BULKDATA_JSON_REPORT_FORMAT_NAME_VALUE, Validate_BulkDataReportFormat, NULL, DM_STRING);
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp", BULKDATA_JSON_TIMESTAMP_FORMAT_EPOCH, Validate_BulkDataReportTimestamp, NULL, DM_STRING);
|
||||
|
||||
@@ -129,7 +130,7 @@
|
||||
// Device.BulkData.Profile.{i}.HTTP
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.HTTP.URL", "", NULL, NotifyChange_BulkDataURL, DM_STRING);
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.HTTP.Username", "", NULL, NULL, DM_STRING);
|
||||
@@ -591,9 +611,10 @@ int Validate_BulkDataProtocol(dm_req_t *
|
||||
@@ -591,9 +612,10 @@
|
||||
int Validate_BulkDataEncodingType(dm_req_t *req, char *value)
|
||||
{
|
||||
// Exit if trying to set a value outside of the range we accept
|
||||
@@ -142,7 +143,7 @@
|
||||
return USP_ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
@@ -676,6 +697,32 @@ int Validate_BulkDataReportFormat(dm_req
|
||||
@@ -676,6 +698,32 @@
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
@@ -175,7 +176,7 @@
|
||||
** Validate_BulkDataReportTimestamp
|
||||
**
|
||||
** Validates Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp
|
||||
@@ -1970,6 +2017,14 @@ int bulkdata_platform_get_profile_contro
|
||||
@@ -1970,6 +2018,14 @@
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -190,7 +191,7 @@
|
||||
// Exit if unable to get ReportTimestamp
|
||||
USP_SNPRINTF(path, sizeof(path), "Device.BulkData.Profile.%d.JSONEncoding.ReportTimestamp", bp->profile_id);
|
||||
err = DATA_MODEL_GetParameterValue(path, ctrl_params->report_timestamp, sizeof(ctrl_params->report_timestamp), 0);
|
||||
@@ -1986,6 +2041,46 @@ int bulkdata_platform_get_profile_contro
|
||||
@@ -1986,6 +2042,46 @@
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -237,7 +238,7 @@
|
||||
return USP_ERR_OK;
|
||||
}
|
||||
|
||||
@@ -2222,7 +2317,7 @@ void bulkdata_process_profile_http(bulkd
|
||||
@@ -2222,7 +2318,7 @@
|
||||
{
|
||||
int err;
|
||||
report_t *cur_report;
|
||||
@@ -246,7 +247,7 @@
|
||||
profile_ctrl_params_t ctrl;
|
||||
unsigned char *compressed_report;
|
||||
int compressed_len;
|
||||
@@ -2261,10 +2356,23 @@ void bulkdata_process_profile_http(bulkd
|
||||
@@ -2261,10 +2357,23 @@
|
||||
}
|
||||
|
||||
// Exit if unable to generate the report
|
||||
@@ -274,7 +275,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2273,14 +2381,14 @@ void bulkdata_process_profile_http(bulkd
|
||||
@@ -2273,14 +2382,14 @@
|
||||
USP_LOG_Info("BULK DATA: using compression method=%s", ctrl.compression);
|
||||
if (enable_protocol_trace)
|
||||
{
|
||||
@@ -293,7 +294,7 @@
|
||||
}
|
||||
// NOTE: From this point on, only the compressed_report exists
|
||||
|
||||
@@ -2310,9 +2418,15 @@ void bulkdata_process_profile_usp_event(
|
||||
@@ -2310,9 +2419,15 @@
|
||||
kv_vector_t event_args;
|
||||
kv_pair_t kv;
|
||||
report_t *cur_report;
|
||||
@@ -310,7 +311,7 @@
|
||||
|
||||
// Exit if the MTP has not been connected to successfully after bootup
|
||||
// This is to prevent BDC events being enqueued before the Boot! event is sent (the Boot! event is only sent after successfully connecting to the MTP).
|
||||
@@ -2321,20 +2435,62 @@ void bulkdata_process_profile_usp_event(
|
||||
@@ -2321,20 +2436,62 @@
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -384,7 +385,7 @@
|
||||
}
|
||||
|
||||
// When sending via USP events, only one report is ever sent in each USP event
|
||||
@@ -2354,10 +2510,16 @@ void bulkdata_process_profile_usp_event(
|
||||
@@ -2354,10 +2511,16 @@
|
||||
bp->num_retained_reports = 1;
|
||||
|
||||
// Exit if unable to generate the report
|
||||
@@ -404,7 +405,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2365,15 +2527,15 @@ void bulkdata_process_profile_usp_event(
|
||||
@@ -2365,15 +2528,15 @@
|
||||
|
||||
// Construct event_args manually to avoid the overhead of a malloc and copy of the report in KV_VECTOR_Add()
|
||||
kv.key = "Data";
|
||||
@@ -423,10 +424,37 @@
|
||||
|
||||
// From the point of view of this code, the report(s) have been successfully sent, so don't retain them
|
||||
// NOTE: Sending of the reports successfully is delegated to the USP notification retry mechanism
|
||||
@@ -2835,6 +2997,219 @@ char *bulkdata_generate_json_report(bulk
|
||||
@@ -2835,6 +2998,319 @@
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
+** safe_asprintf
|
||||
+**
|
||||
+** Wrapper around asprintf that calls terminate in case of error
|
||||
+**
|
||||
+** \param strp -- pointer to the output string
|
||||
+** \param fmt -- printing format
|
||||
+**
|
||||
+** \return None
|
||||
+**
|
||||
+**************************************************************************/
|
||||
+static void safe_asprintf(char **strp, const char *fmt, ...)
|
||||
+{
|
||||
+ int ret;
|
||||
+ va_list argp;
|
||||
+
|
||||
+ va_start(argp, fmt);
|
||||
+ ret = vasprintf(strp, fmt, argp);
|
||||
+ va_end(argp);
|
||||
+
|
||||
+ if (ret == -1) {
|
||||
+ USP_ERR_Terminate("%s (%d): asprintf(%s) failed",
|
||||
+ __FUNCTION__, __LINE__, fmt);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/*********************************************************************//**
|
||||
+**
|
||||
+** append_string_to_target
|
||||
+**
|
||||
+** concatenates the src string with target string in newly allocated memory
|
||||
@@ -454,10 +482,70 @@
|
||||
+ }
|
||||
+
|
||||
+ assert(tmp != NULL);
|
||||
+ asprintf(output, "%s%s", tmp, str);
|
||||
+ safe_asprintf(output, "%s%s", tmp, str);
|
||||
+ free(tmp);
|
||||
+}
|
||||
+
|
||||
+/*************************************************************************
|
||||
+**
|
||||
+** csv_encode
|
||||
+**
|
||||
+** encodes the src string to CSV specification RFC4180 compliance string
|
||||
+** and assign back the new pointer.
|
||||
+**
|
||||
+** \param str - pointer to the src string
|
||||
+** \return address of the pointer that points to the target string or NULL
|
||||
+**
|
||||
+**************************************************************************/
|
||||
+char *csv_encode(const char *str)
|
||||
+{
|
||||
+ if (str == NULL)
|
||||
+ return NULL;
|
||||
+
|
||||
+ int len = strlen(str);
|
||||
+ if (len == 0)
|
||||
+ return strdup(str);
|
||||
+
|
||||
+ char *temp = NULL;
|
||||
+ // Get the number of '\"' present in the string
|
||||
+ int quote_count = 0;
|
||||
+
|
||||
+ temp = strchr(str, '\"');
|
||||
+ while (temp) {
|
||||
+ quote_count++;
|
||||
+ temp = strchr(temp+1, '\"');
|
||||
+ }
|
||||
+
|
||||
+ int encode_size = len + quote_count + 3; // added 3 for initial quote, end quote & null at end
|
||||
+ temp = (char *)malloc(sizeof(char) * encode_size);
|
||||
+
|
||||
+ if (!temp)
|
||||
+ return NULL;
|
||||
+
|
||||
+ memset(temp, 0, sizeof(char) * encode_size);
|
||||
+
|
||||
+ int i = 0, j = 0;
|
||||
+
|
||||
+ temp[j++] = '\"';
|
||||
+ for (i = 0; i < len; i++) {
|
||||
+ if (str[i] == '\"') {
|
||||
+ if (j > (encode_size - 3))
|
||||
+ break;
|
||||
+
|
||||
+ temp[j++] = '\"';
|
||||
+ }
|
||||
+
|
||||
+ if (j > (encode_size - 3))
|
||||
+ break;
|
||||
+
|
||||
+ temp[j++] = str[i];
|
||||
+ }
|
||||
+
|
||||
+ temp[j] = '\"';
|
||||
+
|
||||
+ return temp;
|
||||
+}
|
||||
+
|
||||
+/*********************************************************************//**
|
||||
+**
|
||||
+** bulkdata_generate_csv_report
|
||||
@@ -502,9 +590,9 @@
|
||||
+
|
||||
+ if (strcasecmp(csv_format, "ParameterPerRow") == 0) {
|
||||
+ if (strcmp(row_timestamp, "None") == 0)
|
||||
+ asprintf(&str, "ParameterName%cParameterValue%cParameterType%c", separator, separator, rowseparator);
|
||||
+ safe_asprintf(&str, "ParameterName%cParameterValue%cParameterType%c", separator, separator, rowseparator);
|
||||
+ else
|
||||
+ asprintf(&str, "ReportTimestamp%cParameterName%cParameterValue%cParameterType%c", separator, separator, separator, rowseparator);
|
||||
+ safe_asprintf(&str, "ReportTimestamp%cParameterName%cParameterValue%cParameterType%c", separator, separator, separator, rowseparator);
|
||||
+
|
||||
+ assert(str != NULL);
|
||||
+ append_string_to_target(str, &output);
|
||||
@@ -521,14 +609,18 @@
|
||||
+ // Add Collection time to each csv report element (only if specified and not 'None')
|
||||
+ if (strcmp(row_timestamp, "Unix-Epoch")==0)
|
||||
+ {
|
||||
+ asprintf(×tamp, "%lld", (long long int)report->collection_time);
|
||||
+ safe_asprintf(×tamp, "%lld", (long long int)report->collection_time);
|
||||
+ }
|
||||
+ else if (strcmp(row_timestamp, "ISO-8601")==0)
|
||||
+ {
|
||||
+ char *result = iso8601_from_unix_time(report->collection_time, buf, sizeof(buf));
|
||||
+ if (result != NULL)
|
||||
+ {
|
||||
+ asprintf(×tamp, "%s", buf);
|
||||
+ char *val = csv_encode(buf);
|
||||
+ if (val) {
|
||||
+ safe_asprintf(×tamp, "%s", buf);
|
||||
+ free(val);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -579,11 +671,14 @@
|
||||
+ }
|
||||
+
|
||||
+ if (type) {
|
||||
+ char *p_path = csv_encode(param_path);
|
||||
+ char *p_value = csv_encode(param_value);
|
||||
+
|
||||
+ if (strcasecmp(csv_format, "ParameterPerRow") == 0) {
|
||||
+ if (timestamp == NULL)
|
||||
+ asprintf(&str, "%s%c%s%c%s%c", param_path, separator, param_value, separator, type, rowseparator);
|
||||
+ safe_asprintf(&str, "%s%c%s%c%s%c", p_path, separator, p_value, separator, type, rowseparator);
|
||||
+ else
|
||||
+ asprintf(&str, "%s%c%s%c%s%c%s%c", timestamp, separator, param_path, separator, param_value, separator, type, rowseparator);
|
||||
+ safe_asprintf(&str, "%s%c%s%c%s%c%s%c", timestamp, separator, p_path, separator, p_value, separator, type, rowseparator);
|
||||
+
|
||||
+ assert(str != NULL);
|
||||
+ append_string_to_target(str, &output);
|
||||
@@ -591,9 +686,9 @@
|
||||
+ str = NULL;
|
||||
+ } else {
|
||||
+ if (str1 == NULL || strlen(str1) == 0)
|
||||
+ asprintf(&str, "%s", param_path);
|
||||
+ safe_asprintf(&str, "%s", p_path);
|
||||
+ else
|
||||
+ asprintf(&str, "%c%s", separator, param_path);
|
||||
+ safe_asprintf(&str, "%c%s", separator, p_path);
|
||||
+
|
||||
+ assert(str != NULL);
|
||||
+ append_string_to_target(str, &str1);
|
||||
@@ -601,15 +696,21 @@
|
||||
+ str = NULL;
|
||||
+
|
||||
+ if (str2 == NULL || strlen(str2) == 0)
|
||||
+ asprintf(&str, "%s", param_value);
|
||||
+ safe_asprintf(&str, "%s", p_value);
|
||||
+ else
|
||||
+ asprintf(&str, "%c%s", separator, param_value);
|
||||
+ safe_asprintf(&str, "%c%s", separator, p_value);
|
||||
+
|
||||
+ assert(str != NULL);
|
||||
+ append_string_to_target(str, &str2);
|
||||
+ free(str);
|
||||
+ str = NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (p_path)
|
||||
+ free(p_path);
|
||||
+
|
||||
+ if (p_value)
|
||||
+ free(p_value);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -620,7 +721,7 @@
|
||||
+ }
|
||||
+
|
||||
+ if (strcasecmp(csv_format, "ParameterPerColumn") == 0) {
|
||||
+ asprintf(&str, "%c", rowseparator);
|
||||
+ safe_asprintf(&str, "%c", rowseparator);
|
||||
+ assert(str != NULL);
|
||||
+ append_string_to_target(str, &str1);
|
||||
+ append_string_to_target(str, &str2);
|
||||
@@ -643,7 +744,7 @@
|
||||
** bulkdata_compress_report
|
||||
**
|
||||
** Compresses the report to send
|
||||
@@ -2986,9 +3361,18 @@ int bulkdata_schedule_sending_http_repor
|
||||
@@ -2986,9 +3462,18 @@
|
||||
flags |= BDC_FLAG_DATE_HEADER;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
diff --git a/src/core/usp_err.c b/src/core/usp_err.c
|
||||
index 1626e58..6db1d42 100755
|
||||
--- a/src/core/usp_err.c
|
||||
+++ b/src/core/usp_err.c
|
||||
@@ -189,7 +189,9 @@ char *USP_ERR_ToString(int err, char *buf, int len)
|
||||
{
|
||||
#if HAVE_STRERROR_R && !STRERROR_R_CHAR_P
|
||||
// XSI version of strerror_r
|
||||
- strerror_r(err, buf, len);
|
||||
+ if (strerror_r(err, buf, len) != 0) {
|
||||
+ snprintf(buf, len, "Unknown error %d", err);
|
||||
+ }
|
||||
return buf;
|
||||
#else
|
||||
// GNU version of strerror_r
|
||||
56
porttrigger/Makefile
Normal file
56
porttrigger/Makefile
Normal file
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# Copyright (C) 2021-2023 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=porttrigger
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
LOCAL_DEV:=1
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/port-trigger.git
|
||||
PKG_SOURCE_VERSION:=
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/porttrigger
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Port Trigger Daemon
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api
|
||||
endef
|
||||
|
||||
define Package/porttrigger/description
|
||||
Manage port trigger
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ./port-trigger/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/porttrigger/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/lib/porttrigger
|
||||
|
||||
$(INSTALL_BIN) ./files/etc/init.d/porttrigger $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/config/porttrigger $(1)/etc/config/
|
||||
$(INSTALL_DATA) ./files/lib/port_trigger.sh $(1)/lib/porttrigger/
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/bbf_plugin/libporttrigger.so)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,porttrigger))
|
||||
1
porttrigger/files/etc/config/porttrigger
Normal file
1
porttrigger/files/etc/config/porttrigger
Normal file
@@ -0,0 +1 @@
|
||||
#port trigger uci file
|
||||
20
porttrigger/files/etc/init.d/porttrigger
Normal file
20
porttrigger/files/etc/init.d/porttrigger
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=65
|
||||
STOP=20
|
||||
USE_PROCD=1
|
||||
|
||||
. /lib/porttrigger/port_trigger.sh
|
||||
|
||||
start_service() {
|
||||
port_trigger_handling
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "firewall"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
start
|
||||
}
|
||||
99
porttrigger/files/lib/port_trigger.sh
Executable file
99
porttrigger/files/lib/port_trigger.sh
Executable file
@@ -0,0 +1,99 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
process_port_trigger() {
|
||||
local rule_id="$1"
|
||||
local is_enabled=""
|
||||
local duration=""
|
||||
local trigger_dport=""
|
||||
local trigger_dport_end=""
|
||||
local protocol=""
|
||||
local interface=""
|
||||
local open_dport=""
|
||||
local open_dport_end=""
|
||||
local open_protocol=""
|
||||
local ptg_id=""
|
||||
|
||||
config_get ptg_id "$rule_id" "dm_parent"
|
||||
|
||||
is_enabled=$(uci -q get porttrigger."$ptg_id".enable)
|
||||
|
||||
if [ -z "$is_enabled" ] || [ "$is_enabled" = "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
IP_RULE=""
|
||||
protocol=$(uci -q get porttrigger."$ptg_id".protocol)
|
||||
[ -z "$protocol" ] && return
|
||||
|
||||
if [ "$protocol" = "UDP" ] || [ "$protocol" = "udp" ]; then
|
||||
IP_RULE="$IP_RULE -p udp"
|
||||
elif [ "$protocol" = "TCP" ] || [ "$protocol" = "tcp" ]; then
|
||||
IP_RULE="$IP_RULE -p tcp"
|
||||
else
|
||||
return
|
||||
fi
|
||||
|
||||
trigger_dport=$(uci -q get porttrigger."$ptg_id".port)
|
||||
[ -z "$trigger_dport" ] && return
|
||||
IP_RULE="$IP_RULE --dport $trigger_dport"
|
||||
|
||||
trigger_dport_end=$(uci -q get porttrigger."$ptg_id".end_port_range)
|
||||
if [ -n "$trigger_dport_end" ]; then
|
||||
IP_RULE="$IP_RULE:$trigger_dport"
|
||||
fi
|
||||
|
||||
config_get open_protocol "$rule_id" "protocol"
|
||||
if [ "$open_protocol" = "UDP" ] || [ "$open_protocol" = "udp" ]; then
|
||||
IP_RULE="$IP_RULE -j TRIGGER --trigger-type out --trigger-proto udp"
|
||||
elif [ "$open_protocol" = "TCP" ] || [ "$open_protocol" = "tcp" ]; then
|
||||
IP_RULE="$IP_RULE -j TRIGGER --trigger-type out --trigger-proto tcp"
|
||||
else
|
||||
return
|
||||
fi
|
||||
|
||||
config_get open_dport "$rule_id" "port"
|
||||
[ -z "$open_dport" ] && return
|
||||
IP_RULE="$IP_RULE --trigger-match $open_dport"
|
||||
|
||||
config_get open_dport_end "$rule_id" "end_port_range"
|
||||
if [ -z "$open_dport_end" ]; then
|
||||
IP_RULE="$IP_RULE --trigger-relate $open_dport"
|
||||
else
|
||||
IP_RULE="$IP_RULE-$open_dport_end --trigger-relate $open_dport-$open_dport_end"
|
||||
fi
|
||||
|
||||
duration=$(uci -q get porttrigger."$ptg_id".auto_disable_duration)
|
||||
if [ -n "$duration" ]; then
|
||||
IP_RULE="$IP_RULE --trigger-timeout $duration"
|
||||
fi
|
||||
|
||||
interface=$(uci -q get porttrigger."$ptg_id".src)
|
||||
[ -z "$interface" ] && return
|
||||
device=$(uci show network | grep -w "name='.*$interface'" | cut -d'.' -f2)
|
||||
ports=$(uci -q get network."$device".ports)
|
||||
for port in ${ports}; do
|
||||
IP_RULE_1="iptables -t nat -A prerouting_porttrigger -i $port $IP_RULE"
|
||||
echo "$IP_RULE_1">>/tmp/port_trigger_iptables
|
||||
done
|
||||
}
|
||||
|
||||
port_trigger_handling() {
|
||||
rm /tmp/port_trigger_iptables
|
||||
iptables -w -t nat -F prerouting_porttrigger
|
||||
|
||||
touch /tmp/port_trigger_iptables
|
||||
prerouting_porttrigger=$(iptables -t nat --list | grep prerouting_porttrigger)
|
||||
if [ -z "$prerouting_porttrigger" ]; then
|
||||
iptables -w -t nat -N prerouting_porttrigger
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && iptables -w -t nat -I PREROUTING -j prerouting_porttrigger
|
||||
fi
|
||||
|
||||
# Load /etc/config/porttrigger UCI file
|
||||
config_load porttrigger
|
||||
config_foreach process_port_trigger rule
|
||||
|
||||
sh /tmp/port_trigger_iptables
|
||||
}
|
||||
@@ -23,6 +23,11 @@ get_burst_size_per_queue() {
|
||||
echo "1500"
|
||||
}
|
||||
|
||||
get_max_burst_size_per_queue() {
|
||||
# maximum burst size for tc class
|
||||
echo "4289999999"
|
||||
}
|
||||
|
||||
handle_q_weight() {
|
||||
local qid="$1" #queue section ID
|
||||
config_get ifname "$qid" "ifname"
|
||||
@@ -99,6 +104,8 @@ handle_queue() {
|
||||
local port_bs="$5"
|
||||
local par_class="$6"
|
||||
local priority=7
|
||||
local bs=0
|
||||
|
||||
config_get is_enable "$qid" "enable"
|
||||
|
||||
# no need to configure disabled queues
|
||||
@@ -146,6 +153,10 @@ handle_queue() {
|
||||
fi
|
||||
# burst size in tc class is given in bytes
|
||||
bs=$(( bs * 1000 ))
|
||||
local max_bs=$(get_max_burst_size_per_queue )
|
||||
if [ $bs -gt $max_bs ]; then
|
||||
bs=$max_bs
|
||||
fi
|
||||
|
||||
local salg=1
|
||||
|
||||
@@ -160,7 +171,14 @@ handle_queue() {
|
||||
;;
|
||||
esac
|
||||
|
||||
priority=`expr $priority - $order`
|
||||
[ -f /etc/board.json ] || return 0
|
||||
if [ $salg -ne 2 ]; then
|
||||
priority=$order
|
||||
wan_port=$(jsonfilter -i /etc/board.json -e @.network.wan.device)
|
||||
if [ "$wan_port" == "$port" ]; then
|
||||
priority=`expr 7 - $order`
|
||||
fi
|
||||
fi
|
||||
|
||||
local ceil_rate=$port_bw
|
||||
if [ "$rate" -lt "$port_bw" ]; then
|
||||
@@ -354,15 +372,20 @@ config_ingress_rate_limit() {
|
||||
|
||||
ingress_rate=$((ingress_rate / 1000))
|
||||
|
||||
if [ $in_burst_size -eq 0 ]; then
|
||||
in_burst_size=$ingress_rate
|
||||
else
|
||||
in_burst_size=$((in_burst_size / 1000))
|
||||
local bs=0
|
||||
local avg_bs=$(( ingress_rate * 25 ))
|
||||
config_get b_size "$sid" "burst_size"
|
||||
if [ "$in_burst_size" > "0" ]; then
|
||||
bs=`expr $in_burst_size / 1000`
|
||||
fi
|
||||
bs=$(( bs * 8 ))
|
||||
if [ $avg_bs -gt $bs ]; then
|
||||
bs="$avg_bs"
|
||||
fi
|
||||
|
||||
tc qdisc add dev $ifname ingress
|
||||
|
||||
tc filter add dev $ifname parent ffff: protocol ip prio $pindex u32 match ip src 0.0.0.0/0 police rate ${ingress_rate}kbit burst $in_burst_size drop flowid :$pindex
|
||||
tc filter add dev $ifname parent ffff: protocol ip prio $pindex u32 match ip src 0.0.0.0/0 police rate ${ingress_rate}kbit burst $bs drop flowid :$pindex
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=rulengd
|
||||
PKG_VERSION:=1.2.9
|
||||
PKG_VERSION:=1.2.10
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/rulengd.git
|
||||
PKG_SOURCE_VERSION:=1a3bf130d99ed275152c7d29b309d12c4400613d
|
||||
PKG_SOURCE_VERSION:=a32e325090d4303fe9aec786f81f0699006d21ab
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
35
self-diagnostics/Makefile
Normal file
35
self-diagnostics/Makefile
Normal file
@@ -0,0 +1,35 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=self-diagnostics
|
||||
PKG_VERSION:=1.0.4
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
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
|
||||
endef
|
||||
|
||||
define Package/self-diagnostics/description
|
||||
Generate Self test diagnostics report
|
||||
endef
|
||||
|
||||
#define Build/Prepare
|
||||
# mkdir -p $(PKG_BUILD_DIR)
|
||||
# $(CP) ./files/* $(PKG_BUILD_DIR)/
|
||||
#endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/self-diagnostics/install
|
||||
$(INSTALL_DIR) $(1)/etc/self-diagnostics/spec/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,self-diagnostics))
|
||||
188
self-diagnostics/README.md
Normal file
188
self-diagnostics/README.md
Normal file
@@ -0,0 +1,188 @@
|
||||
# Self Test Diagnostics and Reports
|
||||
|
||||
Self test diagnostics package provides a set of tools and recipes to run diagnostics/commands and collect logs.
|
||||
|
||||
It provides a cli utility called `self-diagnostics`, which executes recipes defined in json files and collect logs.
|
||||
```bash
|
||||
# self-diagnostics -h
|
||||
Generate self diagnostics report
|
||||
|
||||
Syntax: /usr/sbin/self-diagnostics [-m|h|l|j]
|
||||
|
||||
Options:
|
||||
l List available module(s)
|
||||
m Generate system report of specific module(s)
|
||||
j Enable JSON output
|
||||
h Print this help
|
||||
```
|
||||
|
||||
It also has an uci file to configure the various parameters:
|
||||
|
||||
```bash
|
||||
# cat /etc/config/self-diagnostics
|
||||
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 compression_level '9'
|
||||
```
|
||||
|
||||
Here:
|
||||
|
||||
| Options | Description |
|
||||
| ------------------ | ------------------------------- |
|
||||
| extended_spec_dir | Directory path to store 3rd-party/user diagnostics recipes |
|
||||
| exec_timeout | Timeout used for each command |
|
||||
| report_name | Name of the generated report file, here $MODEL and $SERIAL replaced with ProductModel and SerialNumber |
|
||||
| verbose | Logs everythings to logread as well |
|
||||
| commpression_level | Gzip compression_level 0-9, if not set, then report will not gziped |
|
||||
|
||||
|
||||
It also provide, a rpcd script to expose `self-diagnostics` over ubus
|
||||
|
||||
```bash
|
||||
# ubus -v list self-diagnostics
|
||||
'self-diagnostics' @2c0b768d
|
||||
"list":{}
|
||||
"generate":{"modules":"String"}
|
||||
```
|
||||
|
||||
## Recipe(s)
|
||||
|
||||
It has core modules and extended modules.
|
||||
|
||||
Core module recipes are present in `/usr/share/self-diagnostics/spec/` path, where as
|
||||
extended module recipes are defined in uci option 'self-diagnostics.globals.extended_spec_dir'
|
||||
|
||||
Both the spec directories has recipes to run diagnostics and collect logs, these recipes are defined in json files.
|
||||
|
||||
```bash
|
||||
# ls /usr/share/self-diagnostics/spec/
|
||||
config.json network.json trx69.json wifi.json
|
||||
multiap.json system.json voice.json
|
||||
```
|
||||
|
||||
Each json file need to follow below structure:
|
||||
|
||||
```json
|
||||
{
|
||||
"description": "<Description of module>",
|
||||
"dependency": [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "<filepath>"
|
||||
}
|
||||
],
|
||||
"exec": [
|
||||
{
|
||||
"description": "<Description of command>",
|
||||
"cmd": "<command To Execute>",
|
||||
"dependency": [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "<filepath>"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "<Next command description>",
|
||||
"cmd": "<command to execute>"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## How to use
|
||||
|
||||
This can be run from command line, ubus , USP-Controller and ACS.
|
||||
|
||||
### List available core/extension modules
|
||||
|
||||
```bash
|
||||
# self-diagnostics -l
|
||||
|
||||
Core Module(s):
|
||||
- config
|
||||
- multiap
|
||||
- network
|
||||
- system
|
||||
- trx69
|
||||
- voice
|
||||
- wifi
|
||||
|
||||
Extension Module(s):
|
||||
```
|
||||
|
||||
### Run and collect logs
|
||||
|
||||
```bash
|
||||
# self-diagnostics
|
||||
/tmp/self-diagnostics-report-EX600-Y.0721140081.tar.gz
|
||||
```
|
||||
|
||||
### List available core/extension modules over ubus
|
||||
|
||||
```bash
|
||||
# ubus call self-diagnostics list
|
||||
{
|
||||
"CoreModules": [
|
||||
"config",
|
||||
"multiap",
|
||||
"network",
|
||||
"system",
|
||||
"trx69",
|
||||
"voice",
|
||||
"wifi"
|
||||
],
|
||||
"ExtensionModules": [
|
||||
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Run specific module from ubus
|
||||
|
||||
```bash
|
||||
# ubus call self-diagnostics generate '{"modules":"config"}'
|
||||
{
|
||||
"result": "/tmp/self-diagnostics-report-EX600-Y.0721140081.tar.gz"
|
||||
}
|
||||
```
|
||||
|
||||
## TR-181 Integration
|
||||
|
||||
|
||||
TR-181 (USP) provides an Operate command `Device.SelfTestDiagnostics()` to execute it from USP-controllers.
|
||||
TR-181 (CWMP) provides a diagnostics object `Device.SelfTestDiagnostics.` for the same, so its can be triggered from ACS as well.
|
||||
|
||||
```bash
|
||||
# ubus call bbfdm operate '{"command":"Device.SelfTestDiagnostics()"}'
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"path": "Device.SelfTestDiagnostics()",
|
||||
"data": "",
|
||||
"output": [
|
||||
{
|
||||
"Results": "Device.DeviceInfo.VendorLogFile.2",
|
||||
"Status": "Complete"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Once the opreate command is done, it generate a new entry in VendorLogFile, like below:
|
||||
|
||||
```bash
|
||||
# bbfdmd -c get Device.DeviceInfo.VendorLogFile.2.
|
||||
Device.DeviceInfo.VendorLogFile.2.Alias => cpe-2
|
||||
Device.DeviceInfo.VendorLogFile.2.Name => /tmp/self-diagnostics-report-EX600-Y.0721140081.tar.gz
|
||||
Device.DeviceInfo.VendorLogFile.2.MaximumSize => 0
|
||||
Device.DeviceInfo.VendorLogFile.2.Persistent => 0
|
||||
```
|
||||
|
||||
Which is then can be uploaded to a server using `Device.DeviceInfo.VendorLogFile.{i}.Upload()` operate command.
|
||||
6
self-diagnostics/files/etc/config/self-diagnostics
Normal file
6
self-diagnostics/files/etc/config/self-diagnostics
Normal file
@@ -0,0 +1,6 @@
|
||||
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 compression_level '9'
|
||||
28
self-diagnostics/files/usr/libexec/rpcd/self-diagnostics
Executable file
28
self-diagnostics/files/usr/libexec/rpcd/self-diagnostics
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
BIN="/usr/sbin/self-diagnostics"
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
echo '{"list": {}, "generate" : {"modules":"String"}}'
|
||||
;;
|
||||
call)
|
||||
case "$2" in
|
||||
generate)
|
||||
read -t 1 -r input
|
||||
|
||||
json_load "${input}"
|
||||
json_get_var modules modules
|
||||
if [ -z "${modules}" ]; then
|
||||
${BIN} -j
|
||||
else
|
||||
${BIN} -j -m "${modules}"
|
||||
fi
|
||||
;;
|
||||
list)
|
||||
${BIN} -j -l
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
383
self-diagnostics/files/usr/sbin/self-diagnostics
Executable file
383
self-diagnostics/files/usr/sbin/self-diagnostics
Executable file
@@ -0,0 +1,383 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
JSON_OUT=0
|
||||
SPEC_DIR="/usr/share/self-diagnostics/spec"
|
||||
SPEC_EXT_DIR="/etc/self-diagnostics/spec"
|
||||
REPORT_DIR="$(mktemp -d)"
|
||||
REPORT_NAME="self-test-diagnostics"
|
||||
VERBOSE=0
|
||||
COMPOPTS=""
|
||||
TIMEOUT=5
|
||||
|
||||
cleanup()
|
||||
{
|
||||
[ -d "${REPORT_DIR}" ] && \
|
||||
rm -rf ${REPORT_DIR}
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
help()
|
||||
{
|
||||
echo "Generate self diagnostics report"
|
||||
echo
|
||||
echo "Syntax: $0 [-m|h|l|j]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " l List available module(s)"
|
||||
echo " m Generate system report of specific module(s)"
|
||||
echo " j Enable JSON output"
|
||||
echo " h Print this help"
|
||||
echo
|
||||
}
|
||||
|
||||
log()
|
||||
{
|
||||
log_file="${REPORT_DIR}/execution.log"
|
||||
if [ "$VERBOSE" -eq 1 ]; then
|
||||
logger -t $0 "$*"
|
||||
fi
|
||||
echo "[$(date +%Y:%m:%d-%H:%M:%S)] $*" >> ${log_file}
|
||||
}
|
||||
|
||||
# Alias ubus to have a smaller 5-second timeout on all subsequent calls
|
||||
ubus()
|
||||
{
|
||||
if [ "${1}" == "call" ]; then
|
||||
if command ubus list $2 >/dev/null 2>&1; then
|
||||
command ubus "$@";
|
||||
fi
|
||||
else
|
||||
command ubus "$@";
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
config_load()
|
||||
{
|
||||
local temp
|
||||
local MODEL SERIAL
|
||||
|
||||
log "# Starting Self diagnostics tests #"
|
||||
|
||||
MODEL="$(db get device.deviceinfo.ModelName)"
|
||||
SERIAL="$(db get device.deviceinfo.SerialNumber)"
|
||||
|
||||
temp="$(uci -q get self-diagnostics.globals.extended_spec_dir)"
|
||||
[ -d "${temp}" ] && \
|
||||
SPEC_EXT_DIR="${temp}"
|
||||
|
||||
temp="$(uci -q get self-diagnostics.globals.exec_timeout)"
|
||||
[ -n "${temp}" ] && \
|
||||
TIMEOUT="${temp}"
|
||||
|
||||
temp="$(uci -q get self-diagnostics.globals.report_name)"
|
||||
[ -n "${temp}" ] && \
|
||||
REPORT_NAME="$(eval echo ${temp})"
|
||||
|
||||
REPORT_NAME="${REPORT_NAME//[ \/]/_}"
|
||||
|
||||
temp="$(uci -q get self-diagnostics.globals.compression_level)"
|
||||
[ -n "${temp}" ] && \
|
||||
COMPOPTS="${temp}"
|
||||
|
||||
temp="$(uci -q get self-diagnostics.globals.verbose)"
|
||||
[ -n "${temp}" ] && \
|
||||
VERBOSE="${temp}"
|
||||
}
|
||||
|
||||
exec_spec()
|
||||
{
|
||||
local json_file exec_skip name timeout exec_timeout rc
|
||||
|
||||
json_file="$1"
|
||||
[ -z "$json_file" ] && {
|
||||
log "No/invalid spec json_file"
|
||||
return 1
|
||||
}
|
||||
|
||||
log "Loading $json_file ..."
|
||||
|
||||
json_init
|
||||
json_load_file "${json_file}" || {
|
||||
log "Failed to load ${json_file} spec file"
|
||||
return 1
|
||||
}
|
||||
|
||||
name="$(basename ${json_file})"
|
||||
export_path="${REPORT_DIR}/${name//.json/.log}"
|
||||
|
||||
exec_skip=0
|
||||
if json_is_a dependency array; then
|
||||
json_select "dependency"
|
||||
json_get_keys ekeys
|
||||
|
||||
for key in $ekeys; do
|
||||
if json_is_a $key object; then
|
||||
json_select $key
|
||||
json_get_var type type
|
||||
|
||||
if [ "$type" == "file" ]; then
|
||||
json_get_var file file
|
||||
if [ ! -e "$file" ]; then
|
||||
log "${json_file} has unmet file dependency $file"
|
||||
exec_skip=1
|
||||
json_select ..
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
json_select ..
|
||||
fi
|
||||
done
|
||||
json_select ..
|
||||
fi
|
||||
|
||||
[ "${exec_skip}" -eq 1 ] && {
|
||||
log "Dependency not satisfied for ${json_file}"
|
||||
return 0
|
||||
}
|
||||
|
||||
json_get_var description description
|
||||
log "Description: $description"
|
||||
|
||||
if json_is_a exec array; then
|
||||
json_select "exec"
|
||||
json_get_keys keys
|
||||
|
||||
for key in $keys; do
|
||||
if json_is_a $key object; then
|
||||
json_select $key
|
||||
cmd_skip=0
|
||||
if json_is_a dependency array; then
|
||||
json_select "dependency"
|
||||
json_get_keys d_keys
|
||||
|
||||
for d_key in $d_keys; do
|
||||
if json_is_a $d_key object; then
|
||||
json_select $d_key
|
||||
json_get_var type type
|
||||
if [ "$type" == "file" ]; then
|
||||
json_get_var file file
|
||||
if [ ! -e $file ]; then
|
||||
json_select ..
|
||||
cmd_skip=1
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
json_select ..
|
||||
fi
|
||||
done
|
||||
json_select ..
|
||||
fi
|
||||
|
||||
[ $cmd_skip -eq 1 ] && {
|
||||
json_select ..
|
||||
log "Dependency not satisfied for ${file}"
|
||||
continue
|
||||
}
|
||||
|
||||
json_get_var description description
|
||||
json_get_var cmd cmd
|
||||
json_get_var timeout timeout
|
||||
|
||||
if [ -n "$timeout" ]; then
|
||||
exec_timeout=$timeout
|
||||
else
|
||||
exec_timeout=$TIMEOUT
|
||||
fi
|
||||
log "Executing $cmd with timeout $exec_timeout"
|
||||
echo "##########################################" >> $export_path
|
||||
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
|
||||
|
||||
if [ "$rc" -eq 0 ]; then
|
||||
log "Execution [$cmd] completed"
|
||||
else
|
||||
log "Execution [$cmd] Failed/Timeout with $rc exit code"
|
||||
fi
|
||||
|
||||
echo >> $export_path
|
||||
json_select ..
|
||||
fi
|
||||
done
|
||||
json_select ..
|
||||
fi
|
||||
|
||||
log "Handling of $json_file done"
|
||||
log ""
|
||||
}
|
||||
|
||||
generate_module()
|
||||
{
|
||||
local modules="${@}"
|
||||
local file module
|
||||
|
||||
config_load
|
||||
|
||||
log "Modules [$@]"
|
||||
for module in $modules; do
|
||||
module="${module/.json/}"
|
||||
file="$(find $SPEC_DIR -type f -name ${module}.json)"
|
||||
[ -z "$file" ] && {
|
||||
[ -d "${SPEC_EXT_DIR}" ] && \
|
||||
file="$(find $SPEC_EXT_DIR -type f -name ${module}.json)"
|
||||
}
|
||||
|
||||
[ -f "$file" ] && \
|
||||
exec_spec "$file"
|
||||
done
|
||||
}
|
||||
|
||||
generate_all()
|
||||
{
|
||||
local files
|
||||
|
||||
config_load
|
||||
|
||||
files="$(find ${SPEC_DIR} -type f -name *.json)"
|
||||
[ -d "${SPEC_EXT_DIR}" ] && \
|
||||
files="${files} $(find $SPEC_EXT_DIR -type f -name *.json)"
|
||||
|
||||
[ -z "$files" ] && {
|
||||
return 0
|
||||
}
|
||||
|
||||
for file in $files; do
|
||||
exec_spec "$file"
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
list_modules()
|
||||
{
|
||||
local files
|
||||
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_init
|
||||
json_add_array "CoreModules"
|
||||
else
|
||||
echo
|
||||
echo "Core Module(s):"
|
||||
fi
|
||||
|
||||
cd ${SPEC_DIR} && {
|
||||
for file in $(ls); do
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_add_string "" "${file/.json/}"
|
||||
else
|
||||
echo " - ${file/.json/}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_close_array
|
||||
json_add_array "ExtensionModules"
|
||||
else
|
||||
echo
|
||||
echo "Extension Module(s):"
|
||||
fi
|
||||
|
||||
cd ${SPEC_EXT_DIR} && {
|
||||
for file in $(ls); do
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_add_string "" "${file/.json/}"
|
||||
else
|
||||
echo " - ${file/.json/}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_close_array
|
||||
json_dump
|
||||
else
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
generate_report()
|
||||
{
|
||||
local filename report_path
|
||||
|
||||
report_path="$(dirname "${REPORT_DIR}")"
|
||||
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} && {
|
||||
filename="${filename}.tar"
|
||||
tar -cf "${filename}" *
|
||||
}
|
||||
|
||||
rm -r "$REPORT_DIR"
|
||||
|
||||
if [ -n "$COMPOPTS" ]; then
|
||||
gzip -${COMPOPTS} -f "${filename}"
|
||||
filename="${filename}.gz"
|
||||
fi
|
||||
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_init
|
||||
json_add_string result "${filename}"
|
||||
json_dump
|
||||
else
|
||||
echo "${filename}"
|
||||
fi
|
||||
}
|
||||
|
||||
[ ! -d "${SPEC_DIR}" ] && {
|
||||
log "# ${SPEC_DIR} does not exits"
|
||||
exit 1
|
||||
}
|
||||
|
||||
list=0
|
||||
modules=""
|
||||
|
||||
while getopts "m:hlj" opts; do
|
||||
case $opts in
|
||||
h)
|
||||
help
|
||||
exit;;
|
||||
j)
|
||||
JSON_OUT=1
|
||||
;;
|
||||
l)
|
||||
list=1
|
||||
;;
|
||||
m)
|
||||
modules="$modules ${OPTARG}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "${list}" -eq 1 ]; then
|
||||
list_modules
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "${modules}" ]; then
|
||||
generate_all
|
||||
else
|
||||
generate_module ${modules}
|
||||
fi
|
||||
|
||||
generate_report
|
||||
@@ -0,0 +1,11 @@
|
||||
interfaces=$(uci show wireless | grep "ifname=" | awk -F'[.,=]' '{print$2}')
|
||||
for int in $interfaces; do
|
||||
mode=$(uci get "wireless.${int}.mode")
|
||||
if [ "$mode" = "ap" ] ; then
|
||||
ap_int=$(uci get "wireless.${int}.ifname")
|
||||
echo "Get assoc list for ${ap_int}"
|
||||
ubus call "wifi.ap.${ap_int}" assoclist
|
||||
echo "Get station info for ${ap_int}"
|
||||
ubus call "wifi.ap.${ap_int}" stations
|
||||
fi
|
||||
done
|
||||
@@ -0,0 +1,5 @@
|
||||
for radio_if in $(ubus list 'wifi.radio.*'); do
|
||||
ubus call "${radio_if}" scan
|
||||
sleep 2
|
||||
ubus call "${radio_if}" scanresults
|
||||
done
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"description": "Gathering configuration data",
|
||||
"exec" : [
|
||||
{
|
||||
"description": "OS Release",
|
||||
"cmd": "cat /etc/os-release"
|
||||
},
|
||||
{
|
||||
"description": "Installed Packages",
|
||||
"cmd": "opkg list-installed"
|
||||
},
|
||||
{
|
||||
"description": "Database",
|
||||
"cmd": "db export"
|
||||
},
|
||||
{
|
||||
"description": "Configuration",
|
||||
"cmd": "uci export"
|
||||
},
|
||||
{
|
||||
"description": "Runtime Configuration",
|
||||
"cmd": "cat /var/state/*"
|
||||
},
|
||||
{
|
||||
"description": "Firmware Environment",
|
||||
"cmd": "fw_printenv"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"description": "Gathering EasyMesh state",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/mapagent"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/ieee1905"
|
||||
}
|
||||
],
|
||||
"exec" : [
|
||||
{
|
||||
"description": "Hosts Show",
|
||||
"cmd": "ubus call hosts show"
|
||||
},
|
||||
{
|
||||
"description": "Hosts Dump",
|
||||
"cmd": "ubus call hosts dump"
|
||||
},
|
||||
{
|
||||
"description": "IEEE1905 Info",
|
||||
"cmd": "ubus call ieee1905 info"
|
||||
},
|
||||
{
|
||||
"description": "IEEE1905 Links",
|
||||
"cmd": "ubus call ieee1905 links"
|
||||
},
|
||||
{
|
||||
"description": "IEEE1905 Neighbors",
|
||||
"cmd": "ubus call ieee1905 neighbors"
|
||||
},
|
||||
{
|
||||
"description": "IEEE1905 Others",
|
||||
"cmd": "ubus call ieee1905 others"
|
||||
},
|
||||
{
|
||||
"description": "IEEE1905 Topology",
|
||||
"cmd": "ubus call ieee1905.topology dump"
|
||||
},
|
||||
{
|
||||
"description": "MAP Agent Info",
|
||||
"cmd": "ubus call map.agent info"
|
||||
},
|
||||
{
|
||||
"description": "MAP Agent Status",
|
||||
"cmd": "ubus call map.agent status"
|
||||
},
|
||||
{
|
||||
"description": "MAP Agent Backhaul Info",
|
||||
"cmd": "ubus call map.agent backhaul_info"
|
||||
},
|
||||
{
|
||||
"description": "MAP Controller Status",
|
||||
"cmd": "ubus call map.controller status"
|
||||
},
|
||||
{
|
||||
"description": "MAP Controller List MACs",
|
||||
"cmd": "ubus call map.controller.dbg list_macs"
|
||||
},
|
||||
{
|
||||
"description": "MAP Controller BH Topology Dump",
|
||||
"cmd": "ubus call map.controller.dbg bh_topology_dump"
|
||||
},
|
||||
{
|
||||
"description": "Data Elements Dump",
|
||||
"cmd": "ubus call wifi.dataelements.collector refresh; sleep 2; ubus call wifi.dataelements.collector dump2"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"description": "Gathering network state",
|
||||
"exec" : [
|
||||
{
|
||||
"description": "Network Device Status",
|
||||
"cmd": "ubus call network.device status"
|
||||
},
|
||||
{
|
||||
"description": "Network Interface Dump",
|
||||
"cmd": "ubus call network.interface dump"
|
||||
},
|
||||
{
|
||||
"description": "Linux Network Interface Config",
|
||||
"cmd": "ifconfig -a"
|
||||
},
|
||||
{
|
||||
"description": "IPv4 Routes",
|
||||
"cmd": "ip -d r"
|
||||
},
|
||||
{
|
||||
"description": "IPv6 Routes",
|
||||
"cmd": "ip -d -6 r"
|
||||
},
|
||||
{
|
||||
"description": "Neighbor Table",
|
||||
"cmd": "ip n"
|
||||
},
|
||||
{
|
||||
"description": "ARP Table",
|
||||
"cmd": "cat /proc/net/arp"
|
||||
},
|
||||
{
|
||||
"description": "Conntrack Table",
|
||||
"cmd": "cat /proc/net/nf_conntrack"
|
||||
},
|
||||
{
|
||||
"description": "Network Interface Status",
|
||||
"cmd": "ip -d a"
|
||||
},
|
||||
{
|
||||
"description": "IPv4 Firewall Status",
|
||||
"cmd": "iptables -xvnL"
|
||||
},
|
||||
{
|
||||
"description": "IPv6 Firewall Status",
|
||||
"cmd": "ip6tables -xvnL"
|
||||
},
|
||||
{
|
||||
"description": "Bridge Info",
|
||||
"cmd": "brctl show"
|
||||
},
|
||||
{
|
||||
"description": "Bridge Link",
|
||||
"cmd": "bridge link"
|
||||
},
|
||||
{
|
||||
"description": "Bridge VLAN",
|
||||
"cmd": "bridge vlan"
|
||||
},
|
||||
{
|
||||
"description": "Bridge FDB",
|
||||
"cmd": "bridge fdb"
|
||||
},
|
||||
{
|
||||
"description": "TCP listened ports",
|
||||
"cmd": "netstat -tlnp"
|
||||
},
|
||||
{
|
||||
"description": "UDP listened ports",
|
||||
"cmd": "netstat -ulnp"
|
||||
},
|
||||
{
|
||||
"description": "MAC layer firewall status list",
|
||||
"cmd": "ebtables -L"
|
||||
},
|
||||
{
|
||||
"description": "MAC layer firewall status",
|
||||
"cmd": "ebtables -t broute -L"
|
||||
},
|
||||
{
|
||||
"description": "QoS queue stats",
|
||||
"cmd": "ubus call qos queue_stats"
|
||||
},
|
||||
{
|
||||
"description": "IGMP Snooping Table",
|
||||
"cmd": "ubus call mcast stats"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"description": "Gathering system information",
|
||||
"exec" : [
|
||||
{
|
||||
"description": "Firmware banks",
|
||||
"cmd": "ubus call fwbank dump"
|
||||
},
|
||||
{
|
||||
"description": "System Info",
|
||||
"cmd": "ubus call system info"
|
||||
},
|
||||
{
|
||||
"description": "Board Info",
|
||||
"cmd": "ubus call system board"
|
||||
},
|
||||
{
|
||||
"description": "Running Processes",
|
||||
"cmd": "top -b -n 1"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"description": "PCI Devices",
|
||||
"cmd": "lspci -k"
|
||||
},
|
||||
{
|
||||
"description": "Installed Modules",
|
||||
"cmd": "lsmod"
|
||||
},
|
||||
{
|
||||
"description": "CPU Info",
|
||||
"cmd": "cat /proc/cpuinfo"
|
||||
},
|
||||
{
|
||||
"description": "Memory Info",
|
||||
"cmd": "cat /proc/meminfo"
|
||||
},
|
||||
{
|
||||
"description": "Slab Info",
|
||||
"cmd": "cat /proc/slabinfo"
|
||||
},
|
||||
{
|
||||
"description": "eMMC Partition/Volume Info",
|
||||
"cmd": "fdisk -l",
|
||||
"dependency" : {
|
||||
"file": "/sbin/fdisk"
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "NAND Partition/Volume Info",
|
||||
"cmd": "ubinfo --all",
|
||||
"dependency" : {
|
||||
"file": "/usr/sbin/ubinfo"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"description": "Gathering TR-x69 state",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/cwmp"
|
||||
}
|
||||
],
|
||||
"exec" : [
|
||||
{
|
||||
"description": "TR-181 DM MAP",
|
||||
"cmd": "uci -c /etc/bbfdm/dmmap export"
|
||||
},
|
||||
{
|
||||
"description": "TR-181 Parameters via BBFDM",
|
||||
"cmd": "bbfdmd -c schema Device."
|
||||
},
|
||||
{
|
||||
"description": "TR-181 Parameters via CWMP",
|
||||
"cmd": "icwmpd -c get Device."
|
||||
},
|
||||
{
|
||||
"description": "TR-069 status",
|
||||
"cmd": "ubus call tr069 status"
|
||||
},
|
||||
{
|
||||
"description": "TR-069 Logs",
|
||||
"cmd": "cat /var/log/icwmpd.log",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/var/log/icwmpd.log"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "TR-181 Parameters via USP",
|
||||
"cmd": "obuspa -c get Device.",
|
||||
"timeout": 10
|
||||
},
|
||||
{
|
||||
"description": "USP Agent Database",
|
||||
"cmd": "obuspa -f $(uci -q get obuspa.global.db_file) -c show database"
|
||||
},
|
||||
{
|
||||
"description": "USP Logs",
|
||||
"cmd": "cat /var/log/obuspa.log",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/var/log/obuspa.log"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"description": "Gathering Voice state",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/asterisk"
|
||||
}
|
||||
],
|
||||
"exec" : [
|
||||
{
|
||||
"description": "Endpoint Status",
|
||||
"cmd": "ubus call endpt status"
|
||||
},
|
||||
{
|
||||
"description": "Endpoint Count",
|
||||
"cmd": "ubus call endpt count"
|
||||
},
|
||||
{
|
||||
"description": "Voice Status",
|
||||
"cmd": "ubus call voice.asterisk status"
|
||||
},
|
||||
{
|
||||
"description": "DECT Status",
|
||||
"cmd": "ubus call dect status",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/dect"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "DECT Handsets",
|
||||
"cmd": "ubus call dect handsets",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/dect"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"description": "Gathering WiFi state",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/sys/class/ieee80211"
|
||||
}
|
||||
],
|
||||
"exec" : [
|
||||
{
|
||||
"description": "Wireless Status",
|
||||
"cmd": "ubus call network.wireless status"
|
||||
},
|
||||
{
|
||||
"description": "Wireless Radio Status",
|
||||
"cmd": "ubus call wifi status"
|
||||
},
|
||||
{
|
||||
"description": "Get radio scan",
|
||||
"cmd": "sh /usr/share/self-diagnostics/helper/wifi_radio_scan.sh"
|
||||
},
|
||||
{
|
||||
"description": "Get Assoc List",
|
||||
"cmd": "sh /usr/share/self-diagnostics/helper/wifi_assoclist.sh"
|
||||
},
|
||||
{
|
||||
"description": "iwinfo interface details",
|
||||
"cmd": "/usr/bin/iwinfo"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=stunc
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.3.2
|
||||
PKG_VERSION:=1.4.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/stunc.git
|
||||
PKG_SOURCE_VERSION:=3e56818cd219f285263d6d1a7d41f751bbb0fe08
|
||||
PKG_SOURCE_VERSION:=335f52d51b3b988917f0130303d571ac1fd9636c
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -27,77 +27,25 @@ include ../bbfdm/bbfdm.mk
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/stunc/default
|
||||
define Package/stunc
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF STUN Client
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libblobmsg-json +libbbfdm-api
|
||||
endef
|
||||
|
||||
define Package/stunc
|
||||
$(Package/stunc/default)
|
||||
TITLE += (default)
|
||||
DEPENDS += +libopenssl
|
||||
VARIANT:=default
|
||||
DEFAULT_VARIANT:=1
|
||||
endef
|
||||
|
||||
define Package/stunc-mbedtls
|
||||
$(Package/stunc/default)
|
||||
TITLE += (mbedtls)
|
||||
DEPENDS += +PACKAGE_stunc-mbedtls:libmbedtls
|
||||
VARIANT:=mbedtls
|
||||
CONFLICTS := stunc stunc-openssl stunc-wolfssl
|
||||
endef
|
||||
|
||||
define Package/stunc-openssl
|
||||
$(Package/stunc/default)
|
||||
TITLE += (openssl)
|
||||
DEPENDS += +PACKAGE_stunc-openssl:libopenssl
|
||||
VARIANT:=openssl
|
||||
CONFLICTS := stunc stunc-mbedtls stunc-wolfssl
|
||||
endef
|
||||
|
||||
define Package/stunc-wolfssl
|
||||
$(Package/stunc/default)
|
||||
TITLE += (wolfssl)
|
||||
DEPENDS += +PACKAGE_stunc-wolfssl:libwolfssl
|
||||
VARIANT:=wolfssl
|
||||
CONFLICTS := stunc stunc-openssl stunc-mbedtls
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libblobmsg-json +libbbfdm-api +libopenssl
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE \
|
||||
-Wall -Werror
|
||||
|
||||
ifeq ($(BUILD_VARIANT),default)
|
||||
MAKE_FLAGS += \
|
||||
USE_OPENSSL="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),wolfssl)
|
||||
MAKE_FLAGS += \
|
||||
USE_WOLFSSL="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),mbedtls)
|
||||
MAKE_FLAGS += \
|
||||
USE_MBEDTLS="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),openssl)
|
||||
MAKE_FLAGS += \
|
||||
USE_OPENSSL="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/stunc/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/stunc/default/install
|
||||
define Package/stunc/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
@@ -107,12 +55,4 @@ define Package/stunc/default/install
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/src/libstunc.so)
|
||||
endef
|
||||
|
||||
Package/stunc/install = $(Package/stunc/default/install)
|
||||
Package/stunc-openssl/install = $(Package/stunc/default/install)
|
||||
Package/stunc-wolfssl/install = $(Package/stunc/default/install)
|
||||
Package/stunc-mbedtls/install = $(Package/stunc/default/install)
|
||||
|
||||
$(eval $(call BuildPackage,stunc))
|
||||
$(eval $(call BuildPackage,stunc-openssl))
|
||||
$(eval $(call BuildPackage,stunc-wolfssl))
|
||||
$(eval $(call BuildPackage,stunc-mbedtls))
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-base
|
||||
PKG_VERSION:=3.1.21
|
||||
PKG_VERSION:=3.1.45
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
|
||||
PKG_SOURCE_VERSION:=b52092230833fffdec881ed1b91386399f5e2310
|
||||
PKG_SOURCE_VERSION:=9f3525957ac203c8900996c467032c2be6343ae5
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
SULU_MOD:=core
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-builder
|
||||
PKG_VERSION:=3.1.21
|
||||
PKG_VERSION:=3.1.45
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-builder.git
|
||||
PKG_SOURCE_VERSION:=eb44f85f1a819f4d5fd6e74d7e2dfd7011381c63
|
||||
PKG_SOURCE_VERSION:=32f297540eca2d80aea425968d3503b3c41d86eb
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/sulu-$(PKG_VERSION)/sulu-builder-$(PKG_SOURCE_VERSION)
|
||||
@@ -89,6 +89,12 @@ define Package/sulu-builder/config
|
||||
You can specify the list of non core sulu package,
|
||||
so that sulu-builder include them before building the core.
|
||||
|
||||
config SULU_ENV_DATA
|
||||
depends on PACKAGE_sulu-builder
|
||||
string "Sulu env data"
|
||||
help
|
||||
Use this option to initialize sulu build time environment options.
|
||||
|
||||
config SULU_PWA_APP
|
||||
depends on PACKAGE_sulu-builder
|
||||
bool "Enable SULU PWA App support"
|
||||
@@ -173,7 +179,13 @@ endef
|
||||
|
||||
define Package/sulu-builder/install
|
||||
$(Package/sulu/install/Default)
|
||||
$(INSTALL_DIR) $(1)/sulu/presets
|
||||
$(INSTALL_DIR) $(1)/sulu/settings
|
||||
$(INSTALL_DIR) $(1)/sulu/widget-presets
|
||||
$(CP) $(PKG_BUILD_DIR)/build/dist/* $(1)/sulu
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/build/device/presets/*.json $(1)/sulu/presets/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/build/device/settings/*.json $(1)/sulu/settings/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/build/device/widget-presets/*.json $(1)/sulu/widget-presets/
|
||||
$(Package/sulu/install/Post)
|
||||
endef
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
config global 'global'
|
||||
option role_based_access '1'
|
||||
option SessionMode 'Allow'
|
||||
list user 'admin'
|
||||
list user 'user'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
START=99
|
||||
START=60
|
||||
STOP=01
|
||||
|
||||
. /lib/functions.sh
|
||||
@@ -16,12 +16,11 @@ validate_sulu_global_section()
|
||||
{
|
||||
uci_validate_section sulu global global \
|
||||
'enabled:bool:1' \
|
||||
'enable_system_credentials:bool:1' \
|
||||
'role_based_access:bool:0'
|
||||
'enable_system_credentials:bool:1'
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enabled enable_system_credentials role_based_access
|
||||
local enabled enable_system_credentials
|
||||
|
||||
config_load sulu
|
||||
procd_open_instance sulu
|
||||
@@ -34,8 +33,8 @@ start_service() {
|
||||
fi
|
||||
|
||||
update_nginx_template
|
||||
configure_sulu "${enable_system_credentials}" "${role_based_access}" 1
|
||||
generate_sulu_conn_config "${role_based_access}"
|
||||
configure_sulu "${enable_system_credentials}" 1
|
||||
generate_sulu_conn_config
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
# format using "shfmt"
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
_RESTART_SERVICES="0"
|
||||
|
||||
mkdir -p /tmp/sulu/
|
||||
|
||||
function slog()
|
||||
{
|
||||
echo "$*" |logger -t sulu.init -p debug
|
||||
function slog() {
|
||||
echo "$*" | logger -t sulu.init -p debug
|
||||
}
|
||||
|
||||
function _get_agent_id()
|
||||
{
|
||||
local oui serial endpointid
|
||||
function _get_agent_id() {
|
||||
local oui serial endpointid
|
||||
|
||||
endpointid="$(uci_get obuspa localagent EndpointID)"
|
||||
if [ -z "${endpointid}" ]; then
|
||||
@@ -21,14 +21,13 @@ function _get_agent_id()
|
||||
serial="$(db -q get device.deviceinfo.SerialNumber)"
|
||||
echo "${oui}-${serial//+/%2B}"
|
||||
else
|
||||
endpointid="$(echo "${endpointid/::/,}"|cut -d "," -f 2)"
|
||||
endpointid="$(echo "${endpointid/::/,}" | cut -d "," -f 2)"
|
||||
endpointid="${endpointid//+/%2B}"
|
||||
fi
|
||||
}
|
||||
|
||||
function _get_endpoint_id()
|
||||
{
|
||||
local oui serial endpointid
|
||||
function _get_endpoint_id() {
|
||||
local oui serial endpointid
|
||||
|
||||
endpointid="$(uci_get obuspa localagent EndpointID)"
|
||||
if [ -z "${endpointid}" ]; then
|
||||
@@ -40,228 +39,107 @@ function _get_endpoint_id()
|
||||
fi
|
||||
}
|
||||
|
||||
function _get_sulu_users()
|
||||
{
|
||||
function _get_sulu_users() {
|
||||
echo "$(uci -q get sulu.global.user)"
|
||||
}
|
||||
|
||||
function _get_sulu_root()
|
||||
{
|
||||
function _get_sulu_root() {
|
||||
local root
|
||||
|
||||
root="$(uci -q get nginx._sulu_s.root)"
|
||||
echo "${root:-/sulu}"
|
||||
}
|
||||
|
||||
function _get_sulu_connection_config()
|
||||
{
|
||||
function _get_sulu_connection_config() {
|
||||
local config
|
||||
|
||||
config="$(_get_sulu_root)/presets/connection-config.json"
|
||||
echo "${config}"
|
||||
}
|
||||
|
||||
function _get_sulu_session_mode()
|
||||
{
|
||||
function _get_sulu_session_mode() {
|
||||
echo "$(uci -q get sulu.global.SessionMode)"
|
||||
}
|
||||
|
||||
function _get_usp_upstream_port()
|
||||
{
|
||||
function _get_usp_upstream_port() {
|
||||
local port
|
||||
|
||||
port="$(uci -q get mosquitto.sulu.port)"
|
||||
echo "${port:-9009}"
|
||||
}
|
||||
|
||||
function _get_sulu_acl_file()
|
||||
{
|
||||
function _get_sulu_acl_file() {
|
||||
local file
|
||||
|
||||
file="$(uci -q get mosquitto.sulu.acl_file)"
|
||||
echo "${file}"
|
||||
}
|
||||
|
||||
function _get_sulu_tls_port()
|
||||
{
|
||||
local port listen
|
||||
|
||||
listen="$(uci -q get nginx._sulu_s.listen)"
|
||||
port="$(echo $listen|grep -Eo '[0-9]+'|head -n 1)"
|
||||
|
||||
echo "${port:-8443}"
|
||||
}
|
||||
|
||||
function _get_sulu_http_port()
|
||||
{
|
||||
function _get_sulu_http_port() {
|
||||
local port listen
|
||||
|
||||
listen="$(uci -q get nginx._sulu_http.listen)"
|
||||
port="$(echo $listen|grep -Eo '[0-9]+'|head -n 1)"
|
||||
port="$(echo $listen | grep -Eo '[0-9]+' | head -n 1)"
|
||||
|
||||
echo "${port:-8080}"
|
||||
}
|
||||
|
||||
function update_nginx_template()
|
||||
{
|
||||
function update_nginx_template() {
|
||||
local port
|
||||
|
||||
UCI_TEMPLATE="/etc/nginx/uci.conf.template"
|
||||
port="$(_get_usp_upstream_port)"
|
||||
if ! grep -q "upstream websocket { server 127.0.0.1:${port}; }" ${UCI_TEMPLATE}; then
|
||||
if ! grep -q "upstream websocket { server 127.0.0.1:${port}; }" ${UCI_TEMPLATE}; then
|
||||
sed -i "s/upstream websocket { server 127.0.0.1:[0-9]\+; }/upstream websocket { server 127.0.0.1:${var}; }/" ${UCI_TEMPLATE}
|
||||
log "Restarting nginx"
|
||||
ubus call uci commit '{"config":"nginx"}'
|
||||
fi
|
||||
}
|
||||
|
||||
function generate_sulu_conn_config()
|
||||
{
|
||||
local rbac users SCONFIG session
|
||||
function generate_sulu_conn_config() {
|
||||
local users SCONFIG session
|
||||
|
||||
rbac="${1}"
|
||||
users="$(_get_sulu_users)"
|
||||
session="$(_get_sulu_session_mode)"
|
||||
SCONFIG="$(_get_sulu_connection_config)"
|
||||
|
||||
json_init;
|
||||
if [ "${rbac}" -eq "1" ]; then
|
||||
json_add_string 'Current-connection' 'rbac';
|
||||
else
|
||||
json_add_string 'Current-connection' 'main';
|
||||
fi
|
||||
json_add_object 'Connections';
|
||||
json_add_object 'rbac';
|
||||
json_add_string 'toId' "$(_get_endpoint_id)";
|
||||
json_add_int 'port' "$(_get_sulu_tls_port)";
|
||||
json_add_string 'path' "/wss";
|
||||
json_init
|
||||
json_add_string 'Current-connection' 'main'
|
||||
json_add_object 'Connections'
|
||||
{
|
||||
json_add_object 'main'
|
||||
{
|
||||
json_add_string 'toId' "$(_get_endpoint_id)"
|
||||
json_add_string 'port' "auto"
|
||||
json_add_string 'path' "/wss"
|
||||
|
||||
if [ "${session}" = "Require" ]; then
|
||||
json_add_boolean 'useSession' 1;
|
||||
fi
|
||||
if [ "${session}" = "Require" ]; then
|
||||
json_add_boolean 'useSession' 1
|
||||
fi
|
||||
|
||||
json_add_string 'protocol' 'wss';
|
||||
json_add_array 'auth';
|
||||
json_close_array;
|
||||
|
||||
json_add_array 'urlOverrides';
|
||||
json_add_object "";
|
||||
json_add_object 'match';
|
||||
json_add_string 'protocol' 'http:'
|
||||
json_close_object
|
||||
json_add_object 'override';
|
||||
json_add_string 'protocol' 'ws'
|
||||
json_add_int 'port' "$(_get_sulu_http_port)";
|
||||
json_close_object
|
||||
json_add_string 'protocol' 'autoWs'
|
||||
json_add_object 'overrides'
|
||||
{
|
||||
for user in ${users}; do
|
||||
json_add_object "${user}"
|
||||
{
|
||||
json_add_string 'fromId' "self::sulu-${user}"
|
||||
json_add_string 'publishEndpoint' "/usp/$(_get_agent_id)/${user}/endpoint"
|
||||
json_add_string 'subscribeEndpoint' "/usp/$(_get_agent_id)/${user}/controller"
|
||||
json_close_object
|
||||
}
|
||||
done
|
||||
json_close_object
|
||||
json_close_array
|
||||
}
|
||||
json_close_object
|
||||
}
|
||||
json_close_object
|
||||
}
|
||||
|
||||
json_add_object 'overrides';
|
||||
for f in ${users}; do
|
||||
json_add_object "${f}";
|
||||
json_add_string 'fromId' "self::sulu-${f}";
|
||||
json_add_string 'publishEndpoint' "/usp/$(_get_agent_id)/${f}/endpoint";
|
||||
json_add_string 'subscribeEndpoint' "/usp/$(_get_agent_id)/${f}/controller";
|
||||
json_close_object;
|
||||
done
|
||||
json_close_object;
|
||||
json_close_object;
|
||||
|
||||
# add the default connection
|
||||
json_add_object 'main';
|
||||
json_add_string 'fromId' 'proto::interop-usp-controller';
|
||||
json_add_string 'toId' "$(_get_endpoint_id)";
|
||||
json_add_int 'port' "$(_get_sulu_tls_port)";
|
||||
json_add_string 'path' "/wss";
|
||||
json_add_string 'protocol' 'wss';
|
||||
json_add_string 'publishEndpoint' "/usp/endpoint";
|
||||
json_add_string 'subscribeEndpoint' "/usp/controller";
|
||||
json_add_array 'auth';
|
||||
json_close_array;
|
||||
|
||||
json_add_array 'urlOverrides';
|
||||
json_add_object "";
|
||||
json_add_object 'match';
|
||||
json_add_string 'protocol' 'http:'
|
||||
json_close_object
|
||||
json_add_object 'override';
|
||||
json_add_string 'protocol' 'ws'
|
||||
json_add_int 'port' "$(_get_sulu_http_port)";
|
||||
json_close_object
|
||||
json_close_object
|
||||
json_close_array
|
||||
json_close_object;
|
||||
json_close_object;
|
||||
|
||||
json_dump > ${SCONFIG}
|
||||
json_dump >${SCONFIG}
|
||||
}
|
||||
|
||||
function set_sulu_connection_mode()
|
||||
{
|
||||
local rbac profile config SCONFIG
|
||||
|
||||
SCONFIG="$(_get_sulu_connection_config)"
|
||||
rbac="${1}"
|
||||
|
||||
profile="$(jq '."Current-connection"' ${SCONFIG})"
|
||||
if [ "$rbac" -eq "1" -a "${profile}" == "\"main\"" ]; then
|
||||
config="$(jq '."Current-connection" = "rbac"' ${SCONFIG})"
|
||||
echo "${config}" > ${SCONFIG}
|
||||
elif [ "$rbac" -eq "0" -a "${profile}" == "\"rbac\"" ]; then
|
||||
config="$(jq '."Current-connection" = "main"' ${SCONFIG})"
|
||||
echo "${config}" > ${SCONFIG}
|
||||
fi
|
||||
}
|
||||
|
||||
function update_sulu_connection_port()
|
||||
{
|
||||
local port ws_port SCONF
|
||||
|
||||
SCONF="$(_get_sulu_connection_config)"
|
||||
ws_port="$(_get_sulu_tls_port)"
|
||||
|
||||
port="$(jq '.Connections.rbac.port' ${SCONF})"
|
||||
if [ "${port}" -ne "${ws_port}" ]; then
|
||||
jq ".Connections.main.port = ${ws_port} | .Connections.rbac.port = ${ws_port}" ${SCONF} > /tmp/sulu/ss_port.json
|
||||
mv /tmp/sulu/ss_port.json ${SCONF}
|
||||
fi
|
||||
}
|
||||
|
||||
function _update_obuspa_config()
|
||||
{
|
||||
local restart
|
||||
|
||||
restart=0
|
||||
if ! uci_get obuspa localmqtt >/dev/null 2>&1; then
|
||||
uci_add obuspa mqtt localmqtt
|
||||
uci_set obuspa localmqtt BrokerAddress "127.0.0.1"
|
||||
uci_set obuspa localmqtt BrokerPort "1883"
|
||||
uci_set obuspa localmqtt TransportProtocol "TCP/IP"
|
||||
restart=1
|
||||
fi
|
||||
|
||||
if ! uci_get obuspa agent_mtp >/dev/null 2>&1; then
|
||||
uci_add obuspa mtp agent_mtp
|
||||
uci_set obuspa agent_mtp Protocol "MQTT"
|
||||
uci_set obuspa agent_mtp ResponseTopicConfigured "/usp/endpoint"
|
||||
uci_set obuspa agent_mtp mqtt "localmqtt"
|
||||
restart=1
|
||||
fi
|
||||
|
||||
if ! uci_get obuspa localcontroller >/dev/null 2>&1; then
|
||||
uci_add obuspa controller localcontroller
|
||||
uci_set obuspa localcontroller EndpointID "proto::interop-usp-controller"
|
||||
uci_set obuspa localcontroller Protocol "MQTT"
|
||||
uci_set obuspa localcontroller Topic "/usp/controller"
|
||||
uci_set obuspa localcontroller mqtt "localmqtt"
|
||||
uci_set obuspa localcontroller assigned_role_name "full_access"
|
||||
restart=1
|
||||
fi
|
||||
return "${restart}"
|
||||
}
|
||||
|
||||
function _remove_obuspa_config()
|
||||
{
|
||||
function _remove_obuspa_config() {
|
||||
local restart session
|
||||
|
||||
restart=0
|
||||
@@ -288,86 +166,68 @@ function _update_obuspa_config_rbac() {
|
||||
session="$(_get_sulu_session_mode)"
|
||||
restart=0
|
||||
|
||||
for f in ${users}; do
|
||||
local sec
|
||||
for user in ${users}; do
|
||||
local section
|
||||
|
||||
# Add mqtt
|
||||
sec="mqtt_sulu_${f}"
|
||||
if ! uci_get obuspa ${sec} >/dev/null 2>&1; then
|
||||
uci_add obuspa mqtt ${sec}
|
||||
uci_set obuspa ${sec} BrokerAddress "127.0.0.1"
|
||||
uci_set obuspa ${sec} BrokerPort "1883"
|
||||
uci_set obuspa ${sec} TransportProtocol "TCP/IP"
|
||||
section="mqtt_sulu_${user}"
|
||||
if ! uci_get obuspa ${section} >/dev/null 2>&1; then
|
||||
uci_add obuspa mqtt ${section}
|
||||
uci_set obuspa ${section} BrokerAddress "127.0.0.1"
|
||||
uci_set obuspa ${section} BrokerPort "1883"
|
||||
uci_set obuspa ${section} TransportProtocol "TCP/IP"
|
||||
restart=1
|
||||
fi
|
||||
|
||||
# Add mtp
|
||||
sec="mtp_sulu_${f}"
|
||||
if ! uci_get obuspa ${sec} >/dev/null 2>&1; then
|
||||
uci_add obuspa mtp ${sec}
|
||||
uci_set obuspa ${sec} Protocol "MQTT"
|
||||
uci_set obuspa ${sec} ResponseTopicConfigured "/usp/${agent}/${f}/endpoint"
|
||||
uci_set obuspa ${sec} mqtt "mqtt_sulu_$f"
|
||||
section="mtp_sulu_${user}"
|
||||
if ! uci_get obuspa ${section} >/dev/null 2>&1; then
|
||||
uci_add obuspa mtp ${section}
|
||||
uci_set obuspa ${section} Protocol "MQTT"
|
||||
uci_set obuspa ${section} ResponseTopicConfigured "/usp/${agent}/${user}/endpoint"
|
||||
uci_set obuspa ${section} mqtt "mqtt_sulu_$user"
|
||||
restart=1
|
||||
fi
|
||||
|
||||
# Add controller
|
||||
sec="controller_sulu_${f}"
|
||||
if ! uci_get obuspa ${sec} >/dev/null 2>&1; then
|
||||
uci_add obuspa controller ${sec}
|
||||
uci_set obuspa ${sec} EndpointID "self::sulu-${f}"
|
||||
uci_set obuspa ${sec} Protocol "MQTT"
|
||||
uci_set obuspa ${sec} Topic "/usp/${agent}/${f}/controller"
|
||||
uci_set obuspa ${sec} mqtt "mqtt_sulu_$f"
|
||||
uci_set obuspa ${sec} assigned_role_name "$f"
|
||||
section="controller_sulu_${user}"
|
||||
if ! uci_get obuspa ${section} >/dev/null 2>&1; then
|
||||
uci_add obuspa controller ${section}
|
||||
uci_set obuspa ${section} EndpointID "self::sulu-${user}"
|
||||
uci_set obuspa ${section} Protocol "MQTT"
|
||||
uci_set obuspa ${section} Topic "/usp/${agent}/${user}/controller"
|
||||
uci_set obuspa ${section} mqtt "mqtt_sulu_$user"
|
||||
uci_set obuspa ${section} assigned_role_name "$user"
|
||||
restart=1
|
||||
fi
|
||||
|
||||
obMode="$(uci_get obuspa ${sec} SessionMode)"
|
||||
obMode="$(uci_get obuspa ${section} SessionMode)"
|
||||
if [ "${session}" != "${obMode}" ]; then
|
||||
uci_set obuspa ${sec} SessionMode "${session}"
|
||||
uci_set obuspa ${section} SessionMode "${session}"
|
||||
restart=1
|
||||
fi
|
||||
done
|
||||
return "${restart}"
|
||||
}
|
||||
|
||||
function _remove_sulu_sec()
|
||||
{
|
||||
local sec
|
||||
function _remove_sulu_section() {
|
||||
local section="$1"
|
||||
|
||||
if [[ "${1}" == *"_sulu_"* ]]; then
|
||||
if [[ "${section}" == *"_sulu_"* ]]; then
|
||||
uci_remove obuspa ${1}
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
function _remove_obuspa_config_rbac()
|
||||
{
|
||||
local restart
|
||||
|
||||
restart=0
|
||||
config_foreach _remove_sulu_sec mqtt
|
||||
restart="$(( restart + $? ))"
|
||||
config_foreach _remove_sulu_sec mtp
|
||||
restart="$(( restart + $? ))"
|
||||
config_foreach _remove_sulu_sec controller
|
||||
restart="$(( restart + $? ))"
|
||||
uci_set obuspa global role_file ""
|
||||
|
||||
return "${restart}"
|
||||
}
|
||||
|
||||
function _create_acl() {
|
||||
local agentid rbac users restart
|
||||
local agentid users restart
|
||||
local ACL_FILE
|
||||
|
||||
rbac="${1:-0}"
|
||||
restart="0"
|
||||
|
||||
ACL_FILE="$(_get_sulu_acl_file)"
|
||||
if [ -z "${ACL_FILE}" -o "${rbac}" -eq "0" ]; then
|
||||
if [ -z "${ACL_FILE}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
@@ -376,20 +236,18 @@ function _create_acl() {
|
||||
fi
|
||||
touch "${ACL_FILE}"
|
||||
|
||||
if [ "${rbac}" -eq "1" ]; then
|
||||
users="$(_get_sulu_users)"
|
||||
agentid="$(_get_agent_id)"
|
||||
for f in ${users}; do
|
||||
if ! grep -q "user $f" ${ACL_FILE}; then
|
||||
echo "user ${f}" >> ${ACL_FILE}
|
||||
echo "topic read /usp/${agentid}/${f}/controller/reply-to/#" >> ${ACL_FILE}
|
||||
echo "topic write /usp/${agentid}/${f}/endpoint/#" >> ${ACL_FILE}
|
||||
echo "topic read /usp/${agentid}/${f}/controller/#" >> ${ACL_FILE}
|
||||
echo "" >> ${ACL_FILE}
|
||||
restart="1"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
users="$(_get_sulu_users)"
|
||||
agentid="$(_get_agent_id)"
|
||||
for user in ${users}; do
|
||||
if ! grep -q "user $user" ${ACL_FILE}; then
|
||||
echo "user ${user}" >>${ACL_FILE}
|
||||
echo "topic read /usp/${agentid}/${user}/controller/reply-to/#" >>${ACL_FILE}
|
||||
echo "topic write /usp/${agentid}/${user}/endpoint/#" >>${ACL_FILE}
|
||||
echo "topic read /usp/${agentid}/${user}/controller/#" >>${ACL_FILE}
|
||||
echo "" >>${ACL_FILE}
|
||||
restart="1"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "${restart}" -gt "0" ]; then
|
||||
slog "Restarting mosquitto..."
|
||||
@@ -397,25 +255,16 @@ function _create_acl() {
|
||||
fi
|
||||
}
|
||||
|
||||
function update_obuspa_config()
|
||||
{
|
||||
local rbac restart
|
||||
function update_obuspa_config() {
|
||||
local restart
|
||||
|
||||
rbac="${1}"
|
||||
restart=0
|
||||
|
||||
uci_load obuspa
|
||||
if [ "${rbac}" -eq "1" ]; then
|
||||
_remove_obuspa_config
|
||||
restart="$(( restart + $? ))"
|
||||
_update_obuspa_config_rbac
|
||||
restart="$(( restart + $? ))"
|
||||
else
|
||||
_remove_obuspa_config_rbac
|
||||
restart="$(( restart + $? ))"
|
||||
_update_obuspa_config
|
||||
restart="$(( restart + $? ))"
|
||||
fi
|
||||
_remove_obuspa_config
|
||||
restart="$((restart + $?))"
|
||||
_update_obuspa_config_rbac
|
||||
restart="$((restart + $?))"
|
||||
uci_commit obuspa
|
||||
|
||||
if [ "${_RESTART_SERVICES}" -eq "1" -a "${restart}" -gt "0" ]; then
|
||||
@@ -424,22 +273,19 @@ function update_obuspa_config()
|
||||
fi
|
||||
}
|
||||
|
||||
function configure_sulu()
|
||||
{
|
||||
local sys_cred rbac restart
|
||||
function configure_sulu() {
|
||||
local sys_cred restart
|
||||
|
||||
sys_cred="${1}"
|
||||
rbac="${2}"
|
||||
restart="${3:-0}"
|
||||
restart="${2:-0}"
|
||||
|
||||
if [ -z "${sys_cred}" -o -z "${rbac}" ]; then
|
||||
if [ -z "${sys_cred}" ]; then
|
||||
slog "Invalid inputs"
|
||||
return 0
|
||||
fi
|
||||
|
||||
_RESTART_SERVICES="${restart}"
|
||||
|
||||
set_sulu_connection_mode "${rbac}"
|
||||
update_obuspa_config "${rbac}"
|
||||
_create_acl "${rbac}"
|
||||
update_obuspa_config
|
||||
_create_acl
|
||||
}
|
||||
|
||||
@@ -21,25 +21,28 @@ add_sulu_nginx_uci()
|
||||
uci_set nginx _sulu_s error_log '/dev/null'
|
||||
fi
|
||||
|
||||
# To host on http, disable _suluredirect and enable _sulu_http
|
||||
# if ! uci_get nginx _suluredirect >/dev/null 2>&1; then
|
||||
# uci_add nginx server _suluredirect
|
||||
# uci_add_list nginx _suluredirect listen "8080"
|
||||
# uci_add_list nginx _suluredirect listen "[::]:8080"
|
||||
# uci_set nginx _suluredirect server_name '_suluredirect'
|
||||
# uci_set nginx _suluredirect return '302 https://$host:8443$request_uri'
|
||||
# fi
|
||||
|
||||
if ! uci_get nginx _sulu_http >/dev/null 2>&1; then
|
||||
uci_add nginx server _sulu_http
|
||||
uci_set nginx _sulu_http root '/sulu'
|
||||
uci_add_list nginx _sulu_http listen "8080"
|
||||
uci_add_list nginx _sulu_http listen "[::]:8080"
|
||||
uci_set nginx _sulu_http server_name '_sulu_http'
|
||||
uci_add_list nginx _sulu_http include '/etc/sulu/nginx.locations'
|
||||
uci_set nginx _sulu_http ssl_session_cache 'none'
|
||||
uci_set nginx _sulu_http access_log 'off; # logd openwrt'
|
||||
# To host on http, disable _suluredirect and enable _sulu_http
|
||||
if ! uci_get nginx _suluredirect >/dev/null 2>&1; then
|
||||
uci_add nginx server _suluredirect
|
||||
uci_add_list nginx _suluredirect listen "8080"
|
||||
uci_add_list nginx _suluredirect listen "[::]:8080"
|
||||
uci_set nginx _suluredirect server_name '_suluredirect'
|
||||
uci_set nginx _suluredirect return '302 https://$host:8443$request_uri'
|
||||
fi
|
||||
|
||||
if uci_get nginx _sulu_http >/dev/null 2>&1; then
|
||||
uci_remove nginx _sulu_http
|
||||
fi
|
||||
# if ! uci_get nginx _sulu_http >/dev/null 2>&1; then
|
||||
# uci_add nginx server _sulu_http
|
||||
# uci_set nginx _sulu_http root '/sulu'
|
||||
# uci_add_list nginx _sulu_http listen "8080"
|
||||
# uci_add_list nginx _sulu_http listen "[::]:8080"
|
||||
# uci_set nginx _sulu_http server_name '_sulu_http'
|
||||
# uci_add_list nginx _sulu_http include '/etc/sulu/nginx.locations'
|
||||
# uci_set nginx _sulu_http ssl_session_cache 'none'
|
||||
# uci_set nginx _sulu_http access_log 'off; # logd openwrt'
|
||||
# fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
config_load sulu
|
||||
config_get enable_system_credentials global enable_system_credentials 1
|
||||
config_get role_based_access global role_based_access 0
|
||||
|
||||
configure_sulu "${enable_system_credentials}" "${role_based_access}" 0
|
||||
generate_sulu_conn_config "${role_based_access}"
|
||||
configure_sulu "${enable_system_credentials}" 0
|
||||
generate_sulu_conn_config
|
||||
|
||||
@@ -39,6 +39,11 @@ endif
|
||||
|
||||
define Build/Compile
|
||||
# Skip compilation, will be build with sulu-builder
|
||||
ifeq ($(SULU_MOD),core)
|
||||
ifneq ($(CONFIG_SULU_ENV_DATA),)
|
||||
echo -e "$(CONFIG_SULU_ENV_DATA)" > $(PKG_BUILD_DIR)/.env
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
ifeq ($(SULU_PLUGIN_INSTALL),0)
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=sulu-lcm
|
||||
PKG_VERSION:=3.1.21
|
||||
PKG_VERSION:=3.1.27
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-lcm.git
|
||||
PKG_SOURCE_VERSION:=acb0853935ff1f465bb8dc0108b52b26029a61a1
|
||||
PKG_SOURCE_VERSION:=6b1d30d7918adeb19c5177dd7c5472cb0dac9896
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include ../sulu-builder/sulu.mk
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=sulu-multi-ap
|
||||
PKG_VERSION:=3.1.21
|
||||
PKG_VERSION:=3.1.42
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-multi-ap.git
|
||||
PKG_SOURCE_VERSION:=e9a6d5e8e14b59afb588140b2f7ff4367c361f84
|
||||
PKG_SOURCE_VERSION:=e209cbc04a92494b96c74cee443e1b385c6687fe
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include ../sulu-builder/sulu.mk
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=sulu-parental-control
|
||||
PKG_VERSION:=3.1.21
|
||||
PKG_VERSION:=3.1.38
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-parental-control.git
|
||||
PKG_SOURCE_VERSION:=ac898cf7c1d03eff29991d3850ba0911d803c06f
|
||||
PKG_SOURCE_VERSION:=dd9dab9fb8aca87991cd2cc02c5fedd8baee3b97
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include ../sulu-builder/sulu.mk
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=swmodd
|
||||
PKG_VERSION:=2.4.2
|
||||
PKG_VERSION:=2.5.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/lcm/swmodd.git
|
||||
PKG_SOURCE_VERSION:=ad39d3aa3b69c4efcb9f0230cee17af00fb3337f
|
||||
PKG_SOURCE_VERSION:=80d8a2f0dddc8e1575c0a6dee1e496c52104d033
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -83,6 +83,7 @@ define Package/swmodd/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/swmodd $(1)/usr/sbin/swmodd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/opkg_offline.sh $(1)/usr/share/swmodd/opkg_offline
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-bundle-path $(1)/etc/uci-defaults/01-fix-bundle-path
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/03-execenv-ref $(1)/etc/uci-defaults/03-execenv-ref
|
||||
ifeq ($(CONFIG_PACKAGE_liblxc),y)
|
||||
$(INSTALL_DIR) $(1)/usr/share/lxc/templates/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/templates/lxc-iopsys $(1)/usr/share/lxc/templates/lxc-iopsys
|
||||
|
||||
@@ -16,13 +16,14 @@ is_container_running() {
|
||||
|
||||
|
||||
configure_lxc_container() {
|
||||
local requested_state name ctype du_status BUNDLE
|
||||
local requested_state name ctype du_status BUNDLE section
|
||||
|
||||
ctype="${1}"
|
||||
name="${2}"
|
||||
requested_state="${3}"
|
||||
du_state="${4}"
|
||||
du_status="${4}"
|
||||
BUNDLE="${5}"
|
||||
section="${6}"
|
||||
|
||||
if [ "${ctype}" != "lxc" ]; then
|
||||
return 0;
|
||||
@@ -33,6 +34,18 @@ configure_lxc_container() {
|
||||
if [ -d "${BUNDLE:?}/${name:?}" ]; then
|
||||
rm -rf "${BUNDLE:?}/${name:?}"
|
||||
fi
|
||||
|
||||
# If directory still exists then uninstall failed
|
||||
if [ -d "${BUNDLE}/${name}" ]; then
|
||||
uci_set ocicontainer "${section}" du_status Uninstalling_failed
|
||||
uci_set ocicontainer "${section}" fault_string "Failed to remove ${BUNDLE}/${name}"
|
||||
log "LXC container ${name} remove failed"
|
||||
else
|
||||
uci_set ocicontainer "${section}" du_status Uninstalling_success
|
||||
log "LXC container ${name} removed"
|
||||
fi
|
||||
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ "${requested_state}" = "Idle" ]; then
|
||||
@@ -66,7 +79,7 @@ configure_crun_container() {
|
||||
fi
|
||||
|
||||
if [ "${type}" != "crun" ]; then
|
||||
configure_lxc_container "${type}" "${name}" "${requested_state}" "${du_status}" "${BUNDLE}"
|
||||
configure_lxc_container "${type}" "${name}" "${requested_state}" "${du_status}" "${BUNDLE}" "${1}"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
@@ -203,7 +216,7 @@ boot() {
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local bundle bridge boot
|
||||
local bundle root env bridge boot
|
||||
|
||||
# Check if crun present
|
||||
if ! command -v crun >/dev/null 2>&1; then
|
||||
@@ -218,15 +231,17 @@ start_service() {
|
||||
fi
|
||||
|
||||
config_load swmodd
|
||||
config_get bundle globals oci_bundle_root ""
|
||||
config_get root globals root ""
|
||||
config_get bridge globals lan_bridge "br-lan"
|
||||
config_get timeout globals oci_pull_timeout "10"
|
||||
|
||||
if [ -z "${bundle}" ] || [ -z "${bridge}" ]; then
|
||||
log "Empty bundle path or bridge"
|
||||
env=$(uci -q get swmodd.@execenv[0].name)
|
||||
if [ -z "${root}" ] || [ -z "${bridge}" ]; then
|
||||
log "Base bundle root[$root] or bridge[$bridge] not defined"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
bundle="${root}/${env}"
|
||||
if [ -f "${bundle}/ocicontainer" ]; then
|
||||
UCI_CONFIG_DIR="${bundle}"
|
||||
config_load ocicontainer
|
||||
@@ -235,6 +250,8 @@ start_service() {
|
||||
|
||||
# Add a timer for DuStateChange!
|
||||
(sleep 5 && ubus -t 5 call swmodules reload) &
|
||||
else
|
||||
log "${bundle}/ocicontainer not present"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,7 @@ validate_globals_section()
|
||||
'enabled:bool:1' \
|
||||
'debug:bool:false' \
|
||||
'log_level:uinteger:1' \
|
||||
'lxc_bundle_root:string' \
|
||||
'oci_bundle_root:string' \
|
||||
'root:string' \
|
||||
'sock:string'
|
||||
}
|
||||
|
||||
@@ -79,7 +78,7 @@ stop_lxc_containers() {
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enabled debug log_level sock lxc_bundle_root oci_bundle_root
|
||||
local enabled debug log_level sock root
|
||||
|
||||
config_load swmodd
|
||||
|
||||
@@ -89,13 +88,35 @@ start_service() {
|
||||
|
||||
[ "${enabled}" -eq 0 ] && return 0
|
||||
|
||||
if [ ! -d "${lxc_bundle_root}" ]; then
|
||||
log "# Not staring lxc [${lxc_bundle_root}] not present/defined"
|
||||
[ ! -d "/run" ] && ln -fs /var/run /run
|
||||
if [ ! -d "${root}" ]; then
|
||||
log "# Not staring root [${root}] not present/defined"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ ! -d "${oci_bundle_root}" ]; then
|
||||
log "# Not staring oci [${oci_bundle_root}] not present/defined"
|
||||
env_name=""
|
||||
execenvs=$(uci show swmodd | grep "=execenv" | cut -d'=' -f 1 | cut -d'.' -f 2)
|
||||
for env in ${execenvs}; do
|
||||
name=$(uci get swmodd.${env}.name)
|
||||
if [ -n "${name}" ]; then
|
||||
env_name="${name}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "${env_name}" ]; then
|
||||
log "# Not starting execenv name [${env_name}] not defined"
|
||||
return 1
|
||||
fi
|
||||
|
||||
bundle_root="${root}"
|
||||
if [ "${root: -1}" != '/' ]; then
|
||||
bundle_root="${root}/"
|
||||
fi
|
||||
|
||||
bundle_root="${bundle_root}${env_name}"
|
||||
if [ ! -d "${bundle_root}" ]; then
|
||||
log "# Not staring execenv [${bundle_root}] not present"
|
||||
return 1
|
||||
fi
|
||||
|
||||
@@ -116,15 +137,10 @@ start_service() {
|
||||
procd_close_instance
|
||||
|
||||
# Auto-start the lxc containers
|
||||
if [ -f "${lxc_bundle_root}/lxccontainer" ]; then
|
||||
UCI_CONFIG_DIR="${lxc_bundle_root}"
|
||||
config_load lxccontainer
|
||||
config_foreach start_lxc_container container ${lxc_bundle_root}
|
||||
fi
|
||||
if [ -f "${oci_bundle_root}/ocicontainer" ]; then
|
||||
UCI_CONFIG_DIR="${oci_bundle_root}"
|
||||
if [ -f "${bundle_root}/ocicontainer" ]; then
|
||||
UCI_CONFIG_DIR="${bundle_root}"
|
||||
config_load ocicontainer
|
||||
config_foreach start_lxc_container du_eu_assoc ${oci_bundle_root}
|
||||
config_foreach start_lxc_container du_eu_assoc ${bundle_root}
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -2,37 +2,48 @@
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
lxc=""
|
||||
lxc_bundle=""
|
||||
oci_bundle=""
|
||||
configure_ee_path() {
|
||||
local lxc_bundle oci_bundle name root
|
||||
|
||||
if [ -f "/etc/lxc/lxc.conf" ]; then
|
||||
lxc=$(cat /etc/lxc/lxc.conf |grep "lxc.lxcpath"| cut -d "=" -f 2)
|
||||
fi
|
||||
config_load swmodd
|
||||
config_get lxc_bundle globals lxc_bundle_root ""
|
||||
config_get oci_bundle globals oci_bundle_root ""
|
||||
|
||||
config_load swmodd
|
||||
config_get lxc_bundle globals lxc_bundle_root ""
|
||||
config_get oci_bundle globals oci_bundle_root ""
|
||||
|
||||
if [ -n "${lxc_bundle}" ]; then
|
||||
# if lxc_bundle_root define in swmodd, update it in lxc path
|
||||
mkdir -p /etc/lxc
|
||||
echo "lxc.lxcpath = ${lxc_bundle}" > /etc/lxc/lxc.conf
|
||||
elif [ -n "${lxc}" ]; then
|
||||
# if lxc_bundle_root not define in swmodd, update it with lxc path
|
||||
uci_set swmodd globals lxc_bundle_root ${lxc}
|
||||
else
|
||||
mkdir -p /etc/lxc
|
||||
echo "lxc.lxcpath = /srv/" > /etc/lxc/lxc.conf
|
||||
uci_set swmodd globals lxc_bundle_root "/srv/"
|
||||
fi
|
||||
if [ -n "${oci_bundle}" ]; then
|
||||
# if oci_bundle_root define in swmodd, then remove it
|
||||
name=$(echo ${oci_bundle##/*/})
|
||||
root=$(echo ${oci_bundle%/$name})
|
||||
echo "lxc.lxcpath = ${oci_bundle}" > /etc/lxc/lxc.conf
|
||||
elif [ -n "${lxc_bundle}" ]; then
|
||||
# if lxc_bundle_root define in swmodd, then remove it
|
||||
name=$(echo ${lxc_bundle##/*/})
|
||||
root=$(echo ${lxc_bundle%/$name})
|
||||
echo "lxc.lxcpath = ${lxc_bundle}" > /etc/lxc/lxc.conf
|
||||
elif [ -f /etc/lxc/lxc.conf ]; then
|
||||
bundle_path=$(cat /etc/lxc/lxc.conf | grep "lxc.lxcpath" | cut -d "=" -f 2 | sed 's/[[:blank:]]//g')
|
||||
name=$(echo ${bundle_path##/*/})
|
||||
root=$(echo ${bundle_path%/$name})
|
||||
else
|
||||
name="lxc"
|
||||
root="/srv"
|
||||
echo "lxc.lxcpath = /srv/lxc" > /etc/lxc/lxc.conf
|
||||
fi
|
||||
|
||||
if [ -z "${oci_bundle}" ] && [ -n "${lxc_bundle}" ]; then
|
||||
# if oci_bundle_root not defined in swmodd, update it with lxc_bundle_root if defined
|
||||
uci_set swmodd globals oci_bundle_root ${lxc_bundle}
|
||||
elif [ -z "${oci_bundle}" ] && [ -n "${lxc}" ]; then
|
||||
# if oci_bundle_root not defined in swmodd, update it with lxc path
|
||||
uci_set swmodd globals oci_bundle_root ${lxc}
|
||||
elif [ -z "${oci_bundle}" ]; then
|
||||
uci_set swmodd globals oci_bundle_root "/srv/"
|
||||
fi
|
||||
uci_set swmodd globals oci_bundle_root ""
|
||||
uci_set swmodd globals lxc_bundle_root ""
|
||||
|
||||
# configure root in globals section
|
||||
if ! uci_get swmodd globals root >/dev/null; then
|
||||
uci_set swmodd globals root ${root}
|
||||
fi
|
||||
|
||||
# configure execenv in swmodd
|
||||
if ! uci_get swmodd.@execenv[0].name >/dev/null; then
|
||||
uci_add swmodd execenv execenv_1
|
||||
uci_set swmodd execenv_1 name ${name}
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
configure_ee_path
|
||||
|
||||
@@ -2,46 +2,41 @@
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
config_change=0
|
||||
migrate_from_lxc_to_oci_config() {
|
||||
config_load swmodd
|
||||
|
||||
migrate_lxc() {
|
||||
config_get name "${1}" name ""
|
||||
env_name=$(uci_get swmodd.@execenv[0].name)
|
||||
bundle_root=$(uci_get swmodd.globals.root)
|
||||
|
||||
if [ -z "${name}" ]; then
|
||||
return 0;
|
||||
if [ -z "${bundle_root}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Now lets check if already present in lxccontainer
|
||||
exist=$(uci -q -c "${2}" show lxccontainer | grep ".name='$name'")
|
||||
if [ -z "${exist}" ]; then
|
||||
# Not present, need to migrate
|
||||
sec=$(uci -q -c "${2}" add lxccontainer container)
|
||||
if [ -n "${sec}" ]; then
|
||||
uci -q -c "${2}" set lxccontainer."${sec}".name="${name}"
|
||||
uci -q -c "${2}" set lxccontainer."${sec}".type='lxc'
|
||||
uci -q -c "${2}" set lxccontainer."${sec}".autostart='1'
|
||||
uci -q -c "${2}" set lxccontainer."${sec}".timeout='300'
|
||||
config_change=1
|
||||
if [ -z "${env_name}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if ! command -v crun_create >/dev/null; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${bundle_root: -1}" != '/' ]; then
|
||||
bundle_root="${bundle_root}/"
|
||||
fi
|
||||
|
||||
lxcpath="${bundle_root}${env_name}"
|
||||
touch "${lxcpath}/ocicontainer"
|
||||
rm -rf "${lxcpath}/lxccontainer"
|
||||
|
||||
dirs=$(ls -l "${lxcpath}/" 2>/dev/null | grep '^d' | awk '{print $9}')
|
||||
|
||||
for d in ${dirs}; do
|
||||
config_file="${lxcpath}/${d}/config"
|
||||
|
||||
if [ -f "${config_file}" ]; then
|
||||
crun_create -c -r "${bundle_root}" -e "${env_name}" -n "${d}" --no-reload
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
config_load swmodd
|
||||
config_get lxc_bundle globals lxc_bundle_root ""
|
||||
|
||||
if [ -z "${lxc_bundle}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ ! -d "${lxc_bundle}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
touch "${lxc_bundle}"/lxccontainer
|
||||
|
||||
config_load lxc-auto
|
||||
config_foreach migrate_lxc container "${lxc_bundle}"
|
||||
|
||||
if [ $config_change -eq 1 ]; then
|
||||
uci -q -c "${lxc_bundle}" commit lxccontainer
|
||||
fi
|
||||
migrate_from_lxc_to_oci_config
|
||||
|
||||
42
swmodd/files/etc/uci-defaults/03-execenv-ref
Normal file
42
swmodd/files/etc/uci-defaults/03-execenv-ref
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
set_execenv_ref() {
|
||||
config_get ee_name "${1}" ee_name ""
|
||||
|
||||
if [ "${ee_name}" != "${2}" ]; then
|
||||
uci_set ocicontainer "${1}" ee_name "${2}"
|
||||
fi
|
||||
}
|
||||
|
||||
migrate_execenv_ref() {
|
||||
config_load swmodd
|
||||
|
||||
env_name=$(uci_get swmodd.@execenv[0].name)
|
||||
bundle_root=$(uci_get swmodd.globals.root)
|
||||
|
||||
if [ -z "${bundle_root}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -z "${env_name}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${bundle_root: -1}" != '/' ]; then
|
||||
bundle_root="${bundle_root}/"
|
||||
fi
|
||||
|
||||
lxcpath="${bundle_root}${env_name}"
|
||||
|
||||
if [ -f "${lxcpath}/ocicontainer" ]; then
|
||||
UCI_CONFIG_DIR="${lxcpath}"
|
||||
config_load ocicontainer
|
||||
config_foreach set_execenv_ref du_eu_assoc ${env_name}
|
||||
fi
|
||||
|
||||
uci -q -c "${lxcpath}" commit ocicontainer
|
||||
}
|
||||
|
||||
migrate_execenv_ref
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=timemngr
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_VERSION:=1.0.13
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/timemngr.git
|
||||
PKG_SOURCE_VERSION:=b90e33743155735f8df9e86f2e053fed7601adb2
|
||||
PKG_SOURCE_VERSION:=7552c44b6fb4561687e0ce50639fd80396836d51
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -21,6 +21,8 @@ PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
#RSTRIP:=:
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
NAME=time
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t time.iface -p info
|
||||
}
|
||||
|
||||
configure_ntp_servers()
|
||||
{
|
||||
local ntp_interface
|
||||
|
||||
# Only change the ntp servers if interface matches with the defined interface
|
||||
ntp_interface="$(uci -q get ${NAME}.dhcp_driven.interface)"
|
||||
ntp_interface="$(uci -q get time.dhcp_driven.interface)"
|
||||
|
||||
if [ "${ntp_interface}" != "${1}" ]; then
|
||||
return 0
|
||||
@@ -19,13 +21,14 @@ configure_ntp_servers()
|
||||
json_select data
|
||||
json_get_var servers ntpserver ""
|
||||
|
||||
exist_dhcp_ntp_server="$(uci -q get ${NAME}.dhcp_driven.server)"
|
||||
exist_dhcp_ntp_server="$(uci -q get time.dhcp_driven.server)"
|
||||
if [ "${servers}" != "${exist_dhcp_ntp_server}" ]; then
|
||||
uci -q del ${NAME}.dhcp_driven.server
|
||||
uci -q del time.dhcp_driven.server
|
||||
for server in ${servers}; do
|
||||
uci -q add_list ${NAME}.dhcp_driven.server="${server}"
|
||||
uci -q add_list time.dhcp_driven.server="${server}"
|
||||
done
|
||||
eval ubus call uci commit '{\"config\":\"$NAME\"}'
|
||||
log "Restarting timemngr"
|
||||
ubus call uci commit '{"config":"time"}'
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -11,17 +11,21 @@ PROG_UBUS=/usr/sbin/timemngr
|
||||
|
||||
DM_INPUT="/etc/timemngr/input.json"
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t time.init -p info
|
||||
}
|
||||
|
||||
validate_global_section() {
|
||||
uci_validate_section time global global \
|
||||
'enable:bool:1' \
|
||||
'loglevel:uinteger:1'
|
||||
'loglevel:uinteger:4'
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enable loglevel
|
||||
|
||||
if uci -q get system.ntp >/dev/null 2>&1; then
|
||||
logger -t timemngr.init "Not starting timemngr, legacy ntp definition detected"
|
||||
log "Not starting timemngr, legacy ntp definition detected"
|
||||
return 1
|
||||
fi
|
||||
|
||||
@@ -36,6 +40,7 @@ start_service() {
|
||||
procd_open_instance timemngr_ubus
|
||||
procd_set_param command $PROG_UBUS
|
||||
procd_append_param command -l ${loglevel}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
|
||||
generate_config
|
||||
@@ -45,6 +50,7 @@ start_service() {
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
log "Restarting timemngr"
|
||||
stop
|
||||
start
|
||||
}
|
||||
@@ -58,8 +64,9 @@ service_triggers() {
|
||||
}
|
||||
|
||||
if [ "$enable" != 0 ] && [ "$mode" = "Broadcast" ] && [ -n "$interface" ]; then
|
||||
log "Service trigger for interface up event"
|
||||
procd_open_trigger
|
||||
procd_add_interface_trigger "interface.*.up" $interface /etc/init.d/timemngr restart
|
||||
procd_add_interface_trigger "interface.*.up" $interface /etc/init.d/timemngr reload
|
||||
procd_close_trigger
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -180,5 +180,6 @@ generate_config() {
|
||||
create_service() {
|
||||
procd_open_instance timemngr
|
||||
procd_set_param command "/sbin/ntpd" -g -u ntp:ntp -n -c ${CONF_FILE}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
config TR104_DOTSO_PLUGIN
|
||||
bool "Use bbfdm DotSO plugin backend to provide TR104 and extension datamodel"
|
||||
config TR104_RUNAS_BBFDM_MICROSERVICE
|
||||
bool "Use bbfdmd datamodel microservice to run tr104, preferred if TR104 and BBFDMD are on different base"
|
||||
depends on PACKAGE_tr104
|
||||
default n
|
||||
|
||||
config TR104_VENDOR_EXTENSIONS
|
||||
bool "Use TR104 vendor extensions"
|
||||
depends on PACKAGE_tr104
|
||||
default y
|
||||
|
||||
@@ -5,20 +5,23 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tr104
|
||||
PKG_VERSION:=1.0.7
|
||||
PKG_VERSION:=1.0.14
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifeq ($(LOCAL_DEV),0)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/voice/tr104.git
|
||||
PKG_SOURCE_VERSION:=cd0c5d1f4a8489e3d93b5cf433f8f0df638bf62b
|
||||
PKG_SOURCE_VERSION:=fa19217fbd589d064e1f32ec20d0df53e31fb610
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_CONFIG_DEPENDS:=CONFIG_TR104_RUNAS_BBFDM_MICROSERVICE CONFIG_TR104_VENDOR_EXTENSIONS
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_USE_NINJA:=0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
@@ -43,7 +46,21 @@ endef
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)" \
|
||||
-DDAEMON_JSON_INPUT:String="/etc/tr104/input.json" \
|
||||
-DDM_ENABLE_UBUS=ON
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
|
||||
-DDM_ENABLE_UBUS:BOOL=ON
|
||||
|
||||
ifeq ($(CONFIG_TR104_VENDOR_EXTENSIONS),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DTR104_EXTENSION_DIR:String="iowrt"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_RUNAS_BBFDM_MICROSERVICE),y)
|
||||
MAKE_PATH:=libdm
|
||||
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/libbbfdm-api
|
||||
CMAKE_OPTIONS += -DRUNAS_BBFDM_MICROSERVICE:BOOL=ON
|
||||
else
|
||||
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/tr104
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
@@ -53,18 +70,26 @@ endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
ifeq ($(CONFIG_TR104_DOTSO_PLUGIN),y)
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libdm/tr104/libtr104.so)
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libdm/tr104_ext/libtr104ext.so)
|
||||
else
|
||||
$(INSTALL_DIR) $(1)/etc/tr104/plugins/
|
||||
$(INSTALL_BIN) ./files/etc/tr104/input.json $(1)/etc/tr104/input.json
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libdm/tr104/libtr104.so $(1)/etc/tr104/
|
||||
ifeq ($(CONFIG_TR104_VENDOR_EXTENSIONS),y)
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libdm/extensions/iowrt/libtr104ext.so $(1)/etc/tr104/plugins/
|
||||
endif
|
||||
ifeq ($(CONFIG_RUNAS_BBFDM_MICROSERVICE),y)
|
||||
$(INSTALL_BIN) ./files/etc/init.d/tr104d.bbfdm $(1)/etc/init.d/tr104d
|
||||
else
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/daemon/ubus/tr104d $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libdm/tr104/libtr104.so $(1)/etc/tr104/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libdm/tr104_ext/libtr104ext.so $(1)/etc/tr104/plugins/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/tr104d $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/etc/tr104/input.json $(1)/etc/tr104/input.json
|
||||
$(INSTALL_BIN) ./files/etc/init.d/tr104d $(1)/etc/init.d/tr104d
|
||||
endif
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/include/tr104
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libdmtree/*.h $(1)/usr/include/tr104/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libdm/common/common.h $(1)/usr/include/tr104/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=96
|
||||
START=60
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
12
tr104/files/etc/init.d/tr104d.bbfdm
Normal file
12
tr104/files/etc/init.d/tr104d.bbfdm
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=60
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
. /etc/bbfdm/bbfdm_services.sh
|
||||
|
||||
start_service()
|
||||
{
|
||||
bbfdm_add_service "tr104" "/etc/tr104/input.json"
|
||||
}
|
||||
@@ -6,13 +6,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=twamp
|
||||
PKG_VERSION:=1.4.2
|
||||
PKG_VERSION:=1.4.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/twamp-light.git
|
||||
PKG_SOURCE_VERSION:=f3d35a5499e8815721ba384e79fda8181f76b8f8
|
||||
PKG_SOURCE_VERSION:=d31b2128e6ea4ab42538b88db91b2cc84091ef4d
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user