From 6191bda0985710e774e4f8cdeb014051fcbe2f1e Mon Sep 17 00:00:00 2001 From: Raj Bhattacharjea Date: Thu, 27 Mar 2008 12:27:41 -0400 Subject: [PATCH] Implement TcpHeader::Print (bug 151) --- src/internet-node/tcp-header.cc | 34 +++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/src/internet-node/tcp-header.cc b/src/internet-node/tcp-header.cc index f721082ca..f5c485999 100644 --- a/src/internet-node/tcp-header.cc +++ b/src/internet-node/tcp-header.cc @@ -150,11 +150,41 @@ TcpHeader::GetInstanceTypeId (void) const } void TcpHeader::Print (std::ostream &os) const { - //XXX + os << m_sourcePort << " > " << m_destinationPort; + if(m_flags!=0) + { + os<<" ["; + if((m_flags & FIN) != 0) + { + os<<" FIN "; + } + if((m_flags & SYN) != 0) + { + os<<" SYN "; + } + if((m_flags & RST) != 0) + { + os<<" RST "; + } + if((m_flags & PSH) != 0) + { + os<<" PSH "; + } + if((m_flags & ACK) != 0) + { + os<<" ACK "; + } + if((m_flags & URG) != 0) + { + os<<" URG "; + } + os<<"]"; + } + os<<" Seq="<