@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-nodewatcher
-PKG_VERSION:=47
+PKG_VERSION:=48
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
@@ -2,10 +2,13 @@
# Netmon Nodewatcher (C) 2010-2012 Freifunk Oldenburg
# License; GPL v3
-SCRIPT_VERSION="47"
+SCRIPT_VERSION="48"
test -f /tmp/started || exit
+# Load libraries
+. /lib/functions.sh # Required for simple-tc
+
#Get the configuration from the uci configuration file
#If it does not exists, then get it from a normal bash file with variables.
if [ -f /etc/config/nodewatcher ];then
@@ -280,6 +283,24 @@ crawl() {
dataair="$dataair<airtime5><active>$w5_ACT</active><busy>$w5_BUS</busy></airtime5>"
fi
+ # simple-tc information
+ config_load simple-tc
+ tc_enabled="0"
+ tc_in="0"
+ tc_out="0"
+ parseTcInterface() {
+ local iface="$1"
+
+ config_get ifname "$iface" ifname
+ [ "wan" = "$ifname" ] || return
+
+ config_get tc_enabled "$iface" enabled "0"
+ config_get tc_in "$iface" limit_ingress "0"
+ config_get tc_out "$iface" limit_egress "0"
+ }
+ config_foreach parseTcInterface 'interface'
+ traffic_control="<traffic_control><wan><enabled>$tc_enabled</enabled><in>$tc_in</in><out>$tc_out</out></wan></traffic_control>"
+
err "$(date): Putting all information into a XML-File and save it at $SCRIPT_DATA_FILE"
DATA="<?xml version='1.0' standalone='yes'?><data>"
@@ -292,6 +313,7 @@ crawl() {
DATA=$DATA"<client_count>$client_count</client_count>"
DATA=$DATA"<clients>$dataclient</clients>"
DATA=$DATA"$dataair"
+ DATA=$DATA"$traffic_control"
DATA=$DATA"</data>"
#write data to xml file that provides the data on httpd