Compare commits

..

1 Commits

Author SHA1 Message Date
Amin Ben Romdhane
6066487307 icwmp: optimize dual stack implementation 2023-04-19 14:37:29 +02:00
107 changed files with 3138 additions and 1717 deletions

View File

@@ -5,11 +5,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bbfdm
PKG_VERSION:=1.1.4
PKG_VERSION:=1.0.4
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
PKG_SOURCE_VERSION:=dec994de5a1338bbda82c2fb01218d70bef9b09d
PKG_SOURCE_VERSION:=96b305926f8fa8cafa0638e613879537da9b6086
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
@@ -111,7 +111,6 @@ endif
CMAKE_OPTIONS += \
-DBBF_TR181=ON
-DBBF_WIFI_DATAELEMENTS=ON
ifeq ($(CONFIG_BBF_TR104),y)
CMAKE_OPTIONS += \
@@ -166,6 +165,7 @@ CMAKE_OPTIONS += -DWITH_MBEDTLS=ON
endif
ifeq ($(CONFIG_PACKAGE_bbfdmd),y)
CMAKE_OPTIONS += -DBBFDMD_ENABLED=ON
CMAKE_OPTIONS += \
-DBBFDMD_MAX_MSG_LEN:Integer=10485760
endif
@@ -204,15 +204,11 @@ endef
define Package/bbfdmd/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(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/src/bbfdmd $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/json/input.json $(1)/etc/bbfdm/
endef
define Package/userinterface/install
@@ -225,9 +221,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)

View File

@@ -1,7 +1,5 @@
config bbfdmd 'bbfdmd'
option enabled '1'
option loglevel '1'
option refresh_time '10'
option transaction_timeout '10'

View File

@@ -1,74 +0,0 @@
#!/bin/sh
. /lib/functions.sh
log() {
echo "${@}"|logger -t firewall.dnat -p info
}
exec_cmd() {
if ! eval "$*"; then
log "Failed to run [$*]"
fi
}
reorder_dnat_rules() {
nat_chains=$(iptables -t nat -S | grep -E "^-N zone[a-zA-Z0-9_]+prerouting$" | cut -d' ' -f 2)
for chain in ${nat_chains}; do
# Collect empty remote host & empty dport rules
EMPTY_HOST_PORT=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep -v "\-\-dport" | grep -v "\-s ")
if [ -n "${EMPTY_HOST_PORT}" ]; then
echo "${EMPTY_HOST_PORT}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
exec_cmd $cmd1
done
fi
# Collect empty remote host but non empty dport rules
EMPTY_HOST=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep "\-\-dport" | grep -v "\-s ")
if [ -n "${EMPTY_HOST}" ]; then
echo "${EMPTY_HOST}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
exec_cmd $cmd1
done
fi
# Collect non empty remote host but empty dport rules
EMPTY_PORT=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep -v "\-\-dport" | grep "\-s ")
if [ -n "${EMPTY_PORT}" ]; then
echo "${EMPTY_PORT}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
exec_cmd $cmd1
done
fi
# Now add rules as per datamodel precedence shown below
## Non empty remote host, empty dport
## empty remote host, non empty dport
## empty remote host, empty dport
if [ -n "${EMPTY_PORT}" ]; then
echo "${EMPTY_PORT}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd)"
exec_cmd $cmd1
done
fi
if [ -n "${EMPTY_HOST}" ]; then
echo "${EMPTY_HOST}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd)"
exec_cmd $cmd1
done
fi
if [ -n "${EMPTY_HOST_PORT}" ]; then
echo "${EMPTY_HOST_PORT}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd)"
exec_cmd $cmd1
done
fi
done
}
# Re-order portmapping rules according to precedence hierarchy
reorder_dnat_rules

View File

@@ -1,17 +0,0 @@
#!/bin/sh
[ "$ACTION" = "ifup" ] || exit 0
apply_sysctl_configuration() {
local sysctl_conf
sysctl_conf="/etc/bbfdm/sysctl.conf"
[ -f "${sysctl_conf}" ] || touch "${sysctl_conf}"
sysctl -e -p "${sysctl_conf}" >&-
}
ubus -t 10 wait_for network.device
apply_sysctl_configuration

View File

@@ -6,8 +6,6 @@ STOP=10
USE_PROCD=1
PROG=/usr/sbin/bbfdmd
BBFDM_JSON_INPUT="/etc/bbfdm/input.json"
log() {
echo "${@}"|logger -t bbfdmd.init -p info
}
@@ -19,14 +17,12 @@ validate_bbfdm_bbfdmd_section()
'debug:bool:false' \
'loglevel:uinteger' \
'sock:string' \
'refresh_time:uinteger' \
'transaction_timeout:uinteger' \
'subprocess_level:uinteger'
'transaction_timeout:string'
}
configure_bbfdmd()
{
local enabled debug sock
local enabled debug sock transaction_timeout
config_load bbfdm
@@ -37,24 +33,6 @@ configure_bbfdmd()
[ "${enabled}" -eq 0 ] && return 0
[ ! -f "${BBFDM_JSON_INPUT}" ] && return 0
if [ -n "${loglevel}" ]; then
echo "$(jq --arg res ${loglevel} '.daemon.config += {"loglevel": $res}' ${BBFDM_JSON_INPUT})" > ${BBFDM_JSON_INPUT}
fi
if [ -n "${refresh_time}" ]; then
echo "$(jq --arg res ${refresh_time} '.daemon.config += {"refresh_time": $res}' ${BBFDM_JSON_INPUT})" > ${BBFDM_JSON_INPUT}
fi
if [ -n "${transaction_timeout}" ]; then
echo "$(jq --arg res ${transaction_timeout} '.daemon.config += {"transaction_timeout": $res}' ${BBFDM_JSON_INPUT})" > ${BBFDM_JSON_INPUT}
fi
if [ -n "${subprocess_level}" ]; then
echo "$(jq --arg res ${subprocess_level} '.daemon.config += {"subprocess_level": $res}' ${BBFDM_JSON_INPUT})" > ${BBFDM_JSON_INPUT}
fi
procd_set_param command ${PROG}
if [ "${debug}" -eq 1 ]; then
procd_set_param stdout 1
@@ -64,17 +42,42 @@ configure_bbfdmd()
if [ -f "${sock}" ]; then
procd_append_param command -s "${sock}"
fi
if [ -n "${transaction_timeout}" ]; then
procd_append_param command -t "${transaction_timeout}"
fi
}
start_service()
{
procd_open_instance "bbfdm"
apply_sysctl_configuration() {
local sysctl_conf
sysctl_conf="/etc/bbfdm/sysctl.conf"
[ -f "${sysctl_conf}" ] || touch "${sysctl_conf}"
sysctl -e -p "${sysctl_conf}" >&-
}
start_service() {
local sysctl_reload
ubus -t 5 wait_for network.device
[ "$?" -eq 0 ] && sysctl_reload=1
procd_open_instance bbf
configure_bbfdmd
procd_set_param respawn
procd_close_instance "bbfdm"
procd_close_instance
[ "${sysctl_reload}" -eq 1 ] && apply_sysctl_configuration
}
reload_service() {
ubus -t 5 wait_for network.device
apply_sysctl_configuration
}
service_triggers()
{
procd_add_reload_trigger "bbfdm"
procd_add_reload_trigger "bbfdm" "network"
}

View File

@@ -1,12 +0,0 @@
#!/bin/sh
uci -q batch <<-EOT
delete firewall.port_hook
set firewall.port_hook=include
set firewall.port_hook.path=/etc/firewall.portmap
set firewall.port_hook.reload=1
commit firewall
EOT
exit 0

View File

@@ -5,19 +5,17 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=decollector
PKG_VERSION:=4.0.2.6
PKG_VERSION:=4.0.2.0
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=944a981d8d3f9548f464c862778b67455aee9112
PKG_SOURCE_VERSION:=162654487bfbff7d68d0c87ae9498a3def738d84
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE

View File

@@ -17,11 +17,10 @@ start_service() {
config_load mapcontroller
config_get en controller enabled "0"
config_get collect_int controller de_collect_interval
[ $en -gt 0 ] && {
procd_open_instance
procd_set_param command "$PROG" "-d" "${collect_int:+-t $collect_int}"
procd_set_param command "$PROG" "-d"
#procd_set_param stdout 1
#procd_set_param stderr 1
procd_set_param respawn

View File

@@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dectmngr
PKG_RELEASE:=3
PKG_VERSION:=3.5.11
PKG_VERSION:=3.5.7
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=18dece420502e25a9bd9f3b534bc6c338fcc9377
PKG_SOURCE_VERSION:=83f89a83cf860bbcf2b7f2e030215db315a5bbbf
PKG_MIRROR_HASH:=skip
endif

View File

@@ -6,6 +6,7 @@ START=70
STOP=12
USE_PROCD=1
NAME=dectmngr
PROG=/usr/sbin/dectmngr
LOG_PATH=/var/log/dectmngr
DB_PATH=/etc/dect
@@ -15,13 +16,11 @@ DECT_GPIO="$(gpiofind DCX81_RSTN | cut -d ' ' -f 2 2>/dev/null)"
# Ask dectmngr to exit nicely and wait for it to clean up, which is a slow process.
stop_and_wait_dectmngr() {
dect_pid=$(pidof $PROG)
[ -n "$dect_pid" ] && kill $dect_pid
pidof $NAME && killall -q $NAME
pidof $PROG > /dev/null 2>&1 && sleep 2 # wait for the process to stop gracefully
while pidof $PROG > /dev/null 2>&1; do
dect_pid=$(pidof $PROG)
[ -n "$dect_pid" ] && kill -9 $dect_pid
pidof $NAME && sleep 2 # wait for the process to stop gracefully
while pidof $NAME; do
killall -q -9 $NAME
sleep 1
done
}

View File

@@ -13,7 +13,7 @@ PKG_VERSION:=1.2.0
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=43dec92b1c86be7859521da337e7bd1168848b26
PKG_SOURCE_VERSION:=bb754ae620a9fc66fd6fc0745f0fead0708c7a17
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dslmngr.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip

View File

@@ -23,7 +23,7 @@ define Package/ethmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Ethernet status and configration utility
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_iopsys_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl
endef
define Package/ethmngr/description
@@ -37,7 +37,7 @@ TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include/libnl3 \
-D_GNU_SOURCE
ifeq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_mediatek),)
ifeq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_iopsys_mediatek),)
define Build/Compile
endef
endif
@@ -49,7 +49,7 @@ ifneq ($(CONFIG_TARGET_brcmbca),)
else
$(CP) ./files/linux/* $(1)/
endif
ifneq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_mediatek),)
ifneq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_iopsys_mediatek),)
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ethmngr $(1)/usr/sbin/
endif

View File

@@ -6,16 +6,16 @@ get_max_port_speed() {
fi
local ifname="$1"
local phycap="$(ethctl $ifname media-type 2>/dev/null | grep 'PHY Speed Capabilities' | awk '{print$NF}')"
local phycap="$(ethctl $ifname media-type 2>/dev/null | grep 'PHY Capabilities' | awk '{print$NF}' | cut -d'|' -f1)"
local speed=1000
case "$phycap" in
10GFD*) speed=10000 ;;
5GFD*) speed=5000 ;;
2.5GFD*) speed=2500 ;;
1GFD*) speed=1000 ;;
100MFD*|100MHD*) speed=100 ;;
10MFD*|10MHD*) speed=10 ;;
10GFD) speed=10000 ;;
5GFD) speed=5000 ;;
2.5GFD) speed=2500 ;;
1GFD|1GHD) speed=1000 ;;
100MFD|100MHD) speed=100 ;;
10MFD|10MHD) speed=10 ;;
esac
echo $speed
@@ -84,16 +84,21 @@ set_port_settings() {
[ "$duplex" == 0 ] && dplx="HD" || dplx="FD"
[ "$autoneg" == "on" ] && media_type="auto" || media_type="$speed$dplx"
phycaps="$(ethctl $ifname media-type 2>/dev/null | grep 'PHY Speed Capabilities' | awk '{print$NF}')"
numofcaps="$(echo $phycaps | tr ':' ' ' | wc -w)"
phycrossbar="$(ethctl $ifname phy-crossbar | head -1)"
crossbartype="$(echo $phycrossbar | awk '{print$2$3}')"
# Take only the last PHY Endpoint (non-Serdes) into account as Serdes port number precedes
[ "$crossbartype" == "oncrossbar" ] && pyhendpoint="$(echo $phycrossbar | awk '{print$NF}')"
phycaps="$(ethctl $ifname media-type ${pyhendpoint:+ port $pyhendpoint} | awk -F'PHY Capabilities: ' '{print$2}')"
numofcaps="$(echo $phycaps | tr '|' ' ' | wc -w)"
# Reset the port before setting new params
reset_port $ifname
if [ "$numofcaps" == "1" ]; then
logger -t "ethmngr" "$ifname is capable of $phycaps only; not setting speed/duplex"
logger -t "port-management" "$ifname is capable of $phycaps only; not setting speed/duplex"
else
logger -t "ethmngr" "$ifname is capable of $phycaps; setting speed/duplex to $media_type"
logger -t "port-management" "$ifname is capable of $phycaps; setting speed/duplex to $media_type"
ethctl $ifname media-type $media_type ${pyhendpoint:+ port $pyhendpoint} &>/dev/null
fi

106
evoice/Makefile Normal file
View File

@@ -0,0 +1,106 @@
#
# Copyright (C) 2022 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=evoice
PKG_VERSION:=0.2.39
LOCAL_DEV=0
LOCAL_DEV_EVOICE_DIR=~/voip/evoice
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/evoice.git
PKG_SOURCE_VERSION:=30d65330de0368f73ecf4a2e804c39a2ee280454
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
PKG_LICENSE:=PROPRIETARY IOPSYS
PKG_LICENSE_FILES:=LICENSE
# All config variable that are passed to the make invocation, directly or
# indirectly. This ensures that the package is rebuilt on config-changes.
#PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
CATEGORY:=Network
SUBMENU:=Telephony
TITLE:=Ensemble Voice
URL:=
DEPENDS:= +libubox +libubus +libpicoevent +libuci +libstdcpp +libopenssl +libjson-c +libblobmsg-json\
+TARGET_brcmbca:bcmkernel\
+TARGET_airoha:kmod-voip_driver\
+TARGET_airoha:voip_app +libbbf_api
endef
define Package/$(PKG_NAME)/description
Ensemble Voice. A stand alone SIP VoIP application.
endef
ifeq ($(LOCAL_DEV),1)
# If you want to build the code from your own local repositiory enable
# LOCAL_DEV and set LOCAL_DEV_EVOICE_DIR to your own git repository.
define Build/Prepare
@echo "======================================================="
@echo "DEVELOPMENT BUILD! rsync $(LOCAL_DEV_EVOICE_DIR) to $(PKG_BUILD_DIR)"
@echo "======================================================="
rsync -a $(LOCAL_DEV_EVOICE_DIR)/* $(PKG_BUILD_DIR)/
endef
endif
IDIR = $(STAGING_DIR)/usr/include
TONES_INI_REQUIRED=
ifeq ($(CONFIG_TARGET_brcmbca),y)
TARGET_PLATFORM=BROADCOM
BDIR = bcm963xx/userspace/private/apps/voice
CC_FLAGS = -I$(IDIR) -I$(IDIR)/$(BDIR)/inc\
-I$(IDIR)/bcm963xx/xchg/bos/publicInc\
-I$(IDIR)/bcm963xx/bcmdrivers/broadcom/include/bcm963xx
TRG=SVrgBcmFxs
JSONFILE=codecs_brcm.json
else ifeq ($(CONFIG_TARGET_airoha),y)
TARGET_PLATFORM=ECONET
TONES_INI_REQUIRED=y
TRG=SVrgMtekOwrt
JSONFILE=codecs_airoha.json
endif
# disable temporarily some not important warnings, force PIC
CC_FLAGS_VS=$(CC_FLAGS) -Wno-unused-parameter -Wno-unused-function -fPIC
export TARGET_PLATFORM
#used and altered by BIDE makefiles
export _XFLAGS
BIDE_MAKE_OPTS = -r -R -C $(PKG_BUILD_DIR) -f _bld/src/cdabs.mk\
SWB=b_gxxqca6 HWA=a_openwrt HWC=c_hosted OSP=p_posix LIF=cerder DBG=dbg
define Build/Compile
@echo "TARGET_PLATFORM=${TARGET_PLATFORM}"
+$(MAKE) $(BIDE_MAKE_OPTS) CC_FLAGS="$(CC_FLAGS)" TRG=$(TRG)
@echo "clean libvoiceservice before building shared lib!"
+$(MAKE) $(BIDE_MAKE_OPTS) CC_FLAGS="$(CC_FLAGS_VS)" TRG=libvoiceservice cleanall
+$(MAKE) $(BIDE_MAKE_OPTS) CC_FLAGS="$(CC_FLAGS_VS)" TRG=libvoiceservice
endef
define Package/evoice/install
$(CP) ./files/* $(1)/
$(if $(TONES_INI_REQUIRED),,$(RM) $(1)/etc/evoice/tones.ini)
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(1)/lib/voice/$(JSONFILE) $(1)/lib/voice/codecs_evoice.json
$(RM) $(1)/lib/voice/codecs_brcm.json
$(RM) $(1)/lib/voice/codecs_airoha.json
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
$(INSTALL_BIN) $(PKG_BUILD_DIR)/_bin/a_openwrt/evoice $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/_bin/a_openwrt/libvoiceservice.so $(1)/usr/lib/bbfdm/
endef
$(eval $(call BuildPackage,evoice))

View File

@@ -0,0 +1,334 @@
config SIPClient 'Client1'
option Enable '1'
option RegisterMode 'RFC3261'
option AuthUserName '51234'
option AuthPassword '51234'
option Network 'Network1'
option MaxSessions '5'
option RegisiterURI '51234@sip-proxy.iopsys.eu'
option E164Format '1'
config SIPClient 'Client2'
option Enable '1'
option RegisterMode 'RFC3261'
option AuthUserName '51235'
option AuthPassword '51235'
option Network 'Network1'
option MaxSessions '5'
option RegisiterURI '51235@sip-proxy.iopsys.eu'
option E164Format '1'
config SIPNetwork 'Network1'
option Enable '1'
option ProxyServer 'sip-proxy.iopsys.eu'
option AcceptFromProxyOnly '0'
option ProxyServerPort '5060'
option ProxyServerTransport 'UDP'
option RegistrarServer 'sip-proxy.iopsys.eu'
option RegistrarServerPort '5060'
option RegistrarServerTransport 'UDP'
option RegistrationPeriod '3240'
option RegisterExpires '3600'
option UserAgentDomain ' '
option TimerRegistrationFailed '120'
option TimerT1 '500'
option VoIPProfile 'VoIPProfile1'
option SIPSessionTimerEnable '0'
option SIPSessionExpireInterval '1800'
option SIPSessionMinimumTimer '90'
option SIPSessionRefresher 'NONE'
option SIPSessionTimerMode 'REQUEST'
option SIPSessionRefreshRequest 'UPDATE'
list CodecList '1CodecProfile1'
list CodecList '1CodecProfile2'
list CodecList '1CodecProfile3'
list CodecList '1CodecProfile5'
list CodecList '1CodecProfile4'
config CodecProfile '1CodecProfile1'
option Enable '1'
option Codec 'G.711ALaw'
option PacketizationPeriod '20'
option SilenceSupression '1'
config CodecProfile '1CodecProfile2'
option Enable '1'
option Codec 'G.711MuLaw'
option PacketizationPeriod '20'
option SilenceSupression '1'
config CodecProfile '1CodecProfile3'
option Enable '1'
option Codec 'G.726'
option PacketizationPeriod '20'
option SilenceSupression '0'
config CodecProfile '1CodecProfile4'
option Enable '1'
option Codec 'G.722'
option PacketizationPeriod '20'
option SilenceSupression '0'
config CodecProfile '1CodecProfile5'
option Enable '1'
option Codec 'G.729'
option PacketizationPeriod '20'
option SilenceSupression '0'
config VoIPProfile 'VoIPProfile1'
option Enable '1'
option DTMFMethod 'RFC4733'
option RTP '1RTP'
config RTP '1RTP'
option LocalPortMin '10020'
option LocalPortMax '10039'
option JitterBufferType 'Static'
config FXXPorts 'POTS'
option Region 'US'
config FXSPorts 'FXS1'
option Enable '1'
option DialType 'Tone'
option TransmitGain '0'
option ReceiveGain '0'
option EchoCancellationEnable '1'
config FXSPorts 'FXS2'
option Enable '1'
option DialType 'Tone'
option TransmitGain '0'
option ReceiveGain '0'
option EchoCancellationEnable '1'
config Extension 'Extension1'
option Enable '1'
option ExtensionNumber '10#'
option Provider 'FXS1'
option CallingFeatures 'Set1'
option Name 'Phone 1'
config Extension 'Extension2'
option Enable '1'
option ExtensionNumber '11#'
option Provider 'FXS2'
option CallingFeatures 'Set1'
option Name 'Phone 2'
config Line 'Line1'
option Enable '1'
option Provider 'Client1'
option CallingFeatures 'Set1'
config Line 'Line2'
option Enable '1'
option Provider 'Client2'
option CallingFeatures 'Set2'
config IncomingMap 'IncomingMap1'
option Enable '1'
option Extension 'Extension1'
option Line 'Line1'
config IncomingMap 'IncomingMap2'
option Enable '1'
option Extension 'Extension2'
option Line 'Line2'
config IncomingMap 'IncomingMap3'
option Enable '0'
option Extension 'Extension2'
option Line 'Line1'
config OutgoingMap 'OutgoingMap1'
option Enable '1'
option Extension 'Extension1'
option Line 'Line1'
config OutgoingMap 'OutgoingMap2'
option Enable '1'
option Extension 'Extension2'
option Line 'Line2'
config CallingFeatures 'Set1'
option CallerIDEnable '1'
option CallerIDNameEnable '1'
option CallForwardUnconditionalEnable '0'
option CallForwardUnconditionalNumber ' '
option CallForwardOnBusyEnable '0'
option CallForwardOnBusyNumber ' '
option CallForwardOnNoAnswerEnable '0'
option CallForwardOnNoAnswerRingTimeout '24'
option CallForwardOnNoAnswerNumber ' '
option CallTransferEnable '1'
option MWIEnable '1'
option VMWIEnable '1'
option LineMessagesWaiting '0'
option AnonymousCallRejectionEnable '0'
option AnonymousCallEnable '1'
option DoNotDisturbEnable '1'
option RepeatDialEnable '1'
option VoiceMailEnable '1'
option CallPickUpEnable '1'
option CCBSEnable '1'
option CallWaitingEnable '0'
config CallingFeatures 'Set2'
option CallerIDEnable '1'
option CallerIDNameEnable '1'
option CallForwardUnconditionalEnable '0'
option CallForwardUnconditionalNumber ' '
option CallForwardOnBusyEnable '0'
option CallForwardOnBusyNumber ' '
option CallForwardOnNoAnswerEnable '0'
option CallForwardOnNoAnswerRingTimeout '24'
option CallForwardOnNoAnswerNumber ' '
option CallTransferEnable '1'
option MWIEnable '1'
option VMWIEnable '1'
option LineMessagesWaiting '0'
option AnonymousCallRejectionEnable '0'
option AnonymousCallEnable '1'
option DoNotDisturbEnable '1'
option RepeatDialEnable '1'
option VoiceMailEnable '1'
option CallPickUpEnable '1'
option CCBSEnable '1'
option CallWaitingEnable '1'
config NumberingPlan 'NumberingPlan1'
option MinimumNumberOfDigits '1'
option MaximumNumberOfDigits '15'
option InterDigitTimerStd '2000'
option InterDigitTimerOpen '2000'
option TerminationDigit '#'
config NumberingPlan 'NumberingPlan2'
option MinimumNumberOfDigits '5'
option MaximumNumberOfDigits '15'
option InterDigitTimerStd '2000'
option InterDigitTimerOpen '2000'
option TerminationDigit ' '
list PrefixList '2PrefixInfo1'
list PrefixList '2PrefixInfo2'
list PrefixList '2PrefixInfo3'
list PrefixList '2PrefixInfo4'
list PrefixList '2PrefixInfo5'
list PrefixList '2PrefixInfo6'
list PrefixList '2PrefixInfo7'
list PrefixList '2PrefixInfo8'
list PrefixList '2PrefixInfo9'
config NumberingPlan 'NumberingPlan3'
option MinimumNumberOfDigits '5'
option MaximumNumberOfDigits '15'
option InterDigitTimerStd '2000'
option InterDigitTimerOpen '2000'
option TerminationDigit '#'
list PrefixList '3PrefixInfo1'
config PrefixInfo '2PrefixInfo1'
option Enable '1'
option PrefixRange '*43#'
option PrefixMinNumberOfDigits '4'
option PrefixMaxNumberOfDigits '4'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CW_ACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '2PrefixInfo2'
option Enable '1'
option PrefixRange '#43#'
option PrefixMinNumberOfDigits '4'
option PrefixMaxNumberOfDigits '4'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CW_DEACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '2PrefixInfo3'
option Enable '1'
option PrefixRange '*21*(X+)#'
option PrefixMinNumberOfDigits '9'
option PrefixMaxNumberOfDigits '9'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CFU_ACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '2PrefixInfo4'
option Enable '1'
option PrefixRange '#21#'
option PrefixMinNumberOfDigits '4'
option PrefixMaxNumberOfDigits '4'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CFU_DEACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '2PrefixInfo5'
option Enable '1'
option PrefixRange '*67*(X+)#'
option PrefixMinNumberOfDigits '9'
option PrefixMaxNumberOfDigits '9'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CFB_ACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '2PrefixInfo6'
option Enable '1'
option PrefixRange '#67#'
option PrefixMinNumberOfDigits '4'
option PrefixMaxNumberOfDigits '4'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CFB_DEACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '2PrefixInfo7'
option Enable '1'
option PrefixRange '*61*(X+(*X+)?)#'
option PrefixMinNumberOfDigits '15'
option PrefixMaxNumberOfDigits '15'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CFNR_ACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '2PrefixInfo8'
option Enable '1'
option PrefixRange '#61#'
option PrefixMinNumberOfDigits '4'
option PrefixMaxNumberOfDigits '4'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CFNR_DEACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '2PrefixInfo9'
option Enable '1'
option PrefixRange '*31*'
option PrefixMinNumberOfDigits '4'
option PrefixMaxNumberOfDigits '4'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CA_ACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '3PrefixInfo1'
option Enable '1'
option PrefixRange '110|112'
option PrefixMinNumberOfDigits '7'
option PrefixMaxNumberOfDigits '7'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'X_IOPSYS_EU_EMERGENCY'
option FacilityActionArgument ' '
config DialPlan 'X_IOPSYS_EU_InternalNumber1'
option RegExp '1X#'

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,181 @@
# RO (Main)
config account 'map_board'
option HW_Has_Voice 'hw.board.hasVoice'
option HW_Has_DECT 'hw.board.hasDect'
option HW_Nr_Of_POTS_Ports 'hw.board.VoicePorts'
option HW_VoiceDSP 'hw.board.VoiceDSP'
option ProductID 'device.deviceinfo.ModelName'
option I3_VERSION 'device.deviceinfo.SoftwareVersion'
option SerialNumber 'device.deviceinfo.SerialNumber'
config account 'map_pots'
option Country 'voice.POTS.Region'
# Voice Service navigation paths
# Not used to initialize internal configuration
config navigation 'map_vs'
option Account 'voice.Client@.'
option Network 'voice.Client@.Network'
option VoIPProfile 'voice.Network@.VoIPProfile'
option CfAccount 'voice.Line@.CallingFeatures'
option CfPhone 'voice.Extension@.CallingFeatures'
option CodecList 'voice.Network@.CodecList'
option Codec 'voice.Codec@.Codec'
option OutgoingMapEnabled 'voice.OutgoingMap@.Enable'
option From_Phone 'voice.OutgoingMap@.Extension'
option Extension 'voice.Extension@.Provider'
option To_Account 'voice.OutgoingMap@.Line'
option Line 'voice.Line@.Provider'
option LineEnable 'voice.Line@.Enable'
option LineProvider 'voice.Line@.Provider'
option IncomingMapEnabled 'voice.IncomingMap@.Enable'
option From_Account 'voice.IncomingMap@.Line'
option To_Phone 'voice.IncomingMap@.Extension'
option ExtensionEnable 'voice.Extension@.Enable'
option ExtensionProvider 'voice.Extension@.Provider'
# Registration for account A-Z is associate with SIP.Clienti.Enable
# All parameters in this table are written to internal configuration
config account 'map_account'
option Registration 'voice.Client@.Enable'
option Display_Name ''
option PhoneNumber 'voice.Client@.RegisiterURI'
option Username 'voice.Client@.AuthUserName'
option Password 'voice.Client@.AuthPassword'
option SIP_Telephone_Syntax 'voice.Client@.E164Format'
option Device_Description 'voice.Client@.UserAgent'
# Network stuff associated with an account.
# All parameters in this table are written to internal configuration
config network 'map_net'
option Enable 'voice.Network@.Enable'
option Registration_Server 'voice.Network@.RegistrarServer'
option Outbound_Proxy 'voice.Network@.ProxyServer'
option Accept_From_Registered 'voice.Network@.AcceptFromProxyOnly'
option SIP_Port 'voice.Network@.RegistrarServerPort'
option SIP_Transport 'voice.Network@.RegistrarServerTransport'
option RegistrationPeriod 'voice.Network@.RegistrationPeriod'
option Registration_Interval 'voice.Network@.RegisterExpires'
option Reg_Failure_Interval 'voice.Network@.TimerRegistrationFailed'
option T1 'voice.Network@.TimerT1'
option UserAgentDomain 'voice.Network@.UserAgentDomain'
option SIP_SessTmrEnable 'voice.Network@.SIPSessionTimerEnable'
option SIP_SessTmrMode 'voice.Network@.SIPSessionTimerMode'
option SIP_SessTmrMsg 'voice.Network@.SIPSessionRefreshRequest'
option SIP_SessTmrRefresher 'voice.Network@.SIPSessionRefresher'
option SIP_MinSE 'voice.Network@.SIPSessionMinimumTimer'
option SIP_SessInterval 'voice.Network@.SIPSessionExpireInterval'
config VoIPProfile 'map_voip'
option Enable 'voice.VoIPProfile@.Enable'
option DTMF_Method 'voice.VoIPProfile@.DTMFMethod'
option RTP 'voice.VoIPProfile@.RTP'
config RTP 'map_rtp'
option RTP_Port_Base 'voice.@RTP@.LocalPortMin'
option RTP_Port_End 'voice.@RTP@.LocalPortMax'
config codecs 'map_codec'
option Codec 'voice.CodecProfile@.Codec'
option enable 'voice.CodecProfile@.Enable'
option ptime 'voice.CodecProfile@.PacketizationPeriod'
option dtx 'voice.CodecProfile@.SilenceSupression'
config fxsinfo 'map_fxs'
option Enable 'voice.FXS@.Enable'
option DialType 'voice.FXS@.DialType'
option TransmitGain 'voice.FXS@.TransmitGain'
option ReceiveGain 'voice.FXS@.ReceiveGain'
option EchoCancellationEnable 'voice.FXS@.EchoCancellationEnable'
config extensioninfo 'map_ext'
option Enable 'voice.Extension@.Enable'
option Internal_Number_Phone 'voice.Extension@.ExtensionNumber'
option Display_Name_Phone 'voice.Extension@.Name'
config capabilities 'map_capa'
option Call_Waiting_Enable 'voice.Capabilities@FacilityActions'
option Enable_Call_Diversion 'voice.Capabilities@FacilityActions'
config cs_account 'map_set'
option BusyCallWait 'voice.Set@.CallWaitingEnable'
option AlwaysDivert 'voice.Set@.CallForwardUnconditionalEnable'
option CFU_Number 'voice.Set@.CallForwardUnconditionalNumber'
option BusyDivert 'voice.Set@.CallForwardOnBusyEnable'
option CFB_Number 'voice.Set@.CallForwardOnBusyNumber'
option NoAnswDivert 'voice.Set@.CallForwardOnNoAnswerEnable'
option CFNR_Number 'voice.Set@.CallForwardOnNoAnswerNumber'
option CFNR_Timeout 'voice.Set@.CallForwardOnNoAnswerRingTimeout'
option Enable_Call_Transfer 'voice.Set@.CallTransferEnable'
option AnonymousReject 'voice.Set@.AnonymousCallRejectionEnable'
option AllowAnonymousConf 'voice.Set@.AnonymousCallEnable'
option CallerIDEnable 'voice.Set@.CallerIDEnable'
config cs_xvendor 'map_np_cs'
option np_sc_actCW 'voice.X_IOPSYS_EU_NpSc@.CW_ACT'
option np_sc_actCW_output 'voice.X_IOPSYS_EU_NpSc@.CW_OUT'
option np_sc_deactCW 'voice.X_IOPSYS_EU_NpSc@.CW_DEACT'
option np_sc_isactCW 'voice.X_IOPSYS_EU_NpSc@.CW_ISACT'
option np_sc_actCFU 'voice.X_IOPSYS_EU_NpSc@.CFU_ACT'
option np_sc_actCFU_output 'voice.X_IOPSYS_EU_NpSc@.CFU_OUT'
option np_sc_deactCFU 'voice.X_IOPSYS_EU_NpSc@.CFU_DEACT'
option np_sc_actCFB 'voice.X_IOPSYS_EU_NpSc@.CFB_ACT'
option np_sc_actCFB_output 'voice.X_IOPSYS_EU_NpSc@.CFB_OUT'
option np_sc_deactCFB 'voice.X_IOPSYS_EU_NpSc@.CFB_DEACT'
option np_sc_actCFNR 'voice.X_IOPSYS_EU_NpSc@.CFNR_ACT'
option np_sc_actCFNR_output 'voice.X_IOPSYS_EU_NpSc@.CFNR_OUT'
option np_sc_deactCFNR 'voice.X_IOPSYS_EU_NpSc@.CFNR_DEACT'
option np_sc_actRA 'voice.X_IOPSYS_EU_NpSc@.RA_ACT'
option np_sc_deactRA 'voice.X_IOPSYS_EU_NpSc@.RA_DEACT'
option np_sc_actAC 'voice.X_IOPSYS_EU_NpSc@.AC_ACT'
option np_sc_deactAC 'voice.X_IOPSYS_EU_NpSc@.AC_DEACT'
option np_sc_actAA 'voice.X_IOPSYS_EU_NpSc@.AA_ACT'
option np_sc_deactAA 'voice.X_IOPSYS_EU_NpSc@.AA_DEACT'
option np_sc_actAD 'voice.X_IOPSYS_EU_NpSc@.AD_ACT'
option np_sc_actAD_output 'voice.X_IOPSYS_EU_NpSc@.AD_OUT'
option np_sc_deactAD 'voice.X_IOPSYS_EU_NpSc@.AD_DEACT'
option np_sc_actMWSplash 'voice.X_IOPSYS_EU_NpSc@.MWI_SPLASH_ACT'
option np_sc_deactMWSplash 'voice.X_IOPSYS_EU_NpSc@.MWI_SPLASH_DEACT'
option np_sc_actMWTone 'voice.X_IOPSYS_EU_NpSc@.MWI_TONE_ACT'
option np_sc_deactMWTone 'voice.X_IOPSYS_EU_NpSc@.MWI_TONE_DEACT'
option np_sc_redial 'voice.X_IOPSYS_EU_NpSc@.REDIAL'
option np_sc_setMiscConf 'voice.X_IOPSYS_EU_NpSc@.SET_MISC'
config cc_xvendor 'map_np_in'
option np_in_limitExp 'voice.X_IOPSYS_EU_InternalNumber@.RegExp'
config cc_xvendor 'map_np_sh'
option sh_no_str 'voice.X_IOPSYS_EU_ShortNumber@.RegExp'
config cc_xvendor 'map_np_eme'
option np_eme 'voice.X_IOPSYS_EU_EmergencyNumber@.RegExp'
option np_eme_out 'voice.X_IOPSYS_EU_EmergencyNumber@.OutStr'
config cc_xvendor 'map_np_rn'
option np_rn 'voice.X_IOPSYS_EU_RegularNumber@.RegExp'
option np_rn_out 'voice.X_IOPSYS_EU_RegularNumber@.OutStr'
option np_rn_account 'voice.X_IOPSYS_EU_RegularNumber@.AccStr'
config cc_xvendor 'map_np_bn'
option np_bn 'voice.X_IOPSYS_EU_BarredNumber@.RegExp'
option np_bn_out 'voice.X_IOPSYS_EU_BarredNumber@.OutStr'
config TR104NumberingPlan 'map_np_tr'
option min_digits 'voice.NumberingPlan@.MinimumNumberOfDigits'
option max_digits 'voice.NumberingPlan@.MaximumNumberOfDigits'
option tmo_std 'voice.NumberingPlan@.InterDigitTimerStd'
option tmo_open 'voice.NumberingPlan@.InterDigitTimerOpen'
option term_digit 'voice.NumberingPlan@.TerminationDigit'
option prefix_list 'voice.NumberingPlan@.PrefixList'
config TR104NumberingPlanPrefix 'map_np_pf'
option enable 'voice.@PrefixInfo@.Enable'
option range 'voice.@PrefixInfo@.PrefixRange'
option prefix_min_digits 'voice.@PrefixInfo@.PrefixMinNumberOfDigits'
option prefix_max_digits 'voice.@PrefixInfo@.PrefixMaxNumberOfDigits'
option remove_digits 'voice.@PrefixInfo@.NumberOfDigitsToRemove'
option remove_pos 'voice.@PrefixInfo@.NumberOfDigitsToRemove'
option facility_act 'voice.@PrefixInfo@.FacilityAction'
option facility_arg 'voice.@PrefixInfo@.FacilityActionArgument'

View File

@@ -0,0 +1,56 @@
config static_prm 'defaults'
option Print_Control '4'
option Print_UDP_Addr '192.168.1.3'
option Print_UDP_Port '60000'
option Verbosity 'On'
option Failure_Log 'On'
option Message_Log 'On'
option Method_Trace 'Off'
option Dial_Cache_Size '0'
option Reverse_Fax_Detection '0'
option DSP_24 '0'
option DSP_36 '0'
option DSP_43 '0'
option Swap_Name_Nr_CID '0'
option R_Button_Lower_Lim '100'
option R_Button_Upper_Lim '800'
option HookOn_Delay '0'
option SupportLDD '0'
option LDD_Min_Break_Time '41'
option LDD_Max_Break_Time '94'
option LDD_Percent_Break '55'
option Tone_On_Hangup '1'
option BusyTone_On_Hangup '1'
option Enable_Analouge_Conf '0'
option PrackUsage '1'
option SIP_SupportedPath '0'
option IMS_Access_Network_Info ' '
option SIP_Reason_Protocol '0'
option SIP_Body_QOST '0'
option SIP_HistoryInfo '0'
option Customer_Spec2 '1'
option UTF8_Enable '0'
option RFC3325 '0'
option Accept_From_Registered '0'
option Polarity_Reversal '0'
option Closed_Dial_Plan '0'
option Netw_Dial '0'
option No_Answer_Tmo '180'
option UPnP_Enabled '0'
option NAT_Address ' '
option NAT_Address_From_SIP '0'
option HookOn_Transfer '0'
option Enable_Call_Transfer '1'
option CallerIDEnable '1'
option Multiparty_Transp '0'
option Presence_Indication '0'
option Login_Note ' '
option Login_Description ' '
option Logout_Note ' '
option Logout_Description ' '
option Resolve_Every_Transaction '2'
option Translate_Plus '1'
option Mid_Call_Services '0'
option Account_Restriction '0'
option Answering_Machine_Enable '0'

32
evoice/files/etc/init.d/evoice Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/sh /etc/rc.common
START=68
STOP=12
USE_PROCD=1
NAME=evoice
VOICE_UCI_CONFIG=voice
start_service() {
[ "$(db -q get hw.board.hasVoice)" = "1" ] || return
which endptmngr >/dev/null 2>&1 && {
echo "evoice can't be started since endptmngr is installed. Please remove endptmngr and retry"
return
}
procd_open_instance
procd_set_param command $NAME
procd_set_param respawn "5" "0" "3"
procd_close_instance
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger $VOICE_UCI_CONFIG
}

View File

@@ -0,0 +1,50 @@
{
"G.711ALaw": [
{
"BitRate": 64000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
],
"G.711MuLaw": [
{
"BitRate": 64000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
],
"G.722": [
{
"BitRate": 64000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
],
"G.726": [
{
"BitRate": 32000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
},
{
"BitRate": 24000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
],
"G.729": [
{
"BitRate": 8000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
],
"AMR": [
{
"BitRate": 7400,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
]
}

View File

@@ -0,0 +1,140 @@
{
"G.711MuLaw": [
{
"BitRate": 64000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"G.711ALaw": [
{
"BitRate": 64000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"G.726": [
{
"BitRate": 16000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 24000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 32000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 40000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"G.723.1": [
{
"BitRate": 5300,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 6300,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"G.729": [
{
"BitRate": 8000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"iLBC": [
{
"BitRate": 15200,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 13300,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"G.722": [
{
"BitRate": 64000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"AMR": [
{
"BitRate": 12200,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 10200,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 7950,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 7400,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 6700,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 5900,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 5150,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 4750,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"GSM-EFR": [
{
"BitRate": 12200,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"GSM-FR": [
{
"BitRate": 13200,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"GSM-HR": [
{
"BitRate": 5600,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
]
}

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -41,8 +41,32 @@ EXTRA_KCONFIG:= CONFIG_RGB_LED=m
MODULE_INCLUDE=-I$(PKG_BUILD_DIR)
# support compilation against BCM SDK kernel
include ../../broadcom/bcmkernel/bcm-kernel-toolchain.mk
ifeq ($(CONFIG_TARGET_brcmbca),y)
LINUX_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-4.19
# This assumes that the MODULES_SUBDIR set by OpenWrt is of the form
# lib/modules/4.19.235-abcdef where 4.19.235 is the version of our fake bcmlinux kernel
# and abcdef the git-commit.
# The kernel compiled by the Broadcom SDK has a uname -r of 4.19.235, i.e. without the git-commit.
# The assignment below removes the part after the - which puts modules in the right directory as
# long as the bcmlinux version matches the kernel version in the BCM SDK.
# So, this will only stop working in the time window where the BCM SDK has been updated
# but bcmlinux has not yet been updated.
MODULES_SUBDIR:=$(firstword $(subst -, ,$(MODULES_SUBDIR)))
TARGET_CROSS:=$(CONFIG_BRCM_ALT_TOOLCHAIN_BASE)/$(CONFIG_BRCM_ALT_ARM_TOOLCHAIN_TOPDIR)/bin/$(CONFIG_BRCM_ALT_ARM_TOOLCHAIN_PREFIX)-
ifeq ($(CONFIG_BCM_CHIP_ID),$(filter $(CONFIG_BCM_CHIP_ID),"63158" "6856" "6858"))
# These targets use a 64-bit kernel
LINUX_KARCH:=arm64
TARGET_CROSS:=$(CONFIG_BRCM_ALT_TOOLCHAIN_BASE)/$(CONFIG_BRCM_ALT_AARCH64_TOOLCHAIN_TOPDIR)/bin/$(CONFIG_BRCM_ALT_AARCH64_TOOLCHAIN_PREFIX)-
else ifeq ($(CONFIG_BCM_CHIP_ID),$(filter $(CONFIG_BCM_CHIP_ID),"6855" "6756" "47622" "63148" "63178"))
# These targets use a 32-bit arm-sfp kernel
LINUX_KARCH:=arm
TARGET_CROSS:=$(CONFIG_BRCM_ALT_TOOLCHAIN_BASE)/$(CONFIG_BRCM_ALT_ARMSFP_TOOLCHAIN_TOPDIR)/bin/$(CONFIG_BRCM_ALT_ARMSFP_TOOLCHAIN_PREFIX)-
endif
# For some reason, Broadcom's kernel does not set the include paths correctly when compiling out-of-tree modules
EXTRA_KCPPFLAGS:="-I $(LINUX_DIR)/../bcmkernel/include -I $(LINUX_DIR)/arch/arm/mach-bcm963xx/include"
endif
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)/kdevlinks/

View File

@@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=9.3.8
PKG_VERSION:=9.3.2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
PKG_SOURCE_VERSION:=09b7cd7a6b647dd8cbc038698af9298883b5c262
PKG_SOURCE_VERSION:=a68417ec44251e9f619f2682618b06dae083bd32
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip

View File

@@ -5,14 +5,14 @@ log() {
echo "${@}"|logger -t firewall.cwmp -p info
}
if [ ! -f "/var/state/icwmp" ]; then
if [ ! -f "/var/state/cwmp" ]; then
exit 0;
fi
zone_name=$(uci -c /var/state -q get icwmp.acs.zonename)
zone_name=$(uci -c /var/state -q get cwmp.acs.zonename)
port=$(uci -q get cwmp.cpe.port)
ipaddr=$(uci -c /var/state -q get icwmp.acs.ip)
ip6addr=$(uci -c /var/state -q get icwmp.acs.ip6)
ipaddr=$(uci -c /var/state -q get cwmp.acs.ip)
ip6addr=$(uci -c /var/state -q get cwmp.acs.ip6)
incoming_rule=$(uci -q get cwmp.cpe.incoming_rule|tr 'A-Z' 'a-z')
if [ -z "${zone_name}" ]; then
@@ -76,5 +76,5 @@ if [ "$?" -eq 0 ]; then
${cmd6}
fi
uci -c /var/state -q set icwmp.cpe.firewall_restart="init"
uci -c /var/state -q commit icwmp
uci -c /var/state -q set cwmp.cpe.firewall_restart="init"
uci -c /var/state -q commit cwmp

View File

@@ -14,13 +14,11 @@ handle_icwmp_update() {
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
# read status from var/state/icwmp
status=$(uci -q -c /var/state get icwmp.sess_status.current_status)
# read status from var/state/cwmp
status=$(uci -q -c /var/state get cwmp.sess_status.current_status)
if [ "$status" != "running" ]; then
log "Trigger out of bound inform, since last inform status was failure"
ubus -t 10 call tr069 inform >/dev/null 2>&1

View File

@@ -488,17 +488,20 @@ reload_service() {
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 ${default_wan_interface}
procd_open_trigger
json_add_array
json_add_string "" "interface.update"
json_add_array
json_add_array
json_add_string "" "run_script"
json_add_string "" "/etc/icwmpd/update.sh"
json_close_array
json_close_array
json_add_int "" "2000"
json_close_array
procd_close_trigger
}

View File

@@ -1,16 +1,16 @@
#
# Copyright (C) 2020-2023 IOPSYS Software Solutions AB
# Copyright (C) 2021 IOPSYS
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ieee1905
PKG_VERSION:=8.1.16
PKG_VERSION:=8.0.15
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=4843afa0069c8eff18c6bdde6a5dd76625dc1ac5
PKG_SOURCE_VERSION:=1717f97c054c232d393c91fa7e95a571bf893680
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

View File

@@ -67,10 +67,9 @@ CONFIG_PACKAGE_map-controller=m
CONFIG_PACKAGE_map-topology=y
CONFIG_PACKAGE_decollector=y
CONFIG_IEEE1905_CMDU_SA_IS_ALMAC=y
# Network #
CONFIG_PACKAGE_netmode=y
CONFIG_PACKAGE_owsd=m
CONFIG_PACKAGE_urlfilter=y
# System #

View File

@@ -1,26 +1,15 @@
#!/bin/bash
#! /bin/bash
function feeds_update {
heads=1
developer=0
override=1
while getopts "inh" opt; do
start=$(date -u +'%s')
while getopts "n" opt; do
case $opt in
i)
heads=0
;;
n)
override=0
;;
h|\?)
echo "Usage: ./iop feeds_update [-i] [-n] [-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 " -h - Display this help message and exit."
exit 1
;;
esac
done
@@ -28,42 +17,42 @@ function feeds_update {
cp .config .genconfig_config_bak
if [ $heads == 1 ]; then
if [ $developer == 1 ]; then
./scripts/feeds update -g
else
./scripts/feeds update
fi
#if -d argument is passed, clone feeds with ssh instead of http
if [ $developer == 1 ]; then
./scripts/feeds update -g
else
./scripts/feeds update
fi
./scripts/feeds update -ai || exit 1
./scripts/feeds update -ai
# 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 openwrt_core -a
fi
(
echo '# DO NOT EDIT. Autogenerated file by ./iop feeds_update'
echo 'FEED_DEVICES_DIRS:='
find feeds -type f -name .is-feed-devices-dir -printf 'FEED_DEVICES_DIRS+=$(TOPDIR)/%h'
) > target/linux/feed-devices/feed-devices-list.mk || exit 1
) > target/linux/feed-devices/feed-devices-list.mk
# targets need to be installed explicitly
for target in $(ls ./feeds/targets); do
./scripts/feeds install -f -p targets $target || exit 1
rm -f target/linux/$target
./scripts/feeds install -p targets $target
done
# install all packages
./scripts/feeds install -a || exit 1
./scripts/feeds install -a
# remove broken symlinks ( for packages that are no longer in the feed )
find -L package/feeds -maxdepth 2 -type l -delete || exit 1
find -L package/feeds -maxdepth 2 -type l -delete
cp .genconfig_config_bak .config
make defconfig || exit 1
make defconfig
# record when we last run this script
touch tmp/.iop_bootstrap || exit 1
touch tmp/.iop_bootstrap
# always return true
exit 0

View File

@@ -15,11 +15,10 @@ function genconfig {
target_config_path=""
brcmbca_feed="target/linux/feeds/brcmbca"
airoha_feed="target/linux/feeds/airoha"
x86_feed="target/linux/feeds/x86"
armvirt_feed="target/linux/feeds/armvirt"
mediatek_feed="target/linux/feeds/mediatek"
x86_feed="target/linux/feeds/iopsys-x86"
armvirt_feed="target/linux/feeds/iopsys-armvirt"
mediatek_feed="target/linux/feeds/iopsys-mediatek"
qualcomm_ipq95xx_feed="target/linux/feeds/ipq95xx"
qualcomm_ipq53xx_feed="target/linux/feeds/ipq53xx"
Red='\033[0;31m' # Red
Color_Off='\033[0m' # Text Reset
@@ -42,13 +41,19 @@ function genconfig {
}
function verify_config {
IFS=$'\n'
org=$(<.genconfig.config)
unset IFS
local num
local conf_opt
local conf_org
local conf_new
while read -r line
#echo "lines to check $tot_lines"
num=0
for line in $org
do
conf_opt=$(echo $line | grep "^[ #]*CONFIG_" | sed 's|.*\(CONFIG_[^ =]*\)[ =].*|\1|')
conf_opt=$(echo $line | grep CONFIG_ | sed 's|.*\(CONFIG_[^ =]*\)[ =].*|\1|')
if [ -n "${conf_opt}" ]
then
conf_org=$(find_last ${conf_opt} .genconfig.config)
@@ -69,7 +74,8 @@ function genconfig {
#echo -e "wanted [$conf_org] got [$conf_new]"
fi
fi
done < .genconfig.config
num=$((num+1))
done
}
# Takes a board name and returns the target name in global var $target
@@ -107,27 +113,32 @@ function genconfig {
[ -e $airoha_feed/genconfig ] &&
airoha=$(cd $airoha_feed; ./genconfig)
[ -e $x86_feed/genconfig ] &&
x86=$(cd $x86_feed; ./genconfig)
iopsys_x86=$(cd $x86_feed; ./genconfig)
[ -e $armvirt_feed/genconfig ] &&
armvirt=$(cd $armvirt_feed; ./genconfig)
iopsys_armvirt=$(cd $armvirt_feed; ./genconfig)
[ -e $mediatek_feed/genconfig ] &&
mediatek=$(cd $mediatek_feed; ./genconfig)
iopsys_mediatek=$(cd $mediatek_feed; ./genconfig)
[ -e $qualcomm_ipq95xx_feed/genconfig ] &&
ipq95xx=$(cd $qualcomm_ipq95xx_feed; ./genconfig)
[ -e $qualcomm_ipq53xx_feed/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 iopsys_x86 iopsys_armvirt iopsys_mediatek ipq95xx; do
echo "$list based boards:"
a=$(echo "${!list}" | sort)
for b in $a; do
for b in ${!list}; do
echo -e "\t$b"
done
done
return
fi
for p in $brcmbca; do
if [ $p == $profile ]; then
target="brcmbca"
target_config_path="$brcmbca_feed/config"
return
fi
done
for p in $airoha; do
if [ $p == $profile ]; then
target="airoha"
@@ -136,25 +147,25 @@ function genconfig {
fi
done
for p in $x86; do
for p in $iopsys_x86; do
if [ $p == $profile ]; then
target="x86"
target="iopsys_x86"
target_config_path="$x86_feed/config"
return
fi
done
for p in $armvirt; do
for p in $iopsys_armvirt; do
if [ $p == $profile ]; then
target="armvirt"
target="iopsys_armvirt"
target_config_path="$armvirt_feed/config"
return
fi
done
for p in $mediatek; do
for p in $iopsys_mediatek; do
if [ $p == $profile ]; then
target="mediatek"
target="iopsys_mediatek"
target_config_path="$mediatek_feed/config"
return
fi
@@ -167,22 +178,6 @@ function genconfig {
return
fi
done
for p in $ipq53xx; do
if [ $p == $profile ]; then
target="ipq53xx"
target_config_path="$qualcomm_ipq53xx_feed/config"
return
fi
done
for p in $brcmbca; do
if [ $p == $profile ]; then
target="brcmbca"
target_config_path="$brcmbca_feed/config"
return
fi
done
}
git remote -v | grep -qE '(git@|ssh://)' && {
@@ -362,15 +357,10 @@ function genconfig {
cat $target_config_path/$BOARDTYPE/config >> .config
echo "" >> .config
fi
# hack to support custom-devices until we have deprecated this genconfig-script...
if [ -f "feeds/custom_devices/devices/$target/config/$BOARDTYPE/config" ]; then
cat "feeds/custom_devices/devices/$target/config/$BOARDTYPE/config" >> .config
echo "" >> .config
fi
# Special handling for targets which use TARGET_DEVICES
case "$target" in
airoha | mediatek | brcmbca | ipq95xx | ipq53xx)
airoha | iopsys_mediatek | brcmbca | ipq95xx)
# This assumes the device name to be unique within one target,
# which is a fair assumption to make.
local subtarget="$(get_subtarget_for_device "${target/_/-}" "$BOARDTYPE")"
@@ -470,7 +460,7 @@ function genconfig {
if [ ! -e tmp/.iop_bootstrap ]; then
echo "You have not installed feeds. Running genconfig in this state would create a non functional configuration."
echo "Run: iop feeds_update"
exit 1
exit 0
fi
if [ $# -eq 0 ]; then
@@ -507,7 +497,7 @@ function genconfig {
CUSTREPO="${CUSTREPO:-git@dev.iopsys.eu:consumer/iopsys.git}"
setup_dirs
create_and_copy_files "$@" || exit 1
create_and_copy_files "$@"
fi
}

View File

@@ -14,11 +14,10 @@ function genconfig_min {
target_config_path=""
brcmbca_feed="target/linux/feeds/brcmbca"
airoha_feed="target/linux/feeds/airoha"
x86_feed="target/linux/feeds/x86"
armvirt_feed="target/linux/feeds/armvirt"
mediatek_feed="target/linux/feeds/mediatek"
x86_feed="target/linux/feeds/iopsys-x86"
armvirt_feed="target/linux/feeds/iopsys-armvirt"
mediatek_feed="target/linux/feeds/iopsys-mediatek"
qualcomm_ipq95xx_feed="target/linux/feeds/ipq95xx"
qualcomm_ipq53xx_feed="target/linux/feeds/ipq53xx"
Red='\033[0;31m' # Red
Color_Off='\033[0m' # Text Reset
@@ -41,13 +40,19 @@ function genconfig_min {
}
function verify_config {
IFS=$'\n'
org=$(<.genconfig.config)
unset IFS
local num
local conf_opt
local conf_org
local conf_new
while read -r line
#echo "lines to check $tot_lines"
num=0
for line in $org
do
conf_opt=$(echo $line | grep "^[ #]*CONFIG_" | sed 's|.*\(CONFIG_[^ =]*\)[ =].*|\1|')
conf_opt=$(echo $line | grep CONFIG_ | sed 's|.*\(CONFIG_[^ =]*\)[ =].*|\1|')
if [ -n "${conf_opt}" ]
then
conf_org=$(find_last ${conf_opt} .genconfig.config)
@@ -68,7 +73,8 @@ function genconfig_min {
#echo -e "wanted [$conf_org] got [$conf_new]"
fi
fi
done < .genconfig.config
num=$((num+1))
done
}
# Takes a board name and returns the target name in global var $target
@@ -106,27 +112,32 @@ function genconfig_min {
[ -e $airoha_feed/genconfig ] &&
airoha=$(cd $airoha_feed; ./genconfig)
[ -e $x86_feed/genconfig ] &&
x86=$(cd $x86_feed; ./genconfig)
iopsys_x86=$(cd $x86_feed; ./genconfig)
[ -e $armvirt_feed/genconfig ] &&
armvirt=$(cd $armvirt_feed; ./genconfig)
iopsys_armvirt=$(cd $armvirt_feed; ./genconfig)
[ -e $mediatek_feed/genconfig ] &&
mediatek=$(cd $mediatek_feed; ./genconfig)
iopsys_mediatek=$(cd $mediatek_feed; ./genconfig)
[ -e $qualcomm_ipq95xx_feed/genconfig ] &&
ipq95xx=$(cd $qualcomm_ipq95xx_feed; ./genconfig)
[ -e $qualcomm_ipq53xx_feed/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 iopsys_x86 iopsys_armvirt iopsys_mediatek ipq95xx; do
echo "$list based boards:"
a=$(echo "${!list}" | sort)
for b in $a; do
for b in ${!list}; do
echo -e "\t$b"
done
done
return
fi
for p in $brcmbca; do
if [ $p == $profile ]; then
target="brcmbca"
target_config_path="$brcmbca_feed/config"
return
fi
done
for p in $airoha; do
if [ $p == $profile ]; then
target="airoha"
@@ -135,25 +146,25 @@ function genconfig_min {
fi
done
for p in $x86; do
for p in $iopsys_x86; do
if [ $p == $profile ]; then
target="x86"
target="iopsys_x86"
target_config_path="$x86_feed/config"
return
fi
done
for p in $armvirt; do
for p in $iopsys_armvirt; do
if [ $p == $profile ]; then
target="armvirt"
target="iopsys_armvirt"
target_config_path="$armvirt_feed/config"
return
fi
done
for p in $mediatek; do
for p in $iopsys_mediatek; do
if [ $p == $profile ]; then
target="mediatek"
target="iopsys_mediatek"
target_config_path="$mediatek_feed/config"
return
fi
@@ -166,22 +177,6 @@ function genconfig_min {
return
fi
done
for p in $ipq53xx; do
if [ $p == $profile ]; then
target="ipq53xx"
target_config_path="$qualcomm_ipq53xx_feed/config"
return
fi
done
for p in $brcmbca; do
if [ $p == $profile ]; then
target="brcmbca"
target_config_path="$brcmbca_feed/config"
return
fi
done
}
git remote -v | grep -qE '(git@|ssh://)' && {
@@ -336,15 +331,10 @@ function genconfig_min {
cat $target_config_path/$BOARDTYPE/config >> .config
echo "" >> .config
fi
# hack to support custom-devices until we have deprecated this genconfig-script...
if [ -f "feeds/custom_devices/devices/$target/config/$BOARDTYPE/config" ]; then
cat "feeds/custom_devices/devices/$target/config/$BOARDTYPE/config" >> .config
echo "" >> .config
fi
# Special handling for targets which use TARGET_DEVICES
case "$target" in
airoha | mediatek | brcmbca | ipq95xx | ipq53xx)
airoha | iopsys_mediatek | brcmbca | ipq95xx)
# This assumes the device name to be unique within one target,
# which is a fair assumption to make.
local subtarget="$(get_subtarget_for_device "${target/_/-}" "$BOARDTYPE")"
@@ -438,7 +428,7 @@ function genconfig_min {
if [ ! -e tmp/.iop_bootstrap ]; then
echo "You have not installed feeds. Running genconfig in this state would create a non functional configuration."
echo "Run: iop feeds_update"
exit 1
exit 0
fi
if [ $# -eq 0 ]; then

View File

@@ -449,7 +449,7 @@ insert_feed_hash_in_feeds_config()
local feed=$1
local TO=$(cd feeds/${feed}; git rev-parse HEAD)
sed -i feeds.conf -e "/ ${feed} / s/\(.*\)[;^].*/\1^${TO}/"
sed -i feeds.conf -e "/ ${feed}/ s/\(.*\)[;^].*/\1^${TO}/"
git add feeds.conf
}

View File

@@ -10,8 +10,9 @@ PKG_VERSION:=7.2.99
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=f9f3fcd0f4140540db5bd41059bcca7ded083024
PKG_SOURCE_VERSION:=54d53295b5e4ca74884045d0fa6bb0dc279ace3d
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libdsl.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
endif
@@ -28,26 +29,14 @@ ifeq ($(CONFIG_TARGET_brcmbca),y)
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
else ifeq ($(CONFIG_TARGET_x86),y)
else ifeq ($(CONFIG_TARGET_iopsys_x86),y)
TARGET_PLATFORM=TEST
TARGET_CFLAGS +=-DIOPSYS_TEST
else ifeq ($(CONFIG_TARGET_armvirt),y)
else ifeq ($(CONFIG_TARGET_iopsys_armvirt),y)
TARGET_PLATFORM=TEST
TARGET_CFLAGS +=-DIOPSYS_TEST
endif
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/openssl \
-I$(STAGING_DIR)/usr/include/libnl3
MAKE_FLAGS += \
CFLAGS="$(TARGET_CFLAGS) -Wall -I./" \
LDFLAGS="$(TARGET_LDFLAGS)" \
FPIC="$(FPIC)" \
PLATFORM="$(TARGET_PLATFORM)" \
subdirs="$(subdirs)"
define Package/libdsl
SECTION:=libs
CATEGORY:=Libraries

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libeasy
PKG_VERSION:=7.2.100
PKG_VERSION:=7.2.99
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=32db1b79bd88eba85a3e7518dbbbd1e29f4b06d9
PKG_SOURCE_VERSION:=bca982ba1e3c59fc900d297145b731dd0ad588a0
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

View File

@@ -5,13 +5,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libethernet
PKG_VERSION:=7.2.104
PKG_VERSION:=7.2.102
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=d777636ca43302a95e571ab030ec44ef50905570
PKG_SOURCE_VERSION:=30df74671870acef99036217e002d1f4418c8d4f
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libethernet.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
endif
@@ -19,6 +20,7 @@ endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=LGPL-2.1-only
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=+TARGET_brcmbca:bcmkernel
include $(INCLUDE_DIR)/package.mk
@@ -29,18 +31,21 @@ ifeq ($(CONFIG_TARGET_brcmbca),y)
-I$(STAGING_DIR)/usr/include/bcm963xx/shared/opensource/include/bcm963xx \
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
else ifeq ($(CONFIG_TARGET_x86),y)
else ifeq ($(CONFIG_TARGET_iopsys_x86),y)
TARGET_PLATFORM=TEST
TARGET_CFLAGS +=-DIOPSYS_TEST
else ifeq ($(CONFIG_TARGET_armvirt),y)
else ifeq ($(CONFIG_TARGET_iopsys_armvirt),y)
TARGET_PLATFORM=TEST
TARGET_CFLAGS +=-DIOPSYS_TEST
else ifeq ($(CONFIG_TARGET_airoha),y)
TARGET_PLATFORM=ECONET
TARGET_CFLAGS +=-DIOPSYS_ECONET
else ifeq ($(CONFIG_TARGET_mediatek),y)
TARGET_PLATFORM=MEDIATEK
TARGET_CFLAGS +=-DIOPSYS_MEDIATEK
else ifeq ($(CONFIG_TARGET_ipq95xx),y)
TARGET_PLATFORM=IPQ95XX
TARGET_CFLAGS +=-DIPQ95XX
else ifeq ($(CONFIG_TARGET_iopsys_mediatek),y)
TARGET_PLATFORM=LINUX
TARGET_CFLAGS +=-DIOPSYS_LINUX
else
$(info Unexpected CONFIG_TARGET, use default LINUX)
TARGET_PLATFORM=LINUX
@@ -65,7 +70,7 @@ define Package/libethernet
SUBMENU:=IOPSYS HAL libs
MENU:=1
TITLE:= Ethernet library (libethernet)
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_airoha:ecnt_api +TARGET_brcmbca:bcmkernel
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_airoha:ecnt_api
endef
define Package/libethernet/description

View File

@@ -5,13 +5,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libqos
PKG_VERSION:=7.2.101
PKG_VERSION:=7.2.100
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=93ca0a66d6f82bca208bbe52b75ed582b20aa094
PKG_SOURCE_VERSION:=3a37af002fee1c0d35da49cefee2d24ee92a5d0a
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libqos.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
endif
@@ -19,6 +20,7 @@ endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=LGPL-2.1-only
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=+TARGET_brcmbca:bcmkernel
include $(INCLUDE_DIR)/package.mk
@@ -28,10 +30,10 @@ ifeq ($(CONFIG_TARGET_brcmbca),y)
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
else ifeq ($(CONFIG_TARGET_x86),y)
else ifeq ($(CONFIG_TARGET_iopsys_x86),y)
TARGET_PLATFORM=TEST
TARGET_CFLAGS +=-DIOPSYS_TEST
else ifeq ($(CONFIG_TARGET_armvirt),y)
else ifeq ($(CONFIG_TARGET_iopsys_armvirt),y)
TARGET_PLATFORM=TEST
TARGET_CFLAGS +=-DIOPSYS_TEST
else ifeq ($(CONFIG_TARGET_airoha),y)
@@ -40,7 +42,7 @@ else ifeq ($(CONFIG_TARGET_airoha),y)
else ifeq ($(CONFIG_TARGET_ipq95xx),y)
TARGET_PLATFORM=IPQ95XX
TARGET_CFLAGS +=-DIPQ95XX
else ifeq ($(CONFIG_TARGET_mediatek),y)
else ifeq ($(CONFIG_TARGET_iopsys_mediatek),y)
TARGET_PLATFORM=LINUX
TARGET_CFLAGS +=-DIOPSYS_LINUX
else
@@ -67,7 +69,7 @@ define Package/libqos
SUBMENU:=IOPSYS HAL libs
MENU:=1
TITLE:= QoS library (libqos)
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_brcmbca:bcmkernel
DEPENDS+=+libnl +libnl-route +libeasy
endef
define Package/libqos/config

View File

@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libvoice-airoha
PKG_RELEASE:=1
PKG_VERSION:=1.0.5
PKG_VERSION:=1.0.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:=3f4cdca981b30d54ec5a426775fdcec2a63f83d9
PKG_SOURCE_VERSION:=2a6ef141747ad0f7b32a536b5b5bd174834a7af5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -48,7 +48,7 @@
"bitrate": 15.2
},
"gsm": {
"name": "AMR",
"name": "GSM-AMR",
"ptime_min": 10,
"ptime_max": 30,
"ptime_default": 20,

View File

@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libvoice-broadcom
PKG_RELEASE:=1
PKG_VERSION:=1.0.1
PKG_VERSION:=1.0.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:=548f8fccc9f8f0b5dd6bb39bdd9cac8659400cb6
PKG_SOURCE_VERSION:=401a392a72e2933f527eb92466faaf2907c38730
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -48,7 +48,7 @@
"bitrate": 15.2
},
"gsm": {
"name": "AMR",
"name": "GSM-AMR",
"ptime_min": 10,
"ptime_max": 30,
"ptime_default": 20,

View File

@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libvoice-d2
PKG_RELEASE:=1
PKG_VERSION:=1.0.6
PKG_VERSION:=1.0.2
PKG_LICENSE:=PROPRIETARY
PKG_LICENSE_FILES:=LICENSE
@@ -17,7 +17,7 @@ LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
PKG_SOURCE_VERSION:=062a265754b93a865cfcd2745f200aa09fb4a668
PKG_SOURCE_VERSION:=7ca102e62fa439a7188f2c5e4c72e3fcfd3fb28a
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -15,6 +15,14 @@
"ptime_increment": 10,
"bitrate": 64
},
"g729a": {
"name": "G.729a",
"ptime_min": 10,
"ptime_max": 40,
"ptime_default": 20,
"ptime_increment": 10,
"bitrate": 64
},
"g729": {
"name": "G.729",
"ptime_min": 10,

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libwifi
PKG_VERSION:=7.2.107
PKG_VERSION:=7.2.100
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=1bd819ac21f86a0956b1f69ef1d110665e240a5f
PKG_SOURCE_VERSION:=d6e14d7a0b747ca09d3f6843cea9ae3584d18dd3
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
@@ -30,11 +30,11 @@ ifeq ($(CONFIG_TARGET_brcmbca),y)
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
else ifeq ($(CONFIG_TARGET_x86),y)
else ifeq ($(CONFIG_TARGET_iopsys_x86),y)
TARGET_PLATFORM=TEST
TARGET_WIFI_TYPE=TEST
TARGET_CFLAGS +=-DIOPSYS_TEST
else ifeq ($(CONFIG_TARGET_armvirt),y)
else ifeq ($(CONFIG_TARGET_iopsys_armvirt),y)
TARGET_PLATFORM=TEST
TARGET_WIFI_TYPE=TEST
TARGET_CFLAGS +=-DIOPSYS_TEST
@@ -44,9 +44,9 @@ else ifeq ($(CONFIG_TARGET_airoha),y)
TARGET_CFLAGS +=-DIOPSYS_ECONET
else ifeq ($(CONFIG_TARGET_ipq95xx),y)
TARGET_PLATFORM=IPQ95XX
TARGET_WIFI_TYPE=QUALCOMM MAC80211
TARGET_WIFI_TYPE=MAC80211
TARGET_CFLAGS +=-DIPQ95XX
else ifeq ($(CONFIG_TARGET_mediatek),y)
else ifeq ($(CONFIG_TARGET_iopsys_mediatek),y)
TARGET_PLATFORM=LINUX
TARGET_WIFI_TYPE=MAC80211
TARGET_CFLAGS +=-DIOPSYS_LINUX

View File

@@ -1,14 +1,14 @@
#
# Copyright (C) 2020-2023 IOPSYS Software Solutions AB
# Copyright (C) 2020-22 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=map-agent
PKG_VERSION:=4.3.3.10
PKG_VERSION:=4.3.1.1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=644884a8b421fd830f793b94779876395eecd8e6
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
PKG_SOURCE_VERSION:=a6c5d7cbbc6363e123cfacc9333e5ae507f6dcd7
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE

View File

@@ -8,7 +8,6 @@ config agent 'agent'
option eth_onboards_wifi_bhs '0'
# option controller_macaddr '0a:1b:2c:3d:4e:50'
option scan_on_boot_only '0'
list map_port 'all'
config dynamic_backhaul
option missing_bh_timer '60'

View File

@@ -175,7 +175,6 @@ validate_agent_config() {
create_dir() {
mkdir -p /var/run/multiap
mkdir -p /etc/multiap
}
start_service() {

View File

@@ -1,14 +1,13 @@
#
# Copyright (C) 2020-2023 IOPSYS Software Solutions AB
# Copyright (C) 2020-22 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=map-controller
PKG_VERSION:=4.3.0.8
PKG_VERSION:=4.3.0.3
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=0d83f8acd66a4cb97f2f123149696334d7f03e6e
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
PKG_SOURCE_VERSION:=fb600940ac54456bcde650ccee7055f7c9bb785b
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)

View File

@@ -70,6 +70,7 @@ validate_ap_section() {
'encryption:or("sae", "sae+aes", "psk2",
"psk2+aes", "sae-mixed", "sae-mixed+aes",
"none", "psk-mixed", "psk-mixed+aes",
"wpa", "wpa+aes", "wpa2", "wpa2+aes",
"psk", "psk+aes")' \
'key:string' \
'vid:range(1,65535):1' \
@@ -155,10 +156,6 @@ validate_controller_config() {
return 0
}
create_dir() {
mkdir -p /etc/multiap
}
start_service() {
local enabled
@@ -168,8 +165,6 @@ start_service() {
config_get_bool enabled controller enabled 1
[ "$enabled" -eq 0 ] && return
create_dir
procd_open_instance
procd_set_param command "/usr/sbin/mapcontroller" "-d"

View File

@@ -18,9 +18,5 @@ config TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI
enabled through TOPOLOGYD_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
through which such features would be exposed.
config TOPOLOGYD_HOST_WAN_STATS
bool "Enable wan statistics collection per hosts"
default y
endmenu
endif

View File

@@ -6,11 +6,11 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=map-topology
PKG_VERSION:=2.5.1.24
PKG_VERSION:=2.5.1.19
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_VERSION:=9f15e813c39ff23cef27975ce138bd3286f30adf
PKG_SOURCE_VERSION:=7b2f5dc086207dd74c5c56421dea65b7dabb6944
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/map-topology.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
@@ -52,9 +52,6 @@ ifeq ($(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT),y)
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI)\\\"
endif
ifeq ($(CONFIG_TOPOLOGYD_HOST_WAN_STATS),y)
TARGET_CFLAGS += -DHOST_WAN_STATS
endif
ifeq ($(LOCAL_DEV),1)
define Build/Prepare

View File

@@ -20,12 +20,7 @@ compare_mcast_proxy_upstream() {
for dev in $upstream; do
if [ "$l3device" == "$dev" ]; then
running=$(ubus call service list '{"name": "mcast"}' | jsonfilter -e '@.mcast.instances')
if [ -z "${running}" ];then
/etc/init.d/mcast start
else
ubus call uci commit '{"config":"mcast"}'
fi
ubus call uci commit '{"config":"mcast"}'
exit
fi
done

View File

@@ -95,13 +95,8 @@ interfaces_ok(){
dev_section=$(ubus call uci get '{"config":"network", "type":"device", "match":{"name":"'"$itf"'"}}' | jsonfilter -e @.values | jq keys[])
# mcast config is outdated, simply generate as per new logic
if [ -z "$dev_section" ]; then
# check if the itf is a native interface && return 1
native=$(ubus call uci get '{"config":"ports", "type":"ethport", "match":{"ifname":"'"$itf"'"}}' | jsonfilter -e @.values | jq keys[])
[ -z "native" ] && return 1
fi
[ -z "$dev_section" ] && return 1
done
return 0
}

View File

@@ -1,7 +1,6 @@
#!/bin/sh
. /lib/mcast/common.sh
. /lib/functions/network.sh
include /lib/network
@@ -10,150 +9,54 @@ PROG_EXE=/usr/sbin/mcproxy
PROG_PARAMS=
PROG_PARAMS_SEPARATOR=:
__device_is_bridge() {
local device="$2"
local devsec__="$(uci show network | grep name=.*$device | cut -d'.' -f2)"
local sectype="$(uci -q get network.$devsec__)"
local devtype="$(uci -q get network.$devsec__.type)"
[ "$sectype" != "device" -o "$devtype" != "bridge" ] && return 1
eval "$1=$devsec__"
}
device_is_bridge() {
local device="$1"
local devsec=
__device_is_bridge devsec "$device" || return 1
}
device_ports() {
local device="$1"
local devsec=
if __device_is_bridge devsec "$device"; then
echo "$(uci get network.$devsec.ports)"
else
echo "$device"
fi
}
device_has_ip() {
local protocol="$1"
local device="$2"
# Read the openwrt interface for the device.
# Device can have multiple logical interfaces like wan and wan6
# but same l3 device
# NB. Don't use 'get_network_of' here.
# This function fails in some uci configurations for interfaces that refer
# to a device indirectly.
local ifaces=$(ubus call network.interface dump | jsonfilter -e "@.interface[@.device='$device'].interface")
for iface in $ifaces; do
local ip=
case "$protocol" in
"igmp") network_get_ipaddr ip "$iface" ;;
"mld") network_get_ipaddr6 ip "$iface" ;;
esac
[ -n "$ip" ] && return
done
return 1
setup_mcast_mode() {
unused(){ :;}
}
config_mcproxy_interfaces() {
local protocol="$1"
local upstreams="$2"
local downstreams="$3"
local exceptions="$4"
if [ -z "$upstreams" ] || [ -z "$downstreams" ]; then
return 1
fi
local upstreams="$1"
local downstreams="$2"
local exceptions="$3"
local str_up=""
for upstream in $upstreams; do
device_has_ip "$protocol" "$upstream" || continue
str_up="$str_up \"$upstream\""
done
[ -z "$str_up" ] && return 1
local str_down=""
for downstream in $downstreams; do
device_has_ip "$protocol" "$downstream" || continue
str_down="$str_down \"$downstream\""
done
[ -z "$str_down" ] && return 1
echo -e "pinstance main:$str_up ==>$str_down;\n" >> $CONFFILE
for excp in $exceptions; do
local filter=""
case $excp in
*/*)
ip_start="$(ipcalc.sh $excp | grep IP | awk '{print substr($0,4)}')"
ip_end="$(ipcalc.sh $excp | grep BROADCAST | awk '{print substr($0,11)}')"
filter="$filter ($ip_start - $ip_end | *)"
;;
*)
filter="$filter ($excp | *)"
;;
esac
for upstream in $str_up; do
echo "pinstance main upstream $upstream in blacklist table{$filter };" >> $CONFFILE
echo "pinstance main upstream $upstream out blacklist table{$filter };" >> $CONFFILE
if [ -n "$upstreams" ]; then
for upstream in $upstreams; do
str_up="$str_up \"$upstream\""
done
for downstream in $str_down; do
echo "pinstance main downstream $downstream in blacklist table{$filter };" >> $CONFFILE
echo "pinstance main downstream $downstream out blacklist table{$filter };" >> $CONFFILE
done
done
}
config_sysfs_mcast_snooping() {
local downstreams="$1"
for downstream in $downstreams; do
if device_is_bridge "$downstream"; then
echo 1 > /sys/class/net/$downstream/bridge/multicast_snooping
fi
done
}
config_sysfs_mcast_fastleave() {
local downstreams="$1"
local fastleave="$2"
local prt
for downstream in $downstreams; do
for prt in $(device_ports $downstream); do
if [ -f /sys/class/net/$prt/brport/multicast_fast_leave ]; then
echo $fastleave > /sys/class/net/$prt/brport/multicast_fast_leave
fi
done
done
}
config_sysfs_mcast_mode() {
local downstreams=$1
local mcast_mode=$2
local prt
local mcast_flood=
if [ $mcast_mode == "2" ]; then # disable mcast flood
mcast_flood=0
else
mcast_flood=1
fi
for downstream in $downstreams; do
for prt in $(device_ports $downstream); do
if [ -f /sys/class/net/$prt/brport/multicast_flood ]; then
echo $mcast_flood > /sys/class/net/$prt/brport/multicast_flood
fi
local str_down=""
if [ -n "$downstreams" ]; then
for downstream in $downstreams; do
str_down="$str_down \"$downstream\""
done
fi
if [ ! -z $downstream ]; then
echo -e "pinstance main:$str_up ==>$str_down;\n" >> $CONFFILE
fi
if [ -z "$exceptions" ] || [ -z "$upstreams" ]; then
return
fi
for upstream in $upstreams; do
local filter=""
for excp in $exceptions; do
case $excp in
*/*)
ip_start="$(ipcalc.sh $excp | grep IP | awk '{print substr($0,4)}')"
ip_end="$(ipcalc.sh $excp | grep BROADCAST | awk '{print substr($0,11)}')"
filter="$filter ($ip_start - $ip_end | *)"
;;
*)
filter="$filter ($excp | *)"
;;
esac
done
echo "pinstance main upstream \"$upstream\" in blacklist table{$filter };" >> $CONFFILE
echo "pinstance main upstream \"$upstream\" out blacklist table{$filter };" >> $CONFFILE
done
}
@@ -169,7 +72,6 @@ config_mcproxy_instance() {
local exceptions=
local upstreams=
local downstreams=
local mcast_mode=2 # default value 2 is for blocking mode
CONFFILE=/var/etc/mcproxy_"$protocol".conf
rm -f $CONFFILE
@@ -194,7 +96,6 @@ config_mcproxy_instance() {
upstreams=$igmp_p_up_interfaces
downstreams=$igmp_p_down_interfaces
mcast_mode=$igmp_p_mode
elif [ "$protocol" == "mld" ]; then
case "$version" in
[1-2])
@@ -214,24 +115,16 @@ config_mcproxy_instance() {
upstreams=$mld_p_up_interfaces
downstreams=$mld_p_down_interfaces
mcast_mode=$mld_p_mode
fi
[ -n "$max_groups" ] && echo -e "max_groups $max_groups;" >> $CONFFILE
[ -n "$robustness" ] && echo -e "rv $robustness;" >> $CONFFILE
[ -n "$query_interval" ] && echo -e "qi $query_interval;" >> $CONFFILE
[ -n "$q_resp_interval" ] && echo -e "qri $q_resp_interval;" >> $CONFFILE
[ -n "$last_mem_q_int" ] && echo -e "lmqi $last_mem_q_int;" >> $CONFFILE
[ -n "$fast_leave" ] && echo -e "fastleave $fast_leave;\n" >> $CONFFILE
config_mcproxy_interfaces "$protocol" "$upstreams" "$downstreams" "$exceptions" || return
# 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"
[ -n "$upstreams" ] && [ -n "$downstreams" ] &&
config_mcproxy_interfaces "$upstreams" "$downstreams" "$exceptions"
PROG_PARAMS="${PROG_PARAMS} -f ${CONFFILE}${PROG_PARAMS_SEPARATOR}"
}
@@ -249,16 +142,8 @@ config_mcproxy() {
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
if [ -z "${PROG_PARAMS}" ]; then
exit 0
fi
config_mcproxy
}

View File

@@ -1,163 +0,0 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
. /lib/functions.sh
read_mcast_stats() {
local temp_igmp_file='/tmp/igmp_stats_'$$
local snooping_stats='/tmp/igmp_snooping_stats'
local old_mod_time=$(date +%s 2>/dev/null -r "$snooping_stats")
# Sending signal to mcproxy to dump multicast data in /tmp/igmp_snooping_stats
local mcast_pids=$(pidof mcproxy)
for pid in $mcast_pids
do
$(kill -10 $pid)
done
# Wait for signal is being processed by mcproxy
if [ -n "$mcast_pids" ]; then
for i in 1 2 3; do
local new_mod_time=$(date +%s 2>/dev/null -r "$snooping_stats")
[ -n "$new_mod_time" ] && [ "$new_mod_time" != "$old_mod_time" ] && break
sleep 0.1
done
fi
cat "$snooping_stats" > "$temp_igmp_file"
local mcast_addrs=""
local ifaces=""
while read line; do
# reading each line
case $line in
br-*)
found_iface=0
snoop_iface="$(echo $line | awk -F ' ' '{ print $1 }')"
if [ -z "$ifaces" ]; then
ifaces="$snoop_iface"
continue
fi
IFS=" "
for ifx in $ifaces; do
if [ $ifx == $snoop_iface ]; then
found_iface=1
break
fi
done
if [ $found_iface -eq 0 ]; then
ifaces="$ifaces $snoop_iface"
continue
fi
;;
esac
done < "$temp_igmp_file"
while read line; do
# reading each line
case $line in
br-*)
found_ip=0
grp_ip="$(echo $line | awk -F ' ' '{ print $2 }')"
if [ -z "$mcast_addrs" ]; then
mcast_addrs="$grp_ip"
continue
fi
IFS=" "
for ip_addr in $mcast_addrs; do
if [ $ip_addr == $grp_ip ]; then
found_ip=1
break
fi
done
if [ $found_ip -eq 0 ]; then
mcast_addrs="$mcast_addrs $grp_ip"
continue
fi
;;
esac
done < "$temp_igmp_file"
json_init
json_add_array "snooping"
json_add_object ""
IFS=" "
for intf in $ifaces; do
while read line; do
# reading each line
case $line in
br-*)
snoop_iface="$(echo $line | awk -F ' ' '{ print $1 }')"
if [ "$snoop_iface" != "$intf" ]; then
continue
fi
json_add_string "interface" "$intf"
json_add_array "groups"
break
;;
esac
done < "$temp_igmp_file"
IFS=" "
for gip_addr in $mcast_addrs; do
grp_obj_added=0
while read line; do
# reading each line
case $line in
br-*)
snoop_iface="$(echo $line | awk -F ' ' '{ print $1 }')"
if [ "$snoop_iface" != "$intf" ]; then
continue
fi
grp_ip="$(echo $line | awk -F ' ' '{ print $2 }')"
if [ "$grp_ip" != "$gip_addr" ]; then
continue
fi
if [ $grp_obj_added -eq 0 ]; then
json_add_object ""
gip="$(ipcalc.sh $gip_addr | grep IP | awk '{print substr($0,4)}')"
json_add_string "groupaddr" "$gip"
json_add_array "clients"
grp_obj_added=1
fi
json_add_object ""
host_ip="$(echo $line | awk -F ' ' '{ print $3 }')"
h_ip="$(ipcalc.sh $host_ip | grep IP | awk '{print substr($0,4)}')"
json_add_string "ipaddr" "$h_ip"
src_port="$(echo $line | awk -F ' ' '{ print $4 }')"
json_add_string "device" "$src_port"
timeout="$(echo $line | awk -F ' ' '{ print $5 }')"
json_add_int "timeout" "$timeout"
json_close_object #close the associated device object
;;
esac
done < "$temp_igmp_file"
json_close_array #close the associated devices array
json_close_object # close the groups object
done # close the loop for group addresses
json_close_array #close the groups array
done # close the loop for interfaces
json_close_object # close the snooping object
json_close_array # close the snooping array
json_dump
rm -f "$temp_igmp_file"
}
case "$1" in
list)
echo '{ "stats":{} }'
;;
call)
case "$2" in
stats)
read_mcast_stats
;;
esac
;;
esac

View File

@@ -23,7 +23,7 @@ config OBUSPA_MTP_ENABLE_COAP
default y
config OBUSPA_CONTROLLER_MTP_VERIFY
bool "Enable verification of controller MTP before processing the message"
bool "Enable verification of MQTT response topic before processing the message"
default n
endmenu
endif

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=obuspa
PKG_VERSION:=7.0.2.22.1
PKG_VERSION:=7.0.2.4
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
PKG_SOURCE_VERSION:=001a4cf2de7e20f322ac48ef73c6b5b84db39992
PKG_SOURCE_VERSION:=902d7a9586c3faa16337fef71f538daa878a47b8
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip

View File

@@ -12,7 +12,7 @@ KEEP_FILE="/lib/upgrade/keep.d/obuspa"
RESET_FILE="/tmp/obuspa/obuspa_param_reset.txt"
SQL_DB_FILE="/tmp/obuspa/usp.db"
DB_DUMP="/tmp/obuspa/usp.dump_$(date +%s)"
DB_DUMP="/tmp/obuspa/usp.dump"
BASEPATH=""
INSTANCE_COUNT=0
@@ -55,28 +55,38 @@ db_set_sql()
value="$*"
if [ -n "${param}" ] && [ -n "${value}" ]; then
if grep -q "${param} " ${DB_DUMP}; then
value="${value//\//\\/}"
sed -i "s/${param} .*/${param} \"${value}\"/g" ${DB_DUMP}
else
echo "${param} \"${value}\"" >> ${DB_DUMP}
fi
${PROG} -f ${SQL_DB_FILE} -c dbset "${param}" "${value}" >/dev/null 2>&1
fi
}
db_del_sql()
{
local param
param="${1}"
if [ -n "${param}" ]; then
${PROG} -f ${SQL_DB_FILE} -c dbdel "${param}" >/dev/null 2>&1
fi
}
db_set()
{
# if sql db dump file present, update it
if [ -f "${DB_DUMP}" ]; then
# if sql db present, update sql db
# else update reset file
if [ -f "${SQL_DB_FILE}" ]; then
db_set_sql "$@"
else
db_set_reset_file "$@"
fi
}
dump_db()
update_db_dump()
{
${PROG} -v0 -f ${SQL_DB_FILE} -c show database |awk '/^Device./ || /^Internal./ {print $1 " \"" $3 "\""}' | sort > ${DB_DUMP}
if [ -f "${DB_DUMP}" ]; then
rm ${DB_DUMP}
${PROG} -f ${SQL_DB_FILE} -c show database |sort > ${DB_DUMP}
fi
}
# if db present then check if it matches with existing instances
@@ -92,7 +102,7 @@ get_base_path()
count=0
if [ -f "${DB_DUMP}" ]; then
path=$(grep "${refpath}\d.Alias \"${value}\"" ${DB_DUMP})
path=$(grep "${refpath}\d.Alias => ${value}" ${DB_DUMP})
path=${path%.*}
if [ -z "${path}" ]; then
path=$(grep -o "${refpath}\d" ${DB_DUMP} |sort -r|head -n 1)
@@ -196,10 +206,6 @@ validate_obuspa_section()
'debug:bool:0' \
'prototrace:bool:0' \
'log_level:uinteger' \
'min_num_to_group:uinteger' \
'max_group_sep:uinteger' \
'max_cache_time:uinteger' \
'ipc_timeout:uinteger' \
'log_dest:string' \
'db_file:string' \
'role_file:file'
@@ -228,10 +234,7 @@ validate_controller_section()
'Host:string' \
'Port:port' \
'Path:string' \
'EnableEncryption:bool' \
'PeriodicNotifInterval:uinteger' \
'SessionMode:string:Allow'
'EnableEncryption:bool'
}
validate_subscription_section()
@@ -256,7 +259,6 @@ validate_mtp_section()
'mqtt:string' \
'stomp:string' \
'Reference:string' \
'PublishQoS:uinteger' \
'EnableEncryption:bool'
}
@@ -308,6 +310,7 @@ configure_localagent()
}
db_set Device.LocalAgent.EndpointID "${EndpointID}"
update_db_dump
}
update_reset_reason()
@@ -324,7 +327,7 @@ configure_controller()
local EndpointID Enable
local Protocol Destination
local Topic mqtt stomp assigned_role_name AssignedRole ParameterName
local Host Port Path EnableEncryption Reference SessionMode PeriodicNotifInterval
local Host Port Path EnableEncryption Reference
local dm_ref sec
sec="${1}"
@@ -361,15 +364,6 @@ configure_controller()
db_set "${BASEPATH}.Alias" "${sec}"
db_set "${BASEPATH}.Enable" "${Enable}"
db_set "${BASEPATH}.EndpointID" "${EndpointID}"
if [ -n "${PeriodicNotifInterval}" ]; then
db_set "${BASEPATH}.PeriodicNotifInterval" "${PeriodicNotifInterval}"
fi
if [ -n "${SessionMode}" ]; then
db_set "${BASEPATH}.E2ESession.SessionMode" "${SessionMode}"
fi
if [ -n "${assigned_role_name}" ]; then
AssignedRole=$(get_role_index "${assigned_role_name}")
fi
@@ -410,6 +404,9 @@ configure_controller()
db_set "${BASEPATH}.BootParameter.${_pnum}.ParameterName" "${param}"
_pnum=$(( _pnum + 1 ))
done
db_set
update_db_dump
}
configure_subscription()
@@ -502,6 +499,7 @@ configure_challenges()
sec="${1}"
validate_challenge_section "${1}" || {
log "Validation of challenge section failed"
exit 1;
}
sec="${sec/challenge_/cpe-}"
@@ -534,7 +532,7 @@ configure_challenges()
configure_mtp() {
local Enable Protocol ResponseTopicConfigured
local Path Port EnableEncryption PublishQoS
local Path Port EnableEncryption
local stomp mqtt dm_ref sec
sec="${1}"
@@ -573,9 +571,6 @@ configure_mtp() {
if [ "${Protocol}" = "MQTT" ]; then
db_set "${BASEPATH}.MQTT.Reference" "${dm_ref}"
db_set "${BASEPATH}.MQTT.ResponseTopicConfigured" "${ResponseTopicConfigured}"
if [ -n "${PublishQoS}" ]; then
db_set "${BASEPATH}.MQTT.PublishQoS" "${PublishQoS}"
fi
elif [ "${Protocol}" = "STOMP" ]; then
db_set "${BASEPATH}.STOMP.Reference" "${dm_ref}"
db_set "${BASEPATH}.STOMP.Destination" "${Destination}"
@@ -587,6 +582,8 @@ configure_mtp() {
db_set "${BASEPATH}.WebSocket.Port" "${Port}"
db_set "${BASEPATH}.WebSocket.EnableEncryption" "${EnableEncryption}"
fi
db_set
update_db_dump
}
configure_stomp_connection() {
@@ -617,6 +614,8 @@ configure_stomp_connection() {
db_set "${BASEPATH}.EnableEncryption" "${EnableEncryption}"
db_set "${BASEPATH}.EnableHeartbeats" "${EnableHeartbeats}"
db_set "${BASEPATH}.VirtualHost" "${VirtualHost}"
db_set
update_db_dump
}
configure_mqtt_client() {
@@ -646,6 +645,9 @@ configure_mqtt_client() {
db_set "${BASEPATH}.ProtocolVersion" "${ProtocolVersion}"
db_set "${BASEPATH}.TransportProtocol" "${TransportProtocol}"
db_set "${BASEPATH}.ClientID" "${ClientID}"
db_set
update_db_dump
}
@@ -699,9 +701,6 @@ configure_obuspa() {
fi
if [ -f "${RESET_FILE}" ]; then
if [ -f "${SQL_DB_FILE}" ]; then
mv ${SQL_DB_FILE} ${SQL_DB_FILE}.old
fi
procd_append_param command -r ${RESET_FILE}
fi
@@ -746,9 +745,9 @@ get_param_value_from_dump()
return 0
fi
value="$(grep "^${param} " ${DB_DUMP}|awk '{print $2}')"
value="$(grep "^${param} " ${DB_DUMP}|awk '{print $3}')"
echo "${value//\"/}"
echo "$value"
}
update_uci_sec()
@@ -772,7 +771,7 @@ sync_db_controller()
{
local cntrs copts sec pvalue protocol
copts="Enable EndpointID AssignedRole PeriodicNotifInterval"
copts="Enable EndpointID AssignedRole"
popts="Destination Topic Reference Host Port Path EnableEncryption"
cntrs="$(get_instances_from_db_dump Device.LocalAgent.Controller.)"
@@ -805,7 +804,7 @@ sync_db_localagent_mtp()
local mtps opts popts sec pvalue protocol
opts="Enable"
popts="ResponseTopicConfigured Destination Port Path Reference EnableEncryption PublishQoS"
popts="ResponseTopicConfigured Destination Port Path Reference EnableEncryption"
ropts="mqtt stomp"
mtps="$(get_instances_from_db_dump Device.LocalAgent.MTP.)"
@@ -921,8 +920,10 @@ delete_sql_db_entry_with_pattern()
return 0;
fi
#log "Deleting with pattern [${pattern}] from ${DB_DUMP}"
sed -i "/${pattern}/d" ${DB_DUMP}
params="$(grep "${pattern}" ${DB_DUMP}|awk '{print $1}')"
for p in ${params}; do
db_del_sql "${p}"
done
}
check_n_delete_db()
@@ -938,7 +939,7 @@ check_n_delete_db()
r="${3}"
sec="${sec/${t}_/cpe-}"
path=$(grep "${r}\d.Alias \"${sec}\"" ${DB_DUMP})
path=$(grep "${r}\d.Alias => ${sec}" ${DB_DUMP})
path=${path%.*}
delete_sql_db_entry_with_pattern "${path}"
@@ -966,42 +967,28 @@ db_init()
reason="${1}"
mkdir -p /tmp/obuspa/
# Load configuration
config_load $CONFIGURATION
config_get SQL_DB_FILE global db_file "/tmp/obuspa/usp.db"
if [ -f "${SQL_DB_FILE}.old" ] && [ ! -f "${SQL_DB_FILE}" ]; then
log "Copying old db, since new db not present ..."
mv ${SQL_DB_FILE}.old ${SQL_DB_FILE}
fi
# Dump datamodel parameters from DB
if [ -f "${SQL_DB_FILE}" ]; then
dump_db
${PROG} -f ${SQL_DB_FILE} -c show database |sort > ${DB_DUMP}
fi
# In case of Reboot or service restart update the uci
# from usp.db file
# Only sync uci with db in case of non service triggers
if [ -f "${DB_DUMP}" ] && [ "${reason}" != "update" ]; then
# Only do this if db have reasonable data
val="$(awk 'END{print NR}' ${DB_DUMP})"
if [ "$val" -gt 15 ]; then
log "Syncing obuspa uci with usp.db ...."
sync_uci_with_db
fi
sync_uci_with_db
fi
# remove entries from db if deleted from uci, only in case of reload
# remove entries from db if deleted from uci
if [ -f "${DB_DUMP}" ] && [ "${reason}" = "update" ] && [ -f "/tmp/obuspa/obuspa" ]; then
log "Deleting entries from usp.db if uci not present ...."
reverse_update_db_with_uci
fi
# Remove reset file if present
[ -f "${RESET_FILE}" ] && mv ${RESET_FILE} ${RESET_FILE}.old
[ -f "${RESET_FILE}" ] && rm -f ${RESET_FILE}
#log "Create reset file ...."
config_load $CONFIGURATION
global_init
config_foreach configure_localagent localagent
@@ -1022,9 +1009,8 @@ db_init()
uci_commit ${CONFIGURATION}
cp /etc/config/obuspa /tmp/obuspa/
if [ -f "${DB_DUMP}" ]; then
mv ${DB_DUMP} ${RESET_FILE}
fi
[ -f "${DB_DUMP}" ] && rm -f ${DB_DUMP}
return 0;
}
@@ -1036,8 +1022,8 @@ register_service()
configure_obuspa
procd_set_param respawn \
"${respawn_threshold:-10}" \
"${respawn_timeout:-10}" "${respawn_retry:-5}"
"${respawn_threshold:-5}" \
"${respawn_timeout:-10}" "${respawn_retry:-3}"
procd_set_param watch bbfdm
procd_close_instance

View File

@@ -1,117 +0,0 @@
diff --git a/src/core/device.h b/src/core/device.h
index 5ca0782..ee6d88c 100644
--- a/src/core/device.h
+++ b/src/core/device.h
@@ -157,6 +157,9 @@ int DEVICE_CONTROLLER_Start(void);
void DEVICE_CONTROLLER_Stop(void);
int DEVICE_CONTROLLER_FindInstanceByEndpointId(char *endpoint_id);
int DEVICE_CONTROLLER_QueueBinaryMessage(mtp_send_item_t *msi, char *endpoint_id, char *usp_msg_id, mtp_reply_to_t *mtp_reply_to, time_t expiry_time);
+#ifdef OBUSPA_CONTROLLER_MTP_VERIFY
+bool DEVICE_CONTROLLER_IsMTPAllowed(char *endpoint_id, mtp_reply_to_t *mrt);
+#endif
bool DEVICE_CONTROLLER_IsMTPConfigured(char *endpoint_id, mtp_protocol_t protocol);
char *DEVICE_CONTROLLER_FindEndpointIdByInstance(int instance);
char *DEVICE_CONTROLLER_FindEndpointByMTP(mtp_reply_to_t *mrt);
diff --git a/src/core/device_controller.c b/src/core/device_controller.c
index ae609f5..a6335f5 100644
--- a/src/core/device_controller.c
+++ b/src/core/device_controller.c
@@ -900,6 +900,78 @@ int DEVICE_CONTROLLER_QueueBinaryMessage(mtp_send_item_t *msi, char *endpoint_id
return USP_ERR_OK;
}
+#ifdef OBUSPA_CONTROLLER_MTP_VERIFY
+/*********************************************************************//**
+**
+** DEVICE_CONTROLLER_IsMTPAllowed
+**
+** Determines whether an MTP is allowed to be used by the specified controller
+** This function is used by ValidateUspRecord() to determine whether to process a received USP message
+**
+** \param endpoint_id - Endpoint ID of controller that sent a USP message
+** \param mrt - pointer to structure specifying on which MTP the message was received
+**
+** \return true if the MTP is allowed, false otherwise
+**
+**************************************************************************/
+bool DEVICE_CONTROLLER_IsMTPAllowed(char *endpoint_id, mtp_reply_to_t *mrt)
+{
+ controller_t *cont = FindEnabledControllerByEndpointId(endpoint_id);
+ controller_mtp_t *mtp;
+
+ // Disallow if no controller instance is found
+ if (cont == NULL)
+ {
+ return false;
+ }
+
+ mtp = FindFirstEnabledMtp(cont, mrt->protocol);
+
+#ifdef ENABLE_WEBSOCKETS
+ // Allow websocket server if no other MTP is configured
+ if ((mrt->protocol == kMtpProtocol_WebSockets) && (mrt->wsserv_conn_id != INVALID))
+ {
+ return mtp == NULL;
+ }
+#endif
+
+ // Disallow if there is no MTP configured with matching protocol
+ if ((mtp == NULL) || (mtp->protocol != mrt->protocol))
+ {
+ return false;
+ }
+
+ // Check that the configured MTP matches the MTP on which the message was received
+ switch(mtp->protocol)
+ {
+#ifndef DISABLE_STOMP
+ case kMtpProtocol_STOMP:
+ return mtp->stomp_connection_instance == mrt->stomp_instance;
+#endif
+
+#ifdef ENABLE_COAP
+ case kMtpProtocol_CoAP:
+ return true; // More detailed checks are not implemented for CoAP
+#endif
+
+#ifdef ENABLE_MQTT
+ case kMtpProtocol_MQTT:
+ return mtp->mqtt_connection_instance == mrt->mqtt_instance;
+#endif
+
+#ifdef ENABLE_WEBSOCKETS
+ case kMtpProtocol_WebSockets:
+ return (mrt->wsclient_cont_instance == cont->instance) && (mrt->wsclient_mtp_instance == mtp->instance);
+#endif
+ default:
+ TERMINATE_BAD_CASE(mtp->protocol);
+ break;
+ }
+
+ return false;
+}
+#endif
+
/*********************************************************************//**
**
** DEVICE_CONTROLLER_IsMTPConfigured
diff --git a/src/core/msg_handler.c b/src/core/msg_handler.c
index 8313342..a953562 100644
--- a/src/core/msg_handler.c
+++ b/src/core/msg_handler.c
@@ -759,6 +759,15 @@ int ValidateUspRecord(UspRecord__Record *rec, mtp_reply_to_t *mrt)
return USP_ERR_RECORD_FIELD_INVALID;
}
+#ifdef OBUSPA_CONTROLLER_MTP_VERIFY
+ // Exit if the controller is not allowed to use the MTP on which the message was received
+ if (DEVICE_CONTROLLER_IsMTPAllowed(rec->from_id, mrt) == false)
+ {
+ USP_ERR_SetMessage("%s: Ignoring message from endpoint_id=%s (unauthorized MTP)", __FUNCTION__, rec->from_id);
+ return USP_ERR_PERMISSION_DENIED;
+ }
+#endif
+
// Exit if the controller is unknown
cur_msg_controller_instance = DEVICE_CONTROLLER_FindInstanceByEndpointId(rec->from_id);
if (cur_msg_controller_instance == INVALID)

View File

@@ -10,7 +10,7 @@
{
--- a/src/core/data_model.h
+++ b/src/core/data_model.h
@@ -325,6 +325,7 @@ void DATA_MODEL_DumpSchema(void);
@@ -324,6 +324,7 @@ void DATA_MODEL_DumpSchema(void);
void DATA_MODEL_DumpInstances(void);
char DATA_MODEL_GetJSONParameterType(char *path);
int DATA_MODEL_SetParameterInDatabase(char *path, char *value);

View File

@@ -1,6 +1,6 @@
--- a/src/core/data_model.c
+++ b/src/core/data_model.c
@@ -1242,7 +1242,7 @@ int DATA_MODEL_NotifyInstanceAdded(char
@@ -1239,7 +1239,7 @@ int DATA_MODEL_NotifyInstanceAdded(char
// Exit if instance already exists - nothing to do
if (exists)
{
@@ -9,7 +9,7 @@
return USP_ERR_CREATION_FAILURE;
}
@@ -1327,7 +1327,7 @@ int DATA_MODEL_NotifyInstanceDeleted(cha
@@ -1324,7 +1324,7 @@ int DATA_MODEL_NotifyInstanceDeleted(cha
// Exit if instance does not exist - nothing to do
if (exists == false)
{

View File

@@ -1,6 +1,8 @@
diff --git a/src/core/bdc_exec.c b/src/core/bdc_exec.c
index 3670361..6a6325d 100644
--- a/src/core/bdc_exec.c
+++ b/src/core/bdc_exec.c
@@ -547,11 +547,19 @@ int StartSendingReport(bdc_connection_t
@@ -547,11 +547,19 @@ int StartSendingReport(bdc_connection_t *bc)
// Set the list of headers
bc->headers = NULL;
@@ -23,6 +25,8 @@
if (bc->flags & BDC_FLAG_GZIP)
{
diff --git a/src/core/bdc_exec.h b/src/core/bdc_exec.h
index ff37a2d..ee29c85 100644
--- a/src/core/bdc_exec.h
+++ b/src/core/bdc_exec.h
@@ -53,6 +53,9 @@ void BDC_EXEC_ScheduleExit(void);
@@ -36,6 +40,8 @@
+#define BDC_FLAG_HEADER_PER_COL 0x00000040 // If set, report format in header would be csv ParameterPerColumn
#endif
diff --git a/src/core/device_bulkdata.c b/src/core/device_bulkdata.c
index a7d1b3e..fab9731 100755
--- a/src/core/device_bulkdata.c
+++ b/src/core/device_bulkdata.c
@@ -67,9 +67,12 @@
@@ -72,7 +78,7 @@
} profile_ctrl_params_t;
//------------------------------------------------------------------------------
@@ -208,6 +217,7 @@ int Validate_BulkDataEncodingType(dm_req
@@ -208,6 +217,7 @@ int Validate_BulkDataEncodingType(dm_req_t *req, char *value);
int Validate_BulkDataReportingInterval(dm_req_t *req, char *value);
int Validate_BulkDataReference(dm_req_t *req, char *value);
int Validate_BulkDataReportFormat(dm_req_t *req, char *value);
@@ -80,7 +86,7 @@
int Validate_BulkDataReportTimestamp(dm_req_t *req, char *value);
int Validate_BulkDataCompression(dm_req_t *req, char *value);
int Validate_BulkDataHTTPMethod(dm_req_t *req, char *value);
@@ -236,6 +246,8 @@ bulkdata_profile_t *bulkdata_find_profil
@@ -236,6 +246,8 @@ bulkdata_profile_t *bulkdata_find_profile(int profile_id);
int bulkdata_calc_report_map(bulkdata_profile_t *bp, kv_vector_t *report_map);
int bulkdata_reduce_to_alt_name(char *spec, char *path, char *alt_name, char *out_buf, int buf_len);
char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timestamp, char *report_format);
@@ -89,7 +95,7 @@
unsigned char *bulkdata_compress_report(profile_ctrl_params_t *ctrl, char *input_buf, int input_len, int *p_output_len);
int bulkdata_schedule_sending_http_report(profile_ctrl_params_t *ctrl, bulkdata_profile_t *bp, unsigned char *json_report, int report_len);
int bulkdata_start_profile(bulkdata_profile_t *bp);
@@ -250,6 +262,7 @@ char *bulkdata_platform_calc_uri_query_s
@@ -250,6 +262,7 @@ char *bulkdata_platform_calc_uri_query_string(kv_vector_t *escaped_map);
int bulkdata_platform_get_param_refs(int profile_id, param_ref_vector_t *param_refs);
void bulkdata_expand_param_ref(param_ref_entry_t *pr, group_get_vector_t *ggv);
void bulkdata_append_to_result_map(param_ref_entry_t *pr, group_get_vector_t *ggv, kv_vector_t *report_map);
@@ -129,7 +135,7 @@
// Device.BulkData.Profile.{i}.HTTP
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.HTTP.URL", "", NULL, NotifyChange_BulkDataURL, DM_STRING);
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.HTTP.Username", "", NULL, NULL, DM_STRING);
@@ -591,9 +611,10 @@ int Validate_BulkDataProtocol(dm_req_t *
@@ -591,9 +611,10 @@ int Validate_BulkDataProtocol(dm_req_t *req, char *value)
int Validate_BulkDataEncodingType(dm_req_t *req, char *value)
{
// Exit if trying to set a value outside of the range we accept
@@ -142,10 +148,12 @@
return USP_ERR_INVALID_VALUE;
}
@@ -676,6 +697,32 @@ int Validate_BulkDataReportFormat(dm_req
@@ -674,6 +695,32 @@ int Validate_BulkDataReportFormat(dm_req_t *req, char *value)
return USP_ERR_OK;
}
/*********************************************************************//**
**
+/*********************************************************************//**
+**
+** Validate_BulkDataCSVReportFormat
+**
+** Validates Device.BulkData.Profile.{i}.CSVEncoding.ReportFormat
@@ -170,12 +178,10 @@
+ return USP_ERR_OK;
+}
+
+/*********************************************************************//**
+**
** Validate_BulkDataReportTimestamp
/*********************************************************************//**
**
** Validates Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp
@@ -1970,6 +2017,14 @@ int bulkdata_platform_get_profile_contro
** Validate_BulkDataReportTimestamp
@@ -1970,6 +2017,14 @@ int bulkdata_platform_get_profile_control_params(bulkdata_profile_t *bp, profile
return err;
}
@@ -190,7 +196,7 @@
// Exit if unable to get ReportTimestamp
USP_SNPRINTF(path, sizeof(path), "Device.BulkData.Profile.%d.JSONEncoding.ReportTimestamp", bp->profile_id);
err = DATA_MODEL_GetParameterValue(path, ctrl_params->report_timestamp, sizeof(ctrl_params->report_timestamp), 0);
@@ -1986,6 +2041,46 @@ int bulkdata_platform_get_profile_contro
@@ -1986,6 +2041,46 @@ int bulkdata_platform_get_profile_control_params(bulkdata_profile_t *bp, profile
return err;
}
@@ -237,7 +243,7 @@
return USP_ERR_OK;
}
@@ -2222,7 +2317,7 @@ void bulkdata_process_profile_http(bulkd
@@ -2222,7 +2317,7 @@ void bulkdata_process_profile_http(bulkdata_profile_t *bp)
{
int err;
report_t *cur_report;
@@ -246,7 +252,7 @@
profile_ctrl_params_t ctrl;
unsigned char *compressed_report;
int compressed_len;
@@ -2261,10 +2356,23 @@ void bulkdata_process_profile_http(bulkd
@@ -2261,10 +2356,23 @@ void bulkdata_process_profile_http(bulkdata_profile_t *bp)
}
// Exit if unable to generate the report
@@ -274,7 +280,7 @@
return;
}
@@ -2273,14 +2381,14 @@ void bulkdata_process_profile_http(bulkd
@@ -2273,14 +2381,14 @@ void bulkdata_process_profile_http(bulkdata_profile_t *bp)
USP_LOG_Info("BULK DATA: using compression method=%s", ctrl.compression);
if (enable_protocol_trace)
{
@@ -293,7 +299,7 @@
}
// NOTE: From this point on, only the compressed_report exists
@@ -2310,9 +2418,15 @@ void bulkdata_process_profile_usp_event(
@@ -2310,9 +2418,15 @@ void bulkdata_process_profile_usp_event(bulkdata_profile_t *bp)
kv_vector_t event_args;
kv_pair_t kv;
report_t *cur_report;
@@ -310,7 +316,7 @@
// Exit if the MTP has not been connected to successfully after bootup
// This is to prevent BDC events being enqueued before the Boot! event is sent (the Boot! event is only sent after successfully connecting to the MTP).
@@ -2321,20 +2435,62 @@ void bulkdata_process_profile_usp_event(
@@ -2321,20 +2435,62 @@ void bulkdata_process_profile_usp_event(bulkdata_profile_t *bp)
goto exit;
}
@@ -384,7 +390,7 @@
}
// When sending via USP events, only one report is ever sent in each USP event
@@ -2354,10 +2510,16 @@ void bulkdata_process_profile_usp_event(
@@ -2354,10 +2510,16 @@ void bulkdata_process_profile_usp_event(bulkdata_profile_t *bp)
bp->num_retained_reports = 1;
// Exit if unable to generate the report
@@ -404,7 +410,7 @@
return;
}
@@ -2365,15 +2527,15 @@ void bulkdata_process_profile_usp_event(
@@ -2365,15 +2527,15 @@ void bulkdata_process_profile_usp_event(bulkdata_profile_t *bp)
// Construct event_args manually to avoid the overhead of a malloc and copy of the report in KV_VECTOR_Add()
kv.key = "Data";
@@ -423,10 +429,12 @@
// From the point of view of this code, the report(s) have been successfully sent, so don't retain them
// NOTE: Sending of the reports successfully is delegated to the USP notification retry mechanism
@@ -2835,6 +2997,219 @@ char *bulkdata_generate_json_report(bulk
@@ -2833,6 +2995,219 @@ char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timesta
return result;
}
/*********************************************************************//**
**
+/*********************************************************************//**
+**
+** append_string_to_target
+**
+** concatenates the src string with target string in newly allocated memory
@@ -638,12 +646,10 @@
+ return output;
+}
+
+/*********************************************************************//**
+**
** bulkdata_compress_report
/*********************************************************************//**
**
** Compresses the report to send
@@ -2986,9 +3361,18 @@ int bulkdata_schedule_sending_http_repor
** bulkdata_compress_report
@@ -2986,9 +3361,18 @@ int bulkdata_schedule_sending_http_report(profile_ctrl_params_t *ctrl, bulkdata_
flags |= BDC_FLAG_DATE_HEADER;
}

View File

@@ -1,72 +0,0 @@
#
# Copyright (C) 2023 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=obuspc
PKG_VERSION:=1.0.1.1
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa-test-controller.git
PKG_SOURCE_VERSION:=f1f721bc1a4feaf63c7f7837eb7b0c86111e2f71
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
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
define Package/obuspc
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=USP Controller
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl
endef
define Package/obuspc/description
OB-USP-Controller is a local usp controller based on User Services Platform (USP).
endef
TARGET_CFLAGS += \
-D_GNU_SOURCE \
-Wall \
-Werror
CONFIGURE_ARGS += \
--localstatedir="/tmp/" \
--enable-stomp \
--enable-coap \
--enable-mqtt \
--enable-websockets
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/obuspa-test-controller/* $(PKG_BUILD_DIR)/
$(Build/Patch)
endef
endif
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/
$(INSTALL_BIN) ./files/etc/init.d/obuspc $(1)/etc/init.d/
$(INSTALL_BIN) ./files/etc/uci-defaults/99-fix-agent-endpoint $(1)/etc/uci-defaults/
$(INSTALL_DATA) ./files/etc/config/obuspc $(1)/etc/config/
endef
$(eval $(call BuildPackage,obuspc))

View File

@@ -1,19 +0,0 @@
config obuspc 'global'
option enabled '1'
option debug '1'
option log_level '1'
option prototrace '1'
config mqtt 'mqtt'
option BrokerAddress '127.0.0.1'
option BrokerPort '1883'
option TransportProtocol 'TCP/IP'
config controller 'controller'
option EndpointID 'proto::interop-usp-controller'
option Protocol 'MQTT'
option ResponseTopicConfigured '/usp/controller'
option mqtt 'mqtt'
config agent 'agent'
option Topic '/usp/endpoint'

View File

@@ -1,349 +0,0 @@
#!/bin/sh /etc/rc.common
START=99
STOP=01
USE_PROCD=1
PROG=/usr/sbin/obuspc
CONFIGURATION=obuspc
RESET_FILE="/tmp/usp/obuspc_param_reset.txt"
SQL_DB_FILE="/tmp/usp/uspc.db"
BASEPATH=""
INSTANCE_COUNT=0
. /usr/share/libubox/jshn.sh
global_init()
{
BASEPATH=""
INSTANCE_COUNT=0
}
log()
{
echo "$*"|logger -t obuspc.init -p debug
}
db_set_reset_file()
{
local param value
param="${1}"
shift
value="$*"
if [ -n "${param}" ] && [ -n "${value}" ]; then
echo "${param} \"${value}\"">>${RESET_FILE}
else
echo >>${RESET_FILE}
fi
}
db_set()
{
db_set_reset_file "$@"
}
# if db present then check if it matches with existing instances
# fallback to max instance present + 1
# In case of no db get the count
get_base_path()
{
local refpath value path count
refpath="${1}"
value="${2}"
path=""
count=0
if [ -z "${path}" ]; then
INSTANCE_COUNT=$(( INSTANCE_COUNT + 1 ))
path="${refpath}${INSTANCE_COUNT}"
fi
BASEPATH="${path}"
}
get_refrence_path()
{
local dmref value path
dmref="${1}"
value="${2}"
path=""
path=$(grep "${dmref}\d.Alias " ${RESET_FILE}|grep -w "${value}")
path=${path%.*}
echo "${path}"
}
validate_global_section()
{
uci_validate_section ${CONFIGURATION} obuspc "${1}" \
'enabled:bool:1' \
'debug:bool:0' \
'prototrace:bool:0' \
'log_level:uinteger' \
'log_dest:string' \
'db_file:string'
}
validate_mqtt_client_section()
{
uci_validate_section ${CONFIGURATION} mqtt "${1}" \
'Enable:bool:1' \
'BrokerAddress:string' \
'BrokerPort:port:1883' \
'Username:string' \
'Password:string' \
'ProtocolVersion:or("3.1", "3.1.1","5.0"):5.0' \
'TransportProtocol:or("TCP/IP","TLS"):TCP/IP' \
'ClientID:string'
}
validate_controller_section()
{
uci_validate_section ${CONFIGURATION} mtp "${1}" \
'EndpointID:string' \
'Protocol:or("MQTT", "WebSocket")' \
'ResponseTopicConfigured:string' \
'Destination:string' \
'Port:port' \
'Path:string' \
'mqtt:string' \
'stomp:string' \
'Reference:string' \
'EnableEncryption:bool:0'
}
configure_controller() {
local EndpointID Protocol ResponseTopicConfigured
local Destination Path Port EnableEncryption Reference
local stomp mqtt dm_ref sec
sec="${1}"
validate_controller_section "${1}" || {
log "Validation of mtp section failed"
return 1;
}
if [ -z "${EndpointID}" ]; then
log "EndpointID not defined for controller"
return 1;
fi
db_set Device.LocalAgent.EndpointID "${EndpointID}"
sec="${sec/mtp_/cpe-}"
get_base_path "Device.LocalAgent.MTP." "${sec}"
if [ -z "${BASEPATH}" ]; then
log "Failed to get path [$BASEPATH]"
return 1;
fi
if [ -z "${Protocol}" ]; then
log "Protocol not defined for the mtp[${1}] section"
return 1;
fi
dm_ref=""
if [ -z "${Reference}" ]; then
if [ "${Protocol}" = "STOMP" ]; then
stomp="${stomp/stomp_/cpe-}"
dm_ref=$(get_refrence_path "Device.STOMP.Connection." "${stomp}")
elif [ "${Protocol}" = "MQTT" ]; then
mqtt="${mqtt/mqtt_/cpe-}"
dm_ref=$(get_refrence_path "Device.MQTT.Client." "${mqtt}")
fi
else
dm_ref="${Reference}"
fi
db_set "${BASEPATH}.Alias" "${sec}"
db_set "${BASEPATH}.Enable" "1"
db_set "${BASEPATH}.Protocol" "${Protocol}"
if [ "${Protocol}" = "MQTT" ]; then
db_set "${BASEPATH}.MQTT.Reference" "${dm_ref}"
db_set "${BASEPATH}.MQTT.ResponseTopicConfigured" "${ResponseTopicConfigured}"
elif [ "${Protocol}" = "STOMP" ]; then
db_set "${BASEPATH}.STOMP.Reference" "${dm_ref}"
db_set "${BASEPATH}.STOMP.Destination" "${Destination}"
elif [ "${Protocol}" = "CoAP" ]; then
db_set "${BASEPATH}.CoAP.Path" "${Path}"
db_set "${BASEPATH}.CoAP.Port" "${Port}"
elif [ "${Protocol}" = "WebSocket" ]; then
db_set "${BASEPATH}.WebSocket.Path" "${Path}"
db_set "${BASEPATH}.WebSocket.Port" "${Port}"
db_set "${BASEPATH}.WebSocket.EnableEncryption" "${EnableEncryption}"
fi
db_set
}
validate_agent_section()
{
uci_validate_section ${CONFIGURATION} agent "${1}" \
'name:string' \
'EndpointID:string' \
'Topic:string'
}
configure_agent() {
local EndpointID Topic name
local stomp mqtt dm_ref sec
sec="${1}"
validate_agent_section "${1}" || {
log "Validation of agent section failed"
return 1;
}
if [ -z "${EndpointID}" ]; then
log "EndpointID not defined for agent"
return 1;
fi
if [ -z "${Topic}" ]; then
log "Topic not defined for agent"
return 1;
fi
sec="${sec/mtp_/cpe-}"
get_base_path "Device.LocalAgent.Controller." "${sec}"
if [ -z "${BASEPATH}" ]; then
log "Failed to get path [$BASEPATH]"
return 1;
fi
db_set "${BASEPATH}.Alias" "${sec}"
db_set "${BASEPATH}.Enable" "1"
db_set "${BASEPATH}.EndpointID" "${EndpointID}"
db_set "${BASEPATH}.MTP.1.Enable" "1"
db_set "${BASEPATH}.MTP.1.Protocol" "MQTT"
db_set "${BASEPATH}.MTP.1.MQTT.Reference" "Device.MQTT.Client.1"
db_set "${BASEPATH}.MTP.1.MQTT.Topic" "${Topic}"
db_set
}
configure_mqtt_client() {
local BrokerAddress BrokerPort Enable Username Password ProtocolVersion
local TransportProtocol ClientID
local sec
sec="${1}"
validate_mqtt_client_section "${1}" || {
log "Validation of mqtt section failed"
return 1;
}
sec="${sec/mqtt_/cpe-}"
get_base_path "Device.MQTT.Client." "${sec}"
if [ -z "${BASEPATH}" ]; then
log "Failed to get path [$BASEPATH]"
return 1;
fi
db_set "${BASEPATH}.Alias" "${sec}"
db_set "${BASEPATH}.Enable" "${Enable}"
db_set "${BASEPATH}.BrokerAddress" "${BrokerAddress}"
db_set "${BASEPATH}.BrokerPort" "${BrokerPort}"
db_set "${BASEPATH}.Username" "${Username}"
db_set "${BASEPATH}.Password" "${Password}"
db_set "${BASEPATH}.ProtocolVersion" "${ProtocolVersion}"
db_set "${BASEPATH}.TransportProtocol" "${TransportProtocol}"
db_set "${BASEPATH}.ClientID" "${ClientID}"
db_set
}
configure_obuspc() {
local enabled trust_cert ifname interface debug prototrace log_level db_file log_dest
local client_cert
validate_global_section "global"
if [ "${debug}" -ne "0" ]; then
# Forward stdout of the command to logd
procd_set_param stdout 1
# Same for stderr
procd_set_param stderr 1
fi
procd_append_param command -u
if [ "${prototrace}" -eq 1 ]; then
procd_append_param command -p
fi
if [ -n "${log_level}" ]; then
procd_append_param command -v "${log_level}"
fi
if [ -n "${log_dest}" ]; then
procd_append_param command -l "${log_dest}"
fi
if [ -f "${RESET_FILE}" ]; then
procd_append_param command -r ${RESET_FILE}
fi
}
# Create factory reset file
db_init()
{
# Load configuration
config_load $CONFIGURATION
config_get SQL_DB_FILE global db_file "/tmp/usp/uspc.db"
# Remove DB and generate from uci
[ -f "${SQL_DB_FILE}" ] && rm -f "${SQL_DB_FILE}"
# Remove reset file if present
[ -f "${RESET_FILE}" ] && rm -f ${RESET_FILE}
config_load $CONFIGURATION
global_init
config_foreach configure_mqtt_client mqtt
global_init
config_foreach configure_controller controller
global_init
config_foreach configure_agent agent
return 0;
}
register_service()
{
procd_open_instance ${CONFIGURATION}
procd_set_param command ${PROG}
configure_obuspc
procd_set_param respawn \
"${respawn_threshold:-5}" \
"${respawn_timeout:-10}" "${respawn_retry:-3}"
procd_close_instance
}
start_service() {
local enabled
config_load ${CONFIGURATION}
config_get_bool enabled global enabled 0
if [ "${enabled}" -eq 0 ]; then
return 0;
fi
mkdir -p /tmp/usp/
db_init
register_service
}
stop_service() {
${PROG} -c stop >/dev/null 2>&1
}
service_triggers() {
procd_add_reload_trigger "obuspc"
}

View File

@@ -1,31 +0,0 @@
#!/bin/sh
. /lib/functions.sh
get_oui_from_db()
{
db -q get device.deviceinfo.ManufacturerOUI
}
get_serial_from_db()
{
db -q get device.deviceinfo.SerialNumber
}
fix_agent_endpoint()
{
local AgentEndpointID serial oui user pass
# Get endpoint id from obuspa config first
config_load obuspa
config_get AgentEndpointID localagent EndpointID ""
if [ -z "${AgentEndpointID}" ]; then
serial=$(get_serial_from_db)
oui=$(get_oui_from_db)
AgentEndpointID="os::${oui}-${serial//+/%2B}"
fi
uci -q set obuspc.agent.EndpointID="${AgentEndpointID}"
}
fix_agent_endpoint

View File

@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=owsd
PKG_VERSION:=1.1.6
PKG_VERSION:=1.1.5
PKG_RELEASE:=1
PKG_SOURCE_PROTO=git
@@ -37,7 +37,7 @@ include $(INCLUDE_DIR)/cmake.mk
define Package/owsd
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libjson-c +libblobmsg-json +libwebsockets-openssl +ubox \
DEPENDS:=+libjson-c +libblobmsg-json +libwebsockets +ubox \
+OWSD_USE_UBUS:ubus \
+OWSD_USE_DBUS:libdbus \
+OWSD_USE_DBUS:libxml2 \

View File

@@ -17,15 +17,14 @@ init_xpon() {
procd_open_instance ponmgr_cfg
procd_set_param command /userfs/bin/ponmgr_cfg
procd_set_param respawn
procd_close_instance
procd_open_instance omci
procd_set_param command /userfs/bin/omci
procd_set_param respawn
procd_close_instance
}
deinit_xpon() {
return
killall -9 omci 2>/dev/null
killall -9 ponmgr_cfg 2>/dev/null
}

View File

@@ -587,7 +587,7 @@
],
"datatype": "string",
"enumerations": [
"G-PON",
"GPON",
"XG-PON",
"NG-PON2",
"XGS-PON"
@@ -858,7 +858,7 @@
}
]
},
"VendorName": {
"ModuleVendor": {
"type": "string",
"read": true,
"write": false,
@@ -871,11 +871,11 @@
{
"data": "@Parent",
"type": "json",
"key": "VendorName"
"key": "ModuleVendor"
}
]
},
"VendorPartNumber": {
"ModuleName": {
"type": "string",
"read": true,
"write": false,
@@ -888,11 +888,11 @@
{
"data": "@Parent",
"type": "json",
"key": "VendorPartNumber"
"key": "ModuleName"
}
]
},
"VendorRevision": {
"ModuleVersion": {
"type": "string",
"read": true,
"write": false,
@@ -905,7 +905,24 @@
{
"data": "@Parent",
"type": "json",
"key": "VendorRevision"
"key": "ModuleVersion"
}
]
},
"ModuleFirmwareVersion": {
"type": "string",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"mapping": [
{
"data": "@Parent",
"type": "json",
"key": "ModuleFirmwareVersion"
}
]
},

View File

@@ -1,6 +0,0 @@
#!/bin/sh
# Install iptables rules
iptables_set_traffic_class() {
IP_RULE="$IP_RULE -j MARK --set-xmark 0x${1}0/0xF0"
}

View File

@@ -5,14 +5,13 @@
include /lib/ethernet
. /lib/qos/iptables.sh
. /lib/qos/chains.ebtables.sh
. /lib/qos/chains.iptables.sh
. /lib/qos/common/chains.ebtables.sh
. /lib/qos/ebtables.sh
. /lib/qos/ip_rule.sh
. /lib/qos/classify.sh
. /lib/qos/policer.sh
. /lib/qos/queue.sh
. /lib/qos/shaper.sh
. /lib/qos/common/policer.sh
. /lib/qos/common/queue.sh
. /lib/qos/common/shaper.sh
. /lib/qos/airoha.sh
get_rate_per_queue() {
@@ -23,13 +22,6 @@ get_burst_size_per_queue() {
echo "0"
}
# marking value be decimal for linux target as it uses set-mark whereas other
# targets uses set-xmark, hence this function can't make it common
ip_rule_get_converted_tos() {
con_tos=$(printf %x $1)
echo $con_tos
}
configure_qos() {
# queue configuration is being done after shaper configuration,
# If port shapingrate configuration on DISC device is called after queue configuration then

View File

@@ -176,17 +176,6 @@ handle_queue() {
Q_COUNT=$((Q_COUNT + 1))
}
iptables_set_traffic_class() {
IP_RULE="$IP_RULE -j MARK --set-xmark 0x$1/0x$1"
}
# marking value be decimal for linux target as it uses set-mark whereas other
# targets uses set-xmark, hence this function can't make it common
ip_rule_get_converted_tos() {
con_tos=$(printf %x $1)
echo $con_tos
}
ebt_match_ipv6_dscp() {
#when ethertype is not configured by user then both proto rules of ipv4
#and ipv6 to be installed so update BR6_RULE string as well otherwise

View File

@@ -1,65 +1,52 @@
#!/bin/sh
# add ip rule from qos uci
FWD_POLICY=""
IP_RULE=""
init_ip_rule() {
FWD_POLICY=""
IP_RULE=""
}
ip_rule_match_inif() {
FWD_POLICY="$FWD_POLICY iif $1"
IP_RULE="$IP_RULE iif $1"
}
ip_rule_match_proto() {
FWD_POLICY="$FWD_POLICY ipproto $1"
IP_RULE="$IP_RULE ipproto $1"
}
ip_rule_match_dest_port() {
FWD_POLICY="$FWD_POLICY dport $1"
IP_RULE="$IP_RULE dport $1"
}
ip_rule_match_src_port() {
FWD_POLICY="$FWD_POLICY sport $1"
IP_RULE="$IP_RULE sport $1"
}
ip_rule_match_dest_ip() {
FWD_POLICY="$FWD_POLICY to $1"
IP_RULE="$IP_RULE to $1"
}
ip_rule_match_src_ip() {
FWD_POLICY="$FWD_POLICY from $1"
IP_RULE="$IP_RULE from $1"
}
ip_rule_match_dest_port_range() {
FWD_POLICY="$FWD_POLICY dport $1-$2"
IP_RULE="$IP_RULE dport $1-$2"
}
ip_rule_match_src_port_range() {
FWD_POLICY="$FWD_POLICY sport $1-$2"
IP_RULE="$IP_RULE sport $1-$2"
}
ip_rule_match_tos() {
dscp_filter=$1
tos_val=$((dscp_filter<<2))
IP_RULE="$IP_RULE tos 0x$tos_val"
}
ip_rule_match_fwmark() {
FWD_POLICY="$FWD_POLICY fwmark $1"
}
ip_rule_handle_match_tos() {
local dscp="$2"
local IPTOS_LOWDELAY="0x10"
local tos_val="$((dscp<<2))"
# ip rule not accept beyond 0x10, to handle further value mark the tos
# value through iptable and route with that marked value by fwmark
# in ip rule
if [ "$((tos_val))" -gt "$((IPTOS_LOWDELAY))" ]; then
handle_iptables_rules $1 $(ip_rule_get_converted_tos $tos_val)
ip_rule_match_fwmark $(printf 0x%x $tos_val)
else
FWD_POLICY="$FWD_POLICY tos $(printf %x $tos_val)"
if [ -n "$3" ]; then
ip_rule_match_fwmark $3
fi
fi
IP_RULE="$IP_RULE fwmark $1"
}
handle_ip_rule() {
@@ -73,7 +60,7 @@ handle_ip_rule() {
config_get src_ip "$cid" "src_ip"
config_get ifname "$cid" "ifname"
config_get proto "$cid" "proto"
config_get dscp "$cid" "dscp_filter"
config_get tos "$cid" "dscp_filter"
config_get fwmark "$cid" "traffic_class"
config_get dest_port "$cid" "dest_port"
config_get dest_port_range "$cid" "dest_port_range"
@@ -105,20 +92,14 @@ handle_ip_rule() {
ip_rule_match_src_port_range $src_port $src_port_range
fi
if [ -n "$dscp" ]; then
# If tos and fwmark configured then fwmark be igroned/skipped
# in the case of tos value greater than 0x10 and if tos value
# less than 0x10 then both tos and fwmark then both configuration
#considered/applied for ip rule.
ip_rule_handle_match_tos $cid $dscp $fwmark
elif [ -n "$fwmark" ]; then
ip_rule_match_fwmark $fwmark
fi
[ -n "$tos" ] && ip_rule_match_tos $tos
[ -n "$fwmark" ] && ip_rule_match_fwmark $fwmark
# forming full ip rule
if [ -n "$FWD_POLICY" ]; then
echo "ip rule add $FWD_POLICY table $fwding_policy" >> /tmp/qos/classify.iprule
echo "ip rule del $FWD_POLICY table $fwding_policy" >> /tmp/qos/classify.del_iprule
if [ -n "$IP_RULE" ]; then
echo "ip rule add $IP_RULE table $fwding_policy" >> /tmp/qos/classify.iprule
echo "ip rule del $IP_RULE table $fwding_policy" >> /tmp/qos/classify.del_iprule
fi
}

View File

@@ -55,6 +55,10 @@ iptables_set_dscp_mark() {
IP_RULE="$IP_RULE -j DSCP --set-dscp $1"
}
iptables_set_traffic_class() {
IP_RULE="$IP_RULE -j MARK --set-xmark 0x${1}0/0xF0"
}
append_rule_to_mangle_table() {
if [ "$2" == 4 ]; then
echo "iptables -w -t mangle -A $1 $IP_RULE" >> /tmp/qos/classify.iptables
@@ -70,18 +74,10 @@ handle_iptables_rules() {
local cid="$1"
local ip_version=0
local is_l3_rule=0
traffic_class=$2
init_iptables_rule
# If traffic class non empty/zero then function call for handling fowrwarding
# policy in the case of tos greater than 0x10.
# In this case, traffic class should not be read from config and use value in arg
if [ -z "$traffic_class" ]; then
config_get traffic_class "$cid" "traffic_class"
fi
config_get proto "$cid" "proto"
config_get traffic_class "$cid" "traffic_class"
config_get dscp_mark "$cid" "dscp_mark"
config_get dscp_filter "$cid" "dscp_filter"
config_get dest_port "$cid" "dest_port"

View File

@@ -146,21 +146,11 @@ handle_queue() {
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
tc filter add dev $port parent ${root}:0 prio $order handle $order fw classid ${root}:$order
fi
Q_COUNT=$((Q_COUNT + 1))
}
iptables_set_traffic_class() {
IP_RULE="$IP_RULE -j MARK --set-mark $1"
}
# marking value be decimal for linux target as it uses set-mark whereas other
# targets uses set-xmark, hence this function can't make it common
ip_rule_get_converted_tos() {
echo $1
}
ebt_match_ipv6_dscp() {
#when ethertype is not configured by user then both proto rules of ipv4
#and ipv6 to be installed so update BR6_RULE string as well otherwise

View File

@@ -38,7 +38,7 @@ define Package/quickjs-websocket
CATEGORY:=Libraries
TITLE:=WebSocket API for QuickJS
MAINTAINER:=Erik Karlsson <erik.karlsson@genexis.eu>
DEPENDS:=+quickjs +libwebsockets-openssl
DEPENDS:=+quickjs +libwebsockets
endef
define Package/quickjs-websocket/description

View File

@@ -85,19 +85,3 @@ After adding the makefile, user need to specify the list of plugins in below con
```bash
CONFIG_SULU_EXTRA_PACKAGES="sulu-plugin1 sulu-plugin2 sulu-theme1"
```
# SULU PWA (Progressive Web App)
PWA applications generally used for well know secured sites, which can be installed directly from web-browser as desktop/mobile application.
> Note:
> 1. It requires well defined SSL keys for deployment of PWA for a defined site.
> 2. It should be used with sites with well defined FQDN
To enable SULU PWA application, user need to select PWA in sulu/sulu-builder config options and provide the path of the pwa key file
```bash
CONFIG_SULU_PWA_APP=y
CONFIG_SULU_PWA_KEYS_PATH="/somepath_with_pwa.{crt,key}"
```
>Note: Replacing/changing the keys might requires uninstall/install of PWA App and CTRL+Shift+R in browser to drop the cached site and load the new site with new keys.

View File

@@ -5,11 +5,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-base
PKG_VERSION:=2.3.0
PKG_VERSION:=2.1.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
PKG_SOURCE_VERSION:=f7d77710c288668c7abf84ec82eeffc613723004
PKG_SOURCE_VERSION:=624710be04dcdba5434840c539518d22a18e537a
PKG_MIRROR_HASH:=skip
SULU_MOD:=core

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-builder
PKG_VERSION:=2.3.0
PKG_VERSION:=2.1.0
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-builder.git
PKG_SOURCE_VERSION:=6d4933ac821600b051193951f24765569da2c9a4
PKG_SOURCE_VERSION:=c50a4a74376a1f3d1f14eb1476fee4e328f3cf90
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)
@@ -28,8 +28,7 @@ define Package/sulu/default
CATEGORY:=Utilities
SUBMENU:=SULU
TITLE:=SULU-CE
DEPENDS:=+mosquitto-auth-shadow +usermngr +jq
EXTRA_DEPENDS:=nginx
DEPENDS:=+nginx +mosquitto-auth-shadow +usermngr +jq
endef
define Package/sulu
@@ -42,10 +41,10 @@ endef
define Package/sulu-builder
$(Package/sulu/default)
CONFLICTS:=sulu
TITLE += (Builder)
VARIANT:=builder
DEPENDS+=+sulu-base $(foreach plugin,$(SULU_PLUGINS), +PACKAGE_$(plugin):$(plugin)) $(foreach plugin,$(SULU_EXTRA), +PACKAGE_$(plugin):$(plugin))
MENU:=1
endef
define Package/sulu/description
@@ -56,45 +55,16 @@ define Package/sulu-builder/description
SULU-CE ReactJS based Web UI builder.
endef
define Package/sulu/config
config SULU_PWA_APP
depends on PACKAGE_sulu
bool "Enable SULU PWA App support"
default n
help
Enable SULU PWA (Progressive Web App) support, this requires
'pwa.crt' and 'pwa.key' to be installed in '/etc/sulu/' directory.
config SULU_PWA_KEYS_PATH
depends on PACKAGE_sulu
string "Path of pwa.crt and pwa.key for sulu/PWA"
help
Provide directory path for the certficates for PWA,
directory must contain 'pwa.crt' and 'pwa.key'.
endef
define Package/sulu-builder/config
config SULU_EXTRA_PACKAGES
menu "Configuration"
depends on PACKAGE_sulu-builder
config SULU_EXTRA_PACKAGES
string "Space separated list of sulu packages"
help
You can specify the list of non core sulu package,
so that sulu-builder include them before building the core.
config SULU_PWA_APP
depends on PACKAGE_sulu-builder
bool "Enable SULU PWA App support"
default n
help
Enable SULU PWA (Progressive Web App) support, this requires
'pwa.crt' and 'pwa.key' to be installed in '/etc/sulu/' directory.
config SULU_PWA_KEYS_PATH
depends on PACKAGE_sulu-builder
string "Path of pwa.crt and pwa.key for sulu/PWA"
help
Provide directory path for the certficates for PWA,
directory must contain 'pwa.crt' and 'pwa.key'.
endmenu
endef
ifeq ($(BUILD_VARIANT),builder)
@@ -129,19 +99,11 @@ define Package/sulu/install/Default
$(INSTALL_BIN) ./files/etc/uci-defaults/40-add-sulu-nginx-config $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/uci-defaults/01-update-nginx-uci-template $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/uci-defaults/10-add-mqtt-config $(1)/etc/uci-defaults/
ifeq ($(CONFIG_SULU_PWA_APP),y)
$(INSTALL_BIN) ./files/etc/uci-defaults/99-eval-set-sulu-pwa-keys $(1)/etc/uci-defaults/
$(INSTALL_DATA) $(CONFIG_SULU_PWA_KEYS_PATH)/pwa.crt $(1)/etc/sulu/
$(INSTALL_DATA) $(CONFIG_SULU_PWA_KEYS_PATH)/pwa.key $(1)/etc/sulu/
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
ifneq ($(CONFIG_PACKAGE_skopeo)$(CONFIG_PACKAGE_umoci),yy)
$(RM) $(1)/sulu/config/widgets/lcm-store.json
endif
@@ -150,9 +112,6 @@ endef
define Package/sulu-builder/install
$(Package/sulu/install/Default)
$(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/src/config/*.json $(1)/sulu/config/
$(CP) $(PKG_BUILD_DIR)/build/src/config/widgets/diagnostics.json $(1)/sulu/config/widgets/
$(CP) $(PKG_BUILD_DIR)/build/src/config/widgets/wan.json $(1)/sulu/config/widgets/

View File

@@ -1,5 +1,4 @@
config global 'global'
option role_based_access '1'
option SessionMode 'Require'
list user 'admin'
list user 'user'

View File

@@ -8,7 +8,7 @@ location /sitemap.xml {
return 200 "User-agent: *\nDisallow: /\n";
}
location /wss {
location /ws {
proxy_pass_request_headers on;
proxy_cache off;
proxy_http_version 1.1;
@@ -29,11 +29,13 @@ location /wss {
location / {
autoindex on;
expires -1;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,Content-Type,Range';
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
@@ -43,7 +45,6 @@ location / {
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,Content-Type,Range' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
}
expires -1;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
}

View File

@@ -53,11 +53,6 @@ function _get_sulu_root()
echo "${root:-/sulu}"
}
function _get_sulu_session_mode()
{
echo "$(uci -q get sulu.global.SessionMode)"
}
function _get_usp_upstream_port()
{
local port
@@ -99,11 +94,10 @@ function update_nginx_template()
function generate_sulu_conn_config()
{
local rbac users SCONFIG session
local rbac users SCONFIG
rbac="${1}"
users="$(_get_sulu_users)"
session="$(_get_sulu_session_mode)"
SCONFIG="$(_get_sulu_root)/config/connectionConfig.json"
json_init;
@@ -116,12 +110,7 @@ function generate_sulu_conn_config()
json_add_object 'rbac';
json_add_string 'toId' "$(_get_endpoint_id)";
json_add_int 'port' "$(_get_sulu_tls_port)";
json_add_string 'path' "/wss";
if [ "${session}" = "Require" ]; then
json_add_boolean 'useSession' 1;
fi
json_add_string 'path' "/ws";
json_add_string 'protocol' 'wss';
json_add_array 'auth';
json_close_array;
@@ -142,7 +131,7 @@ function generate_sulu_conn_config()
json_add_string 'fromId' 'proto::interop-usp-controller';
json_add_string 'toId' "$(_get_endpoint_id)";
json_add_int 'port' "$(_get_sulu_tls_port)";
json_add_string 'path' "/wss";
json_add_string 'path' "/ws";
json_add_string 'protocol' 'wss';
json_add_string 'publishEndpoint' "/usp/endpoint";
json_add_string 'subscribeEndpoint' "/usp/controller";
@@ -220,7 +209,7 @@ function _update_obuspa_config()
function _remove_obuspa_config()
{
local restart session
local restart
restart=0
if [ "$(uci_get obuspa localmqtt)" == "mqtt" ]; then
@@ -239,11 +228,10 @@ function _remove_obuspa_config()
}
function _update_obuspa_config_rbac() {
local agent users restart session
local agent users restart
agent="$(_get_agent_id)"
users="$(_get_sulu_users)"
session="$(_get_sulu_session_mode)"
restart=0
for f in ${users}; do
@@ -280,12 +268,6 @@ function _update_obuspa_config_rbac() {
uci_set obuspa ${sec} assigned_role_name "$f"
restart=1
fi
obMode="$(uci_get obuspa ${sec} SessionMode)"
if [ "${session}" != "${obMode}" ]; then
uci_set obuspa ${sec} SessionMode "${session}"
restart=1
fi
done
if [ -f "/etc/sulu/roles.json" ]; then
uci_set obuspa global role_file "/etc/sulu/roles.json"

View File

@@ -9,14 +9,15 @@ add_sulu_nginx_uci()
if ! uci_get nginx _sulu_s >/dev/null 2>&1; then
uci_add nginx server _sulu_s
uci_set nginx _sulu_s root '/sulu'
uci_add_list nginx _sulu_s listen "8443 ssl default_server"
uci_add_list nginx _sulu_s listen "[::]:8443 ssl default_server"
uci_add_list nginx _sulu_s listen "8443 http2 ssl"
uci_add_list nginx _sulu_s listen "[::]:8443 http2 ssl"
uci_set nginx _sulu_s server_name '_sulu_s'
uci_add_list nginx _sulu_s include '/etc/sulu/nginx.locations'
uci_set nginx _sulu_s uci_manage_ssl 'self-signed'
uci_set nginx _sulu_s ssl_certificate '/etc/nginx/conf.d/_lan.crt'
uci_set nginx _sulu_s ssl_certificate_key '/etc/nginx/conf.d/_lan.key'
uci_set nginx _sulu_s ssl_session_cache 'none'
uci_set nginx _sulu_s ssl_session_cache 'shared:SSL:32k'
uci_set nginx _sulu_s ssl_session_timeout '64m'
uci_set nginx _sulu_s access_log 'off; # logd openwrt'
uci_set nginx _sulu_s error_log '/dev/null'
fi
@@ -26,7 +27,7 @@ add_sulu_nginx_uci()
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'
uci_set nginx _suluredirect return 'https://$host:8443$request_uri'
fi
}

View File

@@ -1,14 +0,0 @@
#!/bin/sh
. /lib/functions.sh
set_sulu_pwa_key()
{
if [ -f "/etc/sulu/pwa.crt" -a -f "/etc/sulu/pwa.key" ]; then
uci_load nginx
uci_set nginx _sulu_s ssl_certificate '/etc/sulu/pwa.crt'
uci_set nginx _sulu_s ssl_certificate_key '/etc/sulu/pwa.key'
fi
}
set_sulu_pwa_key

View File

@@ -4,11 +4,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-lcm
PKG_VERSION:=2.2.12
PKG_VERSION:=2.1.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-lcm.git
PKG_SOURCE_VERSION:=bc866b3679d07a80828aa40f7fcdaf18d48c7c61
PKG_SOURCE_VERSION:=29515d3a3031d528cb603a8931156bf617fee885
PKG_MIRROR_HASH:=skip
SULU_PLUGIN_INSTALL:=1

View File

@@ -4,11 +4,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-multi-ap
PKG_VERSION:=2.2.18
PKG_VERSION:=2.0.10
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-multi-ap.git
PKG_SOURCE_VERSION:=ae4cb0a27b7d084aaad69e81cb4d96d88ecdffee
PKG_SOURCE_VERSION:=9f8143ea1dd4ac26b756268bdf03dc518c49b483
PKG_MIRROR_HASH:=skip
include ../sulu-builder/sulu.mk

View File

@@ -4,11 +4,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-parental-control
PKG_VERSION:=2.2.12
PKG_VERSION:=2.1.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-parental-control.git
PKG_SOURCE_VERSION:=e005dd22fd98342df9589e05dd89e322265a2dcc
PKG_SOURCE_VERSION:=9f460d0851c52a433ec5fef079e6105b5ebeb225
PKG_MIRROR_HASH:=skip
include ../sulu-builder/sulu.mk

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=swmodd
PKG_VERSION:=2.2.7
PKG_VERSION:=2.2.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:=e202399a238369b792d20aded0e085ab71d1b120
PKG_SOURCE_VERSION:=db0805d7833a27afc9a42edd094209978f43e311
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -29,7 +29,7 @@ define Package/swmodd
SUBMENU:=TRx69
TITLE:= Software Modules Daemon
DEPENDS:=+libuci +libubox +ubus +libuuid +opkg +libcurl \
+PACKAGE_lxc:lxc +PACKAGE_liblxc:liblxc +@BUSYBOX_CONFIG_BUSYBOX \
+PACKAGE_liblxc:liblxc +@BUSYBOX_CONFIG_BUSYBOX \
+@BUSYBOX_CONFIG_FEATURE_SHOW_SCRIPT +@BUSYBOX_CONFIG_SCRIPT \
+swmodd-cgroup +jq +libbbfdm-api
endef
@@ -59,7 +59,7 @@ MAKE_FLAGS += \
SWMOD_CRUN="yes"
endif
ifeq ($(CONFIG_PACKAGE_lxc),y)
ifeq ($(CONFIG_PACKAGE_liblxc),y)
MAKE_FLAGS += \
SWMOD_LXC="yes"
endif
@@ -76,24 +76,23 @@ define Package/swmodd/install
$(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)
$(INSTALL_DIR) $(1)/usr/share/lxc/templates/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/templates/lxc-iopsys $(1)/usr/share/lxc/templates/lxc-iopsys
$(INSTALL_BIN) ./files/etc/uci-defaults/02-migrate-lxc $(1)/etc/uci-defaults/02-migrate-lxc
endif
ifeq ($(CONFIG_PACKAGE_crun),y)
$(INSTALL_DIR) $(1)/etc/swmodd
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/etc/swmodd/run.sh $(1)/etc/swmodd/run.sh
$(INSTALL_BIN) ./files/etc/init.d/crun $(1)/etc/init.d/crun
$(INSTALL_BIN) ./files/etc/config/crun $(1)/etc/config/crun
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/crun_create $(1)/usr/sbin/crun_create
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-bundle-path $(1)/etc/uci-defaults/01-fix-bundle-path
endif
endef

View File

@@ -22,7 +22,6 @@ configure_crun_container() {
BUNDLE="${2}"
BRIDGE="${3}"
BOOT="${4}"
TIMEOUT="${5}"
config_get name "${1}" name ""
config_get type "${1}" type ""
@@ -47,7 +46,7 @@ configure_crun_container() {
uci_set ocicontainer "${1}" du_status Installing_start
uci_set ocicontainer "${1}" username ""
uci_set ocicontainer "${1}" password ""
result=$(${RUNNER} -b "${BUNDLE}" -n "${name}" -r "${url}" -l "${username}:${password}" -t "${TIMEOUT}")
result=$(${RUNNER} -b "${BUNDLE}" -n "${name}" -r "${url}" -l "${username}:${password}")
if [ "$?" -eq 0 ]; then
result=$(cat ${BUNDLE}/${name}/config.json |jq ".annotations.org_opencontainers_image_description")
if [ "${result}" != "null" ]; then
@@ -191,7 +190,6 @@ start_service() {
config_load swmodd
config_get bundle globals oci_bundle_root ""
config_get bridge globals lan_bridge "br-lan"
config_get timeout globals oci_pull_timeout "10"
if [ -z "${bundle}" ] || [ -z "${bridge}" ]; then
log "Empty bundle path or bridge"
@@ -201,7 +199,7 @@ start_service() {
if [ -f "${bundle}/ocicontainer" ]; then
UCI_CONFIG_DIR="${bundle}"
config_load ocicontainer
config_foreach configure_crun_container du_eu_assoc "${bundle}" "${bridge}" "${boot}" "${timeout}"
config_foreach configure_crun_container du_eu_assoc "${bundle}" "${bridge}" "${boot}"
uci_commit ocicontainer
# Add a timer for DuStateChange!

View File

@@ -164,15 +164,14 @@ pull_image_from_registry() {
OPTS="--src-creds ${LOGIN}"
INSPECT_OPT="--creds ${LOGIN}"
fi
if ! skopeo --command-timeout ${TIMEOUT:-10}m copy ${OPTS} ${REGURL} oci:${NAME}_tmp:latest >/dev/null 2>&1; then
log "Failed to download image: $?"
if ! skopeo --command-timeout 4m copy ${OPTS} ${REGURL} oci:${NAME}_tmp:latest >/dev/null 2>&1; then
log "Failed to download image"
cd -
rm -rf "${temp}"
exit 1
fi
if ! umoci unpack --image ${NAME}_tmp:latest ${NAME} >/dev/null 2>&1; then
log "Failed to unpack image: $?"
log "Failed to unpack image"
cd -
rm -rf "${temp}"
exit 1
@@ -212,7 +211,7 @@ pull_image_from_registry() {
clean=0
net_update=0
update_json=0
while getopts b:n:i:r:l:t:cuU options
while getopts b:n:i:r:l:cuU options
do
case "${options}" in
b) BUNDLE=${OPTARG};;
@@ -220,7 +219,6 @@ do
i) BRIDGE=${OPTARG};;
r) REGURL=${OPTARG};;
l) LOGIN=${OPTARG};;
t) TIMEOUT=${OPTARG};;
c) clean=1;;
u) net_update=1;;
U) update_json=1;;

View File

@@ -1,47 +0,0 @@
#!/bin/sh
. /lib/functions.sh
config_change=0
migrate_lxc() {
config_get name "${1}" name ""
if [ -z "${name}" ]; then
return 0;
fi
# Now lets check if already present in lxccontainer
exist=$(uci -q -c "${2}" show lxccontainer | grep ".name='$name'")
if [ -z "${exist}" ]; then
# Not present, need to migrate
sec=$(uci -q -c "${2}" add lxccontainer container)
if [ -n "${sec}" ]; then
uci -q -c "${2}" set lxccontainer."${sec}".name="${name}"
uci -q -c "${2}" set lxccontainer."${sec}".type='lxc'
uci -q -c "${2}" set lxccontainer."${sec}".autostart='1'
uci -q -c "${2}" set lxccontainer."${sec}".timeout='300'
config_change=1
fi
fi
}
config_load swmodd
config_get lxc_bundle globals lxc_bundle_root ""
if [ -z "${lxc_bundle}" ]; then
return 0
fi
if [ ! -d "${lxc_bundle}" ]; then
return 0
fi
touch "${lxc_bundle}"/lxccontainer
config_load lxc-auto
config_foreach migrate_lxc container "${lxc_bundle}"
if [ $config_change -eq 1 ]; then
uci -q -c "${lxc_bundle}" commit lxccontainer
fi

View File

@@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=urlfilter
PKG_VERSION:=1.1.7
PKG_VERSION:=1.1.5
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/urlfilter.git
PKG_SOURCE_VERSION:=a726e4ce9fa3322e135cb0dd961f31b4fd7ae22a
PKG_SOURCE_VERSION:=e55a2c2c7c992eb5071e82734bdc8850b71b02e0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

Some files were not shown because too many files have changed in this diff Show More