00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef WIFI_ADDR_HH_
00023 # define WIFI_ADDR_HH_
00024
00025 extern "C"
00026 {
00027 # include <inttypes.h>
00028 }
00029
00030 # include <string>
00031 # include <ostream>
00032
00034 namespace wifi
00035 {
00036
00038 struct addr
00039 {
00041 addr();
00042
00055 addr(const void* a);
00056
00066 addr(const std::string&);
00067
00069
00070 bool operator < (const addr&) const;
00071 bool operator == (const addr&) const;
00072 bool operator != (const addr&) const;
00074
00076
00077 uint8_t& operator [] (unsigned);
00078 const uint8_t& operator [] (unsigned) const;
00080
00082 void dump(void *) const;
00083
00085 static const addr& null();
00086
00088 static const addr& broadcast();
00089
00090 private:
00091 uint8_t addr_[6];
00092 };
00093
00095 std::ostream&
00096 operator << (std::ostream& os, const addr& a);
00097
00099 std::string
00100 make_string(const addr& a);
00101
00102 }
00103
00104 # include "addr.hxx"
00105
00106 #endif // ! WIFI_ADDR_HH_