X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPackets%2F80211Bundle%2FWLANPacket.hh;fp=senf%2FPackets%2F80211Bundle%2FWLANPacket.hh;h=814263ef3bdac70c1a3613d4e0231e63f9043f5c;hb=ec082e2ded82e26d02f7aa72da519cbadcb601ec;hp=ddbe46c61b84cf3aec0ce9934d441edce3ac690f;hpb=5e6a9673486c8806d807702d1136443822a3ffa1;p=senf.git diff --git a/senf/Packets/80211Bundle/WLANPacket.hh b/senf/Packets/80211Bundle/WLANPacket.hh index ddbe46c..814263e 100644 --- a/senf/Packets/80211Bundle/WLANPacket.hh +++ b/senf/Packets/80211Bundle/WLANPacket.hh @@ -197,27 +197,36 @@ namespace senf SENF_PARSER_INHERIT(WLANPacketParser); - SENF_PARSER_GOTO(subtype); - SENF_PARSER_SKIP_BITS(14); // dsBits_t; + dsBits_t::value_type dsBits() const { return parse( 1); } - SENF_PARSER_PRIVATE_FIELD ( addr1, MACAddressParser ); - SENF_PARSER_PRIVATE_FIELD ( addr2, MACAddressParser ); - SENF_PARSER_PRIVATE_FIELD ( addr3, MACAddressParser ); + MACAddressParser addr1() const { return parse( 4); } + MACAddressParser addr2() const { return parse( 10); } + MACAddressParser addr3() const { return parse( 16); } //sequence Number and fragment number //shift bits manually due to LSB - SENF_PARSER_PRIVATE_BITFIELD ( seqNumber_1, 4, unsigned ); - SENF_PARSER_BITFIELD ( fragmentNumber, 4, unsigned ); - SENF_PARSER_PRIVATE_FIELD ( seqNumber_2, UInt8Parser ); + typedef UIntFieldParser<0, 0+4> seqNumber_1_t; + seqNumber_1_t seqNumber_1() const { return parse( 22); } + + public: + typedef UIntFieldParser<4, 4+4> fragmentNumber_t; + fragmentNumber_t fragmentNumber() const { return parse( 22); } + + protected: + UInt8Parser seqNumber_2() const { return parse( 23); } + + public: boost::uint16_t sequenceNumber() const { return (uint16_t)(seqNumber_2()) << 4 | seqNumber_1(); }; void sequenceNumber(boost::uint16_t sn); + SENF_PARSER_GOTO_OFFSET( 24, 24); + // TODO fourth address field in case of WDS // SENF_PARSER_PRIVATE_VARIANT (wds_, dsBits, // ( novalue ( disable_addr4, VoidPacketParser ))