forked from esnet/iperf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added iperf error code (iperf_error.*). Also added iperf_parse_parame…
…ters().
- Loading branch information
sethdelliott
committed
Jul 19, 2010
1 parent
7585c69
commit 8430ad4
Showing
7 changed files
with
285 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include <stdio.h> | ||
#include "iperf.h" | ||
#include "iperf_error.h" | ||
|
||
int ierrno; | ||
|
||
void | ||
ierror(char *estr) | ||
{ | ||
fprintf(stderr, "%s: ", estr); | ||
|
||
switch (ierrno) { | ||
case IESERVCLIENT: | ||
fprintf(stderr, "iperf cannot be both server and client\n"); | ||
break; | ||
case IENOROLE: | ||
fprintf(stderr, "iperf instance must either be a client (-c) or server (-s)\n"); | ||
break; | ||
case IECLIENTONLY: | ||
fprintf(stderr, "some option you are trying to set is client only\n"); | ||
break; | ||
case IEDURATION: | ||
fprintf(stderr, "test duration too long (maximum = %d seconds)\n", MAX_TIME); | ||
break; | ||
case IENUMSTREAMS: | ||
fprintf(stderr, "number of parallel streams too large (maximum = %d)\n", MAX_STREAMS); | ||
break; | ||
case IEBLOCKSIZE: | ||
fprintf(stderr, "block size too large (maximum = %d bytes)\n", MAX_BLOCKSIZE); | ||
break; | ||
case IEBUFSIZE: | ||
fprintf(stderr, "socket buffer size too large (maximum = %d bytes)\n", MAX_TCP_BUFFER); | ||
break; | ||
case IEINTERVAL: | ||
fprintf(stderr, "report interval too large (maximum = %d seconds)\n", MAX_INTERVAL); | ||
break; | ||
case IEMSS: | ||
fprintf(stderr, "TCP MSS too large (maximum = %d bytes)\n", MAX_MSS); | ||
break; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* iperf_error.h | ||
* | ||
* Iperf error handling | ||
*/ | ||
|
||
#ifndef __IPERF_ERROR_H | ||
#define __IPERF_ERROR_H | ||
|
||
void ierror(char *); | ||
|
||
extern int ierrno; | ||
|
||
enum { | ||
IESERVCLIENT = 1, // Iperf cannot be both server and client | ||
IENOROLE = 2, // Iperf must either be a client (-c) or server (-s) | ||
IECLIENTONLY = 3, // This option is client only | ||
IEDURATION = 4, // test duration too long. Maximum value = %dMAX_TIME | ||
IENUMSTREAMS = 5, // Number of parallel streams too large. Maximum value = %dMAX_STREAMS | ||
IEBLOCKSIZE = 6, // Block size too large. Maximum value = %dMAX_BLOCKSIZE | ||
IEBUFSIZE = 7, // Socket buffer size too large. Maximum value = %dMAX_TCP_BUFFER | ||
IEINTERVAL = 8, // Report interval too large. Maxumum value = %dMAX_INTERVAL | ||
IEMSS = 9, // MSS too large. Maximum value = %dMAX_MSS | ||
}; | ||
|
||
#endif |
Oops, something went wrong.