mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-23 02:24:16 +08:00
Compare commits
77 Commits
devel-no-h
...
csmngr_tes
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fda7416852 | ||
|
|
f25274d726 | ||
|
|
6ba197ce98 | ||
|
|
0e2dc2f81c | ||
|
|
34a285bc6b | ||
|
|
da455c0808 | ||
|
|
07ac62e428 | ||
|
|
ccf5a26c17 | ||
|
|
f9e1decc9a | ||
|
|
21170ae143 | ||
|
|
9dbf0bc0e5 | ||
|
|
b5707298be | ||
|
|
a73b9b1dec | ||
|
|
bd830ca37b | ||
|
|
014f35b7ab | ||
|
|
0a9f5c30c9 | ||
|
|
c05e258ceb | ||
|
|
b318a5b6f2 | ||
|
|
1070248a0d | ||
|
|
9d3f965e62 | ||
|
|
ed690caaf1 | ||
|
|
ae5af97107 | ||
|
|
60b474355b | ||
|
|
1faed9afbd | ||
|
|
e6f090c9e6 | ||
|
|
532da477d9 | ||
|
|
ef281267db | ||
|
|
51f19923c0 | ||
|
|
6cf78059d7 | ||
|
|
a913f05342 | ||
|
|
83fb8b879b | ||
|
|
af3cbff6d1 | ||
|
|
45dcdc7783 | ||
|
|
8997c156d9 | ||
|
|
25e01248c5 | ||
|
|
2e70d12fd7 | ||
|
|
e47d128902 | ||
|
|
bb755d5774 | ||
|
|
250a89ca1d | ||
|
|
f139834fc7 | ||
|
|
0a8fb82fa8 | ||
|
|
0c8626ef5e | ||
|
|
dbd0fc3e17 | ||
|
|
267a855faf | ||
|
|
cea30db473 | ||
|
|
532aab72ee | ||
|
|
1a6a42b0ca | ||
|
|
2d21fa7e95 | ||
|
|
8a120f056a | ||
|
|
6e2083e30e | ||
|
|
9c50c4c41b | ||
|
|
689905913c | ||
|
|
c17d03ef56 | ||
|
|
0c65d03dca | ||
|
|
aeca33ecae | ||
|
|
150730e3e2 | ||
|
|
bc5d99459d | ||
|
|
2e4b1c84ac | ||
|
|
49a823a046 | ||
|
|
7ba428e4b2 | ||
|
|
f215dd2fb8 | ||
|
|
e9f91b465f | ||
|
|
6f4e3daffb | ||
|
|
9ecc88fc72 | ||
|
|
a9a44c2b13 | ||
|
|
71316b37e3 | ||
|
|
bb3267649f | ||
|
|
ae630fc142 | ||
|
|
9f71023857 | ||
|
|
8a86868513 | ||
|
|
91edc0fc99 | ||
|
|
a2bbe00934 | ||
|
|
3861cb8714 | ||
|
|
c94232f071 | ||
|
|
9cdc3e8265 | ||
|
|
d943a0e0d1 | ||
|
|
c25c241008 |
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.4.23
|
||||
PKG_VERSION:=1.4.23.11
|
||||
|
||||
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:=3cdbb5432c3a76824cfc0262b35d479471cba12c
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.6.4
|
||||
PKG_VERSION:=3.6.5
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=d9cc11c81ce1ff625e4e789afa180b301c7fcf74
|
||||
PKG_SOURCE_VERSION:=192e74db2082e3f89f6defe9d752d752b0b09079
|
||||
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.1
|
||||
PKG_VERSION:=2.1.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b81d06867d895245ef47004c6949f9d6dedd10ef
|
||||
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.1.4
|
||||
PKG_VERSION:=1.1.7
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=edb5bbe57c5bc83035e217c73071c9b3e878dc22
|
||||
PKG_SOURCE_VERSION:=79a6649995752da3501808debeed9e3ddfdf4d59
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/hostmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.5.27
|
||||
PKG_VERSION:=9.5.29.7
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=ce1f7e01f0f5e7cc3a5dfeb5378d488f3e2938a0
|
||||
PKG_SOURCE_VERSION:=12c5a6ff4bb9c423d6a24dbe7127d2d2c47d3785
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -103,8 +103,8 @@ define Package/icwmp/default/install
|
||||
$(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
|
||||
|
||||
@@ -541,7 +541,6 @@ start_service() {
|
||||
"${respawn_threshold:-5}" \
|
||||
"${respawn_timeout:-10}" "${respawn_retry:-3}"
|
||||
|
||||
procd_set_param watch network.interface
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
@@ -569,6 +568,20 @@ reload_service() {
|
||||
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
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.3.4
|
||||
PKG_VERSION:=8.3.4.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=526690993c93720ee1707bba6b7a08e8c28f2dd9
|
||||
PKG_SOURCE_VERSION:=8288da08c76e9b0eabc26b45aebb696db321db31
|
||||
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
|
||||
|
||||
@@ -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))
|
||||
10
iop/config
10
iop/config
@@ -64,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
|
||||
@@ -80,6 +79,7 @@ CONFIG_PACKAGE_map-controller=y
|
||||
# Network #
|
||||
CONFIG_PACKAGE_hostmngr=y
|
||||
CONFIG_PACKAGE_netmode=y
|
||||
CONFIG_PACKAGE_testnet=y
|
||||
CONFIG_PACKAGE_urlfilter=y
|
||||
|
||||
# System #
|
||||
@@ -143,7 +143,6 @@ CONFIG_PACKAGE_wwan=y
|
||||
CONFIG_PACKAGE_xl2tpd=y
|
||||
|
||||
# Services #
|
||||
CONFIG_PACKAGE_atftp=y
|
||||
CONFIG_PACKAGE_atftpd=y
|
||||
CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_dnsmasq=y
|
||||
@@ -179,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
|
||||
@@ -248,7 +249,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 +330,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)
|
||||
@@ -415,6 +431,15 @@ function genconfig {
|
||||
fi
|
||||
done
|
||||
fi
|
||||
# Ensure strict file permissions, for when provided through the above
|
||||
if [ -f "$FILEDIR/etc/shadow" ]; then
|
||||
v "chmod 0600 $FILEDIR/etc/shadow"
|
||||
chmod 0600 "$FILEDIR/etc/shadow"
|
||||
fi
|
||||
if [ -d "$FILEDIR/etc/ssl/private" ]; then
|
||||
v "find $FILEDIR/etc/ssl/private -type d -exec chmod 0700 '{}' ';' -o -type f -exec chmod 0600 '{}' ';'"
|
||||
find "$FILEDIR/etc/ssl/private" -type d -exec chmod 0700 '{}' ';' -o -type f -exec chmod 0600 '{}' ';'
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local git_version
|
||||
|
||||
@@ -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
|
||||
@@ -389,6 +405,15 @@ function genconfig_min {
|
||||
fi
|
||||
done
|
||||
fi
|
||||
# Ensure strict file permissions, for when provided through the above
|
||||
if [ -f "$FILEDIR/etc/shadow" ]; then
|
||||
v "chmod 0600 $FILEDIR/etc/shadow"
|
||||
chmod 0600 "$FILEDIR/etc/shadow"
|
||||
fi
|
||||
if [ -d "$FILEDIR/etc/ssl/private" ]; then
|
||||
v "find $FILEDIR/etc/ssl/private -type d -exec chmod 0700 '{}' ';' -o -type f -exec chmod 0600 '{}' ';'"
|
||||
find "$FILEDIR/etc/ssl/private" -type d -exec chmod 0700 '{}' ';' -o -type f -exec chmod 0600 '{}' ';'
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local git_version
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-airoha
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.10
|
||||
PKG_VERSION:=1.0.12
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=e6ba6fca814f6c83a3d6ff4a5b7560fbc36d3101
|
||||
PKG_SOURCE_VERSION:=a9ea70b6c0adb246685f7632e38853e0d803a7c3
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
21
libvoice-airoha/files/etc/uci-defaults/99-asterisk
Executable file
21
libvoice-airoha/files/etc/uci-defaults/99-asterisk
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
hasVoice=$(db -q get hw.board.hasVoice)
|
||||
|
||||
[ "$hasVoice" = "1" ] || { rm -f "/etc/config/asterisk"; return; }
|
||||
|
||||
source /lib/voice/config_asterisk.sh
|
||||
|
||||
default_asterisk_config
|
||||
|
||||
SLIC=`cat /proc/device-tree/airoha-voice/slic-type`
|
||||
[ "${SLIC#pef}" != "${SLIC}" ] || return
|
||||
|
||||
echo Configure TxGain and RxGain for MXL SLIC $SLIC
|
||||
|
||||
ports=$(db -q get hw.board.VoicePorts)
|
||||
for p in $(seq 0 $((ports-1))); do
|
||||
uci set asterisk.extension${p}.txgain='10'
|
||||
uci set asterisk.extension${p}.rxgain='-15'
|
||||
done
|
||||
uci commit asterisk
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-broadcom
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.8
|
||||
PKG_VERSION:=1.0.9
|
||||
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:=e1de60c2c05935fb2f4adfc1f73feba0bb32ade6
|
||||
PKG_SOURCE_VERSION:=3a8d0954ca351a1f8f669dc2f3d294409b90f091
|
||||
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.16
|
||||
PKG_VERSION:=7.4.16.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=dfafd5f7ea387d6119a9eb692e435f98b16f75a3
|
||||
PKG_SOURCE_VERSION:=26f2b783f7ff9f86a18f9aedde44d2f3c8b5b529
|
||||
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
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=4.5.0.10
|
||||
PKG_VERSION:=4.5.0.15
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=a03ea6bee6856000496d858f3b4c8d161612472d
|
||||
PKG_SOURCE_VERSION:=63989509f5c92b74a36683e1d9d54a0f352c3215
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
|
||||
@@ -69,7 +69,7 @@ fi
|
||||
|
||||
remove_from_bridge() {
|
||||
config_get ifname "$section" ifname
|
||||
[ -n "$ifname" ] && ubus call network.interface.${al_brnet} remove_device '{"name":"$ifname"}'
|
||||
[ -n "$ifname" ] && brctl delif ${al_bridge} ${ifname}
|
||||
}
|
||||
|
||||
update_bstas() {
|
||||
|
||||
@@ -15,7 +15,7 @@ snooping_bridges=
|
||||
|
||||
__device_is_bridge() {
|
||||
local device="$2"
|
||||
local devsec__="$(uci show network | grep name=.*$device | grep -v ifname | cut -d'.' -f2)"
|
||||
local devsec__="$(uci show network | grep -F ".name='$device'" | 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
|
||||
@@ -302,7 +302,12 @@ config_mcproxy_instance() {
|
||||
# for snooping to work we should enable it on the bridge, doing it from
|
||||
# here instead of from inside network config
|
||||
if [ "$downstreams" != "$snooping_bridges" ]; then
|
||||
config_sysfs_mcast_snooping "$downstreams" 1
|
||||
if [ "$mcast_mode" == "0" ]; then
|
||||
config_sysfs_mcast_snooping "$downstreams" 0
|
||||
else
|
||||
config_sysfs_mcast_snooping "$downstreams" 1
|
||||
fi
|
||||
|
||||
[ -n $fast_leave ] &&
|
||||
config_sysfs_mcast_fastleave "$downstreams" "$fast_leave"
|
||||
config_sysfs_mcast_flood "$downstreams" "$mcast_mode"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=netmode
|
||||
PKG_VERSION:=0.3.0
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
config netmode global
|
||||
option enabled 0
|
||||
# option mode 'router'
|
||||
|
||||
#config testnet testnet
|
||||
# option enabled 1
|
||||
# option destination '8.8.8.8'
|
||||
|
||||
#config shiftrange shiftrange
|
||||
# option enabled 1
|
||||
|
||||
@@ -1,252 +0,0 @@
|
||||
#!/bin/sh
|
||||
# this scripts shifts the lan network prefixes
|
||||
# if a wan interface has the same network prefix.
|
||||
|
||||
# do not shift range if the feature is explicitly disabled
|
||||
[ "$(uci -q get netmode.shiftrange.enabled)" == "0" ] && exit 0
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/network.sh
|
||||
|
||||
LOCKFILE="/tmp/70-shiftrange.lock"
|
||||
RESTRICTED_NETS=""
|
||||
ALL_NETS=""
|
||||
|
||||
#####
|
||||
##### initial functions
|
||||
#####
|
||||
|
||||
initial_check()
|
||||
{
|
||||
# run only on ifup
|
||||
[ "$ACTION" == "ifup" ] || exit 0
|
||||
|
||||
# run only for uplink (not is_lan) interfaces
|
||||
local islan="$(uci -q get network.$INTERFACE.is_lan)"
|
||||
[ "$islan" != "1" ] || exit 0
|
||||
|
||||
# run only if the uplink interface has a configured protocol
|
||||
local proto="$(uci -q get network.$INTERFACE.proto)"
|
||||
[ "$proto" != "none" ] || exit 0
|
||||
}
|
||||
|
||||
finish()
|
||||
{
|
||||
lock -u $LOCKFILE
|
||||
rm -f $LOCKFILE
|
||||
}
|
||||
|
||||
# just one instance of this script at a time
|
||||
just_one_instance()
|
||||
{
|
||||
local counter=0
|
||||
local limit=10
|
||||
|
||||
#wait for the lock to become free
|
||||
while [ -e $LOCKFILE ] ; do
|
||||
sleep 1
|
||||
counter=$((counter + 1))
|
||||
[ "$counter" -gt "$limit" ] && exit 1
|
||||
done
|
||||
|
||||
lock $LOCKFILE
|
||||
trap finish EXIT INT TERM
|
||||
}
|
||||
|
||||
|
||||
#####
|
||||
##### helper functions
|
||||
#####
|
||||
|
||||
#given a an ip and a mask in the form of "192.168.1.1/24"
|
||||
#return the network address like "192.168.1.0/24"
|
||||
get_network_address()
|
||||
{
|
||||
local ip="$1"
|
||||
[ -z "$ip" ] && return
|
||||
|
||||
local prefix=${ip##*/}
|
||||
|
||||
local ip1=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip2=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip3=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip4=${ip%%/*}
|
||||
|
||||
local ip=$((($ip1 << 24) + ($ip2 << 16) + ($ip3 << 8) + $ip4))
|
||||
local mask=$((0xFFFFFFFF >> (32 - $prefix) << (32 - $prefix)))
|
||||
local network=$(($ip & $mask))
|
||||
|
||||
local n1=$((($network & 0xFF000000) >> 24))
|
||||
local n2=$((($network & 0x00FF0000) >> 16))
|
||||
local n3=$((($network & 0x0000FF00) >> 8))
|
||||
local n4=$(( $network & 0x000000FF))
|
||||
|
||||
echo "$n1.$n2.$n3.$n4/$prefix"
|
||||
}
|
||||
|
||||
#given a network address (192.168.1.0/24)
|
||||
#find the next network address (192.168.2.0/24)
|
||||
next_network_address()
|
||||
{
|
||||
local ip=$1
|
||||
local prefix=${ip##*/}
|
||||
|
||||
local ip1=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip2=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip3=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip4=${ip%%/*}
|
||||
|
||||
local ip=$((($ip1 << 24) + ($ip2 << 16) + ($ip3 << 8) + $ip4))
|
||||
local one="$((1 << (32-$prefix)))"
|
||||
local new=$(($ip + $one))
|
||||
|
||||
local n1=$((($new & 0xFF000000) >> 24))
|
||||
local n2=$((($new & 0x00FF0000) >> 16))
|
||||
local n3=$((($new & 0x0000FF00) >> 8))
|
||||
local n4=$(( $new & 0x000000FF))
|
||||
|
||||
echo "$n1.$n2.$n3.$n4/$prefix"
|
||||
}
|
||||
|
||||
# given a network address and a prefix (192.168.2.0/24)
|
||||
# return the first host ip available (192.168.2.1)
|
||||
first_host_in_network ()
|
||||
{
|
||||
local ip=$1
|
||||
local prefix=${ip##*/}
|
||||
|
||||
local ip1=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip2=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip3=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip4=${ip%%/*}
|
||||
|
||||
local ip=$((($ip1 << 24) + ($ip2 << 16) + ($ip3 << 8) + $ip4))
|
||||
local new=$(($ip + 1))
|
||||
|
||||
local n1=$((($new & 0xFF000000) >> 24))
|
||||
local n2=$((($new & 0x00FF0000) >> 16))
|
||||
local n3=$((($new & 0x0000FF00) >> 8))
|
||||
local n4=$(( $new & 0x000000FF))
|
||||
|
||||
echo "$n1.$n2.$n3.$n4"
|
||||
}
|
||||
|
||||
# given a network address,
|
||||
# find the next available network address.
|
||||
shift_range()
|
||||
{
|
||||
local net="$1"
|
||||
while true ; do
|
||||
if [ "$RESTRICTED_NETS" == "${RESTRICTED_NETS//$net/}" ] && [ "$ALL_NETS" == "${ALL_NETS//$net/}" ]; then
|
||||
# found a net that is not in restricted nets nor in all nets
|
||||
break
|
||||
fi
|
||||
net=$(next_network_address $net)
|
||||
done
|
||||
|
||||
echo "$net"
|
||||
}
|
||||
|
||||
|
||||
#####
|
||||
##### parse all interfaces section
|
||||
#####
|
||||
|
||||
# RESTRICTED_NETS = all the IPs on wan interfaces
|
||||
# ALL_NETS = all the IPs on any interface
|
||||
parse_interface()
|
||||
{
|
||||
local interface=$1
|
||||
local nets="" # "192.168.1.1/24"
|
||||
local networks="" # "192.168.1.0/24"
|
||||
|
||||
config_get is_lan $interface is_lan
|
||||
network_get_subnets nets $interface
|
||||
|
||||
for n in $nets ; do
|
||||
networks="$networks $(get_network_address $n)"
|
||||
done
|
||||
|
||||
[ "$is_lan" != "1" ] && RESTRICTED_NETS="$RESTRICTED_NETS $networks"
|
||||
ALL_NETS="$ALL_NETS $networks"
|
||||
}
|
||||
|
||||
# parse all the interfaces
|
||||
# get all the IPs on wan interfaces and store them in restrict_nets
|
||||
# get all the IPs on all interfaces and store them in ALL_NETS
|
||||
parse_interfaces()
|
||||
{
|
||||
config_foreach parse_interface "interface"
|
||||
}
|
||||
|
||||
|
||||
#####
|
||||
##### parse all lan interfaces section
|
||||
#####
|
||||
|
||||
parse_lan()
|
||||
{
|
||||
local interface=$1
|
||||
local nets=""
|
||||
local ips=""
|
||||
local newips=""
|
||||
local ips_changed=0
|
||||
|
||||
[ "$interface" == "loopback" ] && return
|
||||
config_get is_lan $interface is_lan
|
||||
[ "$is_lan" == "1" ] || return
|
||||
|
||||
network_get_subnets ips $interface
|
||||
|
||||
for ip in $ips ; do
|
||||
net="$(get_network_address $ip)"
|
||||
|
||||
if [ "$RESTRICTED_NETS" == "${RESTRICTED_NETS//$net/}" ] ; then
|
||||
# net is not in restricted nets
|
||||
# append ip to newips
|
||||
[ -z "$newips" ] && newips="${ip%/*}" || newips="$newips ${ip%/*}"
|
||||
continue
|
||||
fi
|
||||
|
||||
#net is in RESTRICTED_NETS
|
||||
local newnet=$(shift_range $net)
|
||||
local newip="$(first_host_in_network $newnet)"
|
||||
# append newip to newips
|
||||
[ -z "$newips" ] && newips="$newip" || newips="$newips $newip"
|
||||
|
||||
ips_changed=1
|
||||
logger "$0: Changing the ip on interface $interface from $ip to $newip/${newnet##*/}"
|
||||
echo "$0: Changing the ip on interface $interface from $ip to $newip/${newnet##*/}" >/dev/console
|
||||
done
|
||||
|
||||
#assign the new ips
|
||||
if [ "$ips_changed" == "1" ] ; then
|
||||
uci -q set network.$interface.ipaddr="$newips"
|
||||
fi
|
||||
}
|
||||
|
||||
# parse all the interface with is_lan=1
|
||||
parse_lans()
|
||||
{
|
||||
config_foreach parse_lan "interface"
|
||||
}
|
||||
|
||||
#####
|
||||
##### main
|
||||
#####
|
||||
|
||||
main()
|
||||
{
|
||||
initial_check
|
||||
just_one_instance
|
||||
|
||||
config_load network
|
||||
parse_interfaces
|
||||
parse_lans
|
||||
|
||||
if [ -n "$(uci changes network)" ] ; then
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
fi
|
||||
}
|
||||
|
||||
main $@
|
||||
110
netmode/files/etc/uci-defaults/netmode.l2mode
Normal file
110
netmode/files/etc/uci-defaults/netmode.l2mode
Normal file
@@ -0,0 +1,110 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
source "/etc/device_info"
|
||||
|
||||
l2_mcast_config() {
|
||||
# configure L2 mcast config for snooping
|
||||
logger -s -p user.info -t "netmode" "Generating L2 mcast configuration"
|
||||
|
||||
# remove proxy sections
|
||||
uci -q delete mcast.igmp_proxy_1
|
||||
uci -q delete mcast.mc_proxy_MLD
|
||||
|
||||
# add igmp_snooping section
|
||||
uci -q set mcast.igmp_snooping_1=snooping
|
||||
uci -q set mcast.igmp_snooping_1.enable='1'
|
||||
uci -q set mcast.igmp_snooping_1.proto='igmp'
|
||||
uci -q set mcast.igmp_snooping_1.version='2'
|
||||
uci -q set mcast.igmp_snooping_1.robustness='2'
|
||||
uci -q set mcast.igmp_snooping_1.query_interval='125'
|
||||
uci -q set mcast.igmp_snooping_1.query_response_interval='100'
|
||||
uci -q set mcast.igmp_snooping_1.last_member_query_interval='10'
|
||||
uci -q set mcast.igmp_snooping_1.fast_leave='1'
|
||||
uci -q set mcast.igmp_snooping_1.snooping_mode='2'
|
||||
uci -q set mcast.igmp_snooping_1.interface='br-lan'
|
||||
uci -q add_list mcast.igmp_snooping_1.filter='239.0.0.0/8'
|
||||
|
||||
# add mld_snooping section
|
||||
uci -q set mcast.mld_snooping_1=snooping
|
||||
uci -q set mcast.mld_snooping_1.enable='1'
|
||||
uci -q set mcast.mld_snooping_1.proto='mld'
|
||||
uci -q set mcast.mld_snooping_1.version='2'
|
||||
uci -q set mcast.mld_snooping_1.robustness='2'
|
||||
uci -q set mcast.mld_snooping_1.query_interval='125'
|
||||
uci -q set mcast.mld_snooping_1.query_response_interval='100'
|
||||
uci -q set mcast.mld_snooping_1.last_member_query_interval='10'
|
||||
uci -q set mcast.mld_snooping_1.fast_leave='1'
|
||||
uci -q set mcast.mld_snooping_1.snooping_mode='2'
|
||||
uci -q set mcast.mld_snooping_1.interface='br-lan'
|
||||
|
||||
uci -q commit mcast
|
||||
}
|
||||
|
||||
l2_network_config() {
|
||||
logger -s -p user.info -t "netmode" "Generating L2 network configuration"
|
||||
|
||||
# Configure L2 Network Mode
|
||||
uci -q delete network.lan
|
||||
uci -q delete network.wan
|
||||
uci -q delete network.wan6
|
||||
uci -q set network.lan=interface
|
||||
uci -q set network.lan.proto='dhcp'
|
||||
uci -q set network.lan.device='br-lan'
|
||||
uci -q set network.lan.force_link='1'
|
||||
uci -q set network.lan6=interface
|
||||
uci -q set network.lan6.proto='dhcpv6'
|
||||
uci -q set network.lan6.device='@lan'
|
||||
uci -q set network.lan6.reqprefix='no'
|
||||
uci -q delete network.br_lan.ports
|
||||
uci -q set network.br_lan.bridge_empty='1'
|
||||
|
||||
add_port_to_br_lan() {
|
||||
port="$1"
|
||||
[ -n "$port" -a -d /sys/class/net/$port ] || continue
|
||||
uci add_list network.br_lan.ports="$port"
|
||||
}
|
||||
|
||||
if [ -f /etc/board.json ]; then
|
||||
json_load_file /etc/board.json
|
||||
json_select network
|
||||
json_select lan
|
||||
if json_is_a ports array; then
|
||||
json_for_each_item add_port_to_br_lan ports
|
||||
else
|
||||
json_get_var device device
|
||||
[ -n "$device" ] && uci add_list network.br_lan.ports="$device"
|
||||
fi
|
||||
json_select ..
|
||||
json_select wan 2>/dev/null
|
||||
json_get_var device device
|
||||
[ -n "$device" ] && uci add_list network.br_lan.ports="$device"
|
||||
json_cleanup
|
||||
fi
|
||||
|
||||
uci -q commit network
|
||||
|
||||
# Disable DHCP Server
|
||||
uci -q set dhcp.lan.ignore=1
|
||||
uci -q commit dhcp
|
||||
/etc/init.d/odhcpd disable
|
||||
|
||||
# Disable SSDPD
|
||||
uci -q set ssdpd.ssdp.enabled="0"
|
||||
uci -q commit ssdpd
|
||||
|
||||
# Update CWMP Agent WAN Interface
|
||||
uci -q set cwmp.cpe.default_wan_interface="lan"
|
||||
uci -q commit cwmp
|
||||
}
|
||||
|
||||
network_mode="$(fw_printenv -n netmode 2>/dev/null)"
|
||||
|
||||
case "$network_mode" in
|
||||
layer2|extender)
|
||||
l2_network_config
|
||||
l2_mcast_config
|
||||
;;
|
||||
esac
|
||||
@@ -22,4 +22,12 @@ config OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
config OBUSPA_ENABLE_TEST_CONTROLLER
|
||||
bool "Adds a test controller by default"
|
||||
default n
|
||||
|
||||
config OBUSPA_MAX_CONTROLLERS_NUM
|
||||
int "The maximum number of controllers to be supported"
|
||||
range 1 10
|
||||
default 5
|
||||
help
|
||||
This value must be in range of 1 to 10. (default 5)
|
||||
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=7.0.5.5
|
||||
PKG_VERSION:=7.0.5.5.7
|
||||
|
||||
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:=2bad8d8029ccaca5d1182a20ade9a2b3bb5a6632
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -32,7 +32,7 @@ define Package/obuspa
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=USP agent
|
||||
MENU:=1
|
||||
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl
|
||||
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl +ca-certificates
|
||||
endef
|
||||
|
||||
define Package/obuspa/description
|
||||
@@ -81,10 +81,14 @@ else
|
||||
CMAKE_OPTIONS += -DENABLE_WEBSOCKETS=OFF
|
||||
endif
|
||||
|
||||
ifdef $(CONFIG_OBUSPA_MAX_CONTROLLERS_NUM)
|
||||
TARGET_CFLAGS += -DOBUSPA_MAX_CONTROLLERS_NUM=$(CONFIG_OBUSPA_MAX_CONTROLLERS_NUM)
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/obuspa/* $(PKG_BUILD_DIR)/
|
||||
$(Build/Patch)
|
||||
$(CP) -rf ~/git/obuspa/* $(PKG_BUILD_DIR)/
|
||||
$(Build/Patch)
|
||||
endef
|
||||
endif
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ config obuspa 'global'
|
||||
option db_file '/etc/obuspa/usp.db'
|
||||
option role_file '/etc/obuspa/roles.json'
|
||||
option dm_caching_exclude '/etc/obuspa/dmcaching_exclude.json'
|
||||
#option trust_cert '/etc/obuspa/rootCA.pem'
|
||||
#option trust_cert '/etc/ssl/cert.pem'
|
||||
#option client_cert '/etc/obuspa/client.pem'
|
||||
#option log_dest '/tmp/obuspa.log'
|
||||
|
||||
|
||||
@@ -92,10 +92,10 @@ get_base_path()
|
||||
count=0
|
||||
|
||||
if [ -f "${DB_DUMP}" ]; then
|
||||
path=$(grep "${refpath}\d.Alias \"${value}\"" ${DB_DUMP})
|
||||
path=$(grep -E "${refpath}\d+.Alias \"${value}\"" ${DB_DUMP})
|
||||
path=${path%.*}
|
||||
if [ -z "${path}" ]; then
|
||||
path=$(grep -o "${refpath}\d" ${DB_DUMP} |sort -r|head -n 1)
|
||||
path=$(grep -oE "${refpath}\d+" ${DB_DUMP} |sort -r|head -n 1)
|
||||
if [ -n "${path}" ]; then
|
||||
count=${path##*.}
|
||||
count=$(( count + 1 ))
|
||||
@@ -122,9 +122,9 @@ get_refrence_path()
|
||||
path=""
|
||||
|
||||
if [ -f "${DB_DUMP}" ]; then
|
||||
path=$(grep "${dmref}\d.Alias " ${DB_DUMP}|grep -w "${value}")
|
||||
path=$(grep -E "${dmref}\d+.Alias " ${DB_DUMP}|grep -w "${value}")
|
||||
elif [ -f "${RESET_FILE}" ]; then
|
||||
path=$(grep "${dmref}\d.Alias " ${RESET_FILE}|grep -w "${value}")
|
||||
path=$(grep -E "${dmref}\d+.Alias " ${RESET_FILE}|grep -w "${value}")
|
||||
fi
|
||||
path=${path%.*}
|
||||
echo "${path}"
|
||||
@@ -728,13 +728,13 @@ get_instances_from_db_dump()
|
||||
{
|
||||
local obj inst
|
||||
|
||||
obj="${1}\d"
|
||||
obj="${1}\d+"
|
||||
if [ ! -f "${DB_DUMP}" ]; then
|
||||
echo ""
|
||||
return 0;
|
||||
fi
|
||||
|
||||
inst="$(grep -oe "${obj}" "${DB_DUMP}"|uniq)"
|
||||
inst="$(grep -oE "${obj}" "${DB_DUMP}"|uniq)"
|
||||
echo "$inst"
|
||||
}
|
||||
|
||||
@@ -942,7 +942,7 @@ check_n_delete_db()
|
||||
r="${3}"
|
||||
sec="${sec/${t}_/cpe-}"
|
||||
|
||||
path=$(grep "${r}\d.Alias \"${sec}\"" ${DB_DUMP})
|
||||
path=$(grep -E "${r}\d+.Alias \"${sec}\"" ${DB_DUMP})
|
||||
path=${path%.*}
|
||||
|
||||
delete_sql_db_entry_with_pattern "${path}"
|
||||
|
||||
@@ -82,6 +82,17 @@
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.SelfTestDiagnostics()",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.FactoryReset()",
|
||||
"perm": [
|
||||
@@ -544,6 +555,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"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -553,8 +581,7 @@
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_NONE",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -567,66 +594,6 @@
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Time.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UPnP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Bridging.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Ethernet.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv4.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv6.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Hosts.",
|
||||
"perm": [
|
||||
@@ -637,37 +604,6 @@
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.NAT.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PPP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Routing.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.IEEE1905.",
|
||||
"perm": [
|
||||
@@ -678,16 +614,6 @@
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.InterfaceStack.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DynamicDNS.",
|
||||
"perm": [
|
||||
@@ -698,56 +624,6 @@
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.LANConfigSecurity.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Security.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.RouterAdvertisement.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Services.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UserInterface.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PeriodicStatistics.",
|
||||
"perm": [
|
||||
@@ -758,27 +634,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": [
|
||||
@@ -805,30 +660,16 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DNS.",
|
||||
"object": "Device.WiFi.AccessPoint.{i}.WPS.InitiateWPSPBC()",
|
||||
"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.IP.",
|
||||
"object": "Device.WiFi.DataElements.Network.SetSSID()",
|
||||
"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"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,29 +1,69 @@
|
||||
--- a/src/core/cli_server.c
|
||||
+++ b/src/core/cli_server.c
|
||||
@@ -787,6 +787,7 @@ int ExecuteCli_Set(char *arg1, char *arg
|
||||
@@ -780,6 +780,7 @@ int ExecuteCli_Set(char *arg1, char *arg
|
||||
goto exit;
|
||||
}
|
||||
|
||||
+ SetControllerRoleForInternal();
|
||||
// Iterate over all objects to set
|
||||
for (i=0; i < objects.num_entries; i++)
|
||||
{
|
||||
// Exit if unable to start a transaction
|
||||
err = DM_TRANS_Start(&trans);
|
||||
if (err != USP_ERR_OK)
|
||||
@@ -865,6 +866,7 @@ int ExecuteCli_Add(char *arg1, char *arg
|
||||
goto exit;
|
||||
}
|
||||
|
||||
+ SetControllerRoleForInternal();
|
||||
// Exit if unable to start a transaction
|
||||
err = DM_TRANS_Start(&trans);
|
||||
if (err != USP_ERR_OK)
|
||||
@@ -976,6 +978,7 @@ int ExecuteCli_Del(char *arg1, char *arg
|
||||
goto exit;
|
||||
}
|
||||
|
||||
+ SetControllerRoleForInternal();
|
||||
// Exit if unable to start a transaction
|
||||
err = DM_TRANS_Start(&trans);
|
||||
if (err != USP_ERR_OK)
|
||||
--- a/src/core/data_model.h
|
||||
+++ b/src/core/data_model.h
|
||||
@@ -325,6 +325,7 @@ void DATA_MODEL_DumpSchema(void);
|
||||
@@ -325,6 +325,8 @@ void DATA_MODEL_DumpSchema(void);
|
||||
void DATA_MODEL_DumpInstances(void);
|
||||
char DATA_MODEL_GetJSONParameterType(char *path);
|
||||
int DATA_MODEL_SetParameterInDatabase(char *path, char *value);
|
||||
+void SetControllerRoleForInternal();
|
||||
+void SetControllerDummyID();
|
||||
|
||||
int DM_PRIV_InitSetRequest(dm_req_t *req, dm_node_t *node, char *path, dm_instances_t *inst, char *new_value);
|
||||
void DM_PRIV_RequestInit(dm_req_t *req, dm_node_t *node, char *path, dm_instances_t *inst);
|
||||
--- a/src/core/dm_exec.c
|
||||
+++ b/src/core/dm_exec.c
|
||||
@@ -1207,6 +1207,7 @@ void ProcessMessageQueueSocketActivity(s
|
||||
return;
|
||||
}
|
||||
|
||||
+ SetControllerDummyID(); // To make sure session handler does not break with internal services
|
||||
switch(msg.type)
|
||||
{
|
||||
case kDmExecMsg_ProcessUspRecord:
|
||||
--- a/src/core/msg_handler.c
|
||||
+++ b/src/core/msg_handler.c
|
||||
@@ -902,6 +902,20 @@ char *MtpSendItemToString(mtp_send_item_
|
||||
@@ -902,6 +902,34 @@ char *MtpSendItemToString(mtp_send_item_
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
+** SetControllerDummyID
|
||||
+**
|
||||
+** Sets the role for internal user
|
||||
+**
|
||||
+**
|
||||
+**************************************************************************/
|
||||
+void SetControllerDummyID()
|
||||
+{
|
||||
+ cur_msg_controller_info.endpoint_id = "";
|
||||
+}
|
||||
+
|
||||
+/*********************************************************************//**
|
||||
+**
|
||||
+** SetControllerRoleForInternal
|
||||
+**
|
||||
+** Sets the role for internal user
|
||||
@@ -34,6 +74,7 @@
|
||||
+{
|
||||
+ cur_msg_combined_role.inherited = kCTrustRole_Untrusted;
|
||||
+ cur_msg_combined_role.assigned = kCTrustRole_FullAccess;
|
||||
+ SetControllerDummyID();
|
||||
+}
|
||||
+
|
||||
+/*********************************************************************//**
|
||||
|
||||
@@ -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);
|
||||
42
obuspa/patches/0011-max_controllers.patch
Normal file
42
obuspa/patches/0011-max_controllers.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
|
||||
index 04a1a9c..8cb2ad7 100644
|
||||
--- a/src/core/mqtt.c
|
||||
+++ b/src/core/mqtt.c
|
||||
@@ -234,6 +234,8 @@ void HandleMqttDisconnect(mqtt_client_t *client);
|
||||
#define DEFINE_MQTT_TrustCertVerifyCallbackIndex(index) \
|
||||
int MQTT_TrustCertVerifyCallback_##index (int preverify_ok, X509_STORE_CTX *x509_ctx) \
|
||||
{\
|
||||
+ if (index >= MAX_MQTT_CLIENTS) \
|
||||
+ return 0; \
|
||||
return DEVICE_SECURITY_TrustCertVerifyCallbackWithCertChain(preverify_ok, x509_ctx, &mqtt_clients[index].cert_chain);\
|
||||
}
|
||||
|
||||
@@ -244,6 +246,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex(1);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(2);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(3);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(4);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(5);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(6);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(7);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(8);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(9);
|
||||
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@@ -254,10 +261,15 @@ ssl_verify_callback_t* mqtt_verify_callbacks[] = {
|
||||
MQTT_TrustCertVerifyCallbackIndex(2),
|
||||
MQTT_TrustCertVerifyCallbackIndex(3),
|
||||
MQTT_TrustCertVerifyCallbackIndex(4),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(5),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(6),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(7),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(8),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(9),
|
||||
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
|
||||
};
|
||||
|
||||
-USP_COMPILEASSERT( ((sizeof(mqtt_verify_callbacks)/sizeof(ssl_verify_callback_t*)) == MAX_MQTT_CLIENTS),
|
||||
+USP_COMPILEASSERT( ((sizeof(mqtt_verify_callbacks)/sizeof(ssl_verify_callback_t*)) >= MAX_MQTT_CLIENTS),
|
||||
"There must be MAX_MQTT_CLIENTS callbacks defined");
|
||||
|
||||
/*********************************************************************//**
|
||||
@@ -15,10 +15,6 @@ include /lib/ethernet
|
||||
. /lib/qos/shaper.sh
|
||||
. /lib/qos/airoha.sh
|
||||
|
||||
get_rate_per_queue() {
|
||||
echo "0"
|
||||
}
|
||||
|
||||
get_burst_size_per_queue() {
|
||||
echo "0"
|
||||
}
|
||||
|
||||
@@ -34,10 +34,6 @@ get_port_number() {
|
||||
done
|
||||
}
|
||||
|
||||
get_rate_per_queue() {
|
||||
echo "0"
|
||||
}
|
||||
|
||||
get_burst_size_per_queue() {
|
||||
echo "0"
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ generate_queue(){
|
||||
uci set qos.@queue[-1].ifname="$ifname"
|
||||
uci set qos.@queue[-1].precedence="$order"
|
||||
uci set qos.@queue[-1].scheduling="SP"
|
||||
uci set qos.@queue[-1].rate=$(get_rate_per_queue)
|
||||
uci set qos.@queue[-1].rate="0"
|
||||
uci set qos.@queue[-1].burst_size=$(get_burst_size_per_queue)
|
||||
uci set qos.@queue[-1].weight="1"
|
||||
done
|
||||
|
||||
@@ -15,10 +15,6 @@ Q_COUNT=0
|
||||
SP_Q_PRIO=7
|
||||
SOQ_wgt=0
|
||||
|
||||
get_rate_per_queue() {
|
||||
echo "1000000"
|
||||
}
|
||||
|
||||
get_burst_size_per_queue() {
|
||||
echo "1500"
|
||||
}
|
||||
@@ -405,18 +401,20 @@ pre_configure_queue() {
|
||||
}
|
||||
|
||||
get_link_rate() {
|
||||
intf="$1"
|
||||
speed=1000
|
||||
local ifname="$1"
|
||||
local phycap="$(ethtool $ifname | grep -A 10 "Supported link modes" | grep 00 | tail -n 1 | awk '{print$NF}')"
|
||||
local speed=1000
|
||||
|
||||
if [ -d "/sys/class/net/$intf/" ]; then
|
||||
speed=$(cat /sys/class/net/$intf/speed 2>/dev/null)
|
||||
[ -z "$speed" ] & speed=1000
|
||||
fi
|
||||
|
||||
if [ $speed -le 0 ]; then
|
||||
# assuming default 1000
|
||||
speed=1000
|
||||
fi
|
||||
# Get the max capability of this port
|
||||
case "$phycap" in
|
||||
10000*) speed=10000 ;;
|
||||
5000*) speed=5000 ;;
|
||||
2500*) speed=2500 ;;
|
||||
1000*) speed=1000 ;;
|
||||
100*) speed=100 ;;
|
||||
10*) speed=10 ;;
|
||||
*) speed=1000 ;;
|
||||
esac
|
||||
|
||||
echo "$speed"
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-base
|
||||
PKG_VERSION:=3.1.42
|
||||
PKG_VERSION:=3.1.53
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
|
||||
PKG_SOURCE_VERSION:=6a0cc2795607895bbe8c8e3598e3f5f435af3499
|
||||
PKG_SOURCE_VERSION:=0108f9c192a168936ee223dbf4d85a7ceba7093d
|
||||
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.53
|
||||
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:=5d0336f678a116cdf4c73fec7c0d8ab06c0f65d6
|
||||
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
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=sulu-lcm
|
||||
PKG_VERSION:=3.1.27
|
||||
PKG_VERSION:=3.1.52
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-lcm.git
|
||||
PKG_SOURCE_VERSION:=6b1d30d7918adeb19c5177dd7c5472cb0dac9896
|
||||
PKG_SOURCE_VERSION:=af612edb4ea186d9c71fc2157883bf686b14e376
|
||||
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.42
|
||||
PKG_VERSION:=3.1.52
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-multi-ap.git
|
||||
PKG_SOURCE_VERSION:=e209cbc04a92494b96c74cee443e1b385c6687fe
|
||||
PKG_SOURCE_VERSION:=ac4a73768844796be5678559b64269e6fe073192
|
||||
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.38
|
||||
PKG_VERSION:=3.1.52
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-parental-control.git
|
||||
PKG_SOURCE_VERSION:=dd9dab9fb8aca87991cd2cc02c5fedd8baee3b97
|
||||
PKG_SOURCE_VERSION:=e1c5b4473fba9d42ef7d1e95e634416585bf5887
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include ../sulu-builder/sulu.mk
|
||||
|
||||
27
testnet/Makefile
Normal file
27
testnet/Makefile
Normal file
@@ -0,0 +1,27 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=testnet
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/testnet
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Check WAN IP Connection
|
||||
DEPENDS:=+ndisc6
|
||||
endef
|
||||
|
||||
define Package/testnet/description
|
||||
Check WAN IP connection
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/testnet/install
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,testnet))
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# do not start testnet if the feature is explicitly disabled
|
||||
[ "$(uci -q get netmode.testnet.enabled)" = "0" ] && exit 0
|
||||
[ "$(uci -q get testnet.global.enabled)" = "0" ] && exit 0
|
||||
|
||||
[ "$ACTION" == "ifup" -o "$ACTION" == "ifdown" ] || exit 0
|
||||
|
||||
@@ -14,8 +14,4 @@ interface_check() {
|
||||
}
|
||||
|
||||
interface_check
|
||||
if [ -n "$(pgrep -f testnet)" ]; then
|
||||
testnet once
|
||||
else
|
||||
testnet &
|
||||
fi
|
||||
/etc/init.d/testnet reload
|
||||
23
testnet/files/etc/init.d/testnet
Executable file
23
testnet/files/etc/init.d/testnet
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=21
|
||||
STOP=10
|
||||
USE_PROCD=1
|
||||
|
||||
TESTNET=$(which testnet)
|
||||
|
||||
start_service() {
|
||||
# do not start testnet if the feature is explicitly disabled
|
||||
[ "$(uci -q get testnet.global.enabled)" = "0" ] && return 0
|
||||
|
||||
[ -n "$TESTNET" ] && {
|
||||
procd_open_instance
|
||||
procd_set_param command "$TESTNET"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
[ -n "$TESTNET" ] && procd_running testnet && "$TESTNET" once
|
||||
}
|
||||
@@ -14,14 +14,17 @@ test_connection() {
|
||||
local defroute="$(ip r | grep default | awk '{print$3}' | head -1)"
|
||||
local def6route="$(ip -f inet6 r | grep default | awk '{print$3}')"
|
||||
local ping6dev="$(ip -f inet6 r | grep default | awk '{print$5}')"
|
||||
local resolvfile="$(uci -q get dhcp.@dnsmasq[0].resolvfile)"
|
||||
|
||||
if [ -n "$addr" ]; then
|
||||
ping -q -w 5 -c 1 $addr >/dev/null 2>&1 && return 0
|
||||
elif [ -n "$defroute" ]; then
|
||||
ping -q -w 5 -c 1 $defroute >/dev/null 2>&1 && return 0
|
||||
for nmsrv in $(grep nameserver /var/resolv.conf.auto | awk '{print$2}'); do
|
||||
ping -q -w 5 -c 1 $nmsrv >/dev/null 2>&1 && return 0
|
||||
done
|
||||
if [ -e "$resolvfile" ]; then
|
||||
for nmsrv in $(grep nameserver "$resolvfile" | awk '{print$2}'); do
|
||||
ping -q -w 5 -c 1 $nmsrv >/dev/null 2>&1 && return 0
|
||||
done
|
||||
fi
|
||||
elif [ -n "$def6route" -a -n "$ping6dev" ]; then
|
||||
ndisc6 -w 5 -1 $def6route $ping6dev >/dev/null 2>&1 && return 0
|
||||
fi
|
||||
@@ -32,9 +35,9 @@ internet_test() {
|
||||
local link dest
|
||||
|
||||
# use the destination address given in config for connectivity check
|
||||
dest="$(uci -q get netmode.testnet.destination)"
|
||||
dest="$(uci -q get testnet.global.destination)"
|
||||
# for backwards compatibility
|
||||
[ -n "$dest" ] || dest="$(uci -q get diagnostics.@connectivity[0].destination)"
|
||||
[ -n "$dest" ] || dest="$(uci -q get system.@system[0].netping_addr)"
|
||||
|
||||
test_connection $dest
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
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
|
||||
default y
|
||||
|
||||
config TR104_VENDOR_EXTENSIONS
|
||||
bool "Use TR104 vendor extensions"
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tr104
|
||||
PKG_VERSION:=1.0.12
|
||||
PKG_VERSION:=1.0.13.3
|
||||
|
||||
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:=38ef8533501af818638339acce21fc1fdfc95ee2
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -32,7 +32,7 @@ define Package/$(PKG_NAME)
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=TR104 Datamodel Daemon
|
||||
MENU:=1
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +asterisk
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +asterisk +libcurl +PACKAGE_libbbfdm-api:libbbfdm-api
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
@@ -54,7 +54,7 @@ CMAKE_OPTIONS += \
|
||||
-DTR104_EXTENSION_DIR:String="iowrt"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_RUNAS_BBFDM_MICROSERVICE),y)
|
||||
ifeq ($(CONFIG_TR104_RUNAS_BBFDM_MICROSERVICE),y)
|
||||
MAKE_PATH:=libdm
|
||||
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/libbbfdm-api
|
||||
CMAKE_OPTIONS += -DRUNAS_BBFDM_MICROSERVICE:BOOL=ON
|
||||
@@ -76,7 +76,7 @@ define Package/$(PKG_NAME)/install
|
||||
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)
|
||||
ifeq ($(CONFIG_TR104_RUNAS_BBFDM_MICROSERVICE),y)
|
||||
$(INSTALL_BIN) ./files/etc/init.d/tr104d.bbfdm $(1)/etc/init.d/tr104d
|
||||
else
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=usp-js
|
||||
PKG_VERSION:=1.2.3
|
||||
PKG_VERSION:=1.2.4
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/usp-js.git
|
||||
PKG_SOURCE_VERSION:=61cf7adb3258820f12f5dc02c69c5bdd612ed4cd
|
||||
PKG_SOURCE_VERSION:=fa4586a0fc5fe13bc83165c8401e63d84db89e72
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=voicemngr
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.1.2
|
||||
PKG_VERSION:=1.1.7
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -19,7 +19,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:=25571796f18c91a2070f98881bd1205f15575fea
|
||||
PKG_SOURCE_VERSION:=e1322af26aeca67ddbf75965fcc1c054dd0d9b6a
|
||||
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.1.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=48082bc03ef03e0c3a9e843523482b017e8676e1
|
||||
PKG_SOURCE_VERSION:=9aa7217a67feefec40692377ca3c3156b29480b8
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user