A Discrete-Event Network Simulator
API
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 
44 class WimaxConnection : public Object
45 {
46  public:
51  static TypeId GetTypeId();
52 
60  ~WimaxConnection() override;
61 
66  Cid GetCid() const;
67 
72  Cid::Type GetType() const;
81  void SetServiceFlow(ServiceFlow* serviceFlow);
85  ServiceFlow* GetServiceFlow() const;
86 
87  // wrapper functions
91  uint8_t GetSchedulingType() const;
99  bool Enqueue(Ptr<Packet> packet, const MacHeaderType& hdrType, const GenericMacHeader& hdr);
115  Ptr<Packet> Dequeue(MacHeaderType::HeaderType packetType, uint32_t availableByte);
119  bool HasPackets() const;
126  bool HasPackets(MacHeaderType::HeaderType packetType) const;
127 
132  std::string GetTypeStr() const;
133 
135  typedef std::list<Ptr<const Packet>> FragmentsQueue;
140  const FragmentsQueue GetFragmentsQueue() const;
145  void FragmentEnqueue(Ptr<const Packet> fragment);
149  void ClearFragmentsQueue();
150 
151  private:
152  void DoDispose() override;
153 
158 
159  // FragmentsQueue stores all received fragments
161 };
162 
163 } // namespace ns3
164 
165 #endif /* WIMAX_CONNECTION_H */
Cid class.
Definition: cid.h:37
Type
Type enumeration.
Definition: cid.h:41
This class implements the Generic mac Header as described by IEEE Standard for Local and metropolitan...
This class Represents the HT (Header Type) field of generic MAC and bandwidth request headers.
HeaderType
Header type enumeration.
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:43
a unique identifier for an interface.
Definition: type-id.h:59
Class to represent WiMAX connections.
ServiceFlow * m_serviceFlow
service flow
bool Enqueue(Ptr< Packet > packet, const MacHeaderType &hdrType, const GenericMacHeader &hdr)
enqueue a packet in the queue of the connection
std::string GetTypeStr() const
Get type string.
ServiceFlow * GetServiceFlow() const
void DoDispose() override
Destructor implementation.
Cid::Type GetType() const
Get type function.
Ptr< Packet > Dequeue(MacHeaderType::HeaderType packetType=MacHeaderType::HEADER_TYPE_GENERIC)
dequeue a packet from the queue of the connection
void ClearFragmentsQueue()
delete all enqueued fragments
Cid GetCid() const
Get CID function.
uint8_t GetSchedulingType() const
WimaxConnection(Cid cid, Cid::Type type)
Constructor.
void SetServiceFlow(ServiceFlow *serviceFlow)
set the service flow associated to this connection
Ptr< WimaxMacQueue > GetQueue() const
Ptr< WimaxMacQueue > m_queue
queue
Cid::Type m_cidType
CID type.
static TypeId GetTypeId()
Get the type ID.
std::list< Ptr< const Packet > > FragmentsQueue
Definition of Fragments Queue data type.
FragmentsQueue m_fragmentsQueue
fragments queue
const FragmentsQueue GetFragmentsQueue() const
get a queue of received fragments
void FragmentEnqueue(Ptr< const Packet > fragment)
enqueue a received packet (that is a fragment) into the fragments queue
Every class exported by the ns3 library is enclosed in the ns3 namespace.