Search:

SENF Extensible Network Framework

  • Home
  • Download
  • Wiki
  • BerliOS
  • ChangeLog
  • Browse SVN
  • Bug Tracker
  • Overview
  • Examples
  • HowTos
  • Glossary
  • PPI
  • Packets
  • Scheduler
  • Socket
  • Utils
  • Console
  • Daemon
  • Logger
  • Termlib
  • Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

80211Bundle/InformationElements.hh

Go to the documentation of this file.
00001 // $Id: InformationElements.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 //     Thorsten Horstmann <tho@berlios.de>
00007 //
00008 // This program is free software; you can redistribute it and/or modify
00009 // it under the terms of the GNU General Public License as published by
00010 // the Free Software Foundation; either version 2 of the License, or
00011 // (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU General Public License
00019 // along with this program; if not, write to the
00020 // Free Software Foundation, Inc.,
00021 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00026 #ifndef HH_SENF_Packets_80211Bundle_InformationElements_
00027 #define HH_SENF_Packets_80211Bundle_InformationElements_ 1
00028 
00029 // Custom includes
00030 #include <senf/Packets/Packets.hh>
00031 
00032 //#include "InformationElements.mpp"
00033 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00034 
00035 namespace senf {
00036 
00037     class WLANInfoElementParser : public PacketParserBase
00038     {
00039     public:
00040 #       include SENF_PARSER()
00041         SENF_PARSER_FIELD    ( type,   UInt8Parser   );
00042         SENF_PARSER_FIELD    ( length, UInt8Parser   );
00043         SENF_PARSER_FINALIZE ( WLANInfoElementParser );
00044 
00045         typedef GenericTLVParserRegistry<WLANInfoElementParser> Registry;
00046     };
00047 
00048     typedef GenericTLVParserBase<WLANInfoElementParser> WLANGenericInfoElementParser;
00049 
00050     struct WLANSSIDInfoElementParser
00051         : public WLANInfoElementParser
00052     {
00053     #   include SENF_PARSER()
00054         SENF_PARSER_INHERIT  ( WLANInfoElementParser            );
00055         // the StringParser includes the length field so we have to go back
00056         SENF_PARSER_GOTO     ( length                           );
00057         SENF_PARSER_FIELD    ( value, StringParser<UInt8Parser> );
00058         SENF_PARSER_FINALIZE ( WLANSSIDInfoElementParser        );
00059 
00060         SENF_PARSER_INIT() {
00061             type() = typeId;
00062         }
00063         static const type_t::value_type typeId = 0x00u;
00064 
00065         void dump(std::ostream & os) const;
00066     };
00067 
00068     struct WLANSupportedRatesInfoElementParser
00069         : public WLANInfoElementParser
00070     {
00071     #   include SENF_PARSER()
00072         SENF_PARSER_INHERIT  ( WLANInfoElementParser               );
00073         // we just skip the value here. If somebody needs the information he has to implement
00074         // this strange information element himself.
00075         SENF_PARSER_SKIP     ( length(), 0                         );
00076         SENF_PARSER_FINALIZE ( WLANSupportedRatesInfoElementParser );
00077 
00078         SENF_PARSER_INIT() {
00079             type() = typeId;
00080         }
00081         static const type_t::value_type typeId = 0x01u;
00082 
00083         void dump(std::ostream & os) const;
00084     };
00085 
00086     struct WLANPowerConstraintInfoElementParser
00087         : public WLANInfoElementParser
00088     {
00089     #   include SENF_PARSER()
00090         SENF_PARSER_INHERIT  ( WLANInfoElementParser                );
00091         SENF_PARSER_FIELD    ( value,   UInt8Parser                 );
00092         SENF_PARSER_FINALIZE ( WLANPowerConstraintInfoElementParser );
00093 
00094         SENF_PARSER_INIT() {
00095             type() = typeId;
00096             length() = 1;
00097         }
00098         static const type_t::value_type typeId = 0x20u;
00099 
00100         void dump(std::ostream & os) const;
00101     };
00102 }
00103 
00104 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00105 //#include "InformationElements.cci"
00106 //#include "InformationElements.ct"
00107 //#include "InformationElements.cti"
00108 #endif
00109 
00110 
00111 // Local Variables:
00112 // mode: c++
00113 // fill-column: 100
00114 // comment-column: 40
00115 // c-file-style: "senf"
00116 // indent-tabs-mode: nil
00117 // ispell-local-dictionary: "american"
00118 // compile-command: "scons -u test"
00119 // End:

Contact: senf-dev@lists.berlios.de | © 2006-2010 Fraunhofer Institute for Open Communication Systems, Network Research