merge with HEAD

This commit is contained in:
Mathieu Lacage
2008-03-27 12:21:58 -07:00

View File

@@ -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="<<m_sequenceNumber<<" Ack="<<m_ackNumber<<" Win="<<m_windowSize;
}
uint32_t TcpHeader::GetSerializedSize (void) const
{
return 20; //tcp headers are 20 bytes
return 4*m_length;
}
void TcpHeader::Serialize (Buffer::Iterator start) const
{