mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
twamp: 1.2.1
This commit is contained in:
parent
d275e37d3b
commit
2391836769
4 changed files with 28 additions and 11 deletions
|
|
@ -6,13 +6,13 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=twamp
|
PKG_NAME:=twamp
|
||||||
PKG_VERSION:=1.2.0
|
PKG_VERSION:=1.2.1
|
||||||
|
|
||||||
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-light.git
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/twamp-light.git
|
||||||
PKG_SOURCE_VERSION:=4dfc8609fb0cefaaf9e86b559b1e10488117cf07
|
PKG_SOURCE_VERSION:=b0111c35ff4908edd82c5d5f4a3c0d6809605b94
|
||||||
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
|
||||||
|
|
@ -41,7 +41,7 @@ TARGET_CFLAGS += \
|
||||||
|
|
||||||
ifeq ($(LOCAL_DEV),1)
|
ifeq ($(LOCAL_DEV),1)
|
||||||
define Build/Prepare
|
define Build/Prepare
|
||||||
$(CP) -rf ~/git/twamp/* $(PKG_BUILD_DIR)/
|
$(CP) -rf ~/git/twamp-light/* $(PKG_BUILD_DIR)/
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
@ -58,6 +58,7 @@ define Package/$(PKG_NAME)/install
|
||||||
$(INSTALL_BIN) ./files/etc/init.d/twampd $(1)/etc/init.d/twampd
|
$(INSTALL_BIN) ./files/etc/init.d/twampd $(1)/etc/init.d/twampd
|
||||||
$(INSTALL_BIN) ./files/etc/firewall.twamp $(1)/etc/firewall.twamp
|
$(INSTALL_BIN) ./files/etc/firewall.twamp $(1)/etc/firewall.twamp
|
||||||
$(INSTALL_BIN) ./files/etc/uci-defaults/92-twampfirewall $(1)/etc/uci-defaults/92-twampfirewall
|
$(INSTALL_BIN) ./files/etc/uci-defaults/92-twampfirewall $(1)/etc/uci-defaults/92-twampfirewall
|
||||||
|
$(INSTALL_BIN) ./files/etc/uci-defaults/93-twamp_fix_reflector $(1)/etc/uci-defaults/93-twamp_fix_reflector
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,5 @@
|
||||||
|
|
||||||
config twamp 'twamp'
|
config twamp 'twamp'
|
||||||
option enable '0'
|
option enable '0'
|
||||||
#Log levels: Critical=0, Error=1, Warning=2, Notice=3, Info=4, Debug=5
|
#Log levels: Critical=0, Error=1, Warning=2, Notice=3, Info=4, Debug=5
|
||||||
option log_level '4'
|
option log_level '3'
|
||||||
|
|
||||||
config twamp_reflector 'reflector_1'
|
|
||||||
option enable '0'
|
|
||||||
option interface 'wan'
|
|
||||||
option port '862'
|
|
||||||
option max_ttl '1'
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ function configure_firewall()
|
||||||
|
|
||||||
function delete_rule()
|
function delete_rule()
|
||||||
{
|
{
|
||||||
while iptables -w 1 -L zone_${1}_input --line-numbers | grep "TWAMP reflector port" > /dev/null; do
|
while iptables -w 1 -L zone_${1}_input --line-numbers | grep "TWAMP reflector port" > /dev/null 2>&1; 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}');
|
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
|
done
|
||||||
}
|
}
|
||||||
|
|
|
||||||
22
twamp/files/etc/uci-defaults/93-twamp_fix_reflector
Normal file
22
twamp/files/etc/uci-defaults/93-twamp_fix_reflector
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. /lib/functions.sh
|
||||||
|
|
||||||
|
function rename_section()
|
||||||
|
{
|
||||||
|
local enable inst
|
||||||
|
|
||||||
|
config_get interface ${1} interface ""
|
||||||
|
if [ -z "${interface}" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
inst="$(echo ${1}|cut -d '_' -f 2)"
|
||||||
|
uci_rename twamp ${1} "${interface}_${inst}"
|
||||||
|
}
|
||||||
|
|
||||||
|
config_load twamp
|
||||||
|
config_foreach rename_section twamp_reflector
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
Loading…
Add table
Reference in a new issue