Skip to content
Snippets Groups Projects
Commit 204448c8 authored by cni's avatar cni
Browse files

Packets/80211Bundle: some clean-up

parent df92b48a
No related branches found
No related tags found
No related merge requests found
...@@ -148,33 +148,33 @@ namespace senf ...@@ -148,33 +148,33 @@ namespace senf
( novalue( disable_##name, VoidPacketParser )) \ ( novalue( disable_##name, VoidPacketParser )) \
( id( name, parser )) ); ( id( name, parser )) );
/* */ /* macro to create padding parser */
#define SKIP_OPTIONAL_PADDING(cond, parser, size) \ #define SKIP_OPTIONAL_PADDING(cond, parser, size) \
SENF_PARSER_SKIP( \ SENF_PARSER_SKIP( \
(cond ? (size - (parser##__offset() + \ (cond ? (size - (parser##__offset() + \
senf::bytes(parser##_())) % size) % size : 0) , 0 ); senf::bytes(parser##_())) % size) % size : 0) , 0 );
OPTIONAL_FIELD ( tsft, UInt64LSBParser ); OPTIONAL_FIELD ( tsft, UInt64LSBParser );
OPTIONAL_FIELD ( flags, RadiotapPacketParser_Flags ); OPTIONAL_FIELD ( flags, RadiotapPacketParser_Flags );
OPTIONAL_FIELD ( rate, UInt8Parser ); OPTIONAL_FIELD ( rate, UInt8Parser );
SKIP_OPTIONAL_PADDING(channelOptionsPresent(), rate, 2); SKIP_OPTIONAL_PADDING ( channelOptionsPresent(), rate, 2 );
OPTIONAL_FIELD ( channelOptions, RadiotapPacketParser_ChannelOptions ) ; OPTIONAL_FIELD ( channelOptions, RadiotapPacketParser_ChannelOptions ) ;
SKIP_OPTIONAL_PADDING(fhssPresent(), channelOptions, 2); SKIP_OPTIONAL_PADDING ( fhssPresent(), channelOptions, 2 );
OPTIONAL_FIELD ( fhss, UInt16LSBParser ); OPTIONAL_FIELD ( fhss, UInt16LSBParser );
OPTIONAL_FIELD ( dbmAntennaSignal, Int8Parser ); OPTIONAL_FIELD ( dbmAntennaSignal, Int8Parser );
OPTIONAL_FIELD ( dbmAntennaNoise, Int8Parser ); OPTIONAL_FIELD ( dbmAntennaNoise, Int8Parser );
SKIP_OPTIONAL_PADDING(lockQualityPresent(), dbmAntennaNoise, 2); SKIP_OPTIONAL_PADDING ( lockQualityPresent(), dbmAntennaNoise, 2 );
OPTIONAL_FIELD ( lockQuality, UInt16LSBParser ); OPTIONAL_FIELD ( lockQuality, UInt16LSBParser );
SKIP_OPTIONAL_PADDING(txAttenuationPresent(), lockQuality, 2); SKIP_OPTIONAL_PADDING ( txAttenuationPresent(), lockQuality, 2 );
OPTIONAL_FIELD ( txAttenuation, UInt16LSBParser ); OPTIONAL_FIELD ( txAttenuation, UInt16LSBParser );
SKIP_OPTIONAL_PADDING(dbTxAttenuationPresent(), txAttenuation, 2); SKIP_OPTIONAL_PADDING ( dbTxAttenuationPresent(), txAttenuation, 2 );
OPTIONAL_FIELD ( dbTxAttenuation, UInt16LSBParser ); OPTIONAL_FIELD ( dbTxAttenuation, UInt16LSBParser );
OPTIONAL_FIELD ( dbmTxAttenuation, Int8Parser ); OPTIONAL_FIELD ( dbmTxAttenuation, Int8Parser );
OPTIONAL_FIELD ( antenna, UInt8Parser ); OPTIONAL_FIELD ( antenna, UInt8Parser );
OPTIONAL_FIELD ( dbAntennaSignal, UInt8Parser ); OPTIONAL_FIELD ( dbAntennaSignal, UInt8Parser );
OPTIONAL_FIELD ( dbAntennaNoise, UInt8Parser ); OPTIONAL_FIELD ( dbAntennaNoise, UInt8Parser );
SKIP_OPTIONAL_PADDING(fcsPresent(), dbAntennaNoise, 4) SKIP_OPTIONAL_PADDING ( fcsPresent(), dbAntennaNoise, 4 );
OPTIONAL_FIELD ( fcs, UInt32Parser ); OPTIONAL_FIELD ( fcs, UInt32Parser );
SENF_PARSER_INIT() { SENF_PARSER_INIT() {
version() = 0; version() = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment