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
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
18
namespace
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
*/
34
class
CidFactory
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
*/
45
Cid
AllocateBasic
();
46
/**
47
* \brief This function returns the next primary basic CID.
48
* \returns the next primary CID.
49
*/
50
Cid
AllocatePrimary
();
51
/**
52
* \brief This function returns the next Transport (or Secondary) CID.
53
* \returns the next Transport (or Secondary) CID.
54
*/
55
Cid
AllocateTransportOrSecondary
();
56
/**
57
* \brief This function returns the next Multicast CID.
58
* \returns the next Multicast CID.
59
*/
60
Cid
AllocateMulticast
();
61
/**
62
* \brief This function returns the next CID for the specified type.
63
* \param type CID type
64
* \returns the next CID.
65
*/
66
Cid
Allocate
(
Cid::Type
type);
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 */
cid.h
ns3::CidFactory
This class is used exclusively by the BS to allocate CIDs to new connections.
Definition
cid-factory.h:35
ns3::CidFactory::m_m
uint16_t m_m
m
Definition
cid-factory.h:95
ns3::CidFactory::Allocate
Cid Allocate(Cid::Type type)
This function returns the next CID for the specified type.
Definition
cid-factory.cc:63
ns3::CidFactory::m_basicIdentifier
uint16_t m_basicIdentifier
basic identifier
Definition
cid-factory.h:97
ns3::CidFactory::IsBasic
bool IsBasic(Cid cid) const
This function determines if the CID is basic.
Definition
cid-factory.cc:102
ns3::CidFactory::m_transportOrSecondaryIdentifier
uint16_t m_transportOrSecondaryIdentifier
transport or secondary identifier
Definition
cid-factory.h:99
ns3::CidFactory::AllocatePrimary
Cid AllocatePrimary()
This function returns the next primary basic CID.
Definition
cid-factory.cc:39
ns3::CidFactory::AllocateTransportOrSecondary
Cid AllocateTransportOrSecondary()
This function returns the next Transport (or Secondary) CID.
Definition
cid-factory.cc:47
ns3::CidFactory::m_multicastPollingIdentifier
uint16_t m_multicastPollingIdentifier
multicast polling identifier
Definition
cid-factory.h:100
ns3::CidFactory::IsPrimary
bool IsPrimary(Cid cid) const
This function determines if the CID is primary.
Definition
cid-factory.cc:95
ns3::CidFactory::AllocateBasic
Cid AllocateBasic()
This function returns the next basic CID.
Definition
cid-factory.cc:31
ns3::CidFactory::IsTransport
bool IsTransport(Cid cid) const
This function determines if the CID is a transport.
Definition
cid-factory.cc:88
ns3::CidFactory::m_primaryIdentifier
uint16_t m_primaryIdentifier
primary identifier
Definition
cid-factory.h:98
ns3::CidFactory::AllocateMulticast
Cid AllocateMulticast()
This function returns the next Multicast CID.
Definition
cid-factory.cc:55
ns3::CidFactory::CidFactory
CidFactory()
Create a cid factory with a default value for m of 0x5500.
Definition
cid-factory.cc:20
ns3::CidFactory::FreeCid
void FreeCid(Cid cid)
Notify the factory that the connection associated to this cid has been killed and that this cid can b...
Definition
cid-factory.cc:109
ns3::Cid
Cid class.
Definition
cid.h:26
ns3::Cid::Type
Type
Type enumeration.
Definition
cid.h:30
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
wimax
model
cid-factory.h
Generated on Fri Nov 8 2024 13:59:09 for ns-3 by
1.11.0