View | Details | Raw Unified | Return to bug 2263
Collapse All | Expand All

(-)a/src/internet/model/tcp-header.cc (+6 lines)
 Lines 482-487   TcpHeader::AppendOption (Ptr<TcpOption> option) Link Here 
482
  return false;
482
  return false;
483
}
483
}
484
484
485
const TcpHeader::TcpOptionList&
486
TcpHeader::GetOptionList () const
487
{
488
  return m_options;
489
}
490
485
Ptr<TcpOption>
491
Ptr<TcpOption>
486
TcpHeader::GetOption (uint8_t kind) const
492
TcpHeader::GetOption (uint8_t kind) const
487
{
493
{
(-)a/src/internet/model/tcp-header.h (-1 / +8 lines)
 Lines 47-52   public: Link Here 
47
  TcpHeader ();
47
  TcpHeader ();
48
  virtual ~TcpHeader ();
48
  virtual ~TcpHeader ();
49
49
50
  typedef std::list< Ptr<TcpOption> > TcpOptionList; //!< List of TcpOption
51
50
  /**
52
  /**
51
   * \brief Print a TCP header into an output stream
53
   * \brief Print a TCP header into an output stream
52
   *
54
   *
 Lines 186-191   public: Link Here 
186
  Ptr<TcpOption> GetOption (uint8_t kind) const;
188
  Ptr<TcpOption> GetOption (uint8_t kind) const;
187
189
188
  /**
190
  /**
191
   * \brief Get the list of option in this header
192
   * \return a const reference to the option list
193
   */
194
  const TcpOptionList& GetOptionList (void) const;
195
196
  /**
189
   * \brief Get the total length of appended options
197
   * \brief Get the total length of appended options
190
   * \return the total length of options appended to this TcpHeader
198
   * \return the total length of options appended to this TcpHeader
191
   */
199
   */
 Lines 341-347   private: Link Here 
341
  bool m_goodChecksum;    //!< Flag to indicate that checksum is correct
349
  bool m_goodChecksum;    //!< Flag to indicate that checksum is correct
342
350
343
  static const uint8_t m_maxOptionsLen = 40;         //!< Maximum options length
351
  static const uint8_t m_maxOptionsLen = 40;         //!< Maximum options length
344
  typedef std::list< Ptr<TcpOption> > TcpOptionList; //!< List of TcpOption
345
  TcpOptionList m_options;     //!< TcpOption present in the header
352
  TcpOptionList m_options;     //!< TcpOption present in the header
346
  uint8_t m_optionsLen;        //!< Tcp options length.
353
  uint8_t m_optionsLen;        //!< Tcp options length.
347
};
354
};
(-)a/src/internet/model/tcp-socket-base.cc (+16 lines)
 Lines 1373-1378   TcpSocketBase::ProcessEstablished (Ptr<Packet> packet, const TcpHeader& tcpHeade Link Here 
1373
    }
1373
    }
1374
}
1374
}
1375
1375
1376
void
1377
TcpSocketBase::ReadOptions (const TcpHeader &tcpHeader)
1378
{
1379
  NS_LOG_FUNCTION (this << tcpHeader);
1380
  TcpHeader::TcpOptionList::const_iterator it;
1381
  const TcpHeader::TcpOptionList options = tcpHeader.GetOptionList ();
1382
1383
  for (it = options.begin (); it != options.end (); ++it)
1384
    {
1385
      const Ptr<TcpOption> option = (*it);
1386
      // Placeholder for a switch statement
1387
    }
1388
}
1389
1376
/* Process the newly received ACK */
1390
/* Process the newly received ACK */
1377
void
1391
void
1378
TcpSocketBase::ReceivedAck (Ptr<Packet> packet, const TcpHeader& tcpHeader)
1392
TcpSocketBase::ReceivedAck (Ptr<Packet> packet, const TcpHeader& tcpHeader)
 Lines 1382-1387   TcpSocketBase::ReceivedAck (Ptr<Packet> packet, const TcpHeader& tcpHeader) Link Here 
1382
  NS_ASSERT (0 != (tcpHeader.GetFlags () & TcpHeader::ACK));
1396
  NS_ASSERT (0 != (tcpHeader.GetFlags () & TcpHeader::ACK));
1383
  NS_ASSERT (m_tcb->m_segmentSize > 0);
1397
  NS_ASSERT (m_tcb->m_segmentSize > 0);
1384
1398
1399
  ReadOptions (tcpHeader);
1400
1385
  SequenceNumber32 ackNumber = tcpHeader.GetAckNumber ();
1401
  SequenceNumber32 ackNumber = tcpHeader.GetAckNumber ();
1386
  uint32_t bytesAcked = ackNumber - m_txBuffer->HeadSequence ();
1402
  uint32_t bytesAcked = ackNumber - m_txBuffer->HeadSequence ();
1387
  uint32_t segsAcked  = bytesAcked / m_tcb->m_segmentSize;
1403
  uint32_t segsAcked  = bytesAcked / m_tcb->m_segmentSize;
(-)a/src/internet/model/tcp-socket-base.h (-1 / +10 lines)
 Lines 831-837   protected: Link Here 
831
   *
831
   *
832
   * \param tcpHeader TcpHeader to add options to
832
   * \param tcpHeader TcpHeader to add options to
833
   */
833
   */
834
  virtual void AddOptions (TcpHeader& tcpHeader);
834
  void AddOptions (TcpHeader& tcpHeader);
835
836
  /**
837
   * \brief Read TCP options begore Ack processing
838
   *
839
   * Timestamp and Window scale are managed in other pieces of code.
840
   *
841
   * \param tcpHeader Header of the segment
842
   */
843
  void ReadOptions (const TcpHeader &tcpHeader);
835
844
836
  /**
845
  /**
837
   * \brief Read and parse the Window scale option
846
   * \brief Read and parse the Window scale option

Return to bug 2263