///////////////////////////////cc.p////////////////////////////////////////
SENF_AUTO_UNIT_TEST(NDPMessage_create)
{
+ senf::dumpPacketRegistries(std::cout);
+
unsigned char data[] = {
0x60, 0x00, 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, //IPv6
0x20, 0x01, 0x08, 0x90, 0x06, 0x00, 0xff, 0xff,
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-
-namespace {
- SENF_PACKET_TLV_REGISTRY_REGISTER( senf::NDPSourceLLAddressTLVParser );
- SENF_PACKET_TLV_REGISTRY_REGISTER( senf::NDPTargetLLAddressTLVParser );
- SENF_PACKET_TLV_REGISTRY_REGISTER( senf::NDPPrefixInformationTLVParser );
- SENF_PACKET_TLV_REGISTRY_REGISTER( senf::NDPMTUTLVParser );
-}
+SENF_PACKET_TLV_REGISTRY_REGISTER( senf::NDPSourceLLAddressTLVParser );
+SENF_PACKET_TLV_REGISTRY_REGISTER( senf::NDPTargetLLAddressTLVParser );
+SENF_PACKET_TLV_REGISTRY_REGISTER( senf::NDPPrefixInformationTLVParser );
+SENF_PACKET_TLV_REGISTRY_REGISTER( senf::NDPMTUTLVParser );
prefix_ void senf::NDPSourceLLAddressTLVParser::dump(std::ostream & os) const
{
typedef GenericTLVParserRegistry<NDPOptionParser> Registry;
};
- typedef GenericTLVParserBase<NDPOptionParser> NDPGenericOptionParser;
+
+ struct NDPGenericOptionParser : public GenericTLVParserBase<NDPOptionParser>
+ {
+ typedef GenericTLVParserBase<NDPOptionParser> base;
+ NDPGenericOptionParser(data_iterator i, state_type s) : base(i,s) {}
+
+ senf::PacketParserBase::size_type bytes() const
+ {
+ return length()*8;
+ }
+ };
struct NDPSourceLLAddressTLVParser : public NDPOptionParser
{
type() = typeId;
length() = 1;
}
- static const UInt8Parser::value_type typeId = 0x02;
+
+ senf::PacketParserBase::size_type bytes(NDPTargetLLAddressTLVParser p) {
+ return length()*8;
+ }
+ static const type_t::value_type typeId = 0x02;
void dump(std::ostream & os) const;
};
reserved1() = 0;
reserved2() = 0;
}
+ senf::PacketParserBase::size_type bytes(NDPPrefixInformationTLVParser p) {
+ return length()*8;
+ }
static const UInt8Parser::value_type typeId = 0x03;
void dump(std::ostream & os) const;
};