src/internet/model/tcp-rx-buffer.h
author Brian Swenson <bswenson3@gatech.edu>
Tue, 22 Apr 2014 11:52:55 -0400
changeset 10694 4af272d94cfd
parent 10440 1e48ff9185f1
permissions -rw-r--r--
Bug 1791
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     2
/*
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     3
 * Copyright (c) 2010 Adrian Sai-wah Tam
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     4
 *
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     8
 *
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    12
 * GNU General Public License for more details.
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    13
 *
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    17
 *
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    18
 * Author: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com>
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    19
 */
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    20
7353
09fccf6195ea bug 1203: Inconsistently named ifndef/define macros in ns-3 headers
Vedran Miletic <rivanvx@gmail.com>
parents: 7176
diff changeset
    21
#ifndef TCP_RX_BUFFER_H
09fccf6195ea bug 1203: Inconsistently named ifndef/define macros in ns-3 headers
Vedran Miletic <rivanvx@gmail.com>
parents: 7176
diff changeset
    22
#define TCP_RX_BUFFER_H
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    23
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    24
#include <map>
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    25
#include "ns3/traced-value.h"
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    26
#include "ns3/trace-source-accessor.h"
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    27
#include "ns3/sequence-number.h"
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    28
#include "ns3/ptr.h"
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    29
#include "ns3/tcp-header.h"
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    30
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    31
namespace ns3 {
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    32
class Packet;
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    33
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    34
/**
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    35
 * \ingroup tcp
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    36
 *
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    37
 * \brief class for the reordering buffer that keeps the data from lower layer, i.e.
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    38
 *        TcpL4Protocol, sent to the application
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    39
 */
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    40
class TcpRxBuffer : public Object
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    41
{
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    42
public:
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    43
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    44
   * \brief Get the type ID.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    45
   * \return the object TypeId
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    46
   */
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    47
  static TypeId GetTypeId (void);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    48
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    49
   * \brief Constructor
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    50
   * \param n initial Sequence number to be received
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    51
   */
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    52
  TcpRxBuffer (uint32_t n = 0);
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    53
  virtual ~TcpRxBuffer ();
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    54
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    55
  // Accessors
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    56
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    57
   * \brief Get Next Rx Sequence number
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    58
   * \returns Next Rx Sequence number
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    59
   */
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    60
  SequenceNumber32 NextRxSequence (void) const;
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    61
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    62
   * \brief Get the lowest sequence number that this TcpRxBuffer cannot accept
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    63
   * \returns the lowest sequence number that this TcpRxBuffer cannot accept
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    64
   */
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    65
  SequenceNumber32 MaxRxSequence (void) const;
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    66
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    67
   * \brief Increment the Next Sequence number
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    68
   */
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    69
  void IncNextRxSequence (void);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    70
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    71
   * \brief Set the Next Sequence number
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    72
   * \param s the Sequence number
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    73
   */
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    74
  void SetNextRxSequence (const SequenceNumber32& s);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    75
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    76
   * \brief Set the FIN Sequence number (i.e., the one closing the connection)
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    77
   * \param s the Sequence number
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    78
   */
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    79
  void SetFinSequence (const SequenceNumber32& s);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    80
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    81
   * \brief Get the Maximum buffer size
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    82
   * \returns the Maximum buffer size
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    83
   */
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    84
  uint32_t MaxBufferSize (void) const;
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    85
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    86
   * \brief Set the Maximum buffer size
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    87
   * \param s the Maximum buffer size
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    88
   */
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    89
  void SetMaxBufferSize (uint32_t s);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    90
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    91
   * \brief Get the actual buffer occupancy
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    92
   * \returns buffer occupancy (in bytes)
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    93
   */
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    94
  uint32_t Size (void) const;
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    95
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    96
   * \brief Get the actual number of bytes available to be read
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    97
   * \returns size of available data (in bytes)
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
    98
   */
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    99
  uint32_t Available () const;
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   100
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   101
   * \brief Check if the buffer did receive all the data (and the connection is closed)
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   102
   * \returns true if all data have been received
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   103
   */
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   104
  bool Finished (void);
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   105
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   106
  /**
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   107
   * Insert a packet into the buffer and update the availBytes counter to
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   108
   * reflect the number of bytes ready to send to the application. This
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   109
   * function handles overlap by triming the head of the inputted packet and
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   110
   * removing data from the buffer that overlaps the tail of the inputted
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   111
   * packet
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   112
   *
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   113
   * \param p packet
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   114
   * \param tcph packet's TCP header
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   115
   * \return True when success, false otherwise.
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   116
   */
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   117
  bool Add (Ptr<Packet> p, TcpHeader const& tcph);
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   118
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   119
  /**
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   120
   * Extract data from the head of the buffer as indicated by nextRxSeq.
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   121
   * The extracted data is going to be forwarded to the application.
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   122
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   123
   * \param maxSize maximum number of bytes to extract
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   124
   * \returns a packet
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   125
   */
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   126
  Ptr<Packet> Extract (uint32_t maxSize);
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   127
public:
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   128
  /// container for data stored in the buffer
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   129
  typedef std::map<SequenceNumber32, Ptr<Packet> >::iterator BufIterator;
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   130
  TracedValue<SequenceNumber32> m_nextRxSeq; //!< Seqnum of the first missing byte in data (RCV.NXT)
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   131
  SequenceNumber32 m_finSeq;                 //!< Seqnum of the FIN packet
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   132
  bool m_gotFin;                             //!< Did I received FIN packet?
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   133
  uint32_t m_size;                           //!< Number of total data bytes in the buffer, not necessarily contiguous
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   134
  uint32_t m_maxBuffer;                      //!< Upper bound of the number of data bytes in buffer (RCV.WND)
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   135
  uint32_t m_availBytes;                     //!< Number of bytes available to read, i.e. contiguous block at head
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7353
diff changeset
   136
  std::map<SequenceNumber32, Ptr<Packet> > m_data; //!< Corresponding data (may be null)
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   137
};
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   138
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   139
} //namepsace ns3
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
   140
7353
09fccf6195ea bug 1203: Inconsistently named ifndef/define macros in ns-3 headers
Vedran Miletic <rivanvx@gmail.com>
parents: 7176
diff changeset
   141
#endif /* TCP_RX_BUFFER_H */