prefix_ void senf::RadiotapPacketType::dump(packet p, std::ostream &os)
{
boost::io::ios_all_saver ias(os);
- os << "Radiotap:\n"
- << " Version : " << unsigned (p->version()) << "\n"
- << " Length : " << unsigned (p->length()) << "\n";
- if (p->has_dbmAntennaSignal())
- os << " Signal : " << signed (p-> dbmAntennaSignal()) << "\n";
+ os << "Radiotap:\n"
+ << " Version : " << unsigned( p->version()) << "\n"
+ << " Length : " << unsigned( p->length()) << "\n";
+ if (p->has_tsft())
+ os << " MAC timestamp : " << unsigned( p->tsft()) << "\n";
+ // TODO: flags
if (p->has_tsft())
- os << " MAC timestamp : " << unsigned (p->tsft()) << "\n";
+ os << " Rate : " << unsigned( p->rate()) << "\n";
+ // TODO: channelOptions
+ if (p->has_fhss())
+ os << " FHSS : " << unsigned( p->fhss()) << "\n";
+ if (p->has_dbmAntennaSignal())
+ os << " Antenna Signal (dBm): " << signed( p->dbmAntennaSignal()) << "\n";
if (p->has_dbmAntennaNoise())
- os << " Noise : " << signed (p-> dbmAntennaNoise()) << "\n";
-
-
-
+ os << " Antenna Noise (dBm) : " << signed( p->dbmAntennaNoise()) << "\n";
+ if (p->has_lockQuality())
+ os << " Lock Quality : " << unsigned( p->lockQuality()) << "\n";
+ if (p->has_txAttenuation())
+ os << " txAttenuation : " << unsigned( p->txAttenuation()) << "\n";
+ if (p->has_dbTxAttenuation())
+ os << " dbTxAttenuation : " << unsigned( p->dbTxAttenuation()) << "\n";
+ if (p->has_dbmTxAttenuation())
+ os << " dbmTxAttenuation : " << signed( p->dbmTxAttenuation()) << "\n";
+ if (p->has_antenna())
+ os << " Antenna : " << unsigned( p->antenna()) << "\n";
+ if (p->has_dbAntennaSignal())
+ os << " Antenna Signal (dB) : " << unsigned( p->dbAntennaSignal()) << "\n";
+ if (p->has_dbAntennaNoise())
+ os << " Antenna Noise (dB) : " << unsigned( p->dbAntennaNoise()) << "\n";
+ if (p->has_fcs())
+ os << " FCS : " << unsigned( p->fcs()) << "\n";
}
prefix_ void senf::RadiotapPacketType::finalize(packet p)
{
- //TODO
- p->length() << p.size();
+ p->length() << senf::bytes( p.parser());
}
prefix_ senf::PacketInterpreterBase::factory_t senf::RadiotapPacketType::nextPacketType(packet p)
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
- \brief Radiotap header \n
- <b>Radiotap uses least significant bit byte order</b>
- */
+ \brief Radiotap header */
#ifndef HH_SENF_Packets_80211Bundle_RadiotapPacket_
#define HH_SENF_Packets_80211Bundle_RadiotapPacket_ 1
{
/** \brief Parse Flag field in Radiotap header
- * <b>Re-ordering of bits due to LSB byte order</b>
- * (see http://www.radiotap.org/)
+ <b>Re-ordering of bits due to LSB byte order</b>
*/
struct RadiotapPacketParser_Flags : public senf::PacketParserBase
{
(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;
\par Fields:
\ref RadiotapPacketParser
-
+
+ \see http://www.radiotap.org/
+
\ingroup protocolbundle_80211
*/
struct RadiotapPacketType
static void dump(packet p, std::ostream &os);
static void finalize(packet p);
static factory_t nextPacketType(packet p);
-
};
typedef senf::ConcretePacket<RadiotapPacketType> RadiotapPacket;