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_
///////////////////////////////cc.p////////////////////////////////////////
senf::MIHFId const senf::MIHFId::Multicast;
-senf::MIHFId const senf::MIHFId::None;
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
{
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
private:
struct GetTypeVisitor : public boost::static_visitor<Type> {
- 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; }