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-rx-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_RX_BUFFER_H
22
#define TCP_RX_BUFFER_H
23
24
#include <map>
25
#include "ns3/traced-value.h"
26
#include "ns3/trace-source-accessor.h"
27
#include "ns3/sequence-number.h"
28
#include "ns3/ptr.h"
29
#include "ns3/tcp-header.h"
30
31
namespace
ns3 {
32
class
Packet;
33
40
class
TcpRxBuffer
:
public
Object
41
{
42
public
:
43
static
TypeId
GetTypeId
(
void
);
44
TcpRxBuffer
(uint32_t n = 0);
45
virtual
~TcpRxBuffer
();
46
47
// Accessors
48
SequenceNumber32
NextRxSequence
(
void
)
const
;
49
SequenceNumber32
MaxRxSequence
(
void
)
const
;
50
void
IncNextRxSequence
(
void
);
51
void
SetNextRxSequence
(
const
SequenceNumber32
&
s
);
52
void
SetFinSequence
(
const
SequenceNumber32
& s);
53
uint32_t
MaxBufferSize
(
void
)
const
;
54
void
SetMaxBufferSize
(uint32_t s);
55
uint32_t
Size
(
void
)
const
;
56
uint32_t
Available
()
const
;
57
bool
Finished
(
void
);
58
68
bool
Add
(
Ptr<Packet>
p,
TcpHeader
const
& tcph);
69
74
Ptr<Packet>
Extract
(uint32_t maxSize);
75
public
:
76
typedef
std::map<SequenceNumber32, Ptr<Packet> >::iterator
BufIterator
;
77
TracedValue<SequenceNumber32>
m_nextRxSeq
;
//< Seqnum of the first missing byte in data (RCV.NXT)
78
SequenceNumber32
m_finSeq
;
//< Seqnum of the FIN packet
79
bool
m_gotFin
;
//< Did I received FIN packet?
80
uint32_t
m_size
;
//< Number of total data bytes in the buffer, not necessarily contiguous
81
uint32_t
m_maxBuffer
;
//< Upper bound of the number of data bytes in buffer (RCV.WND)
82
uint32_t
m_availBytes
;
//< Number of bytes available to read, i.e. contiguous block at head
83
std::map<SequenceNumber32, Ptr<Packet> >
m_data
;
84
//< Corresponding data (may be null)
85
};
86
87
}
//namepsace ns3
88
89
#endif
/* TCP_RX_BUFFER_H */
ns3::TcpRxBuffer::m_availBytes
uint32_t m_availBytes
Definition:
tcp-rx-buffer.h:82
ns3::TcpRxBuffer::m_maxBuffer
uint32_t m_maxBuffer
Definition:
tcp-rx-buffer.h:81
ns3::Ptr< Packet >
ns3::TcpRxBuffer::Add
bool Add(Ptr< Packet > p, TcpHeader const &tcph)
Definition:
tcp-rx-buffer.cc:137
ns3::TcpRxBuffer::m_nextRxSeq
TracedValue< SequenceNumber32 > m_nextRxSeq
Definition:
tcp-rx-buffer.h:77
ns3::TcpRxBuffer::Available
uint32_t Available() const
Definition:
tcp-rx-buffer.cc:90
ns3::TcpRxBuffer::SetFinSequence
void SetFinSequence(const SequenceNumber32 &s)
Definition:
tcp-rx-buffer.cc:121
ns3::TracedValue< SequenceNumber32 >
ns3::TcpRxBuffer::NextRxSequence
SequenceNumber32 NextRxSequence(void) const
Definition:
tcp-rx-buffer.cc:60
ns3::TcpRxBuffer::MaxRxSequence
SequenceNumber32 MaxRxSequence(void) const
Definition:
tcp-rx-buffer.cc:107
s
Ptr< SampleEmitter > s
Definition:
double-probe-test-suite.cc:51
ns3::TcpRxBuffer::IncNextRxSequence
void IncNextRxSequence(void)
Definition:
tcp-rx-buffer.cc:96
ns3::TcpRxBuffer::m_gotFin
bool m_gotFin
Definition:
tcp-rx-buffer.h:79
ns3::TcpRxBuffer
class for the reordering buffer that keeps the data from lower layer, i.e. TcpL4Protocol, sent to the application
Definition:
tcp-rx-buffer.h:40
ns3::TcpRxBuffer::SetNextRxSequence
void SetNextRxSequence(const SequenceNumber32 &s)
Definition:
tcp-rx-buffer.cc:66
ns3::TcpRxBuffer::SetMaxBufferSize
void SetMaxBufferSize(uint32_t s)
Definition:
tcp-rx-buffer.cc:78
ns3::TcpRxBuffer::TcpRxBuffer
TcpRxBuffer(uint32_t n=0)
Definition:
tcp-rx-buffer.cc:50
ns3::TcpRxBuffer::m_finSeq
SequenceNumber32 m_finSeq
Definition:
tcp-rx-buffer.h:78
ns3::TcpRxBuffer::Extract
Ptr< Packet > Extract(uint32_t maxSize)
Definition:
tcp-rx-buffer.cc:220
ns3::SequenceNumber< uint32_t, int32_t >
ns3::TcpHeader
Header for the Transmission Control Protocol.
Definition:
tcp-header.h:43
ns3::TcpRxBuffer::m_data
std::map< SequenceNumber32, Ptr< Packet > > m_data
Definition:
tcp-rx-buffer.h:83
ns3::TcpRxBuffer::MaxBufferSize
uint32_t MaxBufferSize(void) const
Definition:
tcp-rx-buffer.cc:72
ns3::TcpRxBuffer::m_size
uint32_t m_size
Definition:
tcp-rx-buffer.h:80
ns3::TcpRxBuffer::GetTypeId
static TypeId GetTypeId(void)
Definition:
tcp-rx-buffer.cc:31
ns3::Object
a base class which provides memory management and object aggregation
Definition:
object.h:63
ns3::TcpRxBuffer::Size
uint32_t Size(void) const
Definition:
tcp-rx-buffer.cc:84
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::TcpRxBuffer::~TcpRxBuffer
virtual ~TcpRxBuffer()
Definition:
tcp-rx-buffer.cc:55
ns3::TcpRxBuffer::Finished
bool Finished(void)
Definition:
tcp-rx-buffer.cc:131
ns3::TcpRxBuffer::BufIterator
std::map< SequenceNumber32, Ptr< Packet > >::iterator BufIterator
Definition:
tcp-rx-buffer.h:76
src
internet
model
tcp-rx-buffer.h
Generated on Sat Nov 16 2013 12:55:29 for ns-3 by
1.8.5