From: Guy Harris Date: Fri, 2 May 2014 06:20:21 +0000 (-0700) Subject: Sort options and put in notes for unusable option letters. X-Git-Tag: tcpdump-4.6.0~46 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/d6c4d01f8d8b51694435043abe6d34b4364e34d8 Sort options and put in notes for unusable option letters. Sort the options alphabetically, and put in comments for the options we're *currently* not using, to note that other versions of tcpdump use them and that we should only use them for the same purposes. --- diff --git a/tcpdump.c b/tcpdump.c index cd022ad8..85ceafb2 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -614,11 +614,15 @@ static struct option longopts[] = { { NULL, required_argument, NULL, 'C' }, { NULL, no_argument, NULL, 'd' }, { NULL, no_argument, NULL, 'D' }, - { NULL, no_argument, NULL, 'L' }, { NULL, no_argument, NULL, 'e' }, { NULL, required_argument, NULL, 'E' }, { NULL, no_argument, NULL, 'f' }, { NULL, required_argument, NULL, 'F' }, + /* + * NOTE: OS X tcpdump uses -g; we shouldn't use it except for + * the same purpose (forcing non--v output for IP to be on one + * line, making it more "g"repable). + */ { NULL, required_argument, NULL, 'G' }, { NULL, no_argument, NULL, 'h' }, { NULL, no_argument, NULL, 'H' }, @@ -630,14 +634,28 @@ static struct option longopts[] = { { NULL, required_argument, NULL, 'j' }, { NULL, no_argument, NULL, 'J' }, #endif - { NULL, no_argument, NULL, 'l' }, + /* + * NOTE: OS X tcpdump uses -k; we shouldn't use it except for + * the same purpose (printing packet comments in pcap-ng files). + */ { NULL, no_argument, NULL, 'K' }, + { NULL, no_argument, NULL, 'l' }, + { NULL, no_argument, NULL, 'L' }, { NULL, required_argument, NULL, 'm' }, { NULL, required_argument, NULL, 'M' }, { NULL, no_argument, NULL, 'n' }, { NULL, no_argument, NULL, 'N' }, + /* + * NOTE: OpenBSD tcpdump uses -o; we shouldn't use it except for + * the same purpose (trying to do OS fingerprinting for + * hosts sending TCP SYN packets). + */ { NULL, no_argument, NULL, 'O' }, { NULL, no_argument, NULL, 'p' }, + /* + * NOTE: OS X tcpdump uses -P; we shouldn't use it except for + * the same purpose (writing pcap-ng rather than pcap files). + */ { NULL, no_argument, NULL, 'q' }, #ifdef HAVE_PCAP_SETDIRECTION { NULL, required_argument, NULL, 'Q' },