Added warning() function for iperf warnings. Using --server and --udp now gives a warning instead of an error.

This commit is contained in:
sethdelliott 2011-03-10 15:56:17 +00:00
parent ad426c6fd4
commit f970ce8ecd
2 changed files with 10 additions and 0 deletions

View File

@ -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;

View File

@ -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 *);