freecwmp
[Top] [All Lists]

Re: [PATCH 11/27] Update wan_device script to support communicte data of

To: mohamed.kallel@pivasoftware.com
Subject: Re: [PATCH 11/27] Update wan_device script to support communicte data of get parameter values to the core via ubus Contributed by Inteno Broadband Technology AB
From: Luka Perkov <freecwmp@lukaperkov.net>
Date: Sat, 8 Dec 2012 11:41:19 +0100
Cc: freecwmp@linux-mips.org, ahmed.zribi@pivasoftware.com, freecwmp@lukaperkov.net, jogo@openwrt.org
In-reply-to: <1354809292-2467-12-git-send-email-mohamed.kallel@pivasoftware.com>
Mail-followup-to: mohamed.kallel@pivasoftware.com, freecwmp@linux-mips.org, ahmed.zribi@pivasoftware.com, jogo@openwrt.org
Original-recipient: rfc822;freecwmp@linux-mips.org
References: <mohamed.kallel@pivasoftware.com> <1354809292-2467-1-git-send-email-mohamed.kallel@pivasoftware.com> <1354809292-2467-12-git-send-email-mohamed.kallel@pivasoftware.com>
Sender: freecwmp-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, Dec 06, 2012 at 04:54:36PM +0100, Mohamed wrote:
> 
> Signed-off-by: Ahmed ZRIBI <ahmed.zribi@pivasoftware.com>
> Signed-off-by: Mohamed <mohamed.kallel@pivasoftware.com>

NACK. Look at comment from patch v4.

> ---
>  ext/openwrt/scripts/functions/wan_device |   39 +++++++++++++++++++++++++----
>  1 files changed, 33 insertions(+), 6 deletions(-)
> 
> diff --git a/ext/openwrt/scripts/functions/wan_device 
> b/ext/openwrt/scripts/functions/wan_device
> index 77cb63f..a8b6361 100644
> --- a/ext/openwrt/scripts/functions/wan_device
> +++ b/ext/openwrt/scripts/functions/wan_device
> @@ -4,26 +4,37 @@
>  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"
> +ubus_freecwmp_output 
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ConnectionStatus"
>  "$val" "xsd:boolean"
>  }
>  
>  get_wan_device_mng_interface_ip() {
>  local val
> +local 
> parm="InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress"
>  if [ -z "$default_wan_device_mng_interface_ip" ]; then
>       val=`network_get_ipaddr val mng`
>  else
>       val=$default_wan_device_mng_interface_ip
>  fi
> -freecwmp_output 
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress"
>  "$val"
> +if [ "$FLAGS_value" != "${FLAGS_TRUE}" ]; then
> +     ubus_freecwmp_output "$parm" "$val"
> +else
> +     freecwmp_output "$parm" "$val"
> +fi
>  }
>  
>  get_wan_device_mng_interface_mac() {
> +local val=""
> +local 
> parm="InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.MACAddress"
>  if [ -z "$default_wan_device_mng_interface_mac" ]; then
>       val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get 
> network.mng.macaddr`
>  else
>       val=$default_wan_device_mng_interface_mac
>  fi
> -freecwmp_output 
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.MACAddress"
>  "$val"
> +if [ "$FLAGS_value" != "${FLAGS_TRUE}" ]; then
> +     ubus_freecwmp_output "$parm" "$val"
> +else
> +     freecwmp_output "$parm" "$val"
> +fi
>  }
>  
>  get_wan_device_wan_ppp_enable() {
> @@ -31,7 +42,7 @@ local val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} 
> get network.wan.auto
>  if [ -z $val ]; then
>       val="1"
>  fi
> -freecwmp_output 
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Enable"
>  "$val"
> +ubus_freecwmp_output 
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Enable"
>  "$val" "xsd:boolean"
>  }
>  
>  set_wan_device_wan_ppp_enable() {
> @@ -47,7 +58,7 @@ fi
>  
>  get_wan_device_wan_ppp_username() {
>  local val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get 
> network.wan.username 2> /dev/null`
> -freecwmp_output 
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Username"
>  "$val"
> +ubus_freecwmp_output 
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Username"
>  "$val"
>  }
>  
>  set_wan_device_wan_ppp_username() {
> @@ -55,7 +66,9 @@ set_wan_device_wan_ppp_username() {
>  }
>  
>  get_wan_device_wan_ppp_password() {
> -freecwmp_output 
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Password"
>  ""
> +local val=""
> +val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get 
> network.wan.password 2> /dev/null`
> +ubus_freecwmp_output 
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Password"
>  "$val"
>  }
>  
>  set_wan_device_wan_ppp_password() {
> @@ -71,6 +84,7 @@ case "$1" in
>       get_wan_device_wan_ppp_enable
>       get_wan_device_wan_ppp_username
>       get_wan_device_wan_ppp_password
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       InternetGatewayDevice.WANDevice.)
>       get_wan_device_mng_status
> @@ -79,6 +93,7 @@ case "$1" in
>       get_wan_device_wan_ppp_enable
>       get_wan_device_wan_ppp_username
>       get_wan_device_wan_ppp_password
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       InternetGatewayDevice.WANDevice.1.)
>       get_wan_device_mng_status
> @@ -87,6 +102,7 @@ case "$1" in
>       get_wan_device_wan_ppp_enable
>       get_wan_device_wan_ppp_username
>       get_wan_device_wan_ppp_password
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       InternetGatewayDevice.WANDevice.1.WANConnectionDevice.)
>       get_wan_device_mng_status
> @@ -95,6 +111,7 @@ case "$1" in
>       get_wan_device_wan_ppp_enable
>       get_wan_device_wan_ppp_username
>       get_wan_device_wan_ppp_password
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.)
>       get_wan_device_mng_status
> @@ -103,36 +120,46 @@ case "$1" in
>       get_wan_device_wan_ppp_enable
>       get_wan_device_wan_ppp_username
>       get_wan_device_wan_ppp_password
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       
> InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.)
>       get_wan_device_mng_status
>       get_wan_device_mng_interface_ip
>       get_wan_device_mng_interface_mac
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       
> 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 $FAULT_CPE_NO_FAULT
>       ;;
>       
> InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ConnectionStatus)
>       get_wan_device_mng_status
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       
> InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress)
>       get_wan_device_mng_interface_ip
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       
> InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.MACAddress)
>       get_wan_device_mng_interface_mac
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       
> InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Enable)
>       get_wan_device_wan_ppp_enable
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       
> InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Username)
>       get_wan_device_wan_ppp_username
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       
> InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Password)
>       get_wan_device_wan_ppp_password
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>  esac
> +return $FAULT_CPE_INVALID_PARAMETER_NAME
>  }
>  
>  set_wan_device() {
> -- 
> 1.7.4.1

Luka 

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