aboutsummaryrefslogtreecommitdiff
path: root/src/iperf_error.c
diff options
context:
space:
mode:
authorsethdelliott <devnull@localhost>2010-07-19 19:45:08 +0000
committersethdelliott <devnull@localhost>2010-07-19 19:45:08 +0000
commit8430ad49e64446668b1305341129e173dc3c2eb0 (patch)
tree67f7bee713db89c20ecbcdd49e2b371fb7243e2c /src/iperf_error.c
parent7585c696384425a9cb193e78ce2f4b6b0c584056 (diff)
downloadiperf3-8430ad49e64446668b1305341129e173dc3c2eb0.tar.gz
Added iperf error code (iperf_error.*). Also added iperf_parse_parameters().
Diffstat (limited to 'src/iperf_error.c')
-rw-r--r--src/iperf_error.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/iperf_error.c b/src/iperf_error.c
new file mode 100644
index 0000000..a755b94
--- /dev/null
+++ b/src/iperf_error.c
@@ -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;
+ }
+}