#include <TcpProtocolPrinter.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::TcpProtocolPrinter::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.
22 if (
auto header = dynamicPtrCast<const TcpHeader>(chunk)) {
23 context.sourceColumn << header->getSrcPort();
24 context.destinationColumn << header->getDestPort();
25 static const char *flagStart =
" [";
26 static const char *flagSepar =
" ";
27 static const char *flagEnd =
"]";
28 context.infoColumn << header->getSrcPort() <<
"->" << header->getDestPort();
29 const char *separ = flagStart;
30 if (header->getUrgBit()) {
31 context.infoColumn << separ <<
"Urg=" << header->getUrgentPointer();
34 if (header->getSynBit()) {
35 context.infoColumn << separ <<
"Syn";
38 if (header->getAckBit()) {
39 context.infoColumn << separ <<
"Ack=" << header->getAckNo();
42 if (header->getPshBit()) {
43 context.infoColumn << separ <<
"Psh";
46 if (header->getRstBit()) {
47 context.infoColumn << separ <<
"Rst";
50 if (header->getFinBit()) {
51 context.infoColumn << separ <<
"Fin";
54 if (separ == flagSepar)
55 context.infoColumn << flagEnd;
57 context.infoColumn <<
" Seq=" << header->getSequenceNo()
58 <<
" Win=" << header->getWindow();
62 context.infoColumn <<
"(TCP) " << chunk;
The documentation for this class was generated from the following files: