freecwmp
[Top] [All Lists]

ubus data model patch [04/27]

To: freecwmp@linux-mips.org, freecwmp@lukaperkov.net
Subject: ubus data model patch [04/27]
From: KALLEL Mohamed <mohamed.kallel@pivasoftware.com>
Date: Thu, 06 Dec 2012 14:37:27 +0100
Original-recipient: rfc822;freecwmp@linux-mips.org
Sender: freecwmp-bounce@linux-mips.org
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/17.0 Thunderbird/17.0
Hi Luka

  ubus data model patch [04/27] enclosed

Regards
MOHAMED Kallel

------------------------ubus data model patch [04/27] ---------------------------------


>From 9f3c3bea934e079853aed0ac27d91fb1bbe115d5 Mon Sep 17 00:00:00 2001
From: Mohamed <mohamed.kallel@pivasoftware.com>
Date: Sat, 1 Dec 2012 20:59:14 +0100
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


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>
  • ubus data model patch [04/27], KALLEL Mohamed <=