EMANE  1.2.1
EMANE::Models::IEEE80211ABG::MACLayer Class Reference

IEEE 80211 ABG MAC implementation. More...

#include <maclayer.h>

Inheritance diagram for EMANE::Models::IEEE80211ABG::MACLayer:
EMANE::MACLayerImplementor EMANE::NEMLayer EMANE::RadioServiceUser EMANE::Component EMANE::UpstreamTransport EMANE::DownstreamTransport EMANE::PlatformServiceUser EMANE::Buildable EMANE::RunningStateMutable EMANE::EventServiceUser EMANE::TimerServiceUser

Public Types

enum  COLLISION_TYPE {
  COLLISION_TYPE_NONE = 0x00, COLLISION_TYPE_CLOBBER_RX_DURING_TX = 0x01, COLLISION_TYPE_NOISE_COMMON_RX = 0x02, COLLISION_TYPE_CLOBBER_RX_HIDDEN_BUSY = 0x04,
  COLLISION_TYPE_NOISE_HIDDEN_RX = 0x08
}
 

Public Member Functions

 MACLayer (NEMId id, PlatformServiceProvider *pPlatformServiceProvider, RadioServiceProvider *pRadioServiceProvider)
 
 ~MACLayer ()
 
void initialize (Registrar &registrar) override
 
void configure (const ConfigurationUpdate &update) override
 
void start () override
 
void postStart () override
 
void stop () override
 
void destroy () override throw ()
 
void processUpstreamControl (const ControlMessages &msgs) override
 
void processUpstreamPacket (const CommonMACHeader &hdr, UpstreamPacket &pkt, const ControlMessages &msgs) override
 
void processDownstreamControl (const ControlMessages &msgs) override
 
void processDownstreamPacket (DownstreamPacket &pkt, const ControlMessages &msgs) override
 
void processEvent (const EventId &, const Serialization &)
 
void processConfiguration (const ConfigurationUpdate &update) override
 
NEMId getId () const
 
void sendDownstreamBroadcastData (DownstreamQueueEntry &)
 
void sendDownstreamUnicastData (DownstreamQueueEntry &entry)
 
void sendDownstreamUnicastCts (DownstreamQueueEntry &entry, NEMId origin)
 
void sendDownstreamMessage (DownstreamQueueEntry &entry, MACHeaderParams &macHeaderParams)
 
bool isDuplicate (NEMId src, std::uint16_t seq)
 
bool addToken ()
 
bool removeToken ()
 
void setDelayTime (IEEE80211ABG::DownstreamQueueEntry &entry)
 
COLLISION_TYPE checkForRxCollision (NEMId src, std::uint8_t u8Category, std::uint8_t retries)
 
MACStatisticsgetStatistics ()
 
ModeTimingParametersgetModeTiming ()
 
void sendDownstreamPacket (const CommonMACHeader &hdr, DownstreamPacket &pkt, const ControlMessages &msgs=DownstreamTransport::empty)
 
NEMId getNEMId () const
 
virtual void setDownstreamTransport (DownstreamTransport *pDownstreamTransport)
 
void sendDownstreamControl (const ControlMessages &msgs)
 
virtual void setUpstreamTransport (UpstreamTransport *pUpstreamTransport)
 
void sendUpstreamPacket (UpstreamPacket &pkt, const ControlMessages &msgs=empty)
 
void sendUpstreamControl (const ControlMessages &msgs)
 
virtual void processTimedEvent (TimerEventId eventId, const TimePoint &expireTime, const TimePoint &scheduleTime, const TimePoint &fireTime, const void *arg)
 
BuildId getBuildId () const
 
void setBuildId (BuildId bid)
 

Static Public Attributes

static const ControlMessages empty
 
static const ControlMessages empty
 

Protected Attributes

PlatformServiceProviderpPlatformService_
 
RadioServiceProviderpRadioService_
 

Friends

class TransmissionTxState
 

Detailed Description

IEEE 80211 ABG MAC implementation.

Definition at line 104 of file models/mac/ieee80211abg/maclayer.h.

Member Enumeration Documentation

◆ COLLISION_TYPE

collision type none, clobber or noise

Enumerator
COLLISION_TYPE_NONE 
COLLISION_TYPE_CLOBBER_RX_DURING_TX 
COLLISION_TYPE_NOISE_COMMON_RX 
COLLISION_TYPE_CLOBBER_RX_HIDDEN_BUSY 
COLLISION_TYPE_NOISE_HIDDEN_RX 

Definition at line 151 of file models/mac/ieee80211abg/maclayer.h.

Constructor & Destructor Documentation

◆ MACLayer()

EMANE::Models::IEEE80211ABG::MACLayer::MACLayer ( NEMId  id,
PlatformServiceProvider pPlatformServiceProvider,
RadioServiceProvider pRadioServiceProvider 
)

Definition at line 104 of file models/mac/ieee80211abg/maclayer.cc.

◆ ~MACLayer()

EMANE::Models::IEEE80211ABG::MACLayer::~MACLayer ( )

Definition at line 144 of file models/mac/ieee80211abg/maclayer.cc.

Member Function Documentation

◆ addToken()

bool EMANE::Models::IEEE80211ABG::MACLayer::addToken ( )

add token to flow control

Return values
trueon success false on failure

Definition at line 1946 of file models/mac/ieee80211abg/maclayer.cc.

◆ checkForRxCollision()

EMANE::Models::IEEE80211ABG::MACLayer::COLLISION_TYPE EMANE::Models::IEEE80211ABG::MACLayer::checkForRxCollision ( NEMId  src,
std::uint8_t  u8Category,
std::uint8_t  retries 
)

get the type of collision during rx

Parameters
srcthe src of the pkt
u8Categorythe queue service type
retriesthe number of retries
Return values
returnsthe COLLISION_TYPE

Definition at line 1620 of file models/mac/ieee80211abg/maclayer.cc.

◆ configure()

void EMANE::Models::IEEE80211ABG::MACLayer::configure ( const ConfigurationUpdate update)
overridevirtual

Configure the component.

Parameters
updateConfiguration update values
Exceptions
ConfigureExceptionthrown when a unexpected configuration item is encountered or there is a problem with the specified item value

Implements EMANE::Component.

Definition at line 189 of file models/mac/ieee80211abg/maclayer.cc.

◆ destroy()

void EMANE::Models::IEEE80211ABG::MACLayer::destroy ( )
throw (
)
overridevirtual

Destroy the component.

Implements EMANE::Component.

Definition at line 360 of file models/mac/ieee80211abg/maclayer.cc.

◆ getBuildId()

EMANE::BuildId EMANE::Buildable::getBuildId ( ) const
inlineinherited

Gets the application wide unique BuildId of this object.

Returns
the BuildId

Definition at line 34 of file buildable.inl.

◆ getId()

EMANE::NEMId EMANE::Models::IEEE80211ABG::MACLayer::getId ( ) const

get the NEM id

Return values
NEMid

Definition at line 1420 of file models/mac/ieee80211abg/maclayer.cc.

◆ getModeTiming()

EMANE::Models::IEEE80211ABG::ModeTimingParameters & EMANE::Models::IEEE80211ABG::MACLayer::getModeTiming ( )

provides access to the MAC layer mode timing

Returns
reference to the configuration object

Definition at line 2078 of file models/mac/ieee80211abg/maclayer.cc.

◆ getNEMId()

NEMId EMANE::NEMLayer::getNEMId ( ) const
inlineinherited

Get the NEM identifier.

Returns
NEM identifier

Definition at line 72 of file nemlayer.h.

◆ getStatistics()

EMANE::Models::IEEE80211ABG::MACStatistics & EMANE::Models::IEEE80211ABG::MACLayer::getStatistics ( )

provides access to the MAC layer statistics

Returns
reference to the statistics object

Definition at line 2070 of file models/mac/ieee80211abg/maclayer.cc.

◆ initialize()

void EMANE::Models::IEEE80211ABG::MACLayer::initialize ( Registrar registrar)
overridevirtual

Initialize the component.

Exceptions
InitializeExceptionthrown when an error is encountered during initialization

[configurationregistrar-registervalidator-snippet]

[configurationregistrar-registervalidator-snippet]

Implements EMANE::Component.

Definition at line 149 of file models/mac/ieee80211abg/maclayer.cc.

◆ isDuplicate()

bool EMANE::Models::IEEE80211ABG::MACLayer::isDuplicate ( NEMId  src,
std::uint16_t  seq 
)

check if a duplicate packet has been received

Parameters
srcthe source nem
seqsequence number of packet
Return values
trueif src and seq match the last received values, otherwise false.

Definition at line 1861 of file models/mac/ieee80211abg/maclayer.cc.

◆ postStart()

void EMANE::Models::IEEE80211ABG::MACLayer::postStart ( )
overridevirtual

Hook to run any post start functionaililty. Called after all the components have been started.

Reimplemented from EMANE::Component.

Definition at line 247 of file models/mac/ieee80211abg/maclayer.cc.

◆ processConfiguration()

void EMANE::Models::IEEE80211ABG::MACLayer::processConfiguration ( const ConfigurationUpdate update)
overridevirtual

Process dynamic running-state configuration updates

Parameters
updateConfiguration update
Note
Running state configuration errors are indicated using a validator. Validators can be registered using the ConfigurationRegistrar.

Reimplemented from EMANE::RunningStateMutable.

Definition at line 318 of file models/mac/ieee80211abg/maclayer.cc.

◆ processDownstreamControl()

void EMANE::Models::IEEE80211ABG::MACLayer::processDownstreamControl ( const ControlMessages msgs)
overridevirtual

Process downstream control message

Parameters
msgsReference to the ControlMessages

Implements EMANE::DownstreamTransport.

Definition at line 387 of file models/mac/ieee80211abg/maclayer.cc.

◆ processDownstreamPacket()

void EMANE::Models::IEEE80211ABG::MACLayer::processDownstreamPacket ( DownstreamPacket pkt,
const ControlMessages msgs 
)
overridevirtual

Process downstream packet

Parameters
pktReference to the DownstreamPacket to process
msgsoptional reference to the ControlMessages

Implements EMANE::DownstreamTransport.

Definition at line 1121 of file models/mac/ieee80211abg/maclayer.cc.

◆ processEvent()

void EMANE::Models::IEEE80211ABG::MACLayer::processEvent ( const EventId eventId,
const Serialization serialization 
)
virtual

Process an event.

Parameters
eventIdevent identifier corresponding to the serialized event
serializationopaque event object data

Reimplemented from EMANE::EventServiceUser.

Definition at line 1210 of file models/mac/ieee80211abg/maclayer.cc.

◆ processTimedEvent()

virtual void EMANE::TimerServiceUser::processTimedEvent ( TimerEventId  eventId,
const TimePoint expireTime,
const TimePoint scheduleTime,
const TimePoint fireTime,
const void *  arg 
)
inlinevirtualinherited

Process a timed event

Parameters
eventIdIdentifier corresponding to the timer being processed
expireTimeThe time the timer was scheduled to expire
scheduleTimeThe Time the timer was scheduled
fireTimeTime time The time the timer actually fired
argOpaque timed event data
Note
All times are abosulte using CLOCK_REALTIME

Reimplemented in EMANE::NEMStatefulLayer, EMANE::Models::Bypass::PHYLayer, EMANE::NEMQueuedLayer, EMANE::Models::PHYAPITest::ShimLayer, EMANE::Models::CommEffect::Shim, EMANE::Agents::GPSDLocation::Agent, EMANE::TimerServiceProxy, and EMANE::NEMTimerServiceProxy.

Definition at line 62 of file timerserviceuser.h.

◆ processUpstreamControl()

void EMANE::Models::IEEE80211ABG::MACLayer::processUpstreamControl ( const ControlMessages msgs)
overridevirtual

Process upstream control message

Parameters
msgsreference to the ControlMessages

Implements EMANE::UpstreamTransport.

Definition at line 374 of file models/mac/ieee80211abg/maclayer.cc.

◆ processUpstreamPacket()

void EMANE::Models::IEEE80211ABG::MACLayer::processUpstreamPacket ( const CommonMACHeader hdr,
UpstreamPacket pkt,
const ControlMessages msgs 
)
overridevirtual

Process an upstream packet

Parameters
hdrMAC message header
pktUpstream packet reference
msgsOptional control messages
Note
Control message ownership is transferred with this call. Control messages should not be accessed after this point.

Implements EMANE::MACLayerImplementor.

Definition at line 478 of file models/mac/ieee80211abg/maclayer.cc.

◆ removeToken()

bool EMANE::Models::IEEE80211ABG::MACLayer::removeToken ( )

remove token from flow control

Return values
trueon success false on failure

Definition at line 1974 of file models/mac/ieee80211abg/maclayer.cc.

◆ sendDownstreamBroadcastData()

void EMANE::Models::IEEE80211ABG::MACLayer::sendDownstreamBroadcastData ( DownstreamQueueEntry entry)

send a downstream broadcast data packet

Parameters
entrydownstream queue entry

Definition at line 1237 of file models/mac/ieee80211abg/maclayer.cc.

◆ sendDownstreamControl()

void EMANE::UpstreamTransport::sendDownstreamControl ( const ControlMessages msgs)
inlineinherited

Send downstream control message

Parameters
msgsreference to the ControlMessages

Definition at line 44 of file upstreamtransport.inl.

◆ sendDownstreamMessage()

void EMANE::Models::IEEE80211ABG::MACLayer::sendDownstreamMessage ( DownstreamQueueEntry entry,
MACHeaderParams macHeaderParams 
)

send a downstream message

Parameters
entrydownstream queue entry
macHeaderParamsspecific mac header parameters for the message

Definition at line 1323 of file models/mac/ieee80211abg/maclayer.cc.

◆ sendDownstreamPacket()

void EMANE::MACLayerImplementor::sendDownstreamPacket ( const CommonMACHeader hdr,
DownstreamPacket pkt,
const ControlMessages msgs = DownstreamTransport::empty 
)
inlineinherited

Sends a downstream packet

Parameters
hdrMAC message header
pktDownstream packet reference
msgsOptional control messages
Note
Control message ownership is transferred with this call. Control messages should not be accessed after this point.

Definition at line 37 of file maclayerimpl.inl.

◆ sendDownstreamUnicastCts()

void EMANE::Models::IEEE80211ABG::MACLayer::sendDownstreamUnicastCts ( DownstreamQueueEntry entry,
NEMId  origin 
)

send a downstream unicast cts ctrl packet

Parameters
entrydownstream queue entry
originthe origin of the unicast rts/cts exchange

Definition at line 1288 of file models/mac/ieee80211abg/maclayer.cc.

◆ sendDownstreamUnicastData()

void EMANE::Models::IEEE80211ABG::MACLayer::sendDownstreamUnicastData ( DownstreamQueueEntry entry)

send a downstream unicast data packet

Parameters
entrydownstream queue entry

Definition at line 1262 of file models/mac/ieee80211abg/maclayer.cc.

◆ sendUpstreamControl()

void EMANE::DownstreamTransport::sendUpstreamControl ( const ControlMessages msgs)
inlineinherited

Send upstream control message

Parameters
msgsReference to the ControlMessages

Definition at line 44 of file downstreamtransport.inl.

◆ sendUpstreamPacket()

void EMANE::DownstreamTransport::sendUpstreamPacket ( UpstreamPacket pkt,
const ControlMessages msgs = empty 
)
inlineinherited

Send upstream packet

Parameters
pktReference to the UpstreamPacket to process
msgsoptional reference to the ControlMessages

Definition at line 37 of file downstreamtransport.inl.

◆ setBuildId()

void EMANE::Buildable::setBuildId ( BuildId  bid)
inlineinherited

Sets the application wide unique BuildId of this object. Builders assign a BuildId to objects at instantiation.

Parameters
bidthe BuildId
Note
: This method is for internal framework use only.

Definition at line 40 of file buildable.inl.

◆ setDelayTime()

void EMANE::Models::IEEE80211ABG::MACLayer::setDelayTime ( IEEE80211ABG::DownstreamQueueEntry entry)

set the pre and post delays for a downstream queue entry

Parameters
entrythe downstream entry

Definition at line 1429 of file models/mac/ieee80211abg/maclayer.cc.

◆ setDownstreamTransport()

virtual void EMANE::UpstreamTransport::setDownstreamTransport ( DownstreamTransport pDownstreamTransport)
inlinevirtualinherited

Set the downstream transport.

Parameters
pDownstreamTransportPointer to the downstream transport of this upstream transport.
Note
: This method is for internal framework use only.

Reimplemented in EMANE::NEMStatefulLayer, EMANE::PHYLayer, EMANE::MACLayer, EMANE::ShimLayer, and EMANE::TransportLayer.

Definition at line 82 of file upstreamtransport.h.

◆ setUpstreamTransport()

virtual void EMANE::DownstreamTransport::setUpstreamTransport ( UpstreamTransport pUpstreamTransport)
inlinevirtualinherited

Set the upstream transport.

Parameters
pUpstreamTransportPointer to the upstream transport of this downstream transport.

Reimplemented in EMANE::NEMStatefulLayer, EMANE::MACLayer, EMANE::ShimLayer, EMANE::PHYLayer, and EMANE::TransportLayer.

Definition at line 79 of file downstreamtransport.h.

◆ start()

void EMANE::Models::IEEE80211ABG::MACLayer::start ( )
overridevirtual

Start the component.

Exceptions
StartExceptionthrown when an error is encountered during start.

Implements EMANE::Component.

Definition at line 208 of file models/mac/ieee80211abg/maclayer.cc.

◆ stop()

void EMANE::Models::IEEE80211ABG::MACLayer::stop ( )
overridevirtual

Stop the component.

Exceptions
StopExceptionthrown when an error is encountered during stop

Implements EMANE::Component.

Definition at line 330 of file models/mac/ieee80211abg/maclayer.cc.

Friends And Related Function Documentation

◆ TransmissionTxState

friend class TransmissionTxState
friend

Definition at line 372 of file models/mac/ieee80211abg/maclayer.h.

Member Data Documentation

◆ empty [1/2]

const EMANE::ControlMessages EMANE::DownstreamTransport::empty
staticinherited

Definition at line 102 of file downstreamtransport.h.

◆ empty [2/2]

const EMANE::ControlMessages EMANE::UpstreamTransport::empty
staticinherited

Definition at line 106 of file upstreamtransport.h.

◆ pPlatformService_

PlatformServiceProvider* EMANE::PlatformServiceUser::pPlatformService_
protectedinherited

Definition at line 64 of file platformserviceuser.h.

◆ pRadioService_

RadioServiceProvider* EMANE::RadioServiceUser::pRadioService_
protectedinherited

Definition at line 57 of file radioserviceuser.h.


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