Packets/80221Bundle: fixed message validation
[senf.git] / senf / Packets / 80221Bundle / TLVParser.hh
index da6a96f..0a466c6 100644 (file)
 
 namespace senf {
 
-    struct MIHTLVLengthException : public senf::Exception
-    {
-        MIHTLVLengthException()
-          : senf::Exception("MIHTLVLengthException") {}
-    };
-
-
     class MIHTLVLengthParser
         : public detail::packet::IntParserOps<MIHTLVLengthParser, boost::uint32_t>,
           public PacketParserBase
@@ -128,7 +121,8 @@ namespace senf {
          */
         void maxLength(MIHTLVLengthParser::value_type maxl) const;
 
-        std::pair<bool, std::string> validateTL(boost::uint8_t type, MIHTLVLengthParser::value_type length) const;
+        void validateType(boost::uint8_t type) const;
+        void validateTypeLength(boost::uint8_t type, MIHTLVLengthParser::value_type length) const;
     };
 
 
@@ -294,7 +288,7 @@ namespace senf {
         }
         static type_t::value_type const typeId = 1;
         void dump(std::ostream & os) const;
-        std::pair<bool, std::string> validate() const;
+        void validate() const;
     };
 
     /** \brief Parser for 802.21 destination MIHF_ID TLV
@@ -309,7 +303,7 @@ namespace senf {
         }
         static type_t::value_type const typeId = 2;
         void dump(std::ostream & os) const;
-        std::pair<bool, std::string> validate() const;
+        void validate() const;
     };
 
     /** \brief Parser for 802.21 Status TLV
@@ -328,7 +322,7 @@ namespace senf {
         }
         static type_t::value_type const typeId = 3;
         void dump(std::ostream & os) const; ///< dump string representation to given stream
-        std::pair<bool, std::string> validate() const;
+        void validate() const;
 
         enum StatusCode {
             Success, UnspecifiedFailure, Rejected, AuthorizationFailure, NetworkError };
@@ -348,7 +342,7 @@ namespace senf {
         }
         static type_t::value_type const typeId = 11;
         void dump(std::ostream & os) const; ///< dump string representation to given stream
-        std::pair<bool, std::string> validate() const;
+        void validate() const;
 
         enum RequestCode { Registration, ReRegistration };
     };
@@ -367,7 +361,7 @@ namespace senf {
         }
         static type_t::value_type const typeId = 12;
         void dump(std::ostream & os) const; ///< dump string representation to given stream
-        std::pair<bool, std::string> validate() const;
+        void validate() const;
     };
 
 }