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

#include <LayeredProtocolBase.h>

Inheritance diagram for inet::LayeredProtocolBase:
inet::OperationalBase inet::ILifecycle inet::MACProtocolBase inet::NetworkProtocolBase inet::TransportProtocolBase inet::BMacLayer inet::CSMA inet::CsmaCaMac inet::IdealMac inet::ieee80211::Ieee80211Mac inet::LMacLayer inet::Flood inet::ProbabilisticBroadcast inet::WiseRoute

Static Public Attributes

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 Member Functions

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
 
virtual bool isUpperMessage (cMessage *message)=0
 
virtual bool isLowerMessage (cMessage *message)=0
 
- Protected Member Functions inherited from inet::OperationalBase
virtual int numInitStages () const override
 
virtual void initialize (int stage) 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 bool isInitializeStage (int stage)=0
 
virtual bool isNodeStartStage (int stage)=0
 
virtual bool isNodeShutdownStage (int stage)=0
 
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 ()
 
- Protected Attributes inherited from inet::OperationalBase
bool isOperational
 
simtime_t lastChange
 

Member Function Documentation

void inet::LayeredProtocolBase::handleLowerCommand ( cMessage *  message)
protectedvirtual

Referenced by handleMessageWhenUp().

64 {
65  throw cRuntimeError("Lower command '%s' is not handled.", message->getName());
66 }
virtual void inet::LayeredProtocolBase::handleLowerPacket ( cPacket *  packet)
protectedpure virtual
void inet::LayeredProtocolBase::handleMessageWhenUp ( cMessage *  message)
overrideprotectedvirtual

Implements inet::OperationalBase.

30 {
31  if (message->isSelfMessage())
32  handleSelfMessage(message);
33  else if (isUpperMessage(message)) {
34  if (!message->isPacket())
35  handleUpperCommand(message);
36  else {
37  emit(packetReceivedFromUpperSignal, message);
38  handleUpperPacket(PK(message));
39  }
40  }
41  else if (isLowerMessage(message)) {
42  if (!message->isPacket())
43  handleLowerCommand(message);
44  else {
45  emit(packetReceivedFromLowerSignal, message);
46  handleLowerPacket(PK(message));
47  }
48  }
49  else
50  throw cRuntimeError("Message '%s' received on unexpected gate '%s'", message->getName(), message->getArrivalGate()->getFullName());
51 }
virtual bool isLowerMessage(cMessage *message)=0
virtual void handleUpperCommand(cMessage *message)
Definition: LayeredProtocolBase.cc:58
virtual void handleUpperPacket(cPacket *packet)=0
virtual bool isUpperMessage(cMessage *message)=0
static simsignal_t packetReceivedFromUpperSignal
Definition: LayeredProtocolBase.h:29
virtual void handleSelfMessage(cMessage *message)
Definition: LayeredProtocolBase.cc:53
#define PK(msg)
Definition: INETDefs.h:92
virtual void handleLowerCommand(cMessage *message)
Definition: LayeredProtocolBase.cc:63
static simsignal_t packetReceivedFromLowerSignal
Definition: LayeredProtocolBase.h:33
virtual void handleLowerPacket(cPacket *packet)=0
void inet::LayeredProtocolBase::handleSelfMessage ( cMessage *  message)
protectedvirtual

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

Referenced by handleMessageWhenUp(), and inet::IdealMac::handleSelfMessage().

54 {
55  throw cRuntimeError("Self message '%s' is not handled.", message->getName());
56 }
void inet::LayeredProtocolBase::handleUpperCommand ( cMessage *  message)
protectedvirtual

Reimplemented in inet::ieee80211::Ieee80211Mac, and inet::NetworkProtocolBase.

Referenced by handleMessageWhenUp(), and inet::NetworkProtocolBase::handleUpperCommand().

59 {
60  throw cRuntimeError("Upper command '%s' is not handled.", message->getName());
61 }
virtual void inet::LayeredProtocolBase::handleUpperPacket ( cPacket *  packet)
protectedpure virtual
virtual bool inet::LayeredProtocolBase::isLowerMessage ( cMessage *  message)
protectedpure virtual
virtual bool inet::LayeredProtocolBase::isUpperMessage ( cMessage *  message)
protectedpure virtual

Member Data Documentation

simsignal_t inet::LayeredProtocolBase::packetFromLowerDroppedSignal = registerSignal("packetFromLowerDropped")
static

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