#include <UdpProtocolPrinter.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::UdpProtocolPrinter::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 UdpHeader>(chunk)) {
21 context.sourceColumn << header->getSrcPort();
22 context.destinationColumn << header->getDestPort();
23 context.infoColumn << header->getSrcPort() <<
"->" << header->getDestPort() <<
", payload:" << (
B(header->getTotalLengthField()) - header->getChunkLength());
26 context.infoColumn <<
"(UDP) " << chunk;
The documentation for this class was generated from the following files: