1
1

specify client-side port: Only support --cport

Remove support for short-option -e

Signed-off-by: Kevin Constantine <kevin.constantine@gmail.com>
Этот коммит содержится в:
Kevin Constantine 2014-09-15 10:51:31 -07:00
родитель b7b1b32afe
Коммит 499b122230
3 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -584,7 +584,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
{"reverse", no_argument, NULL, 'R'},
{"window", required_argument, NULL, 'w'},
{"bind", required_argument, NULL, 'B'},
{"cport", required_argument, NULL, 'e'},
{"cport", required_argument, NULL, OPT_CLIENT_PORT},
{"set-mss", required_argument, NULL, 'M'},
{"no-delay", no_argument, NULL, 'N'},
{"version4", no_argument, NULL, '4'},
@ -625,7 +625,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
blksize = 0;
server_flag = client_flag = rate_flag = duration_flag = 0;
while ((flag = getopt_long(argc, argv, "p:f:i:DVJvsc:ub:t:n:k:l:P:Rw:B:e:M:N46S:L:ZO:F:A:T:C:dI:h", longopts, NULL)) != -1) {
while ((flag = getopt_long(argc, argv, "p:f:i:DVJvsc:ub:t:n:k:l:P:Rw:B:M:N46S:L:ZO:F:A:T:C:dI:h", longopts, NULL)) != -1) {
switch (flag) {
case 'p':
test->server_port = atoi(optarg);
@ -746,7 +746,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
case 'B':
test->bind_address = strdup(optarg);
break;
case 'e':
case OPT_CLIENT_PORT:
test->bind_port = atoi(optarg);
break;
case 'M':

Просмотреть файл

@ -30,6 +30,7 @@ struct iperf_stream;
#define OPT_LOGFILE 2
#define OPT_GET_SERVER_OUTPUT 3
#define OPT_UDP_COUNTERS_64BIT 4
#define OPT_CLIENT_PORT 5
/* states */
#define TEST_START 1

Просмотреть файл

@ -108,7 +108,7 @@ const char usage_longstr[] = "Usage: iperf [-s|-c host] [options]\n"
" -k, --blockcount #[KMG] number of blocks (packets) to transmit (instead of -t or -n)\n"
" -l, --len #[KMG] length of buffer to read or write\n"
" (default %d KB for TCP, %d KB for UDP)\n"
" -e, --cport <host> bind to a specific client port (default: ephemeral port)\n"
" --cport <port> bind to a specific client port (default: ephemeral port)\n"
" -P, --parallel # number of parallel client streams to run\n"
" -R, --reverse run in reverse mode (server sends, client receives)\n"
" -w, --window #[KMG] TCP window size (socket buffer size)\n"