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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
7
* Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
8
*/
9
10
#ifndef WIMAX_CONNECTION_H
11
#define WIMAX_CONNECTION_H
12
13
#include "
cid.h
"
14
#include "
service-flow.h
"
15
#include "
wimax-mac-header.h
"
16
#include "
wimax-mac-queue.h
"
17
18
#include "ns3/object.h"
19
20
#include <ostream>
21
#include <stdint.h>
22
23
namespace
ns3
24
{
25
26
class
ServiceFlow;
27
class
Cid;
28
29
/**
30
* \ingroup wimax
31
* Class to represent WiMAX connections
32
*/
33
class
WimaxConnection
:
public
Object
34
{
35
public
:
36
/**
37
* \brief Get the type ID.
38
* \return the object TypeId
39
*/
40
static
TypeId
GetTypeId
();
41
42
/**
43
* Constructor
44
*
45
* \param cid connection ID
46
* \param type CID type
47
*/
48
WimaxConnection
(
Cid
cid,
Cid::Type
type);
49
~WimaxConnection
()
override
;
50
51
/**
52
* Get CID function
53
* \returns the CID
54
*/
55
Cid
GetCid
()
const
;
56
57
/**
58
* Get type function
59
* \returns the type
60
*/
61
Cid::Type
GetType
()
const
;
62
/**
63
* \return the queue of the connection
64
*/
65
Ptr<WimaxMacQueue>
GetQueue
()
const
;
66
/**
67
* \brief set the service flow associated to this connection
68
* \param serviceFlow The service flow to be associated to this connection
69
*/
70
void
SetServiceFlow
(
ServiceFlow
* serviceFlow);
71
/**
72
* \return the service flow associated to this connection
73
*/
74
ServiceFlow
*
GetServiceFlow
()
const
;
75
76
// wrapper functions
77
/**
78
* \return the scheduling type of this connection
79
*/
80
uint8_t
GetSchedulingType
()
const
;
81
/**
82
* \brief enqueue a packet in the queue of the connection
83
* \param packet the packet to be enqueued
84
* \param hdrType the header type of the packet
85
* \param hdr the header of the packet
86
* \return true if successful
87
*/
88
bool
Enqueue
(
Ptr<Packet>
packet,
const
MacHeaderType
& hdrType,
const
GenericMacHeader
& hdr);
89
/**
90
* \brief dequeue a packet from the queue of the connection
91
* \param packetType the type of the packet to dequeue
92
* \return packet dequeued
93
*/
94
Ptr<Packet>
Dequeue
(
MacHeaderType::HeaderType
packetType =
MacHeaderType::HEADER_TYPE_GENERIC
);
95
/**
96
* \brief dequeue a packet from the queue of the connection
97
* Dequeue the first packet in the queue if its size is lower than
98
* availableByte, the first availableByte of the first packet otherwise
99
*
100
* \param packetType the type of the packet to dequeue
101
* \param availableByte the number of available bytes
102
* \return packet dequeued
103
*/
104
Ptr<Packet>
Dequeue
(
MacHeaderType::HeaderType
packetType,
uint32_t
availableByte);
105
/**
106
* \return true if the connection has at least one packet in its queue, false otherwise
107
*/
108
bool
HasPackets
()
const
;
109
/**
110
* \return true if the connection has at least one packet of type packetType in its queue, false
111
* otherwise
112
* \param packetType type of packet to check in the queue
113
* \return true if packets available
114
*/
115
bool
HasPackets
(
MacHeaderType::HeaderType
packetType)
const
;
116
117
/**
118
* Get type string
119
* \returns the type string
120
*/
121
std::string
GetTypeStr
()
const
;
122
123
/// Definition of Fragments Queue data type
124
typedef
std::list<Ptr<const Packet>>
FragmentsQueue
;
125
/**
126
* \brief get a queue of received fragments
127
* \returns the fragments queue
128
*/
129
const
FragmentsQueue
GetFragmentsQueue
()
const
;
130
/**
131
* \brief enqueue a received packet (that is a fragment) into the fragments queue
132
* \param fragment received fragment
133
*/
134
void
FragmentEnqueue
(
Ptr<const Packet>
fragment);
135
/**
136
* \brief delete all enqueued fragments
137
*/
138
void
ClearFragmentsQueue
();
139
140
private
:
141
void
DoDispose
()
override
;
142
143
Cid
m_cid
;
///< CID
144
Cid::Type
m_cidType
;
///< CID type
145
Ptr<WimaxMacQueue>
m_queue
;
///< queue
146
ServiceFlow
*
m_serviceFlow
;
///< service flow
147
148
// FragmentsQueue stores all received fragments
149
FragmentsQueue
m_fragmentsQueue
;
///< fragments queue
150
};
151
152
}
// namespace ns3
153
154
#endif
/* WIMAX_CONNECTION_H */
cid.h
ns3::Cid
Cid class.
Definition
cid.h:26
ns3::Cid::Type
Type
Type enumeration.
Definition
cid.h:30
ns3::GenericMacHeader
This class implements the Generic mac Header as described by IEEE Standard for Local and metropolitan...
Definition
wimax-mac-header.h:103
ns3::MacHeaderType
This class Represents the HT (Header Type) field of generic MAC and bandwidth request headers.
Definition
wimax-mac-header.h:27
ns3::MacHeaderType::HeaderType
HeaderType
Header type enumeration.
Definition
wimax-mac-header.h:31
ns3::MacHeaderType::HEADER_TYPE_GENERIC
@ HEADER_TYPE_GENERIC
Definition
wimax-mac-header.h:32
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::ServiceFlow
This class implements service flows as described by the IEEE-802.16 standard.
Definition
service-flow.h:32
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::WimaxConnection
Class to represent WiMAX connections.
Definition
wimax-connection.h:34
ns3::WimaxConnection::m_serviceFlow
ServiceFlow * m_serviceFlow
service flow
Definition
wimax-connection.h:146
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:115
ns3::WimaxConnection::GetTypeStr
std::string GetTypeStr() const
Get type string.
Definition
wimax-connection.cc:147
ns3::WimaxConnection::GetServiceFlow
ServiceFlow * GetServiceFlow() const
Definition
wimax-connection.cc:103
ns3::WimaxConnection::DoDispose
void DoDispose() override
Destructor implementation.
Definition
wimax-connection.cc:72
ns3::WimaxConnection::GetType
Cid::Type GetType() const
Get type function.
Definition
wimax-connection.cc:85
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:123
ns3::WimaxConnection::ClearFragmentsQueue
void ClearFragmentsQueue()
delete all enqueued fragments
Definition
wimax-connection.cc:184
ns3::WimaxConnection::GetCid
Cid GetCid() const
Get CID function.
Definition
wimax-connection.cc:79
ns3::WimaxConnection::GetSchedulingType
uint8_t GetSchedulingType() const
Definition
wimax-connection.cc:109
ns3::WimaxConnection::m_cid
Cid m_cid
CID.
Definition
wimax-connection.h:143
ns3::WimaxConnection::WimaxConnection
WimaxConnection(Cid cid, Cid::Type type)
Constructor.
Definition
wimax-connection.cc:59
ns3::WimaxConnection::SetServiceFlow
void SetServiceFlow(ServiceFlow *serviceFlow)
set the service flow associated to this connection
Definition
wimax-connection.cc:97
ns3::WimaxConnection::GetQueue
Ptr< WimaxMacQueue > GetQueue() const
Definition
wimax-connection.cc:91
ns3::WimaxConnection::m_queue
Ptr< WimaxMacQueue > m_queue
queue
Definition
wimax-connection.h:145
ns3::WimaxConnection::HasPackets
bool HasPackets() const
Definition
wimax-connection.cc:135
ns3::WimaxConnection::m_cidType
Cid::Type m_cidType
CID type.
Definition
wimax-connection.h:144
ns3::WimaxConnection::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
wimax-connection.cc:24
ns3::WimaxConnection::FragmentsQueue
std::list< Ptr< const Packet > > FragmentsQueue
Definition of Fragments Queue data type.
Definition
wimax-connection.h:124
ns3::WimaxConnection::m_fragmentsQueue
FragmentsQueue m_fragmentsQueue
fragments queue
Definition
wimax-connection.h:149
ns3::WimaxConnection::GetFragmentsQueue
const FragmentsQueue GetFragmentsQueue() const
get a queue of received fragments
Definition
wimax-connection.cc:172
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:178
ns3::WimaxConnection::~WimaxConnection
~WimaxConnection() override
Definition
wimax-connection.cc:67
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 Fri Nov 8 2024 13:59:09 for ns-3 by
1.11.0