A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
connection-manager.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 * Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
18 * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19 * <amine.ismail@UDcast.com>
20 */
21
22#ifndef CONNECTION_MANAGER_H
23#define CONNECTION_MANAGER_H
24
25#include "cid.h"
26#include "wimax-connection.h"
27
28#include "ns3/mac48-address.h"
29
30#include <stdint.h>
31
32namespace ns3
33{
34
35class CidFactory;
36class SSRecord;
37class RngRsp;
38class WimaxNetDevice;
39class SubscriberStationNetDevice;
40
41/**
42 * \ingroup wimax
43 * The same connection manager class serves both for BS and SS though some functions are exclusive
44 * to only one of them.
45 */
46
48{
49 public:
50 /**
51 * \brief Get the type ID.
52 * \return the object TypeId
53 */
54 static TypeId GetTypeId();
56 ~ConnectionManager() override;
57 void DoDispose() override;
58 /**
59 * Set CID factory
60 * \param cidFactory the CID factory
61 */
62 void SetCidFactory(CidFactory* cidFactory);
63 /**
64 * \brief allocates the management connection for an ss record. This method is only used by BS
65 * \param ssRecord the ss record to which the management connection will be allocated
66 * \param rngrsp the ranging response message
67 */
68 void AllocateManagementConnections(SSRecord* ssRecord, RngRsp* rngrsp);
69 /**
70 * \brief create a connection of type type
71 * \param type type of the connection to create
72 * \return a smart pointer to the created WimaxConnection
73 */
75 /**
76 * \brief add a connection to the list of managed connections
77 * \param connection the connection to add
78 * \param type the type of connection to add
79 */
80 void AddConnection(Ptr<WimaxConnection> connection, Cid::Type type);
81 /**
82 * \param cid the connection identifier
83 * \return the connection corresponding to cid
84 */
86 /**
87 * \param type the type of connection to add
88 * \return a vector of all connections matching the input type
89 */
90 std::vector<Ptr<WimaxConnection>> GetConnections(Cid::Type type) const;
91 /**
92 * \brief get number of packets
93 * \param type the type of connection to add
94 * \param schedulingType the scheduling type
95 * \returns number of packets
96 */
98 /**
99 * \return true if one of the managed connection has at least one packet to send, false
100 * otherwise
101 */
102 bool HasPackets() const;
103
104 private:
105 std::vector<Ptr<WimaxConnection>> m_basicConnections; ///< basic connections
106 std::vector<Ptr<WimaxConnection>> m_primaryConnections; ///< primary connections
107 std::vector<Ptr<WimaxConnection>> m_transportConnections; ///< transport connections
108 std::vector<Ptr<WimaxConnection>> m_multicastConnections; ///< multicast connections
109 // only for BS
110 CidFactory* m_cidFactory; ///< the factory
111};
112
113} // namespace ns3
114
115#endif /* CONNECTION_MANAGER_H */
This class is used exclusively by the BS to allocate CIDs to new connections.
Definition: cid-factory.h:46
Cid class.
Definition: cid.h:37
Type
Type enumeration.
Definition: cid.h:41
The same connection manager class serves both for BS and SS though some functions are exclusive to on...
std::vector< Ptr< WimaxConnection > > m_primaryConnections
primary connections
std::vector< Ptr< WimaxConnection > > m_basicConnections
basic connections
void DoDispose() override
Destructor implementation.
void AllocateManagementConnections(SSRecord *ssRecord, RngRsp *rngrsp)
allocates the management connection for an ss record.
std::vector< Ptr< WimaxConnection > > m_transportConnections
transport connections
Ptr< WimaxConnection > GetConnection(Cid cid)
Ptr< WimaxConnection > CreateConnection(Cid::Type type)
create a connection of type type
std::vector< Ptr< WimaxConnection > > GetConnections(Cid::Type type) const
uint32_t GetNPackets(Cid::Type type, ServiceFlow::SchedulingType schedulingType) const
get number of packets
void SetCidFactory(CidFactory *cidFactory)
Set CID factory.
static TypeId GetTypeId()
Get the type ID.
void AddConnection(Ptr< WimaxConnection > connection, Cid::Type type)
add a connection to the list of managed connections
CidFactory * m_cidFactory
the factory
std::vector< Ptr< WimaxConnection > > m_multicastConnections
multicast connections
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 the ranging response message described by "IEEE Standard for Local and metropol...
Definition: mac-messages.h:125
This class is used by the base station to store some information related to subscriber station in the...
Definition: ss-record.h:46
SchedulingType
section 11.13.11 Service flow scheduling type, page 701
Definition: service-flow.h:62
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.