Packets: extended description of bad_cast exception in Packet.as()
[senf.git] / senf / Packets / 80211Bundle / InformationElements.hh
index 0b550f4..92c79f7 100644 (file)
@@ -30,7 +30,7 @@
 #include <senf/Packets/Packets.hh>
 
 //#include "InformationElements.mpp"
-///////////////////////////////hh.p////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 
 namespace senf {
 
@@ -41,13 +41,67 @@ namespace senf {
         SENF_PARSER_FIELD    ( type,   UInt8Parser   );
         SENF_PARSER_FIELD    ( length, UInt8Parser   );
         SENF_PARSER_FINALIZE ( WLANInfoElementParser );
+
+        typedef GenericTLVParserRegistry<WLANInfoElementParser> Registry;
     };
 
     typedef GenericTLVParserBase<WLANInfoElementParser> WLANGenericInfoElementParser;
-    
+
+    struct WLANSSIDInfoElementParser
+        : public WLANInfoElementParser
+    {
+    #   include SENF_PARSER()
+        SENF_PARSER_INHERIT  ( WLANInfoElementParser            );
+        // the StringParser includes the length field so we have to go back
+        SENF_PARSER_GOTO     ( length                           );
+        SENF_PARSER_FIELD    ( value, StringParser<UInt8Parser> );
+        SENF_PARSER_FINALIZE ( WLANSSIDInfoElementParser        );
+
+        SENF_PARSER_INIT() {
+            type() = typeId;
+        }
+        static const type_t::value_type typeId = 0x00u;
+
+        void dump(std::ostream & os) const;
+    };
+
+    struct WLANSupportedRatesInfoElementParser
+        : public WLANInfoElementParser
+    {
+    #   include SENF_PARSER()
+        SENF_PARSER_INHERIT  ( WLANInfoElementParser               );
+        // we just skip the value here. If somebody needs the information he has to implement
+        // this strange information element himself.
+        SENF_PARSER_SKIP     ( length(), 0                         );
+        SENF_PARSER_FINALIZE ( WLANSupportedRatesInfoElementParser );
+
+        SENF_PARSER_INIT() {
+            type() = typeId;
+        }
+        static const type_t::value_type typeId = 0x01u;
+
+        void dump(std::ostream & os) const;
+    };
+
+    struct WLANPowerConstraintInfoElementParser
+        : public WLANInfoElementParser
+    {
+    #   include SENF_PARSER()
+        SENF_PARSER_INHERIT  ( WLANInfoElementParser                );
+        SENF_PARSER_FIELD    ( value,   UInt8Parser                 );
+        SENF_PARSER_FINALIZE ( WLANPowerConstraintInfoElementParser );
+
+        SENF_PARSER_INIT() {
+            type() = typeId;
+            length() = 1;
+        }
+        static const type_t::value_type typeId = 0x20u;
+
+        void dump(std::ostream & os) const;
+    };
 }
 
-///////////////////////////////hh.e////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 //#include "InformationElements.cci"
 //#include "InformationElements.ct"
 //#include "InformationElements.cti"