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
00066 template <class D1, class D2>
00067 static bool eq_time(const pcapxx::frame_descriptor<D1>& lhs,
00068 const pcapxx::frame_descriptor<D2>& rhs,
00069 tool::endian::endianness phy_end,
00070 unsigned prec);
00072
00074 uint64_t mactime_get() const;
00075
00077 uint64_t hosttime_get() const;
00078
00079 private:
00080 static uint64_t uint64_get(const void*);
00081
00082 public:
00083
00085 struct v2_extra_fields
00086 {
00087
00088 uint32_t sequence;
00089 uint32_t drops;
00090 uint8_t receiver_addr[6];
00091 uint8_t pad[2];
00092
00093 } __attribute__ ((__packed__));
00094
00095 uint32_t version;
00096 uint32_t length;
00097 uint64_t mactime;
00098 uint64_t hosttime;
00099 uint32_t phytype;
00100 uint32_t channel;
00101 uint32_t datarate;
00102 uint32_t antenna;
00103 uint32_t priority;
00104 uint32_t ssi_type;
00105 uint32_t ssi_signal;
00106 uint32_t ssi_noise;
00107 uint32_t preamble;
00108 uint32_t encoding;
00109 v2_extra_fields v2_fields[];
00110
00111 } __attribute__ ((__packed__));
00112
00113 }
00114
00115 # include "avs_header.hxx"
00116
00117 #endif // ! AVS_HEADER_HH_