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
00076 addr(std::istream&);
00077
00082 std::istream& read(std::istream&);
00083
00085
00086 bool operator < (const addr&) const;
00087 bool operator == (const addr&) const;
00088 bool operator != (const addr&) const;
00090
00092
00093 uint8_t& operator [] (unsigned);
00094 const uint8_t& operator [] (unsigned) const;
00096
00098 void dump(void *) const;
00099
00101 static const addr& null();
00102
00104 static const addr& broadcast();
00105
00106 private:
00107
00108 uint8_t addr_[6];
00109 };
00110
00112 std::ostream&
00113 operator << (std::ostream& os, const addr& a);
00114
00116 std::istream&
00117 operator >> (std::istream& is, addr& a);
00118
00120 std::string
00121 make_string(const addr& a);
00122
00123 }
00124
00125 # include "addr.hxx"
00126
00127 #endif // ! WIFI_ADDR_HH_