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. | |
Cid | Allocate (Cid::Type type) |
This function returns the next CID for the specified type. | |
Cid | AllocateBasic () |
This function returns the next basic CID. | |
Cid | AllocateMulticast () |
This function returns the next Multicast CID. | |
Cid | AllocatePrimary () |
This function returns the next primary basic CID. | |
Cid | AllocateTransportOrSecondary () |
This function returns the next Transport (or Secondary) CID. | |
void | FreeCid (Cid cid) |
Notify the factory that the connection associated to this cid has been killed and that this cid can be reused. | |
bool | IsBasic (Cid cid) const |
This function determines if the CID is basic. | |
bool | IsPrimary (Cid cid) const |
This function determines if the CID is primary. | |
bool | IsTransport (Cid cid) const |
This function determines if the CID is a transport. | |
Private Attributes | |
uint16_t | m_basicIdentifier |
basic identifier | |
uint16_t | m_m |
m | |
uint16_t | m_multicastPollingIdentifier |
multicast polling identifier | |
uint16_t | m_primaryIdentifier |
primary identifier | |
uint16_t | m_transportOrSecondaryIdentifier |
transport or secondary identifier | |
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 34 of file cid-factory.h.
ns3::CidFactory::CidFactory | ( | ) |
Create a cid factory with a default value for m of 0x5500.
Definition at line 20 of file cid-factory.cc.
This function returns the next CID for the specified type.
type | CID type |
Definition at line 63 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, and ns3::Cid::TRANSPORT.
Referenced by ns3::ConnectionManager::CreateConnection().
Cid ns3::CidFactory::AllocateBasic | ( | ) |
This function returns the next basic CID.
Definition at line 31 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 55 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 39 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 47 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 109 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 102 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 95 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 88 of file cid-factory.cc.
References ns3::Cid::m_identifier, and m_m.
|
private |
|
private |
m
Definition at line 95 of file cid-factory.h.
Referenced by AllocateBasic(), AllocatePrimary(), IsBasic(), IsPrimary(), and IsTransport().
|
private |
multicast polling identifier
Definition at line 100 of file cid-factory.h.
Referenced by AllocateMulticast().
|
private |
|
private |
transport or secondary identifier
Definition at line 99 of file cid-factory.h.
Referenced by AllocateTransportOrSecondary().