Packets/80211Bundle: some clean-up
cni [Tue, 9 Dec 2008 16:42:06 +0000 (16:42 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1010 270642c3-0616-0410-b53a-bc976706d245

Packets/80211Bundle/RadiotapPacket.hh

index ea6eee4..28f1beb 100644 (file)
@@ -148,33 +148,33 @@ namespace senf
               ( novalue( disable_##name, VoidPacketParser )) \
               (      id( name,           parser           )) );
 
-        /*  */
+        /* macro to create padding parser */
         #define SKIP_OPTIONAL_PADDING(cond, parser, size) \
             SENF_PARSER_SKIP( \
                     (cond ? (size - (parser##__offset() + \
                             senf::bytes(parser##_())) % size) % size : 0) , 0  );
 
-        OPTIONAL_FIELD ( tsft,             UInt64LSBParser                     );
-        OPTIONAL_FIELD ( flags,            RadiotapPacketParser_Flags          );
-        OPTIONAL_FIELD ( rate,             UInt8Parser                         );
-        SKIP_OPTIONAL_PADDING(channelOptionsPresent(), rate, 2);
-        OPTIONAL_FIELD ( channelOptions,   RadiotapPacketParser_ChannelOptions ) ;
-        SKIP_OPTIONAL_PADDING(fhssPresent(), channelOptions, 2);
-        OPTIONAL_FIELD ( fhss,             UInt16LSBParser                     );
-        OPTIONAL_FIELD ( dbmAntennaSignal, Int8Parser                          );
-        OPTIONAL_FIELD ( dbmAntennaNoise,  Int8Parser                          );
-        SKIP_OPTIONAL_PADDING(lockQualityPresent(), dbmAntennaNoise, 2);
-        OPTIONAL_FIELD ( lockQuality,             UInt16LSBParser                     );
-        SKIP_OPTIONAL_PADDING(txAttenuationPresent(), lockQuality, 2);
-        OPTIONAL_FIELD ( txAttenuation,    UInt16LSBParser                     );
-        SKIP_OPTIONAL_PADDING(dbTxAttenuationPresent(), txAttenuation, 2);
-        OPTIONAL_FIELD ( dbTxAttenuation,  UInt16LSBParser                     );
-        OPTIONAL_FIELD ( dbmTxAttenuation, Int8Parser                     );
-        OPTIONAL_FIELD ( antenna,          UInt8Parser                         );
-        OPTIONAL_FIELD ( dbAntennaSignal,  UInt8Parser                         );
-        OPTIONAL_FIELD ( dbAntennaNoise,   UInt8Parser                         );
-        SKIP_OPTIONAL_PADDING(fcsPresent(), dbAntennaNoise, 4)
-        OPTIONAL_FIELD ( fcs,              UInt32Parser                        );
+        OPTIONAL_FIELD          ( tsft,                     UInt64LSBParser                     );
+        OPTIONAL_FIELD          ( flags,                    RadiotapPacketParser_Flags          );
+        OPTIONAL_FIELD          ( rate,                     UInt8Parser                         );
+        SKIP_OPTIONAL_PADDING   ( channelOptionsPresent(),  rate, 2                             );
+        OPTIONAL_FIELD          ( channelOptions,           RadiotapPacketParser_ChannelOptions ) ;
+        SKIP_OPTIONAL_PADDING   ( fhssPresent(),            channelOptions, 2                   );
+        OPTIONAL_FIELD          ( fhss,                     UInt16LSBParser                     );
+        OPTIONAL_FIELD          ( dbmAntennaSignal,         Int8Parser                          );
+        OPTIONAL_FIELD          ( dbmAntennaNoise,          Int8Parser                          );
+        SKIP_OPTIONAL_PADDING   ( lockQualityPresent(),     dbmAntennaNoise, 2                  );
+        OPTIONAL_FIELD          ( lockQuality,              UInt16LSBParser                     );
+        SKIP_OPTIONAL_PADDING   ( txAttenuationPresent(),   lockQuality, 2                      );
+        OPTIONAL_FIELD          ( txAttenuation,            UInt16LSBParser                     );
+        SKIP_OPTIONAL_PADDING   ( dbTxAttenuationPresent(), txAttenuation, 2                    );
+        OPTIONAL_FIELD          ( dbTxAttenuation,          UInt16LSBParser                     );
+        OPTIONAL_FIELD          ( dbmTxAttenuation,         Int8Parser                          );
+        OPTIONAL_FIELD          ( antenna,                  UInt8Parser                         );
+        OPTIONAL_FIELD          ( dbAntennaSignal,          UInt8Parser                         );
+        OPTIONAL_FIELD          ( dbAntennaNoise,           UInt8Parser                         );
+        SKIP_OPTIONAL_PADDING   ( fcsPresent(),             dbAntennaNoise, 4                   );
+        OPTIONAL_FIELD          ( fcs,                      UInt32Parser                        );
 
         SENF_PARSER_INIT() {
             version() = 0;