mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-20 01:20:35 +08:00
Compare commits
46 Commits
easywifi
...
arjo_fix_g
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.4.23
|
||||
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:=c10303fc51a1034cb87040e0eaf23c95d2b1c658
|
||||
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
|
||||
@@ -136,22 +102,6 @@ CMAKE_OPTIONS += \
|
||||
|
||||
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
|
||||
@@ -162,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
|
||||
@@ -183,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
|
||||
@@ -216,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
|
||||
@@ -243,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))
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=2.1.3
|
||||
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:=f556410b51a2248f11358793f11ae54d3e53e85e
|
||||
PKG_SOURCE_VERSION:=f03fb8682aa7efe760294e54c422f2eab856e08c
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.5.29
|
||||
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:=f9a7bb027a754710353172fa1aec095c08c90832
|
||||
PKG_SOURCE_VERSION:=601708dd0a2ca4fad5213e78cc456e0f355f45bc
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -26,68 +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
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(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
|
||||
@@ -102,20 +55,11 @@ define Package/icwmp/default/install
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/85-cwmp-set-userid $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/95-set-random-inform-time $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/icwmpd/uci_stuck_workaround.sh $(1)/etc/icwmpd/uci_stuck_workaround.sh
|
||||
$(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))
|
||||
|
||||
@@ -21,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 'ERROR'
|
||||
option log_severity 'DEBUG'
|
||||
option log_file_name '/var/log/icwmpd.log'
|
||||
option log_max_size '102400'
|
||||
option userid '' #$OUI-$SER
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
log()
|
||||
{
|
||||
logger -t cwmp.hacks "$@"
|
||||
}
|
||||
|
||||
timeout 2 uci -c /var/state show icwmp >/dev/null 2>&1
|
||||
if [ "$?" -eq "143" ]; then
|
||||
log "Seems uci got stuck, restarting cwmp ...."
|
||||
/etc/init.d/icwmpd restart
|
||||
fi
|
||||
@@ -436,13 +436,14 @@ validate_cpe_section()
|
||||
'notification:bool' \
|
||||
'exec_download:bool' \
|
||||
'periodic_notify_enable:bool' \
|
||||
'enable:bool' \
|
||||
'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 || {
|
||||
@@ -450,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
|
||||
@@ -465,6 +471,11 @@ validate_defaults() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if [ "$enable" = "0" ]; then
|
||||
log "CWMP service disabled"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -512,42 +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 ""
|
||||
|
||||
procd_open_instance icwmp
|
||||
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
procd_close_instance
|
||||
return 0
|
||||
fi
|
||||
|
||||
validate_defaults || {
|
||||
log "Validation of defaults failed"
|
||||
procd_close_instance
|
||||
return 1;
|
||||
}
|
||||
|
||||
if [ -n "${url}" ] || [ -n "${dhcp_url}" ]; then
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -b
|
||||
fi
|
||||
|
||||
# Add crontab job to check uci stuck
|
||||
if ! grep -q "uci_stuck_workaround.sh" /etc/crontabs/root; then
|
||||
echo "*/1 * * * * /etc/icwmpd/uci_stuck_workaround.sh" >>/etc/crontabs/root
|
||||
ubus call uci commit '{"config":"cron"}'
|
||||
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
|
||||
}
|
||||
|
||||
@@ -559,22 +550,34 @@ 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
|
||||
fi
|
||||
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
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
@@ -179,6 +179,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
|
||||
@@ -248,7 +250,6 @@ 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
|
||||
@@ -330,3 +331,7 @@ 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
|
||||
|
||||
@@ -61,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
|
||||
|
||||
@@ -365,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)
|
||||
@@ -383,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
|
||||
|
||||
@@ -339,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
|
||||
@@ -357,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
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libwifi
|
||||
PKG_VERSION:=7.4.16
|
||||
PKG_VERSION:=7.4.18
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=dfafd5f7ea387d6119a9eb692e435f98b16f75a3
|
||||
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
|
||||
@@ -143,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
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=4.5.0.10
|
||||
PKG_VERSION:=4.5.1.0
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=a03ea6bee6856000496d858f3b4c8d161612472d
|
||||
PKG_SOURCE_VERSION:=6d74ca3c6a4a2893160a5de2f7f455a8d8596fec
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=4.5.0.2
|
||||
PKG_VERSION:=4.5.0.4
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=3c915f5f17ff339487a3b8533d384a23888b9c9a
|
||||
PKG_SOURCE_VERSION:=59a3bb0e2cbd0f37f60bd121e4b30289a64d310e
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=7.0.5.5
|
||||
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:=ad32d70ccbe3942b945bf6caf74988bd5660cf96
|
||||
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
|
||||
|
||||
@@ -544,6 +544,23 @@
|
||||
"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"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -758,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
diff --git a/src/core/device_bulkdata.c b/src/core/device_bulkdata.c
|
||||
index 8e44f59..a77bd71 100755
|
||||
--- a/src/core/device_bulkdata.c
|
||||
+++ b/src/core/device_bulkdata.c
|
||||
@@ -2995,6 +2995,33 @@ char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timesta
|
||||
return result;
|
||||
}
|
||||
|
||||
+/*********************************************************************//**
|
||||
+**
|
||||
+** 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
|
||||
@@ -3024,7 +3051,7 @@ void append_string_to_target(char *str, char **output)
|
||||
}
|
||||
|
||||
assert(tmp != NULL);
|
||||
- asprintf(output, "%s%s", tmp, str);
|
||||
+ safe_asprintf(output, "%s%s", tmp, str);
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
@@ -3072,9 +3099,9 @@ char *bulkdata_generate_csv_report(bulkdata_profile_t *bp, char *field_separator
|
||||
|
||||
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);
|
||||
@@ -3091,14 +3118,14 @@ char *bulkdata_generate_csv_report(bulkdata_profile_t *bp, char *field_separator
|
||||
// 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);
|
||||
+ safe_asprintf(×tamp, "%s", buf);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3151,9 +3178,9 @@ char *bulkdata_generate_csv_report(bulkdata_profile_t *bp, char *field_separator
|
||||
if (type) {
|
||||
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", param_path, separator, param_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, param_path, separator, param_value, separator, type, rowseparator);
|
||||
|
||||
assert(str != NULL);
|
||||
append_string_to_target(str, &output);
|
||||
@@ -3161,9 +3188,9 @@ char *bulkdata_generate_csv_report(bulkdata_profile_t *bp, char *field_separator
|
||||
str = NULL;
|
||||
} else {
|
||||
if (str1 == NULL || strlen(str1) == 0)
|
||||
- asprintf(&str, "%s", param_path);
|
||||
+ safe_asprintf(&str, "%s", param_path);
|
||||
else
|
||||
- asprintf(&str, "%c%s", separator, param_path);
|
||||
+ safe_asprintf(&str, "%c%s", separator, param_path);
|
||||
|
||||
assert(str != NULL);
|
||||
append_string_to_target(str, &str1);
|
||||
@@ -3171,9 +3198,9 @@ char *bulkdata_generate_csv_report(bulkdata_profile_t *bp, char *field_separator
|
||||
str = NULL;
|
||||
|
||||
if (str2 == NULL || strlen(str2) == 0)
|
||||
- asprintf(&str, "%s", param_value);
|
||||
+ safe_asprintf(&str, "%s", param_value);
|
||||
else
|
||||
- asprintf(&str, "%c%s", separator, param_value);
|
||||
+ safe_asprintf(&str, "%c%s", separator, param_value);
|
||||
|
||||
assert(str != NULL);
|
||||
append_string_to_target(str, &str2);
|
||||
@@ -3190,7 +3217,7 @@ char *bulkdata_generate_csv_report(bulkdata_profile_t *bp, char *field_separator
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -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
|
||||
|
||||
@@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=stunc
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.3.3
|
||||
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:=7984a54a1e5dd95db0f4657ae974671ba7f37f27
|
||||
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.42
|
||||
PKG_VERSION:=3.1.45
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
|
||||
PKG_SOURCE_VERSION:=6a0cc2795607895bbe8c8e3598e3f5f435af3499
|
||||
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.42
|
||||
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:=76cb288b1496756e8ed43368348127ecfef5751d
|
||||
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)
|
||||
@@ -179,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
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tr104
|
||||
PKG_VERSION:=1.0.12
|
||||
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:=393ad165e64413067de84b452126aebf4bcbcb2d
|
||||
PKG_SOURCE_VERSION:=fa19217fbd589d064e1f32ec20d0df53e31fb610
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=twamp
|
||||
PKG_VERSION:=1.4.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
|
||||
|
||||
@@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=urlfilter
|
||||
PKG_VERSION:=1.1.8
|
||||
PKG_VERSION:=1.1.9
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/urlfilter.git
|
||||
PKG_SOURCE_VERSION:=a726e4ce9fa3322e135cb0dd961f31b4fd7ae22a
|
||||
PKG_SOURCE_VERSION:=75077256211644443ca30cc994ef16b013c4131c
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -21,7 +21,7 @@ configure_firewall()
|
||||
iptables -w -I INPUT 2 -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
|
||||
# disable acceleration for https packet so that they can be read by urlfilter
|
||||
ebtables -A FORWARD -p ip --ip-protocol 6 --ip-destination-port 443 -j SKIPLOG
|
||||
ebtables -A FORWARD -p ip --ip-protocol 6 --ip-destination-port 443 -j SKIPLOG 2> /dev/null
|
||||
fi
|
||||
ip6tables -w -nL FORWARD|grep -iqE "NFQUEUE"
|
||||
if [ "$?" -ne 0 ]; then
|
||||
@@ -62,7 +62,7 @@ stop_service() {
|
||||
iptables -w -D FORWARD -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -D INPUT -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -D INPUT -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ebtables -D FORWARD -p ip --ip-protocol 6 --ip-destination-port 443 -j SKIPLOG
|
||||
ebtables -D FORWARD -p ip --ip-protocol 6 --ip-destination-port 443 -j SKIPLOG 2> /dev/null
|
||||
fi
|
||||
ip6tables -w -nL FORWARD|grep -iqE "NFQUEUE"
|
||||
if [ "$?" -eq 0 ]; then
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=usermngr
|
||||
PKG_VERSION:=1.2.10
|
||||
PKG_VERSION:=1.2.12
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/usermngr.git
|
||||
PKG_SOURCE_VERSION:=4f429e25c6e7a69c5171186731bc560befa5a660
|
||||
PKG_SOURCE_VERSION:=b09414824b95f2a73e6f02b06d4efd15bfab77e0
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wifimngr
|
||||
PKG_VERSION:=16.2.1
|
||||
PKG_VERSION:=16.2.3
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=48082bc03ef03e0c3a9e843523482b017e8676e1
|
||||
PKG_SOURCE_VERSION:=3e5799f9cae80b3f9a1bc1fa6503020005f76aa9
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wifimngr.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=xmppc
|
||||
PKG_VERSION:=2.2.3
|
||||
PKG_VERSION:=2.2.4
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/xmppc.git
|
||||
PKG_SOURCE_VERSION:=23a7f6005b84fc4d4a1432057ecd2b5a74f9ea3e
|
||||
PKG_SOURCE_VERSION:=543c7a780544d195dd8d0357e453c0ce4fa62454
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user