Iperf Received An Unknown Control Message
"Fossies" - the Fresh Open up Source Software Archive
Fellow member "iperf-3.eleven/src/iperf_error.c" (31 Jan 2022, 16194 Bytes) of bundle /linux/privat/iperf-3.11.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you tin can hither view or download the uninterpreted source lawmaking file. For more information nigh "iperf_error.c" run across the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes written report:
three.ten.1_vs_3.xi.
1 /* two * iperf, Copyright (c) 2014-2022, The Regents of the Academy of 3 * California, through Lawrence Berkeley National Laboratory (subject 4 * to receipt of any required approvals from the U.S. Dept. of 5 * Energy). All rights reserved. half dozen * 7 * If you lot have questions most your rights to use or distribute this 8 * software, please contact Berkeley Lab's Technology Transfer ix * Department at TTD@lbl.gov. 10 * xi * NOTICE. This software is owned by the U.Southward. Department of Free energy. 12 * As such, the U.S. Government has been granted for itself and others 13 * interim on its behalf a paid-up, nonexclusive, irrevocable, 14 * worldwide license in the Software to reproduce, gear up derivative 15 * works, and perform publicly and display publicly. First five xvi * (5) years later on the date permission to assert copyright is obtained 17 * from the U.South. Department of Energy, and subject to whatsoever subsequent eighteen * five (5) year renewals, the U.South. Authorities is granted for itself xix * and others acting on its behalf a paid-up, nonexclusive, 20 * irrevocable, worldwide license in the Software to reproduce, 21 * fix derivative works, distribute copies to the public, perform 22 * publicly and display publicly, and to allow others to do so. 23 * 24 * This lawmaking is distributed under a BSD style license, come across the LICENSE 25 * file for consummate information. 26 */ 27 #include <stdio.h> 28 #include <errno.h> 29 #include <netdb.h> 30 #include <string.h> 31 #include <stdlib.h> 32 #include <stdarg.h> 33 #include "iperf.h" 34 #include "iperf_api.h" 35 36 int gerror; 37 38 char iperf_timestrerr[ 100 ]; 39 40 /* Practice a printf to stderr. */ 41 void 42 iperf_err ( struct iperf_test *test, const char *format, ...) 43 { 44 va_list argp; 45 char str[ yard ]; 46 time_t now; 47 struct tm *ltm = NULL; 48 char *ct = Aught; 49 50 /* Timestamp if requested */ 51 if (test != NULL && test->timestamps) { 52 time (&now); 53 ltm = localtime (&now); 54 strftime (iperf_timestrerr, sizeof (iperf_timestrerr), test->timestamp_format, ltm); 55 ct = iperf_timestrerr; 56 } 57 58 va_start (argp, format); 59 vsnprintf (str, sizeof (str), format, argp); 60 if (exam != NULL && exam->json_output && test->json_top != Nothing) 61 cJSON_AddStringToObject (examination->json_top, "mistake" , str); 62 else { 63 if (test && test->outfile && examination->outfile != stdout) { 64 if (ct) { 65 fprintf (test->outfile, " %southward " , ct); 66 } 67 fprintf (examination->outfile, "iperf3: %s \n " , str); 68 } 69 else { 70 if (ct) { 71 fprintf (stderr, " %southward " , ct); 72 } 73 fprintf (stderr, "iperf3: %s \due north " , str); 74 } 75 } 76 va_end (argp); 77 } 78 79 /* Do a printf to stderr or log file equally appropriate, and then go out. */ 80 void 81 iperf_errexit ( struct iperf_test *test, const char *format, ...) 82 { 83 va_list argp; 84 char str[ 1000 ]; 85 time_t now; 86 struct tm *ltm = Null; 87 char *ct = Null; 88 89 /* Timestamp if requested */ 90 if (test != NULL && test->timestamps) { 91 time (&at present); 92 ltm = localtime (&now); 93 strftime (iperf_timestrerr, sizeof (iperf_timestrerr), " %c " , ltm); 94 ct = iperf_timestrerr; 95 } 96 97 va_start (argp, format); 98 vsnprintf (str, sizeof (str), format, argp); 99 if (test != Aught && test->json_output && test->json_top != Nix) { 100 cJSON_AddStringToObject (exam->json_top, "mistake" , str); 101 iperf_json_finish (test); 102 } else 103 if (examination && exam->outfile && exam->outfile != stdout) { 104 if (ct) { 105 fprintf (examination->outfile, " %s " , ct); 106 } 107 fprintf (exam->outfile, "iperf3: %s \north " , str); 108 } 109 else { 110 if (ct) { 111 fprintf (stderr, " %s " , ct); 112 } 113 fprintf (stderr, "iperf3: %south \northward " , str); 114 } 115 va_end (argp); 116 if (test) 117 iperf_delete_pidfile (test); 118 get out ( i ); 119 } 120 121 int i_errno; 122 123 char * 124 iperf_strerror ( int int_errno) 125 { 126 static char errstr[ 256 ]; 127 int len, perr, herr; 128 perr = herr = 0 ; 129 130 len = sizeof (errstr); 131 memset (errstr, 0 , len); 132 133 switch (int_errno) { 134 case IENONE: 135 snprintf (errstr, len, "no error" ); 136 interruption ; 137 case IESERVCLIENT: 138 snprintf (errstr, len, "cannot be both server and client" ); 139 break ; 140 case IENOROLE: 141 snprintf (errstr, len, "must either be a client (-c) or server (-south)" ); 142 intermission ; 143 case IESERVERONLY: 144 snprintf (errstr, len, "some option you are trying to ready is server only" ); 145 suspension ; 146 instance IECLIENTONLY: 147 snprintf (errstr, len, "some selection you are trying to set is client only" ); 148 break ; 149 case IEDURATION: 150 snprintf (errstr, len, "examination duration likewise long (maximum = %d seconds)" , MAX_TIME); 151 break ; 152 case IENUMSTREAMS: 153 snprintf (errstr, len, "number of parallel streams too large (maximum = %d )" , MAX_STREAMS); 154 intermission ; 155 instance IEBLOCKSIZE: 156 snprintf (errstr, len, "block size too large (maximum = %d bytes)" , MAX_BLOCKSIZE); 157 suspension ; 158 case IEBUFSIZE: 159 snprintf (errstr, len, "socket buffer size too large (maximum = %d bytes)" , MAX_TCP_BUFFER); 160 break ; 161 case IEINTERVAL: 162 snprintf (errstr, len, "invalid written report interval (min = %thousand , max = %g seconds)" , MIN_INTERVAL, MAX_INTERVAL); 163 break ; 164 case IEBIND: /* UNUSED */ 165 snprintf (errstr, len, "--demark must be specified to use --cport" ); 166 break ; 167 case IEUDPBLOCKSIZE: 168 snprintf (errstr, len, "block size invalid (minimum = %d bytes, maximum = %d bytes)" , MIN_UDP_BLOCKSIZE, MAX_UDP_BLOCKSIZE); 169 intermission ; 170 example IEBADTOS: 171 snprintf (errstr, len, "bad TOS value (must exist between 0 and 255 inclusive)" ); 172 interruption ; 173 example IESETCLIENTAUTH: 174 snprintf (errstr, len, "yous must specify a username, password, and path to a valid RSA public key" ); 175 intermission ; 176 case IESETSERVERAUTH: 177 snprintf (errstr, len, "y'all must specify a path to a valid RSA private key and a user credential file" ); 178 break ; 179 case IEBADFORMAT: 180 snprintf (errstr, len, "bad format specifier (valid formats are in the set up [kmgtKMGT])" ); 181 break ; 182 case IEBADPORT: 183 snprintf (errstr, len, "port number must be between one and 65535 inclusive" ); 184 interruption ; 185 case IEMSS: 186 snprintf (errstr, len, "TCP MSS too large (maximum = %d bytes)" , MAX_MSS); 187 break ; 188 case IENOSENDFILE: 189 snprintf (errstr, len, "this Bone does non back up sendfile" ); 190 pause ; 191 case IEOMIT: 192 snprintf (errstr, len, "artificial value for --omit" ); 193 break ; 194 case IEUNIMP: 195 snprintf (errstr, len, "an choice y'all are trying to set is not implemented yet" ); 196 suspension ; 197 instance IEFILE: 198 snprintf (errstr, len, "unable to open -F file" ); 199 perr = one ; 200 break ; 201 case IEBURST: 202 snprintf (errstr, len, "invalid burst count (maximum = %d )" , MAX_BURST); 203 interruption ; 204 instance IEENDCONDITIONS: 205 snprintf (errstr, len, "only 1 examination cease condition (-t, -n, -k) may be specified" ); 206 suspension ; 207 example IELOGFILE: 208 snprintf (errstr, len, "unable to open log file" ); 209 perr = 1 ; 210 pause ; 211 example IENOSCTP: 212 snprintf (errstr, len, "no SCTP support bachelor" ); 213 suspension ; 214 example IENEWTEST: 215 snprintf (errstr, len, "unable to create a new test" ); 216 perr = i ; 217 interruption ; 218 instance IEINITTEST: 219 snprintf (errstr, len, "test initialization failed" ); 220 perr = 1 ; 221 break ; 222 case IEAUTHTEST: 223 snprintf (errstr, len, "exam authorization failed" ); 224 interruption ; 225 case IELISTEN: 226 snprintf (errstr, len, "unable to outset listener for connections" ); 227 herr = ane ; 228 perr = 1 ; 229 interruption ; 230 case IECONNECT: 231 snprintf (errstr, len, "unable to connect to server" ); 232 perr = ane ; 233 herr = 1 ; 234 break ; 235 case IEACCEPT: 236 snprintf (errstr, len, "unable to accept connection from customer" ); 237 herr = 1 ; 238 perr = 1 ; 239 suspension ; 240 case IESENDCOOKIE: 241 snprintf (errstr, len, "unable to send cookie to server" ); 242 perr = 1 ; 243 break ; 244 instance IERECVCOOKIE: 245 snprintf (errstr, len, "unable to receive cookie at server" ); 246 perr = i ; 247 break ; 248 example IECTRLWRITE: 249 snprintf (errstr, len, "unable to write to the command socket" ); 250 perr = 1 ; 251 intermission ; 252 case IECTRLREAD: 253 snprintf (errstr, len, "unable to read from the control socket" ); 254 perr = 1 ; 255 break ; 256 case IECTRLCLOSE: 257 snprintf (errstr, len, "control socket has closed unexpectedly" ); 258 break ; 259 example IEMESSAGE: 260 snprintf (errstr, len, "received an unknown control bulletin" ); 261 intermission ; 262 case IESENDMESSAGE: 263 snprintf (errstr, len, "unable to transport control message" ); 264 perr = 1 ; 265 break ; 266 case IERECVMESSAGE: 267 snprintf (errstr, len, "unable to receive control message" ); 268 perr = 1 ; 269 break ; 270 case IESENDPARAMS: 271 snprintf (errstr, len, "unable to send parameters to server" ); 272 perr = one ; 273 break ; 274 example IERECVPARAMS: 275 snprintf (errstr, len, "unable to receive parameters from client" ); 276 perr = 1 ; 277 break ; 278 case IEPACKAGERESULTS: 279 snprintf (errstr, len, "unable to package results" ); 280 perr = 1 ; 281 suspension ; 282 case IESENDRESULTS: 283 snprintf (errstr, len, "unable to send results" ); 284 perr = 1 ; 285 interruption ; 286 case IERECVRESULTS: 287 snprintf (errstr, len, "unable to receive results" ); 288 perr = 1 ; 289 interruption ; 290 case IESELECT: 291 snprintf (errstr, len, "select failed" ); 292 perr = ane ; 293 break ; 294 example IECLIENTTERM: 295 snprintf (errstr, len, "the customer has terminated" ); 296 pause ; 297 case IESERVERTERM: 298 snprintf (errstr, len, "the server has terminated" ); 299 break ; 300 case IEACCESSDENIED: 301 snprintf (errstr, len, "the server is busy running a examination. endeavour again later" ); 302 intermission ; 303 case IESETNODELAY: 304 snprintf (errstr, len, "unable to set TCP/SCTP NODELAY" ); 305 perr = 1 ; 306 break ; 307 case IESETMSS: 308 snprintf (errstr, len, "unable to set up TCP/SCTP MSS" ); 309 perr = 1 ; 310 break ; 311 case IESETBUF: 312 snprintf (errstr, len, "unable to set up socket buffer size" ); 313 perr = ane ; 314 pause ; 315 example IESETTOS: 316 snprintf (errstr, len, "unable to set IP TOS" ); 317 perr = 1 ; 318 break ; 319 case IESETCOS: 320 snprintf (errstr, len, "unable to set IPv6 traffic course" ); 321 perr = one ; 322 break ; 323 case IESETFLOW: 324 snprintf (errstr, len, "unable to fix IPv6 menstruation characterization" ); 325 break ; 326 case IEREUSEADDR: 327 snprintf (errstr, len, "unable to reuse address on socket" ); 328 perr = 1 ; 329 interruption ; 330 case IENONBLOCKING: 331 snprintf (errstr, len, "unable to set socket to non-blocking" ); 332 perr = 1 ; 333 break ; 334 instance IESETWINDOWSIZE: 335 snprintf (errstr, len, "unable to fix socket window size" ); 336 perr = one ; 337 break ; 338 case IEPROTOCOL: 339 snprintf (errstr, len, "protocol does non exist" ); 340 break ; 341 case IEAFFINITY: 342 snprintf (errstr, len, "unable to ready CPU analogousness" ); 343 perr = 1 ; 344 suspension ; 345 case IERCVTIMEOUT: 346 snprintf (errstr, len, "receive timeout value is incorrect or not in range" ); 347 perr = 1 ; 348 pause ; 349 case IERVRSONLYRCVTIMEOUT: 350 snprintf (errstr, len, "client receive timeout is valid only in receiving mode" ); 351 perr = 1 ; 352 break ; 353 case IEDAEMON: 354 snprintf (errstr, len, "unable to go a daemon" ); 355 perr = one ; 356 interruption ; 357 case IECREATESTREAM: 358 snprintf (errstr, len, "unable to create a new stream" ); 359 herr = 1 ; 360 perr = 1 ; 361 break ; 362 case IEINITSTREAM: 363 snprintf (errstr, len, "unable to initialize stream" ); 364 herr = 1 ; 365 perr = ane ; 366 break ; 367 example IESTREAMLISTEN: 368 snprintf (errstr, len, "unable to first stream listener" ); 369 herr = 1 ; 370 perr = one ; 371 break ; 372 example IESTREAMCONNECT: 373 snprintf (errstr, len, "unable to connect stream" ); 374 herr = 1 ; 375 perr = one ; 376 break ; 377 case IESTREAMACCEPT: 378 snprintf (errstr, len, "unable to take stream connection" ); 379 perr = 1 ; 380 break ; 381 case IESTREAMWRITE: 382 snprintf (errstr, len, "unable to write to stream socket" ); 383 perr = one ; 384 break ; 385 case IESTREAMREAD: 386 snprintf (errstr, len, "unable to read from stream socket" ); 387 perr = 1 ; 388 intermission ; 389 case IESTREAMCLOSE: 390 snprintf (errstr, len, "stream socket has closed unexpectedly" ); 391 interruption ; 392 example IESTREAMID: 393 snprintf (errstr, len, "stream has an invalid id" ); 394 break ; 395 case IENEWTIMER: 396 snprintf (errstr, len, "unable to create new timer" ); 397 perr = 1 ; 398 break ; 399 case IEUPDATETIMER: 400 snprintf (errstr, len, "unable to update timer" ); 401 perr = 1 ; 402 break ; 403 instance IESETCONGESTION: 404 snprintf (errstr, len, "unable to ready TCP_CONGESTION: " 405 "Supplied congestion control algorithm not supported on this host" ); 406 interruption ; 407 case IEPIDFILE: 408 snprintf (errstr, len, "unable to write PID file" ); 409 perr = ane ; 410 interruption ; 411 example IEV6ONLY: 412 snprintf (errstr, len, "Unable to fix/reset IPV6_V6ONLY" ); 413 perr = 1 ; 414 break ; 415 case IESETSCTPDISABLEFRAG: 416 snprintf (errstr, len, "unable to set SCTP_DISABLE_FRAGMENTS" ); 417 perr = one ; 418 break ; 419 instance IESETSCTPNSTREAM: 420 snprintf (errstr, len, "unable to prepare SCTP_INIT num of SCTP streams \n " ); 421 perr = 1 ; 422 break ; 423 case IESETPACING: 424 snprintf (errstr, len, "unable to set socket pacing" ); 425 perr = 1 ; 426 break ; 427 example IESETBUF2: 428 snprintf (errstr, len, "socket buffer size not gear up correctly" ); 429 break ; 430 example IEREVERSEBIDIR: 431 snprintf (errstr, len, "cannot be both reverse and bidirectional" ); 432 break ; 433 case IETOTALRATE: 434 snprintf (errstr, len, "total required bandwidth is larger than server limit" ); 435 break ; 436 case IESKEWTHRESHOLD: 437 snprintf (errstr, len, "skew threshold must exist a positive number" ); 438 break ; 439 case IEIDLETIMEOUT: 440 snprintf (errstr, len, "idle timeout parameter is non positive or larger than allowed limit" ); 441 break ; 442 case IEBINDDEV: 443 snprintf (errstr, len, "Unable to bind-to-device (bank check perror, maybe permissions?)" ); 444 break ; 445 example IEBINDDEVNOSUPPORT: 446 snprintf (errstr, len, "`<ip>%%<dev>` is non supported as arrangement does not support demark to device" ); 447 break ; 448 instance IEHOSTDEV: 449 snprintf (errstr, len, "host device name (ip%%<dev>) is supported (and required) only for IPv6 link-local address" ); 450 intermission ; 451 instance IENOMSG: 452 snprintf (errstr, len, "idle timeout for receiving information" ); 453 break ; 454 instance IESETDONTFRAGMENT: 455 snprintf (errstr, len, "unable to set IP Do-Not-Fragment flag" ); 456 suspension ; 457 default : 458 snprintf (errstr, len, "int_errno= %d " , int_errno); 459 perr = 1 ; 460 break ; 461 } 462 463 /* Append the issue of strerror() or gai_strerror() if appropriate */ 464 if (herr || perr) 465 strncat (errstr, ": " , len - strlen (errstr) - i ); 466 if (errno && perr) 467 strncat (errstr, strerror (errno), len - strlen (errstr) - 1 ); 468 else if (herr && gerror) { 469 strncat (errstr, gai_strerror (gerror), len - strlen (errstr) - 1 ); 470 gerror = 0 ; 471 } 472 473 return errstr; 474 }
Source: https://fossies.org/linux/iperf/src/iperf_error.c
Posted by: gravesrepliskel.blogspot.com

0 Response to "Iperf Received An Unknown Control Message"
Post a Comment