X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPackets%2F80221Bundle%2FTLVParser.hh;h=c8b49ada7f6ac702edf9509a65bc9a762a4c421e;hb=bea7cfcf3d02688ece159d76890acfe2d0051d71;hp=e6caf9c28add5d99ad63051a522168604931ac4a;hpb=482523171f06cf239fd7e8c991f81711c02cf0ba;p=senf.git diff --git a/senf/Packets/80221Bundle/TLVParser.hh b/senf/Packets/80221Bundle/TLVParser.hh index e6caf9c..c8b49ad 100644 --- a/senf/Packets/80221Bundle/TLVParser.hh +++ b/senf/Packets/80221Bundle/TLVParser.hh @@ -130,7 +130,7 @@ namespace senf { protect(), length_().finalize(); }; - typedef GenericTLVParserRegistry Registry; + typedef GenericTLVParserRegistry Registry; protected: /// resize the packet after the length field to given size @@ -244,6 +244,61 @@ namespace senf { void dump(std::ostream & os) const; }; + + /** \brief Parser for 802.21 Status TLV + */ + struct MIHStatusTLVParser : public MIHBaseTLVParser + { + # include SENF_PARSER() + SENF_PARSER_INHERIT ( MIHBaseTLVParser ); + SENF_PARSER_FIELD ( value, UInt8Parser ); + SENF_PARSER_FINALIZE( MIHStatusTLVParser ); + SENF_PARSER_INIT() { + defaultInit(); + type() << typeId+0; + length_() = 1; + } + static type_t::value_type const typeId = 3; + void dump(std::ostream & os) const; ///< dump string representation to given stream + + enum StatusCode { + Success, UnspecifiedFailure, Rejected, AuthorizationFailure, NetworkError }; + }; + + struct MIHRegisterReqCodeTLVParser : public MIHBaseTLVParser + { + # include SENF_PARSER() + SENF_PARSER_INHERIT ( MIHBaseTLVParser ); + SENF_PARSER_FIELD ( value, UInt8Parser ); + SENF_PARSER_FINALIZE ( MIHRegisterReqCodeTLVParser ); + + SENF_PARSER_INIT() { + defaultInit(); + type() = typeId+0; + length_() = 1; + } + static type_t::value_type const typeId = 11; + void dump(std::ostream & os) const; ///< dump string representation to given stream + + enum RequestCode { Registration, ReRegistration }; + }; + + struct MIHValidTimeIntervalTLVParser : public MIHBaseTLVParser + { + # include SENF_PARSER() + SENF_PARSER_INHERIT ( MIHBaseTLVParser ); + SENF_PARSER_FIELD ( value, UInt32Parser ); + SENF_PARSER_FINALIZE ( MIHValidTimeIntervalTLVParser ); + + SENF_PARSER_INIT() { + defaultInit(); + type() = typeId+0; + length_() = 4; + } + static type_t::value_type const typeId = 12; + void dump(std::ostream & os) const; ///< dump string representation to given stream + }; + }