00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef WIFI_FRAME_SEQCTL_HH_
00023 # define WIFI_FRAME_SEQCTL_HH_
00024
00025 extern "C"
00026 {
00027 # include <inttypes.h>
00028 }
00029
00030 # include <string>
00031 # include <ostream>
00032
00033 namespace wpl
00034 {
00035
00036 namespace wifi
00037 {
00038
00040 struct seqnum
00041 {
00042 seqnum(unsigned value = 0);
00043
00044 unsigned get() const;
00045
00046 bool operator < (const seqnum& rhs) const;
00047 bool operator <= (const seqnum& rhs) const;
00048 bool operator > (const seqnum& rhs) const;
00049 bool operator >= (const seqnum& rhs) const;
00050 bool operator == (const seqnum& rhs) const;
00051 bool operator != (const seqnum& rhs) const;
00052
00053 int operator - (const seqnum& rhs) const;
00054
00055 private:
00056 unsigned v_;
00057 };
00058
00060 struct seqctl
00061 {
00062 seqctl(unsigned seqnum = 0, unsigned fragnum = 0);
00063 seqctl(const uint16_t raw);
00064 seqctl(const void* raw);
00065
00066 seqnum seqnum_get() const;
00067 unsigned fragnum_get() const;
00068
00069 bool operator < (const seqctl& rhs) const;
00070 bool operator <= (const seqctl& rhs) const;
00071 bool operator > (const seqctl& rhs) const;
00072 bool operator >= (const seqctl& rhs) const;
00073 bool operator == (const seqctl& rhs) const;
00074 bool operator != (const seqctl& rhs) const;
00075
00076 private:
00077 uint16_t seqctl_;
00078 };
00079
00082 std::ostream&
00083 operator << (std::ostream& os, const seqctl& a);
00084
00120 typedef boost::tuple<addr, addr, uint8_t> seqnum_counter_id;
00121
00124 std::string
00125 make_string(const seqctl& a);
00126
00127 }
00128
00129 }
00130
00131 # include "seqctl.hxx"
00132
00133 #endif // ! WIFI_FRAME_SEQCTL_HH_