diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | latency.c | 7 |
2 files changed, 8 insertions, 1 deletions
@@ -19,6 +19,8 @@ Currently requires root privileges as use tun/tap. * `--port` *port*: specify the port to use for client/server. The default is `61234`. + * `--cap-file` *filename*: + specify a file name to write captured packets (in tcpdump/pcap format). * `--help`: show usage help. @@ -66,6 +66,7 @@ usage(bool error) "Options:\n" " -h, --help Show this help\n" " --port <PORT> Specify port to use (default 61234)\n" + " --cap-file <FN> Specify a capture file\n" ); exit(error ? EXIT_FAILURE : EXIT_SUCCESS); } @@ -116,11 +117,12 @@ main(int argc, char **argv) } enum { MODE_local, MODE_server, MODE_client } mode = MODE_local; - enum { ARG_port = 256, ARG_client, ARG_server }; + enum { ARG_port = 256, ARG_client, ARG_server, ARG_capfile }; static struct option long_options[] = { {"client", required_argument, 0, ARG_client }, {"server", no_argument, 0, ARG_server }, {"port", required_argument, 0, ARG_port }, + {"cap-file",required_argument, 0, ARG_capfile }, {"help", no_argument, 0, 'h' }, {0, 0, 0, 0 } }; @@ -146,6 +148,9 @@ main(int argc, char **argv) case ARG_port: str_port = optarg; break; + case ARG_capfile: + tun_log_filename = optarg; + break; default: usage(true); } |