RE: [Omnetpp-l] Creating a custom message definition

265 views
Skip to first unread message

Alfonso Ariza Quintana

unread,
Feb 14, 2021, 6:09:22 AM2/14/21
to omn...@googlegroups.com
This problem usually appears when you try to extract or peek a header incorrectly.

For example, you have two headers
MyHeader1, MyHeader2

And in the top is the MyHeader1
if you do
pkt->peekAtFront<MyHeader2>()
you will have the error that you have commented.

It is possible to do a roundabout using Chunk class that is the ancestor of all headers.

auto chunk = pkt->peekAtFront<Chunk>();
if (dynamicPtrCast<const MyHeader2>(chunk )){

}



De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de Asi Lev <asi...@gmail.com>
Enviado: sábado, 13 de febrero de 2021 21:38
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: [Omnetpp-l] Creating a custom message definition
 

Hello everyone,
I'm trying to create a custom inet Packet message.
I've created a .msg file which extends FieldsChunk.
I use it in some event before a packet is sent, adding my custom chunk before the packet is sent down to IP.
When it runs, I get the following error:
Implicit chunk serialization is disabled to prevent unpredictable performance degradation (you may consider changing the Chunk::enableImplicitChunkSerialization flag or passing the PF_ALLOW_SERIALIZATION flag to peek)

I set the "enableImplicitChunkSerialization" flag, and then I get the next error:
Cannot serialize Ipv4 header without a properly computed CRC

So I add *.host*.ipv4.ip.crcMode = "computed" to omnet.ini, but the problem persists.

I think what I actually need to do is create a custom serializer/desrializer to my custom packet, but the only documentation I can find is this:
And there's not enough information on how to create these serializers/deserializers.
Any help will help.
Thanks,
Asi

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/b465a8e4-73be-4b59-9bc0-b017710b5659n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages