This class is used exclusively by the BS to allocate CIDs to new connections. More...
#include "cid-factory.h"
Public Member Functions | |
CidFactory () | |
Create a cid factory with a default value for m of 0x5500. More... | |
Cid | Allocate (Cid::Type type) |
This function returns the next CID for the specified type. More... | |
Cid | AllocateBasic () |
This function returns the next basic CID. More... | |
Cid | AllocateMulticast () |
This function returns the next Multicast CID. More... | |
Cid | AllocatePrimary () |
This function returns the next primary basic CID. More... | |
Cid | AllocateTransportOrSecondary () |
This function returns the next Transport (or Secondary) CID. More... | |
void | FreeCid (Cid cid) |
Notify the factory that the connection associated to this cid has been killed and that this cid can be reused. More... | |
bool | IsBasic (Cid cid) const |
This function determines if the CID is basic. More... | |
bool | IsPrimary (Cid cid) const |
This function determines if the CID is primary. More... | |
bool | IsTransport (Cid cid) const |
This function determines if the CID is a transport. More... | |
Private Attributes | |
uint16_t | m_basicIdentifier |
basic identifier More... | |
uint16_t | m_m |
m More... | |
uint16_t | m_multicastPollingIdentifier |
multicast polling identifier More... | |
uint16_t | m_primaryIdentifier |
primary identifier More... | |
uint16_t | m_transportOrSecondaryIdentifier |
transport or secondary identifier More... | |
This class is used exclusively by the BS to allocate CIDs to new connections.
This class uses the definitions from Table 345 in ieee-802.16-2004 to allocate cids in different integer ranges according to their type. The relative allocation of the ranges is controlled by the parameter 'm' introduced in the above-mentioned table.
Note: The current implementation merely allocates cids sequentially from the start of the allowed range. A proper implementation would be able to recycle cids from previous dead connections and should instead look at a bitmap of free cids. Some other day :)
Definition at line 45 of file cid-factory.h.
ns3::CidFactory::CidFactory | ( | ) |
Create a cid factory with a default value for m of 0x5500.
Definition at line 31 of file cid-factory.cc.
This function returns the next CID for the specified type.
type | CID type |
Definition at line 74 of file cid-factory.cc.
References AllocateBasic(), AllocateMulticast(), AllocatePrimary(), AllocateTransportOrSecondary(), ns3::Cid::BASIC, ns3::Cid::BROADCAST, ns3::Cid::Broadcast(), ns3::Cid::INITIAL_RANGING, ns3::Cid::InitialRanging(), ns3::Cid::MULTICAST, NS_FATAL_ERROR, ns3::Cid::PADDING, ns3::Cid::Padding(), ns3::Cid::PRIMARY, ns3::Cid::TRANSPORT, and check-style-clang-format::type.
Referenced by ns3::ConnectionManager::CreateConnection().
Cid ns3::CidFactory::AllocateBasic | ( | ) |
This function returns the next basic CID.
Definition at line 42 of file cid-factory.cc.
References m_basicIdentifier, m_m, and NS_ASSERT.
Referenced by Allocate().
Cid ns3::CidFactory::AllocateMulticast | ( | ) |
This function returns the next Multicast CID.
Definition at line 66 of file cid-factory.cc.
References m_multicastPollingIdentifier, and NS_ASSERT.
Referenced by Allocate().
Cid ns3::CidFactory::AllocatePrimary | ( | ) |
This function returns the next primary basic CID.
Definition at line 50 of file cid-factory.cc.
References m_m, m_primaryIdentifier, and NS_ASSERT.
Referenced by Allocate().
Cid ns3::CidFactory::AllocateTransportOrSecondary | ( | ) |
This function returns the next Transport (or Secondary) CID.
Definition at line 58 of file cid-factory.cc.
References m_transportOrSecondaryIdentifier, and NS_ASSERT.
Referenced by Allocate(), and ns3::ConnectionManager::CreateConnection().
void ns3::CidFactory::FreeCid | ( | Cid | cid | ) |
Notify the factory that the connection associated to this cid has been killed and that this cid can be reused.
cid | CID type |
Definition at line 120 of file cid-factory.cc.
References NS_FATAL_ERROR.
bool ns3::CidFactory::IsBasic | ( | Cid | cid | ) | const |
This function determines if the CID is basic.
cid | CID type |
Definition at line 113 of file cid-factory.cc.
References ns3::Cid::m_identifier, and m_m.
Referenced by ns3::BaseStationNetDevice::DoReceive(), and ns3::BaseStationNetDevice::UplinkAllocationEnd().
bool ns3::CidFactory::IsPrimary | ( | Cid | cid | ) | const |
This function determines if the CID is primary.
cid | CID type |
Definition at line 106 of file cid-factory.cc.
References ns3::Cid::m_identifier, and m_m.
Referenced by ns3::BaseStationNetDevice::DoReceive().
bool ns3::CidFactory::IsTransport | ( | Cid | cid | ) | const |
This function determines if the CID is a transport.
cid | CID type |
Definition at line 99 of file cid-factory.cc.
References ns3::Cid::m_identifier, and m_m.
|
private |
|
private |
m
Definition at line 106 of file cid-factory.h.
Referenced by AllocateBasic(), AllocatePrimary(), IsBasic(), IsPrimary(), and IsTransport().
|
private |
multicast polling identifier
Definition at line 111 of file cid-factory.h.
Referenced by AllocateMulticast().
|
private |
|
private |
transport or secondary identifier
Definition at line 110 of file cid-factory.h.
Referenced by AllocateTransportOrSecondary().