#include <IcmpProtocolPrinter.h>
|
| 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...
|
| |
◆ print()
| void inet::IcmpProtocolPrinter::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 if (
auto header = dynamicPtrCast<const IcmpHeader>(chunk)) {
21 switch (header->getType()) {
23 context.typeColumn <<
"DEST-UN";
25 context.infoColumn <<
"code=" << header->getCode();
28 context.typeColumn <<
"TIME-EX";
30 context.infoColumn <<
"code=" << header->getCode();
33 context.typeColumn <<
"PAR-PROB";
35 context.infoColumn <<
"code=" << header->getCode();
38 context.typeColumn <<
"ECHO-REQ";
39 context.infoColumn <<
"code=" << header->getCode();
40 if (
auto echoHeader = dynamicPtrCast<const IcmpEchoRequest>(header))
41 context.infoColumn <<
" id=" << echoHeader->getIdentifier() <<
" seq=" << echoHeader->getSeqNumber();
44 context.typeColumn <<
"ECHO-REPLY";
45 context.infoColumn <<
"code=" << header->getCode();
46 if (
auto echoHeader = dynamicPtrCast<const IcmpEchoReply>(header))
47 context.infoColumn <<
" id=" << echoHeader->getIdentifier() <<
" seq=" << echoHeader->getSeqNumber();
50 context.infoColumn <<
"ICMP-" << header->getType() <<
"-" << header->getCode();
55 context.infoColumn <<
"(ICMP) " << chunk;
The documentation for this class was generated from the following files: