00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef TOOL_TT_OPTIONS_HH_
00023 # define TOOL_TT_OPTIONS_HH_
00024
00025 # include <vector>
00026 # include <string>
00027
00028 # include <trace-tools/tool/endianness.hh>
00029
00030 # define tt_opt_none ""
00031 # define tt_opt_802cmp "8"
00032 # define tt_opt_attr "a:"
00033 # define tt_opt_bytescmp "b"
00034 # define tt_opt_colheads "cC"
00035 # define tt_opt_defaultcmp "d"
00036 # define tt_opt_errs "eE"
00037 # define tt_opt_help "h"
00038 # define tt_opt_frm_idx "iI"
00039 # define tt_opt_mapping "m:"
00040 # define tt_opt_endianness "nN"
00041 # define tt_opt_prism_noise "pP"
00042 # define tt_opt_quiet "q"
00043 # define tt_opt_timecmp "t"
00044 # define tt_opt_usec "uU"
00045 # define tt_opt_version "v"
00046
00047 # define tt_help_make(L, M) " -" #L " " M "\n"
00048
00049 # define tt_help_802cmp \
00050 tt_help_make(8, "Only compare 802.11 frames (no Prism, no PCAP).")
00051
00052 # define tt_help_attr \
00053 tt_help_make(a, "Attributes for unique frames identification " \
00054 "(default: " tt_attr_default ").")
00055
00056 # define tt_help_bytescmp \
00057 tt_help_make(b, "Only compare frame bytes (no PCAP header).")
00058
00059 # define tt_help_colheads \
00060 tt_help_make(c, "Do not print column headers " \
00061 "(default if output is not a tty).") \
00062 tt_help_make(C, "Print column headers (default if output is a tty).")
00063
00064 # define tt_help_defaultcmp \
00065 tt_help_make(d, "Compare everything: PCAP data and bytes (default).")
00066
00067 # define tt_help_errs \
00068 tt_help_make(e, "Do not print error values (default).") \
00069 tt_help_make(E, "Print error values.")
00070
00071 # define tt_help_help \
00072 tt_help_make(h, "Print this help.")
00073
00074 # define tt_help_frm_idx \
00075 tt_help_make(i, "Do not print frame indices.") \
00076 tt_help_make(I, "Print frame indices (default).")
00077
00078 # define tt_help_mapping \
00079 tt_help_make(m, "MAC addresses mapping file " \
00080 "(default: " tt_mapping_default ").")
00081
00082 # define tt_help_endianness \
00083 tt_help_make(n, "Force little endian for PHY headers.") \
00084 tt_help_make(N, "Force big endian for PHY headers.")
00085
00086 # define tt_help_prism_noise \
00087 tt_help_make(p, "Prism noise fields have no special meaning (default).") \
00088 tt_help_make(P, "Consider a non-zero Prism noise field as a PHY error.")
00089
00090 # define tt_help_quiet \
00091 tt_help_make(q, "Quiet ; produce minimal output (no column headers, etc.).")
00092
00093 # define tt_help_timecmp \
00094 tt_help_make(t, "Assume Prism headers and compare 802.11 frames, host time, " \
00095 "and MAC time. Use a precision of 40us.")
00096
00097 # define tt_help_usec \
00098 tt_help_make(u, "Do not print microseconds (default).") \
00099 tt_help_make(U, "Print microseconds.")
00100
00101 # define tt_help_version \
00102 tt_help_make(v, "Print version information.")
00103
00104 # define tt_attr_dst_tmp "dest-timestamp"
00105 # define tt_attr_src_tmp "source-timestamp"
00106 # define tt_attr_bss_tmp "bssid-timestamp"
00107 # define tt_attr_src_bss_tmp "source-bssid-timestamp"
00108 # define tt_attr_seq_bss_tmp "seqctl-bssid-timestamp"
00109 # define tt_attr_seq_dst_bss_tmp "seqctl-dest-bssid-timestamp"
00110
00111 # define tt_attr_default tt_attr_seq_dst_bss_tmp
00112 # define tt_mapping_default "mapping"
00113
00114 namespace tool
00115 {
00116
00117 namespace opt
00118 {
00119
00120 struct options
00121 {
00122 typedef std::vector<std::string> input_type;
00123 typedef std::vector<std::string> output_type;
00124
00125 enum
00126 {
00127 no_input = 0,
00128 no_output = 0,
00129 arbitrary_number_of_inputs = 8,
00130 arbitrary_number_of_outputs = 8,
00131 };
00132
00133 enum comp_method
00134 {
00135 cmp_default,
00136 cmp_802,
00137 cmp_bytes,
00138 cmp_time
00139 };
00140
00141 input_type input;
00142 output_type output;
00143 std::string mapping;
00144 std::string attributes;
00145 endian::endianness endianness;
00146
00147 comp_method cmp;
00148 bool prism_noise_means_error;
00149 bool print_column_headers;
00150 bool print_errors;
00151 bool print_frame_indices;
00152 bool print_microseconds;
00153 bool print_summary;
00154 };
00155
00156 options parse_args(int argc, char* const* argv,
00157 const std::string& available_options,
00158 int ninputs, int noutputs);
00159
00160 }
00161
00162 }
00163
00164 # include "tt_options.hxx"
00165
00166 #endif // TOOL_TT_OPTIONS_HH_