00001 // $Id: WLANBeaconPacket.hh 1772 2011-03-10 12:45:21Z tho $ 00002 // 00003 // Copyright (C) 2009 00004 // Fraunhofer (FOKUS) 00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY 00006 // Christian Niephaus <cni@berlios.de> 00007 // Thorsten Horstmann <tho@berlios.de> 00008 // 00009 // This program is free software; you can redistribute it and/or modify 00010 // it under the terms of the GNU General Public License as published by 00011 // the Free Software Foundation; either version 2 of the License, or 00012 // (at your option) any later version. 00013 // 00014 // This program is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 // GNU General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU General Public License 00020 // along with this program; if not, write to the 00021 // Free Software Foundation, Inc., 00022 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00023 00027 #ifndef HH_SENF_Packets_80211Bundle_WLANBeaconPacket_ 00028 #define HH_SENF_Packets_80211Bundle_WLANBeaconPacket_ 1 00029 00030 // Custom includes 00031 #include "InformationElements.hh" 00032 00033 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00034 namespace senf { 00035 00036 struct WLANBeaconPacketParser : public PacketParserBase 00037 { 00038 # include SENF_PARSER() 00039 00040 SENF_PARSER_FIELD( timestamp, UInt64LSBParser ); 00041 SENF_PARSER_FIELD( beaconInterval, UInt16LSBParser ); 00042 SENF_PARSER_SKIP ( 2,2); //capability flags 00043 00044 SENF_PARSER_FIELD( ssidIE, WLANSSIDInfoElementParser ); 00045 WLANSSIDInfoElementParser::value_t ssid() const { return ssidIE().value(); } 00046 00047 SENF_PARSER_FIELD( supportedRatesIE, WLANSupportedRatesInfoElementParser ); 00048 00049 SENF_PARSER_LIST ( ieList, packetSize(), WLANGenericInfoElementParser ); 00050 00051 SENF_PARSER_FINALIZE( WLANBeaconPacketParser ); 00052 }; 00053 00054 00064 struct WLANBeaconPacketType 00065 : public PacketTypeBase, 00066 public PacketTypeMixin<WLANBeaconPacketType> 00067 { 00068 typedef PacketTypeMixin<WLANBeaconPacketType> mixin; 00069 typedef ConcretePacket<WLANBeaconPacketType> packet; 00070 typedef WLANBeaconPacketParser parser; 00071 00072 using mixin::init; 00073 using mixin::initSize; 00074 using PacketTypeBase::nextPacketRange; 00075 00076 static void dump(packet p, std::ostream & os); 00077 }; 00078 00082 typedef ConcretePacket<WLANBeaconPacketType> WLANBeaconPacket; 00083 00084 } 00085 00086 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00087 //#include "WLANBeaconPacket.cci" 00088 //#include "WLANBeaconPacket.ct" 00089 //#include "WLANBeaconPacket.cti" 00090 #endif 00091 00092 00093 // Local Variables: 00094 // mode: c++ 00095 // fill-column: 100 00096 // c-file-style: "senf" 00097 // indent-tabs-mode: nil 00098 // ispell-local-dictionary: "american" 00099 // compile-command: "scons -u test" 00100 // comment-column: 40 00101 // End: