00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef TOOL_ARGS_HH_
00023 # define TOOL_ARGS_HH_
00024
00025 # include <vector>
00026 # include <string>
00027 # include <set>
00028 # include <utility>
00029
00030 # include <wipal/tool/options.hh>
00031 # include <wipal/pcap/descriptor.hh>
00032
00033
00034
00035
00036
00037
00038 # define WP_ARGS_OPTIONS \
00039 ((8, "Only compare 802.11 frames (no PHY header, no PCAP).")) \
00040 ((a, ("Attributes for unique frames identification (default: " + \
00041 def::attributes() + ")."))) \
00042 ((b, "Only compare frame bytes (no PCAP header).")) \
00043 ((c, "Do not print column headers (default if output is not a tty).")) \
00044 ((C, "Print column headers (default if output is a tty).")) \
00045 ((d, "Compare everything: PCAP data and bytes (default).")) \
00046 ((e, "Do not print error values (default).")) \
00047 ((E, "Print error values.")) \
00048 ((g, "Print debug information.")) \
00049 ((h, "Print this help.")) \
00050 ((i, "Do not print frame indices.")) \
00051 ((I, "Print frame indices (default).")) \
00052 ((m, ("MAC addresses mapping file (default: " + def::mac_map() + ")."))) \
00053 ((n, "Force little endian for PHY headers.")) \
00054 ((N, "Force big endian for PHY headers.")) \
00055 ((o, "Compare everything and count how many bytes differ.")) \
00056 ((p, "Prism noise fields have no special meaning (default).")) \
00057 ((P, "Consider a non-zero Prism noise field as a PHY error.")) \
00058 ((q, "Quiet ; produce minimal output (no column headers, etc.).")) \
00059 ((r, "Ignore reference. Blacklist a given x-y reference frame.")) \
00060 ((s, ("ESSID mapping file (default: " + def::essid_map() + ")."))) \
00061 ((t, "Compare 802.11 frames and time of arrival. " \
00062 "Use a precision of 106us.")) \
00063 ((u, "Do not print microseconds (default).")) \
00064 ((U, "Print microseconds.")) \
00065 ((v, "Print version information."))
00066
00067
00068
00069
00070
00071
00072 # define WP_ATTR_HELP_hsh "Hash frame using MD5."
00073 # define WP_ATTR_HELP_tmp "Use frame timestamp only."
00074 # define WP_ATTR_HELP_dst_tmp "Use dst. + timestamp."
00075 # define WP_ATTR_HELP_src_tmp "Use src. + timestamp."
00076 # define WP_ATTR_HELP_bss_tmp "Use BSSID + timestamp."
00077 # define WP_ATTR_HELP_src_bss_tmp "Use src. + BSSID + timestamp."
00078 # define WP_ATTR_HELP_seq_tmp "Use SeqCtl + timestamp."
00079 # define WP_ATTR_HELP_seq_bss_tmp "Use SeqCtl + BSSID + timestamp."
00080 # define WP_ATTR_HELP_seq_dst_bss_tmp "Use SeqCtl + dst. + BSSID + timestamp."
00081 # define WP_ATTR_HELP_seq_src_bss_tmp "Use SeqCtl + src. + BSSID + timestamp."
00082
00083
00084 namespace tool
00085 {
00086
00087 namespace args
00088 {
00089 typedef std::vector<std::string> input;
00090 typedef std::vector<std::string> output;
00091
00092 enum comp_method
00093 {
00094 cmp_default,
00095 cmp_802,
00096 cmp_bytes,
00097 cmp_time,
00098 cmp_score
00099 };
00100
00101 enum count
00102 {
00103 none = 0,
00104 arbitrary = 8,
00105 };
00106
00107 void
00108 parse(int argc,
00109 char* const* argv,
00110 opt::list& opts,
00111 count ninputs,
00112 count noutputs);
00113
00114 template <class Fun>
00115 int
00116 dispatch_unique_id(opt::list& options, Fun fun);
00117
00118 void
00119 unsupported_linktype(const pcapxx::descriptor<>::link_type lt);
00120
00122 namespace def
00123 {
00124
00125 endian::endianness endianness();
00126 std::set< std::pair<unsigned, unsigned> > ref_blacklist();
00127 undefined_type mapping();
00128 bool ignore_noisy_prism();
00129 std::string mac_map();
00130 std::string essid_map();
00131 std::string attributes();
00132 comp_method cmp();
00133 bool ui_errors();
00134 bool ui_indices();
00135 bool ui_headers();
00136 bool ui_microseconds();
00137 bool ui_summary();
00138
00139 }
00140
00141 }
00142
00143 }
00144
00145 # include "args.hxx"
00146
00147 #endif // TOOL_ARGS_HH_