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