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

#include <Ieee80211PhyProtocolDissector.h>

Inheritance diagram for inet::Ieee80211PhyProtocolDissector:
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::Ieee80211PhyProtocolDissector::dissect ( Packet packet,
const Protocol protocol,
ICallback callback 
) const
overridevirtual

Dissects the packet according to the protocol implemented by this ProtocolDissector.

Implements inet::ProtocolDissector.

30 {
31  auto protocolTag = packet->getTag<PacketProtocolTag>()->getProtocol();
32  callback.startProtocolDataUnit(protocolTag);
33  auto originalBackOffset = packet->getBackOffset();
34  auto payloadEndOffset = packet->getFrontOffset();
36  callback.visitChunk(header, protocolTag);
37  payloadEndOffset += header->getChunkLength() + header->getLengthField();
38  bool incorrect = (payloadEndOffset > originalBackOffset || b(header->getLengthField()) < header->getChunkLength());
39  if (incorrect) {
40  callback.markIncorrect();
41  payloadEndOffset = originalBackOffset;
42  }
43  packet->setBackOffset(payloadEndOffset);
44  callback.dissectPacket(packet, &Protocol::ieee80211Mac);
45  packet->setBackOffset(originalBackOffset);
46  auto paddingLength = packet->getDataLength();
47  if (paddingLength > b(0)) {
48  const auto& padding = packet->popAtFront(paddingLength);
49  callback.visitChunk(padding, protocolTag);
50  }
51  callback.endProtocolDataUnit(protocolTag);
52 }

The documentation for this class was generated from the following files:
inet::physicallayer::Ieee80211Radio::popIeee80211PhyHeaderAtFront
static const Ptr< const Ieee80211PhyHeader > popIeee80211PhyHeaderAtFront(Packet *packet, b length=b(-1), int flags=0)
Definition: Ieee80211Radio.cc:283
PacketProtocolTag
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down PacketProtocolTag
Definition: IUdp-gates.txt:25
inet::units::values::b
value< int64_t, units::b > b
Definition: Units.h:1241
inet::Chunk::PF_ALLOW_INCORRECT
@ PF_ALLOW_INCORRECT
Definition: Chunk.h:281
inet::Protocol::ieee80211Mac
static const Protocol ieee80211Mac
Definition: Protocol.h:79