A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
wimax-connection.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007,2008, 2009 INRIA, UDcast
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
18
* Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19
*/
20
21
#ifndef WIMAX_CONNECTION_H
22
#define WIMAX_CONNECTION_H
23
24
#include "
cid.h
"
25
#include "
service-flow.h
"
26
#include "
wimax-mac-header.h
"
27
#include "
wimax-mac-queue.h
"
28
29
#include "ns3/object.h"
30
31
#include <ostream>
32
#include <stdint.h>
33
34
namespace
ns3
35
{
36
37
class
ServiceFlow;
38
class
Cid;
39
40
/**
41
* \ingroup wimax
42
* Class to represent WiMAX connections
43
*/
44
class
WimaxConnection
:
public
Object
45
{
46
public
:
47
/**
48
* \brief Get the type ID.
49
* \return the object TypeId
50
*/
51
static
TypeId
GetTypeId
();
52
53
/**
54
* Constructor
55
*
56
* \param cid connection ID
57
* \param type CID type
58
*/
59
WimaxConnection
(
Cid
cid,
Cid::Type
type);
60
~WimaxConnection
()
override
;
61
62
/**
63
* Get CID function
64
* \returns the CID
65
*/
66
Cid
GetCid
()
const
;
67
68
/**
69
* Get type function
70
* \returns the type
71
*/
72
Cid::Type
GetType
()
const
;
73
/**
74
* \return the queue of the connection
75
*/
76
Ptr<WimaxMacQueue>
GetQueue
()
const
;
77
/**
78
* \brief set the service flow associated to this connection
79
* \param serviceFlow The service flow to be associated to this connection
80
*/
81
void
SetServiceFlow
(
ServiceFlow
* serviceFlow);
82
/**
83
* \return the service flow associated to this connection
84
*/
85
ServiceFlow
*
GetServiceFlow
()
const
;
86
87
// wrapper functions
88
/**
89
* \return the scheduling type of this connection
90
*/
91
uint8_t
GetSchedulingType
()
const
;
92
/**
93
* \brief enqueue a packet in the queue of the connection
94
* \param packet the packet to be enqueued
95
* \param hdrType the header type of the packet
96
* \param hdr the header of the packet
97
* \return true if successful
98
*/
99
bool
Enqueue
(
Ptr<Packet>
packet,
const
MacHeaderType
& hdrType,
const
GenericMacHeader
& hdr);
100
/**
101
* \brief dequeue a packet from the queue of the connection
102
* \param packetType the type of the packet to dequeue
103
* \return packet dequeued
104
*/
105
Ptr<Packet>
Dequeue
(
MacHeaderType::HeaderType
packetType =
MacHeaderType::HEADER_TYPE_GENERIC
);
106
/**
107
* \brief dequeue a packet from the queue of the connection
108
* Dequeue the first packet in the queue if its size is lower than
109
* availableByte, the first availableByte of the first packet otherwise
110
*
111
* \param packetType the type of the packet to dequeue
112
* \param availableByte the number of available bytes
113
* \return packet dequeued
114
*/
115
Ptr<Packet>
Dequeue
(
MacHeaderType::HeaderType
packetType,
uint32_t
availableByte);
116
/**
117
* \return true if the connection has at least one packet in its queue, false otherwise
118
*/
119
bool
HasPackets
()
const
;
120
/**
121
* \return true if the connection has at least one packet of type packetType in its queue, false
122
* otherwise
123
* \param packetType type of packet to check in the queue
124
* \return true if packets available
125
*/
126
bool
HasPackets
(
MacHeaderType::HeaderType
packetType)
const
;
127
128
/**
129
* Get type string
130
* \returns the type string
131
*/
132
std::string
GetTypeStr
()
const
;
133
134
/// Definition of Fragments Queue data type
135
typedef
std::list<Ptr<const Packet>>
FragmentsQueue
;
136
/**
137
* \brief get a queue of received fragments
138
* \returns the fragments queue
139
*/
140
const
FragmentsQueue
GetFragmentsQueue
()
const
;
141
/**
142
* \brief enqueue a received packet (that is a fragment) into the fragments queue
143
* \param fragment received fragment
144
*/
145
void
FragmentEnqueue
(
Ptr<const Packet>
fragment);
146
/**
147
* \brief delete all enqueued fragments
148
*/
149
void
ClearFragmentsQueue
();
150
151
private
:
152
void
DoDispose
()
override
;
153
154
Cid
m_cid
;
///< CID
155
Cid::Type
m_cidType
;
///< CID type
156
Ptr<WimaxMacQueue>
m_queue
;
///< queue
157
ServiceFlow
*
m_serviceFlow
;
///< service flow
158
159
// FragmentsQueue stores all received fragments
160
FragmentsQueue
m_fragmentsQueue
;
///< fragments queue
161
};
162
163
}
// namespace ns3
164
165
#endif
/* WIMAX_CONNECTION_H */
cid.h
ns3::Cid
Cid class.
Definition:
cid.h:37
ns3::Cid::Type
Type
Type enumeration.
Definition:
cid.h:41
ns3::GenericMacHeader
This class implements the Generic mac Header as described by IEEE Standard for Local and metropolitan...
Definition:
wimax-mac-header.h:114
ns3::MacHeaderType
This class Represents the HT (Header Type) field of generic MAC and bandwidth request headers.
Definition:
wimax-mac-header.h:38
ns3::MacHeaderType::HeaderType
HeaderType
Header type enumeration.
Definition:
wimax-mac-header.h:42
ns3::MacHeaderType::HEADER_TYPE_GENERIC
@ HEADER_TYPE_GENERIC
Definition:
wimax-mac-header.h:43
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::ServiceFlow
This class implements service flows as described by the IEEE-802.16 standard.
Definition:
service-flow.h:43
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::WimaxConnection
Class to represent WiMAX connections.
Definition:
wimax-connection.h:45
ns3::WimaxConnection::m_serviceFlow
ServiceFlow * m_serviceFlow
service flow
Definition:
wimax-connection.h:157
ns3::WimaxConnection::Enqueue
bool Enqueue(Ptr< Packet > packet, const MacHeaderType &hdrType, const GenericMacHeader &hdr)
enqueue a packet in the queue of the connection
Definition:
wimax-connection.cc:126
ns3::WimaxConnection::GetTypeStr
std::string GetTypeStr() const
Get type string.
Definition:
wimax-connection.cc:158
ns3::WimaxConnection::GetServiceFlow
ServiceFlow * GetServiceFlow() const
Definition:
wimax-connection.cc:114
ns3::WimaxConnection::DoDispose
void DoDispose() override
Destructor implementation.
Definition:
wimax-connection.cc:83
ns3::WimaxConnection::GetType
Cid::Type GetType() const
Get type function.
Definition:
wimax-connection.cc:96
ns3::WimaxConnection::Dequeue
Ptr< Packet > Dequeue(MacHeaderType::HeaderType packetType=MacHeaderType::HEADER_TYPE_GENERIC)
dequeue a packet from the queue of the connection
Definition:
wimax-connection.cc:134
ns3::WimaxConnection::ClearFragmentsQueue
void ClearFragmentsQueue()
delete all enqueued fragments
Definition:
wimax-connection.cc:195
ns3::WimaxConnection::GetCid
Cid GetCid() const
Get CID function.
Definition:
wimax-connection.cc:90
ns3::WimaxConnection::GetSchedulingType
uint8_t GetSchedulingType() const
Definition:
wimax-connection.cc:120
ns3::WimaxConnection::m_cid
Cid m_cid
CID.
Definition:
wimax-connection.h:154
ns3::WimaxConnection::SetServiceFlow
void SetServiceFlow(ServiceFlow *serviceFlow)
set the service flow associated to this connection
Definition:
wimax-connection.cc:108
ns3::WimaxConnection::GetQueue
Ptr< WimaxMacQueue > GetQueue() const
Definition:
wimax-connection.cc:102
ns3::WimaxConnection::m_queue
Ptr< WimaxMacQueue > m_queue
queue
Definition:
wimax-connection.h:156
ns3::WimaxConnection::HasPackets
bool HasPackets() const
Definition:
wimax-connection.cc:146
ns3::WimaxConnection::m_cidType
Cid::Type m_cidType
CID type.
Definition:
wimax-connection.h:155
ns3::WimaxConnection::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
wimax-connection.cc:35
ns3::WimaxConnection::FragmentsQueue
std::list< Ptr< const Packet > > FragmentsQueue
Definition of Fragments Queue data type.
Definition:
wimax-connection.h:135
ns3::WimaxConnection::m_fragmentsQueue
FragmentsQueue m_fragmentsQueue
fragments queue
Definition:
wimax-connection.h:160
ns3::WimaxConnection::GetFragmentsQueue
const FragmentsQueue GetFragmentsQueue() const
get a queue of received fragments
Definition:
wimax-connection.cc:183
ns3::WimaxConnection::FragmentEnqueue
void FragmentEnqueue(Ptr< const Packet > fragment)
enqueue a received packet (that is a fragment) into the fragments queue
Definition:
wimax-connection.cc:189
ns3::WimaxConnection::~WimaxConnection
~WimaxConnection() override
Definition:
wimax-connection.cc:78
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
service-flow.h
wimax-mac-header.h
wimax-mac-queue.h
src
wimax
model
wimax-connection.h
Generated on Tue May 28 2024 23:41:19 for ns-3 by
1.9.6