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

#include <IcmpProtocolDissector.h>

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

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

Implements inet::ProtocolDissector.

18 {
19  const auto& header = packet->popAtFront<IcmpHeader>();
20  callback.startProtocolDataUnit(&Protocol::icmpv4);
21  callback.visitChunk(header, &Protocol::icmpv4);
22  switch (header->getType()) {
24  case ICMP_TIME_EXCEEDED:
26  // TODO packet contains a complete Ipv4Header and the first 8 bytes of transport header (or icmp). (protocol specified in Ipv4Header.)
27  callback.dissectPacket(packet, nullptr);
28  break;
29  }
30  default:
31  callback.dissectPacket(packet, nullptr);
32  break;
33  }
34  callback.endProtocolDataUnit(&Protocol::icmpv4);
35 }

The documentation for this class was generated from the following files:
inet::ICMP_DESTINATION_UNREACHABLE
@ ICMP_DESTINATION_UNREACHABLE
Definition: IcmpHeader_m.h:77
inet::ICMP_PARAMETER_PROBLEM
@ ICMP_PARAMETER_PROBLEM
Definition: IcmpHeader_m.h:84
inet::Protocol::icmpv4
static const Protocol icmpv4
Definition: Protocol.h:71
inet::ICMP_TIME_EXCEEDED
@ ICMP_TIME_EXCEEDED
Definition: IcmpHeader_m.h:83