freecwmp
[Top] [All Lists]

[PATCH v2 03/10] Update scripts in order to send data from external scri

Subject: [PATCH v2 03/10] Update scripts in order to send data from external script to the core via ubus
From: Mohamed <mohamed.kallel@pivasoftware.com>
Date: Thu, 27 Dec 2012 17:07:59 +0100
Update the scripts inorder to communicate data to ubus handler for the 
get_parameter_values with ubus commands
Contributed by Inteno Broadband Technology AB

Signed-off-by: Mohamed Kallel <mohamed.kallel@pivasoftware.com>
Signed-off-by: Ahmed Zribi <ahmed.zribi@pivasoftware.com>
---
 ext/openwrt/scripts/freecwmp.sh              |   52 ++++++++++--
 ext/openwrt/scripts/functions/common         |  114 +++++++++++++++++++++++---
 ext/openwrt/scripts/functions/device_hosts   |    4 +-
 ext/openwrt/scripts/functions/device_info    |   16 +++-
 ext/openwrt/scripts/functions/device_ip      |    3 +-
 ext/openwrt/scripts/functions/device_routing |    3 +-
 ext/openwrt/scripts/functions/device_users   |    2 +
 ext/openwrt/scripts/functions/lan_device     |   11 ++-
 ext/openwrt/scripts/functions/misc           |    9 ++-
 ext/openwrt/scripts/functions/wan_device     |   20 ++++-
 10 files changed, 204 insertions(+), 30 deletions(-)

diff --git a/ext/openwrt/scripts/freecwmp.sh b/ext/openwrt/scripts/freecwmp.sh
index 3d16c4b..b6ff68a 100644
--- a/ext/openwrt/scripts/freecwmp.sh
+++ b/ext/openwrt/scripts/freecwmp.sh
@@ -9,6 +9,7 @@
 # define a 'name' command-line string flag
 DEFINE_boolean 'newline' false 'do not output the trailing newline' 'n'
 DEFINE_boolean 'value' false 'output values only' 'v'
+DEFINE_boolean 'ubus' false 'send values using ubus' 'b'
 DEFINE_boolean 'empty' false 'output empty parameters' 'e'
 DEFINE_boolean 'last' false 'output only last line ; for parameters that tend 
to have huge output' 'l'
 DEFINE_boolean 'debug' false 'give debug output' 'd'
@@ -20,7 +21,7 @@ DEFINE_string 'size' '' 'size of file to download [download 
only]' 's'
 FLAGS_HELP=`cat << EOF
 USAGE: $0 [flags] command [parameter] [values]
 command:
-  get [value|notification|tags|all]
+  get [value|notification|tags|name|all]
   set [value|notification|tag]
   download
   factory_reset
@@ -118,21 +119,56 @@ handle_scripts() {
 config_load freecwmp
 config_foreach handle_scripts "scripts"
 
+# Fault codes
+
+E_REQUEST_DENIED="1"
+E_INTERNAL_ERROR="2"
+E_INVALID_ARGUMENTS="3"
+E_RESOURCES_EXCEEDED="4"
+E_INVALID_PARAMETER_NAME="5"
+E_INVALID_PARAMETER_TYPE="6"
+E_INVALID_PARAMETER_VALUE="7"
+E_NON_WRITABLE_PARAMETER="8"
+E_NOTIFICATION_REJECTED="9"
+E_DOWNLOAD_FAILURE="10"
+E_UPLOAD_FAILURE="11"
+E_FILE_TRANSFER_AUTHENTICATION_FAILURE="12"
+E_FILE_TRANSFER_UNSUPPORTED_PROTOCOL="13"
+E_DOWNLOAD_FAIL_MULTICAST_GROUP="14"
+E_DOWNLOAD_FAIL_CONTACT_SERVER="15"
+E_DOWNLOAD_FAIL_ACCESS_FILE="16"
+E_DOWNLOAD_FAIL_COMPLETE_DOWNLOAD="17"
+E_DOWNLOAD_FAIL_FILE_CORRUPTED="18"
+E_DOWNLOAD_FAIL_FILE_AUTHENTICATION="19"
+
 if [ "$action" = "get_value" -o "$action" = "get_all" ]; then
        if [ ${FLAGS_force} -eq ${FLAGS_FALSE} ]; then
                __tmp_arg="Device."
                # TODO: don't check only string length ; but this is only used
-               #       for getting correct prefix of CWMP parameter anyway
-               if [  ${#__arg1} -lt ${#__tmp_arg} ]; then
-                       echo "CWMP parameters usualy begin with 
'InternetGatewayDevice.' or 'Device.'     "
+               #       for getting correct prefix of CWMP parameter anyway and 
accepting empty string
+               if [  ${#__arg1} -lt ${#__tmp_arg} -a ${#__arg1} -ne 0 ]; then
+                       echo "CWMP parameters usualy begin with 
'InternetGatewayDevice.' or 'Device.' or ''     "
                        echo "if you want to force script execution with 
provided parameter use '-f' flag."
                        exit -1
                fi
        fi
-       for function_name in $get_value_functions
-       do
-               $function_name "$__arg1"
-       done
+       freecwmp_check_fault "$__arg1"
+       fault_code="$?"
+       if [ "$fault_code" = "0" ]; then
+               # TODO: don't return only 'InternetGatewayDevice.' when getting 
an empty string; but we should both
+               #       parameter with prefix 'InternetGatewayDevice.' and 
'Device.'
+               if [ "$__arg1" = "InternetGatewayDevice." -a "$__arg1" = "" ]; 
then
+                       __param="InternetGatewayDevice."
+               else
+                       __param="$__arg1"
+               fi
+               freecwmp_execute_functions "$get_value_functions" "$__param"
+               fault_code="$?"
+       fi
+       if [ "$fault_code" != "0" ]; then
+               let fault_code=$fault_code+9000
+               freecwmp_output "$__arg1" "" "" "" "$fault_code"
+       fi
 fi
 
 if [ "$action" = "set_value" ]; then
diff --git a/ext/openwrt/scripts/functions/common 
b/ext/openwrt/scripts/functions/common
index 7e3000a..7a52dc8 100644
--- a/ext/openwrt/scripts/functions/common
+++ b/ext/openwrt/scripts/functions/common
@@ -1,5 +1,6 @@
 #!/bin/sh
 # Copyright (C) 2011-2012 Luka Perkov <freecwmp@lukaperkov.net>
+# Copyright (C) 2012 Ahmed Zribi <ahmed.zribi@pivasoftware.com>
 
 # TODO: merge this one somewhere in OpenWrt
 uci_remove_list_element() {
@@ -17,37 +18,97 @@ uci_remove_list_element() {
 }
 
 freecwmp_output() {
-local parameter="$1"
-local value="$2"
-local delimiter="$3"
+if [ "$FLAGS_value" = "${FLAGS_TRUE}" ]; then
+       local parameter="$1"
+       local value="$2"
+       local delimiter="$3"
 
-if [ "$delimiter" = "" ]; then
-       delimiter=":"
+       if [ "$delimiter" = "" ]; then
+               delimiter=":"
+       fi
+       if [ -n "$value" -o ${FLAGS_empty} -eq ${FLAGS_TRUE} ]; then
+               if [ ${FLAGS_value} -eq ${FLAGS_TRUE} ]; then
+                       echo $ECHO_newline $value
+               else
+                       echo $ECHO_newline $parameter "$delimiter" $value
+               fi
+       fi
 fi
 
-if [ -n "$value" -o ${FLAGS_empty} -eq ${FLAGS_TRUE} ]; then
-       if [ ${FLAGS_value} -eq ${FLAGS_TRUE} ]; then
-               echo $ECHO_newline $value
-       else
-               echo $ECHO_newline $parameter "$delimiter" $value
-       fi
+if [ "$FLAGS_ubus" = "${FLAGS_TRUE}" ]; then
+       local parameter="$1"
+       local value="$2"
+       local permissions="$3"
+       local type="$4"
+       local fault_code="$5"
+       freecwmp_ubus_output "$parameter" "$value" "$permissions" "$type" 
"$fault_code"
 fi
 }
 
+freecwmp_ubus_output() {
+
+       local parameter="$1"
+       local value="$2"
+       local permissions="$3"
+       local type="$4"
+       local fault_code="$5"
+
+       if [ "$type" = "" ]; then
+               type="xsd:string"
+       fi
+
+       case "$action" in
+               get_value)
+               ubus ${UBUS_SOCKET:+-s $UBUS_SOCKET}  call tr069 
get_parameter_values '{ "parameter": "'$parameter'", "value": "'$value'", 
"type": "'$type'", "fault_code":"'$fault_code'" }' 2> /dev/null
+               ;;
+       esac
+}
 freecwmp_value_output() {
+       local tmp_value=${FLAGS_value}
+       FLAGS_value=${FLAGS_TRUE}
+       local tmp_ubus=${FLAGS_ubus}
+       FLAGS_ubus=${FLAGS_FALSE}
+       
        freecwmp_output "$1" "$2" "V"
+       
+       FLAGS_value=$tmp_value
+       FLAGS_ubus=$tmp_ubus
 }
 
 freecwmp_notification_output() {
+       local tmp_value=${FLAGS_value}
+       FLAGS_value=${FLAGS_TRUE}
+       local tmp_ubus=${FLAGS_ubus}
+       FLAGS_ubus=${FLAGS_FALSE}
+
        freecwmp_output "$1" "$2" "N"
+       
+       FLAGS_value=$tmp_value
+       FLAGS_ubus=$tmp_ubus
 }
 
 freecwmp_tags_output() {
+       local tmp_value=${FLAGS_value}
+       FLAGS_value=${FLAGS_TRUE}
+       local tmp_ubus=${FLAGS_ubus}
+       FLAGS_ubus=${FLAGS_FALSE}
+       
        freecwmp_output "$1" "$2" "T"
+       
+       FLAGS_value=$tmp_value
+       FLAGS_ubus=$tmp_ubus
 }
 
 freecwmp_not_implemented() {
+       local tmp_value=${FLAGS_value}
+       FLAGS_value=${FLAGS_TRUE}
+       local tmp_ubus=${FLAGS_ubus}
+       FLAGS_ubus=${FLAGS_FALSE}
+       
        freecwmp_output "$1" "NOT_IMPLEMENTED"
+       
+       FLAGS_value=$tmp_value
+       FLAGS_ubus=$tmp_ubus
 }
 
 freecwmp_parse_formated_parameter() {
@@ -249,3 +310,34 @@ EOF
        sh "$lock" &
 fi
 }
+
+freecwmp_check_fault() {
+if [ "$1" = "." ]; then
+       return $E_INVALID_PARAMETER_NAME
+fi
+return $E_NO_FAULT
+}
+
+freecwmp_execute_functions()
+{
+       local function_list="$1"
+       local arg1="$2"
+       local arg2="$3"
+       local arg3="$4"
+       local no_fault="0"
+       local fault_code=""
+       
+       for function_name in $function_list
+       do
+               $function_name "$arg1" "$arg2" "$arg3"
+               fault_code="$?"
+               if [ "$fault_code" = "0" ]; then
+                       no_fault="1"
+               fi
+               if [ "$fault_code" != "0" -a "$fault_code" != 
"$E_INVALID_PARAMETER_NAME" ]; then
+                       return $fault_code
+               fi
+       done
+       if [ "$no_fault" = "1" ]; then fault_code="0"; fi
+       return $fault_code
+}
\ No newline at end of file
diff --git a/ext/openwrt/scripts/functions/device_hosts 
b/ext/openwrt/scripts/functions/device_hosts
index cccf9a6..27bfeb3 100644
--- a/ext/openwrt/scripts/functions/device_hosts
+++ b/ext/openwrt/scripts/functions/device_hosts
@@ -25,7 +25,7 @@ get_device_hosts_ip_address() {
        fi
        eval "export -- \"$5=\"\"$_ip\"\"\""
 }
-
+# TODO: When getting Device. as parameter name we should return all parameter 
path belong to this script
 get_device_hosts() {
 local leases_file
 if [ -z "$default_dnsmasq_leases_file" ]; then
@@ -187,7 +187,7 @@ if [ $rc -eq 0 ]; then
 fi
 
 # TODO: Device.Hosts.Host.{i}.IPv6Address.{i}.IPAddress (no IPv6 support yet)
-
+return $E_INVALID_PARAMETER_NAME
 }
 
 set_device_hosts() { return; }
diff --git a/ext/openwrt/scripts/functions/device_info 
b/ext/openwrt/scripts/functions/device_info
index 4423b8b..2f13cc9 100644
--- a/ext/openwrt/scripts/functions/device_info
+++ b/ext/openwrt/scripts/functions/device_info
@@ -81,6 +81,7 @@ case "$1" in
        get_device_info_software_version
        get_device_info_uptime
        get_device_info_device_log
+       return 0
        ;;
        InternetGatewayDevice.DeviceInfo.)
        get_device_info_manufacturer
@@ -91,32 +92,42 @@ case "$1" in
        get_device_info_software_version
        get_device_info_uptime
        get_device_info_device_log
+       return 0
        ;;
        InternetGatewayDevice.DeviceInfo.Manufacturer)
        get_device_info_manufacturer
+       return 0
        ;;
        InternetGatewayDevice.DeviceInfo.ManufacturerOUI)
        get_device_info_oui
+       return 0
        ;;
        InternetGatewayDevice.DeviceInfo.ProductClass)
        get_device_info_product_class
+       return 0
        ;;
        InternetGatewayDevice.DeviceInfo.SerialNumber)
        get_device_info_serial_number
+       return 0
        ;;
        InternetGatewayDevice.DeviceInfo.HardwareVersion)
        get_device_info_hardware_version
+       return 0
        ;;
        InternetGatewayDevice.DeviceInfo.SoftwareVersion)
        get_device_info_software_version
+       return 0
        ;;
        InternetGatewayDevice.DeviceInfo.UpTime)
        get_device_info_uptime
+       return 0
        ;;
        InternetGatewayDevice.DeviceInfo.DeviceLog)
        get_device_info_device_log
+       return 0
        ;;
 esac
+return $E_INVALID_PARAMETER_NAME
 }
 
 set_device_info() {
@@ -161,10 +172,11 @@ return 1
 }
 
 get_device_info_generic() {
-       check_parameter_device_info_generic "$1" ; _tmp=$? ; if [ "$_tmp" -eq 1 
]; then return 0; fi
+       check_parameter_device_info_generic "$1" ; _tmp=$? ; if [ "$_tmp" -eq 1 
]; then return $E_INVALID_PARAMETER_NAME; fi
 
        freecwmp_get_parameter_value "val" "$1"
-       freecwmp_value_output "$1" "$val"
+       freecwmp_output "$1" "$val"
+       return 0
 }
 
 set_device_info_generic() {
diff --git a/ext/openwrt/scripts/functions/device_ip 
b/ext/openwrt/scripts/functions/device_ip
index fda3793..ef1a368 100644
--- a/ext/openwrt/scripts/functions/device_ip
+++ b/ext/openwrt/scripts/functions/device_ip
@@ -1,6 +1,7 @@
 #!/bin/sh
 # Copyright (C) 2012 Luka Perkov <freecwmp@lukaperkov.net>
 
+# TODO: When getting Device. as parameter name we should return all parameter 
path belong to this script
 get_device_ip() {
 local parameter="$1"
 
@@ -119,7 +120,7 @@ fi
 # TODO: Device.IP.Interface.{i}.IPv6Address.{i}.Status
 # TODO: Device.IP.Interface.{i}.IPv6Prefix.{i}.Status
 # TODO: Device.IP.Interface.{i}.Stats.
-
+return $E_INVALID_PARAMETER_NAME;
 }
 
 set_device_ip() { return; }
diff --git a/ext/openwrt/scripts/functions/device_routing 
b/ext/openwrt/scripts/functions/device_routing
index 0dba0a1..da58b1b 100644
--- a/ext/openwrt/scripts/functions/device_routing
+++ b/ext/openwrt/scripts/functions/device_routing
@@ -80,6 +80,7 @@ get_device_routing_ipv4_ordering_information() {
        eval "export -- \"$4=\"\"$_static\"\"\""
 }
 
+# TODO: When getting Device. as parameter name we should return all parameter 
path belong to this script
 get_device_routing() {
 local parameter=$1
 
@@ -349,7 +350,7 @@ if [ $rc -eq 0 ]; then
                return
        fi
 fi
-
+return $E_INVALID_PARAMETER_NAME
 }
 
 set_device_routing() { return; }
diff --git a/ext/openwrt/scripts/functions/device_users 
b/ext/openwrt/scripts/functions/device_users
index 97e6c26..58e527d 100644
--- a/ext/openwrt/scripts/functions/device_users
+++ b/ext/openwrt/scripts/functions/device_users
@@ -1,6 +1,7 @@
 #!/bin/sh
 # Copyright (C) 2012 Luka Perkov <freecwmp@lukaperkov.net>
 
+# TODO: When getting Device. as parameter name we should return all parameter 
path belong to this script
 get_device_users() {
 local parameter="$1"
 case "$parameter" in
@@ -57,6 +58,7 @@ if [ $rc -eq 0 ]; then
        freecwmp_value_output "$parameter" ""
        return
 fi
+return $E_INVALID_PARAMETER_NAME
 }
 
 set_device_users() {
diff --git a/ext/openwrt/scripts/functions/lan_device 
b/ext/openwrt/scripts/functions/lan_device
index 5ba513c..2faa3b5 100644
--- a/ext/openwrt/scripts/functions/lan_device
+++ b/ext/openwrt/scripts/functions/lan_device
@@ -3,6 +3,7 @@
 
 get_wlan_enable() {
 local num="$1"
+local type="xsd:boolean"
 local val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get 
wireless.@wifi-device[$num].disabled 2> /dev/null`
 let num=$num+1
 if [ "$val" = "1" ]; then
@@ -10,7 +11,7 @@ if [ "$val" = "1" ]; then
 else
        val="1"
 fi
-freecwmp_output 
"InternetGatewayDevice.LANDevice.1.WLANConfiguration.$num.Enable" "$val"
+freecwmp_output 
"InternetGatewayDevice.LANDevice.1.WLANConfiguration.$num.Enable" "$val" "" 
"$type"
 }
 
 set_wlan_enable() {
@@ -44,30 +45,38 @@ case "$1" in
        InternetGatewayDevice.)
        get_wlan_enable 0
        get_wlan_ssid 0
+       return 0
        ;;
        InternetGatewayDevice.LANDevice.)
        get_wlan_enable 0
        get_wlan_ssid 0
+       return 0
        ;;
        InternetGatewayDevice.LANDevice.1.)
        get_wlan_enable 0
        get_wlan_ssid 0
+       return 0
        ;;
        InternetGatewayDevice.LANDevice.1.WLANConfiguration.)
        get_wlan_enable 0
        get_wlan_ssid 0
+       return 0
        ;;
        InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.)
        get_wlan_enable 0
        get_wlan_ssid 0
+       return 0
        ;;
        InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.Enable)
        get_wlan_enable 0
+       return 0
        ;;
        InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.SSID)
        get_wlan_ssid 0
+       return 0
        ;;
 esac
+return $E_INVALID_PARAMETER_NAME
 }
 
 set_lan_device() {
diff --git a/ext/openwrt/scripts/functions/misc 
b/ext/openwrt/scripts/functions/misc
index 7dede8b..5c923ec 100644
--- a/ext/openwrt/scripts/functions/misc
+++ b/ext/openwrt/scripts/functions/misc
@@ -3,23 +3,28 @@
 
 get_misc_cpu_usage() {
 local val=`uptime | awk -F'average: ' '{ print $2 }' | awk -F',' '{ print $1 
}' | awk -F'.' '{ print $2 }'`
-freecwmp_value_output "Device.DeviceInfo.ProcessStatus.CPUUsage" "$val"
+freecwmp_output "Device.DeviceInfo.ProcessStatus.CPUUsage" "$val"
 }
 
 get_misc_process_number() {
 local val=`ps | grep -v COMMAND | wc -l`
-freecwmp_value_output "Device.DeviceInfo.ProcessStatus.ProcessNumberOfEntries" 
"$val"
+local type="xsd:unsignedInt"
+freecwmp_output "Device.DeviceInfo.ProcessStatus.ProcessNumberOfEntries" 
"$val" "" "$type"
 }
 
+# TODO: When getting Device. as parameter name we should return all parameter 
path belong to this script
 get_misc() {
 case "$1" in
        Device.DeviceInfo.ProcessStatus.CPUUsage)
        get_misc_cpu_usage
+       return 0
        ;;
        Device.DeviceInfo.ProcessStatus.ProcessNumberOfEntries)
        get_misc_process_number
+       return 0
        ;;
 esac
+return $E_INVALID_PARAMETER_NAME
 }
 
 set_misc() { return; }
diff --git a/ext/openwrt/scripts/functions/wan_device 
b/ext/openwrt/scripts/functions/wan_device
index e8c6a25..12d36e2 100644
--- a/ext/openwrt/scripts/functions/wan_device
+++ b/ext/openwrt/scripts/functions/wan_device
@@ -4,7 +4,8 @@
 get_wan_device_mng_status() {
 # TODO: Unconfigured ; Connecting ; Connected ; PendingDisconnect ; 
Disconneting ; Disconnected 
 local val="Connected"
-freecwmp_output 
"InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ConnectionStatus"
 "$val"
+local type="xsd:boolean"
+freecwmp_output 
"InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ConnectionStatus"
 "$val" "" "$type"
 }
 
 get_wan_device_mng_interface_ip() {
@@ -28,10 +29,11 @@ freecwmp_output 
"InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPCo
 
 get_wan_device_wan_ppp_enable() {
 local val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get 
network.wan.auto 2> /dev/null`
+local type="xsd:boolean"
 if [ -z $val ]; then
        val="1"
 fi
-freecwmp_output 
"InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Enable"
 "$val"
+freecwmp_output 
"InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Enable"
 "$val" "" "$type"
 }
 
 set_wan_device_wan_ppp_enable() {
@@ -71,6 +73,7 @@ case "$1" in
        get_wan_device_wan_ppp_enable
        get_wan_device_wan_ppp_username
        get_wan_device_wan_ppp_password
+       return 0
        ;;
        InternetGatewayDevice.WANDevice.)
        get_wan_device_mng_status
@@ -79,6 +82,7 @@ case "$1" in
        get_wan_device_wan_ppp_enable
        get_wan_device_wan_ppp_username
        get_wan_device_wan_ppp_password
+       return 0
        ;;
        InternetGatewayDevice.WANDevice.1.)
        get_wan_device_mng_status
@@ -87,6 +91,7 @@ case "$1" in
        get_wan_device_wan_ppp_enable
        get_wan_device_wan_ppp_username
        get_wan_device_wan_ppp_password
+       return 0
        ;;
        InternetGatewayDevice.WANDevice.1.WANConnectionDevice.)
        get_wan_device_mng_status
@@ -95,6 +100,7 @@ case "$1" in
        get_wan_device_wan_ppp_enable
        get_wan_device_wan_ppp_username
        get_wan_device_wan_ppp_password
+       return 0
        ;;
        InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.)
        get_wan_device_mng_status
@@ -103,36 +109,46 @@ case "$1" in
        get_wan_device_wan_ppp_enable
        get_wan_device_wan_ppp_username
        get_wan_device_wan_ppp_password
+       return 0
        ;;
        
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.)
        get_wan_device_mng_status
        get_wan_device_mng_interface_ip
        get_wan_device_mng_interface_mac
+       return 0
        ;;
        
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.)
        get_wan_device_mng_status
        get_wan_device_mng_interface_ip
        get_wan_device_mng_interface_mac
+       return 0
        ;;
        
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ConnectionStatus)
        get_wan_device_mng_status
+       return 0
        ;;
        
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress)
        get_wan_device_mng_interface_ip
+       return 0
        ;;
        
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.MACAddress)
        get_wan_device_mng_interface_mac
+       return 0
        ;;
        
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Enable)
        get_wan_device_wan_ppp_enable
+       return 0
        ;;
        
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Username)
        get_wan_device_wan_ppp_username
+       return 0
        ;;
        
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Password)
        get_wan_device_wan_ppp_password
+       return 0
        ;;
 esac
+return $E_INVALID_PARAMETER_NAME
 }
 
 set_wan_device() {
-- 
1.7.4.1


--------------050008050603080005000105
Content-Type: text/plain; charset=windows-1256;
 name="0007-Adapt-the-scripts-in-order-to-support-get-parameter-.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0007-Adapt-the-scripts-in-order-to-support-get-parameter-.pa";
 filename*1="tch"

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH v2 03/10] Update scripts in order to send data from external script to the core via ubus, Mohamed <=