#include <cid-factory.h>
Public Member Functions | |
CidFactory (void) | |
Cid | Allocate (enum Cid::Type type) |
Cid | AllocateBasic (void) |
This function returns the next basic CID. More... | |
Cid | AllocateMulticast (void) |
This function returns the next Multicast CID. More... | |
Cid | AllocatePrimary (void) |
This function returns the next primary basic CID. More... | |
Cid | AllocateTransportOrSecondary (void) |
This function returns the next Transport (or Secondary) CID. More... | |
void | FreeCid (Cid cid) |
bool | IsBasic (Cid cid) const |
bool | IsPrimary (Cid cid) const |
bool | IsTransport (Cid cid) const |
Private Attributes | |
uint16_t | m_basicIdentifier |
uint16_t | m_m |
uint16_t | m_multicastPollingIdentifier |
uint16_t | m_primaryIdentifier |
uint16_t | m_transportOrSecondaryIdentifier |
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-mentionned 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 | ( | void | ) |
Create a cid factory with a default value for m of 0x5500.
Definition at line 30 of file cid-factory.cc.
Cid ns3::CidFactory::AllocateBasic | ( | void | ) |
This function returns the next basic CID.
Definition at line 41 of file cid-factory.cc.
References NS_ASSERT.
Cid ns3::CidFactory::AllocateMulticast | ( | void | ) |
This function returns the next Multicast CID.
Definition at line 65 of file cid-factory.cc.
References NS_ASSERT.
Cid ns3::CidFactory::AllocatePrimary | ( | void | ) |
This function returns the next primary basic CID.
Definition at line 49 of file cid-factory.cc.
References NS_ASSERT.
Cid ns3::CidFactory::AllocateTransportOrSecondary | ( | void | ) |
This function returns the next Transport (or Secondary) CID.
Definition at line 57 of file cid-factory.cc.
References NS_ASSERT.
Referenced by 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.
Definition at line 119 of file cid-factory.cc.
References NS_FATAL_ERROR.