Merged print mss (-m) into verbose mode (-V)
Этот коммит содержится в:
родитель
9a599d5f8d
Коммит
02a35f07e3
@ -30,9 +30,6 @@ set server port to listen on/connect to to \fIn\fR (default 5201)
|
||||
.BR -i ", " --interval " \fIn\fR"
|
||||
pause \fIn\fR seconds between periodic bandwidth reports
|
||||
.TP
|
||||
.BR -m ", " --print_mss " "
|
||||
print TCP maximum segment size (MTU - TCP/IP header)
|
||||
.TP
|
||||
.BR -h ", " --help " "
|
||||
print a help synopsis
|
||||
.TP
|
||||
|
@ -131,7 +131,6 @@ struct iperf_test
|
||||
int debug; /* -d option - debug mode */
|
||||
int no_delay; /* -N option */
|
||||
int output_format; /* -O option */
|
||||
int print_mss; /* -m option */
|
||||
int reverse; /* -R option */
|
||||
int tcp_info; /* -T option - display getsockopt(TCP_INFO) results. */
|
||||
int v6domain; /* -6 option */
|
||||
|
@ -124,7 +124,7 @@ iperf_on_connect(struct iperf_test *test)
|
||||
char ipr[INET6_ADDRSTRLEN];
|
||||
struct sockaddr_storage temp;
|
||||
socklen_t len;
|
||||
int domain;
|
||||
int domain, opt;
|
||||
|
||||
if (test->role == 'c') {
|
||||
printf("Connecting to host %s, port %d\n", test->server_hostname,
|
||||
@ -143,6 +143,15 @@ iperf_on_connect(struct iperf_test *test)
|
||||
}
|
||||
if (test->verbose) {
|
||||
printf(" Cookie: %s\n", test->cookie);
|
||||
if (test->protocol->id == SOCK_STREAM) {
|
||||
if (test->settings->mss) {
|
||||
printf(" TCP MSS: %d\n", test->settings->mss);
|
||||
} else {
|
||||
len = sizeof(opt);
|
||||
getsockopt(test->ctrl_sck, IPPROTO_TCP, TCP_MAXSEG, &opt, &len);
|
||||
printf(" TCP MSS: %d (default)\n", opt);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -177,7 +186,6 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
|
||||
{"interval", required_argument, NULL, 'i'},
|
||||
{"bytes", required_argument, NULL, 'n'},
|
||||
{"NoDelay", no_argument, NULL, 'N'},
|
||||
{"Print-mss", no_argument, NULL, 'm'},
|
||||
{"Set-mss", required_argument, NULL, 'M'},
|
||||
{"version", no_argument, NULL, 'v'},
|
||||
{"verbose", no_argument, NULL, 'V'},
|
||||
@ -199,7 +207,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
|
||||
};
|
||||
char ch;
|
||||
|
||||
while ((ch = getopt_long(argc, argv, "c:p:st:uP:B:b:l:w:i:n:mRS:NTvh6VdM:f:", longopts, NULL)) != -1) {
|
||||
while ((ch = getopt_long(argc, argv, "c:p:st:uP:B:b:l:w:i:n:RS:NTvh6VdM:f:", longopts, NULL)) != -1) {
|
||||
switch (ch) {
|
||||
case 'c':
|
||||
if (test->role == 's') {
|
||||
@ -303,9 +311,6 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
|
||||
}
|
||||
test->settings->bytes = unit_atoi(optarg);
|
||||
break;
|
||||
case 'm':
|
||||
test->print_mss = 1;
|
||||
break;
|
||||
case 'N':
|
||||
if (test->role == 's') {
|
||||
i_errno = IECLIENTONLY;
|
||||
@ -830,7 +835,6 @@ parse_results(struct iperf_test *test, char *results)
|
||||
for (strp = results; *strp; strp = strchr(strp, '\n')+1) {
|
||||
sscanf(strp, "%d:%llu,%lf,%d,%d\n", &sid, &bytes_transferred, &jitter,
|
||||
&cerror, &pcount);
|
||||
// for (sp = test->streams; sp; sp = sp->next)
|
||||
SLIST_FOREACH(sp, &test->streams, streams)
|
||||
if (sp->id == sid) break;
|
||||
if (sp == NULL) {
|
||||
@ -1146,7 +1150,6 @@ iperf_reporter_callback(struct iperf_test * test)
|
||||
case TEST_RUNNING:
|
||||
case STREAM_RUNNING:
|
||||
/* print interval results for each stream */
|
||||
// for (sp = test->streams; sp != NULL; sp = sp->next) {
|
||||
SLIST_FOREACH(sp, &test->streams, streams) {
|
||||
print_interval_results(test, sp);
|
||||
bytes += sp->result->interval_results->bytes_transferred; /* sum up all streams */
|
||||
@ -1182,7 +1185,6 @@ iperf_reporter_callback(struct iperf_test * test)
|
||||
start_time = 0.;
|
||||
sp = SLIST_FIRST(&test->streams);
|
||||
end_time = timeval_diff(&sp->result->start_time, &sp->result->end_time);
|
||||
// for (sp = test->streams; sp != NULL; sp = sp->next) {
|
||||
SLIST_FOREACH(sp, &test->streams, streams) {
|
||||
bytes_sent = sp->result->bytes_sent;
|
||||
bytes_received = sp->result->bytes_received;
|
||||
@ -1244,11 +1246,6 @@ iperf_reporter_callback(struct iperf_test * test)
|
||||
printf(report_sum_bw_jitter_loss_format, start_time, end_time, ubuf, nbuf, avg_jitter,
|
||||
lost_packets, total_packets, (double) (100.0 * lost_packets / total_packets));
|
||||
}
|
||||
|
||||
// XXX: Why is this here?
|
||||
if ((test->print_mss != 0) && (test->role == 'c')) {
|
||||
printf("The TCP maximum segment size mss = %d\n", getsock_tcp_mss(sp->socket));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -391,10 +391,7 @@ iperf_run_server(struct iperf_test *test)
|
||||
}
|
||||
}
|
||||
|
||||
/* Clean up the last test */
|
||||
//iperf_test_reset(test);
|
||||
//printf("\n");
|
||||
|
||||
/* Close open test sockets */
|
||||
close(test->ctrl_sck);
|
||||
close(test->listener);
|
||||
|
||||
|
@ -132,7 +132,6 @@ iperf_tcp_listen(struct iperf_test *test)
|
||||
i_errno = IESETNODELAY;
|
||||
return (-1);
|
||||
}
|
||||
printf(" TCP NODELAY: on\n");
|
||||
}
|
||||
// XXX: Setting MSS is very buggy!
|
||||
if ((opt = test->settings->mss)) {
|
||||
@ -140,7 +139,6 @@ iperf_tcp_listen(struct iperf_test *test)
|
||||
i_errno = IESETMSS;
|
||||
return (-1);
|
||||
}
|
||||
printf(" TCP MSS: %d\n", opt);
|
||||
}
|
||||
if ((opt = test->settings->socket_bufsize)) {
|
||||
if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, &opt, sizeof(opt)) < 0) {
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user