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
|
# Copyright (C) 2020-2022 iopsys Software Solutions AB
|
||||||
#
|
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
|
||||||
# See /LICENSE for more information.
|
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=twamp
|
PKG_NAME:=twamp
|
||||||
PKG_VERSION:=1.1.2
|
PKG_VERSION:=1.2.0
|
||||||
|
|
||||||
LOCAL_DEV:=0
|
LOCAL_DEV:=0
|
||||||
ifneq ($(LOCAL_DEV),1)
|
ifneq ($(LOCAL_DEV),1)
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/twamp.git
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/twamp-light.git
|
||||||
PKG_SOURCE_VERSION:=c9b6b0fe35e137e967ccef63a9e1253155a59078
|
PKG_SOURCE_VERSION:=4dfc8609fb0cefaaf9e86b559b1e10488117cf07
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
PKG_MIRROR_HASH:=skip
|
PKG_MIRROR_HASH:=skip
|
||||||
endif
|
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:=GPL-2.0-only
|
||||||
PKG_LICENSE_FILES:=LICENSE
|
PKG_LICENSE_FILES:=LICENSE
|
||||||
PKG_BUILD_DEPENDS:=bbf
|
PKG_BUILD_DEPENDS:=bbf
|
||||||
|
|
@ -31,12 +27,12 @@ define Package/$(PKG_NAME)
|
||||||
SECTION:=utils
|
SECTION:=utils
|
||||||
CATEGORY:=Utilities
|
CATEGORY:=Utilities
|
||||||
SUBMENU:=TRx69
|
SUBMENU:=TRx69
|
||||||
TITLE:=BBF TWAMP/TWAMP Light feature
|
TITLE:=TWAMP Light Client(TR-390)
|
||||||
DEPENDS:=+libuci +ubox +libubus
|
DEPENDS:=+libuci +ubox +libubus
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/$(PKG_NAME)/description
|
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
|
endef
|
||||||
|
|
||||||
TARGET_CFLAGS += \
|
TARGET_CFLAGS += \
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,11 @@
|
||||||
|
|
||||||
config twamp 'twamp'
|
config twamp 'twamp'
|
||||||
option enable '1'
|
option enable '0'
|
||||||
option twamp_light '1'
|
#Log levels: Critical=0, Error=1, Warning=2, Notice=3, Info=4, Debug=5
|
||||||
#Log levels: Critical=0, Warning=1, Notice=2, Info=3, Debug=4
|
option log_level '4'
|
||||||
option log_level '3'
|
|
||||||
|
|
||||||
config twamp_reflector 'reflector_1'
|
config twamp_reflector 'reflector_1'
|
||||||
option enable '0'
|
option enable '0'
|
||||||
option interface 'wan'
|
option interface 'wan'
|
||||||
option port '862'
|
option port '862'
|
||||||
option max_ttl '1'
|
option max_ttl '1'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ function configure_firewall()
|
||||||
{
|
{
|
||||||
local enable port interface
|
local enable port interface
|
||||||
|
|
||||||
config_get enable ${1} enable "0"
|
config_get enable ${1} enable "1"
|
||||||
config_get port ${1} port
|
config_get port ${1} port
|
||||||
config_get interface ${1} interface
|
config_get interface ${1} interface
|
||||||
if [ "$enable" -eq 0 -o -z "${port}" -o -z "${interface}" ]; then
|
if [ "$enable" -eq 0 -o -z "${port}" -o -z "${interface}" ]; then
|
||||||
|
|
@ -27,5 +27,21 @@ function configure_firewall()
|
||||||
fi
|
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_load twamp
|
||||||
|
config_get twamp_enable twamp enable "0"
|
||||||
|
if [ "${twamp_enable}" -eq "0" ]; then
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
config_foreach configure_firewall twamp_reflector
|
config_foreach configure_firewall twamp_reflector
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@ start_service() {
|
||||||
reload_service() {
|
reload_service() {
|
||||||
stop
|
stop
|
||||||
start
|
start
|
||||||
|
[ -f /etc/firewall.twamp ] && {
|
||||||
|
sh /etc/firewall.twamp
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
service_triggers() {
|
service_triggers() {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue