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

#include <ArpProtocolPrinter.h>

Inheritance diagram for inet::ArpProtocolPrinter:
inet::ProtocolPrinter

Public Member Functions

virtual void print (const Ptr< const Chunk > &chunk, const Protocol *protocol, const cMessagePrinter::Options *options, Context &context) const override
 Prints the given chunk of protocol according to options into context. More...
 

Member Function Documentation

◆ print()

void inet::ArpProtocolPrinter::print ( const Ptr< const Chunk > &  chunk,
const Protocol protocol,
const cMessagePrinter::Options *  options,
Context context 
) const
overridevirtual

Prints the given chunk of protocol according to options into context.

Implements inet::ProtocolPrinter.

19 {
20  if (auto arpPacket = dynamicPtrCast<const ArpPacket>(chunk)) {
21  context.infoColumn << arpPacket->str();
22  switch (arpPacket->getOpcode()) {
23  case ARP_REQUEST:
24  case ARP_RARP_REQUEST:
25  context.typeColumn << "REQUEST";
26  break;
27  case ARP_REPLY:
28  case ARP_RARP_REPLY:
29  context.typeColumn << "REPLY";
30  break;
31  }
32  }
33  else
34  context.infoColumn << "(ARP) " << chunk;
35 }

The documentation for this class was generated from the following files:
inet::ARP_REQUEST
@ ARP_REQUEST
Definition: ArpPacket_m.h:64
inet::ARP_REPLY
@ ARP_REPLY
Definition: ArpPacket_m.h:65
inet::ARP_RARP_REPLY
@ ARP_RARP_REPLY
Definition: ArpPacket_m.h:67
inet::ARP_RARP_REQUEST
@ ARP_RARP_REQUEST
Definition: ArpPacket_m.h:66