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

Interface entry for the interface table in IInterfaceTable. More...

#include <NetworkInterface.h>

Inheritance diagram for inet::NetworkInterface:
inet::queueing::PacketProcessorBase inet::queueing::IPassivePacketSink inet::ILifecycle inet::queueing::IPacketProcessor inet::StringFormat::IDirectiveResolver inet::EthernetCutthroughInterface inet::ExtInterface

Classes

class  LocalGate
 

Public Types

enum  State { UP, DOWN, GOING_UP, GOING_DOWN }
 
enum  {
  F_CARRIER, F_STATE, F_NAME, F_NODE_IN_GATEID,
  F_NODE_OUT_GATEID, F_NETW_GATEIDX, F_LOOPBACK, F_BROADCAST,
  F_MULTICAST, F_POINTTOPOINT, F_DATARATE, F_MTU,
  F_MACADDRESS, F_TOKEN, F_IPV4_DATA, F_IPV6_DATA,
  F_NEXTHOP_DATA, F_ISIS_DATA, F_TRILL_DATA, F_IEEE8021D_DATA,
  F_CLNS_DATA
}
 

Public Member Functions

virtual void setInterfaceId (int id)
 
virtual void resetInterface ()
 
 NetworkInterface ()
 
virtual ~NetworkInterface ()
 
virtual std::string str () const override
 
virtual std::string getInterfaceFullPath () const
 
virtual bool supportsPacketSending (cGate *gate) const override
 Returns true if the processor supports sending packets at the given gate. More...
 
virtual bool supportsPacketPushing (cGate *gate) const override
 Returns true if the processor supports pushing packets at the given gate. More...
 
virtual bool supportsPacketPulling (cGate *gate) const override
 Returns true if the processor supports pulling packets at the given gate. More...
 
virtual bool supportsPacketPassing (cGate *gate) const override
 Returns true if the processor supports passing packets as a whole at the given gate. More...
 
virtual bool supportsPacketStreaming (cGate *gate) const override
 Returns true if the processor supports streaming packets at the given gate. More...
 
virtual bool canPushSomePacket (cGate *gate) const override
 Returns false if the packet sink is full at the given gate and no more packets can be pushed into it without raising an error. More...
 
virtual bool canPushPacket (Packet *packet, cGate *gate) const override
 Returns true if the given packet can be pushed at the given gate into the packet sink without raising an error. More...
 
virtual void pushPacket (Packet *packet, cGate *gate) override
 Pushes the packet into the packet sink at the given gate. More...
 
virtual void pushPacketStart (Packet *packet, cGate *gate, bps datarate) override
 Starts pushing the packet into the packet sink at the given gate. More...
 
virtual void pushPacketEnd (Packet *packet, cGate *gate) override
 Ends pushing the packet into the packet sink at the given gate. More...
 
virtual void pushPacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength=b(0)) override
 Progresses pushing the packet into the packet sink at the given gate. More...
 
IInterfaceTablegetInterfaceTable () const
 Returns the IInterfaceTable this interface is in, or nullptr. More...
 
State getState () const
 Returns the requested state of this interface. More...
 
cChannel * getRxTransmissionChannel ()
 
cChannel * getTxTransmissionChannel ()
 
bool isUp () const
 Returns the combined state of the carrier and the interface requested state. More...
 
bool isDown () const
 
void setHasModuleIdAddress (bool value)
 
void setHasModulePathAddress (bool value)
 
const ModuleIdAddress getModuleIdAddress () const
 
const ModulePathAddress getModulePathAddress () const
 
const L3Address getNetworkAddress () const
 
virtual bool hasNetworkAddress (const L3Address &address) const
 
Field getters. Note they are non-virtual and inline, for performance reasons.
const ProtocolgetProtocol () const
 
int getInterfaceId () const
 
const char * getInterfaceName () const
 
int getNodeOutputGateId () const
 
int getNodeInputGateId () const
 
int getMtu () const
 
bool hasCarrier () const
 
bool isBroadcast () const
 
bool isMulticast () const
 
bool isPointToPoint () const
 
bool isLoopback () const
 
bool isWired () const
 
bool isWireless () const
 
double getDatarate () const
 
const MacAddressgetMacAddress () const
 
const InterfaceTokengetInterfaceToken () const
 
Field setters
virtual void setProtocol (const Protocol *protocol)
 
virtual void setInterfaceName (const char *s)
 
virtual void setNodeOutputGateId (int i)
 
virtual void setNodeInputGateId (int i)
 
virtual void setMtu (int m)
 
virtual void setState (State s)
 
virtual void setCarrier (bool b)
 
virtual void setBroadcast (bool b)
 
virtual void setMulticast (bool b)
 
virtual void setPointToPoint (bool b)
 
virtual void setLoopback (bool b)
 
virtual void setDatarate (double d)
 
virtual void setMacAddress (const MacAddress &addr)
 
virtual void setInterfaceToken (const InterfaceToken &t)
 
bool matchesMacAddress (const MacAddress &address) const
 
Multicast MacAddress related functions
void addMulticastMacAddress (const MacAddress &address)
 
void removeMulticastMacAddress (const MacAddress &address)
 
bool matchesMulticastMacAddress (const MacAddress &address) const
 
Tag related functions
int getNumProtocolData () const
 Returns the number of protocol data structures. More...
 
const InterfaceProtocolDatagetProtocolData (int index) const
 Returns the protocol data at the given index. More...
 
void clearProtocolDataSet ()
 Clears the set of protocol data objects. More...
 
template<typename T >
const TfindProtocolData () const
 Returns the protocol data for the provided type or returns nullptr if no such protocol data is found. More...
 
template<typename T >
TfindProtocolDataForUpdate ()
 Returns the protocol data for the provided type or returns nullptr if no such protocol data is found. More...
 
template<typename T >
const TgetProtocolData () const
 Returns the protocol data for the provided type or throws an exception if no such protocol data is found. More...
 
template<typename T >
TgetProtocolDataForUpdate ()
 Returns the protocol data for the provided type or throws an exception if no such protocol data is found. More...
 
template<typename T >
TaddProtocolData ()
 Returns a newly added protocol data for the provided type, or throws an exception if such a protocol data is already present. More...
 
template<typename T >
TaddProtocolDataIfAbsent ()
 Returns a newly added protocol data for the provided type if absent, or returns the protocol data that is already present. More...
 
template<typename T >
TremoveProtocolData ()
 Removes the protocol data for the provided type, or throws an exception if no such protocol data is found. More...
 
template<typename T >
TremoveProtocolDataIfPresent ()
 Removes the protocol data for the provided type if present, or returns nullptr if no such protocol data is found. More...
 
Accessing protocol-specific interface data. Note methods are non-virtual, for performance reasons.
Ipv4Address getIpv4Address () const
 
Ipv4Address getIpv4Netmask () const
 
virtual void joinMulticastGroup (const L3Address &address)
 
virtual void changeMulticastGroupMembership (const L3Address &multicastAddress, McastSourceFilterMode oldFilterMode, const std::vector< L3Address > &oldSourceList, McastSourceFilterMode newFilterMode, const std::vector< L3Address > &newSourceList)
 
access to the cost process estimation


virtual bool setEstimateCostProcess (int, MacEstimateCostProcess *p)
 
virtual MacEstimateCostProcessgetEstimateCostProcess (int)
 
virtual bool handleOperationStage (LifecycleOperation *operation, IDoneCallback *doneCallback) override
 Perform one stage of a lifecycle operation. More...
 
virtual void handleStartOperation (LifecycleOperation *operation)
 
virtual void handleStopOperation (LifecycleOperation *operation)
 
virtual void handleCrashOperation (LifecycleOperation *operation)
 
- Public Member Functions inherited from inet::queueing::IPacketProcessor
virtual ~IPacketProcessor ()
 
- Public Member Functions inherited from inet::queueing::IPassivePacketSink
virtual ~IPassivePacketSink ()
 
- Public Member Functions inherited from inet::ILifecycle
virtual ~ILifecycle ()
 

Protected Member Functions

virtual void configChanged (int fieldId)
 
virtual void stateChanged (int fieldId)
 
virtual void changed (simsignal_t signalID, int fieldId)
 
virtual int numInitStages () const override
 
virtual void initialize (int stage) override
 
virtual void handleParameterChange (const char *name) override
 
virtual void refreshDisplay () const override
 
virtual void updateDisplayString () const override
 
virtual const char * resolveDirective (char directive) const override
 
virtual void receiveSignal (cComponent *source, simsignal_t signal, cObject *obj, cObject *details) override
 
virtual cGate * createGateObject (cGate::Type type) override
 
virtual double computeDatarate () const
 
virtual bool computeCarrier () const
 
virtual std::string getFullPath () const override
 
virtual const char * getName () const override
 
virtual void arrived (cMessage *message, cGate *gate, const SendOptions &options, simtime_t time) override
 
- Protected Member Functions inherited from inet::queueing::PacketProcessorBase
virtual void handlePacketProcessed (Packet *packet)
 
virtual void checkPacketOperationSupport (cGate *gate) const
 
virtual void checkPacketOperationSupport (cGate *startGate, cGate *endGate) const
 
virtual void animate (Packet *packet, cGate *gate, const SendOptions &sendOptions, Action action) const
 
virtual void animatePacket (Packet *packet, cGate *gate, Action action) const
 
virtual void animatePacketStart (Packet *packet, cGate *gate, bps datarate, long transmissionId, Action action) const
 
virtual void animatePacketStart (Packet *packet, cGate *gate, bps datarate, const SendOptions &sendOptions, Action action) const
 
virtual void animatePacketEnd (Packet *packet, cGate *gate, long transmissionId, Action action) const
 
virtual void animatePacketEnd (Packet *packet, cGate *gate, const SendOptions &sendOptions, Action action) const
 
virtual void animatePacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, long transmissionId, Action action) const
 
virtual void animatePacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, const SendOptions &sendOptions, Action action) const
 
virtual void pushOrSendPacket (Packet *packet, cGate *gate, IPassivePacketSink *consumer)
 
virtual void pushOrSendPacketStart (Packet *packet, cGate *gate, IPassivePacketSink *consumer, bps datarate, int transmissionId)
 
virtual void pushOrSendPacketEnd (Packet *packet, cGate *gate, IPassivePacketSink *consumer, int transmissionId)
 
virtual void pushOrSendPacketProgress (Packet *packet, cGate *gate, IPassivePacketSink *consumer, bps datarate, b position, b extraProcessableLength, int transmissionId)
 
virtual void animatePush (Packet *packet, cGate *gate, const SendOptions &sendOptions) const
 
virtual void animatePushPacket (Packet *packet, cGate *gate) const
 
virtual void animatePushPacketStart (Packet *packet, cGate *gate, bps datarate, long transmissionId) const
 
virtual void animatePushPacketStart (Packet *packet, cGate *gate, bps datarate, const SendOptions &sendOptions) const
 
virtual void animatePushPacketEnd (Packet *packet, cGate *gate, long transmissionId) const
 
virtual void animatePushPacketEnd (Packet *packet, cGate *gate, const SendOptions &sendOptions) const
 
virtual void animatePushPacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, long transmissionId) const
 
virtual void animatePushPacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, const SendOptions &sendOptions) const
 
virtual void animatePull (Packet *packet, cGate *gate, const SendOptions &sendOptions) const
 
virtual void animatePullPacket (Packet *packet, cGate *gate) const
 
virtual void animatePullPacketStart (Packet *packet, cGate *gate, bps datarate, long transmissionId) const
 
virtual void animatePullPacketStart (Packet *packet, cGate *gate, bps datarate, const SendOptions &sendOptions) const
 
virtual void animatePullPacketEnd (Packet *packet, cGate *gate, long transmissionId) const
 
virtual void animatePullPacketEnd (Packet *packet, cGate *gate, const SendOptions &sendOptions) const
 
virtual void animatePullPacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, long transmissionId) const
 
virtual void animatePullPacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, const SendOptions &sendOptions) const
 
virtual void dropPacket (Packet *packet, PacketDropReason reason, int limit=-1)
 

Protected Attributes

cGate * upperLayerIn = nullptr
 
cGate * upperLayerOut = nullptr
 
cGate * rxIn = nullptr
 
cGate * txOut = nullptr
 
cChannel * rxTransmissionChannel = nullptr
 
cChannel * txTransmissionChannel = nullptr
 
queueing::IPassivePacketSinkupperLayerInConsumer = nullptr
 
queueing::IPassivePacketSinkupperLayerOutConsumer = nullptr
 
const Protocolprotocol = nullptr
 
ModuleRefByPar< IInterfaceTableinterfaceTable
 IInterfaceTable that contains this interface, or nullptr. More...
 
int interfaceId = -1
 identifies the interface in the IInterfaceTable More...
 
std::string interfaceName
 
int nodeOutputGateId = -1
 id of the output gate of this host/router (or -1 if this is a virtual interface) More...
 
int nodeInputGateId = -1
 id of the input gate of this host/router (or -1 if this is a virtual interface) More...
 
int mtu = 0
 Maximum Transmission Unit (e.g. 1500 on Ethernet); 0 means infinite (i.e. never fragment) More...
 
State state = DOWN
 requested interface state, similar to Linux ifup/ifdown More...
 
bool carrier = false
 presence of the physical or virtual carrier More...
 
bool broadcast = false
 interface supports broadcast More...
 
bool multicast = false
 interface supports multicast More...
 
bool pointToPoint = false
 interface is point-to-point link More...
 
bool loopback = false
 interface is loopback interface More...
 
bool hasModuleIdAddress = false
 
bool hasModulePathAddress = false
 
double datarate = 0
 data rate in bit/s More...
 
MacAddress macAddr
 link-layer address (for now, only IEEE 802 MAC addresses are supported) More...
 
InterfaceToken token
 for Ipv6 stateless autoconfig (RFC 1971), interface identifier (RFC 2462) More...
 
std::vector< MacAddressmulticastAddresses
 
TagSet protocolDataSet
 
std::vector< MacEstimateCostProcess * > estimateCostProcessArray
 
- Protected Attributes inherited from inet::queueing::PacketProcessorBase
const char * displayStringTextFormat = nullptr
 
int numProcessedPackets = -1
 
b processedTotalLength = b(-1)
 

Private Member Functions

 NetworkInterface (const NetworkInterface &obj)
 
NetworkInterfaceoperator= (const NetworkInterface &obj)
 

Friends

class InterfaceProtocolData
 

Additional Inherited Members

- Protected Types inherited from inet::queueing::PacketProcessorBase
enum  Action { PUSH, PULL }
 

Detailed Description

Interface entry for the interface table in IInterfaceTable.

See also
IInterfaceTable

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
F_CARRIER 
F_STATE 
F_NAME 
F_NODE_IN_GATEID 
F_NODE_OUT_GATEID 
F_NETW_GATEIDX 
F_LOOPBACK 
F_BROADCAST 
F_MULTICAST 
F_POINTTOPOINT 
F_DATARATE 
F_MTU 
F_MACADDRESS 
F_TOKEN 
F_IPV4_DATA 
F_IPV6_DATA 
F_NEXTHOP_DATA 
F_ISIS_DATA 
F_TRILL_DATA 
F_IEEE8021D_DATA 
F_CLNS_DATA 

◆ State

Enumerator
UP 
DOWN 
GOING_UP 
GOING_DOWN 
92 { UP, DOWN, GOING_UP, GOING_DOWN };

Constructor & Destructor Documentation

◆ NetworkInterface() [1/2]

inet::NetworkInterface::NetworkInterface ( const NetworkInterface obj)
private

◆ NetworkInterface() [2/2]

inet::NetworkInterface::NetworkInterface ( )
84 {
85 }

◆ ~NetworkInterface()

inet::NetworkInterface::~NetworkInterface ( )
virtual
88 {
90 }

Member Function Documentation

◆ addMulticastMacAddress()

void inet::NetworkInterface::addMulticastMacAddress ( const MacAddress address)
414 {
415  if (contains(multicastAddresses, address))
416  throw cRuntimeError("Multicast MacAddress already added: '%s'", address.str().c_str());
417  multicastAddresses.push_back(address);
418 }

◆ addProtocolData()

template<typename T >
T* inet::NetworkInterface::addProtocolData ( )
inline

Returns a newly added protocol data for the provided type, or throws an exception if such a protocol data is already present.

327  {
328  auto t = protocolDataSet.addTag<T>();
329  auto ipd = static_cast<InterfaceProtocolData *>(t);
330  ipd->ownerp = this;
332  return t;
333  }

Referenced by inet::NextHopRoutingTable::configureInterface(), inet::Ipv6RoutingTable::configureInterfaceForIpv6(), inet::L2NodeConfigurator::prepareInterface(), and inet::Ipv4NodeConfigurator::prepareInterface().

◆ addProtocolDataIfAbsent()

template<typename T >
T* inet::NetworkInterface::addProtocolDataIfAbsent ( )
inline

Returns a newly added protocol data for the provided type if absent, or returns the protocol data that is already present.

338  {
339  auto t = protocolDataSet.addTagIfAbsent<T>();
340  auto ipd = static_cast<InterfaceProtocolData *>(t);
341  if (ipd->ownerp != this) {
342  ipd->ownerp = this;
344  }
345  return t;
346  }

◆ arrived()

void inet::NetworkInterface::arrived ( cMessage *  message,
cGate *  gate,
const SendOptions &  options,
simtime_t  time 
)
overrideprotectedvirtual
177 {
178  if (gate == upperLayerOut && message->isPacket()) {
179  auto packet = check_and_cast<Packet *>(message);
180  packet->addTagIfAbsent<InterfaceInd>()->setInterfaceId(interfaceId);
181  }
182  cModule::arrived(message, gate, options, time);
183 }

◆ canPushPacket()

virtual bool inet::NetworkInterface::canPushPacket ( Packet packet,
cGate *  gate 
) const
inlineoverridevirtual

Returns true if the given packet can be pushed at the given gate into the packet sink without raising an error.

The packet must not be nullptr. The gate must be a valid gate of this module and it must support pushing packets.

Implements inet::queueing::IPassivePacketSink.

196 { return true; }

◆ canPushSomePacket()

virtual bool inet::NetworkInterface::canPushSomePacket ( cGate *  gate) const
inlineoverridevirtual

Returns false if the packet sink is full at the given gate and no more packets can be pushed into it without raising an error.

The gate must be a valid gate of this module and it must support pushing packets.

Implements inet::queueing::IPassivePacketSink.

195 { return true; }

◆ changed()

void inet::NetworkInterface::changed ( simsignal_t  signalID,
int  fieldId 
)
protectedvirtual
389 {
390  if (interfaceTable) {
391  NetworkInterfaceChangeDetails details(this, fieldId);
392  interfaceTable->interfaceChanged(signalID, &details);
393  }
394 }

Referenced by inet::InterfaceProtocolData::changed(), and clearProtocolDataSet().

◆ changeMulticastGroupMembership()

void inet::NetworkInterface::changeMulticastGroupMembership ( const L3Address multicastAddress,
McastSourceFilterMode  oldFilterMode,
const std::vector< L3Address > &  oldSourceList,
McastSourceFilterMode  newFilterMode,
const std::vector< L3Address > &  newSourceList 
)
virtual
561 {
562  switch (multicastAddress.getType()) {
563 #ifdef INET_WITH_IPv4
564  case L3Address::IPv4: {
565  std::vector<Ipv4Address> oldIPv4SourceList, newIPv4SourceList;
566  toIpv4AddressVector(oldSourceList, oldIPv4SourceList);
567  toIpv4AddressVector(newSourceList, newIPv4SourceList);
568  getProtocolDataForUpdate<Ipv4InterfaceData>()->changeMulticastGroupMembership(multicastAddress.toIpv4(),
569  oldFilterMode, oldIPv4SourceList, newFilterMode, newIPv4SourceList);
570  break;
571  }
572 
573 #endif // ifdef INET_WITH_IPv4
574 #ifdef INET_WITH_IPv6
575  case L3Address::IPv6:
576  // TODO
577  throw cRuntimeError("changeMulticastGroupMembership() not implemented for type %s", L3Address::getTypeName(multicastAddress.getType()));
578  break;
579 
580 #endif // ifdef INET_WITH_IPv6
581  case L3Address::MAC:
582  case L3Address::MODULEID:
584  // TODO
585  throw cRuntimeError("changeMulticastGroupMembership() not implemented for type %s", L3Address::getTypeName(multicastAddress.getType()));
586  break;
587 
588  default:
589  throw cRuntimeError("Unknown address type");
590  }
591 }

Referenced by inet::Udp::blockMulticastSources(), inet::Udp::joinMulticastSources(), inet::Udp::leaveMulticastGroups(), inet::Udp::leaveMulticastSources(), inet::Udp::setMulticastSourceFilter(), and inet::Udp::unblockMulticastSources().

◆ clearProtocolDataSet()

void inet::NetworkInterface::clearProtocolDataSet ( )

Clears the set of protocol data objects.

93 {
94  std::vector<int> ids;
95  int n = protocolDataSet.getNumTags();
96  ids.reserve(n);
97  for (int i = 0; i < n; i++)
98  ids[i] = static_cast<const InterfaceProtocolData *>(protocolDataSet.getTag(i))->id;
100  for (int i = 0; i < n; i++)
102 }

◆ computeCarrier()

bool inet::NetworkInterface::computeCarrier ( ) const
protectedvirtual
346 {
347  if (isWireless())
348  return true;
349  else {
350  bool connected = rxTransmissionChannel != nullptr && txTransmissionChannel != nullptr;
351  bool disabled = !connected || rxTransmissionChannel->isDisabled() || txTransmissionChannel->isDisabled();
352  return connected && !disabled;
353  }
354 }

Referenced by initialize(), and receiveSignal().

◆ computeDatarate()

double inet::NetworkInterface::computeDatarate ( ) const
protectedvirtual
333 {
334  double moduleDatarate = 0;
335  if (hasPar("bitrate"))
336  moduleDatarate = par("bitrate");
337  double channelDatarate = 0;
338  if (txTransmissionChannel != nullptr && txTransmissionChannel->hasPar("datarate"))
339  channelDatarate = txTransmissionChannel->par("datarate");
340  if (moduleDatarate != 0 && channelDatarate != 0 && moduleDatarate != channelDatarate)
341  throw cRuntimeError("Wired network interface datarate is set on both the network interface module and on the corresponding transmission channel and the two values are different");
342  return moduleDatarate != 0 ? moduleDatarate : channelDatarate;
343 }

Referenced by handleParameterChange(), initialize(), and receiveSignal().

◆ configChanged()

virtual void inet::NetworkInterface::configChanged ( int  fieldId)
inlineprotectedvirtual

◆ createGateObject()

virtual cGate* inet::NetworkInterface::createGateObject ( cGate::Type  type)
inlineoverrideprotectedvirtual
166  {
167  return type == cGate::INPUT ? new LocalGate(this) : cModule::createGateObject(type);
168  }

◆ findProtocolData()

template<typename T >
const T* inet::NetworkInterface::findProtocolData ( ) const
inline

◆ findProtocolDataForUpdate()

template<typename T >
T* inet::NetworkInterface::findProtocolDataForUpdate ( )
inline

Returns the protocol data for the provided type or returns nullptr if no such protocol data is found.

306  {
308  }

Referenced by inet::Ipv6FlatNetworkConfigurator::configureAdvPrefixes(), inet::Ipv4NetworkConfigurator::createInterfaceInfo(), inet::Igmpv3::initialize(), and inet::eigrp::EigrpDeviceConfigurator::loadEigrpInterfaces6Config().

◆ getDatarate()

◆ getEstimateCostProcess()

MacEstimateCostProcess * inet::NetworkInterface::getEstimateCostProcess ( int  position)
virtual
513 {
514  ASSERT(position >= 0);
515  if ((size_t)position < estimateCostProcessArray.size()) {
516  return estimateCostProcessArray[position];
517  }
518  return nullptr;
519 }

◆ getFullPath()

virtual std::string inet::NetworkInterface::getFullPath ( ) const
inlineoverrideprotectedvirtual
179 { return cModule::getFullPath(); }

◆ getInterfaceFullPath()

◆ getInterfaceId()

int inet::NetworkInterface::getInterfaceId ( ) const
inline
232 { return interfaceId; }

Referenced by inet::PimSm::addNewRouteG(), inet::PimSm::addNewRouteSG(), inet::Ipv6FlatNetworkConfigurator::addOwnAdvPrefixRoutes(), inet::Ipv6FlatNetworkConfigurator::addStaticRoutes(), inet::Ipv4::arpResolutionCompleted(), inet::Udp::blockMulticastSources(), inet::InterfaceTable::collectMulticastGroups(), inet::Ipv6FlatNetworkConfigurator::configureAdvPrefixes(), inet::Ipv6RoutingTable::configureInterfaceForIpv6(), inet::xMIPv6::createAndSendBAMessage(), inet::xMIPv6::createAndSendBRRMessage(), inet::xMIPv6::createAndSendBUMessage(), inet::Ipv6NeighbourDiscovery::createAndSendNsPacket(), inet::Ipv6NeighbourDiscovery::createAndSendRaPacket(), inet::Ipv6NeighbourDiscovery::createAndSendRsPacket(), inet::xMIPv6::createBCEntryExpiryTimer(), inet::xMIPv6::createBRRTimer(), inet::xMIPv6::createBULEntryExpiryTimer(), inet::xMIPv6::createBUTimer(), inet::visualizer::Ieee80211OsgVisualizer::createIeee80211Visualization(), inet::visualizer::Ieee80211CanvasVisualizer::createIeee80211Visualization(), inet::visualizer::InterfaceTableOsgVisualizer::createInterfaceVisualization(), inet::visualizer::InterfaceTableCanvasVisualizer::createInterfaceVisualization(), inet::Ipv6NeighbourDiscovery::createRaTimer(), inet::xMIPv6::createTestInitTimer(), inet::xMIPv6::createTokenEntryExpiryTimer(), inet::Ipv4::datagramLocalOut(), inet::NextHopForwarding::decapsulate(), inet::bgp::BgpRouter::decisionProcess(), inet::PacketReceiverBase::decodePacket(), inet::InterfaceTable::deleteInterface(), inet::Ipv6NeighbourDiscovery::determineNextHop(), inet::Ipv6::determineOutputInterface(), inet::Ipv6NeighbourDiscovery::fetchAdvIfEntry(), inet::xMIPv6::fetchBUTransmitIfEntry(), inet::Ipv6NeighbourDiscovery::fetchRdEntry(), inet::Ipv4::forwardMulticastPacket(), inet::Igmpv2::getHostInterfaceData(), inet::Igmpv3::getHostInterfaceData(), inet::visualizer::Ieee80211VisualizerBase::getIeee80211Visualization(), inet::PimDm::getIncomingInterface(), inet::PimSm::getIncomingInterface(), inet::PimInterface::getInterfaceId(), inet::PimNeighbor::getInterfaceId(), inet::Rip::getInterfaceMetric(), inet::visualizer::InterfaceTableVisualizerBase::getInterfaceVisualization(), inet::ospfv2::Router::getPreferredEntry(), inet::Igmpv2::getRouterInterfaceData(), inet::Igmpv3::getRouterInterfaceData(), inet::ospfv2::Router::getRoutesToASBoundaryRouter(), inet::xMIPv6::handleBCExpiry(), inet::xMIPv6::handleBULExpiry(), inet::ospfv2::Ospfv2::handleInterfaceDown(), inet::EthernetCutthroughSource::handleMessage(), inet::Dsdv::handleMessageWhenUp(), inet::MessageDispatcher::handleRegisterInterface(), inet::Dsdv::handleSelfMessage(), inet::Ieee8022LlcSocketIo::handleStartOperation(), inet::xMIPv6::handleTokenExpiry(), inet::ospfv2::Router::hasRouteToASBoundaryRouter(), inet::PimSm::IamDR(), inet::TunLoopbackApp::initialize(), inet::TunnelApp::initialize(), inet::Ipv6RoutingTable::initialize(), inet::Ldp::initialize(), inet::Ipv6NeighbourDiscovery::initiateDad(), inet::Ipv6NeighbourDiscovery::initiateRouterDiscovery(), inet::Udp::joinMulticastSources(), inet::Udp::leaveMulticastSources(), inet::eigrp::EigrpDeviceConfigurator::loadEigrpInterfaces6Config(), inet::eigrp::EigrpDeviceConfigurator::loadEigrpInterfacesConfig(), inet::eigrp::EigrpDeviceConfigurator::loadEigrpIPv4Networks(), inet::eigrp::EigrpDeviceConfigurator::loadEigrpProcesses6Config(), inet::eigrp::EigrpDeviceConfigurator::loadEigrpProcessesConfig(), inet::ospfv2::Ospfv2ConfigReader::loadInterfaceParameters(), inet::ospfv2::Ospfv2ConfigReader::loadLoopbackParameters(), inet::PimSm::multicastPacketForwarded(), inet::PimDm::multicastReceiverAdded(), inet::PimSm::multicastReceiverAdded(), inet::PimDm::multicastReceiverRemoved(), inet::PimSm::multicastReceiverRemoved(), inet::ospfv3::Ospfv3Interface::Ospfv3Interface(), inet::Ipv4::preroutingFinish(), inet::Arp::processArpPacket(), inet::PimDm::processAssert(), inet::DhcpServer::processDhcpMessage(), inet::PimDm::processGraftPacket(), inet::eigrp::EigrpIpv4Pdm::processIfaceStateChange(), inet::eigrp::EigrpIpv6Pdm::processIfaceStateChange(), inet::PimSm::processJoinG(), inet::PimSm::processJoinSG(), inet::Mpls::processMplsPacketFromL2(), inet::Ipv6NeighbourDiscovery::processNaPacket(), inet::Ipv6NeighbourDiscovery::processNsWithSpecifiedSrcAddr(), inet::PimSm::processPruneG(), inet::PimSm::processPruneSG(), inet::Ipv6NeighbourDiscovery::processRaForRouterUpdates(), inet::Ipv6NeighbourDiscovery::processRaPrefixInfo(), inet::dymo::Dymo::processRerr(), inet::EthernetCutthroughSource::pushPacketEnd(), inet::Ipv4::reassembleAndDeliverFinish(), inet::eigrp::EigrpIpv6Pdm::receiveSignal(), inet::Gptp::receiveSignal(), inet::Rip::receiveSignal(), inet::Ipv6RoutingTable::receiveSignal(), inet::PimDm::receiveSignal(), inet::Igmpv2::receiveSignal(), inet::PimSm::receiveSignal(), inet::Igmpv3::receiveSignal(), inet::eigrp::EigrpIpv4Pdm::receiveSignal(), inet::PimSm::restartExpiryTimer(), inet::xMIPv6::returningHome(), inet::Ipv4::routeLocalBroadcastPacket(), inet::Ipv6::routePacket(), inet::Ipv4::routeUnicastPacket(), inet::PimDm::rpfInterfaceHasChanged(), inet::Arp::sendArpGratuitous(), inet::Arp::sendArpProbe(), inet::Arp::sendArpRequest(), inet::PimDm::sendAssertPacket(), inet::NextHopForwarding::sendDatagramToOutput(), inet::Ipv6::sendDatagramToOutput(), inet::NetworkProtocolBase::sendDown(), inet::dymo::Dymo::sendDymoPacket(), inet::bgp::BgpSession::sendKeepAliveMessage(), inet::bgp::BgpSession::sendOpenMessage(), inet::EthernetSocket::sendOut(), inet::Ieee8021qSocket::sendOut(), inet::RelayInterfaceSelector::sendPacket(), inet::MacRelayUnitBase::sendPacket(), inet::ospfv3::Ospfv3Process::sendPacket(), inet::Rip::sendPacket(), inet::xMIPv6::sendPeriodicBRR(), inet::PimSm::sendPIMAssert(), inet::PimSm::sendPIMJoin(), inet::PimSm::sendPIMPrune(), inet::PimSm::sendPIMRegisterNull(), inet::PimSm::sendPIMRegisterStop(), inet::Igmpv3::sendQueryToIP(), inet::Igmpv3::sendReportToIP(), inet::Ipv6NeighbourDiscovery::sendSolicitedNa(), inet::xMIPv6::sendTestInit(), inet::Igmpv2::sendToIP(), inet::DhcpServer::sendToUDP(), inet::DhcpClient::sendToUdp(), inet::Ipv6NeighbourDiscovery::sendUnsolicitedNa(), inet::bgp::BgpSession::sendUpdateMessage(), inet::Udp::setMulticastSourceFilter(), inet::UdpSocketIo::setSocketOptions(), inet::UdpBasicApp::setSocketOptions(), inet::Rip::startRIPRouting(), str(), inet::Udp::unblockMulticastSources(), inet::PimDm::unroutableMulticastPacketArrived(), inet::PimSm::unroutableMulticastPacketArrived(), inet::PimSm::updateDesignatedRouterAddress(), and inet::MacRelayUnitBase::updatePeerAddress().

◆ getInterfaceName()

const char* inet::NetworkInterface::getInterfaceName ( ) const
inline
233 { return interfaceName.c_str(); }

Referenced by inet::InterfaceTable::addInterface(), inet::Arp::addressRecognized(), inet::DhcpClient::bindLease(), inet::DhcpClient::chooseInterface(), inet::RsvpTe::commitResv(), inet::Igmpv3::configureInterface(), inet::Gpsr::configureInterfaces(), inet::dymo::Dymo::configureInterfaces(), inet::PimInterfaceTable::createInterface(), inet::InterfaceTable::deleteInterface(), inet::Ipv4::determineOutgoingInterfaceForMulticastDatagram(), inet::Ipv4NetworkConfigurator::dumpConfig(), inet::eigrp::EigrpInterface::EigrpInterface(), inet::MacForwardingTableConfigurator::extendConfiguration(), inet::Ipv4FlatNetworkConfigurator::fillRoutingTables(), inet::Ldp::findInterfaceFromPeerAddr(), inet::ospfv2::Ospfv2ConfigReader::findMatchingConfig(), inet::Ipv4::forwardMulticastPacket(), inet::ospfv2::Ospfv2ConfigReader::getInterfaceByXMLAttributesOf(), getInterfaceFullPath(), inet::Ipv4Route::getInterfaceName(), inet::L3NetworkConfiguratorBase::getWirelessId(), inet::ospfv3::Ospfv3Splitter::handleMessage(), inet::NextHopForwarding::handlePacketFromNetwork(), inet::Ted::initializeTED(), inet::bgp::BgpConfigReader::isInInterfaceTable(), inet::L3NetworkConfiguratorBase::isWirelessInterface(), inet::ospfv2::Ospfv2ConfigReader::loadInterfaceParameters(), inet::ospfv2::Ospfv2ConfigReader::loadLoopbackParameters(), inet::Ldp::locateNextHop(), inet::L3NetworkConfiguratorBase::InterfaceMatcher::matches(), inet::PimSm::multicastReceiverAdded(), inet::PimDm::multicastReceiverRemoved(), inet::PimSm::multicastReceiverRemoved(), inet::Igmpv3::multicastSourceListChanged(), inet::Ipv4::preroutingFinish(), inet::Ipv4RoutingTable::printMulticastRoutingTable(), inet::Ipv4RoutingTable::printRoutingTable(), inet::PimDm::processAssertPacket(), inet::PimDm::processAssertTimer(), inet::PimBase::processHelloPacket(), inet::Igmpv3::processHostGeneralQueryTimer(), inet::Igmpv3::processHostGroupQueryTimer(), inet::Igmpv2::processHostGroupTimer(), inet::PimSm::processJoinG(), inet::PimSm::processJoinSG(), inet::Igmpv2::processLeave(), inet::Igmpv2::processLeaveTimer(), inet::Mpls::processMplsPacketFromL2(), inet::PimSm::processPruneG(), inet::PimSm::processPruneSG(), inet::Igmpv2::processQuery(), inet::Igmpv3::processQuery(), inet::Igmpv2::processQueryTimer(), inet::Ipv6NeighbourDiscovery::processRaPrefixInfoForAddrAutoConf(), inet::Igmpv3::processReport(), inet::Igmpv2::processRexmtTimer(), inet::Igmpv3::processRouterGeneralQueryTimer(), inet::Igmpv3::processRouterGroupTimer(), inet::Igmpv3::processRouterSourceTimer(), inet::Igmpv2::processV2Report(), inet::L2NetworkConfigurator::readInterfaceConfiguration(), inet::Ipv4NetworkConfigurator::readInterfaceConfiguration(), inet::Ipv4NetworkConfigurator::readMulticastGroupConfiguration(), inet::RoutingTableRecorder::recordInterfaceChange(), inet::Arp::resolveL3Address(), inet::NextHopForwarding::routePacket(), inet::Ipv4::routeUnicastPacket(), inet::Ipv4::routeUnicastPacketFinish(), inet::PimDm::rpfInterfaceHasChanged(), inet::PimDm::sendAssertPacket(), inet::NextHopForwarding::sendDatagramToOutput(), inet::Igmpv3::sendGroupReport(), inet::PimBase::sendHelloPacket(), inet::bgp::BgpSession::sendKeepAliveMessage(), inet::Igmpv2::sendLeave(), inet::bgp::BgpSession::sendOpenMessage(), inet::PimSm::sendPIMAssert(), inet::Igmpv2::sendQuery(), inet::Igmpv2::sendReport(), inet::Rip::sendRIPRequest(), inet::bgp::BgpSession::sendUpdateMessage(), inet::Dsdv::start(), inet::Igmpv2::startHostTimer(), inet::PimNeighbor::str(), inet::NextHopRoute::str(), inet::RipRoute::str(), inet::Ipv6Route::str(), inet::Ipv4MulticastRoute::str(), str(), inet::DhcpClient::unbindLease(), and inet::PcapngWriter::writeInterface().

◆ getInterfaceTable()

◆ getInterfaceToken()

◆ getIpv4Address()

Ipv4Address inet::NetworkInterface::getIpv4Address ( ) const
593  {
594 #ifdef INET_WITH_IPv4
595  auto ipv4data = findProtocolData<Ipv4InterfaceData>();
596  return ipv4data == nullptr ? Ipv4Address::UNSPECIFIED_ADDRESS : ipv4data->getIPAddress();
597 #else
599 #endif // ifdef INET_WITH_IPv4
600 }

Referenced by inet::eigrp::EigrpIpv4Pdm::addInterfaceToEigrp(), inet::eigrp::EigrpIpv4Pdm::checkNeighborshipRules(), inet::L3AddressResolver::getInterfaceIpv4Address(), inet::ospfv2::Ospfv2ConfigReader::loadLoopbackParameters(), and inet::eigrp::EigrpIpv4Pdm::processIfaceStateChange().

◆ getIpv4Netmask()

Ipv4Address inet::NetworkInterface::getIpv4Netmask ( ) const
602  {
603 #ifdef INET_WITH_IPv4
604  auto ipv4data = findProtocolData<Ipv4InterfaceData>();
605  return ipv4data == nullptr ? Ipv4Address::UNSPECIFIED_ADDRESS : ipv4data->getNetmask();
606 #else
608 #endif // ifdef INET_WITH_IPv4
609 }

Referenced by inet::eigrp::EigrpIpv4Pdm::addInterfaceToEigrp(), inet::eigrp::EigrpIpv4Pdm::checkNeighborshipRules(), inet::L3AddressResolver::getInterfaceIpv4Address(), and inet::eigrp::EigrpIpv4Pdm::processIfaceStateChange().

◆ getMacAddress()

◆ getModuleIdAddress()

const ModuleIdAddress inet::NetworkInterface::getModuleIdAddress ( ) const
inline

◆ getModulePathAddress()

const ModulePathAddress inet::NetworkInterface::getModulePathAddress ( ) const
inline

◆ getMtu()

◆ getName()

virtual const char* inet::NetworkInterface::getName ( ) const
inlineoverrideprotectedvirtual
180 { return cModule::getName(); }

◆ getNetworkAddress()

const L3Address inet::NetworkInterface::getNetworkAddress ( ) const
429 {
430 #ifdef INET_WITH_IPv4
431  if (auto ipv4data = findProtocolData<Ipv4InterfaceData>())
432  return ipv4data->getIPAddress();
433 #endif // ifdef INET_WITH_IPv4
434 #ifdef INET_WITH_IPv6
435  if (auto ipv6data = findProtocolData<Ipv6InterfaceData>())
436  return ipv6data->getPreferredAddress();
437 #endif // ifdef INET_WITH_IPv6
438 #ifdef INET_WITH_NEXTHOP
439  if (auto nextHopData = findProtocolData<NextHopInterfaceData>())
440  return nextHopData->getAddress();
441 #endif // ifdef INET_WITH_NEXTHOP
442  if (hasModuleIdAddress)
443  return getModuleIdAddress();
445  return getModulePathAddress();
446  return L3Address();
447 }

Referenced by resolveDirective().

◆ getNodeInputGateId()

◆ getNodeOutputGateId()

◆ getNumProtocolData()

int inet::NetworkInterface::getNumProtocolData ( ) const
inline

Returns the number of protocol data structures.

281  {
282  return protocolDataSet.getNumTags();
283  }

◆ getProtocol()

◆ getProtocolData() [1/2]

template<typename T >
const T* inet::NetworkInterface::getProtocolData ( ) const
inline

Returns the protocol data for the provided type or throws an exception if no such protocol data is found.

313  {
314  return protocolDataSet.getTag<T>();
315  }

◆ getProtocolData() [2/2]

const InterfaceProtocolData* inet::NetworkInterface::getProtocolData ( int  index) const
inline

Returns the protocol data at the given index.

287  {
288  return static_cast<const InterfaceProtocolData *>(protocolDataSet.getTag(index));
289  }

Referenced by inet::Ipv6FlatNetworkConfigurator::addOwnAdvPrefixRoutes(), inet::Ipv6FlatNetworkConfigurator::addStaticRoutes(), inet::NextHopNetworkConfigurator::addStaticRoutes(), inet::Ipv6NeighbourDiscovery::assignLinkLocalAddress(), inet::xMIPv6::cancelEntries(), inet::DhcpClient::chooseInterface(), inet::NextHopRoutingTable::configureRouterId(), inet::xMIPv6::createAndSendBRRMessage(), inet::xMIPv6::createAndSendBUMessage(), inet::Ipv6NeighbourDiscovery::createAndSendRaPacket(), inet::Ipv6NeighbourDiscovery::createAndSendRsPacket(), inet::xMIPv6::createBUTimer(), inet::xMIPv6::createDeregisterBUTimer(), inet::bgp::BgpRouter::createEbgpSession(), inet::Ipv6NeighbourDiscovery::createRaTimer(), inet::xMIPv6::createTestInitTimer(), inet::Ipv6Tunneling::decapsulateDatagram(), inet::ospfv3::Ospfv3Interface::detailedInfo(), inet::Ipv4NetworkConfigurator::dumpConfig(), inet::RsvpTe::evalNextHopInterface(), inet::Ipv4RoutingTable::findInterfaceByLocalBroadcastAddress(), inet::bgp::BgpConfigReader::findMyAS(), inet::Ipv4::forwardMulticastPacket(), inet::Ipv6::fragmentAndSend(), inet::Ipv6::fragmentPostRouting(), inet::Ipv4::fragmentPostRouting(), inet::StpBase::getPortInterfaceData(), inet::xMIPv6::handleBULExpiry(), inet::Dsdv::handleMessageWhenUp(), inet::Dsdv::handleSelfMessage(), inet::DhcpServer::handleStartOperation(), inet::xMIPv6::handleTokenExpiry(), inet::PimSm::IamDR(), inet::Ipv6RoutingTable::initialize(), inet::Ipv6NeighbourDiscovery::initialize(), inet::Ted::initializeTED(), inet::Ipv6NeighbourDiscovery::initiateAddressResolution(), inet::Ipv6NeighbourDiscovery::initiateDad(), inet::xMIPv6::initiateMipv6Protocol(), inet::Ipv6NeighbourDiscovery::initiateNeighbourUnreachabilityDetection(), inet::Ipv6NeighbourDiscovery::initiateRouterDiscovery(), inet::BindingUpdateList::isCareOfTokenAvailable(), inet::eigrp::EigrpDeviceConfigurator::isEigrpInterface(), inet::BindingUpdateList::isHomeTokenAvailable(), inet::bgp::BgpConfigReader::isInInterfaceTable(), inet::ospfv3::Ospfv3Process::isInInterfaceTable6(), inet::Ipv6RoutingTable::isLocalAddress(), inet::Ipv4RoutingTable::isLocalBroadcastAddress(), inet::Ipv4RoutingTable::isLocalMulticastAddress(), inet::bgp::BgpRouter::listenConnectionFromPeer(), inet::Ipv6NeighbourDiscovery::makeTentativeAddressPermanent(), inet::bgp::BgpRouter::openTCPConnectionToPeer(), inet::ospfv3::Ospfv3Area::originateIntraAreaPrefixLSA(), inet::ospfv3::Ospfv3Interface::originateLinkLSA(), inet::ospfv3::Ospfv3Area::originateNetIntraAreaPrefixLSA(), inet::ospfv3::Ospfv3Interface::Ospfv3Interface(), inet::Ipv4::preroutingFinish(), inet::Ipv4RoutingTable::printRoutingTable(), inet::Arp::processArpPacket(), inet::Ipv6NeighbourDiscovery::processArTimeout(), inet::PimDm::processAssert(), inet::xMIPv6::processCoTMessage(), inet::Ipv6NeighbourDiscovery::processDadTimeout(), inet::DhcpServer::processDhcpMessage(), inet::PimDm::processGraftPacket(), inet::xMIPv6::processHoTMessage(), inet::PimSm::processJoinG(), inet::PimSm::processJoinSG(), inet::Ipv6NeighbourDiscovery::processNaForIncompleteNceState(), inet::Ipv6NeighbourDiscovery::processNaForOtherNceStates(), inet::Ipv6NeighbourDiscovery::processNaPacket(), inet::Ipv6NeighbourDiscovery::processNsPacket(), inet::Ipv6NeighbourDiscovery::processNudTimeout(), inet::PimSm::processPruneG(), inet::PimSm::processPruneSG(), inet::Igmpv3::processQuery(), inet::Ipv6NeighbourDiscovery::processRaForRouterUpdates(), inet::Ipv6NeighbourDiscovery::processRaPacket(), inet::Ipv6NeighbourDiscovery::processRaPrefixInfoForAddrAutoConf(), inet::Ipv6NeighbourDiscovery::processRdTimeout(), inet::Ipv6NeighbourDiscovery::processRsPacket(), inet::GlobalArp::receiveSignal(), inet::BindingUpdateList::recentlySentCOTI(), inet::BindingUpdateList::recentlySentHOTI(), inet::xMIPv6::resetBUIfEntry(), inet::Ipv4::resolveNextHopMacAddress(), inet::xMIPv6::returningHome(), inet::Ipv4::routeLocalBroadcastPacket(), inet::NextHopForwarding::routePacket(), inet::DhcpServer::sendAck(), inet::Arp::sendArpRequest(), inet::DhcpServer::sendNak(), inet::DhcpServer::sendOffer(), inet::ospfv3::Ospfv3Process::sendPacket(), inet::xMIPv6::sendPeriodicBU(), inet::Ipv6NeighbourDiscovery::sendPeriodicRa(), inet::Ipv6NeighbourDiscovery::sendSolicitedNa(), inet::xMIPv6::sendTestInit(), inet::Ipv6NeighbourDiscovery::sendUnsolicitedNa(), inet::ospfv2::Ospfv2Interface::setIfIndex(), inet::xMIPv6::triggerRouteOptimization(), inet::PimDm::unroutableMulticastPacketArrived(), inet::PimSm::updateDesignatedRouterAddress(), inet::bgp::BgpRouter::updateSendProcess(), and inet::xMIPv6::validateCoTMessage().

◆ getProtocolDataForUpdate()

template<typename T >
T* inet::NetworkInterface::getProtocolDataForUpdate ( )
inline

Returns the protocol data for the provided type or throws an exception if no such protocol data is found.

320  {
322  }

Referenced by inet::Udp::addMulticastAddressToInterface(), inet::Ipv4FlatNetworkConfigurator::assignAddresses(), inet::Ipv6NeighbourDiscovery::assignLinkLocalAddress(), inet::Ipv6RoutingTable::assignRequiredNodeAddresses(), inet::DhcpClient::bindLease(), inet::ospfv3::Ospfv3InterfaceState::changeState(), inet::L2NetworkConfigurator::configureInterface(), inet::Ipv4NetworkConfigurator::configureInterface(), inet::Ipv6RoutingTable::configureInterfaceFromXml(), inet::Ipv4RoutingTable::configureRouterId(), inet::Ipv6NeighbourDiscovery::createRaTimer(), inet::eigrp::EigrpIpv4Pdm::disableInterface(), inet::eigrp::EigrpIpv6Pdm::disableInterface(), inet::eigrp::EigrpIpv4Pdm::enableInterface(), inet::StpBase::getPortInterfaceDataForUpdate(), inet::PimBase::handleStartOperation(), inet::Igmpv3::initialize(), inet::Ipv6NeighbourDiscovery::initiateDad(), inet::ospfv2::Ospfv2ConfigReader::joinMulticastGroups(), inet::Ipv6NeighbourDiscovery::makeTentativeAddressPermanent(), inet::ospfv3::Ospfv3Splitter::parseConfig(), inet::ospfv3::Ospfv3Process::parseConfig(), inet::RoutingTableParser::parseInterfaces(), inet::RoutingTableParser::parseMulticastGroups(), inet::Icmpv6::processEchoRequest(), inet::Igmpv2::processLeaveTimer(), inet::Ipv6NeighbourDiscovery::processRaForRouterUpdates(), inet::Ipv6NeighbourDiscovery::processRaPacket(), inet::Ipv6NeighbourDiscovery::processRaPrefixInfoForAddrAutoConf(), inet::Igmpv3::processReport(), inet::Igmpv3::processRouterGroupTimer(), inet::Igmpv3::processRouterSourceTimer(), inet::Igmpv2::processV2Report(), inet::eigrp::EigrpIpv4Pdm::setPassive(), inet::eigrp::EigrpIpv6Pdm::setPassive(), inet::HostAutoConfigurator::setupNetworkLayer(), inet::Dsdv::start(), and inet::DhcpClient::unbindLease().

◆ getRxTransmissionChannel()

cChannel* inet::NetworkInterface::getRxTransmissionChannel ( )
inline
212 { return rxTransmissionChannel; }

◆ getState()

State inet::NetworkInterface::getState ( ) const
inline

Returns the requested state of this interface.

210 { return state; }

◆ getTxTransmissionChannel()

cChannel* inet::NetworkInterface::getTxTransmissionChannel ( )
inline
213 { return txTransmissionChannel; }

◆ handleCrashOperation()

void inet::NetworkInterface::handleCrashOperation ( LifecycleOperation operation)
virtual
673 {
674  setState(State::DOWN);
675  // TODO carrier and UP/DOWN state is independent
676  setCarrier(false);
677 }

Referenced by handleOperationStage().

◆ handleOperationStage()

bool inet::NetworkInterface::handleOperationStage ( LifecycleOperation operation,
IDoneCallback doneCallback 
)
overridevirtual

Perform one stage of a lifecycle operation.

Processing may be done entirely within this method, or may be a longer process that involves nonzero simulation time or several events, and is triggered by this method call.

Return value: true = "done"; false = "not yet done, will invoke doneCallback when done"

Implements inet::ILifecycle.

631 {
632  Enter_Method("handleOperationStage");
633 
634  int stage = operation->getCurrentStage();
635  if (dynamic_cast<ModuleStartOperation *>(operation)) {
637  handleStartOperation(operation);
638  return true;
639  }
640  }
641  else if (dynamic_cast<ModuleStopOperation *>(operation)) {
643  handleStopOperation(operation);
644  return true;
645  }
646  }
647  else if (dynamic_cast<ModuleCrashOperation *>(operation)) {
648  if (stage == ModuleCrashOperation::STAGE_CRASH) {
649  handleCrashOperation(operation);
650  return true;
651  }
652  }
653  else
654  throw cRuntimeError("unaccepted Lifecycle operation: (%s)%s", operation->getClassName(), operation->getName());
655  return true;
656 }

◆ handleParameterChange()

void inet::NetworkInterface::handleParameterChange ( const char *  name)
overrideprotectedvirtual
294 {
295  if (name != nullptr && !strcmp(name, "bitrate"))
297 }

◆ handleStartOperation()

void inet::NetworkInterface::handleStartOperation ( LifecycleOperation operation)
virtual
659 {
660  setState(State::UP);
661  // TODO carrier and UP/DOWN state is independent
662  setCarrier(true);
663 }

Referenced by handleOperationStage().

◆ handleStopOperation()

void inet::NetworkInterface::handleStopOperation ( LifecycleOperation operation)
virtual
666 {
667  setState(State::DOWN);
668  // TODO carrier and UP/DOWN state is independent
669  setCarrier(false);
670 }

Referenced by handleOperationStage().

◆ hasCarrier()

◆ hasNetworkAddress()

bool inet::NetworkInterface::hasNetworkAddress ( const L3Address address) const
virtual
450 {
451  switch(address.getType()) {
452  case L3Address::NONE:
453  return false;
454 
455  case L3Address::IPv4: {
456 #ifdef INET_WITH_IPv4
457  auto ipv4data = findProtocolData<Ipv4InterfaceData>();
458  return ipv4data != nullptr && ipv4data->getIPAddress() == address.toIpv4();
459 #else
460  return false;
461 #endif // ifdef INET_WITH_IPv4
462  }
463  case L3Address::IPv6: {
464 #ifdef INET_WITH_IPv6
465  auto ipv6data = findProtocolData<Ipv6InterfaceData>();
466  return ipv6data != nullptr && ipv6data->hasAddress(address.toIpv6());
467 #else
468  return false;
469 #endif // ifdef INET_WITH_IPv6
470  }
471  case L3Address::MAC: {
472  return getMacAddress() == address.toMac();
473  }
474  case L3Address::MODULEID: {
475 #ifdef INET_WITH_NEXTHOP
476  auto nextHopData = findProtocolData<NextHopInterfaceData>();
477  if (nextHopData != nullptr && nextHopData->getAddress() == address)
478  return true;
479 #endif // ifdef INET_WITH_NEXTHOP
480  if (hasModuleIdAddress)
481  return getModuleIdAddress() == address.toModuleId();
482  return false;
483  }
484  case L3Address::MODULEPATH: {
485 #ifdef INET_WITH_NEXTHOP
486  auto nextHopData = findProtocolData<NextHopInterfaceData>();
487  if (nextHopData != nullptr && nextHopData->getAddress() == address)
488  return true;
489 #endif // ifdef INET_WITH_NEXTHOP
491  return getModulePathAddress() == address.toModulePath();
492  return false;
493  }
494  default:
495  break;
496  }
497  return false;
498 }

◆ initialize()

void inet::NetworkInterface::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::queueing::PacketProcessorBase.

Reimplemented in inet::ExtInterface, and inet::EthernetCutthroughInterface.

105 {
106  if (stage == INITSTAGE_LOCAL) {
107  upperLayerIn = gate("upperLayerIn");
108  upperLayerOut = gate("upperLayerOut");
109  subscribe(POST_MODEL_CHANGE, this);
110  if (hasGate("phys$i")) {
111  rxIn = gate("phys$i")->getPathEndGate();
112  rxTransmissionChannel = rxIn->findIncomingTransmissionChannel();
113  if (rxTransmissionChannel != nullptr)
114  rxTransmissionChannel->subscribe(POST_MODEL_CHANGE, this);
115  }
116  if (hasGate("phys$o")) {
117  txOut = gate("phys$o")->getPathStartGate();
118  txTransmissionChannel = txOut->findTransmissionChannel();
119  if (txTransmissionChannel != nullptr)
120  txTransmissionChannel->subscribe(POST_MODEL_CHANGE, this);
121  }
122  upperLayerInConsumer = findConnectedModule<IPassivePacketSink>(upperLayerIn, 1);
123  upperLayerOutConsumer = findConnectedModule<IPassivePacketSink>(upperLayerOut, 1);
124  interfaceTable.reference(this, "interfaceTableModule", false);
125  setInterfaceName(utils::stripnonalnum(getFullName()).c_str());
128  WATCH(mtu);
129  WATCH(state);
130  WATCH(carrier);
131  WATCH(broadcast);
132  WATCH(multicast);
133  WATCH(pointToPoint);
134  WATCH(loopback);
135  WATCH(datarate);
136  WATCH(macAddr);
137  cModule *node = findContainingNode(this);
138  NodeStatus *nodeStatus = node ? check_and_cast_nullable<NodeStatus *>(node->getSubmodule("status")) : nullptr;
139  if (!nodeStatus || nodeStatus->getState() == NodeStatus::UP) {
140  state = UP;
141  carrier = true;
142  }
143  }
144  else if (stage == INITSTAGE_NETWORK_INTERFACE_CONFIGURATION) {
145  if (hasPar("protocol")) {
146  const char *protocolName = par("protocol");
147  if (*protocolName != '\0')
148  protocol = Protocol::getProtocol(protocolName);
149  }
150  if (hasPar("address")) {
151  const char *address = par("address");
152  if (!strcmp(address, "auto")) {
154  par("address").setStringValue(getMacAddress().str());
155  }
156  else
157  setMacAddress(MacAddress(address));
159  }
160  if (hasPar("broadcast"))
161  setBroadcast(par("broadcast"));
162  if (hasPar("multicast"))
163  setMulticast(par("multicast"));
164  if (hasPar("mtu"))
165  setMtu(par("mtu"));
166  if (hasPar("pointToPoint"))
167  setPointToPoint(par("pointToPoint"));
168  if (interfaceTable)
169  interfaceTable->addInterface(this);
170  inet::registerInterface(*this, gate("upperLayerIn"), gate("upperLayerOut"));
171  }
172  else if (stage == INITSTAGE_LAST)
174 }

Referenced by inet::EthernetCutthroughInterface::initialize().

◆ isBroadcast()

◆ isDown()

bool inet::NetworkInterface::isDown ( ) const
inline

◆ isLoopback()

bool inet::NetworkInterface::isLoopback ( ) const
inline
241 { return loopback; }

Referenced by inet::Ipv4FlatNetworkConfigurator::addDefaultRoutes(), inet::Ipv6FlatNetworkConfigurator::addOwnAdvPrefixRoutes(), inet::Ipv6FlatNetworkConfigurator::addStaticRoutes(), inet::NextHopNetworkConfigurator::addStaticRoutes(), inet::Ipv4NetworkConfigurator::addStaticRoutes(), inet::Ipv4FlatNetworkConfigurator::assignAddresses(), inet::Ipv6NeighbourDiscovery::assignLinkLocalAddress(), inet::Ipv6RoutingTable::assignRequiredNodeAddresses(), inet::StpBase::chooseInterface(), inet::DhcpServer::chooseInterface(), inet::DhcpClient::chooseInterface(), inet::Ipv6FlatNetworkConfigurator::configureAdvPrefixes(), inet::Ipv6RoutingTable::configureInterfaceForIpv6(), inet::PimInterfaceTable::configureInterfaces(), inet::NextHopRoutingTable::configureRouterId(), inet::Ipv4RoutingTable::configureRouterId(), inet::Ipv4::datagramLocalOut(), inet::L3NetworkConfiguratorBase::determineGatewayForLink(), inet::L3NetworkConfiguratorBase::extractDeviceNeighbors(), inet::L3NetworkConfiguratorBase::extractTopology(), inet::L3NetworkConfiguratorBase::extractWirelessNeighbors(), inet::PingApp::getAllAddresses(), inet::L3AddressResolver::getIpv4AddressFrom(), inet::L3AddressResolver::getIpv6AddressFrom(), inet::L3AddressResolver::getMacAddressFrom(), inet::L3AddressResolver::getModuleIdAddressFrom(), inet::L3AddressResolver::getModulePathAddressFrom(), inet::Gpsr::getSelfAddress(), inet::GlobalArp::initialize(), inet::Ipv6RoutingTable::initialize(), inet::Ipv6NeighbourDiscovery::initialize(), inet::Ted::initializeTED(), inet::xMIPv6::initiateMipv6Protocol(), inet::ospfv2::Router::isDirectRoute(), inet::RelayInterfaceSelector::isForwardingInterface(), inet::MacRelayUnitBase::isForwardingInterface(), inet::Rip::isLocalInterfaceRoute(), inet::Rip::isLoopbackInterfaceRoute(), inet::bgp::BgpRouter::isRouteExcluded(), inet::ospfv2::Ospfv2ConfigReader::loadConfigFromXML(), inet::Ipv6NeighbourDiscovery::makeTentativeAddressPermanent(), inet::ospfv3::Ospfv3Process::parseConfig(), inet::Ipv4NodeConfigurator::prepareInterface(), inet::Ipv4::preroutingFinish(), inet::ospfv2::Ospfv2::receiveSignal(), inet::GlobalArp::receiveSignal(), inet::PimInterfaceTable::receiveSignal(), inet::Rip::receiveSignal(), inet::RipNetworkInterface::RipNetworkInterface(), inet::NextHopForwarding::routeMulticastPacket(), inet::Ipv6::routeMulticastPacket(), inet::NetworkProtocolBase::sendDown(), inet::HostAutoConfigurator::setupNetworkLayer(), inet::Rip::startRIPRouting(), and str().

◆ isMulticast()

bool inet::NetworkInterface::isMulticast ( ) const
inline
239 { return multicast; }

Referenced by inet::Udp::addMulticastAddressToInterface(), inet::Udp::blockMulticastSources(), inet::Ipv6RoutingTable::configureInterfaceForIpv6(), inet::PimInterfaceTable::configureInterfaces(), inet::Gpsr::configureInterfaces(), inet::dymo::Dymo::configureInterfaces(), inet::eigrp::EigrpInterface::EigrpInterface(), inet::VirtualTunnel::initialize(), inet::Ldp::initialize(), inet::Igmpv2::initialize(), inet::Igmpv3::initialize(), inet::Ipv4RoutingTable::internalAddMulticastRoute(), inet::eigrp::EigrpInterface::isMulticastAllowedOnIface(), inet::ospfv2::Ospfv2ConfigReader::joinMulticastGroups(), inet::Udp::joinMulticastGroups(), inet::Udp::joinMulticastSources(), inet::Udp::leaveMulticastGroups(), inet::Udp::leaveMulticastSources(), inet::Igmpv2::multicastGroupJoined(), inet::Igmpv2::multicastGroupLeft(), inet::Ipv4NodeConfigurator::prepareInterface(), inet::Igmpv2::processLeave(), inet::Igmpv2::processQuery(), inet::Igmpv3::processQuery(), inet::Igmpv3::processReport(), inet::Igmpv2::processV2Report(), inet::Ipv4NetworkConfigurator::readManualMulticastRouteConfiguration(), inet::ospfv2::Ospfv2::receiveSignal(), inet::PimInterfaceTable::receiveSignal(), inet::Rip::receiveSignal(), inet::Igmpv2::receiveSignal(), inet::Igmpv3::receiveSignal(), inet::RipNetworkInterface::RipNetworkInterface(), inet::Igmpv3::sendQueryToIP(), inet::Igmpv3::sendReportToIP(), inet::Igmpv2::sendToIP(), inet::Udp::setMulticastSourceFilter(), inet::Rip::startRIPRouting(), str(), and inet::Udp::unblockMulticastSources().

◆ isPointToPoint()

bool inet::NetworkInterface::isPointToPoint ( ) const
inline

◆ isUp()

◆ isWired()

bool inet::NetworkInterface::isWired ( ) const
inline
242 { return rxIn != nullptr && txOut != nullptr; }

◆ isWireless()

bool inet::NetworkInterface::isWireless ( ) const
inline
243 { return !isWired(); }

Referenced by computeCarrier().

◆ joinMulticastGroup()

void inet::NetworkInterface::joinMulticastGroup ( const L3Address address)
virtual
522 {
523  switch (address.getType()) {
524 #ifdef INET_WITH_IPv4
525  case L3Address::IPv4:
526  getProtocolDataForUpdate<Ipv4InterfaceData>()->joinMulticastGroup(address.toIpv4());
527  break;
528 
529 #endif // ifdef INET_WITH_IPv4
530 #ifdef INET_WITH_IPv6
531  case L3Address::IPv6:
532  getProtocolDataForUpdate<Ipv6InterfaceData>()->joinMulticastGroup(address.toIpv6());
533  break;
534 
535 #endif // ifdef INET_WITH_IPv6
536 #ifdef INET_WITH_NEXTHOP
537  case L3Address::MAC:
538  case L3Address::MODULEID:
540  getProtocolDataForUpdate<NextHopInterfaceData>()->joinMulticastGroup(address);
541  break;
542 
543 #endif // ifdef INET_WITH_NEXTHOP
544  default:
545  throw cRuntimeError("Unknown address type");
546  }
547 }

Referenced by inet::Udp::addMulticastAddressToInterface(), inet::Gpsr::configureInterfaces(), and inet::dymo::Dymo::configureInterfaces().

◆ matchesMacAddress()

bool inet::NetworkInterface::matchesMacAddress ( const MacAddress address) const
402 {
403  return address.isBroadcast()
404  || (address.isMulticast() && matchesMulticastMacAddress(address))
405  || macAddr == address;
406 }

◆ matchesMulticastMacAddress()

bool inet::NetworkInterface::matchesMulticastMacAddress ( const MacAddress address) const
409 {
410  return address.isMulticast() && contains(multicastAddresses, address);
411 }

Referenced by matchesMacAddress().

◆ numInitStages()

virtual int inet::NetworkInterface::numInitStages ( ) const
inlineoverrideprotectedvirtual

Reimplemented from inet::queueing::PacketProcessorBase.

Reimplemented in inet::ExtInterface.

159 { return NUM_INIT_STAGES; }

◆ operator=()

NetworkInterface& inet::NetworkInterface::operator= ( const NetworkInterface obj)
private

◆ pushPacket()

void inet::NetworkInterface::pushPacket ( Packet packet,
cGate *  gate 
)
overridevirtual

Pushes the packet into the packet sink at the given gate.

This operation pushes the packet as a whole. The onwership of the packet is transferred to the sink.

This method is called, for example, when a packet source module pushes a packet into a queue module.

The sink must not be full at the gate. The packet must not be nullptr. The gate must be a valid gate of this module and it must support pushing and passing packets.

Implements inet::queueing::IPassivePacketSink.

186 {
187  Enter_Method("pushPacket");
188  take(packet);
189  if (gate == upperLayerIn) {
190  if (isDown()) {
191  EV_WARN << "Network interface is down, dropping packet" << EV_FIELD(packet) << EV_ENDL;
192  dropPacket(packet, INTERFACE_DOWN);
193  }
194  else if (!hasCarrier()) {
195  EV_WARN << "Network interface has no carrier, dropping packet" << EV_FIELD(packet) << EV_ENDL;
196  dropPacket(packet, NO_CARRIER);
197  }
198  else
200  }
201  else if (gate == upperLayerOut) {
202  packet->addTagIfAbsent<InterfaceInd>()->setInterfaceId(interfaceId);
204  }
205  else
206  throw cRuntimeError("Unknown gate: %s", gate->getName());
207 }

◆ pushPacketEnd()

void inet::NetworkInterface::pushPacketEnd ( Packet packet,
cGate *  gate 
)
overridevirtual

Ends pushing the packet into the packet sink at the given gate.

This is a packet streaming operation. The onwership of the packet is transferred to the sink.

Packet streaming can be started with any of the streaming operations, and ends when the streaming position plus the extra processable packet length equals to the total packet length.

This method is called, for example, when a preemption supporting server module ends streaming a packet to the sink.

The sink must not be full at the gate and no other packet streaming can be in progress. The packet must not be nullptr. The gate must be a valid gate of this module and it must support pushing and streaming packets.

Implements inet::queueing::IPassivePacketSink.

Reimplemented in inet::EthernetCutthroughInterface.

235 {
236  Enter_Method("pushPacketEnd");
237  take(packet);
238  if (gate == upperLayerIn) {
239  if (isDown()) {
240  EV_WARN << "Network interface is down, dropping packet" << EV_FIELD(packet) << EV_ENDL;
241  dropPacket(packet, INTERFACE_DOWN);
242  }
243  else if (!hasCarrier()) {
244  EV_WARN << "Network interface has no carrier, dropping packet" << EV_FIELD(packet) << EV_ENDL;
245  dropPacket(packet, NO_CARRIER);
246  }
247  else
248  pushOrSendPacketEnd(packet, upperLayerIn, upperLayerInConsumer, packet->getTransmissionId());
249  }
250  else if (gate == upperLayerOut) {
251  packet->addTagIfAbsent<InterfaceInd>()->setInterfaceId(interfaceId);
252  pushOrSendPacketEnd(packet, upperLayerOut, upperLayerOutConsumer, packet->getTransmissionId());
253  }
254  else
255  throw cRuntimeError("Unknown gate: %s", gate->getName());
256 }

Referenced by inet::EthernetCutthroughInterface::pushPacketEnd().

◆ pushPacketProgress()

virtual void inet::NetworkInterface::pushPacketProgress ( Packet packet,
cGate *  gate,
bps  datarate,
b  position,
b  extraProcessableLength = b(0) 
)
inlineoverridevirtual

Progresses pushing the packet into the packet sink at the given gate.

This is a packet streaming operation. The position specifies where the packet streaming is at the moment. The extra length parameter partially fixes the future of the packet streaming operation. The onwership of the packet is transferred to the sink.

Packet streaming can be started with any of the streaming operations, and ends when the streaming position plus the extra processable packet length equals to the total packet length.

This method is called, for example, to notify the sink about a change in the packet data when a preemption occurs.

The sink must not be full at the gate and no other packet streaming can be in progress. The packet must not be nullptr. The gate must be a valid gate of this module and it must support pushing and streaming packets.

Implements inet::queueing::IPassivePacketSink.

200 { throw cRuntimeError("Invalid operation"); }

◆ pushPacketStart()

void inet::NetworkInterface::pushPacketStart ( Packet packet,
cGate *  gate,
bps  datarate 
)
overridevirtual

Starts pushing the packet into the packet sink at the given gate.

This is a packet streaming operation. The onwership of the packet is transferred to the sink.

Packet streaming can be started with any of the streaming operations, and ends when the streaming position plus the extra processable packet length equals to the total packet length.

This method is called, for example, when a preemption supporting server module starts streaming a packet to the sink.

The sink must not be full at the gate and no other packet streaming can be in progress. The packet must not be nullptr. The gate must be a valid gate of this module and it must support pushing and streaming packets.

Implements inet::queueing::IPassivePacketSink.

Reimplemented in inet::EthernetCutthroughInterface.

210 {
211  Enter_Method("pushPacket");
212  take(packet);
213  if (gate == upperLayerIn) {
214  if (isDown()) {
215  EV_WARN << "Network interface is down, dropping packet" << EV_FIELD(packet) << EV_ENDL;
216  dropPacket(packet, INTERFACE_DOWN);
217  }
218  else if (!hasCarrier()) {
219  EV_WARN << "Network interface has no carrier, dropping packet" << EV_FIELD(packet) << EV_ENDL;
220  dropPacket(packet, NO_CARRIER);
221  }
222  else
223  pushOrSendPacketStart(packet, upperLayerIn, upperLayerInConsumer, datarate, packet->getTransmissionId());
224  }
225  else if (gate == upperLayerOut) {
226  packet->addTagIfAbsent<InterfaceInd>()->setInterfaceId(interfaceId);
227  pushOrSendPacketStart(packet, upperLayerOut, upperLayerOutConsumer, datarate, packet->getTransmissionId());
228  }
229  else
230  throw cRuntimeError("Unknown gate: %s", gate->getName());
231 }

Referenced by inet::EthernetCutthroughInterface::pushPacketStart().

◆ receiveSignal()

void inet::NetworkInterface::receiveSignal ( cComponent *  source,
simsignal_t  signal,
cObject *  obj,
cObject *  details 
)
overrideprotectedvirtual
300 {
301  Enter_Method("%s", cComponent::getSignalName(signal));
302 
303  if (signal == POST_MODEL_CHANGE) {
304  if (auto notification = dynamic_cast<cPostPathCreateNotification *>(obj)) {
305  if (rxIn == notification->pathEndGate || txOut == notification->pathStartGate) {
306  rxTransmissionChannel = rxIn->findIncomingTransmissionChannel();
307  txTransmissionChannel = txOut->findTransmissionChannel();
308  if (rxTransmissionChannel != nullptr && !rxTransmissionChannel->isSubscribed(POST_MODEL_CHANGE, this))
309  rxTransmissionChannel->subscribe(POST_MODEL_CHANGE, this);
310  if (txTransmissionChannel != nullptr && !txTransmissionChannel->isSubscribed(POST_MODEL_CHANGE, this))
311  txTransmissionChannel->subscribe(POST_MODEL_CHANGE, this);
313  }
314  }
315  else if (auto notification = dynamic_cast<cPostPathCutNotification *>(obj)) {
316  if (rxIn == notification->pathEndGate || txOut == notification->pathStartGate) {
317  rxTransmissionChannel = nullptr;
318  txTransmissionChannel = nullptr;
320  }
321  }
322  else if (auto notification = dynamic_cast<cPostParameterChangeNotification *>(obj)) {
323  auto owner = notification->par->getOwner();
324  if (owner == rxTransmissionChannel || owner == txTransmissionChannel) {
327  }
328  }
329  }
330 }

◆ refreshDisplay()

void inet::NetworkInterface::refreshDisplay ( ) const
overrideprotectedvirtual

Reimplemented from inet::queueing::PacketProcessorBase.

259 {
261 }

◆ removeMulticastMacAddress()

void inet::NetworkInterface::removeMulticastMacAddress ( const MacAddress address)
421 {
422  auto it = find(multicastAddresses, address);
423  if (it == multicastAddresses.end())
424  throw cRuntimeError("Multicast MacAddress not found: '%s'", address.str().c_str());
425  multicastAddresses.erase(it);
426 }

◆ removeProtocolData()

template<typename T >
T* inet::NetworkInterface::removeProtocolData ( )
inline

Removes the protocol data for the provided type, or throws an exception if no such protocol data is found.

351  {
352  auto t = protocolDataSet.removeTag<T>();
353  check_and_cast<InterfaceProtocolData *>(t)->ownerp = nullptr;
355  return t;
356  }

◆ removeProtocolDataIfPresent()

template<typename T >
T* inet::NetworkInterface::removeProtocolDataIfPresent ( )
inline

Removes the protocol data for the provided type if present, or returns nullptr if no such protocol data is found.

361  {
363  if (t != nullptr) {
364  check_and_cast<InterfaceProtocolData *>(t)->ownerp = nullptr;
366  }
367  return t;
368  }

◆ resetInterface()

void inet::NetworkInterface::resetInterface ( )
virtual
397 {
399 }

Referenced by ~NetworkInterface().

◆ resolveDirective()

const char * inet::NetworkInterface::resolveDirective ( char  directive) const
overrideprotectedvirtual

Reimplemented from inet::queueing::PacketProcessorBase.

272 {
273  static std::string result;
274  switch (directive) {
275  case 'i':
276  result = std::to_string(interfaceId);
277  break;
278  case 'm':
279  result = macAddr.str();
280  break;
281  case 'n':
282  result = interfaceName;
283  break;
284  case 'a':
285  result = getNetworkAddress().str();
286  break;
287  default:
288  throw cRuntimeError("Unknown directive: %c", directive);
289  }
290  return result.c_str();
291 }

◆ setBroadcast()

virtual void inet::NetworkInterface::setBroadcast ( bool  b)
inlinevirtual

◆ setCarrier()

void inet::NetworkInterface::setCarrier ( bool  b)
virtual

◆ setDatarate()

virtual void inet::NetworkInterface::setDatarate ( double  d)
inlinevirtual

◆ setEstimateCostProcess()

bool inet::NetworkInterface::setEstimateCostProcess ( int  position,
MacEstimateCostProcess p 
)
virtual
501 {
502  ASSERT(position >= 0);
503  if (estimateCostProcessArray.size() <= (size_t)position) {
504  estimateCostProcessArray.resize(position + 1, nullptr);
505  }
506  if (estimateCostProcessArray[position] != nullptr)
507  return false;
508  estimateCostProcessArray[position] = p;
509  return true;
510 }

◆ setHasModuleIdAddress()

void inet::NetworkInterface::setHasModuleIdAddress ( bool  value)
inline
222 { hasModuleIdAddress = value; }

◆ setHasModulePathAddress()

void inet::NetworkInterface::setHasModulePathAddress ( bool  value)
inline
223 { hasModulePathAddress = value; }

◆ setInterfaceId()

◆ setInterfaceName()

virtual void inet::NetworkInterface::setInterfaceName ( const char *  s)
inlinevirtual

Referenced by initialize().

◆ setInterfaceToken()

virtual void inet::NetworkInterface::setInterfaceToken ( const InterfaceToken t)
inlinevirtual

◆ setLoopback()

virtual void inet::NetworkInterface::setLoopback ( bool  b)
inlinevirtual
261 { if (loopback != b) { loopback = b; configChanged(F_LOOPBACK); } }

◆ setMacAddress()

virtual void inet::NetworkInterface::setMacAddress ( const MacAddress addr)
inlinevirtual

◆ setMtu()

virtual void inet::NetworkInterface::setMtu ( int  m)
inlinevirtual

◆ setMulticast()

virtual void inet::NetworkInterface::setMulticast ( bool  b)
inlinevirtual

◆ setNodeInputGateId()

virtual void inet::NetworkInterface::setNodeInputGateId ( int  i)
inlinevirtual

◆ setNodeOutputGateId()

virtual void inet::NetworkInterface::setNodeOutputGateId ( int  i)
inlinevirtual

◆ setPointToPoint()

virtual void inet::NetworkInterface::setPointToPoint ( bool  b)
inlinevirtual

◆ setProtocol()

virtual void inet::NetworkInterface::setProtocol ( const Protocol protocol)
inlinevirtual
251 { this->protocol = protocol; }

◆ setState()

void inet::NetworkInterface::setState ( State  s)
virtual
612 {
613  if (state != s) {
614  state = s;
615  // TODO carrier and UP/DOWN state is independent
616  if (state == DOWN)
617  setCarrier(false);
619  }
620 }

Referenced by handleCrashOperation(), handleStartOperation(), and handleStopOperation().

◆ stateChanged()

virtual void inet::NetworkInterface::stateChanged ( int  fieldId)
inlineprotectedvirtual

Referenced by setCarrier(), and setState().

◆ str()

std::string inet::NetworkInterface::str ( ) const
overridevirtual
357 {
358  std::stringstream out;
359  out << getInterfaceName();
360  out << " ID:" << getInterfaceId();
361  out << " MTU:" << getMtu();
362  out << ((state == DOWN) ? " DOWN" : " UP");
363  if (isLoopback())
364  out << " LOOPBACK";
365  if (isBroadcast())
366  out << " BROADCAST";
367  out << (hasCarrier() ? " CARRIER" : " NOCARRIER");
368  if (isMulticast())
369  out << " MULTICAST";
370  if (isPointToPoint())
371  out << " POINTTOPOINT";
372  out << " macAddr:";
374  out << "n/a";
375  else
376  out << getMacAddress();
377  for (int i = 0; i < protocolDataSet.getNumTags(); i++)
378  out << " " << protocolDataSet.getTag(i)->str();
379 
380  return out.str();
381 }

Referenced by inet::Ipv4NetworkConfigurator::dumpAddresses(), inet::MessageDispatcher::handleRegisterInterface(), initialize(), and inet::NetworkInterfaceChangeDetails::str().

◆ supportsPacketPassing()

virtual bool inet::NetworkInterface::supportsPacketPassing ( cGate *  gate) const
inlineoverridevirtual

Returns true if the processor supports passing packets as a whole at the given gate.

A passed packet is handed over from one module to another by either the standard OMNeT++ handleMessage() mechanism, or by directly calling pushPacket() or pullPacket().

For example, packets are passed as a whole to and from a queue module.

Connecting incompatible gates raises an error during initialize. The gate parameter must be a valid gate of this module. The gate should be marked with @labels(pass) in the NED file.

Reimplemented from inet::queueing::PacketProcessorBase.

193 { return true; }

◆ supportsPacketPulling()

virtual bool inet::NetworkInterface::supportsPacketPulling ( cGate *  gate) const
inlineoverridevirtual

Returns true if the processor supports pulling packets at the given gate.

Pulling a packet is a synchronous operation that is initiated by the sink module. A pulled packet can be passed as a whole using pullPacket(), or it can be streamed from the source to the sink using pullPacketStart(), pullPacketEnd(), and pullPacketProgress().

For output gates, true means that the connected module can pull packets from this module. For input gates, true means that this module can pull packets from the connected module. For example, a packet server module can pull packets from a queue module.

Connecting incompatible gates raises an error during initialize. The gate parameter must be a valid gate of this module. The gate should be marked with @labels(pull) in the NED file.

Implements inet::queueing::IPacketProcessor.

192 { return false; }

◆ supportsPacketPushing()

virtual bool inet::NetworkInterface::supportsPacketPushing ( cGate *  gate) const
inlineoverridevirtual

Returns true if the processor supports pushing packets at the given gate.

Pushing a packet is a synchronous operation that is initiated by the source module. A pushed packet can be passed as a whole using pushPacket(), or it can be streamed from the source to the sink using pushPacketStart(), pushPacketEnd(), and pushPacketProgress().

For output gates, true means that this module can push packets into the connected module. For input gates, true means that the connected module can push packets into this module. For example, a packet generator module can push packets into a queue module.

Connecting incompatible gates raises an error during initialize. The gate parameter must be a valid gate of this module. The gate should be marked with @labels(push) in the NED file.

Implements inet::queueing::IPacketProcessor.

191 { return true; }

◆ supportsPacketSending()

virtual bool inet::NetworkInterface::supportsPacketSending ( cGate *  gate) const
inlineoverridevirtual

Returns true if the processor supports sending packets at the given gate.

Sending a packet is an asynchronous operation that is initiated by the source module. A sent packet is always passed as a whole using standard handleMessage().

For output gates, true means that this module can send packets into the connected module. For input gates, true means that the connected module can send packets into this module. For example, a standard OMNeT++ module can send packets to an INET packet processor module, or an INET packet processor module can send packets to a standard OMNeT++ module.

Connecting incompatible gates raises an error during initialize. The gate parameter must be a valid gate of this module. The gate should be marked with @labels(send) in the NED file.

Reimplemented from inet::queueing::PacketProcessorBase.

190 { return true; }

◆ supportsPacketStreaming()

virtual bool inet::NetworkInterface::supportsPacketStreaming ( cGate *  gate) const
inlineoverridevirtual

Returns true if the processor supports streaming packets at the given gate.

A streamed packet is handed over from one module to another using several method calls and potentially exending to a non-zero simulation duration.

For example, packets are streamed to a preemptable signal transmitter module.

Connecting incompatible gates raises an error during initialize. The gate parameter must be a valid gate of this module. The gate should be marked with @labels(stream) in the NED file.

Reimplemented from inet::queueing::PacketProcessorBase.

194 { return false; }

◆ updateDisplayString()

void inet::NetworkInterface::updateDisplayString ( ) const
overrideprotectedvirtual

Reimplemented from inet::queueing::PacketProcessorBase.

264 {
265  if (getEnvir()->isGUI()) {
266  auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
267  getDisplayString().setTagArg("t", 0, text);
268  }
269 }

Referenced by refreshDisplay().

Friends And Related Function Documentation

◆ InterfaceProtocolData

friend class InterfaceProtocolData
friend

Member Data Documentation

◆ broadcast

bool inet::NetworkInterface::broadcast = false
protected

interface supports broadcast

Referenced by initialize().

◆ carrier

bool inet::NetworkInterface::carrier = false
protected

presence of the physical or virtual carrier

Referenced by initialize(), and setCarrier().

◆ datarate

double inet::NetworkInterface::datarate = 0
protected

◆ estimateCostProcessArray

std::vector<MacEstimateCostProcess *> inet::NetworkInterface::estimateCostProcessArray
protected

◆ hasModuleIdAddress

bool inet::NetworkInterface::hasModuleIdAddress = false
protected

◆ hasModulePathAddress

bool inet::NetworkInterface::hasModulePathAddress = false
protected

◆ interfaceId

◆ interfaceName

std::string inet::NetworkInterface::interfaceName
protected

Referenced by resolveDirective().

◆ interfaceTable

ModuleRefByPar<IInterfaceTable> inet::NetworkInterface::interfaceTable
protected

IInterfaceTable that contains this interface, or nullptr.

Referenced by changed(), getInterfaceFullPath(), and initialize().

◆ loopback

bool inet::NetworkInterface::loopback = false
protected

interface is loopback interface

Referenced by initialize().

◆ macAddr

MacAddress inet::NetworkInterface::macAddr
protected

link-layer address (for now, only IEEE 802 MAC addresses are supported)

Referenced by initialize(), matchesMacAddress(), and resolveDirective().

◆ mtu

int inet::NetworkInterface::mtu = 0
protected

Maximum Transmission Unit (e.g. 1500 on Ethernet); 0 means infinite (i.e. never fragment)

Referenced by initialize().

◆ multicast

bool inet::NetworkInterface::multicast = false
protected

interface supports multicast

Referenced by initialize().

◆ multicastAddresses

std::vector<MacAddress> inet::NetworkInterface::multicastAddresses
protected

◆ nodeInputGateId

int inet::NetworkInterface::nodeInputGateId = -1
protected

id of the input gate of this host/router (or -1 if this is a virtual interface)

◆ nodeOutputGateId

int inet::NetworkInterface::nodeOutputGateId = -1
protected

id of the output gate of this host/router (or -1 if this is a virtual interface)

◆ pointToPoint

bool inet::NetworkInterface::pointToPoint = false
protected

interface is point-to-point link

Referenced by initialize().

◆ protocol

const Protocol* inet::NetworkInterface::protocol = nullptr
protected

Referenced by initialize().

◆ protocolDataSet

TagSet inet::NetworkInterface::protocolDataSet
protected

◆ rxIn

cGate* inet::NetworkInterface::rxIn = nullptr
protected

Referenced by initialize(), and receiveSignal().

◆ rxTransmissionChannel

cChannel* inet::NetworkInterface::rxTransmissionChannel = nullptr
protected

◆ state

State inet::NetworkInterface::state = DOWN
protected

requested interface state, similar to Linux ifup/ifdown

Referenced by initialize(), setState(), and str().

◆ token

InterfaceToken inet::NetworkInterface::token
protected

for Ipv6 stateless autoconfig (RFC 1971), interface identifier (RFC 2462)

◆ txOut

cGate* inet::NetworkInterface::txOut = nullptr
protected

Referenced by initialize(), and receiveSignal().

◆ txTransmissionChannel

cChannel* inet::NetworkInterface::txTransmissionChannel = nullptr
protected

◆ upperLayerIn

cGate* inet::NetworkInterface::upperLayerIn = nullptr
protected

◆ upperLayerInConsumer

queueing::IPassivePacketSink* inet::NetworkInterface::upperLayerInConsumer = nullptr
protected

◆ upperLayerOut

cGate* inet::NetworkInterface::upperLayerOut = nullptr
protected

◆ upperLayerOutConsumer

queueing::IPassivePacketSink* inet::NetworkInterface::upperLayerOutConsumer = nullptr
protected

The documentation for this class was generated from the following files:
inet::findContainingNode
cModule * findContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:31
inet::units::units::T
compose< Wb, pow< m, -2 > > T
Definition: Units.h:951
inet::layoutSubmodulesWithoutGates
void layoutSubmodulesWithoutGates(cModule *module, int dimensionIndex, double moduleSpacing)
Definition: SubmoduleLayout.cc:24
inet::INITSTAGE_LAST
INET_API InitStage INITSTAGE_LAST
Operations that no other initializations can depend on, e.g.
inet::NetworkInterface::F_STATE
@ F_STATE
Definition: NetworkInterface.h:146
inet::L3Address::MODULEID
@ MODULEID
Definition: L3Address.h:40
inet::queueing::PacketProcessorBase::pushOrSendPacket
virtual void pushOrSendPacket(Packet *packet, cGate *gate, IPassivePacketSink *consumer)
Definition: PacketProcessorBase.cc:126
inet::NetworkInterface::F_DATARATE
@ F_DATARATE
Definition: NetworkInterface.h:149
inet::NetworkInterface::F_IPV4_DATA
@ F_IPV4_DATA
Definition: NetworkInterface.h:150
inet::NetworkInterface::getModuleIdAddress
const ModuleIdAddress getModuleIdAddress() const
Definition: NetworkInterface.h:224
inet::NetworkInterface::mtu
int mtu
Maximum Transmission Unit (e.g. 1500 on Ethernet); 0 means infinite (i.e. never fragment)
Definition: NetworkInterface.h:110
inet::NetworkInterface::getMacAddress
const MacAddress & getMacAddress() const
Definition: NetworkInterface.h:245
inet::NetworkInterface::setCarrier
virtual void setCarrier(bool b)
Definition: NetworkInterface.cc:622
inet::NetworkInterface::getNetworkAddress
const L3Address getNetworkAddress() const
Definition: NetworkInterface.cc:428
inet::NetworkInterface::resetInterface
virtual void resetInterface()
Definition: NetworkInterface.cc:396
inet::Protocol::getProtocol
static const Protocol * getProtocol(int id)
Definition: Protocol.cc:50
inet::NetworkInterface::setMulticast
virtual void setMulticast(bool b)
Definition: NetworkInterface.h:259
inet::NetworkInterface::isBroadcast
bool isBroadcast() const
Definition: NetworkInterface.h:238
inet::NetworkInterface::DOWN
@ DOWN
Definition: NetworkInterface.h:92
inet::NetworkInterface::setInterfaceName
virtual void setInterfaceName(const char *s)
Definition: NetworkInterface.h:252
inet::NetworkInterface::nodeOutputGateId
int nodeOutputGateId
id of the output gate of this host/router (or -1 if this is a virtual interface)
Definition: NetworkInterface.h:108
inet::L3Address::NONE
@ NONE
Definition: L3Address.h:34
inet::TagSet::findTag
const T * findTag() const
Returns the tag for the provided type, or returns nullptr if no such tag is present.
Definition: TagSet.h:134
inet::NetworkInterface::F_TRILL_DATA
@ F_TRILL_DATA
Definition: NetworkInterface.h:150
inet::NetworkInterface::F_POINTTOPOINT
@ F_POINTTOPOINT
Definition: NetworkInterface.h:148
inet::NetworkInterface::upperLayerOutConsumer
queueing::IPassivePacketSink * upperLayerOutConsumer
Definition: NetworkInterface.h:102
inet::NetworkInterface::rxTransmissionChannel
cChannel * rxTransmissionChannel
Definition: NetworkInterface.h:99
inet::L3Address::str
std::string str() const
Definition: L3Address.cc:88
inet::NetworkInterface::F_MACADDRESS
@ F_MACADDRESS
Definition: NetworkInterface.h:149
inet::NetworkInterface::GOING_UP
@ GOING_UP
Definition: NetworkInterface.h:92
inet::NetworkInterface::getInterfaceName
const char * getInterfaceName() const
Definition: NetworkInterface.h:233
inet::NetworkInterface::isWireless
bool isWireless() const
Definition: NetworkInterface.h:243
inet::NetworkInterface::getFullPath
virtual std::string getFullPath() const override
Definition: NetworkInterface.h:179
inet::NetworkInterface::F_ISIS_DATA
@ F_ISIS_DATA
Definition: NetworkInterface.h:150
inet::TagSet::getTagForUpdate
T * getTagForUpdate()
Returns the tag of the provided type for update, or throws an exception if no such tag is present.
Definition: TagSet.h:159
inet::find
std::vector< T >::iterator find(std::vector< T > &v, const Tk &a)
Definition: stlutils.h:44
inet::NetworkInterface::setBroadcast
virtual void setBroadcast(bool b)
Definition: NetworkInterface.h:258
inet::NetworkInterface::rxIn
cGate * rxIn
Definition: NetworkInterface.h:97
inet::NetworkInterface::protocolDataSet
TagSet protocolDataSet
Definition: NetworkInterface.h:124
inet::NetworkInterface::getMtu
int getMtu() const
Definition: NetworkInterface.h:236
inet::NetworkInterface::F_NODE_OUT_GATEID
@ F_NODE_OUT_GATEID
Definition: NetworkInterface.h:147
inet::NetworkInterface::hasModulePathAddress
bool hasModulePathAddress
Definition: NetworkInterface.h:118
inet::NetworkInterface::isWired
bool isWired() const
Definition: NetworkInterface.h:242
inet::NetworkInterface::updateDisplayString
virtual void updateDisplayString() const override
Definition: NetworkInterface.cc:263
inet::L3Address::IPv4
@ IPv4
Definition: L3Address.h:35
inet::NetworkInterface::interfaceId
int interfaceId
identifies the interface in the IInterfaceTable
Definition: NetworkInterface.h:106
inet::L3Address::MODULEPATH
@ MODULEPATH
Definition: L3Address.h:39
inet::NetworkInterface::getState
State getState() const
Returns the requested state of this interface.
Definition: NetworkInterface.h:210
inet::NetworkInterface::pointToPoint
bool pointToPoint
interface is point-to-point link
Definition: NetworkInterface.h:115
inet::NetworkInterface::F_LOOPBACK
@ F_LOOPBACK
Definition: NetworkInterface.h:148
inet::NetworkInterface::isLoopback
bool isLoopback() const
Definition: NetworkInterface.h:241
inet::NetworkInterface::createGateObject
virtual cGate * createGateObject(cGate::Type type) override
Definition: NetworkInterface.h:166
inet::NetworkInterface::setMacAddress
virtual void setMacAddress(const MacAddress &addr)
Definition: NetworkInterface.h:263
inet::NetworkInterface::interfaceTable
ModuleRefByPar< IInterfaceTable > interfaceTable
IInterfaceTable that contains this interface, or nullptr.
Definition: NetworkInterface.h:105
inet::NetworkInterface::multicast
bool multicast
interface supports multicast
Definition: NetworkInterface.h:114
inet::INITSTAGE_NETWORK_INTERFACE_CONFIGURATION
INET_API InitStage INITSTAGE_NETWORK_INTERFACE_CONFIGURATION
Initialization of network interfaces includes:
inet::NetworkInterface::broadcast
bool broadcast
interface supports broadcast
Definition: NetworkInterface.h:113
inet::NetworkInterface::computeDatarate
virtual double computeDatarate() const
Definition: NetworkInterface.cc:332
inet::MacAddress::str
std::string str() const
Converts address to a hex string.
Definition: MacAddress.cc:111
inet::NetworkInterface::getModulePathAddress
const ModulePathAddress getModulePathAddress() const
Definition: NetworkInterface.h:225
inet::NetworkInterface::F_CARRIER
@ F_CARRIER
Definition: NetworkInterface.h:146
inet::NetworkInterface::handleCrashOperation
virtual void handleCrashOperation(LifecycleOperation *operation)
Definition: NetworkInterface.cc:672
inet::units::values::s
value< double, units::s > s
Definition: Units.h:1235
inet::TagSet::getTag
cObject * getTag(int index) const
Returns the tag at the given index.
Definition: TagSet.h:122
inet::MacAddress::generateAutoAddress
static MacAddress generateAutoAddress()
Generates a unique address which begins with 0a:aa and ends in a unique suffix.
Definition: MacAddress.cc:133
inet::NetworkInterface::getInterfaceId
int getInterfaceId() const
Definition: NetworkInterface.h:232
inet::NetworkInterface::F_NETW_GATEIDX
@ F_NETW_GATEIDX
Definition: NetworkInterface.h:147
inet::NetworkInterface::hasModuleIdAddress
bool hasModuleIdAddress
Definition: NetworkInterface.h:117
EV_FIELD
#define EV_FIELD(...)
Definition: INETDefs.h:112
inet::TagSet::removeTagIfPresent
T * removeTagIfPresent()
Removes the tag for the provided type if present, or returns nullptr if no such tag is present.
Definition: TagSet.h:198
inet::NetworkInterface::setState
virtual void setState(State s)
Definition: NetworkInterface.cc:611
inet::utils::stripnonalnum
std::string stripnonalnum(const char *s)
Removes non-alphanumeric characters from the given string.
Definition: INETUtils.cc:98
inet::contains
bool contains(const std::vector< T > &v, const Tk &a)
Definition: stlutils.h:65
inet::NetworkInterface::setInterfaceToken
virtual void setInterfaceToken(const InterfaceToken &t)
Definition: NetworkInterface.h:264
inet::TagSet::findTagForUpdate
T * findTagForUpdate()
Returns the tag of the provided type for update, or returns nullptr if no such tag is present.
Definition: TagSet.h:142
inet::MacAddress::formInterfaceIdentifier
InterfaceToken formInterfaceIdentifier() const
Create interface identifier (IEEE EUI-64) which can be used by IPv6 stateless address autoconfigurati...
Definition: MacAddress.cc:126
type
removed type
Definition: IUdp-gates.txt:7
inet::TagSet::addTagIfAbsent
T * addTagIfAbsent()
Returns a newly added tag for the provided type if absent, or returns the tag that is already present...
Definition: TagSet.h:178
inet::NetworkInterface::estimateCostProcessArray
std::vector< MacEstimateCostProcess * > estimateCostProcessArray
Definition: NetworkInterface.h:125
inet::ModuleStopOperation::STAGE_LINK_LAYER
@ STAGE_LINK_LAYER
Definition: ModuleOperations.h:54
inet::NetworkInterface::configChanged
virtual void configChanged(int fieldId)
Definition: NetworkInterface.h:155
inet::NetworkInterface::F_MULTICAST
@ F_MULTICAST
Definition: NetworkInterface.h:148
inet::NetworkInterface::stateChanged
virtual void stateChanged(int fieldId)
Definition: NetworkInterface.h:156
inet::queueing::PacketProcessorBase::dropPacket
virtual void dropPacket(Packet *packet, PacketDropReason reason, int limit=-1)
Definition: PacketProcessorBase.cc:390
inet::interfaceStateChangedSignal
simsignal_t interfaceStateChangedSignal
Definition: Simsignals.cc:32
inet::NetworkInterface::carrier
bool carrier
presence of the physical or virtual carrier
Definition: NetworkInterface.h:112
inet::NetworkInterface::multicastAddresses
std::vector< MacAddress > multicastAddresses
Definition: NetworkInterface.h:122
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::NetworkInterface::F_NAME
@ F_NAME
Definition: NetworkInterface.h:147
inet::NetworkInterface::F_IPV6_DATA
@ F_IPV6_DATA
Definition: NetworkInterface.h:150
inet::queueing::PacketProcessorBase::pushOrSendPacketEnd
virtual void pushOrSendPacketEnd(Packet *packet, cGate *gate, IPassivePacketSink *consumer, int transmissionId)
Definition: PacketProcessorBase.cc:154
inet::NetworkInterface::F_IEEE8021D_DATA
@ F_IEEE8021D_DATA
Definition: NetworkInterface.h:150
inet::L3Address::getTypeName
static const char * getTypeName(AddressType t)
Definition: L3Address.cc:389
inet::NetworkInterface::changed
virtual void changed(simsignal_t signalID, int fieldId)
Definition: NetworkInterface.cc:388
inet::units::values::b
value< int64_t, units::b > b
Definition: Units.h:1241
NUM_INIT_STAGES
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
inet::NetworkInterface::F_BROADCAST
@ F_BROADCAST
Definition: NetworkInterface.h:148
inet::NetworkInterface::handleStartOperation
virtual void handleStartOperation(LifecycleOperation *operation)
Definition: NetworkInterface.cc:658
inet::NetworkInterface::nodeInputGateId
int nodeInputGateId
id of the input gate of this host/router (or -1 if this is a virtual interface)
Definition: NetworkInterface.h:109
inet::TagSet::removeTag
cObject * removeTag(int index)
Definition: TagSet.cc:91
inet::NetworkInterface::token
InterfaceToken token
for Ipv6 stateless autoconfig (RFC 1971), interface identifier (RFC 2462)
Definition: NetworkInterface.h:121
inet::NetworkInterface::isMulticast
bool isMulticast() const
Definition: NetworkInterface.h:239
inet::ModuleCrashOperation::STAGE_CRASH
@ STAGE_CRASH
Definition: ModuleOperations.h:76
inet::NetworkInterface::isDown
bool isDown() const
Definition: NetworkInterface.h:220
inet::MacAddress::isUnspecified
bool isUnspecified() const
Returns true if all address bytes are zero.
Definition: MacAddress.h:136
inet::L3Address::IPv6
@ IPv6
Definition: L3Address.h:36
inet::NO_CARRIER
@ NO_CARRIER
Definition: Simsignals_m.h:73
inet::NetworkInterface::F_TOKEN
@ F_TOKEN
Definition: NetworkInterface.h:149
inet::NetworkInterface::isPointToPoint
bool isPointToPoint() const
Definition: NetworkInterface.h:240
inet::NodeStatus::UP
@ UP
Definition: NodeStatus.h:28
inet::NetworkInterface::txOut
cGate * txOut
Definition: NetworkInterface.h:98
inet::StringFormat::formatString
const char * formatString(IDirectiveResolver *resolver) const
Definition: StringFormat.cc:17
inet::INTERFACE_DOWN
@ INTERFACE_DOWN
Definition: Simsignals_m.h:72
inet::NetworkInterface::setPointToPoint
virtual void setPointToPoint(bool b)
Definition: NetworkInterface.h:260
inet::NetworkInterface::F_NEXTHOP_DATA
@ F_NEXTHOP_DATA
Definition: NetworkInterface.h:150
inet::Ipv4Address::UNSPECIFIED_ADDRESS
static const Ipv4Address UNSPECIFIED_ADDRESS
0.0.0.0
Definition: Ipv4Address.h:91
Enter_Method
#define Enter_Method(...)
Definition: SelfDoc.h:71
inet::NetworkInterface::hasCarrier
bool hasCarrier() const
Definition: NetworkInterface.h:237
inet::L3Address::MAC
@ MAC
Definition: L3Address.h:38
inet::NetworkInterface::datarate
double datarate
data rate in bit/s
Definition: NetworkInterface.h:119
inet::NetworkInterface::F_MTU
@ F_MTU
Definition: NetworkInterface.h:149
inet::queueing::PacketProcessorBase::pushOrSendPacketStart
virtual void pushOrSendPacketStart(Packet *packet, cGate *gate, IPassivePacketSink *consumer, bps datarate, int transmissionId)
Definition: PacketProcessorBase.cc:136
inet::TagSet::clearTags
void clearTags()
Clears the set of tags.
Definition: TagSet.cc:104
inet::registerInterface
void registerInterface(const NetworkInterface &interface, cGate *in, cGate *out)
Definition: IInterfaceRegistrationListener.cc:12
inet::NetworkInterface::setDatarate
virtual void setDatarate(double d)
Definition: NetworkInterface.h:262
inet::NetworkInterface::upperLayerIn
cGate * upperLayerIn
Definition: NetworkInterface.h:95
inet::NetworkInterface::protocol
const Protocol * protocol
Definition: NetworkInterface.h:104
inet::NetworkInterface::loopback
bool loopback
interface is loopback interface
Definition: NetworkInterface.h:116
inet::NetworkInterface::macAddr
MacAddress macAddr
link-layer address (for now, only IEEE 802 MAC addresses are supported)
Definition: NetworkInterface.h:120
inet::units::values::m
value< double, units::m > m
Definition: Units.h:1233
inet::NetworkInterface::setInterfaceId
virtual void setInterfaceId(int id)
Definition: NetworkInterface.h:175
inet::ModuleStartOperation::STAGE_LINK_LAYER
@ STAGE_LINK_LAYER
Definition: ModuleOperations.h:28
inet::NetworkInterface::F_CLNS_DATA
@ F_CLNS_DATA
Definition: NetworkInterface.h:150
inet::NetworkInterface::setMtu
virtual void setMtu(int m)
Definition: NetworkInterface.h:255
inet::NetworkInterface::str
virtual std::string str() const override
Definition: NetworkInterface.cc:356
inet::NetworkInterface::matchesMulticastMacAddress
bool matchesMulticastMacAddress(const MacAddress &address) const
Definition: NetworkInterface.cc:408
inet::interfaceConfigChangedSignal
simsignal_t interfaceConfigChangedSignal
Definition: Simsignals.cc:33
EV_ENDL
#define EV_ENDL
Definition: INETDefs.h:114
inet::NetworkInterface::txTransmissionChannel
cChannel * txTransmissionChannel
Definition: NetworkInterface.h:100
inet::NetworkInterface::GOING_DOWN
@ GOING_DOWN
Definition: NetworkInterface.h:92
inet::NetworkInterface::computeCarrier
virtual bool computeCarrier() const
Definition: NetworkInterface.cc:345
inet::NetworkInterface::state
State state
requested interface state, similar to Linux ifup/ifdown
Definition: NetworkInterface.h:111
inet::NetworkInterface::upperLayerOut
cGate * upperLayerOut
Definition: NetworkInterface.h:96
inet::NetworkInterface::F_NODE_IN_GATEID
@ F_NODE_IN_GATEID
Definition: NetworkInterface.h:147
inet::NetworkInterface::upperLayerInConsumer
queueing::IPassivePacketSink * upperLayerInConsumer
Definition: NetworkInterface.h:101
inet::TagSet::getNumTags
int getNumTags() const
Returns the number of tags.
Definition: TagSet.h:117
inet::NetworkInterface::interfaceName
std::string interfaceName
Definition: NetworkInterface.h:107
inet::NetworkInterface::handleStopOperation
virtual void handleStopOperation(LifecycleOperation *operation)
Definition: NetworkInterface.cc:665
inet::TagSet::addTag
void addTag(cObject *tag)
Definition: TagSet.cc:83
inet::NetworkInterface::UP
@ UP
Definition: NetworkInterface.h:92
inet::NetworkInterface::InterfaceProtocolData
friend class InterfaceProtocolData
Definition: NetworkInterface.h:89