mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Make ip_diagnostics_download function works for both usp and cwmp
This commit is contained in:
parent
c78385f681
commit
54748ddb63
8 changed files with 1 additions and 8 deletions
|
|
@ -458,7 +458,7 @@ static opr_ret_t ip_diagnostics_download(struct dmctx *dmctx, char *path, json_o
|
|||
set_diagnostics_option("download", "NumberOfConnections", download.num_of_connections);
|
||||
set_diagnostics_option("download", "EnablePerConnection", download.enable_per_connection_results);
|
||||
|
||||
if (start_upload_download_diagnostic(DOWNLOAD_DIAGNOSTIC, "usp") == -1)
|
||||
if (start_upload_download_diagnostic(DOWNLOAD_DIAGNOSTIC, bbfdatamodel_type == BBFDM_CWMP ? "cwmp":"usp") == -1)
|
||||
return FAIL;
|
||||
|
||||
download.romtime = get_diagnostics_option("download", "ROMtime");
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ download_launch() {
|
|||
local proto tx_bytes_before rx_bytes_before time1 tx_bytes_after rx_bytes_after time2 res rh ba stc periodtime
|
||||
local url=$2
|
||||
local device=$3
|
||||
[ "$1" == "cwmp" ] && [ "`$UCI_GET_BBFDM dmmap_diagnostics.download.DiagnosticState`" != "Requested" ] && return
|
||||
[ "$url" = "" ] && { $UCI_SET_BBFDM dmmap_diagnostics.download.DiagnosticState=Error_InitConnectionFailed; $UCI_COMMIT_BBFDM; return; }
|
||||
local protocol=`download_get dmmap_diagnostics.download.ProtocolVersion Any`
|
||||
if [ "$protocol" == "IPv4" ]; then proto="-4"; elif [ "$protocol" == "IPv6" ]; then proto="-6"; else proto=""; fi
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ ipping_error()
|
|||
|
||||
ipping_launch() {
|
||||
local i proto device res ba stc times sc1 success_count failure_count min_time avg_time max_time avg_time_sum min max micros avg_time_det min_time_det max_time_det avg_time_sum_det min_det max_det
|
||||
[ "$1" == "cwmp" ] && [ "`$UCI_GET_BBFDM dmmap_diagnostics.ipping.DiagnosticState`" != "Requested" ] && return
|
||||
local host=`ipping_get dmmap_diagnostics.ipping.Host`
|
||||
local cnt=`ipping_get dmmap_diagnostics.ipping.NumberOfRepetitions 3`
|
||||
local dsize=`ipping_get dmmap_diagnostics.ipping.DataBlockSize 64`
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ nslookup_get() {
|
|||
nslookup_launch() {
|
||||
local i j time1 time2 timeresponse status AnswerType HostNameReturned address dns_server_ip ResponseTime success_count
|
||||
local address=""
|
||||
[ "$1" == "cwmp" ] && [ "`$UCI_GET_BBFDM dmmap_diagnostics.nslookup.DiagnosticState`" != "Requested" ] && return
|
||||
local hostname=`nslookup_get dmmap_diagnostics.nslookup.HostName`
|
||||
local dnsserver=`nslookup_get dmmap_diagnostics.nslookup.DNSServer`
|
||||
local cnt=`nslookup_get dmmap_diagnostics.nslookup.NumberOfRepetitions 1`
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ serverselection_get() {
|
|||
serverselection_launch() {
|
||||
local i proto device res ba stc times sc1 success_count min_time avg_time max_time avg_time_sum min max micros
|
||||
local fasthost avg_time_host min_time_host max_time_host
|
||||
[ "$1" == "cwmp" ] && [ "`$UCI_GET_BBFDM dmmap_diagnostics.serverselection.DiagnosticState`" != "Requested" ] && return
|
||||
local hostlist=`serverselection_get dmmap_diagnostics.serverselection.HostList`
|
||||
local cnt=`serverselection_get dmmap_diagnostics.serverselection.NumberOfRepetitions 3`
|
||||
local timeout=`serverselection_get dmmap_diagnostics.serverselection.Timeout 1000`
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ traceroute_get() {
|
|||
|
||||
traceroute_launch() {
|
||||
local i proto device res host ip time=0
|
||||
[ "$1" == "cwmp" ] && [ "`$UCI_GET_BBFDM dmmap_diagnostics.traceroute.DiagnosticState`" != "Requested" ] && return
|
||||
local host=`traceroute_get dmmap_diagnostics.traceroute.Host`
|
||||
local cnt=`traceroute_get dmmap_diagnostics.traceroute.NumberOfTries 3`
|
||||
local dsize=`traceroute_get dmmap_diagnostics.traceroute.DataBlockSize 38`
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ udpecho_get() {
|
|||
|
||||
udpecho_launch() {
|
||||
local i proto device res ba stc times sc1 success_count failure_count min_time avg_time max_time avg_time_sum min max micros
|
||||
[ "$1" == "cwmp" ] && [ "`$UCI_GET_BBFDM dmmap_diagnostics.udpechodiag.DiagnosticState`" != "Requested" ] && return
|
||||
local host=`udpecho_get dmmap_diagnostics.udpechodiag.Host`
|
||||
local port=`udpecho_get dmmap_diagnostics.udpechodiag.port`
|
||||
local cnt=`udpecho_get dmmap_diagnostics.udpechodiag.NumberOfRepetitions 1`
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ upload_launch() {
|
|||
local url=$2
|
||||
local device=$3
|
||||
local size=$4
|
||||
[ "$1" == "cwmp" ] && [ "`$UCI_GET_BBFDM dmmap_diagnostics.upload.DiagnosticState`" != "Requested" ] && return
|
||||
[ "$url" = "" ] && { $UCI_SET_BBFDM dmmap_diagnostics.upload.DiagnosticState=Error_InitConnectionFailed; $UCI_COMMIT_BBFDM; return; }
|
||||
local protocol=`upload_get dmmap_diagnostics.upload.ProtocolVersion Any`
|
||||
if [ "$protocol" == "IPv4" ]; then proto="-4"; elif [ "$protocol" == "IPv6" ]; then proto="-6"; else proto=""; fi
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue