LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2010 Adrian Sai-wah Tam | 3 * Copyright (c) 2010 Adrian Sai-wah Tam |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software | 15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 * Author: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com> | 18 * Author: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com> |
19 */ | 19 */ |
20 | 20 |
21 #ifndef __TCP_TX_BUFFER_H__ | 21 #ifndef __TCP_TX_BUFFER_H__ |
22 #define __TCP_TX_BUFFER_H__ | 22 #define __TCP_TX_BUFFER_H__ |
23 | 23 |
24 #include <list> | 24 #include <list> |
| 25 #include "ns3/traced-value.h" |
| 26 #include "ns3/trace-source-accessor.h" |
| 27 #include "ns3/object.h" |
25 #include "ns3/sequence-number.h" | 28 #include "ns3/sequence-number.h" |
26 #include "ns3/ptr.h" | 29 #include "ns3/ptr.h" |
27 | 30 |
28 namespace ns3 { | 31 namespace ns3 { |
29 class Packet; | 32 class Packet; |
30 | 33 |
31 /** | 34 /** |
32 * \ingroup tcp | 35 * \ingroup tcp |
33 * | 36 * |
34 * \brief class for keeping the data sent by the application to the TCP socket,
i.e. | 37 * \brief class for keeping the data sent by the application to the TCP socket,
i.e. |
35 * the sending buffer. | 38 * the sending buffer. |
36 */ | 39 */ |
37 class TcpTxBuffer | 40 class TcpTxBuffer : public Object |
38 { | 41 { |
39 public: | 42 public: |
| 43 static TypeId GetTypeId (void); |
40 TcpTxBuffer (uint32_t n = 0); | 44 TcpTxBuffer (uint32_t n = 0); |
41 virtual ~TcpTxBuffer (void); | 45 virtual ~TcpTxBuffer (void); |
42 | 46 |
43 // Accessors | 47 // Accessors |
44 | 48 |
45 /** | 49 /** |
46 * Returns the first byte's sequence number | 50 * Returns the first byte's sequence number |
47 */ | 51 */ |
48 SequenceNumber32 HeadSequence (void) const; | 52 SequenceNumber32 HeadSequence (void) const; |
49 | 53 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 /** | 103 /** |
100 * Discard data up to but not including this sequence number. | 104 * Discard data up to but not including this sequence number. |
101 * | 105 * |
102 * \param seq The sequence number of the head byte | 106 * \param seq The sequence number of the head byte |
103 */ | 107 */ |
104 void DiscardUpTo (const SequenceNumber32& seq); | 108 void DiscardUpTo (const SequenceNumber32& seq); |
105 | 109 |
106 private: | 110 private: |
107 typedef std::list<Ptr<Packet> >::iterator BufIterator; | 111 typedef std::list<Ptr<Packet> >::iterator BufIterator; |
108 | 112 |
109 SequenceNumber32 m_firstByteSeq; //< Sequence number of the first byte in da
ta (SND.UNA) | 113 TracedValue<SequenceNumber32> m_firstByteSeq; //< Sequence number of the first
byte in data (SND.UNA) |
110 uint32_t m_size; //< Number of data bytes | 114 uint32_t m_size; //< Number of data bytes |
111 uint32_t m_maxBuffer; //< Max number of data bytes in buffer (SND.W
ND) | 115 uint32_t m_maxBuffer; //< Max number of data bytes in
buffer (SND.WND) |
112 std::list<Ptr<Packet> > m_data; //< Corresponding data (may be null) | 116 std::list<Ptr<Packet> > m_data; //< Corresponding data (may be n
ull) |
113 }; | 117 }; |
114 | 118 |
115 } // namepsace ns3 | 119 } // namepsace ns3 |
116 | 120 |
117 #endif | 121 #endif |
LEFT | RIGHT |