00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AVS_HEADER_HH_
00023 # define AVS_HEADER_HH_
00024
00025 # include <wipal/phy/phy.hh>
00026
00027
00028 namespace avs
00029 {
00030 struct header;
00031 }
00032
00033
00034
00035 namespace tool
00036 {
00037
00038 template <>
00039 struct types<avs::header>
00040 {
00041 typedef phy::uint64_time<> time_type;
00042 };
00043
00044 }
00045
00046
00047
00048
00050 namespace avs
00051 {
00052
00054 struct header: public phy::header<avs::header>
00055 {
00056
00058
00059 typedef avs::header exact_type;
00060 typedef WP_TYPE_(time_type, exact_type) time_type;
00061
00062 size_t len_impl(size_t, bool) const;
00063 time_type time_get_impl(bool) const;
00064 void time_set_impl(const time_type&, bool);
00065 static bool eq_time(const pcapxx::frame_descriptor& lhs,
00066 const pcapxx::frame_descriptor& rhs,
00067 tool::endian::endianness phy_end,
00068 unsigned prec);
00070
00072 uint64_t mactime_get() const;
00073
00075 uint64_t hosttime_get() const;
00076
00077 private:
00078 static uint64_t uint64_get(const void*);
00079
00080 public:
00081
00083 struct v2_extra_fields
00084 {
00085
00086 uint32_t sequence;
00087 uint32_t drops;
00088 uint8_t receiver_addr[6];
00089 uint8_t pad[2];
00090
00091 } __attribute__ ((__packed__));
00092
00093 uint32_t version;
00094 uint32_t length;
00095 uint64_t mactime;
00096 uint64_t hosttime;
00097 uint32_t phytype;
00098 uint32_t channel;
00099 uint32_t datarate;
00100 uint32_t antenna;
00101 uint32_t priority;
00102 uint32_t ssi_type;
00103 uint32_t ssi_signal;
00104 uint32_t ssi_noise;
00105 uint32_t preamble;
00106 uint32_t encoding;
00107 v2_extra_fields v2_fields[];
00108
00109 } __attribute__ ((__packed__));
00110
00111 }
00112
00113 # include "avs_header.hxx"
00114
00115 #endif // ! AVS_HEADER_HH_