A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
cid-factory.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 * Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
7 * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
8 * <amine.ismail@UDcast.com>
9 */
10
11#ifndef CONNECTION_IDENTIFIER_FACTORY_H
12#define CONNECTION_IDENTIFIER_FACTORY_H
13
14#include "cid.h"
15
16#include <stdint.h>
17
18namespace ns3
19{
20
21/**
22 * \ingroup wimax
23 * This class is used exclusively by the BS to allocate CIDs to new connections.
24 * This class uses the definitions from Table 345 in ieee-802.16-2004 to
25 * allocate cids in different integer ranges according to their type.
26 * The relative allocation of the ranges is controlled by the parameter 'm'
27 * introduced in the above-mentioned table.
28 *
29 * Note: The current implementation merely allocates cids sequentially from
30 * the start of the allowed range. A proper implementation would be able
31 * to recycle cids from previous dead connections and should instead look
32 * at a bitmap of free cids. Some other day :)
33 */
35{
36 public:
37 /**
38 * Create a cid factory with a default value for m of 0x5500.
39 */
40 CidFactory();
41 /**
42 * \brief This function returns the next basic CID.
43 * \returns the next basic CID.
44 */
46 /**
47 * \brief This function returns the next primary basic CID.
48 * \returns the next primary CID.
49 */
51 /**
52 * \brief This function returns the next Transport (or Secondary) CID.
53 * \returns the next Transport (or Secondary) CID.
54 */
56 /**
57 * \brief This function returns the next Multicast CID.
58 * \returns the next Multicast CID.
59 */
61 /**
62 * \brief This function returns the next CID for the specified type.
63 * \param type CID type
64 * \returns the next CID.
65 */
67
68 /**
69 * \brief This function determines if the CID is a transport.
70 * \param cid CID type
71 * \returns true if the CID is a transport.
72 */
73 bool IsTransport(Cid cid) const;
74 /**
75 * \brief This function determines if the CID is primary.
76 * \param cid CID type
77 * \returns true if the CID is primary.
78 */
79 bool IsPrimary(Cid cid) const;
80 /**
81 * \brief This function determines if the CID is basic.
82 * \param cid CID type
83 * \returns true if the CID is basic.
84 */
85 bool IsBasic(Cid cid) const;
86
87 /**
88 * Notify the factory that the connection associated to this
89 * cid has been killed and that this cid can be reused.
90 * \param cid CID type
91 */
92 void FreeCid(Cid cid);
93
94 private:
95 uint16_t m_m; ///< m
96
97 uint16_t m_basicIdentifier; ///< basic identifier
98 uint16_t m_primaryIdentifier; ///< primary identifier
99 uint16_t m_transportOrSecondaryIdentifier; ///< transport or secondary identifier
100 uint16_t m_multicastPollingIdentifier; ///< multicast polling identifier
101};
102
103} // namespace ns3
104
105#endif /* CONNECTION_IDENTIFIER_FACTORY_H */
This class is used exclusively by the BS to allocate CIDs to new connections.
Definition cid-factory.h:35
uint16_t m_m
m
Definition cid-factory.h:95
Cid Allocate(Cid::Type type)
This function returns the next CID for the specified type.
uint16_t m_basicIdentifier
basic identifier
Definition cid-factory.h:97
bool IsBasic(Cid cid) const
This function determines if the CID is basic.
uint16_t m_transportOrSecondaryIdentifier
transport or secondary identifier
Definition cid-factory.h:99
Cid AllocatePrimary()
This function returns the next primary basic CID.
Cid AllocateTransportOrSecondary()
This function returns the next Transport (or Secondary) CID.
uint16_t m_multicastPollingIdentifier
multicast polling identifier
bool IsPrimary(Cid cid) const
This function determines if the CID is primary.
Cid AllocateBasic()
This function returns the next basic CID.
bool IsTransport(Cid cid) const
This function determines if the CID is a transport.
uint16_t m_primaryIdentifier
primary identifier
Definition cid-factory.h:98
Cid AllocateMulticast()
This function returns the next Multicast CID.
CidFactory()
Create a cid factory with a default value for m of 0x5500.
void FreeCid(Cid cid)
Notify the factory that the connection associated to this cid has been killed and that this cid can b...
Cid class.
Definition cid.h:26
Type
Type enumeration.
Definition cid.h:30
Every class exported by the ns3 library is enclosed in the ns3 namespace.