X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2F80211Bundle%2FWLANPacket.hh;h=66491500555ce4cf9551111c112a26b6c1a4ec42;hb=6165e70feef7199dc3fe96a881d055f6a2999b00;hp=52c71b53d0a70c47bf616c95d6f657790ca20f08;hpb=148834587eec2d0fcc0b87a7b3fa50644161aa1c;p=senf.git diff --git a/Packets/80211Bundle/WLANPacket.hh b/Packets/80211Bundle/WLANPacket.hh index 52c71b5..6649150 100644 --- a/Packets/80211Bundle/WLANPacket.hh +++ b/Packets/80211Bundle/WLANPacket.hh @@ -41,9 +41,8 @@ namespace senf # include SENF_FIXED_PARSER() SENF_PARSER_PRIVATE_BITFIELD ( subtype, 4, unsigned ); - SENF_PARSER_SKIP_BITS ( 4 ); //skip type and version //jump to fist address field - SENF_PARSER_SKIP ( 3 ); + SENF_PARSER_SKIP_BITS ( 28 ); SENF_PARSER_FIELD ( destinationAddress, MACAddressParser ); SENF_PARSER_FIELD ( sourceAddress, MACAddressParser ); SENF_PARSER_FIELD ( bssid, MACAddressParser ); @@ -58,7 +57,9 @@ namespace senf //this is needed due to the goto in the WLANPacketParser. Don't know exactly why yet. SENF_PARSER_INIT() {} - boost::uint16_t sequenceNumber() const; + boost::uint16_t sequenceNumber() const { + return (uint16_t)(seqNumber_2()) << 4 | seqNumber_1(); + }; }; /** \brief Control frame parser @@ -72,9 +73,8 @@ namespace senf # include SENF_PARSER() SENF_PARSER_PRIVATE_BITFIELD ( subtype, 4, unsigned ); - SENF_PARSER_SKIP_BITS ( 4 ); //skip type and version //jump to fist address field - SENF_PARSER_SKIP ( 3, 3 ); + SENF_PARSER_SKIP_BITS ( 28 ); SENF_PARSER_FIELD ( receiverAddress, MACAddressParser ); //only RTS frame contains a source address field @@ -99,14 +99,12 @@ namespace senf # include SENF_PARSER() SENF_PARSER_PRIVATE_BITFIELD ( subtype, 4, unsigned ); //jump to 'toDS' and 'fromDS' bits - //skip type and version - SENF_PARSER_SKIP_BITS ( 4 ); - //skip other flags - SENF_PARSER_SKIP_BITS ( 6 ); + //skip type, version and other flags + SENF_PARSER_SKIP_BITS ( 10 ); //needed in data frames due to the variable address fields SENF_PARSER_PRIVATE_BITFIELD ( dsBits, 2, unsigned ); //skip duration field - SENF_PARSER_SKIP ( 2, 0 ); + SENF_PARSER_SKIP ( 2, 2 ); SENF_PARSER_PRIVATE_FIELD ( addr1, MACAddressParser ); SENF_PARSER_PRIVATE_FIELD ( addr2, MACAddressParser ); @@ -136,7 +134,9 @@ namespace senf //this is needed to due to the goto in the WLANPacketParser. Don't know exactly why yet. SENF_PARSER_INIT() {} - boost::uint16_t sequenceNumber() const; + boost::uint16_t sequenceNumber() const { + return (uint16_t)(seqNumber_2()) << 4 | seqNumber_1(); + }; MACAddressParser receiverAddress() const { return addr1(); }; //ra is always addr1 MACAddressParser transmitterAddress() const { return addr2(); }; //ta is always addr2 @@ -202,6 +202,7 @@ namespace senf \par Fields: \ref WLANPacketParser + \image html WLANPacket.png \ingroup protocolbundle_80211 */