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

#include <IgmpProtocolPrinter.h>

Inheritance diagram for inet::IgmpProtocolPrinter:
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::IgmpProtocolPrinter::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.

20 {
21  if (auto header = dynamicPtrCast<const IgmpMessage>(chunk)) {
22  switch (header->getType()) {
24  if (auto header = dynamicPtrCast<const Igmpv1Query>(chunk)) {
25  context.infoColumn << "IGMPv1 QRY";
26  if (header->getGroupAddress().isUnspecified())
27  context.infoColumn << ", general";
28  else
29  context.infoColumn << ", group " << header->getGroupAddress();
30  }
31  else if (auto header = dynamicPtrCast<const Igmpv2Query>(chunk)) {
32  context.infoColumn << "IGMPv2 QRY";
33  if (header->getGroupAddress().isUnspecified())
34  context.infoColumn << ", general";
35  else
36  context.infoColumn << ", group " << header->getGroupAddress();
37  context.infoColumn << ", maxRespTime=" << SimTime(header->getMaxRespTimeCode(), (SimTimeUnit) - 1);
38  }
39  else if (auto header = dynamicPtrCast<const Igmpv3Query>(chunk)) {
40  context.infoColumn << "IGMPv3 QRY";
41  if (header->getGroupAddress().isUnspecified())
42  context.infoColumn << ", general";
43  else
44  context.infoColumn << ", group " << header->getGroupAddress();
45  context.infoColumn << ", maxRespTime=" << SimTime(Igmpv3::decodeTime(header->getMaxRespTimeCode()), (SimTimeUnit) - 1);
46  if (header->getSuppressRouterProc())
47  context.infoColumn << " Suppress";
48  context.infoColumn << ", QRV=" << header->getRobustnessVariable();
49  context.infoColumn << ", QQIC=" << SimTime(Igmpv3::decodeTime(header->getQueryIntervalCode()), SIMTIME_S);
50  if (header->getSourceList().size() > 0) {
51  context.infoColumn << ", SRC={";
52  for (auto it = header->getSourceList().begin(); it != header->getSourceList().end(); ++it) {
53  if (it != header->getSourceList().begin())
54  context.infoColumn << ", ";
55  context.infoColumn << *it;
56  }
57  context.infoColumn << "}";
58  }
59  }
60  else {
61  context.infoColumn << "IGMP QRY";
62  if (header->getGroupAddress().isUnspecified())
63  context.infoColumn << ", general";
64  else
65  context.infoColumn << ", group " << header->getGroupAddress();
66  }
67  break;
69  context.infoColumn << "IGMPv1 REPORT";
70  if (auto header = dynamicPtrCast<const Igmpv1Report>(chunk)) {
71  }
72  break;
74  context.infoColumn << "IGMPv2 REPORT";
75  if (auto header = dynamicPtrCast<const Igmpv2Report>(chunk)) {
76  }
77  break;
78  case IGMPV2_LEAVE_GROUP:
79  context.infoColumn << "IGMPv2 LEAVE";
80  if (auto header = dynamicPtrCast<const Igmpv2Leave>(chunk)) {
81  }
82  break;
84  context.infoColumn << "IGMPv3 REPORT";
85  if (auto header = dynamicPtrCast<const Igmpv3Report>(chunk)) {
86  }
87  break;
88  default:
89  context.infoColumn << " type=" << header->getType();
90  break;
91  }
92  }
93  else
94  context.infoColumn << "(IGMP) " << chunk;
95 }

The documentation for this class was generated from the following files:
inet::IGMPV3_MEMBERSHIP_REPORT
@ IGMPV3_MEMBERSHIP_REPORT
Definition: IgmpMessage_m.h:75
inet::IGMPV2_LEAVE_GROUP
@ IGMPV2_LEAVE_GROUP
Definition: IgmpMessage_m.h:74
inet::IGMP_MEMBERSHIP_QUERY
@ IGMP_MEMBERSHIP_QUERY
Definition: IgmpMessage_m.h:71
inet::Igmpv3::decodeTime
static uint16_t decodeTime(uint8_t code)
Function for computing the time value in seconds from an encoded value.
Definition: Igmpv3.cc:1359
inet::IGMPV2_MEMBERSHIP_REPORT
@ IGMPV2_MEMBERSHIP_REPORT
Definition: IgmpMessage_m.h:73
inet::IGMPV1_MEMBERSHIP_REPORT
@ IGMPV1_MEMBERSHIP_REPORT
Definition: IgmpMessage_m.h:72