INET Framework for OMNeT++/OMNEST
inet::physicallayer::EthernetPhyProtocolDissector Class Reference

#include <EthernetPhyProtocolDissector.h>

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

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

Reimplemented from inet::DefaultProtocolDissector.

21 {
22  const auto& header = packet->popAtFront<EthernetPhyHeaderBase>();
23  callback.startProtocolDataUnit(&Protocol::ethernetPhy);
24  callback.visitChunk(header, &Protocol::ethernetPhy);
25  if (auto phyHeader = dynamicPtrCast<const EthernetFragmentPhyHeader>(header))
26  // the Ethernet MAC protocol cannot be dissected here because this is just a fragment of a complete packet
27  callback.dissectPacket(packet, nullptr);
28  else
29  callback.dissectPacket(packet, &Protocol::ethernetMac);
30  callback.endProtocolDataUnit(&Protocol::ethernetPhy);
31 }

The documentation for this class was generated from the following files:
inet::Protocol::ethernetMac
static const Protocol ethernetMac
Definition: Protocol.h:65
inet::Protocol::ethernetPhy
static const Protocol ethernetPhy
Definition: Protocol.h:66