INET Framework for OMNeT++/OMNEST
inet::MACProtocolBase Class Referenceabstract

#include <MACProtocolBase.h>

Inheritance diagram for inet::MACProtocolBase:
inet::LayeredProtocolBase inet::OperationalBase inet::ILifecycle inet::BMacLayer inet::CSMA inet::CsmaCaMac inet::IdealMac inet::ieee80211::Ieee80211Mac inet::LMacLayer

Public Attributes

InterfaceEntryinterfaceEntry
 
int upperLayerInGateId
 Gate ids. More...
 
int upperLayerOutGateId
 
int lowerLayerInGateId
 
int lowerLayerOutGateId
 

Protected Member Functions

 MACProtocolBase ()
 
virtual void initialize (int stage) override
 
virtual void registerInterface ()
 
virtual InterfaceEntrycreateInterfaceEntry ()=0
 
virtual void sendUp (cMessage *message)
 
virtual void sendDown (cMessage *message)
 
virtual bool isUpperMessage (cMessage *message) override
 
virtual bool isLowerMessage (cMessage *message) override
 
virtual bool isInitializeStage (int stage) override
 
virtual bool isNodeStartStage (int stage) override
 
virtual bool isNodeShutdownStage (int stage) override
 
- Protected Member Functions inherited from inet::LayeredProtocolBase
virtual void handleMessageWhenUp (cMessage *message) override
 
virtual void handleSelfMessage (cMessage *message)
 
virtual void handleUpperCommand (cMessage *message)
 
virtual void handleLowerCommand (cMessage *message)
 
virtual void handleUpperPacket (cPacket *packet)=0
 
virtual void handleLowerPacket (cPacket *packet)=0
 
- Protected Member Functions inherited from inet::OperationalBase
virtual int numInitStages () const override
 
virtual void handleMessage (cMessage *msg) override
 
virtual void handleMessageWhenDown (cMessage *msg)
 
virtual bool handleOperationStage (LifecycleOperation *operation, int stage, IDoneCallback *doneCallback) override
 Perform one stage of a lifecycle operation. More...
 
virtual bool handleNodeStart (IDoneCallback *doneCallback)
 
virtual bool handleNodeShutdown (IDoneCallback *doneCallback)
 
virtual void handleNodeCrash ()
 
virtual void setOperational (bool isOperational)
 

Additional Inherited Members

- Public Member Functions inherited from inet::OperationalBase
 OperationalBase ()
 
- Public Member Functions inherited from inet::ILifecycle
virtual ~ILifecycle ()
 
- Static Public Attributes inherited from inet::LayeredProtocolBase
static simsignal_t packetSentToUpperSignal = registerSignal("packetSentToUpper")
 
static simsignal_t packetReceivedFromUpperSignal = registerSignal("packetReceivedFromUpper")
 
static simsignal_t packetFromUpperDroppedSignal = registerSignal("packetFromUpperDropped")
 
static simsignal_t packetSentToLowerSignal = registerSignal("packetSentToLower")
 
static simsignal_t packetReceivedFromLowerSignal = registerSignal("packetReceivedFromLower")
 
static simsignal_t packetFromLowerDroppedSignal = registerSignal("packetFromLowerDropped")
 
- Protected Attributes inherited from inet::OperationalBase
bool isOperational
 
simtime_t lastChange
 

Constructor & Destructor Documentation

inet::MACProtocolBase::MACProtocolBase ( )
protected
22  :
27  interfaceEntry(nullptr)
28 {
29 }
InterfaceEntry * interfaceEntry
Definition: MACProtocolBase.h:38
int lowerLayerOutGateId
Definition: MACProtocolBase.h:35
int upperLayerOutGateId
Definition: MACProtocolBase.h:33
int lowerLayerInGateId
Definition: MACProtocolBase.h:34
int upperLayerInGateId
Gate ids.
Definition: MACProtocolBase.h:32

Member Function Documentation

virtual InterfaceEntry* inet::MACProtocolBase::createInterfaceEntry ( )
protectedpure virtual
void inet::MACProtocolBase::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::OperationalBase.

Reimplemented in inet::CsmaCaMac, inet::LMacLayer, inet::CSMA, inet::IdealMac, inet::BMacLayer, and inet::ieee80211::Ieee80211Mac.

Referenced by inet::ieee80211::Ieee80211Mac::initialize(), inet::BMacLayer::initialize(), inet::IdealMac::initialize(), inet::CSMA::initialize(), inet::LMacLayer::initialize(), and inet::CsmaCaMac::initialize().

32 {
34  if (stage == INITSTAGE_LOCAL) {
35  upperLayerInGateId = findGate("upperLayerIn");
36  upperLayerOutGateId = findGate("upperLayerOut");
37  lowerLayerInGateId = findGate("lowerLayerIn");
38  lowerLayerOutGateId = findGate("lowerLayerOut");
39  }
40 }
int lowerLayerOutGateId
Definition: MACProtocolBase.h:35
int upperLayerOutGateId
Definition: MACProtocolBase.h:33
int lowerLayerInGateId
Definition: MACProtocolBase.h:34
int upperLayerInGateId
Gate ids.
Definition: MACProtocolBase.h:32
Local initializations.
Definition: InitStages.h:35
virtual void initialize(int stage) override
Definition: OperationalBase.cc:32
virtual bool inet::MACProtocolBase::isInitializeStage ( int  stage)
inlineoverrideprotectedvirtual

Implements inet::OperationalBase.

54 { return stage == INITSTAGE_LINK_LAYER; }
Initialization of link-layer protocols.
Definition: InitStages.h:59
bool inet::MACProtocolBase::isLowerMessage ( cMessage *  message)
overrideprotectedvirtual

Implements inet::LayeredProtocolBase.

Referenced by inet::CsmaCaMac::handleWithFsm().

72 {
73  return message->getArrivalGateId() == lowerLayerInGateId;
74 }
int lowerLayerInGateId
Definition: MACProtocolBase.h:34
virtual bool inet::MACProtocolBase::isNodeShutdownStage ( int  stage)
inlineoverrideprotectedvirtual

Implements inet::OperationalBase.

56 { return stage == NodeShutdownOperation::STAGE_LINK_LAYER; }
Definition: NodeOperations.h:77
virtual bool inet::MACProtocolBase::isNodeStartStage ( int  stage)
inlineoverrideprotectedvirtual

Implements inet::OperationalBase.

55 { return stage == NodeStartOperation::STAGE_LINK_LAYER; }
Definition: NodeOperations.h:49
bool inet::MACProtocolBase::isUpperMessage ( cMessage *  message)
overrideprotectedvirtual

Implements inet::LayeredProtocolBase.

Referenced by inet::CsmaCaMac::handleWithFsm().

67 {
68  return message->getArrivalGateId() == upperLayerInGateId;
69 }
int upperLayerInGateId
Gate ids.
Definition: MACProtocolBase.h:32
void inet::MACProtocolBase::registerInterface ( )
protectedvirtual

Referenced by inet::ieee80211::Ieee80211Mac::initialize(), inet::BMacLayer::initialize(), inet::IdealMac::initialize(), inet::CSMA::initialize(), inet::LMacLayer::initialize(), and inet::CsmaCaMac::initialize().

43 {
44  ASSERT(interfaceEntry == nullptr);
45  IInterfaceTable *interfaceTable = findModuleFromPar<IInterfaceTable>(par("interfaceTableModule"), this);
46  if (interfaceTable) {
48  interfaceTable->addInterface(interfaceEntry);
49  }
50 }
InterfaceEntry * interfaceEntry
Definition: MACProtocolBase.h:38
virtual InterfaceEntry * createInterfaceEntry()=0
void inet::MACProtocolBase::sendUp ( cMessage *  message)
protectedvirtual

Member Data Documentation

int inet::MACProtocolBase::lowerLayerInGateId

Referenced by initialize(), and isLowerMessage().

int inet::MACProtocolBase::lowerLayerOutGateId
int inet::MACProtocolBase::upperLayerInGateId

Gate ids.

Referenced by initialize(), and isUpperMessage().

int inet::MACProtocolBase::upperLayerOutGateId

Referenced by initialize(), and sendUp().


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