From 82e8527fb8a4453907bfb26926aa8cd72e661db7 Mon Sep 17 00:00:00 2001 From: zribiahmed Date: Wed, 22 May 2013 17:17:40 +0000 Subject: [PATCH] fix some bugs in: --- Makefile | 1 + src/scripts/freecwmp.sh | 10 +- src/scripts/functions/common | 42 +- src/scripts/functions/lan_device | 6278 +++++++++++++++++++++------ src/scripts/functions/voice_service | 38 +- 5 files changed, 4899 insertions(+), 1470 deletions(-) diff --git a/Makefile b/Makefile index 50bdc61..4485f9c 100644 --- a/Makefile +++ b/Makefile @@ -123,6 +123,7 @@ ifeq ($(CONFIG_CWMP_SCRIPTS_FULL),y) $(CP) $(PKG_BUILD_DIR)/scripts/functions $(1)/usr/share/freecwmp $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/freecwmp.sh $(1)/usr/sbin/freecwmp + $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/wepkeygen $(1)/usr/sbin/wepkeygen endif endef diff --git a/src/scripts/freecwmp.sh b/src/scripts/freecwmp.sh index 3ca8488..491fc5a 100644 --- a/src/scripts/freecwmp.sh +++ b/src/scripts/freecwmp.sh @@ -431,7 +431,7 @@ fi if [ "$action" = "set_tag" ]; then freecwmp_set_parameter_tag "$__arg1" "$__arg2" - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q commit fi if [ "$action" = "download" ]; then @@ -524,7 +524,7 @@ if [ "$action" = "apply_notification" -o "$action" = "apply_value" ]; then let __fault_count=$__fault_count/3 if [ "$__fault_count" = "0" ]; then # applying - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q commit if [ "$action" = "apply_notification" ]; then freecwmp_output "" "" "" "" "" "" "" "0" elif [ "$action" = "apply_value" ]; then @@ -535,13 +535,13 @@ if [ "$action" = "apply_notification" -o "$action" = "apply_value" ]; then let n=$__fault_count-1 for i in `seq 0 $n` do - local parm=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -P /var/state get cwmp.@fault[$i].parameter 2> /dev/null` - local fault_code=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -P /var/state get cwmp.@fault[$i].fault_code 2> /dev/null` + local parm=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q -P /var/state get cwmp.@fault[$i].parameter 2> /dev/null` + local fault_code=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q -P /var/state get cwmp.@fault[$i].fault_code 2> /dev/null` freecwmp_fault_output "$parm" "$fault_code" if [ "$action" = "apply_notification" ]; then break; fi done rm -rf /var/state/cwmp 2> /dev/null - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} revert cwmp + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q revert cwmp fi fi diff --git a/src/scripts/functions/common b/src/scripts/functions/common index 5de6c2b..b7a0964 100644 --- a/src/scripts/functions/common +++ b/src/scripts/functions/common @@ -6,13 +6,13 @@ uci_remove_list_element() { local option="$1" local value="$2" - local list="$(/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get $option)" + local list="$(/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q get $option)" local elem - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} delete $option + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q delete $option for elem in $list; do if [ "$elem" != "$value" ]; then - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add_list $option=$elem + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q add_list $option=$elem fi done } @@ -272,7 +272,7 @@ freecwmp_config_cwmp() { fi elif [ "set" = "$2" ]; then if [ "value" = "$3" ]; then - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.$1.value=$5 2> /dev/null + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set cwmp.$1.value=$5 2> /dev/null fi elif [ "check" = "$2" ]; then if [ "parameter" = "$3" ]; then @@ -340,9 +340,9 @@ freecwmp_set_parameter_value() { local _val="$2" config_foreach freecwmp_config_cwmp "cwmp" "check" "parameter" "$_parm" "_section" if [ ! "$_section" = "" ]; then - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.$_section.value=$_val 2> /dev/null + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set cwmp.$_section.value=$_val 2> /dev/null else - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} batch << EOF 2>&1 >/dev/null + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q batch << EOF 2>&1 >/dev/null add cwmp cwmp set cwmp.@cwmp[-1].parameter="$_parm" set cwmp.@cwmp[-1].value="$_val" @@ -388,20 +388,20 @@ freecwmp_notify() { freecwmp_set_parameter_notification() { local _parm="$1" local _val="$2" - local tmp=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@notifications[0] 2>/dev/null` + local tmp=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q get cwmp.@notifications[0] 2>/dev/null` if [ "$tmp" = "" ]; then - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add cwmp notifications 2>&1 >/dev/null + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q add cwmp notifications 2>&1 >/dev/null else uci_remove_list_element "cwmp.@notifications[0].passive" "$_parm" 2>/dev/null uci_remove_list_element "cwmp.@notifications[0].active" "$_parm" 2>/dev/null uci_remove_list_element "cwmp.@notifications[0].disabled" "$_parm" 2>/dev/null fi if [ "$_val" -eq "1" ]; then - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add_list cwmp.@notifications[0].passive="$_parm" 2>&1 >/dev/null + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q add_list cwmp.@notifications[0].passive="$_parm" 2>&1 >/dev/null elif [ "$_val" -eq "2" ]; then - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add_list cwmp.@notifications[0].active="$_parm" 2>&1 >/dev/null + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q add_list cwmp.@notifications[0].active="$_parm" 2>&1 >/dev/null elif [ "$_val" -eq "0" ]; then - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add_list cwmp.@notifications[0].disabled="$_parm" 2>&1 >/dev/null + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q add_list cwmp.@notifications[0].disabled="$_parm" 2>&1 >/dev/null fi } @@ -417,9 +417,9 @@ freecwmp_set_parameter_tag() { local _tag="$2" config_foreach freecwmp_config_cwmp "cwmp" "check" "parameter" "$_parm" "_section" if [ ! "$_section" = "" ]; then - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add_list cwmp.$_section.tag=$_tag 2> /dev/null + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q add_list cwmp.$_section.tag=$_tag 2> /dev/null else - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} batch << EOF 2>&1 >/dev/null + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q batch << EOF 2>&1 >/dev/null add cwmp cwmp set cwmp.@cwmp[-1].parameter="$_parm" add_list cwmp.@cwmp[-1].tag="$_tag" @@ -471,7 +471,7 @@ return $FAULT_CPE_NO_FAULT freecwmp_set_parameter_fault() { local _parm="$1" local _fault="$2" - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -P /var/state batch << EOF 2>&1 >/dev/null + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q -P /var/state batch << EOF 2>&1 >/dev/null add cwmp fault set cwmp.@fault[-1].parameter="$_parm" set cwmp.@fault[-1].fault_code="$_fault" @@ -486,7 +486,7 @@ freecwmp_add_lan_device_ip_interface() { else indice=$_instance fi - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} batch << EOF 2>&1 >/dev/null + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q batch << EOF 2>&1 >/dev/null add cwmp object set cwmp.@object[-1].parameter="$_parm" set cwmp.@object[-1].instance="$_instance" @@ -494,10 +494,10 @@ freecwmp_add_lan_device_ip_interface() { EOF if [ "$indice" != "" ]; then let i=$indice-1 - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set network.lan$indice=interface 2> /dev/null - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set network.lan$indice.ifname=eth$i 2> /dev/null - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set network.lan$indice.type=bridge 2> /dev/null - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set network.lan$indice.proto=dhcp 2> /dev/null + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set network.lan$indice=interface 2> /dev/null + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set network.lan$indice.ifname=eth$i 2> /dev/null + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set network.lan$indice.type=bridge 2> /dev/null + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set network.lan$indice.proto=dhcp 2> /dev/null fi } @@ -597,9 +597,9 @@ freecwmp_apply_vendor_configuration() { local fault_code="9000" - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} import < /tmp/vendor_configuration_file.cfg + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q import < /tmp/vendor_configuration_file.cfg if [ "$?" = "0" ];then - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q commit if [ "$?" != "0" ];then let fault_code=$fault_code+$FAULT_CPE_INTERNAL_ERROR freecwmp_fault_output "" "$fault_code" diff --git a/src/scripts/functions/lan_device b/src/scripts/functions/lan_device index ad233f5..6052c0b 100644 --- a/src/scripts/functions/lan_device +++ b/src/scripts/functions/lan_device @@ -3,18 +3,29 @@ # Copyright (C) 2012 Ahmed Zribi get_wlan_number_of_entries() { -local val=`/sbin/uci -q ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} show wireless | fgrep '=wifi-iface' | wc -l` +local val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless | fgrep '.network' | fgrep "$2" | wc -l` eval "export -- \"$1=$val\"" } get_lan_number_of_entries() { -local val=`/sbin/uci -q ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} show network | fgrep 'is_lan=1' | grep -v loopback|wc -l` +local val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show network | fgrep 'is_lan=1' | grep -v loopback|wc -l` eval "export -- \"$1=$val\"" } +get_lan_device_interface() { +local i=0 +for lan in `ubus list|sed -n 's/network\.interface\.//p'|grep -v loopback`;do + if [ "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q get network.$lan.is_lan`" = "1" ];then + let i=$i+1 + echo "$lan:$i" + fi +done +} + get_wlan_enable() { local num="$1" local lan_num="$2" +local wlan_num="$3" local type="xsd:boolean" local val="" local permissions="" @@ -27,17 +38,17 @@ case "$action" in else val="1" fi - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Enable" "$val" "$permissions" "$type" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Enable" "$val" "$permissions" "$type" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Enable" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Enable" "$val" "$permissions" ;; get_notification) let num=$num+1 freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Enable" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Enable" "$val" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Enable" "$val" ;; esac } @@ -45,7 +56,8 @@ esac set_wlan_enable() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) if [ "$val" = "1" ]; then @@ -58,7 +70,7 @@ case $action in ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Enable" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Enable" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -67,6 +79,7 @@ esac get_wlan_status() { local num="$1" local lan_num="$2" +local wlan_num="$3" local type="xsd:string" local val="" local permissions="" @@ -79,17 +92,17 @@ case "$action" in else val="Up" fi - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Status" "$val" "$permissions" "$type" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Status" "$val" "$permissions" "$type" ;; get_name) permissions="0" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Status" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Status" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Status" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Status" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Status" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Status" "$val" ;; esac } @@ -97,6 +110,7 @@ esac get_wlan_bssid() { local num="$1" local lan_num="$2" +local wlan_num="$3" local type="xsd:string" local val="" local permissions="" @@ -108,17 +122,17 @@ case "$action" in val=`/usr/sbin/wlctl -i wl0.$num bssid` fi let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BSSID" "$val" "$permissions" "$type" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BSSID" "$val" "$permissions" "$type" ;; get_name) permissions="0" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BSSID" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BSSID" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BSSID" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BSSID" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BSSID" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BSSID" "$val" ;; esac } @@ -126,6 +140,7 @@ esac get_wlan_max_bit_rate() { local num="$1" local lan_num="$2" +local wlan_num="$3" local type="xsd:string" local val="" local permissions="" @@ -133,17 +148,17 @@ case "$action" in get_value) val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q get wireless.wl0.hwmode` let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.MaxBitRate" "$val" "$permissions" "$type" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.MaxBitRate" "$val" "$permissions" "$type" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.MaxBitRate" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.MaxBitRate" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.MaxBitRate" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.MaxBitRate" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.MaxBitRate" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.MaxBitRate" "$val" ;; esac } @@ -151,7 +166,8 @@ esac set_wlan_max_bit_rate() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) delay_command "wifi" "wifi" "45" @@ -159,7 +175,7 @@ case $action in ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.MaxBitRate" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.MaxBitRate" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -168,6 +184,7 @@ esac get_wlan_channel() { local num="$1" local lan_num="$2" +local wlan_num="$3" local type="xsd:string" local val="" local permissions="" @@ -179,17 +196,17 @@ case "$action" in val=`/usr/sbin/wlctl -i wl0.$num channel|grep "target channel"|awk -F ' ' '{print$3}'` fi let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Channel" "$val" "$permissions" "$type" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Channel" "$val" "$permissions" "$type" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Channel" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Channel" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Channel" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Channel" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Channel" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Channel" "$val" ;; esac } @@ -197,7 +214,8 @@ esac set_wlan_channel() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) delay_command "wifi" "wifi" "45" @@ -205,7 +223,7 @@ case $action in ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Channel" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Channel" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -214,23 +232,24 @@ esac get_wlan_ssid() { local num="$1" local lan_num="$2" +local wlan_num="$3" local val="" local permissions="" case "$action" in get_value) val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q get wireless.@wifi-iface[$num].ssid` let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.SSID" "$val" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.SSID" "$val" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.SSID" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.SSID" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.SSID" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.SSID" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.SSID" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.SSID" "$val" ;; esac @@ -239,7 +258,8 @@ esac set_wlan_ssid() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) delay_command "wifi" "wifi" "45" @@ -247,7 +267,7 @@ case $action in ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.SSID" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.SSID" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -256,6 +276,7 @@ esac get_wlan_beacon_type() { local num="$1" local lan_num="$2" +local wlan_num="$3" local val="" local permissions="" case "$action" in @@ -273,17 +294,17 @@ case "$action" in val="WPAand11i" fi let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BeaconType" "$val" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BeaconType" "$val" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BeaconType" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BeaconType" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BeaconType" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BeaconType" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BeaconType" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BeaconType" "$val" ;; esac } @@ -291,7 +312,8 @@ esac set_wlan_beacon_type() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) delay_command "wifi" "wifi" "45" @@ -310,7 +332,7 @@ case $action in ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BeaconType" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BeaconType" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -319,6 +341,7 @@ esac get_wlan_mac_control_enable() { local num="$1" local lan_num="$2" +local wlan_num="$3" local type="xsd:boolean" local val="" local permissions="" @@ -331,17 +354,17 @@ case "$action" in else val="0" fi - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.MACAddressControlEnabled" "$val" "$permissions" "$type" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.MACAddressControlEnabled" "$val" "$permissions" "$type" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.MACAddressControlEnabled" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.MACAddressControlEnabled" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.MACAddressControlEnabled" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.MACAddressControlEnabled" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.MACAddressControlEnabled" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.MACAddressControlEnabled" "$val" ;; esac } @@ -349,7 +372,8 @@ esac set_wlan_mac_control_enable() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) if [ "$val" = "1" ]; then @@ -360,12 +384,12 @@ case $action in delay_command "wifi" "wifi" "45" /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set wireless.@wifi-device[$num].macfilter="$val" let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.MACAddressControlEnabled" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.MACAddressControlEnabled" freecwmp_notify "$parm" "$2" "xsd:boolean" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.MACAddressControlEnabled" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.MACAddressControlEnabled" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -374,6 +398,7 @@ esac get_wlan_standard() { local num="$1" local lan_num="$2" +local wlan_num="$3" local val="" local permissions="" case "$action" in @@ -389,17 +414,17 @@ case "$action" in elif [ "$val" = "11n" -o "$val" = "auto" ]; then val="n" fi - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Standard" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Standard" "$val" "$permissions" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Standard" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Standard" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Standard" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Standard" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Standard" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Standard" "$val" ;; esac } @@ -407,7 +432,8 @@ esac set_wlan_standard() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) if [ "$val" = "b" ]; then @@ -422,12 +448,12 @@ case $action in delay_command "wifi" "wifi" "45" /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set wireless.wl0.hwmode="$val" let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Standard" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Standard" freecwmp_notify "$parm" "$2" "xsd:boolean" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.Standard" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.Standard" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -436,6 +462,7 @@ esac get_wlan_wep_key_index() { local num="$1" local lan_num="$2" +local wlan_num="$3" local val="" local type="xsd:unsignedInt" local permissions="" @@ -443,17 +470,17 @@ case "$action" in get_value) val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q get wireless.@wifi-iface[$num].key` let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WEPKeyIndex" "$val" "$permissions" "$type" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPKeyIndex" "$val" "$permissions" "$type" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WEPKeyIndex" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPKeyIndex" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WEPKeyIndex" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WEPKeyIndex" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPKeyIndex" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPKeyIndex" "$val" ;; esac } @@ -461,18 +488,19 @@ esac set_wlan_wep_key_index() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) delay_command "wifi" "wifi" "45" /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set wireless.@wifi-iface[$num].key="$val" let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WEPKeyIndex" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPKeyIndex" freecwmp_notify "$parm" "$2" "xsd:unsignedInt" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WEPKeyIndex" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPKeyIndex" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -481,23 +509,24 @@ esac get_wlan_key_passphrase() { local num="$1" local lan_num="$2" +local wlan_num="$3" local val="" local type="xsd:unsignedInt" local permissions="" case "$action" in get_value) let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.KeyPassphrase" "$val" "$permissions" "$type" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.KeyPassphrase" "$val" "$permissions" "$type" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.KeyPassphrase" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.KeyPassphrase" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.KeyPassphrase" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.KeyPassphrase" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.KeyPassphrase" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.KeyPassphrase" "$val" ;; esac } @@ -505,7 +534,8 @@ esac set_wlan_key_passphrase() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) delay_command "wifi" "wifi" "45" @@ -516,12 +546,12 @@ case $action in let i++ done let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.KeyPassphrase" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.KeyPassphrase" freecwmp_notify "$parm" "$2" "xsd:unsignedInt" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.KeyPassphrase" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.KeyPassphrase" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -530,29 +560,32 @@ esac get_wlan_wep_encryption_level() { local num="$1" local lan_num="$2" +local wlan_num="$3" local val="" local permissions="" case "$action" in get_value) val="40-bit, 104-bit" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WEPEncryptionLevel" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPEncryptionLevel" "$val" "$permissions" ;; get_name) permissions="0" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WEPEncryptionLevel" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPEncryptionLevel" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WEPEncryptionLevel" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WEPEncryptionLevel" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPEncryptionLevel" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPEncryptionLevel" "$val" ;; esac } get_wlan_basic_encryption_modes() { local num="$1" +local lan_num="$2" +local wlan_num="$3" local val="" local permissions="" case "$action" in @@ -568,17 +601,17 @@ case "$action" in else val="None" fi - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BasicEncryptionModes" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BasicEncryptionModes" "$val" "$permissions" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BasicEncryptionModes" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BasicEncryptionModes" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BasicEncryptionModes" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BasicEncryptionModes" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BasicEncryptionModes" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BasicEncryptionModes" "$val" ;; esac } @@ -586,7 +619,8 @@ esac set_wlan_basic_encryption_modes() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) if [ "$val" = "WEPEncryption" ]; then @@ -597,12 +631,12 @@ case $action in delay_command "wifi" "wifi" "45" /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set wireless.@wifi-iface[$num].encryption="$val" let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BasicEncryptionModes" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BasicEncryptionModes" freecwmp_notify "$parm" "$2" "xsd:string" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BasicEncryptionModes" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BasicEncryptionModes" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -611,6 +645,7 @@ esac get_wlan_basic_authentication_mode() { local num="$1" local lan_num="$2" +local wlan_num="$3" local val="" local permissions="" case "$action" in @@ -628,17 +663,17 @@ case "$action" in else val="None" fi - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BasicAuthenticationMode" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BasicAuthenticationMode" "$val" "$permissions" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BasicAuthenticationMode" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BasicAuthenticationMode" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BasicAuthenticationMode" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BasicAuthenticationMode" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BasicAuthenticationMode" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BasicAuthenticationMode" "$val" ;; esac } @@ -646,7 +681,8 @@ esac set_wlan_basic_authentication_mode() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) if [ "$val" = "WEPEncryption" ]; then @@ -657,12 +693,12 @@ case $action in delay_command "wifi" "wifi" "45" /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set wireless.@wifi-iface[$num].encryption="$val" let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BasicAuthenticationMode" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BasicAuthenticationMode" freecwmp_notify "$parm" "$2" "xsd:string" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.BasicAuthenticationMode" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.BasicAuthenticationMode" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -671,6 +707,7 @@ esac get_wlan_wpa_encryption_modes() { local num="$1" local lan_num="$2" +local wlan_num="$3" local val="" local permissions="" case "$action" in @@ -695,17 +732,17 @@ case "$action" in else val="" fi - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WPAEncryptionModes" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WPAEncryptionModes" "$val" "$permissions" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WPAEncryptionModes" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WPAEncryptionModes" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WPAEncryptionModes" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WPAEncryptionModes" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WPAEncryptionModes" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WPAEncryptionModes" "$val" ;; esac } @@ -713,7 +750,8 @@ esac set_wlan_wpa_encryption_modes() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) #TKIPEncryption, AESEncryption, TKIPandAESEncryption @@ -727,12 +765,12 @@ case $action in delay_command "wifi" "wifi" "45" /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set wireless.@wifi-iface[$num].encryption="$val" let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WPAEncryptionModes" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WPAEncryptionModes" freecwmp_notify "$parm" "$2" "xsd:string" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WPAEncryptionModes" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WPAEncryptionModes" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -741,6 +779,7 @@ esac get_wlan_wpa_authentication_mode() { local num="$1" local lan_num="$2" +local wlan_num="$3" local val="" local permissions="" case "$action" in @@ -759,17 +798,17 @@ case "$action" in else val="" fi - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WPAAuthenticationMode" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WPAAuthenticationMode" "$val" "$permissions" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WPAAuthenticationMode" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WPAAuthenticationMode" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WPAAuthenticationMode" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WPAAuthenticationMode" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WPAAuthenticationMode" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WPAAuthenticationMode" "$val" ;; esac } @@ -777,7 +816,8 @@ esac set_wlan_wpa_authentication_mode() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) if [ "$val" = "PSKAuthentication" -o "$wpa" = "132" ]; then @@ -788,12 +828,12 @@ case $action in delay_command "wifi" "wifi" "45" /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set wireless.@wifi-iface[$num].encryption="$val" let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WPAAuthenticationMode" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WPAAuthenticationMode" freecwmp_notify "$parm" "$2" "xsd:string" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WPAAuthenticationMode" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WPAAuthenticationMode" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -802,6 +842,7 @@ esac get_wlan_ieee_11i_encryption_modes() { local num="$1" local lan_num="$2" +local wlan_num="$3" local val="" local permissions="" case "$action" in @@ -826,17 +867,17 @@ case "$action" in else val="" fi - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.IEEE11iEncryptionModes" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.IEEE11iEncryptionModes" "$val" "$permissions" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.IEEE11iEncryptionModes" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.IEEE11iEncryptionModes" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.IEEE11iEncryptionModes" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.IEEE11iEncryptionModes" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.IEEE11iEncryptionModes" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.IEEE11iEncryptionModes" "$val" ;; esac } @@ -844,7 +885,8 @@ esac set_wlan_ieee_11i_encryption_modes() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) #TKIPEncryption, AESEncryption, TKIPandAESEncryption @@ -858,12 +900,12 @@ case $action in delay_command "wifi" "wifi" "45" /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set wireless.@wifi-iface[$num].encryption="$val" let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.IEEE11iEncryptionModes" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.IEEE11iEncryptionModes" freecwmp_notify "$parm" "$2" "xsd:string" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.IEEE11iEncryptionModes" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.IEEE11iEncryptionModes" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -872,6 +914,7 @@ esac get_wlan_ieee_11i_authentication_mode() { local num="$1" local lan_num="$2" +local wlan_num="$3" local val="" local permissions="" case "$action" in @@ -890,17 +933,17 @@ case "$action" in else val="" fi - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.IEEE11iAuthenticationMode" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.IEEE11iAuthenticationMode" "$val" "$permissions" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.IEEE11iAuthenticationMode" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.IEEE11iAuthenticationMode" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.IEEE11iAuthenticationMode" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.IEEE11iAuthenticationMode" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.IEEE11iAuthenticationMode" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.IEEE11iAuthenticationMode" "$val" ;; esac } @@ -908,7 +951,8 @@ esac set_wlan_ieee_11i_authentication_mode() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) if [ "$val" = "PSKAuthentication" ]; then @@ -919,12 +963,12 @@ case $action in delay_command "wifi" "wifi" "45" /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set wireless.@wifi-iface[$num].encryption="$val" let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.IEEE11iAuthenticationMode" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.IEEE11iAuthenticationMode" freecwmp_notify "$parm" "$2" "xsd:string" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.IEEE11iAuthenticationMode" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.IEEE11iAuthenticationMode" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -933,6 +977,7 @@ esac get_wlan_radio_enabled() { local num="$1" local lan_num="$2" +local wlan_num="$3" local val="" local type="xsd:boolean" local permissions="" @@ -950,17 +995,17 @@ case "$action" in val=0 fi let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.RadioEnabled" "$val" "$permissions" "$type" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.RadioEnabled" "$val" "$permissions" "$type" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.RadioEnabled" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.RadioEnabled" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.RadioEnabled" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.RadioEnabled" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.RadioEnabled" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.RadioEnabled" "$val" ;; esac } @@ -968,7 +1013,8 @@ esac set_wlan_radio_enabled() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) delay_command "wifi" "wifi" "45" @@ -983,12 +1029,12 @@ case $action in /usr/sbin/wlctl -i wl0.$num radio $val fi let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.RadioEnabled" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.RadioEnabled" freecwmp_notify "$parm" "$2" "xsd:boolean" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.RadioEnabled" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.RadioEnabled" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -997,6 +1043,7 @@ esac get_wlan_device_operation_mode() { local num="$1" local lan_num="$2" +local wlan_num="$3" local val="" local type="xsd:boolean" local permissions="" @@ -1007,17 +1054,17 @@ case "$action" in val="InfrastructureAccessPoint" fi let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.DeviceOperationMode" "$val" "$permissions" "$type" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.DeviceOperationMode" "$val" "$permissions" "$type" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.DeviceOperationMode" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.DeviceOperationMode" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.DeviceOperationMode" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.DeviceOperationMode" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.DeviceOperationMode" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.DeviceOperationMode" "$val" ;; esac } @@ -1025,7 +1072,8 @@ esac set_wlan_device_operation_mode() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) delay_command "wifi" "wifi" "45" @@ -1033,12 +1081,12 @@ case $action in /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q get wireless.@wifi-iface[$num].mode="ap" fi let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.DeviceOperationMode" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.DeviceOperationMode" freecwmp_notify "$parm" "$2" "xsd:boolean" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.DeviceOperationMode" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.DeviceOperationMode" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -1047,6 +1095,7 @@ esac get_wlan_authentication_service_mode() { local num="$1" local lan_num="$2" +local wlan_num="$3" local val="" local type="xsd:boolean" local permissions="" @@ -1064,17 +1113,17 @@ case "$action" in val="None" fi let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AuthenticationServiceMode" "$val" "$permissions" "$type" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AuthenticationServiceMode" "$val" "$permissions" "$type" ;; get_name) permissions="1" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AuthenticationServiceMode" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AuthenticationServiceMode" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AuthenticationServiceMode" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AuthenticationServiceMode" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AuthenticationServiceMode" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AuthenticationServiceMode" "$val" ;; esac } @@ -1082,7 +1131,8 @@ esac set_wlan_authentication_service_mode() { local num="$1" local lan_num="$2" -local val="$3" +local wlan_num="$3" +local val="$4" case $action in set_value) delay_command "wifi" "wifi" "45" @@ -1092,12 +1142,12 @@ case $action in /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q get wireless.@wifi-iface[$num].encryption="wpa" fi let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AuthenticationServiceMode" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AuthenticationServiceMode" freecwmp_notify "$parm" "$2" "xsd:boolean" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AuthenticationServiceMode" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AuthenticationServiceMode" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -1106,6 +1156,7 @@ esac get_wlan_total_associations() { local num="$1" local lan_num="$2" +local wlan_num="$3" local val="" local type="xsd:unsignedInt" local permissions="" @@ -1117,17 +1168,17 @@ case "$action" in val=`/usr/sbin/wlctl -i wl0.$num assoclist | grep -c 'assoclist'` fi let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.TotalAssociations" "$val" "$permissions" "$type" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.TotalAssociations" "$val" "$permissions" "$type" ;; get_name) permissions="0" let num=$num+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.TotalAssociations" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.TotalAssociations" "$val" "$permissions" ;; get_notification) let num=$num+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.TotalAssociations" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.TotalAssociations" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.TotalAssociations" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.TotalAssociations" "$val" ;; esac } @@ -1135,6 +1186,7 @@ esac get_wlan_associated_device() { local num="$1" local lan_num="$2" +local wlan_num="$3" local val="" local permissions="" local i=0 @@ -1151,17 +1203,17 @@ case "$action" in let i=$i+1 mac_lower=`echo $mac|tr '[A-F]' '[a-f]'` ip=`cat /proc/net/arp|grep $mac_lower|awk -F' ' '{print $1}'` - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AssociatedDevice.$i.AssociatedDeviceMACAddress" "$mac" "$permissions" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AssociatedDevice.$i.AssociatedDeviceIPAddress" "$ip" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AssociatedDevice.$i.AssociatedDeviceMACAddress" "$mac" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AssociatedDevice.$i.AssociatedDeviceIPAddress" "$ip" "$permissions" if [ "$num" = "0" ];then is_authenticated=`/usr/sbin/wlctl -i wl$num authe_sta_list|grep $mac` else is_authenticated=`/usr/sbin/wlctl -i wl0.$num authe_sta_list|grep $mac` fi if [ "$is_authenticated" = "" ];then - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AssociatedDevice.$i.AssociatedDeviceAuthenticationState" "0" "$permissions" "xsd:boolean" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AssociatedDevice.$i.AssociatedDeviceAuthenticationState" "0" "$permissions" "xsd:boolean" else - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AssociatedDevice.$i.AssociatedDeviceAuthenticationState" "1" "$permissions" "xsd:boolean" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AssociatedDevice.$i.AssociatedDeviceAuthenticationState" "1" "$permissions" "xsd:boolean" fi done ;; @@ -1169,20 +1221,20 @@ case "$action" in permissions="0" for mac in $assoclist;do let i=$i+1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AssociatedDevice.$i.AssociatedDeviceMACAddress" "" "$permissions" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AssociatedDevice.$i.AssociatedDeviceIPAddress" "" "$permissions" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AssociatedDevice.$i.AssociatedDeviceAuthenticationState" "" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AssociatedDevice.$i.AssociatedDeviceMACAddress" "" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AssociatedDevice.$i.AssociatedDeviceIPAddress" "" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AssociatedDevice.$i.AssociatedDeviceAuthenticationState" "" "$permissions" done ;; get_notification) for mac in $assoclist;do let i=$i+1 - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AssociatedDevice.$i.AssociatedDeviceMACAddress" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AssociatedDevice.$i.AssociatedDeviceMACAddress" "$val" - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AssociatedDevice.$i.AssociatedDeviceIPAddress" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AssociatedDevice.$i.AssociatedDeviceIPAddress" "$val" - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AssociatedDevice.$i.AssociatedDeviceAuthenticationState" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.AssociatedDevice.$i.AssociatedDeviceAuthenticationState" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AssociatedDevice.$i.AssociatedDeviceMACAddress" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AssociatedDevice.$i.AssociatedDeviceMACAddress" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AssociatedDevice.$i.AssociatedDeviceIPAddress" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AssociatedDevice.$i.AssociatedDeviceIPAddress" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AssociatedDevice.$i.AssociatedDeviceAuthenticationState" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.AssociatedDevice.$i.AssociatedDeviceAuthenticationState" "$val" done ;; esac @@ -1191,22 +1243,23 @@ esac get_wlan_wep_key() { local num="$1" local lan_num="$2" -local key_index="$3" +local wlan_num="$3" +local key_index="$4" local val="" local permissions="" # this parameter must an empty value (TR-098 standard) let num=$num+1 case "$action" in get_value) - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WEPKey.$key_index.WEPKey" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPKey.$key_index.WEPKey" "$val" "$permissions" ;; get_name) permissions="1" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WEPKey.$key_index.WEPKey" "" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPKey.$key_index.WEPKey" "" "$permissions" ;; get_notification) - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WEPKey.$key_index.WEPKey" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WEPKey.$key_index.WEPKey" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPKey.$key_index.WEPKey" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPKey.$key_index.WEPKey" "$val" ;; esac } @@ -1214,19 +1267,20 @@ esac set_wlan_wep_key() { local num="$1" local lan_num="$2" -local key_index="$3" -local val="$4" +local wlan_num="$3" +local key_index="$4" +local val="$5" case $action in set_value) delay_command "wifi" "wifi" "45" /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set wireless.@wifi-iface[$num].key$key_index=$val let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WEPKey.$key_index.WEPKey" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPKey.$key_index.WEPKey" freecwmp_notify "$parm" "$2" "xsd:string" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.WEPKey.$key_index.WEPKey" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPKey.$key_index.WEPKey" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -1235,22 +1289,23 @@ esac get_wlan_pre_shared_key() { local num="$1" local lan_num="$2" -local key_index="$2" +local wlan_num="$3" +local key_index="$4" local val="" local permissions="" # this parameter must an empty value (TR-098 standard) let num=$num+1 case "$action" in get_value) - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.PreSharedKey" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.PreSharedKey" "$val" "$permissions" ;; get_name) permissions="1" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.PreSharedKey" "" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.PreSharedKey" "" "$permissions" ;; get_notification) - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.PreSharedKey" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.PreSharedKey" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.PreSharedKey" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.PreSharedKey" "$val" ;; esac } @@ -1258,19 +1313,20 @@ esac set_wlan_pre_shared_key() { local num="$1" local lan_num="$2" -local key_index="$3" -local val="$4" +local wlan_num="$3" +local key_index="$4" +local val="$5" case $action in set_value) delay_command "wifi" "wifi" "45" /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q det wireless.@wifi-iface[$num].key=$val let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.PreSharedKey" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.PreSharedKey" freecwmp_notify "$parm" "$2" "xsd:string" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.PreSharedKey" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.PreSharedKey" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -1279,22 +1335,23 @@ esac get_wlan_pre_shared_key_key_passphrase() { local num="$1" local lan_num="$2" -local key_index="$2" +local wlan_num="$3" +local key_index="$4" local val="" local permissions="" # this parameter must an empty value (TR-098 standard) let num=$num+1 case "$action" in get_value) - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.KeyPassphrase" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.KeyPassphrase" "$val" "$permissions" ;; get_name) permissions="1" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.KeyPassphrase" "" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.KeyPassphrase" "" "$permissions" ;; get_notification) - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.KeyPassphrase.$key_index.PreSharedKey" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.KeyPassphrase" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.KeyPassphrase.$key_index.PreSharedKey" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.KeyPassphrase" "$val" ;; esac } @@ -1302,18 +1359,19 @@ esac set_wlan_pre_shared_key_key_passphrase() { local num="$1" local lan_num="$2" -local key_index="$3" -local val="$4" +local wlan_num="$3" +local key_index="$4" +local val="$5" case $action in set_value) delay_command "wifi" "wifi" "45" let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.KeyPassphrase" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.KeyPassphrase" freecwmp_notify "$parm" "$2" "xsd:string" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.KeyPassphrase" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.KeyPassphrase" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -1322,22 +1380,23 @@ esac get_wlan_pre_shared_key_associated_device_MACAddress() { local num="$1" local lan_num="$2" -local key_index="$2" +local wlan_num="$3" +local key_index="$4" local val="" local permissions="" # this parameter must an empty value (TR-098 standard) let num=$num+1 case "$action" in get_value) - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.AssociatedDeviceMACAddress" "$val" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.AssociatedDeviceMACAddress" "$val" "$permissions" ;; get_name) permissions="1" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.AssociatedDeviceMACAddress" "" "$permissions" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.AssociatedDeviceMACAddress" "" "$permissions" ;; get_notification) - freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.AssociatedDeviceMACAddress" - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.AssociatedDeviceMACAddress" "$val" + freecwmp_get_parameter_notification "val" "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.AssociatedDeviceMACAddress" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.AssociatedDeviceMACAddress" "$val" ;; esac } @@ -1345,18 +1404,19 @@ esac set_wlan_pre_shared_key_associated_device_MACAddress() { local num="$1" local lan_num="$2" -local key_index="$3" -local val="$4" +local wlan_num="$3" +local key_index="$4" +local val="$5" case $action in set_value) delay_command "wifi" "wifi" "45" let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.AssociatedDeviceMACAddress" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.AssociatedDeviceMACAddress" freecwmp_notify "$parm" "$2" "xsd:string" ;; set_notification) let num=$num+1 - local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$num.PreSharedKey.$key_index.AssociatedDeviceMACAddress" + local parm="InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.PreSharedKey.$key_index.AssociatedDeviceMACAddress" freecwmp_set_parameter_notification "$parm" "$val" ;; esac @@ -1518,43 +1578,47 @@ case "$1" in InternetGatewayDevice.) get_ip_interface_ip_address get_ip_interface_netmask - for lan_num in `seq 1 $max_lan_num`;do - for i in `seq 1 $max_num`;do + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" freecwmp_parse_formated_parameter $1"LANDevice.$lan_num.WLANConfiguration.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - get_wlan_status $uci_num $num1 - get_wlan_bssid $uci_num $num1 - get_wlan_max_bit_rate $uci_num $num1 - get_wlan_channel $uci_num $num1 - get_wlan_ssid $uci_num $num1 - get_wlan_beacon_type $uci_num $num1 - get_wlan_mac_control_enable $uci_num $num1 - get_wlan_standard $uci_num $num1 - get_wlan_wep_key_index $uci_num $num1 - get_wlan_key_passphrase $uci_num $num1 - get_wlan_wep_encryption_level $uci_num $num1 - get_wlan_basic_encryption_modes $uci_num $num1 - get_wlan_basic_authentication_mode $uci_num $num1 - get_wlan_wpa_encryption_modes $uci_num $num1 - get_wlan_wpa_authentication_mode $uci_num $num1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - get_wlan_radio_enabled $uci_num $num1 - get_wlan_device_operation_mode $uci_num $num1 - get_wlan_authentication_service_mode $uci_num $num1 - get_wlan_total_associations $uci_num $num1 - get_wlan_associated_device $uci_num $num1 - get_wlan_wep_key $uci_num $num1 "1" - get_wlan_wep_key $uci_num $num1 "2" - get_wlan_wep_key $uci_num $num1 "3" - get_wlan_wep_key $uci_num $num1 "4" - get_wlan_pre_shared_key $uci_num $num1 "1" - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" + get_wlan_enable $uci_num $num1 $i + get_wlan_status $uci_num $num1 $i + get_wlan_bssid $uci_num $num1 $i + get_wlan_max_bit_rate $uci_num $num1 $i + get_wlan_channel $uci_num $num1 $i + get_wlan_ssid $uci_num $num1 $i + get_wlan_beacon_type $uci_num $num1 $i + get_wlan_mac_control_enable $uci_num $num1 $i + get_wlan_standard $uci_num $num1 $i + get_wlan_wep_key_index $uci_num $num1 $i + get_wlan_key_passphrase $uci_num $num1 $i + get_wlan_wep_encryption_level $uci_num $num1 $i + get_wlan_basic_encryption_modes $uci_num $num1 $i + get_wlan_basic_authentication_mode $uci_num $num1 $i + get_wlan_wpa_encryption_modes $uci_num $num1 $i + get_wlan_wpa_authentication_mode $uci_num $num1 $i + get_wlan_ieee_11i_encryption_modes $uci_num $num1 $i + get_wlan_ieee_11i_authentication_mode $uci_num $num1 $i + get_wlan_radio_enabled $uci_num $num1 $i + get_wlan_device_operation_mode $uci_num $num1 $i + get_wlan_authentication_service_mode $uci_num $num1 $i + get_wlan_total_associations $uci_num $num1 $i + get_wlan_associated_device $uci_num $num1 $i + get_wlan_wep_key $uci_num $num1 $i "1" + get_wlan_wep_key $uci_num $num1 $i "2" + get_wlan_wep_key $uci_num $num1 $i "3" + get_wlan_wep_key $uci_num $num1 $i "4" + get_wlan_pre_shared_key $uci_num $num1 $i "1" + get_wlan_pre_shared_key_key_passphrase $uci_num $num1 $i "1" + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 $i "1" fi done done @@ -1563,43 +1627,47 @@ case "$1" in InternetGatewayDevice.LANDevice.) get_ip_interface_ip_address get_ip_interface_netmask - for lan_num in `seq 1 $max_lan_num`;do - for i in `seq 1 $max_num`;do + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" freecwmp_parse_formated_parameter $1"$lan_num.WLANConfiguration.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - get_wlan_status $uci_num $num1 - get_wlan_bssid $uci_num $num1 - get_wlan_max_bit_rate $uci_num $num1 - get_wlan_channel $uci_num $num1 - get_wlan_ssid $uci_num $num1 - get_wlan_beacon_type $uci_num $num1 - get_wlan_mac_control_enable $uci_num $num1 - get_wlan_standard $uci_num $num1 - get_wlan_wep_key_index $uci_num $num1 - get_wlan_key_passphrase $uci_num $num1 - get_wlan_wep_encryption_level $uci_num $num1 - get_wlan_basic_encryption_modes $uci_num $num1 - get_wlan_basic_authentication_mode $uci_num $num1 - get_wlan_wpa_encryption_modes $uci_num $num1 - get_wlan_wpa_authentication_mode $uci_num $num1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - get_wlan_radio_enabled $uci_num $num1 - get_wlan_device_operation_mode $uci_num $num1 - get_wlan_authentication_service_mode $uci_num $num1 - get_wlan_total_associations $uci_num $num1 - get_wlan_associated_device $uci_num $num1 - get_wlan_wep_key $uci_num $num1 "1" - get_wlan_wep_key $uci_num $num1 "2" - get_wlan_wep_key $uci_num $num1 "3" - get_wlan_wep_key $uci_num $num1 "4" - get_wlan_pre_shared_key $uci_num $num1 "1" - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" + get_wlan_enable $uci_num $num1 $i + get_wlan_status $uci_num $num1 $i + get_wlan_bssid $uci_num $num1 $i + get_wlan_max_bit_rate $uci_num $num1 $i + get_wlan_channel $uci_num $num1 $i + get_wlan_ssid $uci_num $num1 $i + get_wlan_beacon_type $uci_num $num1 $i + get_wlan_mac_control_enable $uci_num $num1 $i + get_wlan_standard $uci_num $num1 $i + get_wlan_wep_key_index $uci_num $num1 $i + get_wlan_key_passphrase $uci_num $num1 $i + get_wlan_wep_encryption_level $uci_num $num1 $i + get_wlan_basic_encryption_modes $uci_num $num1 $i + get_wlan_basic_authentication_mode $uci_num $num1 $i + get_wlan_wpa_encryption_modes $uci_num $num1 $i + get_wlan_wpa_authentication_mode $uci_num $num1 $i + get_wlan_ieee_11i_encryption_modes $uci_num $num1 $i + get_wlan_ieee_11i_authentication_mode $uci_num $num1 $i + get_wlan_radio_enabled $uci_num $num1 $i + get_wlan_device_operation_mode $uci_num $num1 $i + get_wlan_authentication_service_mode $uci_num $num1 $i + get_wlan_total_associations $uci_num $num1 $i + get_wlan_associated_device $uci_num $num1 $i + get_wlan_wep_key $uci_num $num1 $i "1" + get_wlan_wep_key $uci_num $num1 $i "2" + get_wlan_wep_key $uci_num $num1 $i "3" + get_wlan_wep_key $uci_num $num1 $i "4" + get_wlan_pre_shared_key $uci_num $num1 $i "1" + get_wlan_pre_shared_key_key_passphrase $uci_num $num1 $i "1" + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 $i "1" fi done done @@ -1608,42 +1676,55 @@ case "$1" in InternetGatewayDevice.LANDevice.[1-$max_lan_num].) get_ip_interface_ip_address get_ip_interface_netmask - for i in `seq 1 $max_num`;do - freecwmp_parse_formated_parameter $1"WLANConfiguration.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" - local num1=`echo $num | awk '{ print $1 }'` - local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - get_wlan_status $uci_num $num1 - get_wlan_bssid $uci_num $num1 - get_wlan_max_bit_rate $uci_num $num1 - get_wlan_channel $uci_num $num1 - get_wlan_ssid $uci_num $num1 - get_wlan_beacon_type $uci_num $num1 - get_wlan_mac_control_enable $uci_num $num1 - get_wlan_standard $uci_num $num1 - get_wlan_wep_key_index $uci_num $num1 - get_wlan_key_passphrase $uci_num $num1 - get_wlan_wep_encryption_level $uci_num $num1 - get_wlan_basic_encryption_modes $uci_num $num1 - get_wlan_basic_authentication_mode $uci_num $num1 - get_wlan_wpa_encryption_modes $uci_num $num1 - get_wlan_wpa_authentication_mode $uci_num $num1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - get_wlan_radio_enabled $uci_num $num1 - get_wlan_device_operation_mode $uci_num $num1 - get_wlan_authentication_service_mode $uci_num $num1 - get_wlan_total_associations $uci_num $num1 - get_wlan_associated_device $uci_num $num1 - get_wlan_wep_key $uci_num $num1 "1" - get_wlan_wep_key $uci_num $num1 "2" - get_wlan_wep_key $uci_num $num1 "3" - get_wlan_wep_key $uci_num $num1 "4" - get_wlan_pre_shared_key $uci_num $num1 "1" - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" + freecwmp_parse_formated_parameter $1 "InternetGatewayDevice.LANDevice.{i}." "rc" "x" + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $x -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + freecwmp_parse_formated_parameter $1"WLANConfiguration.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" + local num1=`echo $num | awk '{ print $1 }'` + local num2=`echo $num | awk '{ print $2 }'` + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + get_wlan_enable $uci_num $num1 $i + get_wlan_status $uci_num $num1 $i + get_wlan_bssid $uci_num $num1 $i + get_wlan_max_bit_rate $uci_num $num1 $i + get_wlan_channel $uci_num $num1 $i + get_wlan_ssid $uci_num $num1 $i + get_wlan_beacon_type $uci_num $num1 $i + get_wlan_mac_control_enable $uci_num $num1 $i + get_wlan_standard $uci_num $num1 $i + get_wlan_wep_key_index $uci_num $num1 $i + get_wlan_key_passphrase $uci_num $num1 $i + get_wlan_wep_encryption_level $uci_num $num1 $i + get_wlan_basic_encryption_modes $uci_num $num1 $i + get_wlan_basic_authentication_mode $uci_num $num1 $i + get_wlan_wpa_encryption_modes $uci_num $num1 $i + get_wlan_wpa_authentication_mode $uci_num $num1 $i + get_wlan_ieee_11i_encryption_modes $uci_num $num1 $i + get_wlan_ieee_11i_authentication_mode $uci_num $num1 $i + get_wlan_radio_enabled $uci_num $num1 $i + get_wlan_device_operation_mode $uci_num $num1 $i + get_wlan_authentication_service_mode $uci_num $num1 $i + get_wlan_total_associations $uci_num $num1 $i + get_wlan_associated_device $uci_num $num1 $i + get_wlan_wep_key $uci_num $num1 $i "1" + get_wlan_wep_key $uci_num $num1 $i "2" + get_wlan_wep_key $uci_num $num1 $i "3" + get_wlan_wep_key $uci_num $num1 $i "4" + get_wlan_pre_shared_key $uci_num $num1 $i "1" + get_wlan_pre_shared_key_key_passphrase $uci_num $num1 $i "1" + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 $i "1" + fi + done + if [ $x -eq $lan_num ]; then + break fi done return $FAULT_CPE_NO_FAULT @@ -1664,42 +1745,55 @@ case "$1" in return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.) - for i in `seq 1 $max_num`;do - freecwmp_parse_formated_parameter "$1$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" - local num1=`echo $num | awk '{ print $1 }'` - local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - get_wlan_status $uci_num $num1 - get_wlan_bssid $uci_num $num1 - get_wlan_max_bit_rate $uci_num $num1 - get_wlan_channel $uci_num $num1 - get_wlan_ssid $uci_num $num1 - get_wlan_beacon_type $uci_num $num1 - get_wlan_mac_control_enable $uci_num $num1 - get_wlan_standard $uci_num $num1 - get_wlan_wep_key_index $uci_num $num1 - get_wlan_key_passphrase $uci_num $num1 - get_wlan_wep_encryption_level $uci_num $num1 - get_wlan_basic_encryption_modes $uci_num $num1 - get_wlan_basic_authentication_mode $uci_num $num1 - get_wlan_wpa_encryption_modes $uci_num $num1 - get_wlan_wpa_authentication_mode $uci_num $num1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - get_wlan_radio_enabled $uci_num $num1 - get_wlan_device_operation_mode $uci_num $num1 - get_wlan_authentication_service_mode $uci_num $num1 - get_wlan_total_associations $uci_num $num1 - get_wlan_associated_device $uci_num $num1 - get_wlan_wep_key $uci_num $num1 "1" - get_wlan_wep_key $uci_num $num1 "2" - get_wlan_wep_key $uci_num $num1 "3" - get_wlan_wep_key $uci_num $num1 "4" - get_wlan_pre_shared_key $uci_num $num1 "1" - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" + freecwmp_parse_formated_parameter $1 "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration." "rc" "x" + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $x -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + freecwmp_parse_formated_parameter "$1$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" + local num1=`echo $num | awk '{ print $1 }'` + local num2=`echo $num | awk '{ print $2 }'` + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + get_wlan_enable $uci_num $num1 $i + get_wlan_status $uci_num $num1 $i + get_wlan_bssid $uci_num $num1 $i + get_wlan_max_bit_rate $uci_num $num1 $i + get_wlan_channel $uci_num $num1 $i + get_wlan_ssid $uci_num $num1 $i + get_wlan_beacon_type $uci_num $num1 $i + get_wlan_mac_control_enable $uci_num $num1 $i + get_wlan_standard $uci_num $num1 $i + get_wlan_wep_key_index $uci_num $num1 $i + get_wlan_key_passphrase $uci_num $num1 $i + get_wlan_wep_encryption_level $uci_num $num1 $i + get_wlan_basic_encryption_modes $uci_num $num1 $i + get_wlan_basic_authentication_mode $uci_num $num1 $i + get_wlan_wpa_encryption_modes $uci_num $num1 $i + get_wlan_wpa_authentication_mode $uci_num $num1 $i + get_wlan_ieee_11i_encryption_modes $uci_num $num1 $i + get_wlan_ieee_11i_authentication_mode $uci_num $num1 $i + get_wlan_radio_enabled $uci_num $num1 $i + get_wlan_device_operation_mode $uci_num $num1 $i + get_wlan_authentication_service_mode $uci_num $num1 $i + get_wlan_total_associations $uci_num $num1 $i + get_wlan_associated_device $uci_num $num1 $i + get_wlan_wep_key $uci_num $num1 $i "1" + get_wlan_wep_key $uci_num $num1 $i "2" + get_wlan_wep_key $uci_num $num1 $i "3" + get_wlan_wep_key $uci_num $num1 $i "4" + get_wlan_pre_shared_key $uci_num $num1 $i "1" + get_wlan_pre_shared_key_key_passphrase $uci_num $num1 $i "1" + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 $i "1" + fi + done + if [ $x -eq $lan_num ]; then + continue fi done return $FAULT_CPE_NO_FAULT @@ -1708,329 +1802,1018 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - get_wlan_status $uci_num $num1 - get_wlan_bssid $uci_num $num1 - get_wlan_max_bit_rate $uci_num $num1 - get_wlan_channel $uci_num $num1 - get_wlan_ssid $uci_num $num1 - get_wlan_beacon_type $uci_num $num1 - get_wlan_mac_control_enable $uci_num $num1 - get_wlan_standard $uci_num $num1 - get_wlan_wep_key_index $uci_num $num1 - get_wlan_key_passphrase $uci_num $num1 - get_wlan_wep_encryption_level $uci_num $num1 - get_wlan_basic_encryption_modes $uci_num $num1 - get_wlan_basic_authentication_mode $uci_num $num1 - get_wlan_wpa_encryption_modes $uci_num $num1 - get_wlan_wpa_authentication_mode $uci_num $num1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - get_wlan_radio_enabled $uci_num $num1 - get_wlan_device_operation_mode $uci_num $num1 - get_wlan_authentication_service_mode $uci_num $num1 - get_wlan_total_associations $uci_num $num1 - get_wlan_associated_device $uci_num $num1 - get_wlan_wep_key $uci_num $num1 "1" - get_wlan_wep_key $uci_num $num1 "2" - get_wlan_wep_key $uci_num $num1 "3" - get_wlan_wep_key $uci_num $num1 "4" - get_wlan_pre_shared_key $uci_num $num1 "1" - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + get_wlan_enable $uci_num $num1 $i + get_wlan_status $uci_num $num1 $i + get_wlan_bssid $uci_num $num1 $i + get_wlan_max_bit_rate $uci_num $num1 $i + get_wlan_channel $uci_num $num1 $i + get_wlan_ssid $uci_num $num1 $i + get_wlan_beacon_type $uci_num $num1 $i + get_wlan_mac_control_enable $uci_num $num1 $i + get_wlan_standard $uci_num $num1 $i + get_wlan_wep_key_index $uci_num $num1 $i + get_wlan_key_passphrase $uci_num $num1 $i + get_wlan_wep_encryption_level $uci_num $num1 $i + get_wlan_basic_encryption_modes $uci_num $num1 $i + get_wlan_basic_authentication_mode $uci_num $num1 $i + get_wlan_wpa_encryption_modes $uci_num $num1 $i + get_wlan_wpa_authentication_mode $uci_num $num1 $i + get_wlan_ieee_11i_encryption_modes $uci_num $num1 $i + get_wlan_ieee_11i_authentication_mode $uci_num $num1 $i + get_wlan_radio_enabled $uci_num $num1 $i + get_wlan_device_operation_mode $uci_num $num1 $i + get_wlan_authentication_service_mode $uci_num $num1 $i + get_wlan_total_associations $uci_num $num1 $i + get_wlan_associated_device $uci_num $num1 $i + get_wlan_wep_key $uci_num $num1 $i "1" + get_wlan_wep_key $uci_num $num1 $i "2" + get_wlan_wep_key $uci_num $num1 $i "3" + get_wlan_wep_key $uci_num $num1 $i "4" + get_wlan_pre_shared_key $uci_num $num1 $i "1" + get_wlan_pre_shared_key_key_passphrase $uci_num $num1 $i "1" + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 $i "1" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Enable) freecwmp_parse_formated_parameter "$1.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Enable" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_enable $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Status) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Status" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_status $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_status $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BSSID) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BSSID" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_bssid $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_bssid $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].MaxBitRate) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.MaxBitRate" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_max_bit_rate $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_max_bit_rate $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Channel) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Channel" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_channel $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_channel $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].SSID) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.SSID" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_ssid $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_ssid $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BeaconType) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BeaconType" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_beacon_type $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_beacon_type $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].MACAddressControlEnabled) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.MACAddressControlEnabled" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_mac_control_enable $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_mac_control_enable $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Standard) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Standard" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_standard $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_standard $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKeyIndex) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKeyIndex" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_key_index $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_key_index $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].KeyPassphrase) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.KeyPassphrase" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_key_passphrase $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_key_passphrase $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPEncryptionLevel) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPEncryptionLevel" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_encryption_level $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_encryption_level $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BasicEncryptionModes) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BasicEncryptionModes" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_basic_encryption_modes $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_basic_encryption_modes $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BasicAuthenticationMode) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BasicAuthenticationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_basic_authentication_mode $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_basic_authentication_mode $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WPAEncryptionModes) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WPAEncryptionModes" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wpa_encryption_modes $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wpa_encryption_modes $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WPAAuthenticationMode) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WPAAuthenticationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wpa_authentication_mode $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wpa_authentication_mode $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].IEEE11iEncryptionModes) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.IEEE11iEncryptionModes" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_ieee_11i_encryption_modes $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].IEEE11iAuthenticationMode) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.IEEE11iAuthenticationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_ieee_11i_authentication_mode $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].DeviceOperationMode) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.DeviceOperationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_device_operation_mode $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_device_operation_mode $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].AuthenticationServiceMode) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.AuthenticationServiceMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_authentication_service_mode $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_authentication_service_mode $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].RadioEnabled) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.RadioEnabled" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_radio_enabled $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_radio_enabled $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].TotalAssociations) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.TotalAssociations" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_total_associations $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_total_associations $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.1.WEPKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.1.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_key $uci_num $num1 "1" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_key $uci_num $i $num1 "1" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.2.WEPKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.2.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_key $uci_num $num1 "2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_key $uci_num $i $num1 "2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.3.WEPKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.3.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_key $uci_num $num1 "3" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_key $uci_num $i $num1 "3" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.4.WEPKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.4.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_key $uci_num $num1 "4" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_key $uci_num $i $num1 "4" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.PreSharedKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.PreSharedKey.1.PreSharedKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_pre_shared_key $uci_num $num1 "1" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_pre_shared_key $uci_num $i $num1 "1" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.KeyPassphrase) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.PreSharedKey.1.KeyPassphrase" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_pre_shared_key_key_passphrase $uci_num $i $num1 "1" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.AssociatedDeviceMACAddress) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.PreSharedKey.1.AssociatedDeviceMACAddress" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $i $num1 "1" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; esac @@ -2047,48 +2830,52 @@ get_lan_number_of_entries "max_lan_num" case "$1" in InternetGatewayDevice.) freecwmp_output "InternetGatewayDevice.LANDevice." "" "1" - for lan_num in `seq 1 $max_lan_num`;do + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + get_wlan_number_of_entries "max_num" $lan_dev if [ "$2" = "0" ]; then freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num." "" "1" freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration." "" "1" - for i in `seq 1 $max_num`;do + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" freecwmp_parse_formated_parameter $1"LANDevice.$lan_num.WLANConfiguration.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$i." "" "1" - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - get_wlan_status $uci_num $num1 - get_wlan_bssid $uci_num $num1 - get_wlan_max_bit_rate $uci_num $num1 - get_wlan_channel $uci_num $num1 - get_wlan_ssid $uci_num $num1 - get_wlan_beacon_type $uci_num $num1 - get_wlan_mac_control_enable $uci_num $num1 - get_wlan_standard $uci_num $num1 - get_wlan_wep_key_index $uci_num $num1 - get_wlan_key_passphrase $uci_num $num1 - get_wlan_wep_encryption_level $uci_num $num1 - get_wlan_basic_encryption_modes $uci_num $num1 - get_wlan_basic_authentication_mode $uci_num $num1 - get_wlan_wpa_encryption_modes $uci_num $num1 - get_wlan_wpa_authentication_mode $uci_num $num1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - get_wlan_radio_enabled $uci_num $num1 - get_wlan_device_operation_mode $uci_num $num1 - get_wlan_authentication_service_mode $uci_num $num1 - get_wlan_total_associations $uci_num $num1 - get_wlan_associated_device $uci_num $num1 + get_wlan_enable $uci_num $i $num1 + get_wlan_status $uci_num $i $num1 + get_wlan_bssid $uci_num $i $num1 + get_wlan_max_bit_rate $uci_num $i $num1 + get_wlan_channel $uci_num $i $num1 + get_wlan_ssid $uci_num $i $num1 + get_wlan_beacon_type $uci_num $i $num1 + get_wlan_mac_control_enable $uci_num $i $num1 + get_wlan_standard $uci_num $i $num1 + get_wlan_wep_key_index $uci_num $i $num1 + get_wlan_key_passphrase $uci_num $i $num1 + get_wlan_wep_encryption_level $uci_num $i $num1 + get_wlan_basic_encryption_modes $uci_num $i $num1 + get_wlan_basic_authentication_mode $uci_num $i $num1 + get_wlan_wpa_encryption_modes $uci_num $i $num1 + get_wlan_wpa_authentication_mode $uci_num $i $num1 + get_wlan_ieee_11i_encryption_modes $uci_num $i $num1 + get_wlan_ieee_11i_authentication_mode $uci_num $i $num1 + get_wlan_radio_enabled $uci_num $i $num1 + get_wlan_device_operation_mode $uci_num $i $num1 + get_wlan_authentication_service_mode $uci_num $i $num1 + get_wlan_total_associations $uci_num $i $num1 + get_wlan_associated_device $uci_num $i $num1 freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$i.WEPKey" "" "0" - get_wlan_wep_key $uci_num $num1 "1" - get_wlan_wep_key $uci_num $num1 "2" - get_wlan_wep_key $uci_num $num1 "3" - get_wlan_wep_key $uci_num $num1 "4" - get_wlan_pre_shared_key $uci_num $num1 "1" - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" + get_wlan_wep_key $uci_num $i $num1 "1" + get_wlan_wep_key $uci_num $i $num1 "2" + get_wlan_wep_key $uci_num $i $num1 "3" + get_wlan_wep_key $uci_num $i $num1 "4" + get_wlan_pre_shared_key $uci_num $i $num1 "1" + get_wlan_pre_shared_key_key_passphrase $uci_num $i $num1 "1" + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $i $num1 "1" fi done fi @@ -2097,48 +2884,52 @@ case "$1" in ;; InternetGatewayDevice.LANDevice.) freecwmp_output "InternetGatewayDevice.LANDevice." "" "1" - for lan_num in `seq 1 $max_lan_num`;do + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + get_wlan_number_of_entries "max_num" $lan_dev freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num." "" "1" if [ "$2" = "0" ]; then freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration." "" "1" - for i in `seq 1 $max_num`;do + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" freecwmp_parse_formated_parameter $1"1.WLANConfiguration.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$i." "" "1" - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - get_wlan_status $uci_num $num1 - get_wlan_bssid $uci_num $num1 - get_wlan_max_bit_rate $uci_num $num1 - get_wlan_channel $uci_num $num1 - get_wlan_ssid $uci_num $num1 - get_wlan_beacon_type $uci_num $num1 - get_wlan_mac_control_enable $uci_num $num1 - get_wlan_standard $uci_num $num1 - get_wlan_wep_key_index $uci_num $num1 - get_wlan_key_passphrase $uci_num $num1 - get_wlan_wep_encryption_level $uci_num $num1 - get_wlan_basic_encryption_modes $uci_num $num1 - get_wlan_basic_authentication_mode $uci_num $num1 - get_wlan_wpa_encryption_modes $uci_num $num1 - get_wlan_wpa_authentication_mode $uci_num $num1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - get_wlan_radio_enabled $uci_num $num1 - get_wlan_device_operation_mode $uci_num $num1 - get_wlan_authentication_service_mode $uci_num $num1 - get_wlan_total_associations $uci_num $num1 - get_wlan_associated_device $uci_num $num1 + get_wlan_enable $uci_num $i $num1 + get_wlan_status $uci_num $i $num1 + get_wlan_bssid $uci_num $i $num1 + get_wlan_max_bit_rate $uci_num $i $num1 + get_wlan_channel $uci_num $i $num1 + get_wlan_ssid $uci_num $i $num1 + get_wlan_beacon_type $uci_num $i $num1 + get_wlan_mac_control_enable $uci_num $i $num1 + get_wlan_standard $uci_num $i $num1 + get_wlan_wep_key_index $uci_num $i $num1 + get_wlan_key_passphrase $uci_num $i $num1 + get_wlan_wep_encryption_level $uci_num $i $num1 + get_wlan_basic_encryption_modes $uci_num $i $num1 + get_wlan_basic_authentication_mode $uci_num $i $num1 + get_wlan_wpa_encryption_modes $uci_num $i $num1 + get_wlan_wpa_authentication_mode $uci_num $i $num1 + get_wlan_ieee_11i_encryption_modes $uci_num $i $num1 + get_wlan_ieee_11i_authentication_mode $uci_num $i $num1 + get_wlan_radio_enabled $uci_num $i $num1 + get_wlan_device_operation_mode $uci_num $i $num1 + get_wlan_authentication_service_mode $uci_num $i $num1 + get_wlan_total_associations $uci_num $i $num1 + get_wlan_associated_device $uci_num $i $num1 freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$i.WEPKey" "" "0" - get_wlan_wep_key $uci_num $num1 "1" - get_wlan_wep_key $uci_num $num1 "2" - get_wlan_wep_key $uci_num $num1 "3" - get_wlan_wep_key $uci_num $num1 "4" - get_wlan_pre_shared_key $uci_num $num1 "1" - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" + get_wlan_wep_key $uci_num $i $num1 "1" + get_wlan_wep_key $uci_num $i $num1 "2" + get_wlan_wep_key $uci_num $i $num1 "3" + get_wlan_wep_key $uci_num $i $num1 "4" + get_wlan_pre_shared_key $uci_num $i $num1 "1" + get_wlan_pre_shared_key_key_passphrase $uci_num $i $num1 "1" + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $i $num1 "1" fi done fi @@ -2146,152 +2937,216 @@ case "$1" in return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].) - freecwmp_output "InternetGatewayDevice.LANDevice.1." "" "1" - freecwmp_output "InternetGatewayDevice.LANDevice.1.WLANConfiguration." "" "1" - if [ "$2" = "0" ]; then - for i in `seq 1 $max_num`;do - freecwmp_parse_formated_parameter $1"WLANConfiguration.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" - local num1=`echo $num | awk '{ print $1 }'` - local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$i." "" "1" - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - get_wlan_status $uci_num $num1 - get_wlan_bssid $uci_num $num1 - get_wlan_max_bit_rate $uci_num $num1 - get_wlan_channel $uci_num $num1 - get_wlan_ssid $uci_num $num1 - get_wlan_beacon_type $uci_num $num1 - get_wlan_mac_control_enable $uci_num $num1 - get_wlan_standard $uci_num $num1 - get_wlan_wep_key_index $uci_num $num1 - get_wlan_key_passphrase $uci_num $num1 - get_wlan_wep_encryption_level $uci_num $num1 - get_wlan_basic_encryption_modes $uci_num $num1 - get_wlan_basic_authentication_mode $uci_num $num1 - get_wlan_wpa_encryption_modes $uci_num $num1 - get_wlan_wpa_authentication_mode $uci_num $num1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - get_wlan_radio_enabled $uci_num $num1 - get_wlan_device_operation_mode $uci_num $num1 - get_wlan_authentication_service_mode $uci_num $num1 - get_wlan_total_associations $uci_num $num1 - get_wlan_associated_device $uci_num $num1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$i.WEPKey" "" "0" - get_wlan_wep_key $uci_num $num1 "1" - get_wlan_wep_key $uci_num $num1 "2" - get_wlan_wep_key $uci_num $num1 "3" - get_wlan_wep_key $uci_num $num1 "4" - get_wlan_pre_shared_key $uci_num $num1 "1" - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" - fi - done - fi + freecwmp_parse_formated_parameter $1 "InternetGatewayDevice.LANDevice.{i}." "rc" "x" + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $x -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num." "" "1" + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration." "" "1" + if [ "$2" = "0" ]; then + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + freecwmp_parse_formated_parameter $1"WLANConfiguration.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" + local num1=`echo $num | awk '{ print $1 }'` + local num2=`echo $num | awk '{ print $2 }'` + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$i." "" "1" + get_wlan_enable $uci_num $i $num1 + get_wlan_status $uci_num $i $num1 + get_wlan_bssid $uci_num $i $num1 + get_wlan_max_bit_rate $uci_num $i $num1 + get_wlan_channel $uci_num $i $num1 + get_wlan_ssid $uci_num $i $num1 + get_wlan_beacon_type $uci_num $i $num1 + get_wlan_mac_control_enable $uci_num $i $num1 + get_wlan_standard $uci_num $i $num1 + get_wlan_wep_key_index $uci_num $i $num1 + get_wlan_key_passphrase $uci_num $i $num1 + get_wlan_wep_encryption_level $uci_num $i $num1 + get_wlan_basic_encryption_modes $uci_num $i $num1 + get_wlan_basic_authentication_mode $uci_num $i $num1 + get_wlan_wpa_encryption_modes $uci_num $i $num1 + get_wlan_wpa_authentication_mode $uci_num $i $num1 + get_wlan_ieee_11i_encryption_modes $uci_num $i $num1 + get_wlan_ieee_11i_authentication_mode $uci_num $i $num1 + get_wlan_radio_enabled $uci_num $i $num1 + get_wlan_device_operation_mode $uci_num $i $num1 + get_wlan_authentication_service_mode $uci_num $i $num1 + get_wlan_total_associations $uci_num $i $num1 + get_wlan_associated_device $uci_num $i $num1 + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$i.WEPKey" "" "0" + get_wlan_wep_key $uci_num $i $num1 "1" + get_wlan_wep_key $uci_num $i $num1 "2" + get_wlan_wep_key $uci_num $i $num1 "3" + get_wlan_wep_key $uci_num $i $num1 "4" + get_wlan_pre_shared_key $uci_num $i $num1 "1" + get_wlan_pre_shared_key_key_passphrase $uci_num $i $num1 "1" + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $i $num1 "1" + fi + done + fi + if [ $x -eq $lan_num ]; then + break + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.) - freecwmp_output "InternetGatewayDevice.LANDevice.1.WLANConfiguration." "" "1" - if [ "$2" = "0" ]; then - for i in `seq 1 $max_num`;do - freecwmp_parse_formated_parameter "$1$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" - local num1=`echo $num | awk '{ print $1 }'` - local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$i." "" "1" - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - get_wlan_status $uci_num $num1 - get_wlan_bssid $uci_num $num1 - get_wlan_max_bit_rate $uci_num $num1 - get_wlan_channel $uci_num $num1 - get_wlan_ssid $uci_num $num1 - get_wlan_beacon_type $uci_num $num1 - get_wlan_mac_control_enable $uci_num $num1 - get_wlan_standard $uci_num $num1 - get_wlan_wep_key_index $uci_num $num1 - get_wlan_key_passphrase $uci_num $num1 - get_wlan_wep_encryption_level $uci_num $num1 - get_wlan_basic_encryption_modes $uci_num $num1 - get_wlan_basic_authentication_mode $uci_num $num1 - get_wlan_wpa_encryption_modes $uci_num $num1 - get_wlan_wpa_authentication_mode $uci_num $num1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - get_wlan_radio_enabled $uci_num $num1 - get_wlan_device_operation_mode $uci_num $num1 - get_wlan_authentication_service_mode $uci_num $num1 - get_wlan_total_associations $uci_num $num1 - get_wlan_associated_device $uci_num $num1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$i.WEPKey" "" "0" - get_wlan_wep_key $uci_num $num1 "1" - get_wlan_wep_key $uci_num $num1 "2" - get_wlan_wep_key $uci_num $num1 "3" - get_wlan_wep_key $uci_num $num1 "4" - get_wlan_pre_shared_key $uci_num $num1 "1" - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" - fi - done - fi + freecwmp_parse_formated_parameter $1 "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration." "rc" "x" + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $x -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration." "" "1" + if [ "$2" = "0" ]; then + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + freecwmp_parse_formated_parameter "$1$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" + local num1=`echo $num | awk '{ print $1 }'` + local num2=`echo $num | awk '{ print $2 }'` + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$i." "" "1" + get_wlan_enable $uci_num $i $num1 + get_wlan_status $uci_num $i $num1 + get_wlan_bssid $uci_num $i $num1 + get_wlan_max_bit_rate $uci_num $i $num1 + get_wlan_channel $uci_num $i $num1 + get_wlan_ssid $uci_num $i $num1 + get_wlan_beacon_type $uci_num $i $num1 + get_wlan_mac_control_enable $uci_num $i $num1 + get_wlan_standard $uci_num $i $num1 + get_wlan_wep_key_index $uci_num $i $num1 + get_wlan_key_passphrase $uci_num $i $num1 + get_wlan_wep_encryption_level $uci_num $i $num1 + get_wlan_basic_encryption_modes $uci_num $i $num1 + get_wlan_basic_authentication_mode $uci_num $i $num1 + get_wlan_wpa_encryption_modes $uci_num $i $num1 + get_wlan_wpa_authentication_mode $uci_num $i $num1 + get_wlan_ieee_11i_encryption_modes $uci_num $i $num1 + get_wlan_ieee_11i_authentication_mode $uci_num $i $num1 + get_wlan_radio_enabled $uci_num $i $num1 + get_wlan_device_operation_mode $uci_num $i $num1 + get_wlan_authentication_service_mode $uci_num $i $num1 + get_wlan_total_associations $uci_num $i $num1 + get_wlan_associated_device $uci_num $i $num1 + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$i.WEPKey" "" "0" + get_wlan_wep_key $uci_num $i $num1 "1" + get_wlan_wep_key $uci_num $i $num1 "2" + get_wlan_wep_key $uci_num $i $num1 "3" + get_wlan_wep_key $uci_num $i $num1 "4" + get_wlan_pre_shared_key $uci_num $i $num1 "1" + get_wlan_pre_shared_key_key_passphrase $uci_num $i $num1 "1" + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $i $num1 "1" + fi + done + fi + if [ $x -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].) freecwmp_output "$1" "" "1" - if [ "$2" = "0" ]; then - freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" - local num1=`echo $num | awk '{ print $1 }'` - local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - get_wlan_status $uci_num $num1 - get_wlan_bssid $uci_num $num1 - get_wlan_max_bit_rate $uci_num $num1 - get_wlan_channel $uci_num $num1 - get_wlan_ssid $uci_num $num1 - get_wlan_beacon_type $uci_num $num1 - get_wlan_mac_control_enable $uci_num $num1 - get_wlan_standard $uci_num $num1 - get_wlan_wep_key_index $uci_num $num1 - get_wlan_key_passphrase $uci_num $num1 - get_wlan_wep_encryption_level $uci_num $num1 - get_wlan_basic_encryption_modes $uci_num $num1 - get_wlan_basic_authentication_mode $uci_num $num1 - get_wlan_wpa_encryption_modes $uci_num $num1 - get_wlan_wpa_authentication_mode $uci_num $num1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - get_wlan_radio_enabled $uci_num $num1 - get_wlan_device_operation_mode $uci_num $num1 - get_wlan_authentication_service_mode $uci_num $num1 - get_wlan_total_associations $uci_num $num1 - get_wlan_associated_device $uci_num $num1 - freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$i.WEPKey" "" "0" - get_wlan_wep_key $uci_num $num1 "1" - get_wlan_wep_key $uci_num $num1 "2" - get_wlan_wep_key $uci_num $num1 "3" - get_wlan_wep_key $uci_num $num1 "4" - get_wlan_pre_shared_key $uci_num $num1 "1" - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" + freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" + local num1=`echo $num | awk '{ print $1 }'` + local num2=`echo $num | awk '{ print $2 }'` + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue fi - fi + get_wlan_number_of_entries "max_num" $lan_dev + if [ "$2" = "0" ]; then + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_enable $uci_num $i $num1 + get_wlan_status $uci_num $i $num1 + get_wlan_bssid $uci_num $i $num1 + get_wlan_max_bit_rate $uci_num $i $num1 + get_wlan_channel $uci_num $i $num1 + get_wlan_ssid $uci_num $i $num1 + get_wlan_beacon_type $uci_num $i $num1 + get_wlan_mac_control_enable $uci_num $i $num1 + get_wlan_standard $uci_num $i $num1 + get_wlan_wep_key_index $uci_num $i $num1 + get_wlan_key_passphrase $uci_num $i $num1 + get_wlan_wep_encryption_level $uci_num $i $num1 + get_wlan_basic_encryption_modes $uci_num $i $num1 + get_wlan_basic_authentication_mode $uci_num $i $num1 + get_wlan_wpa_encryption_modes $uci_num $i $num1 + get_wlan_wpa_authentication_mode $uci_num $i $num1 + get_wlan_ieee_11i_encryption_modes $uci_num $i $num1 + get_wlan_ieee_11i_authentication_mode $uci_num $i $num1 + get_wlan_radio_enabled $uci_num $i $num1 + get_wlan_device_operation_mode $uci_num $i $num1 + get_wlan_authentication_service_mode $uci_num $i $num1 + get_wlan_total_associations $uci_num $i $num1 + get_wlan_associated_device $uci_num $i $num1 + freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$i.WEPKey" "" "0" + get_wlan_wep_key $uci_num $i $num1 "1" + get_wlan_wep_key $uci_num $i $num1 "2" + get_wlan_wep_key $uci_num $i $num1 "3" + get_wlan_wep_key $uci_num $i $num1 "4" + get_wlan_pre_shared_key $uci_num $i $num1 "1" + get_wlan_pre_shared_key_key_passphrase $uci_num $i $num1 "1" + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $i $num1 "1" + fi + done + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Enable) if [ "$2" = "1" ]; then return $FAULT_CPE_INVALID_ARGUMENTS fi - freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Enable" "rc" "num" + freecwmp_parse_formated_parameter "$1.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Enable" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_enable $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Status) @@ -2301,10 +3156,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Status" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_status $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_status $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BSSID) @@ -2314,10 +3192,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BSSID" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_bssid $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_bssid $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].MaxBitRate) @@ -2327,10 +3228,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.MaxBitRate" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_max_bit_rate $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_max_bit_rate $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Channel) @@ -2340,10 +3264,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Channel" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_channel $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_channel $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].SSID) @@ -2353,10 +3300,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.SSID" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_ssid $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_ssid $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BeaconType) @@ -2366,10 +3336,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BeaconType" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_beacon_type $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_beacon_type $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].MACAddressControlEnabled) @@ -2379,10 +3372,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.MACAddressControlEnabled" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_mac_control_enable $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_mac_control_enable $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Standard) @@ -2392,10 +3408,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Standard" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_standard $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_standard $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKeyIndex) @@ -2405,10 +3444,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKeyIndex" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_key_index $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_key_index $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].KeyPassphrase) @@ -2418,20 +3480,69 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.KeyPassphrase" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_key_passphrase $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_key_passphrase $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPEncryptionLevel) + if [ "$2" = "1" ]; then + return $FAULT_CPE_INVALID_ARGUMENTS + fi freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPEncryptionLevel" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_encryption_level $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_encryption_level $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BasicEncryptionModes) @@ -2441,10 +3552,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BasicEncryptionModes" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_basic_encryption_modes $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_basic_encryption_modes $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BasicAuthenticationMode) @@ -2454,10 +3588,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BasicAuthenticationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_basic_authentication_mode $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_basic_authentication_mode $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WPAEncryptionModes) @@ -2467,10 +3624,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WPAEncryptionModes" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wpa_encryption_modes $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wpa_encryption_modes $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WPAAuthenticationMode) @@ -2480,10 +3660,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WPAAuthenticationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wpa_authentication_mode $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wpa_authentication_mode $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].IEEE11iEncryptionModes) @@ -2493,10 +3696,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.IEEE11iEncryptionModes" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_ieee_11i_encryption_modes $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].IEEE11iAuthenticationMode) @@ -2506,23 +3732,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.IEEE11iAuthenticationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - fi - return $FAULT_CPE_NO_FAULT - ;; - InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].RadioEnabled) - if [ "$2" = "1" ]; then - return $FAULT_CPE_INVALID_ARGUMENTS - fi - freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.RadioEnabled" "rc" "num" - local num1=`echo $num | awk '{ print $1 }'` - local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_radio_enabled $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_ieee_11i_authentication_mode $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].DeviceOperationMode) @@ -2532,12 +3768,35 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.DeviceOperationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_device_operation_mode $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_device_operation_mode $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT - ;; + ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].AuthenticationServiceMode) if [ "$2" = "1" ]; then return $FAULT_CPE_INVALID_ARGUMENTS @@ -2545,10 +3804,69 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.AuthenticationServiceMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_authentication_service_mode $uci_num $num1 + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_authentication_service_mode $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done + return $FAULT_CPE_NO_FAULT + ;; + InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].RadioEnabled) + if [ "$2" = "1" ]; then + return $FAULT_CPE_INVALID_ARGUMENTS fi + freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.RadioEnabled" "rc" "num" + local num1=`echo $num | awk '{ print $1 }'` + local num2=`echo $num | awk '{ print $2 }'` + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_radio_enabled $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].TotalAssociations) @@ -2558,10 +3876,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.TotalAssociations" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_total_associations $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_total_associations $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.1.WEPKey) @@ -2571,10 +3912,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.1.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_key $uci_num $num1 "1" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_key $uci_num $i $num1 "1" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.2.WEPKey) @@ -2584,10 +3948,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.2.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_key $uci_num $num1 "2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_key $uci_num $i $num1 "2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.3.WEPKey) @@ -2597,10 +3984,33 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.3.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_key $uci_num $num1 "3" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_key $uci_num $i $num1 "3" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.4.WEPKey) @@ -2610,49 +4020,141 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.4.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_key $uci_num $num1 "4" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_key $uci_num $i $num1 "4" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; - InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.WEPKey) + InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.PreSharedKey) if [ "$2" = "1" ]; then return $FAULT_CPE_INVALID_ARGUMENTS fi - freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.PreSharedKey.1.WEPKey" "rc" "num" + freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.PreSharedKey.1.PreSharedKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_pre_shared_key $uci_num $num1 "1" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_pre_shared_key $uci_num $i $num1 "1" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; - InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.KeyPassphrase) + InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.KeyPassphrase) if [ "$2" = "1" ]; then return $FAULT_CPE_INVALID_ARGUMENTS fi freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.PreSharedKey.1.KeyPassphrase" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_pre_shared_key_key_passphrase $uci_num $i $num1 "1" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; - InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.AssociatedDeviceMACAddress) + InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.AssociatedDeviceMACAddress) if [ "$2" = "1" ]; then return $FAULT_CPE_INVALID_ARGUMENTS fi freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.PreSharedKey.1.AssociatedDeviceMACAddress" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $i $num1 "1" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; esac @@ -2670,43 +4172,47 @@ case "$1" in InternetGatewayDevice.) get_ip_interface_ip_address get_ip_interface_netmask - for lan_num in `seq 1 $max_lan_num`;do - for i in `seq 1 $max_num`;do + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" freecwmp_parse_formated_parameter $1"LANDevice.$lan_num.WLANConfiguration.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - get_wlan_status $uci_num $num1 - get_wlan_bssid $uci_num $num1 - get_wlan_max_bit_rate $uci_num $num1 - get_wlan_channel $uci_num $num1 - get_wlan_ssid $uci_num $num1 - get_wlan_beacon_type $uci_num $num1 - get_wlan_mac_control_enable $uci_num $num1 - get_wlan_standard $uci_num $num1 - get_wlan_wep_key_index $uci_num $num1 - get_wlan_key_passphrase $uci_num $num1 - get_wlan_wep_encryption_level $uci_num $num1 - get_wlan_basic_encryption_modes $uci_num $num1 - get_wlan_basic_authentication_mode $uci_num $num1 - get_wlan_wpa_encryption_modes $uci_num $num1 - get_wlan_wpa_authentication_mode $uci_num $num1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - get_wlan_radio_enabled $uci_num $num1 - get_wlan_device_operation_mode $uci_num $num1 - get_wlan_authentication_service_mode $uci_num $num1 - get_wlan_total_associations $uci_num $num1 - get_wlan_associated_device $uci_num $num1 - get_wlan_wep_key $uci_num $num1 "1" - get_wlan_wep_key $uci_num $num1 "2" - get_wlan_wep_key $uci_num $num1 "3" - get_wlan_wep_key $uci_num $num1 "4" - get_wlan_pre_shared_key $uci_num $num1 "1" - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" + get_wlan_enable $uci_num $num1 $i + get_wlan_status $uci_num $num1 $i + get_wlan_bssid $uci_num $num1 $i + get_wlan_max_bit_rate $uci_num $num1 $i + get_wlan_channel $uci_num $num1 $i + get_wlan_ssid $uci_num $num1 $i + get_wlan_beacon_type $uci_num $num1 $i + get_wlan_mac_control_enable $uci_num $num1 $i + get_wlan_standard $uci_num $num1 $i + get_wlan_wep_key_index $uci_num $num1 $i + get_wlan_key_passphrase $uci_num $num1 $i + get_wlan_wep_encryption_level $uci_num $num1 $i + get_wlan_basic_encryption_modes $uci_num $num1 $i + get_wlan_basic_authentication_mode $uci_num $num1 $i + get_wlan_wpa_encryption_modes $uci_num $num1 $i + get_wlan_wpa_authentication_mode $uci_num $num1 $i + get_wlan_ieee_11i_encryption_modes $uci_num $num1 $i + get_wlan_ieee_11i_authentication_mode $uci_num $num1 $i + get_wlan_radio_enabled $uci_num $num1 $i + get_wlan_device_operation_mode $uci_num $num1 $i + get_wlan_authentication_service_mode $uci_num $num1 $i + get_wlan_total_associations $uci_num $num1 $i + get_wlan_associated_device $uci_num $num1 $i + get_wlan_wep_key $uci_num $num1 $i "1" + get_wlan_wep_key $uci_num $num1 $i "2" + get_wlan_wep_key $uci_num $num1 $i "3" + get_wlan_wep_key $uci_num $num1 $i "4" + get_wlan_pre_shared_key $uci_num $num1 $i "1" + get_wlan_pre_shared_key_key_passphrase $uci_num $num1 $i "1" + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 $i "1" fi done done @@ -2715,43 +4221,47 @@ case "$1" in InternetGatewayDevice.LANDevice.) get_ip_interface_ip_address get_ip_interface_netmask - for lan_num in `seq 1 $max_lan_num`;do - for i in `seq 1 $max_num`;do + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" freecwmp_parse_formated_parameter $1"$lan_num.WLANConfiguration.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - get_wlan_status $uci_num $num1 - get_wlan_bssid $uci_num $num1 - get_wlan_max_bit_rate $uci_num $num1 - get_wlan_channel $uci_num $num1 - get_wlan_ssid $uci_num $num1 - get_wlan_beacon_type $uci_num $num1 - get_wlan_mac_control_enable $uci_num $num1 - get_wlan_standard $uci_num $num1 - get_wlan_wep_key_index $uci_num $num1 - get_wlan_key_passphrase $uci_num $num1 - get_wlan_wep_encryption_level $uci_num $num1 - get_wlan_basic_encryption_modes $uci_num $num1 - get_wlan_basic_authentication_mode $uci_num $num1 - get_wlan_wpa_encryption_modes $uci_num $num1 - get_wlan_wpa_authentication_mode $uci_num $num1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - get_wlan_radio_enabled $uci_num $num1 - get_wlan_device_operation_mode $uci_num $num1 - get_wlan_authentication_service_mode $uci_num $num1 - get_wlan_total_associations $uci_num $num1 - get_wlan_associated_device $uci_num $num1 - get_wlan_wep_key $uci_num $num1 "1" - get_wlan_wep_key $uci_num $num1 "2" - get_wlan_wep_key $uci_num $num1 "3" - get_wlan_wep_key $uci_num $num1 "4" - get_wlan_pre_shared_key $uci_num $num1 "1" - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" + get_wlan_enable $uci_num $num1 $i + get_wlan_status $uci_num $num1 $i + get_wlan_bssid $uci_num $num1 $i + get_wlan_max_bit_rate $uci_num $num1 $i + get_wlan_channel $uci_num $num1 $i + get_wlan_ssid $uci_num $num1 $i + get_wlan_beacon_type $uci_num $num1 $i + get_wlan_mac_control_enable $uci_num $num1 $i + get_wlan_standard $uci_num $num1 $i + get_wlan_wep_key_index $uci_num $num1 $i + get_wlan_key_passphrase $uci_num $num1 $i + get_wlan_wep_encryption_level $uci_num $num1 $i + get_wlan_basic_encryption_modes $uci_num $num1 $i + get_wlan_basic_authentication_mode $uci_num $num1 $i + get_wlan_wpa_encryption_modes $uci_num $num1 $i + get_wlan_wpa_authentication_mode $uci_num $num1 $i + get_wlan_ieee_11i_encryption_modes $uci_num $num1 $i + get_wlan_ieee_11i_authentication_mode $uci_num $num1 $i + get_wlan_radio_enabled $uci_num $num1 $i + get_wlan_device_operation_mode $uci_num $num1 $i + get_wlan_authentication_service_mode $uci_num $num1 $i + get_wlan_total_associations $uci_num $num1 $i + get_wlan_associated_device $uci_num $num1 $i + get_wlan_wep_key $uci_num $num1 $i "1" + get_wlan_wep_key $uci_num $num1 $i "2" + get_wlan_wep_key $uci_num $num1 $i "3" + get_wlan_wep_key $uci_num $num1 $i "4" + get_wlan_pre_shared_key $uci_num $num1 $i "1" + get_wlan_pre_shared_key_key_passphrase $uci_num $num1 $i "1" + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 $i "1" fi done done @@ -2760,42 +4270,55 @@ case "$1" in InternetGatewayDevice.LANDevice.[1-$max_lan_num].) get_ip_interface_ip_address get_ip_interface_netmask - for i in `seq 1 $max_num`;do - freecwmp_parse_formated_parameter $1"WLANConfiguration.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" - local num1=`echo $num | awk '{ print $1 }'` - local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - get_wlan_status $uci_num $num1 - get_wlan_bssid $uci_num $num1 - get_wlan_max_bit_rate $uci_num $num1 - get_wlan_channel $uci_num $num1 - get_wlan_ssid $uci_num $num1 - get_wlan_beacon_type $uci_num $num1 - get_wlan_mac_control_enable $uci_num $num1 - get_wlan_standard $uci_num $num1 - get_wlan_wep_key_index $uci_num $num1 - get_wlan_key_passphrase $uci_num $num1 - get_wlan_wep_encryption_level $uci_num $num1 - get_wlan_basic_encryption_modes $uci_num $num1 - get_wlan_basic_authentication_mode $uci_num $num1 - get_wlan_wpa_encryption_modes $uci_num $num1 - get_wlan_wpa_authentication_mode $uci_num $num1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - get_wlan_radio_enabled $uci_num $num1 - get_wlan_device_operation_mode $uci_num $num1 - get_wlan_authentication_service_mode $uci_num $num1 - get_wlan_total_associations $uci_num $num1 - get_wlan_associated_device $uci_num $num1 - get_wlan_wep_key $uci_num $num1 "1" - get_wlan_wep_key $uci_num $num1 "2" - get_wlan_wep_key $uci_num $num1 "3" - get_wlan_wep_key $uci_num $num1 "4" - get_wlan_pre_shared_key $uci_num $num1 "1" - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" + freecwmp_parse_formated_parameter $1 "InternetGatewayDevice.LANDevice.{i}." "rc" "x" + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $x -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + freecwmp_parse_formated_parameter $1"WLANConfiguration.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" + local num1=`echo $num | awk '{ print $1 }'` + local num2=`echo $num | awk '{ print $2 }'` + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + get_wlan_enable $uci_num $num1 $i + get_wlan_status $uci_num $num1 $i + get_wlan_bssid $uci_num $num1 $i + get_wlan_max_bit_rate $uci_num $num1 $i + get_wlan_channel $uci_num $num1 $i + get_wlan_ssid $uci_num $num1 $i + get_wlan_beacon_type $uci_num $num1 $i + get_wlan_mac_control_enable $uci_num $num1 $i + get_wlan_standard $uci_num $num1 $i + get_wlan_wep_key_index $uci_num $num1 $i + get_wlan_key_passphrase $uci_num $num1 $i + get_wlan_wep_encryption_level $uci_num $num1 $i + get_wlan_basic_encryption_modes $uci_num $num1 $i + get_wlan_basic_authentication_mode $uci_num $num1 $i + get_wlan_wpa_encryption_modes $uci_num $num1 $i + get_wlan_wpa_authentication_mode $uci_num $num1 $i + get_wlan_ieee_11i_encryption_modes $uci_num $num1 $i + get_wlan_ieee_11i_authentication_mode $uci_num $num1 $i + get_wlan_radio_enabled $uci_num $num1 $i + get_wlan_device_operation_mode $uci_num $num1 $i + get_wlan_authentication_service_mode $uci_num $num1 $i + get_wlan_total_associations $uci_num $num1 $i + get_wlan_associated_device $uci_num $num1 $i + get_wlan_wep_key $uci_num $num1 $i "1" + get_wlan_wep_key $uci_num $num1 $i "2" + get_wlan_wep_key $uci_num $num1 $i "3" + get_wlan_wep_key $uci_num $num1 $i "4" + get_wlan_pre_shared_key $uci_num $num1 $i "1" + get_wlan_pre_shared_key_key_passphrase $uci_num $num1 $i "1" + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 $i "1" + fi + done + if [ $x -eq $lan_num ]; then + break fi done return $FAULT_CPE_NO_FAULT @@ -2816,42 +4339,55 @@ case "$1" in return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.) - for i in `seq 1 $max_num`;do - freecwmp_parse_formated_parameter "$1$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" - local num1=`echo $num | awk '{ print $1 }'` - local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - get_wlan_status $uci_num $num1 - get_wlan_bssid $uci_num $num1 - get_wlan_max_bit_rate $uci_num $num1 - get_wlan_channel $uci_num $num1 - get_wlan_ssid $uci_num $num1 - get_wlan_beacon_type $uci_num $num1 - get_wlan_mac_control_enable $uci_num $num1 - get_wlan_standard $uci_num $num1 - get_wlan_wep_key_index $uci_num $num1 - get_wlan_key_passphrase $uci_num $num1 - get_wlan_wep_encryption_level $uci_num $num1 - get_wlan_basic_encryption_modes $uci_num $num1 - get_wlan_basic_authentication_mode $uci_num $num1 - get_wlan_wpa_encryption_modes $uci_num $num1 - get_wlan_wpa_authentication_mode $uci_num $num1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - get_wlan_radio_enabled $uci_num $num1 - get_wlan_device_operation_mode $uci_num $num1 - get_wlan_authentication_service_mode $uci_num $num1 - get_wlan_total_associations $uci_num $num1 - get_wlan_associated_device $uci_num $num1 - get_wlan_wep_key $uci_num $num1 "1" - get_wlan_wep_key $uci_num $num1 "2" - get_wlan_wep_key $uci_num $num1 "3" - get_wlan_wep_key $uci_num $num1 "4" - get_wlan_pre_shared_key $uci_num $num1 "1" - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" + freecwmp_parse_formated_parameter $1 "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration." "rc" "x" + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $x -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + freecwmp_parse_formated_parameter "$1$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" + local num1=`echo $num | awk '{ print $1 }'` + local num2=`echo $num | awk '{ print $2 }'` + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + get_wlan_enable $uci_num $num1 $i + get_wlan_status $uci_num $num1 $i + get_wlan_bssid $uci_num $num1 $i + get_wlan_max_bit_rate $uci_num $num1 $i + get_wlan_channel $uci_num $num1 $i + get_wlan_ssid $uci_num $num1 $i + get_wlan_beacon_type $uci_num $num1 $i + get_wlan_mac_control_enable $uci_num $num1 $i + get_wlan_standard $uci_num $num1 $i + get_wlan_wep_key_index $uci_num $num1 $i + get_wlan_key_passphrase $uci_num $num1 $i + get_wlan_wep_encryption_level $uci_num $num1 $i + get_wlan_basic_encryption_modes $uci_num $num1 $i + get_wlan_basic_authentication_mode $uci_num $num1 $i + get_wlan_wpa_encryption_modes $uci_num $num1 $i + get_wlan_wpa_authentication_mode $uci_num $num1 $i + get_wlan_ieee_11i_encryption_modes $uci_num $num1 $i + get_wlan_ieee_11i_authentication_mode $uci_num $num1 $i + get_wlan_radio_enabled $uci_num $num1 $i + get_wlan_device_operation_mode $uci_num $num1 $i + get_wlan_authentication_service_mode $uci_num $num1 $i + get_wlan_total_associations $uci_num $num1 $i + get_wlan_associated_device $uci_num $num1 $i + get_wlan_wep_key $uci_num $num1 $i "1" + get_wlan_wep_key $uci_num $num1 $i "2" + get_wlan_wep_key $uci_num $num1 $i "3" + get_wlan_wep_key $uci_num $num1 $i "4" + get_wlan_pre_shared_key $uci_num $num1 $i "1" + get_wlan_pre_shared_key_key_passphrase $uci_num $num1 $i "1" + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 $i "1" + fi + done + if [ $x -eq $lan_num ]; then + continue fi done return $FAULT_CPE_NO_FAULT @@ -2860,329 +4396,1018 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - get_wlan_status $uci_num $num1 - get_wlan_bssid $uci_num $num1 - get_wlan_max_bit_rate $uci_num $num1 - get_wlan_channel $uci_num $num1 - get_wlan_ssid $uci_num $num1 - get_wlan_beacon_type $uci_num $num1 - get_wlan_mac_control_enable $uci_num $num1 - get_wlan_standard $uci_num $num1 - get_wlan_wep_key_index $uci_num $num1 - get_wlan_key_passphrase $uci_num $num1 - get_wlan_wep_encryption_level $uci_num $num1 - get_wlan_basic_encryption_modes $uci_num $num1 - get_wlan_basic_authentication_mode $uci_num $num1 - get_wlan_wpa_encryption_modes $uci_num $num1 - get_wlan_wpa_authentication_mode $uci_num $num1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - get_wlan_radio_enabled $uci_num $num1 - get_wlan_device_operation_mode $uci_num $num1 - get_wlan_authentication_service_mode $uci_num $num1 - get_wlan_total_associations $uci_num $num1 - get_wlan_associated_device $uci_num $num1 - get_wlan_wep_key $uci_num $num1 "1" - get_wlan_wep_key $uci_num $num1 "2" - get_wlan_wep_key $uci_num $num1 "3" - get_wlan_wep_key $uci_num $num1 "4" - get_wlan_pre_shared_key $uci_num $num1 "1" - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + get_wlan_enable $uci_num $num1 $i + get_wlan_status $uci_num $num1 $i + get_wlan_bssid $uci_num $num1 $i + get_wlan_max_bit_rate $uci_num $num1 $i + get_wlan_channel $uci_num $num1 $i + get_wlan_ssid $uci_num $num1 $i + get_wlan_beacon_type $uci_num $num1 $i + get_wlan_mac_control_enable $uci_num $num1 $i + get_wlan_standard $uci_num $num1 $i + get_wlan_wep_key_index $uci_num $num1 $i + get_wlan_key_passphrase $uci_num $num1 $i + get_wlan_wep_encryption_level $uci_num $num1 $i + get_wlan_basic_encryption_modes $uci_num $num1 $i + get_wlan_basic_authentication_mode $uci_num $num1 $i + get_wlan_wpa_encryption_modes $uci_num $num1 $i + get_wlan_wpa_authentication_mode $uci_num $num1 $i + get_wlan_ieee_11i_encryption_modes $uci_num $num1 $i + get_wlan_ieee_11i_authentication_mode $uci_num $num1 $i + get_wlan_radio_enabled $uci_num $num1 $i + get_wlan_device_operation_mode $uci_num $num1 $i + get_wlan_authentication_service_mode $uci_num $num1 $i + get_wlan_total_associations $uci_num $num1 $i + get_wlan_associated_device $uci_num $num1 $i + get_wlan_wep_key $uci_num $num1 $i "1" + get_wlan_wep_key $uci_num $num1 $i "2" + get_wlan_wep_key $uci_num $num1 $i "3" + get_wlan_wep_key $uci_num $num1 $i "4" + get_wlan_pre_shared_key $uci_num $num1 $i "1" + get_wlan_pre_shared_key_key_passphrase $uci_num $num1 $i "1" + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 $i "1" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Enable) freecwmp_parse_formated_parameter "$1.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Enable" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_enable $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_enable $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Status) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Status" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_status $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_status $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BSSID) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BSSID" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_bssid $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_bssid $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].MaxBitRate) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.MaxBitRate" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_max_bit_rate $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_max_bit_rate $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Channel) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Channel" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_channel $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_channel $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].SSID) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.SSID" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_ssid $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_ssid $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BeaconType) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BeaconType" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_beacon_type $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_beacon_type $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].MACAddressControlEnabled) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.MACAddressControlEnabled" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_mac_control_enable $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_mac_control_enable $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Standard) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Standard" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_standard $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_standard $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKeyIndex) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKeyIndex" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_key_index $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_key_index $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].KeyPassphrase) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.KeyPassphrase" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_key_passphrase $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_key_passphrase $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPEncryptionLevel) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPEncryptionLevel" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_encryption_level $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_encryption_level $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BasicEncryptionModes) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BasicEncryptionModes" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_basic_encryption_modes $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_basic_encryption_modes $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BasicAuthenticationMode) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BasicAuthenticationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_basic_authentication_mode $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_basic_authentication_mode $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WPAEncryptionModes) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WPAEncryptionModes" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wpa_encryption_modes $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wpa_encryption_modes $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WPAAuthenticationMode) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WPAAuthenticationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wpa_authentication_mode $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wpa_authentication_mode $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].IEEE11iEncryptionModes) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.IEEE11iEncryptionModes" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_ieee_11i_encryption_modes $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_ieee_11i_encryption_modes $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].IEEE11iAuthenticationMode) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.IEEE11iAuthenticationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_ieee_11i_authentication_mode $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_ieee_11i_authentication_mode $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].DeviceOperationMode) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.DeviceOperationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_device_operation_mode $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_device_operation_mode $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].AuthenticationServiceMode) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.AuthenticationServiceMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_authentication_service_mode $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_authentication_service_mode $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].RadioEnabled) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.RadioEnabled" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_radio_enabled $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_radio_enabled $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].TotalAssociations) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.TotalAssociations" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_total_associations $uci_num $num1 - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_total_associations $uci_num $i $num1 + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.1.WEPKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.1.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_key $uci_num $num1 "1" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_key $uci_num $i $num1 "1" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.2.WEPKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.2.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_key $uci_num $num1 "2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_key $uci_num $i $num1 "2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.3.WEPKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.3.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_key $uci_num $num1 "3" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_key $uci_num $i $num1 "3" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.4.WEPKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.4.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_wep_key $uci_num $num1 "4" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_wep_key $uci_num $i $num1 "4" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.PreSharedKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.PreSharedKey.1.PreSharedKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_pre_shared_key $uci_num $num1 "1" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_pre_shared_key $uci_num $i $num1 "1" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.KeyPassphrase) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.PreSharedKey.1.KeyPassphrase" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_pre_shared_key_key_passphrase $uci_num $i $num1 "1" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.AssociatedDeviceMACAddress) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.PreSharedKey.1.AssociatedDeviceMACAddress" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + get_wlan_pre_shared_key_associated_device_MACAddress $uci_num $i $num1 "1" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; esac @@ -3198,13 +5423,36 @@ get_lan_number_of_entries "max_lan_num" case "$1" in InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Enable) - freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Enable" "rc" "num" + freecwmp_parse_formated_parameter "$1.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Enable" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_enable $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_enable $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Status) @@ -3212,88 +5460,269 @@ case "$1" in ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BSSID) return $FAULT_CPE_NON_WRITABLE_PARAMETER - ;; + ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].MaxBitRate) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.MaxBitRate" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_max_bit_rate $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_max_bit_rate $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Channel) - if [ $2 -lt 0 -o $2 -gt 255 ];then - return $FAULT_CPE_INVALID_PARAMETER_VALUE - fi freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Channel" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_channel $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_channel $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].SSID) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.SSID" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_ssid $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_ssid $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BeaconType) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BeaconType" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_beacon_type $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_beacon_type $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].MACAddressControlEnabled) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.MACAddressControlEnabled" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_mac_control_enable $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_mac_control_enable $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Standard) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Standard" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_standard $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_standard $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKeyIndex) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKeyIndex" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_wep_key_index $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_wep_key_index $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].KeyPassphrase) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.KeyPassphrase" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_key_passphrase $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_key_passphrase $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPEncryptionLevel) @@ -3303,163 +5732,531 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BasicEncryptionModes" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_basic_encryption_modes $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_basic_encryption_modes $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BasicAuthenticationMode) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BasicAuthenticationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_basic_authentication_mode $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_basic_authentication_mode $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WPAEncryptionModes) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WPAEncryptionModes" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_wpa_encryption_modes $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_wpa_encryption_modes $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WPAAuthenticationMode) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WPAAuthenticationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_wpa_authentication_mode $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_wpa_authentication_mode $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].IEEE11iEncryptionModes) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.IEEE11iEncryptionModes" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_ieee_11i_encryption_modes $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_ieee_11i_encryption_modes $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].IEEE11iAuthenticationMode) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.IEEE11iAuthenticationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_ieee_11i_authentication_mode $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_ieee_11i_authentication_mode $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done + return $FAULT_CPE_NO_FAULT + ;; + InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].DeviceOperationMode) + freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.DeviceOperationMode" "rc" "num" + local num1=`echo $num | awk '{ print $1 }'` + local num2=`echo $num | awk '{ print $2 }'` + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_device_operation_mode $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done + return $FAULT_CPE_NO_FAULT + ;; + InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].AuthenticationServiceMode) + freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.AuthenticationServiceMode" "rc" "num" + local num1=`echo $num | awk '{ print $1 }'` + local num2=`echo $num | awk '{ print $2 }'` + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_authentication_service_mode $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].RadioEnabled) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.RadioEnabled" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_radio_enabled $uci_num $num1 "$2" - fi - return $FAULT_CPE_NO_FAULT - ;; - InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].DeviceOperationMode) - freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.DeviceOperationMode" "rc" "num" - local num1=`echo $num | awk '{ print $1 }'` - local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_device_operation_mode $uci_num $num1 "$2" - fi - return $FAULT_CPE_NO_FAULT - ;; - InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].AuthenticationServiceMode) - freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.AuthenticationServiceMode" "rc" "num" - local num1=`echo $num | awk '{ print $1 }'` - local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_authentication_service_mode $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_radio_enabled $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].TotalAssociations) return $FAULT_CPE_NON_WRITABLE_PARAMETER - ;; + ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.1.WEPKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.1.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_wep_key $uci_num $num1 "1" "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_wep_key $uci_num $i $num1 "1" "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.2.WEPKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.2.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_wep_key $uci_num $num1 "2" "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_wep_key $uci_num $i $num1 "2" "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.3.WEPKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.3.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_wep_key $uci_num $num1 "3" "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_wep_key $uci_num $i $num1 "3" "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.4.WEPKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.4.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_wep_key $uci_num $num1 "4" "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_wep_key $uci_num $i $num1 "4" "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.PreSharedKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.PreSharedKey.1.PreSharedKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_pre_shared_key $uci_num $num1 "1" "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_pre_shared_key $uci_num $i $num1 "1" "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.KeyPassphrase) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.PreSharedKey.1.KeyPassphrase" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_pre_shared_key_key_passphrase $uci_num $i $num1 "1" "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.AssociatedDeviceMACAddress) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.PreSharedKey.1.AssociatedDeviceMACAddress" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_pre_shared_key_associated_device_MACAddress $uci_num $i $num1 "1" "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; *) @@ -3485,10 +6282,15 @@ get_lan_number_of_entries "max_lan_num" case "$1" in InternetGatewayDevice.) - for lan_num in `seq 1 $max_lan_num`;do + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + get_wlan_number_of_entries "max_num" $lan_dev freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$lan_num." "0" freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration." "0" - for i in `seq 1 $max_num`;do + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" freecwmp_parse_formated_parameter $1"LANDevice.$lan_num.WLANConfiguration.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` @@ -3526,15 +6328,19 @@ case "$1" in return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.) - for lan_num in `seq 1 $max_lan_num`;do - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$lan_num." "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration." "0" - for i in `seq 1 $max_num`;do + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + get_wlan_number_of_entries "max_num" $lan_dev + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$lan_num." "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration." "0" + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" freecwmp_parse_formated_parameter $1"$lan_num.WLANConfiguration.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i." "0" freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.Enable" "0" freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.MaxBitRate" "0" @@ -3569,80 +6375,106 @@ case "$1" in return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].) - freecwmp_set_parameter_notification "$1WLANConfiguration." "0" - for i in `seq 1 $max_num`;do - freecwmp_parse_formated_parameter $1"WLANConfiguration.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" - local num1=`echo $num | awk '{ print $1 }'` - local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i." "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.Enable" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.MaxBitRate" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.Channel" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.SSID" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.BeaconType" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.MACAddressControlEnabled" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.Standard" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKeyIndex" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.KeyPassphrase" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPEncryptionLevel" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.BasicEncryptionModes" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.BasicAuthenticationMode" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WPAEncryptionModes" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WPAAuthenticationMode" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.IEEE11iEncryptionModes" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.IEEE11iAuthenticationMode" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.RadioEnabled" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.DeviceOperationMode" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.AuthenticationServiceMode" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.1.WEPKey" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.2.WEPKey" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.3.WEPKey" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.4.WEPKey" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.PreSharedKey" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.KeyPassphrase" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.AssociatedDeviceMACAddress" "0" + freecwmp_parse_formated_parameter $1 "InternetGatewayDevice.LANDevice.{i}." "rc" "x" + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $x -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + freecwmp_set_parameter_notification "$1WLANConfiguration." "0" + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + freecwmp_parse_formated_parameter $1"WLANConfiguration.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" + local num1=`echo $num | awk '{ print $1 }'` + local num2=`echo $num | awk '{ print $2 }'` + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i." "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.Enable" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.MaxBitRate" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.Channel" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.SSID" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.BeaconType" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.MACAddressControlEnabled" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.Standard" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKeyIndex" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.KeyPassphrase" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPEncryptionLevel" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.BasicEncryptionModes" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.BasicAuthenticationMode" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WPAEncryptionModes" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WPAAuthenticationMode" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.IEEE11iEncryptionModes" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.IEEE11iAuthenticationMode" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.RadioEnabled" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.DeviceOperationMode" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.AuthenticationServiceMode" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.1.WEPKey" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.2.WEPKey" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.3.WEPKey" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.4.WEPKey" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.PreSharedKey" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.KeyPassphrase" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.AssociatedDeviceMACAddress" "0" + fi + done + if [ $x -eq $lan_num ]; then + break fi done freecwmp_set_parameter_notification "$1" "$2" return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.) - for i in `seq 1 $max_num`;do - freecwmp_parse_formated_parameter "$1$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" - local num1=`echo $num | awk '{ print $1 }'` - local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i." "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.Enable" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.MaxBitRate" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.Channel" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.SSID" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.BeaconType" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.MACAddressControlEnabled" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.Standard" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKeyIndex" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.KeyPassphrase" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPEncryptionLevel" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.BasicEncryptionModes" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.BasicAuthenticationMode" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WPAEncryptionModes" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WPAAuthenticationMode" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.IEEE11iEncryptionModes" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.IEEE11iAuthenticationMode" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.RadioEnabled" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.DeviceOperationMode" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.AuthenticationServiceMode" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.1.WEPKey" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.2.WEPKey" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.3.WEPKey" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.4.WEPKey" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.PreSharedKey" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.KeyPassphrase" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.AssociatedDeviceMACAddress" "0" + freecwmp_parse_formated_parameter $1 "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration." "rc" "x" + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $x -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + freecwmp_parse_formated_parameter "$1$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" + local num1=`echo $num | awk '{ print $1 }'` + local num2=`echo $num | awk '{ print $2 }'` + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i." "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.Enable" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.MaxBitRate" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.Channel" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.SSID" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.BeaconType" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.MACAddressControlEnabled" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.Standard" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKeyIndex" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.KeyPassphrase" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPEncryptionLevel" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.BasicEncryptionModes" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.BasicAuthenticationMode" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WPAEncryptionModes" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WPAAuthenticationMode" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.IEEE11iEncryptionModes" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.IEEE11iAuthenticationMode" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.RadioEnabled" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.DeviceOperationMode" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.AuthenticationServiceMode" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.1.WEPKey" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.2.WEPKey" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.3.WEPKey" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.4.WEPKey" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.PreSharedKey" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.KeyPassphrase" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.AssociatedDeviceMACAddress" "0" fi + done + if [ $x -eq $lan_num ]; then + continue + fi done freecwmp_set_parameter_notification "$1" "$2" return $FAULT_CPE_NO_FAULT @@ -3651,46 +6483,94 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.Enable" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.MaxBitRate" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.Channel" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.SSID" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.BeaconType" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.MACAddressControlEnabled" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.Standard" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.WEPKeyIndex" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.KeyPassphrase" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.WEPEncryptionLevel" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.BasicEncryptionModes" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.BasicAuthenticationMode" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.WPAEncryptionModes" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.WPAAuthenticationMode" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.IEEE11iEncryptionModes" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.IEEE11iAuthenticationMode" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.RadioEnabled" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.DeviceOperationMode" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.AuthenticationServiceMode" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.1.WEPKey" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.2.WEPKey" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.3.WEPKey" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.4.WEPKey" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.PreSharedKey" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.KeyPassphrase" "0" - freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.AssociatedDeviceMACAddress" "0" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}." "rc" "num" + local num1=`echo $num | awk '{ print $1 }'` + local num2=`echo $num | awk '{ print $2 }'` + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.Enable" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.MaxBitRate" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.Channel" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.SSID" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.BeaconType" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.MACAddressControlEnabled" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.Standard" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.WEPKeyIndex" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.KeyPassphrase" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.WEPEncryptionLevel" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.BasicEncryptionModes" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.BasicAuthenticationMode" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.WPAEncryptionModes" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.WPAAuthenticationMode" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.IEEE11iEncryptionModes" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.IEEE11iAuthenticationMode" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.RadioEnabled" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.DeviceOperationMode" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$num2.AuthenticationServiceMode" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.1.WEPKey" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.2.WEPKey" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.3.WEPKey" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.WEPKey.4.WEPKey" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.PreSharedKey" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.KeyPassphrase" "0" + freecwmp_set_parameter_notification "InternetGatewayDevice.LANDevice.$num1.WLANConfiguration.$i.PreSharedKey.1.AssociatedDeviceMACAddress" "0" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done freecwmp_set_parameter_notification "$1" "$2" return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Enable) - freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Enable" "rc" "num" + freecwmp_parse_formated_parameter "$1.$i." "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Enable" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_enable $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_enable $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Status) @@ -3698,95 +6578,269 @@ case "$1" in ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BSSID) return $FAULT_CPE_NOTIFICATION_REJECTED - ;; + ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].MaxBitRate) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.MaxBitRate" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_max_bit_rate $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_max_bit_rate $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Channel) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Channel" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_channel $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_channel $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].SSID) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.SSID" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_ssid $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_ssid $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BeaconType) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BeaconType" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_beacon_type $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_beacon_type $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].MACAddressControlEnabled) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.MACAddressControlEnabled" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_mac_control_enable $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_mac_control_enable $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].Standard) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.Standard" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_standard $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_standard $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKeyIndex) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKeyIndex" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_wep_key_index $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_wep_key_index $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].KeyPassphrase) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.KeyPassphrase" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_key_passphrase $uci_num $num1 "$2" - fi - return $FAULT_CPE_NO_FAULT - ;; - InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BeaconType) - freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BeaconType" "rc" "num" - local num1=`echo $num | awk '{ print $1 }'` - local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_beacon_type $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_key_passphrase $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPEncryptionLevel) @@ -3796,163 +6850,531 @@ case "$1" in freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BasicEncryptionModes" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_basic_encryption_modes $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_basic_encryption_modes $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].BasicAuthenticationMode) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.BasicAuthenticationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_basic_authentication_mode $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_basic_authentication_mode $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WPAEncryptionModes) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WPAEncryptionModes" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_wpa_encryption_modes $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_wpa_encryption_modes $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WPAAuthenticationMode) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WPAAuthenticationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_wpa_authentication_mode $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_wpa_authentication_mode $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].IEEE11iEncryptionModes) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.IEEE11iEncryptionModes" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_ieee_11i_encryption_modes $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_ieee_11i_encryption_modes $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].IEEE11iAuthenticationMode) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.IEEE11iAuthenticationMode" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_ieee_11i_authentication_mode $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_ieee_11i_authentication_mode $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done + return $FAULT_CPE_NO_FAULT + ;; + InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].DeviceOperationMode) + freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.DeviceOperationMode" "rc" "num" + local num1=`echo $num | awk '{ print $1 }'` + local num2=`echo $num | awk '{ print $2 }'` + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_device_operation_mode $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done + return $FAULT_CPE_NO_FAULT + ;; + InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].AuthenticationServiceMode) + freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.AuthenticationServiceMode" "rc" "num" + local num1=`echo $num | awk '{ print $1 }'` + local num2=`echo $num | awk '{ print $2 }'` + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_authentication_service_mode $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].RadioEnabled) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.RadioEnabled" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_radio_enabled $uci_num $num1 "$2" - fi - return $FAULT_CPE_NO_FAULT - ;; - InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].DeviceOperationMode) - freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.DeviceOperationMode" "rc" "num" - local num1=`echo $num | awk '{ print $1 }'` - local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_device_operation_mode $uci_num $num1 "$2" - fi - return $FAULT_CPE_NO_FAULT - ;; - InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].AuthenticationServiceMode) - freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.AuthenticationServiceMode" "rc" "num" - local num1=`echo $num | awk '{ print $1 }'` - local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_authentication_service_mode $uci_num $num1 "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_radio_enabled $uci_num $i $num1 "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].TotalAssociations) return $FAULT_CPE_NOTIFICATION_REJECTED - ;; + ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.1.WEPKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.1.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_wep_key $uci_num $num1 "1" "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_wep_key $uci_num $i $num1 "1" "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.2.WEPKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.2.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_wep_key $uci_num $num1 "2" "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_wep_key $uci_num $i $num1 "2" "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.3.WEPKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.3.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_wep_key $uci_num $num1 "3" "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_wep_key $uci_num $i $num1 "3" "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].WEPKey.4.WEPKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.WEPKey.4.WEPKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_wep_key $uci_num $num1 "4" "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_wep_key $uci_num $i $num1 "4" "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.PreSharedKey) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.PreSharedKey.1.PreSharedKey" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_pre_shared_key $uci_num $num1 "1" "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_pre_shared_key $uci_num $i $num1 "1" "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.KeyPassphrase) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.PreSharedKey.1.KeyPassphrase" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_pre_shared_key_key_passphrase $uci_num $num1 "1" "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_pre_shared_key_key_passphrase $uci_num $i $num1 "1" "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.LANDevice.[1-$max_lan_num].WLANConfiguration.[1-$max_num].PreSharedKey.1.AssociatedDeviceMACAddress) freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.LANDevice.{i}.WLANConfiguration.{i}.PreSharedKey.1.AssociatedDeviceMACAddress" "rc" "num" local num1=`echo $num | awk '{ print $1 }'` local num2=`echo $num | awk '{ print $2 }'` - if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then - let uci_num=$num2-1 - set_wlan_pre_shared_key_associated_device_MACAddress $uci_num $num1 "1" "$2" - fi + for lan in `get_lan_device_interface`;do + lan_num=`echo $lan|cut -f2 -d:` + lan_dev=`echo $lan|cut -f1 -d:` + if [ $num1 -ne $lan_num ]; then + continue + fi + get_wlan_number_of_entries "max_num" $lan_dev + i=0 + for uci_num in `/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show wireless|grep $lan_dev|sed -n 's/wireless\.@wifi-iface//p'|sed -n 's/\.network=\w\+ *\w*//p'|sed -n 's/\]//p'|sed -n 's/\[//p'`;do + let "i++" + if [ $num2 -ne $i ]; then + continue + fi + if [ $rc -eq 0 ] && [ $num2 -gt 0 ] && [ $num2 -le $max_num ]; then + let uci_num=$num2-1 + set_wlan_pre_shared_key_associated_device_MACAddress $uci_num $i $num1 "1" "$2" + else + return $FAULT_CPE_INVALID_PARAMETER_NAME + fi + if [ $num2 -eq $i ]; then + break + fi + done + if [ $num1 -eq $lan_num ]; then + continue + fi + done return $FAULT_CPE_NO_FAULT ;; esac diff --git a/src/scripts/functions/voice_service b/src/scripts/functions/voice_service index 7e9c7ac..ce03c33 100644 --- a/src/scripts/functions/voice_service +++ b/src/scripts/functions/voice_service @@ -673,7 +673,7 @@ local type="xsd:unsignedInt" local permissions="" case "$action" in get_value) - val=`/usr/sbin/asterisk -rx "brcm show status"|grep -c "Default context : sip$num"` + val="" let num=$num+1 freecwmp_output "InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.$num.SIP.Organization" "$val" "$permissions" ;; @@ -790,7 +790,7 @@ local type="xsd:unsignedInt" local permissions="" case "$action" in get_value) - val=`/usr/sbin/asterisk -rx "brcm show status"|grep -c "Default context : sip$num"` + val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q get voice_client.SIP.registertimeout` let num=$num+1 freecwmp_output "InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.$num.SIP.ReInviteExpires" "$val" "$permissions" ;; @@ -812,6 +812,7 @@ local num="$1" local val="$2" case $action in set_value) + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q set voice_client.SIP.registertimeout="$val" ;; set_notification) let num=$num+1 @@ -1166,8 +1167,8 @@ local type="xsd:string" local permissions="" case "$action" in get_value) - val1="/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -P /var/state -q get asterisk.sip$num.sip_registry_registered" - val2="/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -P /var/state -q get asterisk.sip$num.sip_registry_request_sent" + val1="/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q -P /var/state get asterisk.sip$num.sip_registry_registered" + val2="/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q -P /var/state get asterisk.sip$num.sip_registry_request_sent" if [ "$val1" = "yes" ];then val="Up" else @@ -1466,7 +1467,7 @@ case "$1" in get_sip_user_agent_transport $profile_num get_sip_outbound_proxy $profile_num get_sip_outbound_proxy_port $profile_num - get_sip_organization $profile_num + # get_sip_organization $profile_num get_sip_registration_period $profile_num # get_sip_invite_expires $profile_num get_sip_re_invite_expires $profile_num @@ -1513,7 +1514,7 @@ case "$1" in get_sip_user_agent_transport $profile_num get_sip_outbound_proxy $profile_num get_sip_outbound_proxy_port $profile_num - get_sip_organization $profile_num + # get_sip_organization $profile_num get_sip_registration_period $profile_num # get_sip_invite_expires $profile_num get_sip_re_invite_expires $profile_num @@ -1554,7 +1555,7 @@ case "$1" in get_sip_user_agent_transport $profile_num get_sip_outbound_proxy $profile_num get_sip_outbound_proxy_port $profile_num - get_sip_organization $profile_num + # get_sip_organization $profile_num get_sip_registration_period $profile_num # get_sip_invite_expires $profile_num get_sip_re_invite_expires $profile_num @@ -1704,6 +1705,7 @@ case "$1" in return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.[1-$max_num].SIP.Organization) + return $FAULT_CPE_INVALID_PARAMETER_NAME freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.{i}.SIP.Organization" "rc" "num" if [ $rc -eq 0 ] && [ $num -gt 0 ] && [ $num -le $max_num ]; then let profile_num=$num-1 @@ -2130,7 +2132,7 @@ case "$1" in get_sip_user_agent_transport $profile_num get_sip_outbound_proxy $profile_num get_sip_outbound_proxy_port $profile_num - get_sip_organization $profile_num + # get_sip_organization $profile_num get_sip_registration_period $profile_num # get_sip_invite_expires $profile_num get_sip_re_invite_expires $profile_num @@ -2177,7 +2179,7 @@ case "$1" in get_sip_user_agent_transport $profile_num get_sip_outbound_proxy $profile_num get_sip_outbound_proxy_port $profile_num - get_sip_organization $profile_num + # get_sip_organization $profile_num get_sip_registration_period $profile_num # get_sip_invite_expires $profile_num get_sip_re_invite_expires $profile_num @@ -2218,7 +2220,7 @@ case "$1" in get_sip_user_agent_transport $profile_num get_sip_outbound_proxy $profile_num get_sip_outbound_proxy_port $profile_num - get_sip_organization $profile_num + # get_sip_organization $profile_num get_sip_registration_period $profile_num # get_sip_invite_expires $profile_num get_sip_re_invite_expires $profile_num @@ -2368,6 +2370,7 @@ case "$1" in return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.[1-$max_num].SIP.Organization) + return $FAULT_CPE_INVALID_PARAMETER_NAME freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.{i}.SIP.Organization" "rc" "num" if [ $rc -eq 0 ] && [ $num -gt 0 ] && [ $num -le $max_num ]; then let profile_num=$num-1 @@ -2798,7 +2801,7 @@ case "$1" in get_sip_user_agent_transport $profile_num get_sip_outbound_proxy $profile_num get_sip_outbound_proxy_port $profile_num - get_sip_organization $profile_num + # get_sip_organization $profile_num get_sip_registration_period $profile_num # get_sip_invite_expires $profile_num get_sip_re_invite_expires $profile_num @@ -2853,7 +2856,7 @@ case "$1" in get_sip_user_agent_transport $profile_num get_sip_outbound_proxy $profile_num get_sip_outbound_proxy_port $profile_num - get_sip_organization $profile_num + # get_sip_organization $profile_num get_sip_registration_period $profile_num # get_sip_invite_expires $profile_num get_sip_re_invite_expires $profile_num @@ -2907,7 +2910,7 @@ case "$1" in get_sip_user_agent_transport $profile_num get_sip_outbound_proxy $profile_num get_sip_outbound_proxy_port $profile_num - get_sip_organization $profile_num + # get_sip_organization $profile_num get_sip_registration_period $profile_num # get_sip_invite_expires $profile_num get_sip_re_invite_expires $profile_num @@ -2959,7 +2962,7 @@ case "$1" in get_sip_user_agent_transport $profile_num get_sip_outbound_proxy $profile_num get_sip_outbound_proxy_port $profile_num - get_sip_organization $profile_num + # get_sip_organization $profile_num get_sip_registration_period $profile_num # get_sip_invite_expires $profile_num get_sip_re_invite_expires $profile_num @@ -3012,7 +3015,7 @@ case "$1" in get_sip_user_agent_transport $profile_num get_sip_outbound_proxy $profile_num get_sip_outbound_proxy_port $profile_num - get_sip_organization $profile_num + # get_sip_organization $profile_num get_sip_registration_period $profile_num # get_sip_invite_expires $profile_num get_sip_re_invite_expires $profile_num @@ -3059,7 +3062,7 @@ case "$1" in get_sip_user_agent_transport $profile_num get_sip_outbound_proxy $profile_num get_sip_outbound_proxy_port $profile_num - get_sip_organization $profile_num + # get_sip_organization $profile_num get_sip_registration_period $profile_num # get_sip_invite_expires $profile_num get_sip_re_invite_expires $profile_num @@ -3261,6 +3264,7 @@ case "$1" in return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.[1-$max_num].SIP.Organization) + return $FAULT_CPE_INVALID_PARAMETER_NAME freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.{i}.SIP.Organization" "rc" "num" if [ $rc -eq 0 ] && [ $num -gt 0 ] && [ $num -le $max_num ]; then let profile_num=$num-1 @@ -3751,6 +3755,7 @@ case "$1" in return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.[1-$max_num].SIP.Organization) + return $FAULT_CPE_INVALID_PARAMETER_NAME freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.{i}.SIP.Organization" "rc" "num" if [ $rc -eq 0 ] && [ $num -gt 0 ] && [ $num -le $max_num ]; then let profile_num=$num-1 @@ -4239,6 +4244,7 @@ case "$1" in return $FAULT_CPE_NO_FAULT ;; InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.[1-$max_num].SIP.Organization) + return $FAULT_CPE_INVALID_PARAMETER_NAME freecwmp_parse_formated_parameter "$1" "InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.{i}.SIP.Organization" "rc" "num" if [ $rc -eq 0 ] && [ $num -gt 0 ] && [ $num -le $max_num ]; then let profile_num=$num-1