mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-24 11:05:02 +08:00
Compare commits
171 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5c6a370e7 | ||
|
|
ecdc12eb98 | ||
|
|
12dff011cc | ||
|
|
5572cc2ede | ||
|
|
91f5827a4f | ||
|
|
aec92583ea | ||
|
|
63f4adcc97 | ||
|
|
82df16a8c4 | ||
|
|
237f30c3f7 | ||
|
|
2dac7741d4 | ||
|
|
0cff7d0e94 | ||
|
|
5e5abdfd21 | ||
|
|
0a755e5ea5 | ||
|
|
792e3ad20d | ||
|
|
336c5047c6 | ||
|
|
9c999de243 | ||
|
|
9a71a0bc84 | ||
|
|
7fb76b6dcd | ||
|
|
4f924bec0e | ||
|
|
ea4301bf28 | ||
|
|
99fcfcfa7e | ||
|
|
81218bc62d | ||
|
|
a71a0d4036 | ||
|
|
db578ec144 | ||
|
|
9410758de0 | ||
|
|
7b05468390 | ||
|
|
6d43b68d0b | ||
|
|
ae1fb54a3c | ||
|
|
313462e3ab | ||
|
|
be56713329 | ||
|
|
caae6916ae | ||
|
|
4e1db4f14f | ||
|
|
d2298b6097 | ||
|
|
8b1ef3cd74 | ||
|
|
05da8b4210 | ||
|
|
33cd29a47d | ||
|
|
f35b198c05 | ||
|
|
2bba5ad425 | ||
|
|
cbcb5278db | ||
|
|
be032908b0 | ||
|
|
e4d7967cd5 | ||
|
|
2fd0e37395 | ||
|
|
155ed6e0e1 | ||
|
|
4f70901a8c | ||
|
|
faf81a70fd | ||
|
|
680f324a34 | ||
|
|
718c2bdd81 | ||
|
|
d5ef59f028 | ||
|
|
881b8edaa9 | ||
|
|
2b5c30f203 | ||
|
|
1e5ff3a2fd | ||
|
|
7604786437 | ||
|
|
be752464bc | ||
|
|
fe47e30520 | ||
|
|
1623fb6559 | ||
|
|
002dceac35 | ||
|
|
b0b2874fdf | ||
|
|
378ef51ea8 | ||
|
|
241fd05d5c | ||
|
|
3267082ac3 | ||
|
|
fbc67e547c | ||
|
|
57b0cde173 | ||
|
|
222116d122 | ||
|
|
4e51f87eb0 | ||
|
|
a0fa00fd93 | ||
|
|
60989716fb | ||
|
|
a50f99634e | ||
|
|
822a6ff7a1 | ||
|
|
110da023b1 | ||
|
|
03fcf31e97 | ||
|
|
96e990ad3e | ||
|
|
6709beee6c | ||
|
|
644856890b | ||
|
|
208ebe92a8 | ||
|
|
752648d604 | ||
|
|
8f5e73321f | ||
|
|
5c83a98cb3 | ||
|
|
8711c64ff6 | ||
|
|
b6477e8b84 | ||
|
|
6f24ad440c | ||
|
|
640d24ea66 | ||
|
|
60b06dd739 | ||
|
|
501966b150 | ||
|
|
32e6e38103 | ||
|
|
adce72980b | ||
|
|
695351633d | ||
|
|
a2b4aedce5 | ||
|
|
37dd1361b0 | ||
|
|
68042169ff | ||
|
|
f110bdbe68 | ||
|
|
923e714017 | ||
|
|
81dd8f8afa | ||
|
|
73d855e682 | ||
|
|
a5606ed518 | ||
|
|
ca2a495790 | ||
|
|
695b7374bc | ||
|
|
f9df86feec | ||
|
|
8686249557 | ||
|
|
a8d529f9ea | ||
|
|
4715de6308 | ||
|
|
b41ec4ff65 | ||
|
|
b3de88d2c4 | ||
|
|
063314c91d | ||
|
|
e72b600326 | ||
|
|
594b13f5f9 | ||
|
|
fdb1dbbba0 | ||
|
|
d89055f64b | ||
|
|
13ffeac51b | ||
|
|
d94c6e9995 | ||
|
|
639694c0fb | ||
|
|
6f629b7393 | ||
|
|
d4af4ca030 | ||
|
|
237cead03b | ||
|
|
d440af07b1 | ||
|
|
a09346bfc0 | ||
|
|
c9f90a6cf5 | ||
|
|
e0d07b5205 | ||
|
|
1c035c5523 | ||
|
|
38e49fc09f | ||
|
|
1ff2a366fa | ||
|
|
263b785fcb | ||
|
|
c1475dd5f1 | ||
|
|
3411ece8a8 | ||
|
|
5912c00a4b | ||
|
|
e39acfeeae | ||
|
|
b0ddc52e97 | ||
|
|
b7ea6fdfcf | ||
|
|
28fdf33411 | ||
|
|
96b753c367 | ||
|
|
e34ed69b9b | ||
|
|
d75d44795c | ||
|
|
97ce9d60e0 | ||
|
|
391dbe06cc | ||
|
|
81ae6221ac | ||
|
|
a96302230c | ||
|
|
a5b5b160e2 | ||
|
|
21d327d4fe | ||
|
|
2241f360b4 | ||
|
|
3d951f5453 | ||
|
|
9db96d7296 | ||
|
|
7a8b81f261 | ||
|
|
edd2f92dae | ||
|
|
f9fbb07f0a | ||
|
|
29418e36d8 | ||
|
|
2420391455 | ||
|
|
5221858e30 | ||
|
|
1a40a6e747 | ||
|
|
85715416a5 | ||
|
|
2133c53a5c | ||
|
|
f2a5d2987d | ||
|
|
cef675a672 | ||
|
|
78cf48518c | ||
|
|
10d36df0b6 | ||
|
|
b2e5e5ee8d | ||
|
|
14cb91a952 | ||
|
|
aba3bcbe99 | ||
|
|
95691b3de6 | ||
|
|
c6abc34868 | ||
|
|
e9e50f7402 | ||
|
|
ec66d57a7a | ||
|
|
8eb1f7b729 | ||
|
|
4d1fe3c052 | ||
|
|
93a42e1cb9 | ||
|
|
93cffa2d20 | ||
|
|
14a32ff704 | ||
|
|
1d1318dad2 | ||
|
|
cacf1e9610 | ||
|
|
cd80edc69d | ||
|
|
778bd98197 | ||
|
|
2c0e2a559f | ||
|
|
f76e8eb150 |
@@ -18,14 +18,6 @@ config BBF_TR471
|
||||
bool "Enable TR-471 Data Model Support"
|
||||
default y
|
||||
|
||||
config BBFDM_ENABLE_JSON_PLUGIN
|
||||
bool "Enable json plugin to extend datamodel"
|
||||
default y
|
||||
|
||||
config BBFDM_ENABLE_DOTSO_PLUGIN
|
||||
bool "Enable shared library plugin to extend datamodel"
|
||||
default y
|
||||
|
||||
config BBF_MAX_OBJECT_INSTANCES
|
||||
int "Maximum number of instances per object"
|
||||
default 255
|
||||
|
||||
@@ -5,13 +5,16 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.3.30
|
||||
PKG_VERSION:=1.4.9
|
||||
|
||||
USE_LOCAL:=0
|
||||
ifneq ($(USE_LOCAL),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=60171c88176bd0e8d8cb67ddea3cb4f40b834f17
|
||||
PKG_SOURCE_VERSION:=ea08860a345ed77ac2a139812dff98e0ac90bb09
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
@@ -102,10 +105,9 @@ define Package/libbbfdm/description
|
||||
Library contains the data model tree. It includes TR181, TR143 data models
|
||||
endef
|
||||
|
||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||
ifneq ($(USE_LOCAL),)
|
||||
ifeq ($(USE_LOCAL),1)
|
||||
define Build/Prepare
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
$(CP) ~/git/bbfdm/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
@@ -130,20 +132,11 @@ CMAKE_OPTIONS += \
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_VENDOR_LIST:String="$(CONFIG_BBF_VENDOR_LIST)" \
|
||||
-DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)" \
|
||||
-DDAEMON_JSON_INPUT:String="/etc/bbfdm/input.json" \
|
||||
-DBBF_MAX_OBJECT_INSTANCES:Integer=$(CONFIG_BBF_MAX_OBJECT_INSTANCES)
|
||||
|
||||
endif ##CONFIG_BBF_VENDOR_EXTENSION
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_ENABLE_JSON_PLUGIN),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_JSON_PLUGIN=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_ENABLE_DOTSO_PLUGIN),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_DOTSO_PLUGIN=ON
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),default)
|
||||
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
|
||||
endif
|
||||
@@ -174,21 +167,21 @@ define Package/libbbfdm/default/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm/libbbfdm.so $(1)/lib/
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/bbf $(1)/lib/upgrade/keep.d/bbf
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/95-portmap-firewall $(1)/etc/uci-defaults/95-portmap-firewall
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/97-firewall-service $(1)/etc/uci-defaults/97-firewall-service
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/99-link-core-plugins $(1)/etc/uci-defaults/99-link-core-plugins
|
||||
$(INSTALL_BIN) ./files/etc/firewall.portmap $(1)/etc/firewall.portmap
|
||||
$(INSTALL_BIN) ./files/etc/firewall.service $(1)/etc/firewall.service
|
||||
ifeq ($(CONFIG_BBF_TR143),y)
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libbbfdm/scripts/* $(1)/usr/share/bbfdm
|
||||
$(LN) /usr/share/bbfdm/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
|
||||
endif
|
||||
ifeq ($(CONFIG_BBFDM_ENABLE_JSON_PLUGIN),y)
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
endif
|
||||
ifeq ($(CONFIG_BBFDM_ENABLE_DOTSO_PLUGIN),y)
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/default/prerm
|
||||
@@ -203,12 +196,12 @@ define Package/bbfdmd/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bbfdmd $(1)/etc/init.d/bbfdmd
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
|
||||
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbfdmd/ubus/bbfdmd $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/json/input.json $(1)/etc/bbfdm/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bbfdmd $(1)/etc/init.d/bbfdmd
|
||||
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
|
||||
$(INSTALL_BIN) ./files/etc/bbfdm/bbfdm_services.sh $(1)/etc/bbfdm/
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
|
||||
endef
|
||||
|
||||
define Package/userinterface/install
|
||||
@@ -221,9 +214,7 @@ define Package/userinterface/install
|
||||
$(INSTALL_BIN) ./files/etc/init.d/userinterface $(1)/etc/init.d/userinterface
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/93-userinterface-firewall $(1)/etc/uci-defaults/93-userinterface-firewall
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/94-userinterface-json $(1)/etc/uci-defaults/94-userinterface-json
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/95-portmap-firewall $(1)/etc/uci-defaults/95-portmap-firewall
|
||||
$(INSTALL_BIN) ./files/etc/firewall.userinterface $(1)/etc/firewall.userinterface
|
||||
$(INSTALL_BIN) ./files/etc/firewall.portmap $(1)/etc/firewall.portmap
|
||||
endef
|
||||
|
||||
Package/libbbfdm/prerm = $(Package/libbbfdm/default/prerm)
|
||||
|
||||
9
bbfdm/bbfdm.mk
Normal file
9
bbfdm/bbfdm.mk
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# Copyright (C) 2023 IOPSYS
|
||||
#
|
||||
|
||||
|
||||
define BbfdmInstallPlugin
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/plugins
|
||||
$(INSTALL_DATA) $(2) $(1)/etc/bbfdm/plugins/
|
||||
endef
|
||||
@@ -13,5 +13,5 @@ bbfdm_add_service()
|
||||
return 0;
|
||||
fi
|
||||
|
||||
ubus call service add "{'name':'bbfdm.services','instances':{'$name':{'command':['$BBFDMD','-m','$path'], 'respawn': [0]}}}"
|
||||
ubus call service add "{'name':'bbfdm.services','instances':{'$name':{'command':['$BBFDMD','-m','$path']}}}"
|
||||
}
|
||||
|
||||
163
bbfdm/files/etc/firewall.service
Executable file
163
bbfdm/files/etc/firewall.service
Executable file
@@ -0,0 +1,163 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t firewall.service -p info
|
||||
}
|
||||
|
||||
exec_cmd() {
|
||||
if ! eval "$*"; then
|
||||
log "Failed to run [$*]"
|
||||
echo "-1"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "0"
|
||||
return 0
|
||||
}
|
||||
|
||||
add_iptable_rule() {
|
||||
chain_name=$1
|
||||
protocol=$2
|
||||
dest_port=$3
|
||||
icmp_type=$4
|
||||
family=$5
|
||||
src_prefix=$6
|
||||
action=$7
|
||||
res=-1
|
||||
|
||||
cmd="-I ${chain_name}"
|
||||
|
||||
if [ -n "${protocol}" ]; then
|
||||
cmd="${cmd} -p $protocol"
|
||||
|
||||
if [ "${protocol}" -eq 41 ] || [ "${protocol}" -eq 43 ] || [ "${protocol}" -eq 44 ] ||
|
||||
[ "${protocol}" -eq 58 ] || [ "${protocol}" -eq 59 ] || [ "${protocol}" -eq 60 ]; then
|
||||
# Explicit v6 protocols
|
||||
if [ "${family}" = "ipv4" ]; then
|
||||
echo $res
|
||||
return 0
|
||||
else
|
||||
family="ipv6"
|
||||
fi
|
||||
elif [ "${protocol}" -eq 1 ]; then
|
||||
# Explicit v4 protocols
|
||||
if [ "${family}" = "ipv6" ]; then
|
||||
echo $res
|
||||
return 0
|
||||
else
|
||||
family="ipv4"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Limitation:: iptables do not accept dport without specific protocol
|
||||
count=$(echo "${dest_port}" | sed -n "/-1/p" | wc -l)
|
||||
|
||||
if [ "${count}" -eq 0 ]; then
|
||||
# dest_port not contains -1 so need to have this match criteria
|
||||
count=$(echo "${dest_port}" | wc -w)
|
||||
if [ "${count}" -gt 1 ]; then
|
||||
# multiple ports present
|
||||
port=$(echo "${dest_port}" | sed "s/ /,/g")
|
||||
cmd="${cmd} -m multiport --dports ${port}"
|
||||
else
|
||||
cmd="${cmd} --dport ${dest_port}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${family}" = "ipv4" ] || [ "${family}" = "-1" ]; then
|
||||
if [ "${protocol}" -eq 1 ] && [ "${icmp_type}" -ge 0 ]; then
|
||||
cmd="${cmd} --icmp-type ${icmp_type}"
|
||||
fi
|
||||
|
||||
if [ -z "${src_prefix}" ]; then
|
||||
res=$(exec_cmd "iptables ${cmd} -m comment --comment IPtables_service_rule -j ${action}")
|
||||
else
|
||||
#Add ipv4 sources if any
|
||||
src_list=""
|
||||
for src in $src_prefix; do
|
||||
ret=$(echo $src | grep ":" | wc -l)
|
||||
if [ "${ret}" -eq 0 ]; then
|
||||
src_list="$src,$src_list"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$src_list" ]; then
|
||||
src_list=$(echo "${src_list}" | sed "s/,$//")
|
||||
res=$(exec_cmd "iptables -s $src_list ${cmd} -m comment --comment IPtables_service_rule -j ${action}")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${family}" = "ipv6" ] || [ "${family}" = "-1" ]; then
|
||||
if [ "${protocol}" -eq 58 ] && [ "${icmp_type}" -ge 0 ]; then
|
||||
cmd="${cmd} --icmpv6-type ${icmp_type}"
|
||||
fi
|
||||
|
||||
if [ -z "${src_prefix}" ]; then
|
||||
res=$(exec_cmd "ip6tables ${cmd} -m comment --comment IP6tables_service_rule -j ${action}")
|
||||
else
|
||||
#Add ipv6 sources if any
|
||||
src_list=""
|
||||
for src in $src_prefix; do
|
||||
ret=$(echo $src | grep ":" | wc -l)
|
||||
if [ "${ret}" -eq 1 ]; then
|
||||
src_list="$src,$src_list"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$src_list" ]; then
|
||||
src_list=$(echo "${src_list}" | sed "s/,$//")
|
||||
res=$(exec_cmd "ip6tables -s $src_list ${cmd} -m comment --comment IP6tables_service_rule -j ${action}")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo $res
|
||||
}
|
||||
|
||||
add_service() {
|
||||
local enable proto family dest_port interface target icmp_type
|
||||
|
||||
config_get enable "$1" enable "0"
|
||||
config_get icmp_type "$1" icmp_type "-1"
|
||||
config_get target "$1" target "Accept"
|
||||
config_get interface "$1" interface ""
|
||||
config_get family "$1" family "-1"
|
||||
config_get dest_port "$1" dest_port "-1"
|
||||
config_get proto "$1" proto "-1"
|
||||
config_get src_prefix "$1" src_prefix ""
|
||||
|
||||
if [ "${enable}" -eq 0 ] || [ -z "${interface}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
action=$(echo "${target}" | tr a-z A-Z)
|
||||
chain_name="zone_${interface}_input"
|
||||
res=0
|
||||
|
||||
count=$(echo "${proto}" | sed -n "/-1/p" | wc -l)
|
||||
|
||||
if [ "${count}" -eq 0 ]; then
|
||||
# proto not contains -1 so need to have this match criteria
|
||||
for protocol in $proto; do
|
||||
res=$(add_iptable_rule "$chain_name" "$protocol" "$dest_port" "$icmp_type" "$family" "$src_prefix" "$action")
|
||||
done
|
||||
else
|
||||
# proto contains -1 so no need to have this match criteria
|
||||
res=$(add_iptable_rule "$chain_name" "" "$dest_port" "$icmp_type" "$family" "$src_prefix" "$action")
|
||||
fi
|
||||
|
||||
if [ "${res}" -ne 0 ]; then
|
||||
uci -q set firewall."${1}".status="Error"
|
||||
else
|
||||
uci -q set firewall."${1}".status=""
|
||||
fi
|
||||
|
||||
uci commit firewall
|
||||
}
|
||||
|
||||
config_load firewall
|
||||
config_foreach add_service "service"
|
||||
12
bbfdm/files/etc/uci-defaults/97-firewall-service
Normal file
12
bbfdm/files/etc/uci-defaults/97-firewall-service
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOT
|
||||
delete firewall.service_hook
|
||||
set firewall.service_hook=include
|
||||
set firewall.service_hook.path=/etc/firewall.service
|
||||
set firewall.service_hook.reload=1
|
||||
commit firewall
|
||||
EOT
|
||||
|
||||
exit 0
|
||||
|
||||
18
bbfdm/files/etc/uci-defaults/99-link-core-plugins
Normal file
18
bbfdm/files/etc/uci-defaults/99-link-core-plugins
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
UNIFIED_PATH="/etc/bbfdm/plugins/"
|
||||
|
||||
# Link JSON plugins
|
||||
for f in `ls -1 /etc/bbfdm/json/*.json`; do
|
||||
echo "# BBFDM JSON plugin ${f} not aligned #"
|
||||
ln -s ${f} "${UNIFIED_PATH}"
|
||||
done
|
||||
|
||||
# Link DotSo plugins
|
||||
for f in `ls -1 /usr/lib/bbfdm/*.so`; do
|
||||
echo "# BBFDM DotSO plugin ${f} not aligned #"
|
||||
ln -s ${f} "${UNIFIED_PATH}"
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=decollector
|
||||
PKG_VERSION:=4.1.0.4
|
||||
PKG_VERSION:=4.2.0.8
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=566f0b7d148c0ece72f311c4f4b6b5f8e11d6f97
|
||||
PKG_SOURCE_VERSION:=3d24f88de24150299eb5e4524f1d9987fb5b7f14
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -7,7 +7,7 @@ USE_PROCD=1
|
||||
PROG=/usr/sbin/decollector
|
||||
|
||||
service_running() {
|
||||
ubus -t 2 wait_for ieee1905 ieee1905.map topology
|
||||
ubus -t 2 wait_for ieee1905 ieee1905.map
|
||||
}
|
||||
|
||||
start_service() {
|
||||
|
||||
@@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.5.14
|
||||
PKG_VERSION:=3.6.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4f16755f8ac09d373234565f050832c049bdf543
|
||||
PKG_SOURCE_VERSION:=0ec179798236cc435819f80b16c13661a5f00fb5
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostmngr
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_VERSION:=1.0.10
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=bfb9098121d665a324c86a2a9ee0971871d6c22e
|
||||
PKG_SOURCE_VERSION:=208a904170d270404215ee6707204cc84c31de5c
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/hostmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -63,6 +63,7 @@ define Package/hostmngr/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/hostmngr $(1)/usr/sbin/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/bbf_plugin/libhostmngr.so $(1)/etc/hostmngr/
|
||||
$(INSTALL_DATA) ./files/etc/hostmngr/input.json $(1)/etc/hostmngr/
|
||||
$(INSTALL_DATA) ./files/lib/hosts/hosts_acl.sh $(1)/lib/hosts/
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
|
||||
@@ -1,114 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
day=""
|
||||
IP_RULE=""
|
||||
|
||||
process_ac_schedule() {
|
||||
local acs_id="$1"
|
||||
local is_enabled
|
||||
local access_control
|
||||
local start_time=""
|
||||
local stop_time=""
|
||||
local mac=""
|
||||
|
||||
handle_day_list() {
|
||||
local value=$1
|
||||
|
||||
val=$(echo $value | cut -c 1-3)
|
||||
if [ -z $day ]; then
|
||||
day="$val"
|
||||
else
|
||||
day="$day,$val"
|
||||
fi
|
||||
}
|
||||
|
||||
config_list_foreach "$acs_id" "day" handle_day_list
|
||||
config_get is_enabled "$acs_id" "enable" 1
|
||||
config_get access_control "$acs_id" "dm_parent"
|
||||
|
||||
if [ "$is_enabled" == "0" ] || [ -z "$access_control" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
IP_RULE=""
|
||||
|
||||
mac=$(uci -q get hosts.$access_control.macaddr)
|
||||
access_policy=$(uci -q get hosts.$access_control.access_policy)
|
||||
|
||||
config_get start_time "$acs_id" "start_time"
|
||||
config_get duration "$acs_id" "duration"
|
||||
|
||||
if [ -z "$mac" ] && [ -z "$start_time" ] && [ -z "$duration" ] && [ -z "$day" ] && [ -z "$access_policy" ]; then
|
||||
return
|
||||
fi
|
||||
if [ -n "$mac" ]; then
|
||||
IP_RULE="$IP_RULE -m mac --mac-source $mac"
|
||||
fi
|
||||
|
||||
# as per iptables manual default starttime is 00:00
|
||||
# default stoptime is 23:59
|
||||
if [ -z "$start_time" ]; then
|
||||
start_time="0:0"
|
||||
fi
|
||||
|
||||
if [ -n "$duration" ]; then
|
||||
hh=$(echo $start_time | awk -F: '{ print $1 }')
|
||||
mm=$(echo $start_time | awk -F: '{ print $2 }')
|
||||
hh_s=`expr $hh \* 3600`
|
||||
mm_s=`expr $mm \* 60`
|
||||
ss=$(( hh_s + mm_s ))
|
||||
|
||||
stop_ss=$(( ss + duration ))
|
||||
hh=$(( stop_ss / 3600 ))
|
||||
if [ $hh -lt 24 ]; then
|
||||
rem_ss=$(( stop_ss % 3600 ))
|
||||
mm=$(( rem_ss / 60 ))
|
||||
ss=$(( rem_ss % 60 ))
|
||||
stop_time="$hh:$mm:$ss"
|
||||
else
|
||||
stop_time="23:59"
|
||||
fi
|
||||
else
|
||||
stop_time="23:59"
|
||||
fi
|
||||
|
||||
# conversion to utc
|
||||
zone=$(date +%z | cut -c 1)
|
||||
utc_h=$(date -u -d @$(date "+%s" -d "$start_time") +%H)
|
||||
local_h=$(echo $start_time | awk -F: '{ print $1 }')
|
||||
if [ "$zone" == "+" ] && [ $utc_h -gt $local_h ]; then
|
||||
start_utc="0:0"
|
||||
else
|
||||
start_utc=$(date -u -d @$(date "+%s" -d "$start_time") +%H:%M)
|
||||
fi
|
||||
|
||||
utc_h=$(date -u -d @$(date "+%s" -d "$stop_time") +%H)
|
||||
local_h=$(echo $stop_time | awk -F: '{ print $1 }')
|
||||
if [ "$zone" == "-" ] && [ $utc_h -lt $local_h ]; then
|
||||
stop_utc="23:59"
|
||||
else
|
||||
stop_utc=$(date -u -d @$(date "+%s" -d "$stop_time") +%H:%M)
|
||||
fi
|
||||
|
||||
|
||||
IP_RULE="$IP_RULE -m time --timestart $start_utc --timestop $stop_utc"
|
||||
if [ -n "$day" ]; then
|
||||
IP_RULE="$IP_RULE --weekdays $day"
|
||||
fi
|
||||
|
||||
if [ "$access_policy" == "Deny" ]; then
|
||||
IP_RULE="$IP_RULE -j DROP"
|
||||
else
|
||||
IP_RULE="$IP_RULE -j ACCEPT"
|
||||
fi
|
||||
|
||||
iptables -w -A hosts_forward ${IP_RULE}
|
||||
ip6tables -w -A hosts_forward ${IP_RULE}
|
||||
|
||||
day=""
|
||||
}
|
||||
. /lib/hosts/hosts_acl.sh
|
||||
|
||||
iptables -w -F hosts_forward
|
||||
ip6tables -w -F hosts_forward
|
||||
|
||||
@@ -4,6 +4,7 @@ START=97
|
||||
STOP=20
|
||||
|
||||
. /etc/bbfdm/bbfdm_services.sh
|
||||
. /lib/hosts/hosts_acl.sh
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
@@ -19,6 +20,7 @@ start_service() {
|
||||
procd_close_instance
|
||||
|
||||
bbfdm_add_service "bbfdm.hosts" "${HOSTS_JSON_INPUT}"
|
||||
hosts_acl
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
|
||||
235
hostmngr/files/lib/hosts/hosts_acl.sh
Normal file
235
hostmngr/files/lib/hosts/hosts_acl.sh
Normal file
@@ -0,0 +1,235 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
day=""
|
||||
next_days=""
|
||||
prev_days=""
|
||||
IP_RULE=""
|
||||
IP_RULE1=""
|
||||
|
||||
get_next_day() {
|
||||
local weekday="$1"
|
||||
case "$weekday" in
|
||||
"Mon"|"Monday") echo "Tuesday"
|
||||
;;
|
||||
"Tue"|"Tuesday") echo "Wednesday"
|
||||
;;
|
||||
"Wed"|"Wednesday") echo "Thursday"
|
||||
;;
|
||||
"Thu"|"Thursday") echo "Friday"
|
||||
;;
|
||||
"Fri"|"Friday") echo "Saturday"
|
||||
;;
|
||||
"Sat"|"Saturday") echo "Sunday"
|
||||
;;
|
||||
"Sun"|"Sunday") echo "Monday"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_previous_day() {
|
||||
local weekday="$1"
|
||||
case "$weekday" in
|
||||
"Mon"|"Monday") echo "Sunday"
|
||||
;;
|
||||
"Tue"|"Tuesday") echo "Monday"
|
||||
;;
|
||||
"Wed"|"Wednesday") echo "Tuesday"
|
||||
;;
|
||||
"Thu"|"Thursday") echo "Wednesday"
|
||||
;;
|
||||
"Fri"|"Friday") echo "Thursday"
|
||||
;;
|
||||
"Sat"|"Saturday") echo "Friday"
|
||||
;;
|
||||
"Sun"|"Sunday") echo "Saturday"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
ip_rule_west_zone() {
|
||||
local utc_start_t_h="$1"
|
||||
local utc_stop_t_h="$2"
|
||||
local local_start_t_h="$3"
|
||||
local local_stop_t_h="$4"
|
||||
local utc_start_time="$5"
|
||||
local utc_stop_time="$6"
|
||||
|
||||
if [ "$utc_start_t_h" -lt "$local_start_t_h" ]; then
|
||||
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop $utc_stop_time"
|
||||
if [ -n "$next_days" ]; then
|
||||
IP_RULE="$IP_RULE --weekdays $next_days"
|
||||
fi
|
||||
else
|
||||
if [ "$utc_stop_t_h" -lt "$local_stop_t_h" ]; then
|
||||
IP_RULE1="$IP_RULE"
|
||||
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop 23:59"
|
||||
IP_RULE1="$IP_RULE1 -m time --timestart 00:00 --timestop $utc_stop_time"
|
||||
if [ -n "$next_days" ]; then
|
||||
IP_RULE1="$IP_RULE1 --weekdays $next_days"
|
||||
fi
|
||||
else
|
||||
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop $utc_stop_time"
|
||||
fi
|
||||
if [ -n "$day" ]; then
|
||||
IP_RULE="$IP_RULE --weekdays $day"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
ip_rule_east_zone() {
|
||||
local utc_start_t_h="$1"
|
||||
local utc_stop_t_h="$2"
|
||||
local local_start_t_h="$3"
|
||||
local local_stop_t_h="$4"
|
||||
local utc_start_time="$5"
|
||||
local utc_stop_time="$6"
|
||||
|
||||
if [ "$utc_start_t_h" -lt "$local_start_t_h" ]; then
|
||||
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop $utc_stop_time"
|
||||
if [ -n "$day" ]; then
|
||||
IP_RULE="$IP_RULE --weekdays $day"
|
||||
fi
|
||||
else
|
||||
if [ "$utc_stop_t_h" -lt "$local_stop_t_h" ]; then
|
||||
IP_RULE1="$IP_RULE"
|
||||
IP_RULE="$IP_RULE -m time --timestart 00:00 --timestop $utc_stop_time"
|
||||
IP_RULE1="$IP_RULE1 -m time --timestart $utc_start_time --timestop 23:59"
|
||||
if [ -n "$prev_days" ]; then
|
||||
IP_RULE1="$IP_RULE1 --weekdays $prev_days"
|
||||
fi
|
||||
else
|
||||
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop $utc_stop_time"
|
||||
fi
|
||||
if [ -n "$day" ]; then
|
||||
IP_RULE="$IP_RULE --weekdays $day"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
process_ac_schedule() {
|
||||
local acs_id="$1"
|
||||
local is_enabled
|
||||
local access_control
|
||||
local start_time=""
|
||||
local mac=""
|
||||
|
||||
|
||||
handle_day_list() {
|
||||
local value=$1
|
||||
|
||||
val=$(echo $value | cut -c 1-3)
|
||||
next_day_val=$(get_next_day $val)
|
||||
prev_day_val=$(get_previous_day $val)
|
||||
if [ -z $day ]; then
|
||||
day="$val"
|
||||
next_days="$next_day_val"
|
||||
prev_days="$prev_day_val"
|
||||
else
|
||||
day="$day,$val"
|
||||
next_days="$next_days,$next_day_val"
|
||||
prev_days="$prev_days,$prev_day_val"
|
||||
fi
|
||||
}
|
||||
|
||||
config_list_foreach "$acs_id" "day" handle_day_list
|
||||
config_get is_enabled "$acs_id" "enable" 1
|
||||
config_get access_control "$acs_id" "dm_parent"
|
||||
|
||||
if [ "$is_enabled" == "0" ] || [ -z "$access_control" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
IP_RULE=""
|
||||
IP_RULE1=""
|
||||
|
||||
config_get is_enabled "$access_control" "enable" 1
|
||||
if [ "$is_enabled" == "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
mac=$(uci -q get hosts.$access_control.macaddr)
|
||||
access_policy=$(uci -q get hosts.$access_control.access_policy)
|
||||
|
||||
config_get start_time "$acs_id" "start_time"
|
||||
config_get duration "$acs_id" "duration"
|
||||
|
||||
if [ -z "$mac" ] && [ -z "$start_time" ] && [ -z "$duration" ] && [ -z "$day" ] && [ -z "$access_policy" ]; then
|
||||
return
|
||||
fi
|
||||
if [ -n "$mac" ]; then
|
||||
IP_RULE="$IP_RULE -m mac --mac-source $mac"
|
||||
fi
|
||||
|
||||
zone=$(date +%z | cut -c 1)
|
||||
local_start_time=$start_time
|
||||
if [ -n "$duration" ]; then
|
||||
hh=$(echo $local_start_time | awk -F: '{ print $1 }')
|
||||
mm=$(echo $local_start_time | awk -F: '{ print $2 }')
|
||||
hh_s=`expr $hh \* 3600`
|
||||
mm_s=`expr $mm \* 60`
|
||||
ss=$(( hh_s + mm_s ))
|
||||
local_start_hh=$hh
|
||||
|
||||
stop_ss=$(( ss + duration ))
|
||||
hh=$(( stop_ss / 3600 ))
|
||||
rem_ss=$(( stop_ss % 3600 ))
|
||||
mm=$(( rem_ss / 60 ))
|
||||
ss=$(( rem_ss % 60 ))
|
||||
local_stop_time="$hh:$mm:$ss"
|
||||
local_stop_hh=$hh
|
||||
fi
|
||||
|
||||
utc_start_time=$(date -u -d @$(date "+%s" -d "$local_start_time") +%H:%M)
|
||||
utc_stop_time=$(date -u -d @$(date "+%s" -d "$local_stop_time") +%H:%M)
|
||||
utc_start_hh=$(echo $utc_start_time | awk -F: '{ print $1 }')
|
||||
utc_stop_hh=$(echo $utc_stop_time | awk -F: '{ print $1 }')
|
||||
if [ "$zone" == "-" ]; then
|
||||
ip_rule_west_zone $utc_start_hh $utc_stop_hh $local_start_hh $local_stop_hh $utc_start_time $utc_stop_time
|
||||
else
|
||||
ip_rule_east_zone $utc_start_hh $utc_stop_hh $local_start_hh $local_stop_hh $utc_start_time $utc_stop_time
|
||||
fi
|
||||
|
||||
if [ "$access_policy" == "Deny" ]; then
|
||||
IP_RULE="$IP_RULE -j DROP"
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
IP_RULE1="$IP_RULE1 -j DROP"
|
||||
fi
|
||||
else
|
||||
IP_RULE="$IP_RULE -j ACCEPT"
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
IP_RULE1="$IP_RULE1 -j ACCEPT"
|
||||
fi
|
||||
fi
|
||||
|
||||
iptables -w -A hosts_forward ${IP_RULE}
|
||||
ip6tables -w -A hosts_forward ${IP_RULE}
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
iptables -w -A hosts_forward ${IP_RULE1}
|
||||
ip6tables -w -A hosts_forward ${IP_RULE1}
|
||||
fi
|
||||
|
||||
day=""
|
||||
next_days=""
|
||||
prev_days=""
|
||||
}
|
||||
|
||||
hosts_acl() {
|
||||
iptables -w -F hosts_forward
|
||||
ip6tables -w -F hosts_forward
|
||||
|
||||
hosts_forward=$(iptables -t filter --list | grep hosts_forward)
|
||||
if [ -z "$hosts_forward" ]; then
|
||||
iptables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && iptables -w -t filter -I FORWARD -j hosts_forward
|
||||
ip6tables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && ip6tables -w -t filter -I FORWARD -j hosts_forward
|
||||
fi
|
||||
|
||||
# Load /etc/config/hosts UCI file
|
||||
config_load hosts
|
||||
config_foreach process_ac_schedule ac_schedule
|
||||
}
|
||||
@@ -8,21 +8,23 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.5.8
|
||||
PKG_VERSION:=9.5.17
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=79871c5365cf89ce718b922b0863c8a68c09a771
|
||||
PKG_SOURCE_VERSION:=d01799af9a1043b60de0f118ebb974628d57c9b3
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/icwmp/default
|
||||
SECTION:=utils
|
||||
@@ -79,10 +81,9 @@ ifeq ($(BUILD_VARIANT),mbedtls)
|
||||
CMAKE_OPTIONS += -DWITH_MBEDTLS=ON
|
||||
endif
|
||||
|
||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||
ifneq ($(USE_LOCAL),)
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
$(CP) -rf ~/git/icwmp/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
@@ -93,10 +94,7 @@ define Package/icwmp/default/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json/
|
||||
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libcwmpdm.so $(1)/usr/lib/bbfdm/libcwmpdm.so
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/icwmpd $(1)/usr/sbin/icwmpd
|
||||
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
|
||||
$(INSTALL_BIN) ./files/etc/firewall.cwmp $(1)/etc/firewall.cwmp
|
||||
@@ -104,10 +102,10 @@ define Package/icwmp/default/install
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/85-cwmp-set-userid $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
|
||||
$(INSTALL_BIN) ./files/etc/icwmpd/update.sh $(1)/etc/icwmpd/update.sh
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/json/CWMPManagementServer.json $(1)/etc/bbfdm/json/
|
||||
$(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
|
||||
$(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/CWMPManagementServer.json)
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libcwmpdm.so)
|
||||
endef
|
||||
|
||||
Package/icwmp/install = $(Package/icwmp/default/install)
|
||||
|
||||
@@ -20,7 +20,7 @@ config cpe 'cpe'
|
||||
option log_to_file 'disable'
|
||||
# log_severity: INFO (Default)
|
||||
# log_severity possible configs: EMERG, ALERT, CRITIC ,ERROR, WARNING, NOTICE, INFO, DEBUG
|
||||
option log_severity 'INFO'
|
||||
option log_severity 'ERROR'
|
||||
option log_file_name '/var/log/icwmpd.log'
|
||||
option log_max_size '102400'
|
||||
option userid '' #$OUI-$SER
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
#!/bin/sh
|
||||
. /lib/functions.sh
|
||||
|
||||
log() {
|
||||
echo "$@" |logger -t cwmp.update -p info
|
||||
}
|
||||
|
||||
handle_icwmp_update() {
|
||||
local cwmp_enable
|
||||
config_load cwmp
|
||||
|
||||
config_get_bool cwmp_enable cpe enable 1
|
||||
if [ "$cwmp_enable" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# wait for some time to avoid interface fluctuation
|
||||
sleep 10
|
||||
ret=$(ubus call service list '{"name":"icwmpd"}' | jsonfilter -qe '@.icwmpd.instances.icwmp.running')
|
||||
|
||||
if [ "$ret" != "true" ]; then
|
||||
log "Restarting icwmp tr069 object"
|
||||
/etc/init.d/icwmpd restart
|
||||
fi
|
||||
}
|
||||
|
||||
handle_icwmp_update "$@"
|
||||
@@ -467,19 +467,11 @@ validate_defaults() {
|
||||
}
|
||||
|
||||
boot() {
|
||||
local enable_cwmp="0"
|
||||
local dhcp_discovery="0"
|
||||
local wan_interface=""
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
local wan_interface=""
|
||||
|
||||
config_get wan_interface cpe default_wan_interface "wan"
|
||||
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
config_get dhcp_discovery acs dhcp_discovery "0"
|
||||
|
||||
if [ "${dhcp_discovery}" = "enable" ] || [ "${dhcp_discovery}" = "1" ]; then
|
||||
@@ -511,27 +503,31 @@ boot() {
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enable_cwmp
|
||||
local enable_cwmp url dhcp_url
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
config_get url acs url ""
|
||||
config_get dhcp_url acs dhcp_url ""
|
||||
|
||||
procd_open_instance icwmp
|
||||
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
procd_close_instance
|
||||
return 0
|
||||
fi
|
||||
|
||||
[ -f /sbin/netifd ] && log "Waiting for Network to be started ..." && ubus -t 5 wait_for network.interface
|
||||
[ -f /usr/sbin/dnsmasq ] && log "Waiting for DNS Proxy to be started ..." && ubus -t 5 wait_for dnsmasq
|
||||
[ -f /etc/config/dhcp ] && log "Waiting for DNS Server(s) ..." && wait_for_resolvfile 20
|
||||
|
||||
validate_defaults || {
|
||||
log "Validation of defaults failed"
|
||||
procd_close_instance
|
||||
return 1;
|
||||
}
|
||||
|
||||
procd_open_instance icwmp
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -b
|
||||
if [ -n "${url}" ] || [ -n "${dhcp_url}" ]; then
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -b
|
||||
fi
|
||||
|
||||
procd_set_param respawn \
|
||||
"${respawn_threshold:-5}" \
|
||||
"${respawn_timeout:-10}" "${respawn_retry:-3}"
|
||||
@@ -551,6 +547,7 @@ reload_service() {
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
|
||||
log "Reload service $ret"
|
||||
ret="0"
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
stop
|
||||
@@ -558,30 +555,15 @@ reload_service() {
|
||||
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 returning
|
||||
return 0
|
||||
ret=$(ubus call service list '{"name":"icwmpd"}' | jsonfilter -qe '@.icwmpd.instances.icwmp.running')
|
||||
if [ "$ret" != "true" ]; then
|
||||
log "Reloading cwmp service ..."
|
||||
stop
|
||||
start
|
||||
fi
|
||||
|
||||
status="$(echo "${tr069_status}" | jsonfilter -qe '@.cwmp.status')"
|
||||
if [ "$status" = "up" ]; then
|
||||
ubus -t 1 call tr069 command '{"command":"reload"}'
|
||||
fi
|
||||
}
|
||||
|
||||
add_interface_trigger() {
|
||||
procd_add_interface_trigger "interface.update" "$1" /etc/icwmpd/update.sh
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
local wan_interface
|
||||
|
||||
config_load cwmp
|
||||
config_get wan_interface cpe default_wan_interface "wan"
|
||||
|
||||
procd_add_reload_trigger "cwmp"
|
||||
add_interface_trigger ${wan_interface}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ config IEEE1905_WIFI_EASYMESH
|
||||
|
||||
config IEEE1905_CMDU_FRAGMENT_TLV_BOUNDARY
|
||||
bool "Fragment large CMDU frame at TLV boundary instead of octet boundary"
|
||||
default y
|
||||
|
||||
endmenu
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.2.19
|
||||
PKG_VERSION:=8.3.3
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=3d175485a7461ce567e3bee47e1c760e15434367
|
||||
PKG_SOURCE_VERSION:=526690993c93720ee1707bba6b7a08e8c28f2dd9
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/ieee1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -123,7 +123,6 @@ define Build/InstallDev/libieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/cmdu_ackq.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/1905_tlvs.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/i1905_wsc.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/bufutil.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/timer_impl.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/i1905_extension.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/libmidgen.so $(1)/usr/lib/
|
||||
|
||||
@@ -4,6 +4,7 @@ config ieee1905 'ieee1905'
|
||||
list extmodule 'map'
|
||||
list extmodule 'topology'
|
||||
option registrar '2 5 6'
|
||||
list exclude_tagging '/eth.*'
|
||||
# option macaddress '0a:1b:2c:3d:4e:50'
|
||||
|
||||
config al-iface
|
||||
|
||||
@@ -94,6 +94,7 @@ CONFIG_PACKAGE_udpecho-server=y
|
||||
CONFIG_PACKAGE_userinterface=y
|
||||
CONFIG_PACKAGE_xmppc=y
|
||||
CONFIG_PACKAGE_timemngr=y
|
||||
CONFIG_PACKAGE_self-diagnostics=y
|
||||
|
||||
# WebGUI #
|
||||
CONFIG_PACKAGE_sulu=y
|
||||
@@ -170,7 +171,6 @@ CONFIG_PACKAGE_iptables-mod-ipopt=y
|
||||
CONFIG_PACKAGE_iptables-mod-nflog=y
|
||||
CONFIG_PACKAGE_iptables-mod-nfqueue=y
|
||||
CONFIG_PACKAGE_ndisc6=y
|
||||
CONFIG_PACKAGE_nping=y
|
||||
CONFIG_PACKAGE_rdisc6=y
|
||||
CONFIG_PACKAGE_resolveip=y
|
||||
CONFIG_PACKAGE_socat=y
|
||||
@@ -243,7 +243,6 @@ CONFIG_BUSYBOX_CONFIG_ASH_IDLE_TIMEOUT=y
|
||||
CONFIG_BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT=y
|
||||
CONFIG_BUSYBOX_CONFIG_CTTYHACK=y
|
||||
CONFIG_BUSYBOX_CONFIG_DELUSER=y
|
||||
# CONFIG_BUSYBOX_CONFIG_DEVMEM is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCP_8021Q=y
|
||||
CONFIG_BUSYBOX_CONFIG_FIRST_SYSTEM_ID=100
|
||||
# CONFIG_BUSYBOX_CONFIG_HTTPD is not set
|
||||
|
||||
@@ -4,7 +4,18 @@ function feeds_update {
|
||||
heads=1
|
||||
developer=0
|
||||
override=1
|
||||
while getopts "inh" opt; do
|
||||
force=1
|
||||
|
||||
function update_failure {
|
||||
if [ $force == 1 ]; then
|
||||
echo "WARNING: Failed to update feed(s). Forced update, proceeding anyway." >&2
|
||||
else
|
||||
echo "ERROR: Failed to update feed(s). Omit -F to proceed anyway." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
while getopts "inFh" opt; do
|
||||
case $opt in
|
||||
i)
|
||||
heads=0
|
||||
@@ -12,12 +23,16 @@ function feeds_update {
|
||||
n)
|
||||
override=0
|
||||
;;
|
||||
F)
|
||||
force=0
|
||||
;;
|
||||
h|\?)
|
||||
echo "Usage: ./iop feeds_update [-i] [-n] [-h]"
|
||||
echo "Usage: ./iop feeds_update [-i] [-n] [-F] [-h]"
|
||||
echo
|
||||
echo "OPTIONS:"
|
||||
echo " -i - Only update index. Do not change HEAD in feeds."
|
||||
echo " -n - Do not replace core packages with iopsys versions."
|
||||
echo " -F - Do not force update if there are inaccessible feeds."
|
||||
echo " -h - Display this help message and exit."
|
||||
exit 1
|
||||
;;
|
||||
@@ -30,9 +45,9 @@ function feeds_update {
|
||||
|
||||
if [ $heads == 1 ]; then
|
||||
if [ $developer == 1 ]; then
|
||||
./scripts/feeds update -g
|
||||
./scripts/feeds update -g || update_failure
|
||||
else
|
||||
./scripts/feeds update
|
||||
./scripts/feeds update || update_failure
|
||||
fi
|
||||
fi
|
||||
./scripts/feeds update -ai || exit 1
|
||||
@@ -40,6 +55,7 @@ function feeds_update {
|
||||
# replace core packages with iopsys versions
|
||||
if [ $override == 1 ]; then
|
||||
./scripts/feeds install -f -p openwrt_core -a || exit 1
|
||||
./scripts/feeds install -f -p qualcomm -a || exit 1
|
||||
fi
|
||||
|
||||
(
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
function genconfig {
|
||||
export CLEAN=0
|
||||
export DIRTY="--dirty"
|
||||
export IMPORT=1
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
@@ -16,7 +17,7 @@ function genconfig {
|
||||
brcmbca_feed="target/linux/feeds/brcmbca"
|
||||
airoha_feed="target/linux/feeds/airoha"
|
||||
x86_feed="target/linux/feeds/x86"
|
||||
armvirt_feed="target/linux/feeds/armvirt"
|
||||
armsr_feed="target/linux/feeds/armsr"
|
||||
mediatek_feed="target/linux/feeds/mediatek"
|
||||
qualcomm_ipq95xx_feed="target/linux/feeds/ipq95xx"
|
||||
qualcomm_ipq53xx_feed="target/linux/feeds/ipq53xx"
|
||||
@@ -108,8 +109,8 @@ function genconfig {
|
||||
airoha=$(cd $airoha_feed; ./genconfig)
|
||||
[ -e $x86_feed/genconfig ] &&
|
||||
x86=$(cd $x86_feed; ./genconfig)
|
||||
[ -e $armvirt_feed/genconfig ] &&
|
||||
armvirt=$(cd $armvirt_feed; ./genconfig)
|
||||
[ -e $armsr_feed/genconfig ] &&
|
||||
armsr=$(cd $armsr_feed; ./genconfig)
|
||||
[ -e $mediatek_feed/genconfig ] &&
|
||||
mediatek=$(cd $mediatek_feed; ./genconfig)
|
||||
[ -e $qualcomm_ipq95xx_feed/genconfig ] &&
|
||||
@@ -118,7 +119,7 @@ function genconfig {
|
||||
ipq53xx=$(cd $qualcomm_ipq53xx_feed; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in brcmbca airoha x86 armvirt mediatek ipq95xx ipq53xx; do
|
||||
for list in brcmbca airoha x86 armsr mediatek ipq95xx ipq53xx; do
|
||||
echo "$list based boards:"
|
||||
a=$(echo "${!list}" | sort)
|
||||
for b in $a; do
|
||||
@@ -144,10 +145,10 @@ function genconfig {
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $armvirt; do
|
||||
for p in $armsr; do
|
||||
if [ $p == $profile ]; then
|
||||
target="armvirt"
|
||||
target_config_path="$armvirt_feed/config"
|
||||
target="armsr"
|
||||
target_config_path="$armsr_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -198,6 +199,7 @@ function genconfig {
|
||||
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
echo
|
||||
echo -e " -c|--clean\t\tRemove all files under ./files and import from config "
|
||||
echo -e " -D|--no-dirty\t\tIgnore dirty tree"
|
||||
echo -e " -v|--verbose\t\tVerbose"
|
||||
echo -e " -n|--no-update\tDo NOT! Update customer config before applying"
|
||||
echo -e " -t|--target\t\tExplicitly specify the linux target to build the board profile from"
|
||||
@@ -416,7 +418,7 @@ function genconfig {
|
||||
|
||||
# Set target version
|
||||
local git_version
|
||||
if ! git_version="$(git describe --always --dirty --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then
|
||||
if ! git_version="$(git describe --always $DIRTY --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then
|
||||
echo "ERROR: Failed getting version via git describe, exiting." >&2
|
||||
return 1
|
||||
fi
|
||||
@@ -483,6 +485,7 @@ function genconfig {
|
||||
case "$1" in
|
||||
|
||||
-c|--clean) export CLEAN=1;;
|
||||
-D|--no-dirty) export DIRTY="";;
|
||||
-n|--no-update) export IMPORT=0;;
|
||||
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-t|--target) export TARGET="$2"; shift;;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
function genconfig_min {
|
||||
export CLEAN=0
|
||||
export DIRTY="--dirty"
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
CURRENT_CONFIG_FILE=".current_config_file"
|
||||
@@ -15,7 +16,7 @@ function genconfig_min {
|
||||
brcmbca_feed="target/linux/feeds/brcmbca"
|
||||
airoha_feed="target/linux/feeds/airoha"
|
||||
x86_feed="target/linux/feeds/x86"
|
||||
armvirt_feed="target/linux/feeds/armvirt"
|
||||
armsr_feed="target/linux/feeds/armsr"
|
||||
mediatek_feed="target/linux/feeds/mediatek"
|
||||
qualcomm_ipq95xx_feed="target/linux/feeds/ipq95xx"
|
||||
qualcomm_ipq53xx_feed="target/linux/feeds/ipq53xx"
|
||||
@@ -107,8 +108,8 @@ function genconfig_min {
|
||||
airoha=$(cd $airoha_feed; ./genconfig)
|
||||
[ -e $x86_feed/genconfig ] &&
|
||||
x86=$(cd $x86_feed; ./genconfig)
|
||||
[ -e $armvirt_feed/genconfig ] &&
|
||||
armvirt=$(cd $armvirt_feed; ./genconfig)
|
||||
[ -e $armsr_feed/genconfig ] &&
|
||||
armsr=$(cd $armsr_feed; ./genconfig)
|
||||
[ -e $mediatek_feed/genconfig ] &&
|
||||
mediatek=$(cd $mediatek_feed; ./genconfig)
|
||||
[ -e $qualcomm_ipq95xx_feed/genconfig ] &&
|
||||
@@ -117,7 +118,7 @@ function genconfig_min {
|
||||
ipq53xx=$(cd $qualcomm_ipq53xx_feed; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in brcmbca airoha x86 armvirt mediatek ipq95xx ipq53xx; do
|
||||
for list in brcmbca airoha x86 armsr mediatek ipq95xx ipq53xx; do
|
||||
echo "$list based boards:"
|
||||
a=$(echo "${!list}" | sort)
|
||||
for b in $a; do
|
||||
@@ -143,10 +144,10 @@ function genconfig_min {
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $armvirt; do
|
||||
for p in $armsr; do
|
||||
if [ $p == $profile ]; then
|
||||
target="armvirt"
|
||||
target_config_path="$armvirt_feed/config"
|
||||
target="armsr"
|
||||
target_config_path="$armsr_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -197,6 +198,7 @@ function genconfig_min {
|
||||
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
echo
|
||||
echo -e " -c|--clean\t\tRemove all files under ./files and import from config "
|
||||
echo -e " -D|--no-dirty\t\tIgnore dirty tree"
|
||||
echo -e " -v|--verbose\t\tVerbose"
|
||||
echo -e " -n|--no-update\tDo NOT! Update customer config before applying"
|
||||
echo -e " -t|--target\t\tExplicitly specify the linux target to build the board profile from"
|
||||
@@ -390,7 +392,7 @@ function genconfig_min {
|
||||
|
||||
# Set target version
|
||||
local git_version
|
||||
if ! git_version="$(git describe --always --dirty --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then
|
||||
if ! git_version="$(git describe --always $DIRTY --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then
|
||||
echo "ERROR: Failed getting version via git describe, exiting." >&2
|
||||
return 1
|
||||
fi
|
||||
@@ -451,6 +453,7 @@ function genconfig_min {
|
||||
case "$1" in
|
||||
|
||||
-c|--clean) export CLEAN=1;;
|
||||
-D|--no-dirty) export DIRTY="";;
|
||||
-n|--no-update) export IMPORT=0;;
|
||||
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-t|--target) export TARGET="$2"; shift;;
|
||||
|
||||
57
libdpp/Makefile
Normal file
57
libdpp/Makefile
Normal file
@@ -0,0 +1,57 @@
|
||||
#
|
||||
# Copyright (C) 2020-2023 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libdpp
|
||||
PKG_VERSION:=2.0.0
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=f22959b107a8bf443d04d6261d00074b5514dfe8
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/libdpp.git
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=LGPL-2.1-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
define Package/libdpp/description
|
||||
Library providing APIs for DPP EasyConnect frame generation and handling
|
||||
endef
|
||||
|
||||
define Package/libdpp
|
||||
TITLE:= DPP EasyConnect library (libdpp)
|
||||
DEPENDS:= +libeasy +libopenssl +libgcrypt +libubox
|
||||
endef
|
||||
|
||||
MAKE_PATH:=lib
|
||||
|
||||
|
||||
define Build/InstallDev/libdpp
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/dpp_api.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/dpputils.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libdpp.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
define Build/InstallDev
|
||||
$(call Build/InstallDev/libdpp,$(1),$(2))
|
||||
endef
|
||||
|
||||
define Package/libdpp/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libdpp.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libdpp))
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libeasy
|
||||
PKG_VERSION:=7.2.100
|
||||
PKG_VERSION:=7.4.0
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=32db1b79bd88eba85a3e7518dbbbd1e29f4b06d9
|
||||
PKG_SOURCE_VERSION:=fb217608830e7549d5721fd80100295e07a15dbe
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libeasy.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -50,6 +50,9 @@ define Build/InstallDev/libeasy
|
||||
$(CP) $(PKG_BUILD_DIR)/easy.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/event.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/utils.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/bufutil.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/cryptutil.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/ecc_cryptutil.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/if_utils.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/debug.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/hlist.h $(1)/usr/include/easy/
|
||||
|
||||
@@ -10,7 +10,7 @@ PKG_VERSION:=7.2.105
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=78cc1481feff7adc09749e73a3513fae4d9ded28
|
||||
PKG_SOURCE_VERSION:=61b15e0fe345186d36d0ca3212a08f384af3609b
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libqos.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-airoha
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.7
|
||||
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:=5e1befd02c6734ee8b94b7ef54d6171ba1086042
|
||||
PKG_SOURCE_VERSION:=5a41deb7339dd189da6a30a382c3018350a6555c
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-broadcom
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.5
|
||||
PKG_VERSION:=1.0.7
|
||||
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:=8c8fa2b70e2bd570deb291478b31fa81a4ab3c1a
|
||||
PKG_SOURCE_VERSION:=dcf0b378ff9e89f16429f1096e271385529a8122
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-d2
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.12
|
||||
PKG_VERSION:=1.1.0
|
||||
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:=e60fdaa93e1385bbea08751dcd392cddffdf3345
|
||||
PKG_SOURCE_VERSION:=dc4173c8baaf59f59f27c50a3aa7c4988187e97c
|
||||
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.3
|
||||
PKG_VERSION:=7.4.8
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=66cd6a376308ab28b0650883e6ba7bb1952ce6fc
|
||||
PKG_SOURCE_VERSION:=3c878eecd8404591cd139c986850b4d21efd1dea
|
||||
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
|
||||
|
||||
@@ -52,5 +52,8 @@ config AGENT_OPER_CHANNEL_CHANGE_RELAY_MCAST
|
||||
bool "Use config opt to determine if Oper Channel Report CMDU is send as relayed multicast or directly to controller"
|
||||
default y
|
||||
|
||||
config AGENT_USE_LIBDPP
|
||||
bool "Depend on libdpp for DPP EasyConnect"
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=4.3.7.0
|
||||
PKG_VERSION:=4.5.0.4
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=03a85b04d10c08dccd96381ef6f2ece91d16dc52
|
||||
PKG_SOURCE_VERSION:=242b73965cc3cce74de36d0ee758d98bd0640cd6
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
@@ -28,9 +28,12 @@ define Package/map-agent
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi multi-AP Agent (EasyMesh R2)
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
|
||||
+map-plugin +ip-bridge
|
||||
+map-plugin +ip-bridge +AGENT_USE_LIBDPP:libdpp
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_AGENT_USE_LIBDPP),y)
|
||||
TARGET_CFLAGS += -DUSE_LIBDPP
|
||||
endif
|
||||
|
||||
define Package/dynbhd
|
||||
SECTION:=utils
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
config agent 'agent'
|
||||
option enabled '0'
|
||||
option debug '0'
|
||||
option profile '4'
|
||||
option profile '3'
|
||||
option al_bridge 'br-lan'
|
||||
option netdev 'wlan'
|
||||
option island_prevention '0'
|
||||
|
||||
@@ -80,6 +80,7 @@ generate_multiap_config() {
|
||||
ifprefix="wlan0%-"
|
||||
ifname="wlan${devidx}"
|
||||
ifname_bh="wlan${devidx}-1"
|
||||
ap_follow_sta_dfs="1"
|
||||
else
|
||||
ifprefix="wlan%-"
|
||||
ifname="wlan$devidx"
|
||||
@@ -89,6 +90,7 @@ generate_multiap_config() {
|
||||
if [ $generate_mapagent_config -eq 1 ]; then
|
||||
uci set mapagent.agent.ifprefix="$ifprefix"
|
||||
uci set mapagent.agent.brcm_setup="$brcm_setup"
|
||||
uci set mapagent.agent.ap_follow_sta_dfs="$ap_follow_sta_dfs"
|
||||
uci add mapagent radio
|
||||
uci set mapagent.@radio[-1].device="$device"
|
||||
uci set mapagent.@radio[-1].band="$mode_band"
|
||||
|
||||
@@ -26,5 +26,9 @@ config CONTROLLER_EASYMESH_VENDOR_EXT_OUI
|
||||
enabled through CONTROLLER_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
|
||||
through which such features would be exposed.
|
||||
|
||||
config CONTROLLER_USE_LIBDPP
|
||||
bool "Depend on libdpp for DPP EasyConnect"
|
||||
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=4.3.3.0
|
||||
PKG_VERSION:=4.5.0.1
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=cc50001914d500655ffdb8eede3c38f650417209
|
||||
PKG_SOURCE_VERSION:=43e993f9f42ba0d3c49e87ea3fbad0c9d827668e
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
@@ -27,9 +27,15 @@ define Package/map-controller
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi Multi-AP Controller (EasyMesh R2)
|
||||
DEPENDS:=+libuci +libubox +ubus +libeasy +libwifiutils +libieee1905 +ieee1905 +map-plugin
|
||||
DEPENDS:=+libuci +libubox +ubus +libeasy +libwifiutils +libieee1905 +ieee1905 +map-plugin \
|
||||
+CONTROLLER_USE_LIBDPP:libdpp
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_CONTROLLER_USE_LIBDPP),y)
|
||||
TARGET_CFLAGS += -DUSE_LIBDPP
|
||||
endif
|
||||
|
||||
|
||||
define Package/map-controller/description
|
||||
This package provides WiFi MultiAP Controller as per the EasyMesh-R2 specs.
|
||||
endef
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
config controller 'controller'
|
||||
option enabled '1' # may be modified by other package start-up scripts (i.e. map-agent)
|
||||
option profile '4'
|
||||
option profile '3'
|
||||
option registrar '2 5 6'
|
||||
option debug '0'
|
||||
option bcn_metrics_max_num '10'
|
||||
|
||||
@@ -10,6 +10,8 @@ PROG_EXE=/usr/sbin/mcproxy
|
||||
PROG_PARAMS=
|
||||
PROG_PARAMS_SEPARATOR=:
|
||||
|
||||
snooping_bridges=
|
||||
|
||||
|
||||
__device_is_bridge() {
|
||||
local device="$2"
|
||||
@@ -114,10 +116,11 @@ config_mcproxy_interfaces() {
|
||||
|
||||
config_sysfs_mcast_snooping() {
|
||||
local downstreams="$1"
|
||||
local snooping="$2"
|
||||
|
||||
for downstream in $downstreams; do
|
||||
if device_is_bridge "$downstream"; then
|
||||
echo 1 > /sys/class/net/$downstream/bridge/multicast_snooping
|
||||
echo $snooping > /sys/class/net/$downstream/bridge/multicast_snooping
|
||||
fi
|
||||
done
|
||||
}
|
||||
@@ -136,7 +139,53 @@ config_sysfs_mcast_fastleave() {
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_mode() {
|
||||
config_sysfs_mcast_version() {
|
||||
local protocol="$1"
|
||||
local interfaces="$2"
|
||||
local version="$3"
|
||||
|
||||
for iface in $interfaces; do
|
||||
echo $version > /sys/class/net/$iface/bridge/multicast_"$protocol"_version
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_robustness() {
|
||||
local interfaces="$1"
|
||||
local robustness="$2"
|
||||
|
||||
for iface in $interfaces; do
|
||||
echo $robustness > /sys/class/net/$iface/bridge/multicast_last_member_count
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_query_interval() {
|
||||
local interfaces="$1"
|
||||
local query_interval="$2"
|
||||
|
||||
for iface in $interfaces; do
|
||||
echo $query_interval > /sys/class/net/$iface/bridge/multicast_query_interval
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_q_resp_interval() {
|
||||
local interfaces="$1"
|
||||
local q_resp_interval="$2"
|
||||
|
||||
for iface in $interfaces; do
|
||||
echo $q_resp_interval > /sys/class/net/$iface/bridge/multicast_query_response_interval
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_last_mem_q_int() {
|
||||
local interfaces="$1"
|
||||
local last_mem_q_int="$2"
|
||||
|
||||
for iface in $interfaces; do
|
||||
echo $last_mem_q_int > /sys/class/net/$iface/bridge/multicast_last_member_interval
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_flood() {
|
||||
local downstreams=$1
|
||||
local mcast_mode=$2
|
||||
local prt
|
||||
@@ -157,6 +206,25 @@ config_sysfs_mcast_mode() {
|
||||
done
|
||||
}
|
||||
|
||||
config_snooping_mode() {
|
||||
local interfaces="$1"
|
||||
local snooping="$2"
|
||||
|
||||
# snooping_mode:
|
||||
# 0 - snooping is disabled
|
||||
# 1 - multicast flood is enabled
|
||||
# 2 - multicast flood is disabled
|
||||
[ -z "$snooping_mode" ] && snooping_mode=2
|
||||
|
||||
if [ "$snooping_mode" == 0 ]; then
|
||||
config_sysfs_mcast_snooping "$interfaces" 0
|
||||
else
|
||||
config_sysfs_mcast_snooping "$interfaces" 1
|
||||
fi
|
||||
|
||||
config_sysfs_mcast_flood "$interfaces" "$snooping_mode"
|
||||
}
|
||||
|
||||
config_mcproxy_instance() {
|
||||
local protocol="$1"
|
||||
local version="$2"
|
||||
@@ -195,6 +263,11 @@ config_mcproxy_instance() {
|
||||
upstreams=$igmp_p_up_interfaces
|
||||
downstreams=$igmp_p_down_interfaces
|
||||
mcast_mode=$igmp_p_mode
|
||||
|
||||
# mcproxy reserves two multicast subscriptions for igmp router service groups
|
||||
local mg=$(cat /proc/sys/net/ipv4/igmp_max_memberships)
|
||||
mg=$((mg+2))
|
||||
echo $mg > /proc/sys/net/ipv4/igmp_max_memberships
|
||||
elif [ "$protocol" == "mld" ]; then
|
||||
case "$version" in
|
||||
[1-2])
|
||||
@@ -228,21 +301,98 @@ config_mcproxy_instance() {
|
||||
|
||||
# for snooping to work we should enable it on the bridge, doing it from
|
||||
# here instead of from inside network config
|
||||
config_sysfs_mcast_snooping "$downstreams"
|
||||
[ -n $fast_leave ] &&
|
||||
config_sysfs_mcast_fastleave "$downstreams" "$fast_leave"
|
||||
config_sysfs_mcast_mode "$downstreams" "$mcast_mode"
|
||||
if [ "$downstreams" != "$snooping_bridges" ]; then
|
||||
config_sysfs_mcast_snooping "$downstreams" 1
|
||||
[ -n $fast_leave ] &&
|
||||
config_sysfs_mcast_fastleave "$downstreams" "$fast_leave"
|
||||
config_sysfs_mcast_flood "$downstreams" "$mcast_mode"
|
||||
fi
|
||||
|
||||
PROG_PARAMS="${PROG_PARAMS} -f ${CONFFILE}${PROG_PARAMS_SEPARATOR}"
|
||||
}
|
||||
|
||||
config_snooping() {
|
||||
local protocol="$1"
|
||||
|
||||
local version=
|
||||
local robustness=
|
||||
local query_interval=
|
||||
local q_resp_interval=
|
||||
local last_mem_q_int=
|
||||
local fast_leave=0
|
||||
local snooping_mode=
|
||||
local interfaces=
|
||||
|
||||
local HZ=100
|
||||
|
||||
local all_interfaces=
|
||||
if [ "$protocol" == "igmp" ]; then
|
||||
all_interfaces=$igmp_s_iface
|
||||
elif [ "$protocol" == "mld" ]; then
|
||||
all_interfaces=$mld_s_iface
|
||||
fi
|
||||
for iface in $all_interfaces; do
|
||||
device_is_bridge "$iface" || continue
|
||||
interfaces="$interfaces $iface"
|
||||
done
|
||||
[ -z "$interfaces" ] && return
|
||||
snooping_bridges="$interfaces"
|
||||
|
||||
if [ "$protocol" == "igmp" ]; then
|
||||
case "$igmp_s_version" in
|
||||
[1-3])
|
||||
version="$igmp_s_version"
|
||||
;;
|
||||
*)
|
||||
version="2"
|
||||
;;
|
||||
esac
|
||||
|
||||
robustness=$igmp_s_robustness
|
||||
query_interval=$(( igmp_s_query_interval * HZ ))
|
||||
q_resp_interval=$(( igmp_s_q_resp_interval * HZ / 10 ))
|
||||
last_mem_q_int=$(( igmp_s_last_mem_q_int * HZ / 10 ))
|
||||
fast_leave=$igmp_s_fast_leave
|
||||
snooping_mode=$igmp_s_mode
|
||||
elif [ "$protocol" == "mld" ]; then
|
||||
case "$mld_s_version" in
|
||||
[1-2])
|
||||
version="$mld_s_version"
|
||||
;;
|
||||
*)
|
||||
version="2"
|
||||
;;
|
||||
esac
|
||||
|
||||
robustness=$mld_s_robustness
|
||||
query_interval=$(( mld_s_query_interval * HZ ))
|
||||
q_resp_interval=$(( mld_s_q_resp_interval * HZ / 10 ))
|
||||
last_mem_q_int=$(( mld_s_last_mem_q_int * HZ / 10 ))
|
||||
fast_leave=$mld_s_fast_leave
|
||||
snooping_mode=$mld_s_mode
|
||||
fi
|
||||
|
||||
config_snooping_mode "$interfaces" "$snooping_mode"
|
||||
|
||||
[ -n "$version" ] && config_sysfs_mcast_version "$protocol" "$interfaces" "$version"
|
||||
[ -n "$robustness" ] && config_sysfs_mcast_robustness "$interfaces" "$robustness"
|
||||
[ -n "$query_interval" ] && config_sysfs_mcast_query_interval "$interfaces" "$query_interval"
|
||||
[ -n "$q_resp_interval" ] && config_sysfs_mcast_q_resp_interval "$interfaces" "$q_resp_interval"
|
||||
[ -n "$last_mem_q_int" ] && config_sysfs_mcast_last_mem_q_int "$interfaces" "$last_mem_q_int"
|
||||
[ -n "$fast_leave" ] && config_sysfs_mcast_fastleave "$interfaces" "$fast_leave"
|
||||
}
|
||||
|
||||
config_mcproxy() {
|
||||
if [ "$igmp_p_enable" == "1" ]; then
|
||||
config_mcproxy_instance igmp "$igmp_p_version"
|
||||
elif [ "$igmp_s_enable" == "1" ]; then
|
||||
config_snooping igmp "$igmp_s_version"
|
||||
fi
|
||||
|
||||
if [ "$mld_p_enable" == "1" ]; then
|
||||
config_mcproxy_instance mld "$mld_p_version"
|
||||
elif [ "$mld_s_enable" == "1" ]; then
|
||||
config_snooping mld "$mld_s_version"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -253,11 +403,6 @@ setup_mcast_mode() {
|
||||
configure_mcast() {
|
||||
config_global_params "set_max_groups_and_sources"
|
||||
|
||||
# mcproxy reserves two multicast subscriptions for igmp router service groups
|
||||
local mg=$(cat /proc/sys/net/ipv4/igmp_max_memberships)
|
||||
mg=$((mg+2))
|
||||
echo $mg > /proc/sys/net/ipv4/igmp_max_memberships
|
||||
|
||||
read_mcast_snooping_params
|
||||
read_mcast_proxy_params
|
||||
config_mcproxy
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
if PACKAGE_obuspa
|
||||
config OBUSPA_DB_PATH
|
||||
string "Configure path for usp.db file"
|
||||
default "/tmp/"
|
||||
|
||||
config OBUSPA_MTP_ENABLE_MQTT
|
||||
bool "Enable MQTT as mtp protocol"
|
||||
default y
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=7.0.4.4
|
||||
PKG_VERSION:=7.0.4.13
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
|
||||
PKG_SOURCE_VERSION:=7ae856494f6cae9e81510818a7944b1259ca55b2
|
||||
PKG_SOURCE_VERSION:=5f73b6ab057d31a53e1f72d9fb129d65b73cbf55
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -19,12 +19,12 @@ endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/obuspa
|
||||
SECTION:=utils
|
||||
@@ -45,48 +45,40 @@ endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE \
|
||||
-DHAVE_STRERROR_R \
|
||||
-Wall \
|
||||
-D_DM_VENDOR_PREFIX=$(CONFIG_BBF_VENDOR_PREFIX) \
|
||||
-Werror
|
||||
|
||||
CMAKE_OPTIONS += -DCMAKE_INSTALL_PREFIX=/tmp
|
||||
CMAKE_OPTIONS += -DCMAKE_INSTALL_LOCALSTATEDIR=""
|
||||
|
||||
ifneq ($(CONFIG_OBUSPA_CONTROLLER_MTP_VERIFY),)
|
||||
TARGET_CFLAGS += -DOBUSPA_CONTROLLER_MTP_VERIFY
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_OBUSPA_DB_PATH),)
|
||||
CONFIGURE_ARGS += \
|
||||
--localstatedir="$(CONFIG_OBUSPA_DB_PATH)"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OBUSPA_MTP_ENABLE_STOMP),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-stomp
|
||||
CMAKE_OPTIONS += -DENABLE_STOMP=ON
|
||||
else
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-stomp
|
||||
CMAKE_OPTIONS += -DENABLE_STOMP=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OBUSPA_MTP_ENABLE_MQTT),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-mqtt
|
||||
CMAKE_OPTIONS += -DENABLE_MQTT=ON
|
||||
else
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-mqtt
|
||||
CMAKE_OPTIONS += -DENABLE_MQTT=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OBUSPA_MTP_ENABLE_COAP),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-coap
|
||||
CMAKE_OPTIONS += -DENABLE_COAP=ON
|
||||
else
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-coap
|
||||
CMAKE_OPTIONS += -DENABLE_COAP=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OBUSPA_MTP_ENABLE_WEBSOCKETS),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-websockets
|
||||
CMAKE_OPTIONS += -DENABLE_WEBSOCKETS=ON
|
||||
else
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-websockets
|
||||
CMAKE_OPTIONS += -DENABLE_WEBSOCKETS=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
@@ -101,7 +93,6 @@ define Package/obuspa/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/obuspa
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspa $(1)/usr/sbin/
|
||||
@@ -109,12 +100,11 @@ define Package/obuspa/install
|
||||
$(INSTALL_DATA) ./files/etc/config/obuspa $(1)/etc/config/
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/roles.json $(1)/etc/obuspa/roles.json
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/dmcaching_exclude.json $(1)/etc/obuspa/dmcaching_exclude.json
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/json/USPAgent.json $(1)/etc/bbfdm/json/USPAgent.json
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/json/TransferComplete.json $(1)/etc/bbfdm/json/TransferComplete.json
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/00-obuspa-extender-mode $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-upgrade-uci $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/02-obuspa-dhcp-option $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user
|
||||
$(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/USPAgent.json)
|
||||
ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER),y)
|
||||
$(INSTALL_BIN) ./files/etc/init.d/usptest $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/55-test-usp-controller $(1)/etc/uci-defaults/
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
{
|
||||
"Device.LocalAgent.": {
|
||||
"type": "object",
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"access": false,
|
||||
"array": false,
|
||||
"TransferComplete!": {
|
||||
"type": "event",
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"Command": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string"
|
||||
},
|
||||
"CommandKey": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string"
|
||||
},
|
||||
"Requestor": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string"
|
||||
},
|
||||
"TransferType": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"Download",
|
||||
"Upload"
|
||||
]
|
||||
},
|
||||
"Affected": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string"
|
||||
},
|
||||
"TransferURL": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "URL",
|
||||
"range": [
|
||||
{
|
||||
"max": 2048
|
||||
}
|
||||
]
|
||||
},
|
||||
"StartTime": {
|
||||
"type": "dateTime",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "dateTime"
|
||||
},
|
||||
"CompleteTime": {
|
||||
"type": "dateTime",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "dateTime"
|
||||
},
|
||||
"FaultCode": {
|
||||
"type": "unsignedInt",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "unsignedInt"
|
||||
},
|
||||
"FaultString": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"range": [
|
||||
{
|
||||
"max": 256
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ config obuspa 'global'
|
||||
option enabled '1'
|
||||
option debug '1'
|
||||
option dhcp_discovery '1'
|
||||
option log_level '1'
|
||||
option log_level '2'
|
||||
option prototrace '0'
|
||||
option db_file '/etc/obuspa/usp.db'
|
||||
option role_file '/etc/obuspa/roles.json'
|
||||
|
||||
@@ -1033,37 +1033,30 @@ db_init()
|
||||
return 0;
|
||||
}
|
||||
|
||||
register_service()
|
||||
{
|
||||
procd_open_instance ${CONFIGURATION}
|
||||
procd_set_param command ${PROG}
|
||||
|
||||
configure_obuspa
|
||||
procd_set_param respawn \
|
||||
"${respawn_threshold:-10}" \
|
||||
"${respawn_timeout:-10}" "${respawn_retry:-5}"
|
||||
|
||||
procd_set_param watch bbfdm
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enabled
|
||||
|
||||
mkdir -p /tmp/obuspa/
|
||||
config_load obuspa
|
||||
config_get_bool enabled global enabled 0
|
||||
|
||||
if [ "${enabled}" -eq 0 ]; then
|
||||
return 0;
|
||||
procd_open_instance ${CONFIGURATION}
|
||||
if [ "${enabled}" -eq 1 ]; then
|
||||
db_init "${1}"
|
||||
procd_set_param command ${PROG}
|
||||
configure_obuspa
|
||||
procd_set_param respawn \
|
||||
"${respawn_threshold:-10}" \
|
||||
"${respawn_timeout:-10}" "${respawn_retry:-5}"
|
||||
#procd_set_param limits core="unlimited"
|
||||
fi
|
||||
|
||||
mkdir -p /tmp/obuspa/
|
||||
db_init "${1}"
|
||||
register_service
|
||||
procd_close_instance ${CONFIGURATION}
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
${PROG} -c stop >/dev/null 2>&1
|
||||
if command -v timeout >/dev/null 2>&1; then
|
||||
timeout 5 ${PROG} -c stop
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
|
||||
@@ -72,7 +72,8 @@
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
"PERMIT_NONE",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -81,7 +82,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -90,7 +92,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -99,7 +102,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -108,7 +112,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -117,7 +122,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -126,7 +132,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -135,7 +142,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -144,7 +152,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -153,7 +162,9 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -162,7 +173,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -171,7 +183,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -180,7 +193,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -189,7 +203,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -198,7 +213,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -207,7 +223,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -216,7 +233,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -225,7 +243,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -234,7 +253,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -243,7 +263,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -252,7 +273,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -261,7 +283,9 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -270,16 +294,8 @@
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.XMPP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -291,7 +307,8 @@
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_DEL"
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -301,11 +318,9 @@
|
||||
"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"
|
||||
"PERMIT_SUBS_OBJ_DEL"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
12
obuspa/patches/0008-fix_cmake_warning.patch
Normal file
12
obuspa/patches/0008-fix_cmake_warning.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/src/protobuf-c/protobuf-c.c b/src/protobuf-c/protobuf-c.c
|
||||
index 3dc5473..0a6bde7 100644
|
||||
--- a/src/protobuf-c/protobuf-c.c
|
||||
+++ b/src/protobuf-c/protobuf-c.c
|
||||
@@ -1926,6 +1926,7 @@ repeated_field_pack_to_buffer(const ProtobufCFieldDescriptor *field,
|
||||
buffer->append(buffer, rv, scratch);
|
||||
tmp = pack_buffer_packed_payload(field, count, array, buffer);
|
||||
assert(tmp == payload_len);
|
||||
+ (void)tmp; // Keep cmake production build happy
|
||||
return rv + payload_len;
|
||||
} else {
|
||||
size_t siz;
|
||||
@@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspc
|
||||
PKG_VERSION:=1.0.1.5
|
||||
PKG_VERSION:=1.0.1.6
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -61,7 +61,6 @@ define Package/obuspc/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspc $(1)/usr/sbin/uspc
|
||||
$(INSTALL_BIN) ./files/etc/init.d/uspc $(1)/etc/init.d/
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=periodicstats
|
||||
PKG_VERSION:=1.5.2
|
||||
PKG_VERSION:=1.5.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/periodicstats.git
|
||||
PKG_SOURCE_VERSION:=375c71ebaabffa2e47aa37a04e072232492eff25
|
||||
PKG_SOURCE_VERSION:=28bea5be686013af0ba8e54cf4871f10015e4b06
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ponmngr
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.2
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
@@ -14,6 +14,7 @@ PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/ponmngr
|
||||
CATEGORY:=Utilities
|
||||
@@ -39,8 +40,7 @@ ifneq ($(CONFIG_TARGET_brcmbca),)
|
||||
else ifneq ($(CONFIG_TARGET_airoha),)
|
||||
$(CP) ./files/airoha/* $(1)/
|
||||
endif
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(CP) ./files/etc/bbfdm/json/* $(1)/etc/bbfdm/json/
|
||||
$(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/xpon.json)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ponmngr))
|
||||
|
||||
@@ -8,6 +8,7 @@ generate_dns_rule(){
|
||||
uci add qos classify
|
||||
uci rename qos.@classify[-1]="c${classify_no}"
|
||||
uci set qos.@classify[-1].ifname="lo"
|
||||
uci set qos.@classify[-1].all_interfaces="0"
|
||||
uci set qos.@classify[-1].proto="udp"
|
||||
uci set qos.@classify[-1].ethertype="IPv4"
|
||||
uci set qos.@classify[-1].dest_port="53"
|
||||
@@ -20,6 +21,7 @@ generate_dhcp_rule(){
|
||||
uci add qos classify
|
||||
uci rename qos.@classify[-1]="c${classify_no}"
|
||||
uci set qos.@classify[-1].ifname="lo"
|
||||
uci set qos.@classify[-1].all_interfaces="0"
|
||||
uci set qos.@classify[-1].proto="udp"
|
||||
uci set qos.@classify[-1].ethertype="IPv4"
|
||||
uci set qos.@classify[-1].dest_port="67"
|
||||
@@ -33,6 +35,7 @@ generate_igmp_rule(){
|
||||
uci add qos classify
|
||||
uci rename qos.@classify[-1]="c${classify_no}"
|
||||
uci set qos.@classify[-1].ifname="lo"
|
||||
uci set qos.@classify[-1].all_interfaces="0"
|
||||
uci set qos.@classify[-1].proto="IGMP"
|
||||
uci set qos.@classify[-1].ethertype="IPv4"
|
||||
uci set qos.@classify[-1].traffic_class="$1"
|
||||
@@ -44,6 +47,7 @@ generate_icmp_rule(){
|
||||
uci add qos classify
|
||||
uci rename qos.@classify[-1]="c${classify_no}"
|
||||
uci set qos.@classify[-1].ifname="lo"
|
||||
uci set qos.@classify[-1].all_interfaces="0"
|
||||
uci set qos.@classify[-1].proto="icmp"
|
||||
uci set qos.@classify[-1].ethertype="IPv4"
|
||||
uci set qos.@classify[-1].traffic_class="$1"
|
||||
@@ -96,6 +100,7 @@ generate_classify(){
|
||||
uci add qos classify
|
||||
uci rename qos.@classify[-1]="c${classify_no}"
|
||||
uci set qos.@classify[-1].pcp_check="$i"
|
||||
uci set qos.@classify[-1].all_interfaces="0"
|
||||
uci set qos.@classify[-1].traffic_class="$i"
|
||||
uci set qos.@classify[-1].order="$classify_no"
|
||||
done
|
||||
|
||||
@@ -237,15 +237,18 @@ handle_ebtables_rules() {
|
||||
config_get dst_ucid "$sid" "dst_user_class_id" # dhcp option 77
|
||||
config_get traffic_class "$sid" "traffic_class"
|
||||
config_get protocol "$sid" "proto"
|
||||
config_get all_interfaces "$sid" "all_interfaces"
|
||||
|
||||
if [ -n "$src_if" ]; then
|
||||
for interf in $(db -q get hw.board.ethernetPortOrder); do
|
||||
if [ "$src_if" == "$interf" ]; then
|
||||
src_if="$src_if+"
|
||||
broute_filter_on_src_if "$src_if"
|
||||
is_l2_rule=1
|
||||
fi
|
||||
done
|
||||
if [ "$all_interfaces" == "1" ]; then
|
||||
is_l2_rule=1
|
||||
elif [ -n "$src_if" ]; then
|
||||
for interf in $(db -q get hw.board.ethernetPortOrder); do
|
||||
if [ "$src_if" == "$interf" ]; then
|
||||
src_if="$src_if+"
|
||||
broute_filter_on_src_if "$src_if"
|
||||
is_l2_rule=1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -n "$src_mac" ]; then
|
||||
|
||||
@@ -93,6 +93,7 @@ handle_iptables_rules() {
|
||||
config_get ip_len_min "$cid" "ip_len_min"
|
||||
config_get ip_len_max "$cid" "ip_len_max"
|
||||
config_get ifname "$cid" "ifname"
|
||||
config_get all_interfaces "$cid" "all_interfaces"
|
||||
|
||||
#check version of ip
|
||||
case $src_ip$dest_ip in
|
||||
@@ -107,10 +108,10 @@ handle_iptables_rules() {
|
||||
esac
|
||||
|
||||
#filter interface
|
||||
if [ -n "$ifname" ]; then
|
||||
if [ "$ifname" != "lo" ]; then
|
||||
iptables_filter_intf "$ifname"
|
||||
fi
|
||||
if ! [ "$all_interfaces" == "1" ]; then
|
||||
if [ -n "$ifname" -a "$ifname" != "lo" ]; then
|
||||
iptables_filter_intf "$ifname"
|
||||
fi
|
||||
fi
|
||||
|
||||
# filter proto
|
||||
@@ -197,7 +198,9 @@ handle_iptables_rules() {
|
||||
[ -n "$IP_RULE" ] && [ -n "$dscp_mark" ] && append_rule_to_mangle_table "qos_forward" $ip_version
|
||||
|
||||
if [ -n "$IP_RULE" ] && [ -n "$traffic_class" ]; then
|
||||
if [ "$ifname" == "lo" ]; then
|
||||
if [ "all_interfaces" == "1" ]; then
|
||||
append_rule_to_mangle_table "qos_output" $ip_version
|
||||
elif [ "$ifname" == "lo" ]; then
|
||||
#write iptables rule for putting WAN directed internal packets in different queue
|
||||
append_rule_to_mangle_table "qos_output" $ip_version
|
||||
else
|
||||
|
||||
@@ -13,6 +13,7 @@ MAJOR=""
|
||||
POLICER_COUNT=0
|
||||
Q_COUNT=0
|
||||
SP_Q_PRIO=7
|
||||
SOQ_wgt=0
|
||||
|
||||
get_rate_per_queue() {
|
||||
echo "1000000"
|
||||
@@ -22,6 +23,22 @@ get_burst_size_per_queue() {
|
||||
echo "1500"
|
||||
}
|
||||
|
||||
handle_q_weight() {
|
||||
local qid="$1" #queue section ID
|
||||
config_get ifname "$qid" "ifname"
|
||||
# If ifname is empty that is good enough to break
|
||||
if [ -z "$ifname" ];then
|
||||
return
|
||||
fi
|
||||
|
||||
config_get sc_alg "$qid" "scheduling"
|
||||
config_get weight "$qid" "weight"
|
||||
|
||||
if [ "$ifname" == "$2" ] && [ "$sc_alg" == "WRR" ]; then
|
||||
SOQ_wgt=`expr $SOQ_wgt + $weight`
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to handle a queue order and
|
||||
# update total number of queues
|
||||
handle_q_order() {
|
||||
@@ -80,7 +97,8 @@ handle_queue() {
|
||||
local port_bw="$3"
|
||||
local root="$4"
|
||||
local port_bs="$5"
|
||||
local priority=0
|
||||
local par_class="$6"
|
||||
local priority=7
|
||||
config_get is_enable "$qid" "enable"
|
||||
|
||||
# no need to configure disabled queues
|
||||
@@ -120,7 +138,14 @@ handle_queue() {
|
||||
config_get qsize "$qid" "queue_size" 1024
|
||||
|
||||
[ "$rate" == "0" ] && rate="$port_bw"
|
||||
[ "$bs" == "0" ] && bs="$port_bs"
|
||||
|
||||
bs=$(( bs * 8 ))
|
||||
rate_bs=$(( rate * 25 ))
|
||||
if [ $rate_bs -gt $bs ]; then
|
||||
bs=$rate_bs
|
||||
fi
|
||||
# burst size in tc class is given in bytes
|
||||
bs=$(( bs * 1000 ))
|
||||
|
||||
local salg=1
|
||||
|
||||
@@ -135,19 +160,27 @@ handle_queue() {
|
||||
;;
|
||||
esac
|
||||
|
||||
# ignore precedence value in case of WRR, broadcom recommends that WRR queue should
|
||||
# always have precedence value set to 0
|
||||
if [ $salg -ne 2 ]; then
|
||||
priority=$order
|
||||
priority=`expr $priority - $order`
|
||||
|
||||
local ceil_rate=$port_bw
|
||||
if [ "$rate" -lt "$port_bw" ]; then
|
||||
ceil_rate=$rate
|
||||
fi
|
||||
if [ $order -ne 0 ]; then
|
||||
if [ $salg -eq 2 ]; then
|
||||
tc class add dev $port parent ${root}: classid ${root}:$order cbq allot $bs bandwidth ${port_bw}kbit rate ${rate}kbit prio $priority weight $wgt avpkt 1500 bounded isolated
|
||||
else
|
||||
tc class add dev $port parent ${root}: classid ${root}:$order cbq allot $bs bandwidth ${port_bw}kbit rate ${rate}kbit prio $priority avpkt 1500 bounded isolated
|
||||
fi
|
||||
tc filter add dev $port parent ${root}:0 prio $order u32 match mark $order 0xf flowid ${root}:$order
|
||||
|
||||
local cls_priority=`expr $order + 1`
|
||||
cls_priority=${cls_priority}0
|
||||
|
||||
if [ $salg -eq 2 ]; then
|
||||
# maximum quantum value 60000
|
||||
# quantum value calculate based on the configured weight value for the queue
|
||||
quantum=`expr $wgt \* 60000 / $SOQ_wgt`
|
||||
tc class add dev $port parent ${root}:${par_class} classid ${root}:${cls_priority} htb rate ${rate}kbit prio ${priority} ceil ${ceil_rate}kbit quantum ${quantum} burst $bs cburst $port_bs
|
||||
tc qdisc add dev $port parent ${root}:${cls_priority} handle ${cls_priority}: sfq perturb 10
|
||||
else
|
||||
tc class add dev $port parent ${root}:${par_class} classid ${root}:${cls_priority} htb rate ${rate}kbit prio ${priority} ceil ${ceil_rate}kbit burst $bs cburst $port_bs
|
||||
fi
|
||||
tc filter add dev $port parent ${root}:0 prio $order u32 match mark $order 0xf flowid ${root}:${cls_priority}
|
||||
|
||||
Q_COUNT=$((Q_COUNT + 1))
|
||||
}
|
||||
|
||||
@@ -398,10 +431,18 @@ configure_queue() {
|
||||
fi
|
||||
|
||||
rate=$(( rate / 1000 ))
|
||||
|
||||
#burst size is either bitrate*0.00025 or max_packat_size in bit whichever is greater
|
||||
local avg_bs=$(( rate * 25 ))
|
||||
config_get b_size "$sid" "burst_size"
|
||||
if [ "$b_size" == "0" ]; then
|
||||
if [ "$b_size" > "0" ]; then
|
||||
bs="$b_size"
|
||||
fi
|
||||
bs=$(( bs * 8 ))
|
||||
if [ $avg_bs -gt $bs ]; then
|
||||
bs="$avg_bs"
|
||||
fi
|
||||
bs=$(( bs / 1000 ))
|
||||
}
|
||||
local wanport="$(db -q get hw.board.ethernetWanPort)"
|
||||
for interf in $(db -q get hw.board.ethernetPortOrder); do
|
||||
@@ -420,8 +461,15 @@ configure_queue() {
|
||||
rate=$(( link_rate * 1000 ))
|
||||
fi
|
||||
|
||||
# TODO using 1500 as allot and avpkt, if shaper config exist for interf get burst_size of shaper for actual value
|
||||
tc qdisc add dev $interf root handle ${qdisc_idx}: cbq allot $bs avpkt 1500 bandwidth ${rate}kbit
|
||||
p_qdisc_idx=`expr $qdisc_idx + 11`
|
||||
# port shaper needs to add at root tbf qdisc, child class gets token based on rate & burst_size
|
||||
tc qdisc add dev $interf root handle ${p_qdisc_idx}: tbf rate ${rate}kbit burst ${bs}k limit 1M
|
||||
tc qdisc add dev $interf parent ${p_qdisc_idx}: handle ${qdisc_idx}: htb default 10
|
||||
|
||||
local par_class=1
|
||||
tc class add dev $interf parent ${qdisc_idx}: classid ${qdisc_idx}:$par_class htb rate ${rate}kbit prio 8 ceil ${rate}kbit
|
||||
tc filter add dev $interf parent ${qdisc_idx}:0 matchall flowid ${qdisc_idx}:$par_class
|
||||
|
||||
# if qdisc_idx is the index corresponds to WAN port, then
|
||||
# it would be the MAJOR portion of the destination class ID.
|
||||
# under the same qdisc. We are programming for WAN port only.
|
||||
@@ -429,7 +477,11 @@ configure_queue() {
|
||||
MAJOR="$qdisc_idx"
|
||||
fi
|
||||
|
||||
config_foreach handle_queue queue $interf $rate $qdisc_idx $bs
|
||||
#calculate sum of queue weight, to derive the quantum value
|
||||
SOQ_wgt=0
|
||||
config_foreach handle_q_weight queue $interf
|
||||
|
||||
config_foreach handle_queue queue $interf $rate $qdisc_idx $bs $par_class
|
||||
done
|
||||
}
|
||||
|
||||
@@ -453,11 +505,11 @@ configure_policer() {
|
||||
configure_qos() {
|
||||
pre_configure_queue
|
||||
configure_queue
|
||||
configure_policer
|
||||
configure_classify
|
||||
if [ -f "/tmp/qos/classify.ebtables" ]; then
|
||||
sh /tmp/qos/classify.ebtables
|
||||
fi
|
||||
configure_policer
|
||||
}
|
||||
|
||||
reload_qos() {
|
||||
|
||||
35
self-diagnostics/Makefile
Normal file
35
self-diagnostics/Makefile
Normal file
@@ -0,0 +1,35 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=self-diagnostics
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/self-diagnostics
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=System Report
|
||||
DEPENDS:=+@CONFIG_BUSYBOX_CONFIG_TIMEOUT +@CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PATH +@CONFIG_BUSYBOX_CONFIG_TEE \
|
||||
+@CONFIG_BUSYBOX_CONFIG_GZIP
|
||||
endef
|
||||
|
||||
define Package/self-diagnostics/description
|
||||
Generate Self test diagnostics report
|
||||
endef
|
||||
|
||||
#define Build/Prepare
|
||||
# mkdir -p $(PKG_BUILD_DIR)
|
||||
# $(CP) ./files/* $(PKG_BUILD_DIR)/
|
||||
#endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/self-diagnostics/install
|
||||
$(INSTALL_DIR) $(1)/etc/self-diagnostics/spec/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,self-diagnostics))
|
||||
188
self-diagnostics/README.md
Normal file
188
self-diagnostics/README.md
Normal file
@@ -0,0 +1,188 @@
|
||||
# Self Test Diagnostics and Reports
|
||||
|
||||
Self test diagnostics package provides a set of tools and recipes to run diagnostics/commands and collect logs.
|
||||
|
||||
It provides a cli utility called `self-diagnostics`, which executes recipes defined in json files and collect logs.
|
||||
```bash
|
||||
# self-diagnostics -h
|
||||
Generate self diagnostics report
|
||||
|
||||
Syntax: /usr/sbin/self-diagnostics [-m|h|l|j]
|
||||
|
||||
Options:
|
||||
l List available module(s)
|
||||
m Generate system report of specific module(s)
|
||||
j Enable JSON output
|
||||
h Print this help
|
||||
```
|
||||
|
||||
It also has an uci file to configure the various parameters:
|
||||
|
||||
```bash
|
||||
# cat /etc/config/self-diagnostics
|
||||
config globals 'globals'
|
||||
option extended_spec_dir '/etc/self-diagnostics/spec'
|
||||
option exec_timeout '5'
|
||||
option report_name 'self-diagnostics-report-$MODEL-$SERIAL'
|
||||
option verbose '0'
|
||||
option compression_level '9'
|
||||
```
|
||||
|
||||
Here:
|
||||
|
||||
| Options | Description |
|
||||
| ------------------ | ------------------------------- |
|
||||
| extended_spec_dir | Directory path to store 3rd-party/user diagnostics recipes |
|
||||
| exec_timeout | Timeout used for each command |
|
||||
| report_name | Name of the generated report file, here $MODEL and $SERIAL replaced with ProductModel and SerialNumber |
|
||||
| verbose | Logs everythings to logread as well |
|
||||
| commpression_level | Gzip compression_level 0-9, if not set, then report will not gziped |
|
||||
|
||||
|
||||
It also provide, a rpcd script to expose `self-diagnostics` over ubus
|
||||
|
||||
```bash
|
||||
# ubus -v list self-diagnostics
|
||||
'self-diagnostics' @2c0b768d
|
||||
"list":{}
|
||||
"generate":{"modules":"String"}
|
||||
```
|
||||
|
||||
## Recipe(s)
|
||||
|
||||
It has core modules and extended modules.
|
||||
|
||||
Core module recipes are present in `/usr/share/self-diagnostics/spec/` path, where as
|
||||
extended module recipes are defined in uci option 'self-diagnostics.globals.extended_spec_dir'
|
||||
|
||||
Both the spec directories has recipes to run diagnostics and collect logs, these recipes are defined in json files.
|
||||
|
||||
```bash
|
||||
# ls /usr/share/self-diagnostics/spec/
|
||||
config.json network.json trx69.json wifi.json
|
||||
multiap.json system.json voice.json
|
||||
```
|
||||
|
||||
Each json file need to follow below structure:
|
||||
|
||||
```json
|
||||
{
|
||||
"description": "<Description of module>",
|
||||
"dependency": [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "<filepath>"
|
||||
}
|
||||
],
|
||||
"exec": [
|
||||
{
|
||||
"description": "<Description of command>",
|
||||
"cmd": "<command To Execute>",
|
||||
"dependency": [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "<filepath>"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "<Next command description>",
|
||||
"cmd": "<command to execute>"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## How to use
|
||||
|
||||
This can be run from command line, ubus , USP-Controller and ACS.
|
||||
|
||||
### List available core/extension modules
|
||||
|
||||
```bash
|
||||
# self-diagnostics -l
|
||||
|
||||
Core Module(s):
|
||||
- config
|
||||
- multiap
|
||||
- network
|
||||
- system
|
||||
- trx69
|
||||
- voice
|
||||
- wifi
|
||||
|
||||
Extension Module(s):
|
||||
```
|
||||
|
||||
### Run and collect logs
|
||||
|
||||
```bash
|
||||
# self-diagnostics
|
||||
/tmp/self-diagnostics-report-EX600-Y.0721140081.tar.gz
|
||||
```
|
||||
|
||||
### List available core/extension modules over ubus
|
||||
|
||||
```bash
|
||||
# ubus call self-diagnostics list
|
||||
{
|
||||
"CoreModules": [
|
||||
"config",
|
||||
"multiap",
|
||||
"network",
|
||||
"system",
|
||||
"trx69",
|
||||
"voice",
|
||||
"wifi"
|
||||
],
|
||||
"ExtensionModules": [
|
||||
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Run specific module from ubus
|
||||
|
||||
```bash
|
||||
# ubus call self-diagnostics generate '{"modules":"config"}'
|
||||
{
|
||||
"result": "/tmp/self-diagnostics-report-EX600-Y.0721140081.tar.gz"
|
||||
}
|
||||
```
|
||||
|
||||
## TR-181 Integration
|
||||
|
||||
|
||||
TR-181 (USP) provides an Operate command `Device.SelfTestDiagnostics()` to execute it from USP-controllers.
|
||||
TR-181 (CWMP) provides a diagnostics object `Device.SelfTestDiagnostics.` for the same, so its can be triggered from ACS as well.
|
||||
|
||||
```bash
|
||||
# ubus call bbfdm operate '{"command":"Device.SelfTestDiagnostics()"}'
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"path": "Device.SelfTestDiagnostics()",
|
||||
"data": "",
|
||||
"output": [
|
||||
{
|
||||
"Results": "Device.DeviceInfo.VendorLogFile.2",
|
||||
"Status": "Complete"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Once the opreate command is done, it generate a new entry in VendorLogFile, like below:
|
||||
|
||||
```bash
|
||||
# bbfdmd -c get Device.DeviceInfo.VendorLogFile.2.
|
||||
Device.DeviceInfo.VendorLogFile.2.Alias => cpe-2
|
||||
Device.DeviceInfo.VendorLogFile.2.Name => /tmp/self-diagnostics-report-EX600-Y.0721140081.tar.gz
|
||||
Device.DeviceInfo.VendorLogFile.2.MaximumSize => 0
|
||||
Device.DeviceInfo.VendorLogFile.2.Persistent => 0
|
||||
```
|
||||
|
||||
Which is then can be uploaded to a server using `Device.DeviceInfo.VendorLogFile.{i}.Upload()` operate command.
|
||||
6
self-diagnostics/files/etc/config/self-diagnostics
Normal file
6
self-diagnostics/files/etc/config/self-diagnostics
Normal file
@@ -0,0 +1,6 @@
|
||||
config globals 'globals'
|
||||
option extended_spec_dir '/etc/self-diagnostics/spec'
|
||||
option exec_timeout '5'
|
||||
option report_name 'self-diagnostics-report-$MODEL-$SERIAL'
|
||||
option verbose '0'
|
||||
option compression_level '9'
|
||||
28
self-diagnostics/files/usr/libexec/rpcd/self-diagnostics
Executable file
28
self-diagnostics/files/usr/libexec/rpcd/self-diagnostics
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
BIN="/usr/sbin/self-diagnostics"
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
echo '{"list": {}, "generate" : {"modules":"String"}}'
|
||||
;;
|
||||
call)
|
||||
case "$2" in
|
||||
generate)
|
||||
read -t 1 -r input
|
||||
|
||||
json_load "${input}"
|
||||
json_get_var modules modules
|
||||
if [ -z "${modules}" ]; then
|
||||
${BIN} -j
|
||||
else
|
||||
${BIN} -j -m "${modules}"
|
||||
fi
|
||||
;;
|
||||
list)
|
||||
${BIN} -j -l
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
383
self-diagnostics/files/usr/sbin/self-diagnostics
Executable file
383
self-diagnostics/files/usr/sbin/self-diagnostics
Executable file
@@ -0,0 +1,383 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
JSON_OUT=0
|
||||
SPEC_DIR="/usr/share/self-diagnostics/spec"
|
||||
SPEC_EXT_DIR="/etc/self-diagnostics/spec"
|
||||
REPORT_DIR="$(mktemp -d)"
|
||||
REPORT_NAME="self-test-diagnostics"
|
||||
VERBOSE=0
|
||||
COMPOPTS=""
|
||||
TIMEOUT=5
|
||||
|
||||
cleanup()
|
||||
{
|
||||
[ -d "${REPORT_DIR}" ] && \
|
||||
rm -rf ${REPORT_DIR}
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
help()
|
||||
{
|
||||
echo "Generate self diagnostics report"
|
||||
echo
|
||||
echo "Syntax: $0 [-m|h|l|j]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " l List available module(s)"
|
||||
echo " m Generate system report of specific module(s)"
|
||||
echo " j Enable JSON output"
|
||||
echo " h Print this help"
|
||||
echo
|
||||
}
|
||||
|
||||
log()
|
||||
{
|
||||
log_file="${REPORT_DIR}/execution.log"
|
||||
if [ "$VERBOSE" -eq 1 ]; then
|
||||
logger -t $0 "$*"
|
||||
fi
|
||||
echo "[$(date +%Y:%m:%d-%H:%M:%S)] $*" >> ${log_file}
|
||||
}
|
||||
|
||||
# Alias ubus to have a smaller 5-second timeout on all subsequent calls
|
||||
ubus()
|
||||
{
|
||||
if [ "${1}" == "call" ]; then
|
||||
if command ubus list $2 >/dev/null 2>&1; then
|
||||
command ubus "$@";
|
||||
fi
|
||||
else
|
||||
command ubus "$@";
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
config_load()
|
||||
{
|
||||
local temp
|
||||
local MODEL SERIAL
|
||||
|
||||
log "# Starting Self diagnostics tests #"
|
||||
|
||||
MODEL="$(db get device.deviceinfo.ModelName)"
|
||||
SERIAL="$(db get device.deviceinfo.SerialNumber)"
|
||||
|
||||
temp="$(uci -q get self-diagnostics.globals.extended_spec_dir)"
|
||||
[ -d "${temp}" ] && \
|
||||
SPEC_EXT_DIR="${temp}"
|
||||
|
||||
temp="$(uci -q get self-diagnostics.globals.exec_timeout)"
|
||||
[ -n "${temp}" ] && \
|
||||
TIMEOUT="${temp}"
|
||||
|
||||
temp="$(uci -q get self-diagnostics.globals.report_name)"
|
||||
[ -n "${temp}" ] && \
|
||||
REPORT_NAME="$(eval echo ${temp})"
|
||||
|
||||
REPORT_NAME="${REPORT_NAME//[ \/]/_}"
|
||||
|
||||
temp="$(uci -q get self-diagnostics.globals.compression_level)"
|
||||
[ -n "${temp}" ] && \
|
||||
COMPOPTS="${temp}"
|
||||
|
||||
temp="$(uci -q get self-diagnostics.globals.verbose)"
|
||||
[ -n "${temp}" ] && \
|
||||
VERBOSE="${temp}"
|
||||
}
|
||||
|
||||
exec_spec()
|
||||
{
|
||||
local json_file exec_skip name timeout exec_timeout rc
|
||||
|
||||
json_file="$1"
|
||||
[ -z "$json_file" ] && {
|
||||
log "No/invalid spec json_file"
|
||||
return 1
|
||||
}
|
||||
|
||||
log "Loading $json_file ..."
|
||||
|
||||
json_init
|
||||
json_load_file "${json_file}" || {
|
||||
log "Failed to load ${json_file} spec file"
|
||||
return 1
|
||||
}
|
||||
|
||||
name="$(basename ${json_file})"
|
||||
export_path="${REPORT_DIR}/${name//.json/.log}"
|
||||
|
||||
exec_skip=0
|
||||
if json_is_a dependency array; then
|
||||
json_select "dependency"
|
||||
json_get_keys ekeys
|
||||
|
||||
for key in $ekeys; do
|
||||
if json_is_a $key object; then
|
||||
json_select $key
|
||||
json_get_var type type
|
||||
|
||||
if [ "$type" == "file" ]; then
|
||||
json_get_var file file
|
||||
if [ ! -e "$file" ]; then
|
||||
log "${json_file} has unmet file dependency $file"
|
||||
exec_skip=1
|
||||
json_select ..
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
json_select ..
|
||||
fi
|
||||
done
|
||||
json_select ..
|
||||
fi
|
||||
|
||||
[ "${exec_skip}" -eq 1 ] && {
|
||||
log "Dependency not satisfied for ${json_file}"
|
||||
return 0
|
||||
}
|
||||
|
||||
json_get_var description description
|
||||
log "Description: $description"
|
||||
|
||||
if json_is_a exec array; then
|
||||
json_select "exec"
|
||||
json_get_keys keys
|
||||
|
||||
for key in $keys; do
|
||||
if json_is_a $key object; then
|
||||
json_select $key
|
||||
cmd_skip=0
|
||||
if json_is_a dependency array; then
|
||||
json_select "dependency"
|
||||
json_get_keys d_keys
|
||||
|
||||
for d_key in $d_keys; do
|
||||
if json_is_a $d_key object; then
|
||||
json_select $d_key
|
||||
json_get_var type type
|
||||
if [ "$type" == "file" ]; then
|
||||
json_get_var file file
|
||||
if [ ! -e $file ]; then
|
||||
json_select ..
|
||||
cmd_skip=1
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
json_select ..
|
||||
fi
|
||||
done
|
||||
json_select ..
|
||||
fi
|
||||
|
||||
[ $cmd_skip -eq 1 ] && {
|
||||
json_select ..
|
||||
log "Dependency not satisfied for ${file}"
|
||||
continue
|
||||
}
|
||||
|
||||
json_get_var description description
|
||||
json_get_var cmd cmd
|
||||
json_get_var timeout timeout
|
||||
|
||||
if [ -n "$timeout" ]; then
|
||||
exec_timeout=$timeout
|
||||
else
|
||||
exec_timeout=$TIMEOUT
|
||||
fi
|
||||
log "Executing $cmd with timeout $exec_timeout"
|
||||
echo "##########################################" >> $export_path
|
||||
echo "# $description #">> $export_path
|
||||
echo "# Exec [$cmd], timeout [$exec_timeout] #" >> $export_path
|
||||
echo "##########################################" >> $export_path
|
||||
if [ "$VERBOSE" -eq 1 ]; then
|
||||
if [[ "$cmd" == *"logread "* ]]; then
|
||||
eval timeout ${exec_timeout} $cmd 2>&1 | tee -a $export_path
|
||||
rc=$?
|
||||
else
|
||||
eval timeout ${exec_timeout} $cmd 2>&1 | tee -a $export_path | logger -t self-diagnostics
|
||||
rc=$?
|
||||
fi
|
||||
else
|
||||
eval timeout ${exec_timeout} $cmd >> $export_path 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
echo "######## Execution return code $rc ######" >> $export_path
|
||||
|
||||
if [ "$rc" -eq 0 ]; then
|
||||
log "Execution [$cmd] completed"
|
||||
else
|
||||
log "Execution [$cmd] Failed/Timeout with $rc exit code"
|
||||
fi
|
||||
|
||||
echo >> $export_path
|
||||
json_select ..
|
||||
fi
|
||||
done
|
||||
json_select ..
|
||||
fi
|
||||
|
||||
log "Handling of $json_file done"
|
||||
log ""
|
||||
}
|
||||
|
||||
generate_module()
|
||||
{
|
||||
local modules="${@}"
|
||||
local file module
|
||||
|
||||
config_load
|
||||
|
||||
log "Modules [$@]"
|
||||
for module in $modules; do
|
||||
module="${module/.json/}"
|
||||
file="$(find $SPEC_DIR -type f -name ${module}.json)"
|
||||
[ -z "$file" ] && {
|
||||
[ -d "${SPEC_EXT_DIR}" ] && \
|
||||
file="$(find $SPEC_EXT_DIR -type f -name ${module}.json)"
|
||||
}
|
||||
|
||||
[ -f "$file" ] && \
|
||||
exec_spec "$file"
|
||||
done
|
||||
}
|
||||
|
||||
generate_all()
|
||||
{
|
||||
local files
|
||||
|
||||
config_load
|
||||
|
||||
files="$(find ${SPEC_DIR} -type f -name *.json)"
|
||||
[ -d "${SPEC_EXT_DIR}" ] && \
|
||||
files="${files} $(find $SPEC_EXT_DIR -type f -name *.json)"
|
||||
|
||||
[ -z "$files" ] && {
|
||||
return 0
|
||||
}
|
||||
|
||||
for file in $files; do
|
||||
exec_spec "$file"
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
list_modules()
|
||||
{
|
||||
local files
|
||||
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_init
|
||||
json_add_array "CoreModules"
|
||||
else
|
||||
echo
|
||||
echo "Core Module(s):"
|
||||
fi
|
||||
|
||||
cd ${SPEC_DIR} && {
|
||||
for file in $(ls); do
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_add_string "" "${file/.json/}"
|
||||
else
|
||||
echo " - ${file/.json/}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_close_array
|
||||
json_add_array "ExtensionModules"
|
||||
else
|
||||
echo
|
||||
echo "Extension Module(s):"
|
||||
fi
|
||||
|
||||
cd ${SPEC_EXT_DIR} && {
|
||||
for file in $(ls); do
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_add_string "" "${file/.json/}"
|
||||
else
|
||||
echo " - ${file/.json/}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_close_array
|
||||
json_dump
|
||||
else
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
generate_report()
|
||||
{
|
||||
local filename report_path
|
||||
|
||||
report_path="$(dirname "${REPORT_DIR}")"
|
||||
filename="${report_path}/${REPORT_NAME}"
|
||||
|
||||
[ -f "${filename}.tar" ] && rm "${filename}.tar"
|
||||
[ -f "${filename}.tar.gz" ] && rm "${filename}.tar.gz"
|
||||
|
||||
log "# Report generation completed #"
|
||||
cd ${REPORT_DIR} && {
|
||||
filename="${filename}.tar"
|
||||
tar -cf "${filename}" *
|
||||
}
|
||||
|
||||
rm -r "$REPORT_DIR"
|
||||
|
||||
if [ -n "$COMPOPTS" ]; then
|
||||
gzip -${COMPOPTS} -f "${filename}"
|
||||
filename="${filename}.gz"
|
||||
fi
|
||||
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_init
|
||||
json_add_string result "${filename}"
|
||||
json_dump
|
||||
else
|
||||
echo "${filename}"
|
||||
fi
|
||||
}
|
||||
|
||||
[ ! -d "${SPEC_DIR}" ] && {
|
||||
log "# ${SPEC_DIR} does not exits"
|
||||
exit 1
|
||||
}
|
||||
|
||||
list=0
|
||||
modules=""
|
||||
|
||||
while getopts "m:hlj" opts; do
|
||||
case $opts in
|
||||
h)
|
||||
help
|
||||
exit;;
|
||||
j)
|
||||
JSON_OUT=1
|
||||
;;
|
||||
l)
|
||||
list=1
|
||||
;;
|
||||
m)
|
||||
modules="$modules ${OPTARG}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "${list}" -eq 1 ]; then
|
||||
list_modules
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "${modules}" ]; then
|
||||
generate_all
|
||||
else
|
||||
generate_module ${modules}
|
||||
fi
|
||||
|
||||
generate_report
|
||||
@@ -0,0 +1,11 @@
|
||||
interfaces=$(uci show wireless | grep "ifname=" | awk -F'[.,=]' '{print$2}')
|
||||
for int in $interfaces; do
|
||||
mode=$(uci get "wireless.${int}.mode")
|
||||
if [ "$mode" = "ap" ] ; then
|
||||
ap_int=$(uci get "wireless.${int}.ifname")
|
||||
echo "Get assoc list for ${ap_int}"
|
||||
ubus call "wifi.ap.${ap_int}" assoclist
|
||||
echo "Get station info for ${ap_int}"
|
||||
ubus call "wifi.ap.${ap_int}" stations
|
||||
fi
|
||||
done
|
||||
@@ -0,0 +1,5 @@
|
||||
for radio_if in $(ubus list 'wifi.radio.*'); do
|
||||
ubus call "${radio_if}" scan
|
||||
sleep 2
|
||||
ubus call "${radio_if}" scanresults
|
||||
done
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"description": "Gathering configuration data",
|
||||
"exec" : [
|
||||
{
|
||||
"description": "OS Release",
|
||||
"cmd": "cat /etc/os-release"
|
||||
},
|
||||
{
|
||||
"description": "Installed Packages",
|
||||
"cmd": "opkg list-installed"
|
||||
},
|
||||
{
|
||||
"description": "Database",
|
||||
"cmd": "db export"
|
||||
},
|
||||
{
|
||||
"description": "Configuration",
|
||||
"cmd": "uci export"
|
||||
},
|
||||
{
|
||||
"description": "Runtime Configuration",
|
||||
"cmd": "cat /var/state/*"
|
||||
},
|
||||
{
|
||||
"description": "Firmware Environment",
|
||||
"cmd": "fw_printenv"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"description": "Gathering EasyMesh state",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/mapagent"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/ieee1905"
|
||||
}
|
||||
],
|
||||
"exec" : [
|
||||
{
|
||||
"description": "Hosts Show",
|
||||
"cmd": "ubus call hosts show"
|
||||
},
|
||||
{
|
||||
"description": "Hosts Dump",
|
||||
"cmd": "ubus call hosts dump"
|
||||
},
|
||||
{
|
||||
"description": "IEEE1905 Info",
|
||||
"cmd": "ubus call ieee1905 info"
|
||||
},
|
||||
{
|
||||
"description": "IEEE1905 Links",
|
||||
"cmd": "ubus call ieee1905 links"
|
||||
},
|
||||
{
|
||||
"description": "IEEE1905 Neighbors",
|
||||
"cmd": "ubus call ieee1905 neighbors"
|
||||
},
|
||||
{
|
||||
"description": "IEEE1905 Others",
|
||||
"cmd": "ubus call ieee1905 others"
|
||||
},
|
||||
{
|
||||
"description": "IEEE1905 Topology",
|
||||
"cmd": "ubus call ieee1905.topology dump"
|
||||
},
|
||||
{
|
||||
"description": "MAP Agent Info",
|
||||
"cmd": "ubus call map.agent info"
|
||||
},
|
||||
{
|
||||
"description": "MAP Agent Status",
|
||||
"cmd": "ubus call map.agent status"
|
||||
},
|
||||
{
|
||||
"description": "MAP Agent Backhaul Info",
|
||||
"cmd": "ubus call map.agent backhaul_info"
|
||||
},
|
||||
{
|
||||
"description": "MAP Controller Status",
|
||||
"cmd": "ubus call map.controller status"
|
||||
},
|
||||
{
|
||||
"description": "MAP Controller List MACs",
|
||||
"cmd": "ubus call map.controller.dbg list_macs"
|
||||
},
|
||||
{
|
||||
"description": "MAP Controller BH Topology Dump",
|
||||
"cmd": "ubus call map.controller.dbg bh_topology_dump"
|
||||
},
|
||||
{
|
||||
"description": "Data Elements Dump",
|
||||
"cmd": "ubus call wifi.dataelements.collector refresh; sleep 2; ubus call wifi.dataelements.collector dump2"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"description": "Gathering network state",
|
||||
"exec" : [
|
||||
{
|
||||
"description": "Network Device Status",
|
||||
"cmd": "ubus call network.device status"
|
||||
},
|
||||
{
|
||||
"description": "Network Interface Dump",
|
||||
"cmd": "ubus call network.interface dump"
|
||||
},
|
||||
{
|
||||
"description": "Linux Network Interface Config",
|
||||
"cmd": "ifconfig -a"
|
||||
},
|
||||
{
|
||||
"description": "IPv4 Routes",
|
||||
"cmd": "ip -d r"
|
||||
},
|
||||
{
|
||||
"description": "IPv6 Routes",
|
||||
"cmd": "ip -d -6 r"
|
||||
},
|
||||
{
|
||||
"description": "Neighbor Table",
|
||||
"cmd": "ip n"
|
||||
},
|
||||
{
|
||||
"description": "ARP Table",
|
||||
"cmd": "cat /proc/net/arp"
|
||||
},
|
||||
{
|
||||
"description": "Conntrack Table",
|
||||
"cmd": "cat /proc/net/nf_conntrack"
|
||||
},
|
||||
{
|
||||
"description": "Network Interface Status",
|
||||
"cmd": "ip -d a"
|
||||
},
|
||||
{
|
||||
"description": "IPv4 Firewall Status",
|
||||
"cmd": "iptables -xvnL"
|
||||
},
|
||||
{
|
||||
"description": "IPv6 Firewall Status",
|
||||
"cmd": "ip6tables -xvnL"
|
||||
},
|
||||
{
|
||||
"description": "Bridge Info",
|
||||
"cmd": "brctl show"
|
||||
},
|
||||
{
|
||||
"description": "Bridge Link",
|
||||
"cmd": "bridge link"
|
||||
},
|
||||
{
|
||||
"description": "Bridge VLAN",
|
||||
"cmd": "bridge vlan"
|
||||
},
|
||||
{
|
||||
"description": "Bridge FDB",
|
||||
"cmd": "bridge fdb"
|
||||
},
|
||||
{
|
||||
"description": "TCP listened ports",
|
||||
"cmd": "netstat -tlnp"
|
||||
},
|
||||
{
|
||||
"description": "UDP listened ports",
|
||||
"cmd": "netstat -ulnp"
|
||||
},
|
||||
{
|
||||
"description": "MAC layer firewall status list",
|
||||
"cmd": "ebtables -L"
|
||||
},
|
||||
{
|
||||
"description": "MAC layer firewall status",
|
||||
"cmd": "ebtables -t broute -L"
|
||||
},
|
||||
{
|
||||
"description": "QoS queue stats",
|
||||
"cmd": "ubus call qos queue_stats"
|
||||
},
|
||||
{
|
||||
"description": "IGMP Snooping Table",
|
||||
"cmd": "ubus call mcast stats"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"description": "Gathering system information",
|
||||
"exec" : [
|
||||
{
|
||||
"description": "Firmware banks",
|
||||
"cmd": "ubus call fwbank dump"
|
||||
},
|
||||
{
|
||||
"description": "System Info",
|
||||
"cmd": "ubus call system info"
|
||||
},
|
||||
{
|
||||
"description": "Board Info",
|
||||
"cmd": "ubus call system board"
|
||||
},
|
||||
{
|
||||
"description": "Running Processes",
|
||||
"cmd": "top -b -n 1"
|
||||
},
|
||||
{
|
||||
"description": "Kernel Parameters",
|
||||
"cmd": "sysctl -A 2>/dev/null"
|
||||
},
|
||||
{
|
||||
"description": "System Log",
|
||||
"cmd": "timeout 5 logread -l 1000"
|
||||
},
|
||||
{
|
||||
"description": "Driver Message",
|
||||
"cmd": "timeout 5 dmesg"
|
||||
},
|
||||
{
|
||||
"description": "PCI Devices",
|
||||
"cmd": "lspci -k"
|
||||
},
|
||||
{
|
||||
"description": "Installed Modules",
|
||||
"cmd": "lsmod"
|
||||
},
|
||||
{
|
||||
"description": "CPU Info",
|
||||
"cmd": "cat /proc/cpuinfo"
|
||||
},
|
||||
{
|
||||
"description": "Memory Info",
|
||||
"cmd": "cat /proc/meminfo"
|
||||
},
|
||||
{
|
||||
"description": "Slab Info",
|
||||
"cmd": "cat /proc/slabinfo"
|
||||
},
|
||||
{
|
||||
"description": "eMMC Partition/Volume Info",
|
||||
"cmd": "fdisk -l",
|
||||
"dependency" : {
|
||||
"file": "/sbin/fdisk"
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "NAND Partition/Volume Info",
|
||||
"cmd": "ubinfo --all",
|
||||
"dependency" : {
|
||||
"file": "/usr/sbin/ubinfo"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"description": "Gathering TR-x69 state",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/cwmp"
|
||||
}
|
||||
],
|
||||
"exec" : [
|
||||
{
|
||||
"description": "TR-181 DM MAP",
|
||||
"cmd": "uci -c /etc/bbfdm/dmmap export"
|
||||
},
|
||||
{
|
||||
"description": "TR-181 Parameters via BBFDM",
|
||||
"cmd": "bbfdmd -c get Device."
|
||||
},
|
||||
{
|
||||
"description": "TR-181 Parameters via CWMP",
|
||||
"cmd": "icwmpd -c get Device."
|
||||
},
|
||||
{
|
||||
"description": "TR-069 status",
|
||||
"cmd": "ubus call tr069 status"
|
||||
},
|
||||
{
|
||||
"description": "TR-069 Logs",
|
||||
"cmd": "cat /var/log/icwmpd.log",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/var/log/icwmpd.log"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "TR-181 Parameters via USP",
|
||||
"cmd": "obuspa -c get Device.",
|
||||
"timeout": 10
|
||||
},
|
||||
{
|
||||
"description": "USP Agent Database",
|
||||
"cmd": "obuspa -f $(uci -q get obuspa.global.db_file) -c show database"
|
||||
},
|
||||
{
|
||||
"description": "USP Logs",
|
||||
"cmd": "cat /var/log/obuspa.log",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/var/log/obuspa.log"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"description": "Gathering Voice state",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/asterisk"
|
||||
}
|
||||
],
|
||||
"exec" : [
|
||||
{
|
||||
"description": "Endpoint Status",
|
||||
"cmd": "ubus call endpt status"
|
||||
},
|
||||
{
|
||||
"description": "Endpoint Count",
|
||||
"cmd": "ubus call endpt count"
|
||||
},
|
||||
{
|
||||
"description": "Voice Status",
|
||||
"cmd": "ubus call voice.asterisk status"
|
||||
},
|
||||
{
|
||||
"description": "DECT Status",
|
||||
"cmd": "ubus call dect status",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/dect"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "DECT Handsets",
|
||||
"cmd": "ubus call dect handsets",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/dect"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"description": "Gathering WiFi state",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/sys/class/ieee80211"
|
||||
}
|
||||
],
|
||||
"exec" : [
|
||||
{
|
||||
"description": "Wireless Status",
|
||||
"cmd": "ubus call network.wireless status"
|
||||
},
|
||||
{
|
||||
"description": "Wireless Radio Status",
|
||||
"cmd": "ubus call wifi status"
|
||||
},
|
||||
{
|
||||
"description": "Get radio scan",
|
||||
"cmd": "sh /usr/share/self-diagnostics/helper/wifi_radio_scan.sh"
|
||||
},
|
||||
{
|
||||
"description": "Get Assoc List",
|
||||
"cmd": "sh /usr/share/self-diagnostics/helper/wifi_assoclist.sh"
|
||||
},
|
||||
{
|
||||
"description": "iwinfo interface details",
|
||||
"cmd": "/usr/bin/iwinfo"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=stunc
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.3.1
|
||||
PKG_VERSION:=1.3.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -23,6 +23,7 @@ PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
@@ -100,11 +101,10 @@ define Package/stunc/default/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/libstunc.so $(1)/usr/lib/bbfdm/libstunc.so
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/stunc $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/stunc $(1)/etc/init.d/stunc
|
||||
$(INSTALL_DATA) ./files/etc/config/stunc $(1)/etc/config/stunc
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/src/libstunc.so)
|
||||
endef
|
||||
|
||||
Package/stunc/install = $(Package/stunc/default/install)
|
||||
|
||||
@@ -69,8 +69,8 @@ PKG_MIRROR_HASH:=skip
|
||||
SULU_PLUGIN_INSTALL:=1
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/sulu/config/widgets
|
||||
$(CP) $(PKG_BUILD_DIR)/src/config/widgets/lcm-store.json $(1)/sulu/config/widgets/
|
||||
$(INSTALL_DIR) $(1)/<install_path>
|
||||
$(CP) $(PKG_BUILD_DIR)/<source_path>/lcm-store.json $(1)/<install_path>/
|
||||
endef
|
||||
|
||||
include ../sulu-builder/sulu.mk
|
||||
|
||||
@@ -5,21 +5,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-base
|
||||
PKG_VERSION:=3.1.7
|
||||
PKG_VERSION:=3.1.26
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
|
||||
PKG_SOURCE_VERSION:=f9b7325a81d3cd43a683cfb2b01fd1ef35e58c70
|
||||
PKG_SOURCE_VERSION:=403f4513a19e80ae5c753d40e37a2b6d1843376e
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
SULU_MOD:=core
|
||||
include ../sulu-builder/sulu.mk
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/sulu/config/widgets
|
||||
$(CP) $(PKG_BUILD_DIR)/src/config/*.json $(1)/sulu/config/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/config/widgets/diagnostics.json $(1)/sulu/config/widgets/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/config/widgets/wan.json $(1)/sulu/config/widgets/
|
||||
endef
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-builder
|
||||
PKG_VERSION:=3.1.7
|
||||
PKG_VERSION:=3.1.26
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-builder.git
|
||||
PKG_SOURCE_VERSION:=bdda8098426361b6e703dad3b26f38fad78a3841
|
||||
PKG_SOURCE_VERSION:=7e39aba959cd01e518ad039729ac807dcb25bd1e
|
||||
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)
|
||||
@@ -71,6 +71,14 @@ define Package/sulu/config
|
||||
help
|
||||
Provide directory path for the certficates for PWA,
|
||||
directory must contain 'pwa.crt' and 'pwa.key'.
|
||||
|
||||
config SULU_EXPERIMENTAL_WIDGETS
|
||||
depends on PACKAGE_sulu
|
||||
bool "Enable SULU under developement widget"
|
||||
default n
|
||||
help
|
||||
Enable SULU Widgets which are under developement.
|
||||
|
||||
endef
|
||||
|
||||
define Package/sulu-builder/config
|
||||
@@ -95,6 +103,14 @@ define Package/sulu-builder/config
|
||||
help
|
||||
Provide directory path for the certficates for PWA,
|
||||
directory must contain 'pwa.crt' and 'pwa.key'.
|
||||
|
||||
config SULU_EXPERIMENTAL_WIDGETS
|
||||
depends on PACKAGE_sulu-builder
|
||||
bool "Enable SULU under developement widget"
|
||||
default n
|
||||
help
|
||||
Enable SULU Widgets which are under developement.
|
||||
|
||||
endef
|
||||
|
||||
ifeq ($(BUILD_VARIANT),builder)
|
||||
@@ -135,31 +151,30 @@ ifeq ($(CONFIG_SULU_PWA_APP),y)
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/sulu/install
|
||||
$(Package/sulu/install/Default)
|
||||
$(CP) $(PKG_BUILD_DIR)/dist/* $(1)/sulu
|
||||
ifneq ($(CONFIG_SULU_PWA_APP),y)
|
||||
$(CP) $(PKG_BUILD_DIR)/dist/nonPWA.html $(1)/sulu/index.html
|
||||
endif
|
||||
define Package/sulu/install/Post
|
||||
# Post install cleanup
|
||||
ifneq ($(CONFIG_PACKAGE_skopeo)$(CONFIG_PACKAGE_umoci),yy)
|
||||
$(RM) $(1)/sulu/presets/lcm-store.json
|
||||
endif
|
||||
ifneq ($(CONFIG_SULU_EXPERIMENTAL_WIDGETS),y)
|
||||
$(RM) $(1)/sulu/presets/mesh-onboarding-instructions.json
|
||||
endif
|
||||
ifneq ($(CONFIG_SULU_PWA_APP),y)
|
||||
$(CP) $(PKG_BUILD_DIR)/dist/nonPWA.html $(1)/sulu/index.html
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/sulu/install
|
||||
$(Package/sulu/install/Default)
|
||||
$(CP) $(PKG_BUILD_DIR)/dist/* $(1)/sulu
|
||||
$(Package/sulu/install/Post)
|
||||
endef
|
||||
|
||||
|
||||
define Package/sulu-builder/install
|
||||
$(Package/sulu/install/Default)
|
||||
$(INSTALL_DIR) $(1)/sulu/presets
|
||||
$(INSTALL_DIR) $(1)/sulu/settings
|
||||
$(CP) $(PKG_BUILD_DIR)/build/dist/* $(1)/sulu
|
||||
ifneq ($(CONFIG_SULU_PWA_APP),y)
|
||||
$(CP) $(PKG_BUILD_DIR)/build/dist/nonPWA.html $(1)/sulu/index.html
|
||||
endif
|
||||
$(CP) $(PKG_BUILD_DIR)/build/device/presets/*.json $(1)/sulu/presets/
|
||||
$(CP) $(PKG_BUILD_DIR)/build/device/settings/*.json $(1)/sulu/settings/
|
||||
ifneq ($(CONFIG_PACKAGE_skopeo)$(CONFIG_PACKAGE_umoci),yy)
|
||||
$(RM) $(1)/sulu/presets/lcm-store.json
|
||||
endif
|
||||
$(Package/sulu/install/Post)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,sulu-builder))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
config global 'global'
|
||||
option role_based_access '1'
|
||||
option SessionMode 'Require'
|
||||
option SessionMode 'Allow'
|
||||
list user 'admin'
|
||||
list user 'user'
|
||||
|
||||
@@ -22,24 +22,24 @@ add_sulu_nginx_uci()
|
||||
fi
|
||||
|
||||
# To host on http, disable _suluredirect and enable _sulu_http
|
||||
if ! uci_get nginx _suluredirect >/dev/null 2>&1; then
|
||||
uci_add nginx server _suluredirect
|
||||
uci_add_list nginx _suluredirect listen "8080"
|
||||
uci_add_list nginx _suluredirect listen "[::]:8080"
|
||||
uci_set nginx _suluredirect server_name '_suluredirect'
|
||||
uci_set nginx _suluredirect return '302 https://$host:8443$request_uri'
|
||||
fi
|
||||
|
||||
# if ! uci_get nginx _sulu_http >/dev/null 2>&1; then
|
||||
# uci_add nginx server _sulu_http
|
||||
# uci_set nginx _sulu_http root '/sulu'
|
||||
# uci_add_list nginx _sulu_http listen "8080"
|
||||
# uci_add_list nginx _sulu_http listen "[::]:8080"
|
||||
# uci_set nginx _sulu_http server_name '_sulu_http'
|
||||
# uci_add_list nginx _sulu_http include '/etc/sulu/nginx.locations'
|
||||
# uci_set nginx _sulu_http ssl_session_cache 'none'
|
||||
# uci_set nginx _sulu_http access_log 'off; # logd openwrt'
|
||||
# if ! uci_get nginx _suluredirect >/dev/null 2>&1; then
|
||||
# uci_add nginx server _suluredirect
|
||||
# uci_add_list nginx _suluredirect listen "8080"
|
||||
# uci_add_list nginx _suluredirect listen "[::]:8080"
|
||||
# uci_set nginx _suluredirect server_name '_suluredirect'
|
||||
# uci_set nginx _suluredirect return '302 https://$host:8443$request_uri'
|
||||
# fi
|
||||
|
||||
if ! uci_get nginx _sulu_http >/dev/null 2>&1; then
|
||||
uci_add nginx server _sulu_http
|
||||
uci_set nginx _sulu_http root '/sulu'
|
||||
uci_add_list nginx _sulu_http listen "8080"
|
||||
uci_add_list nginx _sulu_http listen "[::]:8080"
|
||||
uci_set nginx _sulu_http server_name '_sulu_http'
|
||||
uci_add_list nginx _sulu_http include '/etc/sulu/nginx.locations'
|
||||
uci_set nginx _sulu_http ssl_session_cache 'none'
|
||||
uci_set nginx _sulu_http access_log 'off; # logd openwrt'
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,22 +4,13 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=sulu-lcm
|
||||
PKG_VERSION:=3.1.1
|
||||
PKG_VERSION:=3.1.24
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-lcm.git
|
||||
PKG_SOURCE_VERSION:=d4c0522c9a7cc59e621d5f967fa6b001a025c7ae
|
||||
PKG_SOURCE_VERSION:=403c646c21a323cff9ed628c4d74c15445557663
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
SULU_PLUGIN_INSTALL:=1
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/sulu/config/widgets
|
||||
ifeq ($(CONFIG_PACKAGE_skopeo)$(CONFIG_PACKAGE_umoci),yy)
|
||||
$(CP) $(PKG_BUILD_DIR)/src/config/widgets/lcm-store.json $(1)/sulu/config/widgets/
|
||||
endif
|
||||
endef
|
||||
|
||||
include ../sulu-builder/sulu.mk
|
||||
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=sulu-multi-ap
|
||||
PKG_VERSION:=3.1.6
|
||||
PKG_VERSION:=3.1.26
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-multi-ap.git
|
||||
PKG_SOURCE_VERSION:=07da9a4d69452a6b092cd0c529186a5cb3b3c538
|
||||
PKG_SOURCE_VERSION:=64d47ff721a197c2cf757df8885a0c109cbb7cd3
|
||||
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.0
|
||||
PKG_VERSION:=3.1.23
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-parental-control.git
|
||||
PKG_SOURCE_VERSION:=c7ac55a741ac36a126e2fb806f97b8c2625a4499
|
||||
PKG_SOURCE_VERSION:=4c27c3c8e6220d41992d51fb7b400c0d8a90a4ae
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include ../sulu-builder/sulu.mk
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=swmodd
|
||||
PKG_VERSION:=2.4.0
|
||||
PKG_VERSION:=2.4.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/lcm/swmodd.git
|
||||
PKG_SOURCE_VERSION:=cd1b40094b46e8223d13253e4bc41a8a2f000cf1
|
||||
PKG_SOURCE_VERSION:=ad39d3aa3b69c4efcb9f0230cee17af00fb3337f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -22,6 +22,7 @@ PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/swmodd
|
||||
SECTION:=utils
|
||||
@@ -74,14 +75,12 @@ endif
|
||||
define Package/swmodd/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/share/swmodd/
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/etc/init.d/swmodd $(1)/etc/init.d/swmodd
|
||||
$(INSTALL_BIN) ./files/etc/config/swmodd $(1)/etc/config/swmodd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/swmodd $(1)/usr/sbin/swmodd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libswmodd.so $(1)/usr/lib/bbfdm/libswmodd.so
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/opkg_offline.sh $(1)/usr/share/swmodd/opkg_offline
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-bundle-path $(1)/etc/uci-defaults/01-fix-bundle-path
|
||||
ifeq ($(CONFIG_PACKAGE_liblxc),y)
|
||||
@@ -96,6 +95,7 @@ ifeq ($(CONFIG_PACKAGE_crun),y)
|
||||
$(INSTALL_BIN) ./files/etc/config/crun $(1)/etc/config/crun
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/crun_create $(1)/usr/sbin/crun_create
|
||||
endif
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libswmodd.so)
|
||||
endef
|
||||
|
||||
define Package/swmodd-cgroup/install
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=timemngr
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_VERSION:=1.0.8
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/timemngr.git
|
||||
PKG_SOURCE_VERSION:=1ffb220f42e37befb37e40ac2286ba31fddfb157
|
||||
PKG_SOURCE_VERSION:=5fd5bb7a94ffba689c1d73502ec564b67394aaef
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -13,16 +13,18 @@ DM_INPUT="/etc/timemngr/input.json"
|
||||
|
||||
validate_global_section() {
|
||||
uci_validate_section time global global \
|
||||
'enable:bool:1'
|
||||
'enable:bool:1' \
|
||||
'loglevel:uinteger:1'
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enable loglevel
|
||||
|
||||
if uci -q get system.ntp >/dev/null 2>&1; then
|
||||
logger -t timemngr.init "Not starting timemngr, legacy ntp definition detected"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local enable
|
||||
validate_global_section || {
|
||||
return 1
|
||||
}
|
||||
@@ -32,7 +34,8 @@ start_service() {
|
||||
fi
|
||||
|
||||
procd_open_instance timemngr_ubus
|
||||
procd_set_param command $PROG_UBUS -l 1
|
||||
procd_set_param command $PROG_UBUS
|
||||
procd_append_param command -l ${loglevel}
|
||||
procd_close_instance
|
||||
|
||||
generate_config
|
||||
|
||||
@@ -30,6 +30,7 @@ if uci -q get system.ntp >/dev/null 2>&1; then
|
||||
uci -q set time.client.minpoll="6"
|
||||
uci -q set time.client.maxpoll="10"
|
||||
uci -q set time.client.mode="Unicast"
|
||||
uci -q set time.client.interface="wan"
|
||||
|
||||
servers="$(get_system_ntp_option server)"
|
||||
if [ -z "${servers}" ]; then
|
||||
|
||||
4
tr104/Config.in
Normal file
4
tr104/Config.in
Normal file
@@ -0,0 +1,4 @@
|
||||
config TR104_DOTSO_PLUGIN
|
||||
bool "Use bbfdm DotSO plugin backend to provide TR104 and extension datamodel"
|
||||
depends on PACKAGE_tr104
|
||||
default n
|
||||
@@ -11,7 +11,7 @@ LOCAL_DEV:=0
|
||||
ifeq ($(LOCAL_DEV),0)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/voice/tr104.git
|
||||
PKG_SOURCE_VERSION:=63a9876a4f7f030bac433fc44427884e7e97baf5
|
||||
PKG_SOURCE_VERSION:=cd0c5d1f4a8489e3d93b5cf433f8f0df638bf62b
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -21,12 +21,14 @@ PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=TR104 Datamodel Daemon
|
||||
MENU:=1
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +asterisk
|
||||
endef
|
||||
|
||||
@@ -34,8 +36,13 @@ define Package/$(PKG_NAME)/description
|
||||
TR104 datamodel daemon
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)" \
|
||||
-DDAEMON_JSON_INPUT:String="/etc/tr104/input.json" \
|
||||
-DDM_ENABLE_UBUS=ON
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
@@ -46,10 +53,18 @@ endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/tr104d
|
||||
ifeq ($(CONFIG_TR104_DOTSO_PLUGIN),y)
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libdm/tr104/libtr104.so)
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libdm/tr104_ext/libtr104ext.so)
|
||||
else
|
||||
$(INSTALL_DIR) $(1)/etc/tr104/plugins/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/daemon/ubus/tr104d $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libdm/tr104/libtr104.so $(1)/etc/tr104/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libdm/tr104_ext/libtr104ext.so $(1)/etc/tr104/plugins/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/tr104d $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/etc/tr104/input.json $(1)/etc/tr104/input.json
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
@@ -14,7 +14,9 @@ log() {
|
||||
start_service()
|
||||
{
|
||||
procd_open_instance "tr104d"
|
||||
|
||||
procd_set_param command ${PROG}
|
||||
procd_append_param command -m "/etc/tr104/input.json"
|
||||
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
|
||||
34
tr104/files/etc/tr104/input.json
Executable file
34
tr104/files/etc/tr104/input.json
Executable file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"daemon": {
|
||||
"config": {
|
||||
"loglevel": "1",
|
||||
"refresh_time": "10",
|
||||
"transaction_timeout": "30"
|
||||
},
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/tr104/libtr104.so",
|
||||
"plugin_dir": "/etc/tr104/plugins/"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"name": "tr104",
|
||||
"parent_dm": "Device.Services.",
|
||||
"object": "VoiceService",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
},
|
||||
"cli": {
|
||||
"config": {
|
||||
"proto": "both",
|
||||
"instance_mode": 0
|
||||
},
|
||||
"input": {
|
||||
"type": "UBUS",
|
||||
"name": "tr104"
|
||||
},
|
||||
"output": {
|
||||
"type": "CLI"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=twamp
|
||||
PKG_VERSION:=1.4.1
|
||||
PKG_VERSION:=1.4.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -21,6 +21,7 @@ PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=utils
|
||||
@@ -46,18 +47,16 @@ endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/twampd $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libtwamp.so $(1)/usr/lib/bbfdm/libtwamp.so
|
||||
$(INSTALL_DATA) ./files/etc/config/twamp $(1)/etc/config/twamp
|
||||
$(INSTALL_BIN) ./files/etc/init.d/twampd $(1)/etc/init.d/twampd
|
||||
$(INSTALL_BIN) ./files/etc/firewall.twamp $(1)/etc/firewall.twamp
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/92-twampfirewall $(1)/etc/uci-defaults/92-twampfirewall
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/93-twamp_fix_reflector $(1)/etc/uci-defaults/93-twamp_fix_reflector
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libtwamp.so)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=udpecho
|
||||
PKG_VERSION:=2.2.0
|
||||
PKG_VERSION:=2.2.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -26,6 +26,7 @@ PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
@@ -64,13 +65,12 @@ endif
|
||||
|
||||
define Package/$(PKG_NAME)-server/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/udpechoserverd $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/libudpechoserver.so $(1)/usr/lib/bbfdm/
|
||||
$(INSTALL_DATA) ./files/etc/config/udpechoserver $(1)/etc/config/udpechoserver
|
||||
$(INSTALL_BIN) ./files/etc/init.d/udpechoserverd $(1)/etc/init.d/udpechoserverd
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/src/libudpechoserver.so)
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)-client/install
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=usermngr
|
||||
PKG_VERSION:=1.2.2
|
||||
PKG_VERSION:=1.2.5
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/usermngr.git
|
||||
PKG_SOURCE_VERSION:=76a7e491ed533b5d2684eef8ace9fd52ecc232e0
|
||||
PKG_SOURCE_VERSION:=46be05288cf5645cf24d25dbbe038cf37de5d320
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -20,6 +20,7 @@ PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
@@ -45,12 +46,11 @@ define Package/usermngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/init.d/users $(1)/etc/init.d/users
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/uci-defaults/90-indicate-bootstrap $(1)/etc/uci-defaults/90-indicate-bootstrap
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/uci-defaults/91-sync-shells $(1)/etc/uci-defaults/91-sync-shells
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/libusermngr.so $(1)/usr/lib/bbfdm/libusermngr.so
|
||||
$(INSTALL_BIN) ./files/etc/config/users $(1)/etc/config/users
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/src/libusermngr.so)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,usermngr))
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=usp-js
|
||||
PKG_VERSION:=1.2.2
|
||||
PKG_VERSION:=1.2.3
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/usp-js.git
|
||||
PKG_SOURCE_VERSION:=80712f48da527a1e524e2d04d40ce5734030483e
|
||||
PKG_SOURCE_VERSION:=61cf7adb3258820f12f5dc02c69c5bdd612ed4cd
|
||||
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.0.10
|
||||
PKG_VERSION:=1.1.1
|
||||
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:=7ad15dc84ce950f7ce8dd723877a9f8fd81194a7
|
||||
PKG_SOURCE_VERSION:=e09bf00b37fd987018c590a61f0021d403fb90cf
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -9,7 +9,7 @@ NAME=voicemngr
|
||||
start_service() {
|
||||
[ "$(db -q get hw.board.hasVoice)" = "1" ] || return
|
||||
|
||||
[ -d "/usr/lib/broadcom" ] && BCM_LIBS=LD_LIBRARY_PATH=/usr/lib/broadcom
|
||||
[ -d "/usr/lib/broadcom" ] && BCM_LIBS=LD_LIBRARY_PATH=/lib/broadcom:/usr/lib/broadcom
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param env hw_board_hasDect="$(db get hw.board.hasDect)" \
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wifimngr
|
||||
PKG_VERSION:=16.1.2
|
||||
PKG_VERSION:=16.1.5
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=8f64538aafe43a778c44756adc3b5d1f6dbe7165
|
||||
PKG_SOURCE_VERSION:=6f5a9f55dadb1dd2a366f954f1ab152b50fae9b9
|
||||
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
|
||||
|
||||
52
wifimngr/files/etc/uci-defaults/gen_wifi_json.sh
Normal file
52
wifimngr/files/etc/uci-defaults/gen_wifi_json.sh
Normal file
@@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -f /etc/wifi.json ] && exit 0
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
is_broadcom() {
|
||||
[ -e /dev/bcm ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
is_qualcomm() {
|
||||
[ -f /proc/device-tree/compatible ] || return
|
||||
strings /proc/device-tree/compatible | grep -qE '^(qcom,|ipq,)'; return
|
||||
}
|
||||
|
||||
if is_broadcom; then
|
||||
ifname="wl*"
|
||||
family="bcmwl nl80211"
|
||||
group="scan"
|
||||
else
|
||||
ifname="wlan*"
|
||||
family="nl80211"
|
||||
if is_qualcomm; then
|
||||
group="scan"
|
||||
else
|
||||
group="scan config mlme vendor"
|
||||
fi
|
||||
fi
|
||||
|
||||
json_init
|
||||
json_add_array "events"
|
||||
for fm in $family; do
|
||||
echo fm=$fm
|
||||
json_add_object ""
|
||||
json_add_string "type" "wifi-event"
|
||||
json_add_string "name" "$fm"
|
||||
json_add_string "ifname" "$ifname"
|
||||
json_add_string "family" "$fm"
|
||||
json_add_array "group"
|
||||
if [ "$fm" == "bcmwl" ]; then
|
||||
json_add_string "" "notify"
|
||||
else
|
||||
for gr in $group; do
|
||||
json_add_string "" "$gr"
|
||||
done
|
||||
fi
|
||||
json_select ..
|
||||
json_select ..
|
||||
done
|
||||
json_select ..
|
||||
json_dump | jq >/etc/wifi.json
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=xmppc
|
||||
PKG_VERSION:=2.2.0
|
||||
PKG_VERSION:=2.2.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/xmppc.git
|
||||
PKG_SOURCE_VERSION:=30f0762f3e62b8e7b4f006a185f09970e6084714
|
||||
PKG_SOURCE_VERSION:=23a7f6005b84fc4d4a1432057ecd2b5a74f9ea3e
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -28,13 +28,14 @@ PKG_LICENSE_FILES:=LICENSE
|
||||
MAKE_PATH:=src
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF xmpp Client
|
||||
DEPENDS:=+libuci +libubox +libstrophe +libubus +libbbfdm-api
|
||||
DEPENDS:=+libuci +libubox +libstrophe +libubus +libbbfdm-api +@CONFIG_BUSYBOX_CONFIG_PIDOF
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
@@ -53,10 +54,9 @@ TARGET_CFLAGS += \
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/xmppc $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/*.so $(1)/usr/lib/bbfdm
|
||||
$(CP) ./files/* $(1)/
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/src/libxmppc.so)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
@@ -1,37 +1,5 @@
|
||||
|
||||
config xmpp 'xmpp'
|
||||
option conn_req_connection 'connection_1'
|
||||
option allowed_jid ''
|
||||
#Log levels: Critical=0, Warning=1, Notice=2, Info=3, Debug=4
|
||||
option loglevel '3'
|
||||
|
||||
config connection 'connection_1'
|
||||
option enable '0'
|
||||
option username ''
|
||||
option password ''
|
||||
option domain ''
|
||||
option resource ''
|
||||
option usetls '0'
|
||||
option interval '30'
|
||||
option attempt '16'
|
||||
option initial_retry_interval '1'
|
||||
option retry_interval_multiplier '1000'
|
||||
option retry_max_interval '1'
|
||||
option serveralgorithm 'DNS-SRV'
|
||||
|
||||
config connection_server 'connection_1_srv_1'
|
||||
option con_name 'connection_1'
|
||||
option enable '0'
|
||||
option priority '0'
|
||||
option weight '-1'
|
||||
option port '5222'
|
||||
option server_address ''
|
||||
|
||||
config connection_server 'connection_1_srv_2'
|
||||
option con_name 'connection_1'
|
||||
option enable '0'
|
||||
option priority '0'
|
||||
option weight '-1'
|
||||
option port '5222'
|
||||
option server_address ''
|
||||
|
||||
|
||||
@@ -17,5 +17,8 @@ PROTO="$(uci -q get network."${INTERFACE}".proto)"
|
||||
IFNAME="$(uci -q get network."${INTERFACE}".ifname)"
|
||||
[ "${IFNAME:0:1}" = "@" ] && exit 0
|
||||
|
||||
/etc/init.d/xmppc reload &
|
||||
# reload xmppc if not running already
|
||||
if ! pidof xmppc; then
|
||||
/etc/init.d/xmppc reload &
|
||||
fi
|
||||
|
||||
|
||||
@@ -9,12 +9,12 @@ PROG="/usr/sbin/xmppc"
|
||||
start_service() {
|
||||
local con_name=$(uci -q get xmpp.xmpp.conn_req_connection)
|
||||
local con_enable=$(uci -q get xmpp."${con_name}".enable)
|
||||
|
||||
procd_open_instance
|
||||
if [ "$con_enable" = "1" ]; then
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn "3" "7" "0"
|
||||
procd_close_instance
|
||||
fi
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
|
||||
Reference in New Issue
Block a user