Packets/80211Bundle: added SSID-IE to BeaconPacket
[senf.git] / senf / Packets / 80211Bundle / WLANBeaconPacket.hh
1 // $Id$
2 //
3 // Copyright (C) 2009
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 //     Christian Niephaus <cni@berlios.de>
7 //     Thorsten Horstmann <tho@berlios.de>
8 //
9 // This program is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation; either version 2 of the License, or
12 // (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the
21 // Free Software Foundation, Inc.,
22 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23
24 /** \file
25     \brief 802.11 WLAN Beacon Packet public header */
26
27 #ifndef HH_SENF_Packets_80211Bundle_WLANBeaconPacket_
28 #define HH_SENF_Packets_80211Bundle_WLANBeaconPacket_ 1
29
30 // Custom includes
31 #include <senf/Packets/Packets.hh>
32 #include "InformationElements.hh"
33
34 ///////////////////////////////hh.p////////////////////////////////////////
35 namespace senf {
36
37     struct WLANBeaconPacketParser : public PacketParserBase
38     {
39     #   include SENF_PARSER()
40
41         SENF_PARSER_FIELD( timestamp,      UInt64LSBParser   );
42         SENF_PARSER_FIELD( beaconInterval, UInt16LSBParser   );
43         SENF_PARSER_SKIP ( 2,2); //capability flags
44
45         SENF_PARSER_FIELD( ssidIE, WLANSSIDInfoElementParser );
46         WLANSSIDInfoElementParser::value_t ssid() const { return ssidIE().value(); }
47         
48         SENF_PARSER_FINALIZE( WLANBeaconPacketParser );
49         
50     };
51
52  
53     /** \brief WLAN Beacon frame packet
54
55         \par Packet type (typedef):
56             \refWLANBeaconPacket
57
58         \par Fields:
59
60         \ingroup protocolbundle_80211
61      */
62     struct WLANBeaconPacketType
63         : public PacketTypeBase,
64           public PacketTypeMixin<WLANBeaconPacketType>
65     {
66         typedef PacketTypeMixin<WLANBeaconPacketType> mixin;
67         typedef ConcretePacket<WLANBeaconPacketType> packet;
68         typedef WLANBeaconPacketParser parser;
69
70         using mixin::init;
71         using mixin::initSize;
72         using PacketTypeBase::nextPacketRange;
73
74         static void dump(packet p, std::ostream &os);
75     };
76
77     typedef ConcretePacket<WLANBeaconPacketType> WLANBeaconPacket;
78
79 }
80
81 ///////////////////////////////hh.e////////////////////////////////////////
82 //#include "WLANBeaconPacket.cci"
83 //#include "WLANBeaconPacket.ct"
84 //#include "WLANBeaconPacket.cti"
85 #endif
86
87 \f
88 // Local Variables:
89 // mode: c++
90 // fill-column: 100
91 // c-file-style: "senf"
92 // indent-tabs-mode: nil
93 // ispell-local-dictionary: "american"
94 // compile-command: "scons -u test"
95 // comment-column: 40
96 // End: