A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
tcp-tx-buffer.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2010 Adrian Sai-wah Tam
4
*
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
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
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
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com>
19
*/
20
21
#ifndef TCP_TX_BUFFER_H
22
#define TCP_TX_BUFFER_H
23
24
#include <list>
25
#include "ns3/traced-value.h"
26
#include "ns3/trace-source-accessor.h"
27
#include "ns3/object.h"
28
#include "ns3/sequence-number.h"
29
#include "ns3/ptr.h"
30
31
namespace
ns3 {
32
class
Packet;
33
40
class
TcpTxBuffer
:
public
Object
41
{
42
public
:
43
static
TypeId
GetTypeId
(
void
);
44
TcpTxBuffer
(uint32_t n = 0);
45
virtual
~TcpTxBuffer
(
void
);
46
47
// Accessors
48
52
SequenceNumber32
HeadSequence
(
void
)
const
;
53
57
SequenceNumber32
TailSequence
(
void
)
const
;
58
62
uint32_t
Size
(
void
)
const
;
63
67
uint32_t
MaxBufferSize
(
void
)
const
;
68
72
void
SetMaxBufferSize
(uint32_t n);
73
77
uint32_t
Available
(
void
)
const
;
78
85
bool
Add
(
Ptr<Packet>
p);
86
90
uint32_t
SizeFromSequence
(
const
SequenceNumber32
& seq)
const
;
91
95
Ptr<Packet>
CopyFromSequence
(uint32_t numBytes,
const
SequenceNumber32
& seq);
96
101
void
SetHeadSequence
(
const
SequenceNumber32
& seq);
102
108
void
DiscardUpTo
(
const
SequenceNumber32
& seq);
109
110
private
:
111
typedef
std::list<Ptr<Packet> >::iterator
BufIterator
;
112
113
TracedValue<SequenceNumber32>
m_firstByteSeq
;
//< Sequence number of the first byte in data (SND.UNA)
114
uint32_t
m_size
;
//< Number of data bytes
115
uint32_t
m_maxBuffer
;
//< Max number of data bytes in buffer (SND.WND)
116
std::list<Ptr<Packet> >
m_data
;
//< Corresponding data (may be null)
117
};
118
119
}
// namepsace ns3
120
121
#endif
/* TCP_TX_BUFFER_H */
ns3::Ptr< Packet >
ns3::TcpTxBuffer::Size
uint32_t Size(void) const
Definition:
tcp-tx-buffer.cc:77
ns3::TcpTxBuffer::DiscardUpTo
void DiscardUpTo(const SequenceNumber32 &seq)
Definition:
tcp-tx-buffer.cc:208
ns3::TcpTxBuffer::SizeFromSequence
uint32_t SizeFromSequence(const SequenceNumber32 &seq) const
Definition:
tcp-tx-buffer.cc:121
ns3::TcpTxBuffer::HeadSequence
SequenceNumber32 HeadSequence(void) const
Definition:
tcp-tx-buffer.cc:65
ns3::TcpTxBuffer::MaxBufferSize
uint32_t MaxBufferSize(void) const
Definition:
tcp-tx-buffer.cc:83
ns3::TracedValue< SequenceNumber32 >
ns3::TcpTxBuffer::m_firstByteSeq
TracedValue< SequenceNumber32 > m_firstByteSeq
Definition:
tcp-tx-buffer.h:113
ns3::TcpTxBuffer::m_size
uint32_t m_size
Definition:
tcp-tx-buffer.h:114
ns3::TcpTxBuffer
class for keeping the data sent by the application to the TCP socket, i.e. the sending buffer...
Definition:
tcp-tx-buffer.h:40
ns3::TcpTxBuffer::SetMaxBufferSize
void SetMaxBufferSize(uint32_t n)
Definition:
tcp-tx-buffer.cc:89
ns3::TcpTxBuffer::Available
uint32_t Available(void) const
Definition:
tcp-tx-buffer.cc:95
ns3::SequenceNumber
Generic "sequence number" class.
Definition:
sequence-number.h:52
ns3::TcpTxBuffer::Add
bool Add(Ptr< Packet > p)
Definition:
tcp-tx-buffer.cc:101
ns3::TcpTxBuffer::GetTypeId
static TypeId GetTypeId(void)
Definition:
tcp-tx-buffer.cc:36
ns3::TcpTxBuffer::m_maxBuffer
uint32_t m_maxBuffer
Definition:
tcp-tx-buffer.h:115
ns3::Object
a base class which provides memory management and object aggregation
Definition:
object.h:63
ns3::TcpTxBuffer::TcpTxBuffer
TcpTxBuffer(uint32_t n=0)
Definition:
tcp-tx-buffer.cc:55
ns3::TcpTxBuffer::~TcpTxBuffer
virtual ~TcpTxBuffer(void)
Definition:
tcp-tx-buffer.cc:60
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::TcpTxBuffer::BufIterator
std::list< Ptr< Packet > >::iterator BufIterator
Definition:
tcp-tx-buffer.h:111
ns3::TcpTxBuffer::TailSequence
SequenceNumber32 TailSequence(void) const
Definition:
tcp-tx-buffer.cc:71
ns3::TcpTxBuffer::m_data
std::list< Ptr< Packet > > m_data
Definition:
tcp-tx-buffer.h:116
ns3::TcpTxBuffer::SetHeadSequence
void SetHeadSequence(const SequenceNumber32 &seq)
Definition:
tcp-tx-buffer.cc:201
ns3::TcpTxBuffer::CopyFromSequence
Ptr< Packet > CopyFromSequence(uint32_t numBytes, const SequenceNumber32 &seq)
Definition:
tcp-tx-buffer.cc:133
src
internet
model
tcp-tx-buffer.h
Generated on Sat Nov 16 2013 12:55:29 for ns-3 by
1.8.5