#include <RipProtocolPrinter.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::RipProtocolPrinter::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 packet = dynamicPtrCast<const RipPacket>(chunk)) {
21 context.infoColumn <<
"RIP: ";
22 switch (packet->getCommand()) {
24 context.infoColumn <<
"req ";
28 context.infoColumn <<
"resp ";
32 context.infoColumn <<
"unknown ";
35 unsigned int size = packet->getEntryArraySize();
36 for (
unsigned int i = 0; i < size; ++i) {
37 const RipEntry& entry = packet->getEntry(i);
39 context.infoColumn <<
"; ";
41 context.infoColumn <<
"...(" << size <<
" entries)";
44 context.infoColumn << entry.address <<
"/" << entry.prefixLength;
45 if (!entry.nextHop.isUnspecified())
46 context.infoColumn <<
"->" << entry.nextHop;
47 if (entry.metric == 16)
48 context.infoColumn <<
" unroutable";
50 context.infoColumn <<
" m=" << entry.metric;
54 context.infoColumn <<
"(RIP) " << chunk;
The documentation for this class was generated from the following files: