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

#include <LayeredProtocolBase.h>

Inheritance diagram for inet::LayeredProtocolBase:
inet::OperationalBase inet::OperationalMixin< cSimpleModule > inet::ILifecycle inet::MacProtocolBase inet::MacRelayUnitBase inet::NetworkProtocolBase inet::physicallayer::PhysicalLayerBase inet::TransportProtocolBase inet::AckingMac inet::BMac inet::CsmaCaMac inet::EthernetMacBase inet::ieee80211::Ieee80211Mac inet::Ieee802154Mac inet::LMac inet::Loopback inet::Ppp inet::ShortcutMac inet::Tun inet::XMac inet::Ieee8021dRelay inet::MacRelayUnit inet::Flooding inet::ProbabilisticBroadcast inet::WiseRoute inet::physicallayer::Radio inet::physicallayer::ShortcutRadio inet::tcp::Tcp inet::Udp

Protected Member Functions

virtual void handleMessageWhenUp (cMessage *message) override
 
virtual void handleSelfMessage (cMessage *message)
 
virtual void handleUpperMessage (cMessage *message)
 
virtual void handleLowerMessage (cMessage *message)
 
virtual void handleUpperCommand (cMessage *message)
 
virtual void handleLowerCommand (cMessage *message)
 
virtual void handleUpperPacket (Packet *packet)
 
virtual void handleLowerPacket (Packet *packet)
 
virtual bool isUpperMessage (cMessage *message) const =0
 
virtual bool isLowerMessage (cMessage *message) const =0
 
- Protected Member Functions inherited from inet::OperationalMixin< cSimpleModule >
virtual int numInitStages () const override
 
virtual void initialize (int stage) override
 
virtual void refreshDisplay () const override
 
virtual void handleMessage (cMessage *msg) override
 
virtual void handleMessageWhenDown (cMessage *msg)
 
virtual bool handleOperationStage (LifecycleOperation *operation, IDoneCallback *doneCallback) override
 Perform one stage of a lifecycle operation. More...
 
virtual void handleStartOperation (LifecycleOperation *operation)=0
 
virtual void handleStopOperation (LifecycleOperation *operation)=0
 
virtual void handleCrashOperation (LifecycleOperation *operation)=0
 
virtual State getInitialOperationalState () const
 Returns initial operational state: OPERATING or NOT_OPERATING. More...
 
virtual bool isInitializeStage (int stage) const=0
 
virtual bool isModuleStartStage (int stage) const=0
 
virtual bool isModuleStopStage (int stage) const=0
 
virtual void handleActiveOperationTimeout (cMessage *message)
 
virtual bool isUp () const
 utility functions More...
 
virtual bool isDown () const
 
virtual void setOperationalState (State newState)
 
virtual void scheduleOperationTimeout (simtime_t timeout)
 
virtual void setupActiveOperation (LifecycleOperation *operation, IDoneCallback *doneCallback, State)
 
virtual void delayActiveOperationFinish (simtime_t timeout)
 
virtual void startActiveOperationExtraTime (simtime_t delay=SIMTIME_ZERO)
 
virtual void startActiveOperationExtraTimeOrFinish (simtime_t extraTime)
 
virtual void finishActiveOperation ()
 

Additional Inherited Members

- Public Member Functions inherited from inet::OperationalMixin< cSimpleModule >
virtual ~OperationalMixin ()
 }@ More...
 
- Public Member Functions inherited from inet::ILifecycle
virtual ~ILifecycle ()
 
- Protected Types inherited from inet::OperationalMixin< cSimpleModule >
enum  State
 
- Protected Attributes inherited from inet::OperationalMixin< cSimpleModule >
State operationalState
 
simtime_t lastChange
 
Operation activeOperation
 
cMessage * activeOperationTimeout
 
cMessage * activeOperationExtraTimer
 

Member Function Documentation

◆ handleLowerCommand()

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

Reimplemented in inet::physicallayer::Radio.

57 {
58  throw cRuntimeError("Lower command '%s' is not handled.", message->getName());
59 }

Referenced by handleLowerMessage(), and inet::physicallayer::PhysicalLayerBase::handleLowerMessage().

◆ handleLowerMessage()

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

Reimplemented in inet::physicallayer::PhysicalLayerBase.

37 {
38  if (!message->isPacket())
39  handleLowerCommand(message);
40  else {
41  emit(packetReceivedFromLowerSignal, message);
42  handleLowerPacket(check_and_cast<Packet *>(message));
43  }
44 }

Referenced by handleMessageWhenUp().

◆ handleLowerPacket()

void inet::LayeredProtocolBase::handleLowerPacket ( Packet packet)
protectedvirtual

◆ handleMessageWhenUp()

void inet::LayeredProtocolBase::handleMessageWhenUp ( cMessage *  message)
overrideprotectedvirtual

Implements inet::OperationalMixin< cSimpleModule >.

Reimplemented in inet::EthernetCsmaMac, inet::EthernetMac, inet::ieee80211::Ieee80211Mac, inet::Ppp, inet::physicallayer::ShortcutRadio, and inet::ShortcutMac.

15 {
16  if (message->isSelfMessage())
17  handleSelfMessage(message);
18  else if (isUpperMessage(message))
19  handleUpperMessage(message);
20  else if (isLowerMessage(message))
21  handleLowerMessage(message);
22  else
23  throw cRuntimeError("Message '%s' received on unexpected gate '%s'", message->getName(), message->getArrivalGate()->getFullName());
24 }

Referenced by inet::ShortcutMac::handleMessageWhenUp(), inet::physicallayer::ShortcutRadio::handleMessageWhenUp(), inet::Ppp::handleMessageWhenUp(), and inet::ieee80211::Ieee80211Mac::handleMessageWhenUp().

◆ handleSelfMessage()

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

◆ handleUpperCommand()

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

◆ handleUpperMessage()

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

Reimplemented in inet::Tun.

27 {
28  if (!message->isPacket())
29  handleUpperCommand(message);
30  else {
31  emit(packetReceivedFromUpperSignal, message);
32  handleUpperPacket(check_and_cast<Packet *>(message));
33  }
34 }

Referenced by handleMessageWhenUp().

◆ handleUpperPacket()

◆ isLowerMessage()

virtual bool inet::LayeredProtocolBase::isLowerMessage ( cMessage *  message) const
protectedpure virtual

◆ isUpperMessage()

virtual bool inet::LayeredProtocolBase::isUpperMessage ( cMessage *  message) const
protectedpure virtual

The documentation for this class was generated from the following files:
inet::packetReceivedFromUpperSignal
simsignal_t packetReceivedFromUpperSignal
Definition: Simsignals.cc:88
inet::LayeredProtocolBase::handleLowerCommand
virtual void handleLowerCommand(cMessage *message)
Definition: LayeredProtocolBase.cc:56
inet::LayeredProtocolBase::handleUpperCommand
virtual void handleUpperCommand(cMessage *message)
Definition: LayeredProtocolBase.cc:51
inet::LayeredProtocolBase::handleLowerMessage
virtual void handleLowerMessage(cMessage *message)
Definition: LayeredProtocolBase.cc:36
inet::LayeredProtocolBase::handleSelfMessage
virtual void handleSelfMessage(cMessage *message)
Definition: LayeredProtocolBase.cc:46
inet::LayeredProtocolBase::handleLowerPacket
virtual void handleLowerPacket(Packet *packet)
Definition: LayeredProtocolBase.cc:66
inet::LayeredProtocolBase::handleUpperMessage
virtual void handleUpperMessage(cMessage *message)
Definition: LayeredProtocolBase.cc:26
inet::packetReceivedFromLowerSignal
simsignal_t packetReceivedFromLowerSignal
Definition: Simsignals.cc:91
inet::LayeredProtocolBase::handleUpperPacket
virtual void handleUpperPacket(Packet *packet)
Definition: LayeredProtocolBase.cc:61
inet::LayeredProtocolBase::isLowerMessage
virtual bool isLowerMessage(cMessage *message) const =0
inet::LayeredProtocolBase::isUpperMessage
virtual bool isUpperMessage(cMessage *message) const =0