Packets: extended description of bad_cast exception in Packet.as()
[senf.git] / senf / Packets / 80211Bundle / WLANBeaconPacket.cc
index d91f059..04eee2f 100644 (file)
@@ -1,9 +1,10 @@
-// $Id: WLANPacket.cc 1449 2009-09-25 23:03:48Z g0dil $
+// $Id$
 //
-// Copyright (C) 2008
+// Copyright (C) 2009
 // Fraunhofer Institute for Open Communication Systems (FOKUS)
 // Competence Center NETwork research (NET), St. Augustin, GERMANY
 //     Christian Niephaus <cni@berlios.de>
+//     Thorsten Horstmann <tho@berlios.de>
 //
 // 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
 // Free Software Foundation, Inc.,
 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-// Definition of non-inline non-template functions
+// Definition of 802.11 WLAN Beacon Packet non-inline non-template functions
 
-// Custom includes
 #include "WLANBeaconPacket.hh"
 
-#include <senf/Packets/Packets.hh>
+// Custom includes
 #include <boost/io/ios_state.hpp>
 
 #define prefix_
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 
-namespace {
-}
-
-prefix_ void senf::WLANBeaconPacketType::dump(packet p, std::ostream &os)
+prefix_ void senf::WLANBeaconPacketType::dump(packet p, std::ostream & os)
 {
-    boost::io::ios_all_saver ias(os);    
-    os << "WLAN Beacon:\n"
-       << senf::fieldName("timestamp") << unsigned( p->timestamp()) << "\n";
+    boost::io::ios_all_saver ias(os);
+    os << "WLAN beacon frame:\n"
+       << senf::fieldName("timestamp")      << unsigned( p->timestamp())      << "\n"
+       << senf::fieldName("beaconInterval") << unsigned( p->beaconInterval()) << "\n";
+    p->ssidIE().dump( os);
+    p->supportedRatesIE().dump( os);
+    os << "  Optional Information Elements:\n";
+    typedef parser::ieList_t::container ieListContainer_t;
+    ieListContainer_t ieListContainer (p->ieList());
+    for (ieListContainer_t::const_iterator i = ieListContainer.begin(); i != ieListContainer.end(); ++i)
+        i->dump( os);
 }
 
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 #undef prefix_
 
 \f