X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2F80211Bundle%2FRadiotapPacket.cc;h=bf4407c08071fa3b37c45ce41e32061444ec36e3;hb=3863d46dd898b7bc35ea8c6ccd8563b18762a6b6;hp=fb03f754ec45449e69bb1a703071ec288db1f4ee;hpb=08bba1cbe020e940671a58c0db5afce75ef84619;p=senf.git diff --git a/Packets/80211Bundle/RadiotapPacket.cc b/Packets/80211Bundle/RadiotapPacket.cc index fb03f75..bf4407c 100644 --- a/Packets/80211Bundle/RadiotapPacket.cc +++ b/Packets/80211Bundle/RadiotapPacket.cc @@ -1,9 +1,9 @@ -// $Id: $ +// $Id$ // -// Copyright (C) 2006 +// Copyright (C) 2008 // Fraunhofer Institute for Open Communication Systems (FOKUS) // Competence Center NETwork research (NET), St. Augustin, GERMANY -// Christian Niephaus +// Christian Niephaus // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -24,27 +24,57 @@ // Custom includes #include "RadiotapPacket.hh" +#include "WLANPacket.hh" #include "../../Packets/Packets.hh" #include #define prefix_ -namespace -{ - -} prefix_ void senf::RadiotapPacketType::dump(packet p, std::ostream &os) { boost::io::ios_all_saver ias(os); - os << "Radiotap:\n" - << " Version : " << p->version() << "\n" - << " Length : " << p->length() << "\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_rate()) + 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 << " 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) { - p->length() << p.size(); + p->length() << senf::bytes( p.parser()); +} + +prefix_ senf::PacketInterpreterBase::factory_t senf::RadiotapPacketType::nextPacketType(packet p) +{ + return WLANPacket::factory(); }