tcp: SackBlock can be printed with NS_LOG macro

This commit is contained in:
Natale Patriciello
2018-02-25 11:40:22 +01:00
parent adc9872391
commit b8478298f7
2 changed files with 18 additions and 0 deletions

View File

@@ -156,4 +156,13 @@ TcpOptionSack::GetSackList (void) const
return m_sackList;
}
std::ostream &
operator<< (std::ostream & os, TcpOptionSack::SackBlock const & sackBlock)
{
std::stringstream ss;
ss << "[" << sackBlock.first << ";" << sackBlock.second << "]";
os << ss.str ();
return os;
}
} // namespace ns3

View File

@@ -96,6 +96,15 @@ protected:
SackList m_sackList; //!< the list of SACK blocks
};
/**
* \brief Output operator.
* \param os The output stream.
* \param sackBlock the block to print.
* \returns The output stream.
*/
std::ostream & operator<< (std::ostream & os,
TcpOptionSack::SackBlock const & sackBlock);
} // namespace ns3
#endif /* TCP_OPTION_SACK */