18 #include <boost/io/ios_state.hpp> 26 os <<
" version : " << p.
version() << std::endl
27 <<
" type : " << p.
type() << std::endl
28 <<
" subtype : " << p.
subtype() << std::endl
30 if ( p.
toDS() ) os <<
" toDS";
31 if ( p.
fromDS() ) os <<
" fromDS";
32 if ( p.
moreFrag() ) os <<
" moreFrag";
33 if ( p.
retry() ) os <<
" retry";
34 if ( p.
pwrMgt() ) os <<
" pwrMgt";
35 if ( p.
moreData() ) os <<
" moreData";
37 if ( p.
order() ) os <<
" order";
43 <<
" duration : " << p.
duration() << std::endl;
58 boost::io::ios_all_saver ias(os);
59 os <<
"802.11 MAC Management Frame:\n";
61 os <<
senf::fieldName(
"destination") << p->destinationAddress() << std::endl
64 <<
senf::fieldName(
"sequence number") << p->sequenceNumber() << std::endl
65 <<
senf::fieldName(
"fragment number") << p->fragmentNumber() << std::endl;
73 boost::io::ios_all_saver ias(os);
74 os <<
"802.11 MAC Control Frame:\n";
131 boost::io::ios_all_saver ias(os);
132 os <<
"802.11 MAC Data Frame:\n";
135 if (p->dsBits()==0 || p->dsBits()==2) os <<
" (receiver)";
138 if (p->dsBits()==0 || p->dsBits()==1) os <<
" (transmitter)";
141 if (p->dsBits()==1) os <<
" (receiver)";
142 else if (p->dsBits()!=0) os <<
" (transmitter)";
144 <<
senf::fieldName(
"sequence number") << p->sequenceNumber() << std::endl
145 <<
senf::fieldName(
"fragment number") << p->fragmentNumber() << std::endl;
146 if (p->has_qosField())
senf::UIntFieldParser<?,?+2 >::value_type type() const
static void dump(packet p, std::ostream &os)
boost::uint16_t sequenceNumber() const
senf::UIntFieldParser<?,?+4 > seqNumber_1() const
std::string fieldName(std::string const &s)
senf::FlagParser<?> retry() const
senf::UIntFieldParser<?,?+2 > version() const
MACAddressParser destinationAddress() const
senf::FlagParser<?> toDS() const
senf::FlagParser<?> pwrMgt() const
Parse an Ethernet MAC address.
MACAddressParser bssid() const
senf::UIntFieldParser<?,?+4 >::value_type subtype() const
senf::FlagParser<?> moreData() const
Protocol specific packet handle.
static void dump(packet p, std::ostream &os)
802.11 Frame parser (see IEEE 802.11-2007 standard - Chapter 7 Frame formats) Re-ordering of bits due...
senf::UIntFieldParser<?,?+2 > dsBits() const
UInt8Parser seqNumber_2() const
boost::uint16_t sequenceNumber() const
senf::FlagParser<?> fromDS() const
senf::FlagParser<?> protectedFrame() const
MACAddressParser sourceAddress() const
UInt16LSBParser duration() const
802.11 WLANPacket public header
senf::FlagParser<?> moreFrag() const
static void dump(packet p, std::ostream &os)
senf::FlagParser<?> order() const
Parser parser() const
Access packet field parser directly.