From: tho Date: Fri, 22 Oct 2010 13:44:36 +0000 (+0000) Subject: Packets/80221Bundle: removed MIHFId::None X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=34700cdc907e04dbe026df9e86d0509990706a31;p=senf.git Packets/80221Bundle: removed MIHFId::None git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1739 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Packets/80221Bundle/MIHPacket.test.cc b/senf/Packets/80221Bundle/MIHPacket.test.cc index fbfdd18..d777bd3 100644 --- a/senf/Packets/80221Bundle/MIHPacket.test.cc +++ b/senf/Packets/80221Bundle/MIHPacket.test.cc @@ -327,6 +327,21 @@ SENF_AUTO_UNIT_TEST(MIHPayload_create) mihPacket.data().begin(), mihPacket.data().end() ); } +SENF_AUTO_UNIT_TEST(Test_MIHFIdTLV) +{ + unsigned char data[] = { + // MIH header + 0x10, 0x54, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, + // source MIHF_ID TLV: + 0x01, 0x00, // type, length + // destination MIHF_ID TLV: + 0x02, 0x00, // type, length + 0x0c // value-length + }; + + MIHPacket mihPacket (MIHPacket::create(data)); + BOOST_CHECK( mihPacket->src_mihfId().valueEquals( MIHFId::Multicast) ); +} ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_ diff --git a/senf/Packets/80221Bundle/MIHTypes.cc b/senf/Packets/80221Bundle/MIHTypes.cc index 4c9e363..bd0259f 100644 --- a/senf/Packets/80221Bundle/MIHTypes.cc +++ b/senf/Packets/80221Bundle/MIHTypes.cc @@ -32,7 +32,6 @@ ///////////////////////////////cc.p//////////////////////////////////////// senf::MIHFId const senf::MIHFId::Multicast; -senf::MIHFId const senf::MIHFId::None; ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_ diff --git a/senf/Packets/80221Bundle/MIHTypes.hh b/senf/Packets/80221Bundle/MIHTypes.hh index bd8d174..ea901bf 100644 --- a/senf/Packets/80221Bundle/MIHTypes.hh +++ b/senf/Packets/80221Bundle/MIHTypes.hh @@ -47,10 +47,9 @@ namespace senf { { public: static MIHFId const Multicast; ///< The multicast (empty) MIHF Id - static MIHFId const None; ///< The multicast (empty) MIHF Id - enum Type { Empty, MACAddress, INet4Address, INet6Address, String, EUI64 }; + enum Type { MulticastType, MACAddress, INet4Address, INet6Address, String, EUI64 }; - MIHFId(); ///< Create empty instance. + MIHFId(); ///< Create multicast id. MIHFId(senf::MACAddress const & addr); ///< Construct id with given MACAddress MIHFId(senf::INet4Address const & addr); ///< Construct id with given INet4Address MIHFId(senf::INet6Address const & addr); ///< Construct id with given INet6Address @@ -63,7 +62,7 @@ namespace senf { private: struct GetTypeVisitor : public boost::static_visitor { - Type operator()(boost::blank const &) const { return Empty; } + Type operator()(boost::blank const &) const { return MulticastType; } Type operator()(senf::MACAddress const &) const { return MACAddress; } Type operator()(senf::INet4Address const &) const { return INet4Address; } Type operator()(senf::INet6Address const &) const { return INet6Address; } diff --git a/senf/Packets/80221Bundle/TLVParser.cc b/senf/Packets/80221Bundle/TLVParser.cc index b5c70ec..78c43c0 100644 --- a/senf/Packets/80221Bundle/TLVParser.cc +++ b/senf/Packets/80221Bundle/TLVParser.cc @@ -139,7 +139,7 @@ prefix_ senf::MIHFId senf::MIHFIdTLVParser::valueAs(MIHFId::Type type) { if (length() == 0) return MIHFId(); switch (type) { - case MIHFId::Empty: + case MIHFId::MulticastType: return MIHFId(); case MIHFId::MACAddress: return MIHFId( valueAsMACAddress());