Packets/80221Bundle: revised signature of validate function
[senf.git] / senf / Packets / 80221Bundle / TLVParser.hh
index da6a96f..ce40481 100644 (file)
@@ -41,6 +41,11 @@ namespace senf {
           : senf::Exception("MIHTLVLengthException") {}
     };
 
+    struct InvalidMIHPacketException : public senf::Exception {
+        InvalidMIHPacketException(std::string const & description)
+            : senf::Exception("Invalid MIH message: ") { append(description); }
+    };
+
 
     class MIHTLVLengthParser
         : public detail::packet::IntParserOps<MIHTLVLengthParser, boost::uint32_t>,
@@ -128,7 +133,7 @@ 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 validateTL(boost::uint8_t type, MIHTLVLengthParser::value_type length) const;
     };
 
 
@@ -294,7 +299,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 +314,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 +333,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 +353,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 +372,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;
     };
 
 }