#include <ProbabilisticProtocolDissector.h>
◆ dissect()
| void inet::ProbabilisticProtocolDissector::dissect |
( |
Packet * |
packet, |
|
|
const Protocol * |
protocol, |
|
|
ICallback & |
callback |
|
) |
| const |
|
overridevirtual |
Dissects the packet according to the protocol implemented by this ProtocolDissector.
Implements inet::ProtocolDissector.
19 auto header = packet->popAtFront<ProbabilisticBroadcastHeader>();
20 auto trailerPopOffset = packet->getBackOffset();
21 auto payloadEndOffset = packet->getFrontOffset() + header->getPayloadLengthField();
23 bool incorrect = (payloadEndOffset > trailerPopOffset);
25 callback.markIncorrect();
26 payloadEndOffset = trailerPopOffset;
29 packet->setBackOffset(payloadEndOffset);
30 callback.dissectPacket(packet, header->getProtocol());
31 if (incorrect && packet->getDataLength() >
b(0))
32 callback.dissectPacket(packet,
nullptr);
33 ASSERT(packet->getDataLength() ==
B(0));
34 packet->setFrontOffset(payloadEndOffset);
35 packet->setBackOffset(trailerPopOffset);
The documentation for this class was generated from the following files: