A Discrete-Event Network Simulator
API
wimax-connection.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2007,2008, 2009 INRIA, UDcast
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: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
19 * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
20 */
21
22#ifndef WIMAX_CONNECTION_H
23#define WIMAX_CONNECTION_H
24
25#include <stdint.h>
26#include <ostream>
27#include "cid.h"
28#include "wimax-mac-header.h"
29#include "wimax-mac-queue.h"
30#include "ns3/object.h"
31#include "service-flow.h"
32
33namespace ns3 {
34
35class ServiceFlow;
36class Cid;
37
42class WimaxConnection : public Object
43{
44public:
49 static TypeId GetTypeId (void);
50
57 WimaxConnection (Cid cid, enum Cid::Type type);
58 ~WimaxConnection (void);
59
64 Cid GetCid (void) const;
65
70 enum Cid::Type GetType (void) const;
74 Ptr<WimaxMacQueue> GetQueue (void) const;
79 void SetServiceFlow (ServiceFlow *serviceFlow);
83 ServiceFlow* GetServiceFlow (void) const;
84
85 // wrapper functions
89 uint8_t GetSchedulingType (void) const;
97 bool Enqueue (Ptr<Packet> packet, const MacHeaderType &hdrType, const GenericMacHeader &hdr);
113 Ptr<Packet> Dequeue (MacHeaderType::HeaderType packetType, uint32_t availableByte);
117 bool HasPackets (void) const;
123 bool HasPackets (MacHeaderType::HeaderType packetType) const;
124
129 std::string GetTypeStr (void) const;
130
132 typedef std::list<Ptr<const Packet> > FragmentsQueue;
137 const FragmentsQueue GetFragmentsQueue (void) const;
142 void FragmentEnqueue (Ptr<const Packet> fragment);
146 void ClearFragmentsQueue (void);
147
148private:
149 virtual void DoDispose (void);
150
155
156 // FragmentsQueue stores all received fragments
158};
159
160} // namespace ns3
161
162#endif /* WIMAX_CONNECTION_H */
Cid class.
Definition: cid.h:38
Type
Type enumeration.
Definition: cid.h:42
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:88
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:40
a unique identifier for an interface.
Definition: type-id.h:59
Class to represent WiMAX connections.
virtual void DoDispose(void)
Destructor implementation.
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
WimaxConnection(Cid cid, enum Cid::Type type)
Constructor.
Ptr< WimaxMacQueue > GetQueue(void) const
Ptr< Packet > Dequeue(MacHeaderType::HeaderType packetType=MacHeaderType::HEADER_TYPE_GENERIC)
dequeue a packet from the queue of the connection
std::string GetTypeStr(void) const
Get type string.
void ClearFragmentsQueue(void)
delete all enqueued fragments
enum Cid::Type m_cidType
CID type.
uint8_t GetSchedulingType(void) const
void SetServiceFlow(ServiceFlow *serviceFlow)
set the service flow associated to this connection
Ptr< WimaxMacQueue > m_queue
queue
enum Cid::Type GetType(void) const
Get type function.
bool HasPackets(void) const
std::list< Ptr< const Packet > > FragmentsQueue
Definition of Fragments Queue data type.
const FragmentsQueue GetFragmentsQueue(void) const
get a queue of received fragments
FragmentsQueue m_fragmentsQueue
fragments queue
static TypeId GetTypeId(void)
Get the type ID.
Cid GetCid(void) const
Get CID function.
void FragmentEnqueue(Ptr< const Packet > fragment)
enqueue a received packet (that is a fragment) into the fragments queue
ServiceFlow * GetServiceFlow(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.