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_FILTER_UNIQUELY_IDENTIFIABLE_HXX_
00023 # define WIFI_FRAME_FILTER_UNIQUELY_IDENTIFIABLE_HXX_
00024
00025 # include <trace-tools/wifi/frame/dissector/dissector.hh>
00026
00027 namespace wifi
00028 {
00029 namespace frame
00030 {
00031 namespace filter
00032 {
00033
00034 namespace internals
00035 {
00036
00037 template <class UniqueId>
00038 ui_iterator_value_type<UniqueId>::
00039 ui_iterator_value_type(const UniqueId& i,
00040 const tool::microseconds& m):
00041 UniqueId (i),
00042 microseconds_ (m)
00043 {
00044 }
00045
00046 template <class UniqueId>
00047 const tool::microseconds&
00048 ui_iterator_value_type<UniqueId>::microseconds() const
00049 {
00050 return microseconds_;
00051 }
00052
00053 template <class U, class I, class H, class B1, class B2>
00054 ui_iterator<U, I, H, B1, B2>::ui_iterator(iterable_type& uif,
00055 bool end):
00056 tool::iterator_base<exact_type> (uif, end)
00057 {
00058 }
00059
00060 template <class U, class I, class H, class B1, class B2>
00061 void
00062 ui_iterator<U, I, H, B1, B2>::increment()
00063 {
00064 typedef typename exact_type::value_type value_type;
00065
00066 uniquely_identifiable<U, I, H, B1>& iterable = *(this->i_);
00067 I& next = iterable.next_;
00068 boost::optional<U> id;
00069
00070 while (next != iterable.end_ and not id)
00071 {
00072 const H* h = reinterpret_cast<const H*> (next->bytes().get());
00073
00074 iterable.mactime_.tick(h, next->pcap_header()->caplen);
00075 id = make_unique_id<U, H>(*next, *iterable.mapping_,
00076 iterable.
00077 prism_header_noise_means_error);
00078 ++next;
00079 }
00080 if (id)
00081 this->v_ =
00082 typename exact_type::value_type (id.get(), iterable.mactime_);
00083 else
00084 this->v_ = boost::none_t ();
00085 }
00086
00087 }
00088
00089 template <class U, class I, class H, class B>
00090 uniquely_identifiable<U, I, H, B>::uniquely_identifiable(const I& begin,
00091 const I& end,
00092 addr_mapping&
00093 mapping):
00094 prism_header_noise_means_error (false),
00095 next_ (begin),
00096 end_ (end),
00097 mapping_ (&mapping),
00098 mactime_ ()
00099 {
00100 }
00101
00102 }
00103
00104 }
00105
00106 }
00107
00108 #endif // ! WIFI_FRAME_FILTER_UNIQUELY_IDENTIFIABLE_HXX_