From f970ce8ecd1efe4be650073b89c6bcfd404d7fd5 Mon Sep 17 00:00:00 2001 From: sethdelliott Date: Thu, 10 Mar 2011 15:56:17 +0000 Subject: [PATCH] Added warning() function for iperf warnings. Using --server and --udp now gives a warning instead of an error. --- src/iperf_api.c | 9 +++++++++ src/iperf_api.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/iperf_api.c b/src/iperf_api.c index 11a9c70..a178adb 100644 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -59,6 +59,12 @@ usage_long() } +void warning(char *str) +{ + fprintf(stderr, "warning: %s\n", str); +} + + /********************** Get/set test protocol structure ***********************/ struct protocol * @@ -242,8 +248,11 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) break; case 'u': if (test->role == 's') { + warning("ignoring client only argument --udp (-u)"); + /* XXX: made a warning i_errno = IECLIENTONLY; return (-1); + */ } set_protocol(test, Pudp); test->settings->blksize = DEFAULT_UDP_BLKSIZE; diff --git a/src/iperf_api.h b/src/iperf_api.h index 60ac67e..d2e49d9 100644 --- a/src/iperf_api.h +++ b/src/iperf_api.h @@ -99,6 +99,7 @@ int iperf_recv(struct iperf_test *); void sig_handler(int); void usage(); void usage_long(); +void warning(char *); int all_data_sent(struct iperf_test *); int package_parameters(struct iperf_test *); int parse_parameters(struct iperf_test *);