Skip to content

Commit

Permalink
ByteInFlight moved inside TcpTxBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
natale-p committed Jan 9, 2016
1 parent e7f2ca4 commit 0de8dbe
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/internet/model/tcp-socket-base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2516,7 +2516,13 @@ uint32_t
TcpSocketBase::BytesInFlight () const
{
NS_LOG_FUNCTION (this);
return m_highTxMark.Get () - m_txBuffer->HeadSequence ();
uint32_t old = m_highTxMark.Get () - m_txBuffer->HeadSequence ();
uint32_t newValue = m_txBuffer->BytesInFlight ();

NS_ABORT_MSG_UNLESS (old == newValue,
"What. Different value of inflight. Old=" << old <<
" new=" << newValue);
return newValue;
}

uint32_t
Expand Down
8 changes: 8 additions & 0 deletions src/internet/model/tcp-tx-buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ TcpTxBuffer::SizeFromSequence (const SequenceNumber32& seq) const
return 0;
}

uint32_t
TcpTxBuffer::BytesInFlight () const
{
NS_LOG_FUNCTION (this);

return m_sentSize;
}

Ptr<Packet>
TcpTxBuffer::CopyFromSequence (uint32_t numBytes, const SequenceNumber32& seq)
{
Expand Down
7 changes: 7 additions & 0 deletions src/internet/model/tcp-tx-buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ class TcpTxBuffer : public Object
*/
uint32_t SizeFromSequence (const SequenceNumber32& seq) const;

/**
* \brief Get the number of bytes stored inside SentList
*
* \return the number of bytes sent but not discarded
*/
uint32_t BytesInFlight () const;

/**
* \brief Copy data from the range [seq, seq+numBytes) into a packet
*
Expand Down

0 comments on commit 0de8dbe

Please sign in to comment.