mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
twamp: 1.2.0
This commit is contained in:
parent
3f214bb959
commit
dd9b7a8774
4 changed files with 30 additions and 17 deletions
|
|
@ -1,26 +1,22 @@
|
|||
#
|
||||
# Copyright (C) 2020 iopsys Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
# Copyright (C) 2020-2022 iopsys Software Solutions AB
|
||||
#
|
||||
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=twamp
|
||||
PKG_VERSION:=1.1.2
|
||||
PKG_VERSION:=1.2.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/twamp.git
|
||||
PKG_SOURCE_VERSION:=c9b6b0fe35e137e967ccef63a9e1253155a59078
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/twamp-light.git
|
||||
PKG_SOURCE_VERSION:=4dfc8609fb0cefaaf9e86b559b1e10488117cf07
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_BUILD_DEPENDS:=bbf
|
||||
|
|
@ -31,12 +27,12 @@ define Package/$(PKG_NAME)
|
|||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF TWAMP/TWAMP Light feature
|
||||
TITLE:=TWAMP Light Client(TR-390)
|
||||
DEPENDS:=+libuci +ubox +libubus
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
BBF TWAMP/TWAMP Light feature
|
||||
TWAMP Client for Performance Measurement from IP Edge to Customer Equipment using TWAMP Light Protocol
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
|
||||
config twamp 'twamp'
|
||||
option enable '1'
|
||||
option twamp_light '1'
|
||||
#Log levels: Critical=0, Warning=1, Notice=2, Info=3, Debug=4
|
||||
option log_level '3'
|
||||
option enable '0'
|
||||
#Log levels: Critical=0, Error=1, Warning=2, Notice=3, Info=4, Debug=5
|
||||
option log_level '4'
|
||||
|
||||
config twamp_reflector 'reflector_1'
|
||||
option enable '0'
|
||||
option interface 'wan'
|
||||
option port '862'
|
||||
option max_ttl '1'
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ function configure_firewall()
|
|||
{
|
||||
local enable port interface
|
||||
|
||||
config_get enable ${1} enable "0"
|
||||
config_get enable ${1} enable "1"
|
||||
config_get port ${1} port
|
||||
config_get interface ${1} interface
|
||||
if [ "$enable" -eq 0 -o -z "${port}" -o -z "${interface}" ]; then
|
||||
|
|
@ -27,5 +27,21 @@ function configure_firewall()
|
|||
fi
|
||||
}
|
||||
|
||||
function delete_rule()
|
||||
{
|
||||
while iptables -w 1 -L zone_${1}_input --line-numbers | grep "TWAMP reflector port" > /dev/null; do
|
||||
iptables -w 1 -D zone_${1}_input $(iptables -w 1 -L zone_${1}_input --line-numbers | grep "TWAMP reflector port" | head -1|awk '{print $1}');
|
||||
done
|
||||
}
|
||||
|
||||
# Loop through all interfaces and delete the twamp reflector rule from interface's input chain
|
||||
config_load network
|
||||
config_foreach delete_rule interface
|
||||
|
||||
config_load twamp
|
||||
config_get twamp_enable twamp enable "0"
|
||||
if [ "${twamp_enable}" -eq "0" ]; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
config_foreach configure_firewall twamp_reflector
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ start_service() {
|
|||
reload_service() {
|
||||
stop
|
||||
start
|
||||
[ -f /etc/firewall.twamp ] && {
|
||||
sh /etc/firewall.twamp
|
||||
}
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue