freecwmp
[Top] [All Lists]

ubus data model patch [06/27]

To: freecwmp@linux-mips.org, freecwmp@lukaperkov.net
Subject: ubus data model patch [06/27]
From: KALLEL Mohamed <mohamed.kallel@pivasoftware.com>
Date: Thu, 06 Dec 2012 14:40:07 +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 [06/27] enclosed

Regards
MOHAMED Kallel

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


>From 91e36ad7421668100895447e65a4fedfba208b33 Mon Sep 17 00:00:00 2001
From: Mohamed <mohamed.kallel@pivasoftware.com>
Date: Sat, 1 Dec 2012 21:04:01 +0100
Subject: [PATCH 06/27] Update device_routing script 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_routing | 33 +++++++++++++------------
 1 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/ext/openwrt/scripts/functions/device_routing b/ext/openwrt/scripts/functions/device_routing
index 3dfa418..ca6dab1 100644
--- a/ext/openwrt/scripts/functions/device_routing
+++ b/ext/openwrt/scripts/functions/device_routing
@@ -85,7 +85,7 @@ local parameter=$1

 case "$parameter" in
     Device.Routing.RouterNumberOfEntries)
-    freecwmp_output "$parameter" "1"
+    ubus_freecwmp_output "$parameter" "1"
     return
     ;;
 esac
@@ -101,7 +101,7 @@ if [ $rc -eq 0 ]; then
     else
         val="0"
     fi
-    freecwmp_output "$parameter" "$val"
+    ubus_freecwmp_output "$parameter" "$val"
     return
 fi

@@ -113,7 +113,7 @@ if [ $rc -eq 0 ]; then
     else
         val="Disabled"
     fi
-    freecwmp_output "$parameter" "$val"
+    ubus_freecwmp_output "$parameter" "$val"
     return
 fi

@@ -134,7 +134,7 @@ if [ $rc -eq 0 ]; then
     else
         return
     fi
-    freecwmp_output "$parameter" "$total"
+    ubus_freecwmp_output "$parameter" "$total"
     return
 fi

@@ -146,7 +146,7 @@ if [ $rc -eq 0 ]; then
     else
         return
     fi
-    freecwmp_output "$parameter" "$val"
+    ubus_freecwmp_output "$parameter" "$val"
     return
 fi

@@ -166,15 +166,15 @@ if [ $rc -eq 0 ]; then
             return
         fi
         if [ $num2 -gt $static ]; then
-            freecwmp_output "$parameter" "Enabled"
+            ubus_freecwmp_output "$parameter" "Enabled"
             return
         fi
         if [ $num2 -le $inactive ]; then
-            freecwmp_output "$parameter" "Error: not active but enabled"
+ ubus_freecwmp_output "$parameter" "Error: not active but enabled"
             return
         fi
         if [ $num2 -le $static ]; then
-            freecwmp_output "$parameter" "Enabled"
+            ubus_freecwmp_output "$parameter" "Enabled"
             return
         fi
     else
@@ -197,11 +197,11 @@ if [ $rc -eq 0 ]; then
             return
         fi
         if [ $num2 -gt $static ]; then
-            freecwmp_output "$parameter" "0"
+            ubus_freecwmp_output "$parameter" "0"
             return
         fi
         if [ $num2 -le $static ]; then
-            freecwmp_output "$parameter" "1"
+            ubus_freecwmp_output "$parameter" "1"
             return
         fi
     else
@@ -230,7 +230,7 @@ if [ $rc -eq 0 ]; then
             let local i=$static-$num2
target=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get network.@route[$i].target 2> /dev/null`
         fi
-        freecwmp_output "$parameter" "$target"
+        ubus_freecwmp_output "$parameter" "$target"
         return
     else
         return
@@ -258,7 +258,7 @@ if [ $rc -eq 0 ]; then
             let local i=$static-$num2
netmask=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get network.@route[$i].netmask 2> /dev/null`
         fi
-        freecwmp_output "$parameter" "$netmask"
+        ubus_freecwmp_output "$parameter" "$netmask"
         return
     else
         return
@@ -288,7 +288,7 @@ if [ $rc -eq 0 ]; then
             let local i=$static-$num2
gateway=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get network.@route[$i].gateway 2> /dev/null`
         fi
-        freecwmp_output "$parameter" "$gateway"
+        ubus_freecwmp_output "$parameter" "$gateway"
         return
     else
         return
@@ -315,7 +315,7 @@ if [ $rc -eq 0 ]; then
         elif [ $num2 -le $static ]; then
             val="Static"
         fi
-        freecwmp_output "$parameter" "$val"
+        ubus_freecwmp_output "$parameter" "$val"
         return
     else
         return
@@ -343,11 +343,12 @@ if [ $rc -eq 0 ]; then
             let local i=$static-$num2
metric=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get network.@route[$i].metric 2> /dev/null`
         fi
-        freecwmp_output "$parameter" "$metric"
+        ubus_freecwmp_output "$parameter" "$metric"
         return
     else
         return
     fi
 fi
-
+return $FAULT_CPE_INVALID_PARAMETER_NAME
 }
+
--
1.7.4.1



<Prev in Thread] Current Thread [Next in Thread>
  • ubus data model patch [06/27], KALLEL Mohamed <=