INET Framework for OMNeT++/OMNEST
inet::ApskProtocolDissector Class Reference

#include <ApskProtocolDissector.h>

Inheritance diagram for inet::ApskProtocolDissector:
inet::ProtocolDissector

Public Member Functions

virtual void dissect (Packet *packet, const Protocol *protocol, ICallback &callback) const override
 Dissects the packet according to the protocol implemented by this ProtocolDissector. More...
 

Member Function Documentation

◆ dissect()

void inet::ApskProtocolDissector::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 {
20  auto header = packet->popAtFront<ApskPhyHeader>();
21  callback.startProtocolDataUnit(&Protocol::apskPhy);
22  callback.visitChunk(header, &Protocol::apskPhy);
23  auto headerPaddingLength = header->getHeaderLengthField() - header->getChunkLength();
24  if (headerPaddingLength > b(0)) {
25  const auto& headerPadding = packet->popAtFront(headerPaddingLength);
26  callback.visitChunk(headerPadding, &Protocol::apskPhy);
27  }
28  auto trailerPaddingLength = packet->getDataLength() - header->getPayloadLengthField();
29  auto trailerPadding = trailerPaddingLength > b(0) ? packet->popAtBack(trailerPaddingLength) : nullptr;
30  auto payloadProtocol = header->getPayloadProtocol();
31  callback.dissectPacket(packet, payloadProtocol);
32  if (trailerPaddingLength > b(0))
33  callback.visitChunk(trailerPadding, &Protocol::apskPhy);
34  callback.endProtocolDataUnit(&Protocol::apskPhy);
35 }

The documentation for this class was generated from the following files:
inet::Protocol::apskPhy
static const Protocol apskPhy
Definition: Protocol.h:123
inet::units::values::b
value< int64_t, units::b > b
Definition: Units.h:1241