diff --git a/scripts/freecwmp.sh b/scripts/freecwmp.sh index f8b801a..d0fef20 100644 --- a/scripts/freecwmp.sh +++ b/scripts/freecwmp.sh @@ -190,40 +190,12 @@ if [ ${FLAGS_debug} -eq ${FLAGS_TRUE} ]; then echo "[debug] started at \"`date`\"" fi -prefix_list="\ -InternetGatewayDevice. \ -InternetGatewayDevice.DeviceInfo. \ -InternetGatewayDevice.LANDevice. \ -InternetGatewayDevice.ManagementServer. \ -InternetGatewayDevice.WANDevice. \ -InternetGatewayDevice.Layer2Bridging. \ -InternetGatewayDevice.Time. \ -InternetGatewayDevice.X_INTENO_SE_IpAccCfg. \ -InternetGatewayDevice.X_INTENO_SE_LoginCfg. \ -InternetGatewayDevice.Layer3Forwarding." +prefix_list="" . /lib/functions/network.sh -. /usr/share/freecwmp/functions/common -. /usr/share/freecwmp/functions/device_info -. /usr/share/freecwmp/functions/lan_device -. /usr/share/freecwmp/functions/management_server -. /usr/share/freecwmp/functions/wan_device -. /usr/share/freecwmp/functions/x_inteno_se_logincfg -. /usr/share/freecwmp/functions/x_inteno_se_ipacccfg -. /usr/share/freecwmp/functions/layer_2_bridging -. /usr/share/freecwmp/functions/models -. /usr/share/freecwmp/functions/times -. /usr/share/freecwmp/functions/layer_3_forwarding - -if [ $(db get hw.board.hasVoice) -eq 1 ]; then - . /usr/share/freecwmp/functions/voice_service - prefix_list="$prefix_list InternetGatewayDevice.Services." -fi - -if [ -e "/etc/config/ice" ]; then - . /usr/share/freecwmp/functions/x_inteno_se_ice - prefix_list="$prefix_list InternetGatewayDevice.X_INTENO_SE_ICE." -fi +for ffile in `ls /usr/share/freecwmp/functions/`; do +. /usr/share/freecwmp/functions/$ffile +done config_load cwmp diff --git a/scripts/functions/device_info b/scripts/functions/device_info index d3c8bd4..3efa4e3 100644 --- a/scripts/functions/device_info +++ b/scripts/functions/device_info @@ -4,6 +4,7 @@ # Author Ahmed Zribi # Author Mohamed Kallel +prefix_list="$prefix_list InternetGatewayDevice.DeviceInfo." get_device_info_hardware_version() { local val="" diff --git a/scripts/functions/lan_device b/scripts/functions/lan_device index 10000f3..ae7d79d 100644 --- a/scripts/functions/lan_device +++ b/scripts/functions/lan_device @@ -5,6 +5,8 @@ # Author Ahmed Zribi # Author Feten Besbes +prefix_list="$prefix_list InternetGatewayDevice.LANDevice." + get_lan_device_interface() { local i=0 local ret="" diff --git a/scripts/functions/layer_2_bridging b/scripts/functions/layer_2_bridging index a7e2b73..99c4aa5 100644 --- a/scripts/functions/layer_2_bridging +++ b/scripts/functions/layer_2_bridging @@ -2,6 +2,8 @@ # Copyright (C) 2013 Inteno Broadband Technology AB # Author Feten Besbes +prefix_list="$prefix_list InternetGatewayDevice.Layer2Bridging." + set_bridge_bridgename() { $UCI_RENAME network.$1=$2 delay_service reload "network" "1" diff --git a/scripts/functions/layer_3_forwarding b/scripts/functions/layer_3_forwarding index 60d3421..e34c902 100644 --- a/scripts/functions/layer_3_forwarding +++ b/scripts/functions/layer_3_forwarding @@ -1,6 +1,9 @@ #!/bin/sh # Copyright (C) 2014 Inteno Broadband Technology AB # Author Mohamed Kallel + +prefix_list="$prefix_list InternetGatewayDevice.Layer3Forwarding." + hex_to_ip() { local hex="$1" printf "%d.%d.%d.%d" 0x${hex:0:2} 0x${hex:2:2} 0x${hex:4:2} 0x${hex:6:2} diff --git a/scripts/functions/management_server b/scripts/functions/management_server index b2719f4..3f26f0d 100644 --- a/scripts/functions/management_server +++ b/scripts/functions/management_server @@ -4,6 +4,8 @@ # Author Ahmed Zribi # Author Mohamed Kallel +prefix_list="$prefix_list InternetGatewayDevice.ManagementServer." + get_management_server_connection_request_url() { local val if [ -z "$default_management_server_connection_request_url" ]; then diff --git a/scripts/functions/models b/scripts/functions/models index 13f95a0..73af3f6 100644 --- a/scripts/functions/models +++ b/scripts/functions/models @@ -3,6 +3,9 @@ # Author Mohamed Kallel #InternetGatewayDevice. + +prefix_list="InternetGatewayDevice. $prefix_list" + get_cache_InternetGatewayDevice() { get_object_cache_generic "InternetGatewayDevice." "0" "0" } diff --git a/scripts/functions/times b/scripts/functions/times index 7be74f9..33ef98d 100644 --- a/scripts/functions/times +++ b/scripts/functions/times @@ -3,6 +3,8 @@ # Author Mohamed Kallel # Author Feten Besbes +prefix_list="$prefix_list InternetGatewayDevice.Time." + get_time_ntpserver() { local ntp_num="$1" local val=`$UCI_GET system.ntp.server | awk -F ' ' -v var=$ntp_num '{print $var}'` diff --git a/scripts/functions/voice_service b/scripts/functions/voice_service index bb22d00..34ebebb 100644 --- a/scripts/functions/voice_service +++ b/scripts/functions/voice_service @@ -4,6 +4,8 @@ # Author Ahmed Zribi # Author Mohamed Kallel +prefix_list="$prefix_list InternetGatewayDevice.Services." + voice_service_save_instance_config() { local i="$1" #line number local j="$2" #line profile diff --git a/scripts/functions/wan_device b/scripts/functions/wan_device index e885dd9..85f96bc 100644 --- a/scripts/functions/wan_device +++ b/scripts/functions/wan_device @@ -3,6 +3,8 @@ # Copyright (C) 2013 Inteno Broadband Technology AB # Author Ahmed Zribi +prefix_list="$prefix_list InternetGatewayDevice.WANDevice." + WAN_INST_ETH=1 WAN_INST_ATM=2 WAN_INST_PTM=3 diff --git a/scripts/functions/x_inteno_se_ice b/scripts/functions/x_inteno_se_ice index 3b4ad9c..9dd26fd 100644 --- a/scripts/functions/x_inteno_se_ice +++ b/scripts/functions/x_inteno_se_ice @@ -1,6 +1,8 @@ #!/bin/sh # Copyright (C) 2014 Inteno Broadband Technology AB +prefix_list="$prefix_list InternetGatewayDevice.X_INTENO_SE_ICE." + get_ice_cloud_enable() { case "$($UCI_GET ice.cloud.enabled)" in 1|"true"|"yes"|"on") diff --git a/scripts/functions/x_inteno_se_ipacccfg b/scripts/functions/x_inteno_se_ipacccfg index 2a69e0a..0bce42d 100644 --- a/scripts/functions/x_inteno_se_ipacccfg +++ b/scripts/functions/x_inteno_se_ipacccfg @@ -2,6 +2,8 @@ # Copyright (C) 2013 Inteno Broadband Technology AB # Author Feten Besbes +prefix_list="$prefix_list InternetGatewayDevice.X_INTENO_SE_IpAccCfg." + get_firewall_rules() { local i=0 local rule diff --git a/scripts/functions/x_inteno_se_logincfg b/scripts/functions/x_inteno_se_logincfg index c2a9c24..f272532 100644 --- a/scripts/functions/x_inteno_se_logincfg +++ b/scripts/functions/x_inteno_se_logincfg @@ -3,6 +3,8 @@ # Copyright (C) 2013 Inteno Broadband Technology AB # Author Feten Besbes +prefix_list="$prefix_list InternetGatewayDevice.X_INTENO_SE_LoginCfg." + set_x_bcm_password() { local usr_type=$1 local new_pwd=$2