A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::CidFactory Class Reference

This class is used exclusively by the BS to allocate CIDs to new connections. More...

#include <cid-factory.h>

Public Member Functions

 CidFactory (void)
 Create a cid factory with a default value for m of 0x5500. More...
 
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)
 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
 
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
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Member Function Documentation

Cid ns3::CidFactory::AllocateBasic ( void  )

This function returns the next basic CID.

Returns
the next basic CID.

Definition at line 41 of file cid-factory.cc.

References m_basicIdentifier, m_m, and NS_ASSERT.

Referenced by Allocate().

+ Here is the caller graph for this function:

Cid ns3::CidFactory::AllocateMulticast ( void  )

This function returns the next Multicast CID.

Returns
the next Multicast CID.

Definition at line 65 of file cid-factory.cc.

References m_multicastPollingIdentifier, and NS_ASSERT.

Referenced by Allocate().

+ Here is the caller graph for this function:

Cid ns3::CidFactory::AllocatePrimary ( void  )

This function returns the next primary basic CID.

Returns
the next primary CID.

Definition at line 49 of file cid-factory.cc.

References m_m, m_primaryIdentifier, and NS_ASSERT.

Referenced by Allocate().

+ Here is the caller graph for this function:

Cid ns3::CidFactory::AllocateTransportOrSecondary ( void  )

This function returns the next Transport (or Secondary) CID.

Returns
the next Transport (or Secondary) CID.

Definition at line 57 of file cid-factory.cc.

References m_transportOrSecondaryIdentifier, and NS_ASSERT.

Referenced by Allocate(), and ns3::ConnectionManager::CreateConnection().

+ Here is the caller graph for this function:

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.

Todo:
We need to update the cid bitmap properly here.

Definition at line 119 of file cid-factory.cc.

References NS_FATAL_ERROR.

bool ns3::CidFactory::IsBasic ( Cid  cid) const

Definition at line 111 of file cid-factory.cc.

References ns3::Cid::m_identifier, and m_m.

Referenced by ns3::BaseStationNetDevice::DoReceive(), and ns3::BaseStationNetDevice::UplinkAllocationEnd().

+ Here is the caller graph for this function:

bool ns3::CidFactory::IsPrimary ( Cid  cid) const

Definition at line 105 of file cid-factory.cc.

References ns3::Cid::m_identifier, and m_m.

Referenced by ns3::BaseStationNetDevice::DoReceive().

+ Here is the caller graph for this function:

bool ns3::CidFactory::IsTransport ( Cid  cid) const

Definition at line 99 of file cid-factory.cc.

References ns3::Cid::m_identifier, and m_m.

Member Data Documentation

uint16_t ns3::CidFactory::m_basicIdentifier
private

Definition at line 88 of file cid-factory.h.

Referenced by AllocateBasic().

uint16_t ns3::CidFactory::m_m
private

Definition at line 86 of file cid-factory.h.

Referenced by AllocateBasic(), AllocatePrimary(), IsBasic(), IsPrimary(), and IsTransport().

uint16_t ns3::CidFactory::m_multicastPollingIdentifier
private

Definition at line 91 of file cid-factory.h.

Referenced by AllocateMulticast().

uint16_t ns3::CidFactory::m_primaryIdentifier
private

Definition at line 89 of file cid-factory.h.

Referenced by AllocatePrimary().

uint16_t ns3::CidFactory::m_transportOrSecondaryIdentifier
private

Definition at line 90 of file cid-factory.h.

Referenced by AllocateTransportOrSecondary().


The documentation for this class was generated from the following files: