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

A C++ interface to abstract the functionality of InterfaceTable. More...

#include <IInterfaceTable.h>

Inheritance diagram for inet::IInterfaceTable:
inet::InterfaceTable

Public Member Functions

virtual ~IInterfaceTable ()
 
virtual std::string getFullPath () const =0
 Module path name. More...
 
virtual cModule * getHostModule () const =0
 Returns the host or router this interface table lives in. More...
 
virtual bool isLocalAddress (const L3Address &address) const =0
 Checks if the address is a local one, i.e. More...
 
virtual bool isNeighborAddress (const L3Address &address) const =0
 Checks if the address is on the network of one of the interfaces, but not local. More...
 
virtual NetworkInterfacefindInterfaceByAddress (const L3Address &address) const =0
 Returns an interface given by its address. More...
 
virtual void addInterface (NetworkInterface *entry)=0
 Adds an interface. More...
 
virtual void deleteInterface (NetworkInterface *entry)=0
 Deletes the given interface from the table. More...
 
virtual int getNumInterfaces () const =0
 Returns the number of interfaces. More...
 
virtual NetworkInterfacegetInterface (int pos) const =0
 Returns the NetworkInterface specified by an index 0..numInterfaces-1. More...
 
virtual NetworkInterfacefindInterfaceById (int id) const =0
 Returns an interface by its Id. More...
 
virtual NetworkInterfacegetInterfaceById (int id) const =0
 Returns an interface by its Id. More...
 
virtual int getBiggestInterfaceId () const =0
 Returns the biggest interface Id. More...
 
virtual NetworkInterfacefindInterfaceByNodeOutputGateId (int id) const =0
 Returns an interface given by its getNodeOutputGateId(). More...
 
virtual NetworkInterfacefindInterfaceByNodeInputGateId (int id) const =0
 Returns an interface given by its getNodeInputGateId(). More...
 
virtual NetworkInterfacefindInterfaceByInterfaceModule (cModule *ifmod) const =0
 Returns an interface by one of its component module (e.g. More...
 
virtual NetworkInterfacefindInterfaceByName (const char *name) const =0
 Returns an interface given by its name. More...
 
virtual NetworkInterfacefindFirstLoopbackInterface () const =0
 Returns the first interface with the isLoopback flag set. More...
 
virtual NetworkInterfacefindFirstNonLoopbackInterface () const =0
 Returns the first interface with the isLoopback flag unset. More...
 
virtual NetworkInterfacefindFirstMulticastInterface () const =0
 Returns the first multicast capable interface. More...
 
virtual MulticastGroupList collectMulticastGroups () const =0
 Returns all multicast group address, with it's interfaceId. More...
 

Protected Member Functions

virtual void interfaceChanged (simsignal_t signalID, const NetworkInterfaceChangeDetails *details)=0
 

Friends

class NetworkInterface
 

Detailed Description

A C++ interface to abstract the functionality of InterfaceTable.

Referring to InterfaceTable via this interface makes it possible to transparently replace InterfaceTable with a different implementation, without any change to the base INET.

See also
InterfaceTable, NetworkInterface

Constructor & Destructor Documentation

◆ ~IInterfaceTable()

virtual inet::IInterfaceTable::~IInterfaceTable ( )
inlinevirtual
45 {}

Member Function Documentation

◆ addInterface()

virtual void inet::IInterfaceTable::addInterface ( NetworkInterface entry)
pure virtual

Adds an interface.

The entry->getInterfaceModule() will be used to discover and fill in getNetworkLayerGateIndex(), getNodeOutputGateId(), and getNodeInputGateId() in NetworkInterface. It should be nullptr if this is a virtual interface (e.g. loopback).

Implemented in inet::InterfaceTable.

◆ collectMulticastGroups()

virtual MulticastGroupList inet::IInterfaceTable::collectMulticastGroups ( ) const
pure virtual

Returns all multicast group address, with it's interfaceId.

Implemented in inet::InterfaceTable.

◆ deleteInterface()

virtual void inet::IInterfaceTable::deleteInterface ( NetworkInterface entry)
pure virtual

Deletes the given interface from the table.

Indices of existing interfaces (see getInterface(int)) may change. It is an error if the given interface is not in the table.

Implemented in inet::InterfaceTable.

◆ findFirstLoopbackInterface()

virtual NetworkInterface* inet::IInterfaceTable::findFirstLoopbackInterface ( ) const
pure virtual

Returns the first interface with the isLoopback flag set.

If there's no loopback, it returns nullptr.

Implemented in inet::InterfaceTable.

◆ findFirstMulticastInterface()

virtual NetworkInterface* inet::IInterfaceTable::findFirstMulticastInterface ( ) const
pure virtual

Returns the first multicast capable interface.

If there is no such interface, then returns nullptr.

Implemented in inet::InterfaceTable.

◆ findFirstNonLoopbackInterface()

virtual NetworkInterface* inet::IInterfaceTable::findFirstNonLoopbackInterface ( ) const
pure virtual

Returns the first interface with the isLoopback flag unset.

If there's no non-loopback, it returns nullptr.

Implemented in inet::InterfaceTable.

◆ findInterfaceByAddress()

virtual NetworkInterface* inet::IInterfaceTable::findInterfaceByAddress ( const L3Address address) const
pure virtual

Returns an interface given by its address.

Returns nullptr if not found.

Implemented in inet::InterfaceTable.

◆ findInterfaceById()

virtual NetworkInterface* inet::IInterfaceTable::findInterfaceById ( int  id) const
pure virtual

Returns an interface by its Id.

Ids are guaranteed to be invariant to interface deletions/additions. Returns nullptr if there is no such interface (This allows detecting stale IDs without raising an error.)

Implemented in inet::InterfaceTable.

◆ findInterfaceByInterfaceModule()

virtual NetworkInterface* inet::IInterfaceTable::findInterfaceByInterfaceModule ( cModule *  ifmod) const
pure virtual

Returns an interface by one of its component module (e.g.

PPP). Returns nullptr if not found.

Implemented in inet::InterfaceTable.

Referenced by inet::DiffservUtil::getInterfaceDatarate(), and inet::ModulePathAddress::tryParse().

◆ findInterfaceByName()

◆ findInterfaceByNodeInputGateId()

virtual NetworkInterface* inet::IInterfaceTable::findInterfaceByNodeInputGateId ( int  id) const
pure virtual

◆ findInterfaceByNodeOutputGateId()

virtual NetworkInterface* inet::IInterfaceTable::findInterfaceByNodeOutputGateId ( int  id) const
pure virtual

◆ getBiggestInterfaceId()

virtual int inet::IInterfaceTable::getBiggestInterfaceId ( ) const
pure virtual

Returns the biggest interface Id.

Implemented in inet::InterfaceTable.

◆ getFullPath()

◆ getHostModule()

◆ getInterface()

virtual NetworkInterface* inet::IInterfaceTable::getInterface ( int  pos) const
pure virtual

Returns the NetworkInterface specified by an index 0..numInterfaces-1.

Throws an error if index is out of range.

Note that this index is NOT the same as interfaceId! Indices are not guaranteed to stay the same after interface addition/deletion, so cannot be used to reliably identify the interface. Use interfaceId to refer to interfaces from other modules or from messages/packets.

Implemented in inet::InterfaceTable.

Referenced by inet::visualizer::InterfaceTableVisualizerBase::addAllInterfaceVisualizations(), inet::Ipv4FlatNetworkConfigurator::addDefaultRoutes(), inet::Ipv6FlatNetworkConfigurator::addOwnAdvPrefixRoutes(), inet::L3AddressResolver::addressOf(), inet::Ipv6FlatNetworkConfigurator::addStaticRoutes(), inet::NextHopNetworkConfigurator::addStaticRoutes(), inet::Ipv4FlatNetworkConfigurator::assignAddresses(), inet::DhcpServer::chooseInterface(), inet::DhcpClient::chooseInterface(), inet::Ipv6FlatNetworkConfigurator::configureAdvPrefixes(), inet::PimInterfaceTable::configureInterfaces(), inet::L3NetworkConfiguratorBase::determineGatewayForLink(), inet::L3NetworkConfiguratorBase::extractDeviceNeighbors(), inet::NetworkConfiguratorBase::extractTopology(), inet::L2NetworkConfigurator::extractTopology(), inet::L3NetworkConfiguratorBase::extractTopology(), inet::L3NetworkConfiguratorBase::extractWirelessNeighbors(), inet::L3AddressResolver::findInterfaceWithMacAddress(), inet::bgp::BgpConfigReader::findMyAS(), inet::PingApp::getAllAddresses(), inet::ospfv2::Ospfv2ConfigReader::getInterfaceByXMLAttributesOf(), inet::L3AddressResolver::getIpv4AddressFrom(), inet::L3AddressResolver::getIpv6AddressFrom(), inet::L3AddressResolver::getMacAddressFrom(), inet::L3AddressResolver::getModuleIdAddressFrom(), inet::L3AddressResolver::getModulePathAddressFrom(), inet::NextHopRoutingTable::initialize(), inet::ospfv2::Router::isDirectRoute(), inet::bgp::BgpConfigReader::isInInterfaceTable(), inet::ospfv3::Ospfv3Process::isInInterfaceTable(), inet::ospfv3::Ospfv3Process::isInInterfaceTable6(), inet::ospfv2::Ospfv2ConfigReader::loadConfigFromXML(), inet::eigrp::EigrpDeviceConfigurator::loadEigrpIPv4Networks(), inet::sctp::SctpAssociation::processInitArrived(), and inet::sctp::SctpAssociation::sendInit().

◆ getInterfaceById()

◆ getNumInterfaces()

virtual int inet::IInterfaceTable::getNumInterfaces ( ) const
pure virtual

Returns the number of interfaces.

Implemented in inet::InterfaceTable.

Referenced by inet::Ipv4FlatNetworkConfigurator::addDefaultRoutes(), inet::Ipv6FlatNetworkConfigurator::addOwnAdvPrefixRoutes(), inet::L3AddressResolver::addressOf(), inet::Ipv6FlatNetworkConfigurator::addStaticRoutes(), inet::NextHopNetworkConfigurator::addStaticRoutes(), inet::Ipv4FlatNetworkConfigurator::assignAddresses(), inet::DhcpServer::chooseInterface(), inet::DhcpClient::chooseInterface(), inet::Ipv6FlatNetworkConfigurator::configureAdvPrefixes(), inet::PimInterfaceTable::configureInterfaces(), inet::L3NetworkConfiguratorBase::determineGatewayForLink(), inet::L3NetworkConfiguratorBase::extractDeviceNeighbors(), inet::NetworkConfiguratorBase::extractTopology(), inet::L2NetworkConfigurator::extractTopology(), inet::L3NetworkConfiguratorBase::extractTopology(), inet::L3NetworkConfiguratorBase::extractWirelessNeighbors(), inet::L3AddressResolver::findInterfaceWithMacAddress(), inet::bgp::BgpConfigReader::findMyAS(), inet::PingApp::getAllAddresses(), inet::ospfv2::Ospfv2ConfigReader::getInterfaceByXMLAttributesOf(), inet::L3AddressResolver::getIpv4AddressFrom(), inet::L3AddressResolver::getIpv6AddressFrom(), inet::L3AddressResolver::getMacAddressFrom(), inet::L3AddressResolver::getModuleIdAddressFrom(), inet::L3AddressResolver::getModulePathAddressFrom(), inet::NextHopRoutingTable::initialize(), inet::ospfv2::Router::isDirectRoute(), inet::bgp::BgpConfigReader::isInInterfaceTable(), inet::ospfv3::Ospfv3Process::isInInterfaceTable(), inet::ospfv3::Ospfv3Process::isInInterfaceTable6(), inet::ospfv2::Ospfv2ConfigReader::loadConfigFromXML(), inet::eigrp::EigrpDeviceConfigurator::loadEigrpIPv4Networks(), inet::physicallayer::RadioMedium::matchesMacAddressFilter(), inet::sctp::SctpAssociation::processInitArrived(), and inet::sctp::SctpAssociation::sendInit().

◆ interfaceChanged()

virtual void inet::IInterfaceTable::interfaceChanged ( simsignal_t  signalID,
const NetworkInterfaceChangeDetails details 
)
protectedpure virtual

Implemented in inet::InterfaceTable.

◆ isLocalAddress()

virtual bool inet::IInterfaceTable::isLocalAddress ( const L3Address address) const
pure virtual

Checks if the address is a local one, i.e.

one of the host's.

Implemented in inet::InterfaceTable.

Referenced by inet::L3AddressResolver::findHostWithAddress(), and inet::UdpBasicBurst::processStart().

◆ isNeighborAddress()

virtual bool inet::IInterfaceTable::isNeighborAddress ( const L3Address address) const
pure virtual

Checks if the address is on the network of one of the interfaces, but not local.

Implemented in inet::InterfaceTable.

Friends And Related Function Documentation

◆ NetworkInterface

friend class NetworkInterface
friend

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