From b7920db5f2fe52dcdf15d66f269059d40fa3ca46 Mon Sep 17 00:00:00 2001 From: zribiahmed Date: Thu, 21 Feb 2013 09:32:35 +0000 Subject: [PATCH] fix returned fault for set parameter attributes --- src/scripts/functions/common | 2 +- src/scripts/functions/device_hosts | 2 +- src/scripts/functions/device_info | 66 ++++++++++++---------------- src/scripts/functions/device_routing | 2 +- src/scripts/functions/device_users | 2 +- src/scripts/functions/misc | 2 +- 6 files changed, 34 insertions(+), 42 deletions(-) diff --git a/src/scripts/functions/common b/src/scripts/functions/common index f200d6b..2d1ea37 100644 --- a/src/scripts/functions/common +++ b/src/scripts/functions/common @@ -490,7 +490,7 @@ freecwmp_execute_functions() if [ "$fault_code" = "0" ]; then no_fault="1" fi - if [ "$fault_code" != "0" -a \( "$fault_code" != "$FAULT_CPE_INVALID_PARAMETER_NAME" -o "$fault_code" != "$FAULT_CPE_NOTIFICATION_REJECTED" \) ]; then + if [ "$fault_code" != "0" -a "$fault_code" != "$FAULT_CPE_INVALID_PARAMETER_NAME" ]; then return $fault_code fi done diff --git a/src/scripts/functions/device_hosts b/src/scripts/functions/device_hosts index d626260..05646bc 100644 --- a/src/scripts/functions/device_hosts +++ b/src/scripts/functions/device_hosts @@ -197,7 +197,7 @@ get_device_hosts_notification() { return $FAULT_CPE_INVALID_PARAMETER_NAME; } set_device_hosts() { return $FAULT_CPE_INVALID_PARAMETER_NAME; } -set_device_hosts_notification() { return $FAULT_CPE_NOTIFICATION_REJECTED; } +set_device_hosts_notification() { return $FAULT_CPE_INVALID_PARAMETER_NAME; } add_device_hosts() { return $FAULT_CPE_INVALID_PARAMETER_NAME; } diff --git a/src/scripts/functions/device_info b/src/scripts/functions/device_info index fca9d03..a30b49b 100644 --- a/src/scripts/functions/device_info +++ b/src/scripts/functions/device_info @@ -19,10 +19,6 @@ esac freecwmp_output "InternetGatewayDevice.DeviceInfo.Manufacturer" "$val" "$permissions" } -set_device_info_manufacturer() { - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.cpe.manufacturer="$1" -} - get_device_info_oui() { local val="" local permissions="" @@ -40,10 +36,6 @@ esac freecwmp_output "InternetGatewayDevice.DeviceInfo.ManufacturerOUI" "$val" "$permissions" } -set_device_info_oui() { - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.cpe.oui="$1" -} - get_device_info_product_class() { local val="" case "$action" in @@ -60,10 +52,6 @@ esac freecwmp_output "InternetGatewayDevice.DeviceInfo.ProductClass" "$val" "$permissions" } -set_device_info_product_class() { - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.cpe.product_class="$1" -} - get_device_info_serial_number() { local val="" local permissions="" @@ -81,10 +69,6 @@ esac freecwmp_output "InternetGatewayDevice.DeviceInfo.SerialNumber" "$val" "$permissions" } -set_device_info_serial_number() { - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.cpe.serial_number="$1" -} - get_device_info_hardware_version() { local val="" local permissions="" @@ -102,10 +86,6 @@ esac freecwmp_output "InternetGatewayDevice.DeviceInfo.HardwareVersion" "$val" "$permissions" } -set_device_info_hardware_version() { - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.cpe.hardware_version="$1" -} - get_device_info_software_version() { local val="" local permissions="" @@ -123,10 +103,6 @@ esac freecwmp_output "InternetGatewayDevice.DeviceInfo.SoftwareVersion" "$val" "$permissions" } -set_device_info_software_version() { - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.cpe.software_version="$1" -} - get_device_info_uptime() { local val="" local permissions="" @@ -377,35 +353,51 @@ return $FAULT_CPE_INVALID_PARAMETER_NAME set_device_info() { case "$1" in InternetGatewayDevice.DeviceInfo.Manufacturer) - set_device_info_manufacturer "$2" - return $FAULT_CPE_NO_FAULT + return $FAULT_CPE_NON_WRITABLE_PARAMETER ;; InternetGatewayDevice.DeviceInfo.ManufacturerOUI) - set_device_info_oui "$2" - return $FAULT_CPE_NO_FAULT + return $FAULT_CPE_NON_WRITABLE_PARAMETER ;; InternetGatewayDevice.DeviceInfo.ProductClass) - set_device_info_product_class "$2" - return $FAULT_CPE_NO_FAULT + return $FAULT_CPE_NON_WRITABLE_PARAMETER ;; InternetGatewayDevice.DeviceInfo.SerialNumber) - set_device_info_serial_number "$2" - return $FAULT_CPE_NO_FAULT + return $FAULT_CPE_NON_WRITABLE_PARAMETER ;; InternetGatewayDevice.DeviceInfo.HardwareVersion) - set_device_info_hardware_version "$2" - return $FAULT_CPE_NO_FAULT + return $FAULT_CPE_NON_WRITABLE_PARAMETER ;; InternetGatewayDevice.DeviceInfo.SoftwareVersion) - set_device_info_software_version "$2" - return $FAULT_CPE_NO_FAULT + return $FAULT_CPE_NON_WRITABLE_PARAMETER ;; esac return $FAULT_CPE_INVALID_PARAMETER_NAME } set_device_info_notification() { -return $FAULT_CPE_NOTIFICATION_REJECTED + InternetGatewayDevice.DeviceInfo.) + return $FAULT_CPE_NOTIFICATION_REJECTED + ;; + InternetGatewayDevice.DeviceInfo.Manufacturer) + return $FAULT_CPE_NOTIFICATION_REJECTED + ;; + InternetGatewayDevice.DeviceInfo.ManufacturerOUI) + return $FAULT_CPE_NOTIFICATION_REJECTED + ;; + InternetGatewayDevice.DeviceInfo.ProductClass) + return $FAULT_CPE_NOTIFICATION_REJECTED + ;; + InternetGatewayDevice.DeviceInfo.SerialNumber) + return $FAULT_CPE_NOTIFICATION_REJECTED + ;; + InternetGatewayDevice.DeviceInfo.HardwareVersion) + return $FAULT_CPE_NOTIFICATION_REJECTED + ;; + InternetGatewayDevice.DeviceInfo.SoftwareVersion) + return $FAULT_CPE_NOTIFICATION_REJECTED + ;; +esac +return $FAULT_CPE_INVALID_PARAMETER_NAME } check_parameter_device_info_generic() { diff --git a/src/scripts/functions/device_routing b/src/scripts/functions/device_routing index 4ff6efe..186e97f 100644 --- a/src/scripts/functions/device_routing +++ b/src/scripts/functions/device_routing @@ -359,7 +359,7 @@ get_device_routing_notification() { return $FAULT_CPE_INVALID_PARAMETER_NAME; } set_device_routing() { return $FAULT_CPE_INVALID_PARAMETER_NAME; } -set_device_routing_notification() { return $FAULT_CPE_NOTIFICATION_REJECTED; } +set_device_routing_notification() { return $FAULT_CPE_INVALID_PARAMETER_NAME; } add_device_routing() { return $FAULT_CPE_INVALID_PARAMETER_NAME; } diff --git a/src/scripts/functions/device_users b/src/scripts/functions/device_users index 2b46c32..2412b99 100644 --- a/src/scripts/functions/device_users +++ b/src/scripts/functions/device_users @@ -133,7 +133,7 @@ get_device_users_notification() { return $FAULT_CPE_INVALID_PARAMETER_NAME; } set_device_users() { return $FAULT_CPE_INVALID_PARAMETER_NAME; } -set_device_users_notification() { return $FAULT_CPE_NOTIFICATION_REJECTED; } +set_device_users_notification() { return $FAULT_CPE_INVALID_PARAMETER_NAME; } add_device_users() { return $FAULT_CPE_INVALID_PARAMETER_NAME; } diff --git a/src/scripts/functions/misc b/src/scripts/functions/misc index aa30ad1..acb711b 100644 --- a/src/scripts/functions/misc +++ b/src/scripts/functions/misc @@ -33,7 +33,7 @@ get_misc_notification () { return $FAULT_CPE_INVALID_PARAMETER_NAME; } set_misc() { return $FAULT_CPE_INVALID_PARAMETER_NAME; } -set_misc_notification () { return $FAULT_CPE_NOTIFICATION_REJECTED; } +set_misc_notification () { return $FAULT_CPE_INVALID_PARAMETER_NAME; } add_misc() { return $FAULT_CPE_INVALID_PARAMETER_NAME; }