#include <UdpProtocolDissector.h>
◆ dissect()
| void inet::UdpProtocolDissector::dissect |
( |
Packet * |
packet, |
|
|
const Protocol * |
protocol, |
|
|
ICallback & |
callback |
|
) |
| const |
|
overridevirtual |
Dissects the packet according to the protocol implemented by this ProtocolDissector.
Implements inet::ProtocolDissector.
21 auto originalTrailerPopOffset = packet->getBackOffset();
22 auto udpHeaderOffset = packet->getFrontOffset();
23 auto header = packet->popAtFront<UdpHeader>();
27 callback.markIncorrect();
29 auto udpPayloadEndOffset = udpHeaderOffset +
B(header->getTotalLengthField());
30 packet->setBackOffset(udpPayloadEndOffset);
32 if (dataProtocol ==
nullptr)
34 callback.dissectPacket(packet, dataProtocol);
35 ASSERT(packet->getDataLength() ==
B(0));
36 packet->setFrontOffset(udpPayloadEndOffset);
37 packet->setBackOffset(originalTrailerPopOffset);
The documentation for this class was generated from the following files: