freecwmp
[Top] [All Lists]

[PATCH 04/27] Update device_hosts to support communicte data of get para

To: freecwmp@linux-mips.org
Subject: [PATCH 04/27] Update device_hosts to support communicte data of get parameter values to the core via ubus Contributed by Inteno Broadband Technology AB
From: Mohamed <mohamed.kallel@pivasoftware.com>
Date: Thu, 6 Dec 2012 16:54:29 +0100
Cc: freecwmp@lukaperkov.net, Mohamed <mohamed.kallel@pivasoftware.com>, Ahmed ZRIBI <ahmed.zribi@pivasoftware.com>
In-reply-to: <1354809292-2467-1-git-send-email-mohamed.kallel@pivasoftware.com>
Original-recipient: rfc822;freecwmp@linux-mips.org
References: <mohamed.kallel@pivasoftware.com> <1354809292-2467-1-git-send-email-mohamed.kallel@pivasoftware.com>
Sender: freecwmp-bounce@linux-mips.org
Signed-off-by: Ahmed ZRIBI <ahmed.zribi@pivasoftware.com>
Signed-off-by: Mohamed <mohamed.kallel@pivasoftware.com>
---
 ext/openwrt/scripts/functions/device_hosts |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/ext/openwrt/scripts/functions/device_hosts 
b/ext/openwrt/scripts/functions/device_hosts
index 4c3fcd4..8909df6 100644
--- a/ext/openwrt/scripts/functions/device_hosts
+++ b/ext/openwrt/scripts/functions/device_hosts
@@ -44,7 +44,7 @@ local parameter=`echo -n $1 | sed 
"s/InternetGatewayDevice\.LANDevice\.1\./Devic
 case "$parameter" in
        Device.Hosts.HostNumberOfEntries)
        let local val=$num_static_leases+$num_dynamic_leases
-       freecwmp_output "$parameter" "$val"
+       ubus_freecwmp_output "$parameter" "$val"
        return
        ;;
 esac
@@ -66,7 +66,7 @@ if [ $rc -eq 0 ]; then
                local sed_cmd=`echo -n \'$num; echo p\'`
                val=`eval sed -n $sed_cmd $leases_file | awk '{ print $2 }'`
        fi
-       freecwmp_value_output "$parameter" "$val"
+       ubus_freecwmp_output "$parameter" "$val"
        return
 fi
 
@@ -74,7 +74,7 @@ freecwmp_parse_formated_parameter "$parameter" 
"Device.Hosts.Host.{i}.IPAddress"
 if [ $rc -eq 0 ]; then
        local val
        get_device_hosts_ip_address "$leases_file" "$num" "$num_static_leases" 
"$num_dynamic_leases" "val"
-       freecwmp_value_output "$parameter" "$val"
+       ubus_freecwmp_output "$parameter" "$val"
        return
 fi
 
@@ -88,7 +88,7 @@ if [ $rc -eq 0 ]; then
        if [ $num -gt 0 -a $num -le $num_dynamic_leases ]; then
                val="DHCP"
        fi
-       freecwmp_value_output "$parameter" "$val"
+       ubus_freecwmp_output "$parameter" "$val"
        return
 fi
 
@@ -107,7 +107,7 @@ if [ $rc -eq 0 ]; then
                local t2=`date +%s`
                let val=$t1-$t2
        fi
-       freecwmp_value_output "$parameter" "$val"
+       ubus_freecwmp_output "$parameter" "$val"
        return
 fi
 
@@ -131,7 +131,7 @@ if [ $rc -eq 0 ]; then
                val=`eval sed -n $sed_cmd $leases_file | awk '{ print $4 }'`
                if [ "x$val" == "x*" ]; then val=""; fi
        fi
-       freecwmp_value_output "$parameter" "$val"
+       ubus_freecwmp_output "$parameter" "$val"
        return
 fi
 
@@ -144,7 +144,7 @@ if [ $rc -eq 0 ]; then
        get_device_hosts_ip_address "$leases_file" "$num" "$num_static_leases" 
"$num_dynamic_leases" "ip"
        val=`ping -c 1 $ip 2>&1 > /dev/null ; echo $?`
        let val=!$val
-       freecwmp_value_output "$parameter" "$val"
+       ubus_freecwmp_output "$parameter" "$val"
        return
 fi
 
@@ -156,7 +156,7 @@ if [ $rc -eq 0 ]; then
        if [ $num -le $n ]; then
                val=1
        fi
-       freecwmp_value_output "$parameter" "$val"
+       ubus_freecwmp_output "$parameter" "$val"
        return
 fi
 
@@ -168,7 +168,7 @@ if [ $rc -eq 0 ]; then
        if [ $num -le $n ]; then
                val=0
        fi
-       freecwmp_value_output "$parameter" "$val"
+       ubus_freecwmp_output "$parameter" "$val"
        return
 fi
 
@@ -182,10 +182,10 @@ if [ $rc -eq 0 ]; then
        if [ $num2 -eq 1 ]; then
                get_device_hosts_ip_address "$leases_file" "$num1" 
"$num_static_leases" "$num_dynamic_leases" "val"
        fi
-       freecwmp_value_output "$parameter" "$val"
+       ubus_freecwmp_output "$parameter" "$val"
        return
 fi
 
 # TODO: Device.Hosts.Host.{i}.IPv6Address.{i}.IPAddress (no IPv6 support yet)
-
+return $FAULT_CPE_INVALID_PARAMETER_NAME
 }
-- 
1.7.4.1


<Prev in Thread] Current Thread [Next in Thread>