version 1.1.1.2, 2021/03/17 00:36:46
|
version 1.1.1.3, 2023/09/27 11:14:54
|
Line 1
|
Line 1
|
/* |
/* |
* iperf, Copyright (c) 2014-2020, The Regents of the University of | * iperf, Copyright (c) 2014-2022, The Regents of the University of |
* California, through Lawrence Berkeley National Laboratory (subject |
* California, through Lawrence Berkeley National Laboratory (subject |
* to receipt of any required approvals from the U.S. Dept. of |
* to receipt of any required approvals from the U.S. Dept. of |
* Energy). All rights reserved. |
* Energy). All rights reserved. |
Line 59 iperf_err(struct iperf_test *test, const char *format,
|
Line 59 iperf_err(struct iperf_test *test, const char *format,
|
vsnprintf(str, sizeof(str), format, argp); |
vsnprintf(str, sizeof(str), format, argp); |
if (test != NULL && test->json_output && test->json_top != NULL) |
if (test != NULL && test->json_output && test->json_top != NULL) |
cJSON_AddStringToObject(test->json_top, "error", str); |
cJSON_AddStringToObject(test->json_top, "error", str); |
else | else { |
if (test && test->outfile && test->outfile != stdout) { |
if (test && test->outfile && test->outfile != stdout) { |
if (ct) { |
if (ct) { |
fprintf(test->outfile, "%s", ct); |
fprintf(test->outfile, "%s", ct); |
Line 72 iperf_err(struct iperf_test *test, const char *format,
|
Line 72 iperf_err(struct iperf_test *test, const char *format,
|
} |
} |
fprintf(stderr, "iperf3: %s\n", str); |
fprintf(stderr, "iperf3: %s\n", str); |
} |
} |
|
} |
va_end(argp); |
va_end(argp); |
} |
} |
|
|
Line 95 iperf_errexit(struct iperf_test *test, const char *for
|
Line 96 iperf_errexit(struct iperf_test *test, const char *for
|
|
|
va_start(argp, format); |
va_start(argp, format); |
vsnprintf(str, sizeof(str), format, argp); |
vsnprintf(str, sizeof(str), format, argp); |
if (test != NULL && test->json_output && test->json_top != NULL) { | if (test != NULL && test->json_output) { |
cJSON_AddStringToObject(test->json_top, "error", str); | if (test->json_top != NULL) { |
| cJSON_AddStringToObject(test->json_top, "error", str); |
| } |
iperf_json_finish(test); |
iperf_json_finish(test); |
} else |
} else |
if (test && test->outfile && test->outfile != stdout) { |
if (test && test->outfile && test->outfile != stdout) { |
Line 227 iperf_strerror(int int_errno)
|
Line 230 iperf_strerror(int int_errno)
|
perr = 1; |
perr = 1; |
break; |
break; |
case IECONNECT: |
case IECONNECT: |
snprintf(errstr, len, "unable to connect to server"); | snprintf(errstr, len, "unable to connect to server - server may have stopped running or use a different port, firewall issue, etc."); |
perr = 1; |
perr = 1; |
herr = 1; |
herr = 1; |
break; |
break; |
Line 256 iperf_strerror(int int_errno)
|
Line 259 iperf_strerror(int int_errno)
|
snprintf(errstr, len, "control socket has closed unexpectedly"); |
snprintf(errstr, len, "control socket has closed unexpectedly"); |
break; |
break; |
case IEMESSAGE: |
case IEMESSAGE: |
snprintf(errstr, len, "received an unknown control message"); | snprintf(errstr, len, "received an unknown control message (ensure other side is iperf3 and not iperf)"); |
break; |
break; |
case IESENDMESSAGE: |
case IESENDMESSAGE: |
snprintf(errstr, len, "unable to send control message"); | snprintf(errstr, len, "unable to send control message - port may not be available, the other side may have stopped running, etc."); |
perr = 1; |
perr = 1; |
break; |
break; |
case IERECVMESSAGE: |
case IERECVMESSAGE: |
snprintf(errstr, len, "unable to receive control message"); | snprintf(errstr, len, "unable to receive control message - port may not be available, the other side may have stopped running, etc."); |
perr = 1; |
perr = 1; |
break; |
break; |
case IESENDPARAMS: |
case IESENDPARAMS: |
Line 341 iperf_strerror(int int_errno)
|
Line 344 iperf_strerror(int int_errno)
|
snprintf(errstr, len, "unable to set CPU affinity"); |
snprintf(errstr, len, "unable to set CPU affinity"); |
perr = 1; |
perr = 1; |
break; |
break; |
|
case IERCVTIMEOUT: |
|
snprintf(errstr, len, "receive timeout value is incorrect or not in range"); |
|
perr = 1; |
|
break; |
|
case IESNDTIMEOUT: |
|
snprintf(errstr, len, "send timeout value is incorrect or not in range"); |
|
perr = 1; |
|
break; |
|
case IEUDPFILETRANSFER: |
|
snprintf(errstr, len, "cannot transfer file using UDP"); |
|
break; |
|
case IERVRSONLYRCVTIMEOUT: |
|
snprintf(errstr, len, "client receive timeout is valid only in receiving mode"); |
|
perr = 1; |
|
break; |
case IEDAEMON: |
case IEDAEMON: |
snprintf(errstr, len, "unable to become a daemon"); |
snprintf(errstr, len, "unable to become a daemon"); |
perr = 1; |
perr = 1; |
Line 392 iperf_strerror(int int_errno)
|
Line 410 iperf_strerror(int int_errno)
|
perr = 1; |
perr = 1; |
break; |
break; |
case IESETCONGESTION: |
case IESETCONGESTION: |
snprintf(errstr, len, "unable to set TCP_CONGESTION: " | snprintf(errstr, len, "unable to set TCP_CONGESTION: " |
"Supplied congestion control algorithm not supported on this host"); |
"Supplied congestion control algorithm not supported on this host"); |
break; |
break; |
case IEPIDFILE: |
case IEPIDFILE: |
Line 423 iperf_strerror(int int_errno)
|
Line 441 iperf_strerror(int int_errno)
|
break; |
break; |
case IETOTALRATE: |
case IETOTALRATE: |
snprintf(errstr, len, "total required bandwidth is larger than server limit"); |
snprintf(errstr, len, "total required bandwidth is larger than server limit"); |
|
break; |
|
case IESKEWTHRESHOLD: |
|
snprintf(errstr, len, "skew threshold must be a positive number"); |
|
break; |
|
case IEIDLETIMEOUT: |
|
snprintf(errstr, len, "idle timeout parameter is not positive or larger than allowed limit"); |
|
break; |
|
case IEBINDDEV: |
|
snprintf(errstr, len, "Unable to bind-to-device (check perror, maybe permissions?)"); |
|
break; |
|
case IEBINDDEVNOSUPPORT: |
|
snprintf(errstr, len, "`<ip>%%<dev>` is not supported as system does not support bind to device"); |
|
break; |
|
case IEHOSTDEV: |
|
snprintf(errstr, len, "host device name (ip%%<dev>) is supported (and required) only for IPv6 link-local address"); |
|
break; |
|
case IENOMSG: |
|
snprintf(errstr, len, "idle timeout for receiving data"); |
|
break; |
|
case IESETDONTFRAGMENT: |
|
snprintf(errstr, len, "unable to set IP Do-Not-Fragment flag"); |
|
break; |
|
case IESETUSERTIMEOUT: |
|
snprintf(errstr, len, "unable to set TCP USER_TIMEOUT"); |
|
perr = 1; |
break; |
break; |
default: |
default: |
snprintf(errstr, len, "int_errno=%d", int_errno); |
snprintf(errstr, len, "int_errno=%d", int_errno); |