Minor cleanup of "-h" output text.

svn path=/trunk/; revision=28334
This commit is contained in:
Bill Meier 2009-05-12 16:06:14 +00:00
parent 3c0d24f3cb
commit fa920e48ed
5 changed files with 73 additions and 68 deletions

View File

@ -124,10 +124,10 @@ print_stats(capture_info *cf_info)
if (cap_duration) print_value("Capture duration: ", 0, " seconds", cf_info->duration);
if (cap_start_time) printf ("Start time: %s", (cf_info->packet_count>0) ? ctime (&start_time_t) : "n/a\n");
if (cap_end_time) printf ("End time: %s", (cf_info->packet_count>0) ? ctime (&stop_time_t) : "n/a\n");
if (cap_data_rate_byte) print_value("Data byte rate: ", 2, " bytes/s", cf_info->data_rate);
if (cap_data_rate_bit) print_value("Data bit rate: ", 2, " bits/s", cf_info->data_rate*8);
if (cap_packet_size) printf ("Average packet size: %.2f bytes\n", cf_info->packet_size);
if (cap_packet_rate) print_value("Average packet rate: ", 2, " packets/s", cf_info->packet_rate);
if (cap_data_rate_byte) print_value("Data byte rate: ", 2, " bytes/sec", cf_info->data_rate);
if (cap_data_rate_bit) print_value("Data bit rate: ", 2, " bits/sec", cf_info->data_rate*8);
if (cap_packet_size) printf ("Average packet size: %.2f bytes\n", cf_info->packet_size);
if (cap_packet_rate) print_value("Average packet rate: ", 2, " packets/sec", cf_info->packet_rate);
}
static int
@ -259,20 +259,20 @@ usage(gboolean is_error)
fprintf(output, " -d display the total length of all packets (in bytes)\n");
fprintf(output, "\n");
fprintf(output, "Time:\n");
fprintf(output, " -u display the capture duration (in seconds) \n");
fprintf(output, " -u display the capture duration (in seconds)\n");
fprintf(output, " -a display the capture start time\n");
fprintf(output, " -e display the capture end time\n");
fprintf(output, "\n");
fprintf(output, "Statistic:\n");
fprintf(output, " -y display average data rate (in bytes/s)\n");
fprintf(output, " -i display average data rate (in bits/s)\n");
fprintf(output, " -y display average data rate (in bytes/sec)\n");
fprintf(output, " -i display average data rate (in bits/sec)\n");
fprintf(output, " -z display average packet size (in bytes)\n");
fprintf(output, " -x display average packet rate (in packets/s)\n");
fprintf(output, " -x display average packet rate (in packets/sec)\n");
fprintf(output, "\n");
fprintf(output, "Miscellaneous:\n");
fprintf(output, " -h display this help and exit\n");
fprintf(output, "\n");
fprintf(output, "If no options are given, default is to display all infos\n");
fprintf(output, "If no options are given the default is to display all infos\n");
}
#ifdef HAVE_PLUGINS

View File

@ -487,25 +487,26 @@ usage(void)
fprintf(stderr, "\n");
fprintf(stderr, "Usage: editcap [options] ... <infile> <outfile> [ <packet#>[-<packet#>] ... ]\n");
fprintf(stderr, "\n");
fprintf(stderr, "<infile> and <outfile> must both be present.\n");
fprintf(stderr, "A single packet or a range of packets can be selected.\n");
fprintf(stderr, "\n");
fprintf(stderr, "Packet selection:\n");
fprintf(stderr, " -r keep the selected packets, default is to delete them\n");
fprintf(stderr, " -r keep the selected packets; default is to delete them.\n");
fprintf(stderr, " -A <start time> don't output packets whose timestamp is before the\n");
fprintf(stderr, " given time (format as YYYY-MM-DD hh:mm:ss)\n");
fprintf(stderr, " given time (format as YYYY-MM-DD hh:mm:ss).\n");
fprintf(stderr, " -B <stop time> don't output packets whose timestamp is after the\n");
fprintf(stderr, " given time (format as YYYY-MM-DD hh:mm:ss)\n");
fprintf(stderr, " given time (format as YYYY-MM-DD hh:mm:ss).\n");
fprintf(stderr, "\n");
fprintf(stderr, "Duplicate packet removal:\n");
fprintf(stderr, " -d remove packet if duplicate (window == %d).\n", DEFAULT_DUP_DEPTH);
fprintf(stderr, " -D <dup window> remove packet if duplicate, configurable <dup window>.\n");
fprintf(stderr, " -D <dup window> remove packet if duplicate; configurable <dup window>\n");
fprintf(stderr, " Valid <dup window> values are 0 to %d.\n", MAX_DUP_DEPTH);
fprintf(stderr, " NOTE: A <dup window> of 0 with -v (verbose option) is\n");
fprintf(stderr, " useful to print MD5 hashes.\n");
fprintf(stderr, " -w <dup time window> remove packet if duplicate packet is found EQUAL TO OR\n");
fprintf(stderr, " LESS THAN <dup time window> prior to current packet.\n");
fprintf(stderr, " A <dup time window> is specified in relative seconds\n");
fprintf(stderr, " (e.g. 0.000001)\n");
fprintf(stderr, " (e.g. 0.000001).\n");
fprintf(stderr, "\n");
fprintf(stderr, " NOTE: The use of the 'Duplicate packet removal' options with\n");
fprintf(stderr, " other editcap options except -v may not always work as expected.\n");
@ -513,29 +514,29 @@ usage(void)
fprintf(stderr, " desired effect if combined with the -d, -D or -w.\n");
fprintf(stderr, "\n");
fprintf(stderr, "Packet manipulation:\n");
fprintf(stderr, " -s <snaplen> truncate each packet to max. <snaplen> bytes of data\n");
fprintf(stderr, " -C <choplen> chop each packet at the end by <choplen> bytes\n");
fprintf(stderr, " -t <time adjustment> adjust the timestamp of each packet,\n");
fprintf(stderr, " <time adjustment> is in relative seconds (e.g. -0.5)\n");
fprintf(stderr, " -s <snaplen> truncate each packet to max. <snaplen> bytes of data.\n");
fprintf(stderr, " -C <choplen> chop each packet at the end by <choplen> bytes.\n");
fprintf(stderr, " -t <time adjustment> adjust the timestamp of each packet;\n");
fprintf(stderr, " <time adjustment> is in relative seconds (e.g. -0.5).\n");
fprintf(stderr, " -E <error probability> set the probability (between 0.0 and 1.0 incl.)\n");
fprintf(stderr, " that a particular packet byte will be randomly changed\n");
fprintf(stderr, " that a particular packet byte will be randomly changed.\n");
fprintf(stderr, "\n");
fprintf(stderr, "Output File(s):\n");
fprintf(stderr, " -c <packets per file> split the packet output to different files,\n");
fprintf(stderr, " based on uniform packet counts \n");
fprintf(stderr, " with a maximum of <packets per file> each\n");
fprintf(stderr, " -i <seconds per file> split the packet output to different files,\n");
fprintf(stderr, " based on uniform time intervals \n");
fprintf(stderr, " with a maximum of <seconds per file> each\n");
fprintf(stderr, " -F <capture type> set the output file type, default is libpcap\n");
fprintf(stderr, " an empty \"-F\" option will list the file types\n");
fprintf(stderr, " -T <encap type> set the output file encapsulation type,\n");
fprintf(stderr, " default is the same as the input file\n");
fprintf(stderr, " an empty \"-T\" option will list the encapsulation types\n");
fprintf(stderr, " -c <packets per file> split the packet output to different files\n");
fprintf(stderr, " based on uniform packet counts\n");
fprintf(stderr, " with a maximum of <packets per file> each.\n");
fprintf(stderr, " -i <seconds per file> split the packet output to different files\n");
fprintf(stderr, " based on uniform time intervals\n");
fprintf(stderr, " with a maximum of <seconds per file> each.\n");
fprintf(stderr, " -F <capture type> set the output file type; default is libpcap.\n");
fprintf(stderr, " an empty \"-F\" option will list the file types.\n");
fprintf(stderr, " -T <encap type> set the output file encapsulation type;\n");
fprintf(stderr, " default is the same as the input file.\n");
fprintf(stderr, " an empty \"-T\" option will list the encapsulation types.\n");
fprintf(stderr, "\n");
fprintf(stderr, "Miscellaneous:\n");
fprintf(stderr, " -h display this help and exit\n");
fprintf(stderr, " -v verbose output\n");
fprintf(stderr, " -h display this help and exit.\n");
fprintf(stderr, " -v verbose output.\n");
fprintf(stderr, " If -v is used with any of the 'Duplicate Packet\n");
fprintf(stderr, " Removal' options (-d, -D or -w) then Packet lengths\n");
fprintf(stderr, " and MD5 hashes are printed to standard-out.\n");

View File

@ -95,22 +95,22 @@ usage(void)
fprintf(stderr, "Merge two or more capture files into one.\n");
fprintf(stderr, "See http://www.wireshark.org for more information.\n");
fprintf(stderr, "\n");
fprintf(stderr, "Usage: mergecap [options] -w <outfile|-> <infile> ...\n");
fprintf(stderr, "Usage: mergecap [options] -w <outfile>|- <infile> ...\n");
fprintf(stderr, "\n");
fprintf(stderr, "Output:\n");
fprintf(stderr, " -a files should be concatenated, not merged\n");
fprintf(stderr, " Default merges based on frame timestamps\n");
fprintf(stderr, " -s <snaplen> truncate packets to <snaplen> bytes of data\n");
fprintf(stderr, " -w <outfile|-> set the output filename to <outfile> or '-' for stdout\n");
fprintf(stderr, " -F <capture type> set the output file type, default is libpcap\n");
fprintf(stderr, " an empty \"-F\" option will list the file types\n");
fprintf(stderr, " -T <encap type> set the output file encapsulation type,\n");
fprintf(stderr, " default is the same as the first input file\n");
fprintf(stderr, " an empty \"-T\" option will list the encapsulation types\n");
fprintf(stderr, " -a concatenate rather than merge files.\n");
fprintf(stderr, " default is to merge based on frame timestamps.\n");
fprintf(stderr, " -s <snaplen> truncate packets to <snaplen> bytes of data.\n");
fprintf(stderr, " -w <outfile>|- set the output filename to <outfile> or '-' for stdout.\n");
fprintf(stderr, " -F <capture type> set the output file type; default is libpcap.\n");
fprintf(stderr, " an empty \"-F\" option will list the file types.\n");
fprintf(stderr, " -T <encap type> set the output file encapsulation type;\n");
fprintf(stderr, " default is the same as the first input file.\n");
fprintf(stderr, " an empty \"-T\" option will list the encapsulation types.\n");
fprintf(stderr, "\n");
fprintf(stderr, "Miscellaneous:\n");
fprintf(stderr, " -h display this help and exit\n");
fprintf(stderr, " -v verbose output\n");
fprintf(stderr, " -h display this help and exit.\n");
fprintf(stderr, " -v verbose output.\n");
}
static void list_capture_types(void) {

View File

@ -216,7 +216,7 @@ print_usage(gboolean print_ver)
/*fprintf(output, "\n");*/
fprintf(output, "Output:\n");
fprintf(output, " -S format string for fields (%%D - name, %%S - stringval, %%N numval\n");
fprintf(output, " -S format string for fields (%%D - name, %%S - stringval, %%N numval)\n");
fprintf(output, " -t ad|a|r|d|dd|e output format of time stamps (def: r: rel. to first)\n");
fprintf(output, " -l flush output after each packet\n");

View File

@ -1034,15 +1034,15 @@ usage (void)
"Generate a capture file from an ASCII hexdump of packets.\n"
"See http://www.wireshark.org for more information.\n"
"\n"
"Usage: text2pcap [options] <input-filename> <output-filename>\n"
"Usage: text2pcap [options] <infile> <outfile>\n"
"\n"
"where <input-filename> specifies input filename (use - for standard input)\n"
" <output-filename> specifies output filename (use - for standard output)\n"
"where <infile> specifies input filename (use - for standard input)\n"
" <outfile> specifies output filename (use - for standard output)\n"
"\n"
"Input:\n"
" -o hex|oct|dec parse offsets as (h)ex, (o)ctal or (d)ecimal, default is hex\n"
" -t <timefmt> treats the text before the packet as a date/time code;\n"
" the specified argument is a format string of the sort \n"
" -o hex|oct|dec parse offsets as (h)ex, (o)ctal or (d)ecimal; default is hex.\n"
" -t <timefmt> treat the text before the packet as a date/time code;\n"
" the specified argument is a format string of the sort\n"
" supported by strptime.\n"
" Example: The time \"10:15:14.5476\" has the format code\n"
" \"%%H:%%M:%%S.\"\n"
@ -1053,40 +1053,44 @@ usage (void)
" used as the default for unspecified fields.\n"
"\n"
"Output:\n"
" -l <typenum> link-layer type number. Default is 1 (Ethernet). \n"
" -l <typenum> link-layer type number; default is 1 (Ethernet).\n"
" See the file net/bpf.h for list of numbers.\n"
" -m <max-packet> max packet length in output, default is %d\n"
" Use this option if your dump is a complete hex dump\n"
" of an encapsulated packet and you wish to specify\n"
" the exact type of encapsulation.\n"
" Example: -l 7 for ARCNet packets.\n"
" -m <max-packet> max packet length in output; default is %d\n"
"\n"
"Prepend dummy header:\n"
" -e <l3pid> prepend dummy Ethernet II header with specified L3PID\n"
" (in HEX)\n"
" Example: -e 0x800\n"
" (in HEX).\n"
" Example: -e 0x806 to specify an ARP packet.\n"
" -i <proto> prepend dummy IP header with specified IP protocol\n"
" (in DECIMAL). \n"
" (in DECIMAL).\n"
" Automatically prepends Ethernet header as well.\n"
" Example: -i 46\n"
" -u <srcp>,<destp> prepend dummy UDP header with specified\n"
" dest and source ports (in DECIMAL).\n"
" Automatically prepends Ethernet & IP headers as well\n"
" Example: -u 30,40\n"
" -T <srcp>,<destp> prepend dummy TCP header with specified \n"
" Automatically prepends Ethernet & IP headers as well.\n"
" Example: -u 1000 69 to make the packets look like TFTP/UDP packets.\n"
" -T <srcp>,<destp> prepend dummy TCP header with specified\n"
" dest and source ports (in DECIMAL).\n"
" Automatically prepends Ethernet & IP headers as well\n"
" Automatically prepends Ethernet & IP headers as well.\n"
" Example: -T 50,60\n"
" -s <srcp>,<dstp>,<tag> prepend dummy SCTP header with specified \n"
" -s <srcp>,<dstp>,<tag> prepend dummy SCTP header with specified\n"
" dest/source ports and verification tag (in DECIMAL).\n"
" Automatically prepends Ethernet & IP headers as well\n"
" Automatically prepends Ethernet & IP headers as well.\n"
" Example: -s 30,40,34\n"
" -S <srcp>,<dstp>,<ppi> prepend dummy SCTP header with specified \n"
" dest/source ports and verification tag 0. \n"
" It also prepends a dummy SCTP DATA \n"
" -S <srcp>,<dstp>,<ppi> prepend dummy SCTP header with specified\n"
" dest/source ports and verification tag 0.\n"
" Automatically prepends a dummy SCTP DATA\n"
" chunk header with payload protocol identifier ppi.\n"
" Example: -S 30,40,34\n"
"\n"
"Miscellaneous:\n"
" -h display this help and exit\n"
" -d detailed debug of parser states \n"
" -q generate no output at all (automatically turns off -d)\n"
" -h display this help and exit.\n"
" -d show detailed debug of parser states.\n"
" -q generate no output at all (automatically turns off -d).\n"
"",
VERSION, MAX_PACKET);