INET Framework for OMNeT++/OMNEST
inet::TunInterface Class Reference

#include <TunInterface.h>

Inheritance diagram for inet::TunInterface:
inet::MACBase inet::ILifecycle

Public Member Functions

virtual int numInitStages () const override
 
virtual void initialize (int stage) override
 
virtual void handleMessage (cMessage *msg) override
 
virtual void finish () override
 
- Public Member Functions inherited from inet::MACBase
 MACBase ()
 
virtual ~MACBase ()
 
- Public Member Functions inherited from inet::ILifecycle
virtual ~ILifecycle ()
 

Protected Member Functions

InterfaceEntrycreateInterfaceEntry () override
 should create InterfaceEntry More...
 
virtual void flushQueue () override
 should clear queue and emit signal "dropPkFromHLIfaceDown" with entire packets More...
 
virtual void clearQueue () override
 should clear queue silently More...
 
virtual bool isUpperMsg (cMessage *msg) override
 should return true if the msg arrived from upper layer, else return false More...
 
- Protected Member Functions inherited from inet::MACBase
void registerInterface ()
 
virtual void receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override
 
virtual bool handleOperationStage (LifecycleOperation *operation, int stage, IDoneCallback *doneCallback) override
 Perform one stage of a lifecycle operation. More...
 
virtual void updateOperationalFlag (bool isNodeUp)
 
virtual bool isNodeUp ()
 
virtual void handleMessageWhenDown (cMessage *msg)
 

Static Protected Attributes

static simsignal_t packetSentToLowerSignal = registerSignal("packetSentToLower")
 
static simsignal_t packetReceivedFromLowerSignal = registerSignal("packetReceivedFromLower")
 
static simsignal_t packetSentToUpperSignal = registerSignal("packetSentToUpper")
 
static simsignal_t packetReceivedFromUpperSignal = registerSignal("packetReceivedFromUpper")
 

Additional Inherited Members

- Protected Attributes inherited from inet::MACBase
cModule * hostModule = nullptr
 
bool isOperational = false
 
InterfaceEntryinterfaceEntry = nullptr
 

Member Function Documentation

void inet::TunInterface::clearQueue ( )
overrideprotectedvirtual

should clear queue silently

Implements inet::MACBase.

67 {
68  // does not have a queue, do nothing
69 }
InterfaceEntry * inet::TunInterface::createInterfaceEntry ( )
overrideprotectedvirtual

should create InterfaceEntry

Implements inet::MACBase.

39 {
40  InterfaceEntry *e = new InterfaceEntry(this);
41  e->setMtu(par("mtu").longValue());
42  return e;
43 }
const value< double, units::C > e(1.602176487e-19)
void inet::TunInterface::finish ( )
overridevirtual
58 {
59 }
void inet::TunInterface::flushQueue ( )
overrideprotectedvirtual

should clear queue and emit signal "dropPkFromHLIfaceDown" with entire packets

Implements inet::MACBase.

62 {
63  // does not have a queue, do nothing
64 }
void inet::TunInterface::handleMessage ( cMessage *  msg)
overridevirtual
46 {
47  if (msg->getArrivalGate()->isName("appIn")) {
48  emit(packetSentToUpperSignal, msg);
49  send(msg, "upperLayerOut");
50  }
51  else if (msg->getArrivalGate()->isName("upperLayerIn")) {
53  send(msg, "appOut");
54  }
55 }
static simsignal_t packetSentToUpperSignal
Definition: TunInterface.h:36
static simsignal_t packetReceivedFromUpperSignal
Definition: TunInterface.h:37
void inet::TunInterface::initialize ( int  stage)
overridevirtual

Reimplemented from inet::MACBase.

32 {
33  MACBase::initialize(stage);
34  if (stage == INITSTAGE_LOCAL)
36 }
virtual void initialize(int stage) override
Definition: MACBase.cc:37
Local initializations.
Definition: InitStages.h:35
void registerInterface()
Definition: MACBase.cc:98
virtual bool inet::TunInterface::isUpperMsg ( cMessage *  msg)
inlineoverrideprotectedvirtual

should return true if the msg arrived from upper layer, else return false

Implements inet::MACBase.

44 { return msg->arrivedOn("upperLayerIn"); }
virtual int inet::TunInterface::numInitStages ( ) const
inlineoverridevirtual

Reimplemented from inet::MACBase.

47 { return NUM_INIT_STAGES; }
The number of initialization stages.
Definition: InitStages.h:116

Member Data Documentation

simsignal_t inet::TunInterface::packetReceivedFromLowerSignal = registerSignal("packetReceivedFromLower")
staticprotected
simsignal_t inet::TunInterface::packetReceivedFromUpperSignal = registerSignal("packetReceivedFromUpper")
staticprotected

Referenced by handleMessage().

simsignal_t inet::TunInterface::packetSentToLowerSignal = registerSignal("packetSentToLower")
staticprotected
simsignal_t inet::TunInterface::packetSentToUpperSignal = registerSignal("packetSentToUpper")
staticprotected

Referenced by handleMessage().


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