#include <IInterfaceTable.h>
Public Member Functions | |
virtual | ~IInterfaceTable () |
virtual std::string | getFullPath () const =0 |
virtual void | addInterface (InterfaceEntry *entry, cModule *ifmod)=0 |
virtual void | deleteInterface (InterfaceEntry *entry)=0 |
virtual int | getNumInterfaces ()=0 |
virtual InterfaceEntry * | getInterface (int pos)=0 |
virtual InterfaceEntry * | getInterfaceById (int id)=0 |
virtual InterfaceEntry * | getInterfaceByNodeOutputGateId (int id)=0 |
virtual InterfaceEntry * | getInterfaceByNodeInputGateId (int id)=0 |
virtual InterfaceEntry * | getInterfaceByNetworkLayerGateIndex (int index)=0 |
virtual InterfaceEntry * | getInterfaceByName (const char *name)=0 |
virtual InterfaceEntry * | getFirstLoopbackInterface ()=0 |
Protected Member Functions | |
virtual void | interfaceChanged (InterfaceEntry *entry, int category)=0 |
Friends | |
class | InterfaceEntry |
A C++ interface to abstract the functionality of IInterfaceTable. Referring to IInterfaceTable via this interface makes it possible to transparently replace IInterfaceTable with a different implementation, without any change to the base INET.
Definition at line 34 of file IInterfaceTable.h.
virtual IInterfaceTable::~IInterfaceTable | ( | ) | [inline, virtual] |
Definition at line 32 of file IInterfaceTable.h.
{
virtual void IInterfaceTable::addInterface | ( | InterfaceEntry * | entry, | |
cModule * | ifmod | |||
) | [pure virtual] |
Adds an interface. The second argument should be a module which belongs to the physical interface (e.g. PPP or EtherMac) -- it will be used to discover and fill in getNetworkLayerGateIndex(), getNodeOutputGateId(), and getNodeInputGateId() in InterfaceEntry. It should be NULL if this is a virtual interface (e.g. loopback).
Referenced by PPP::registerInterface(), ExtInterface::registerInterface(), and EtherMACBase::registerInterface().
virtual void IInterfaceTable::deleteInterface | ( | InterfaceEntry * | 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.
virtual InterfaceEntry* IInterfaceTable::getFirstLoopbackInterface | ( | ) | [pure virtual] |
Returns the first interface with the isLoopback flag set. (If there's no loopback, it returns NULL -- but this should never happen because IInterfaceTable itself registers a loopback interface on startup.)
Referenced by RoutingTable::configureLoopbackForIPv4(), and RoutingTable::configureRouterId().
virtual std::string IInterfaceTable::getFullPath | ( | ) | const [pure virtual] |
Module path name
Referenced by IPAddressResolver::addressOf(), FlatNetworkConfigurator::fillRoutingTables(), IPAddressResolver::getIPv4AddressFrom(), and IPAddressResolver::getIPv6AddressFrom().
virtual InterfaceEntry* IInterfaceTable::getInterface | ( | int | pos | ) | [pure virtual] |
Returns the InterfaceEntry 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.
Referenced by NetworkConfigurator::addDefaultRoutes(), FlatNetworkConfigurator::addDefaultRoutes(), FlatNetworkConfigurator6::addOwnAdvPrefixRoutes(), FlatNetworkConfigurator6::addStaticRoutes(), FlatNetworkConfigurator::assignAddresses(), IPv6NeighbourDiscovery::assignLinkLocalAddress(), FlatNetworkConfigurator6::configureAdvPrefixes(), RoutingTable::configureRouterId(), RoutingTable::gatherAddresses(), RoutingTable6::getInterfaceByAddress(), RoutingTable::getInterfaceByAddress(), IPAddressResolver::getIPv4AddressFrom(), IPAddressResolver::getIPv6AddressFrom(), TED::initialize(), RoutingTable6::initialize(), RoutingTable::initialize(), NAMTraceWriter::initialize(), IPv6NeighbourDiscovery::initialize(), RoutingTable6::isLocalAddress(), RoutingTable::isLocalAddress(), RoutingTable::isLocalMulticastAddress(), SCTPAssociation::processInitArrived(), LDP::rebuildFecList(), IPv6::routeMulticastPacket(), SCTPAssociation::sendInit(), and RoutingTable::updateNetmaskRoutes().
virtual InterfaceEntry* IInterfaceTable::getInterfaceById | ( | int | id | ) | [pure virtual] |
Returns an interface by its Id. Ids are guaranteed to be invariant to interface deletions/additions. Returns NULL if there is no such interface (This allows detecting stale IDs without raising an error.)
Referenced by IPv6::encapsulate(), IP::encapsulate(), IPv6NeighbourDiscovery::initiateAddressResolution(), IPv6NeighbourDiscovery::initiateNeighbourUnreachabilityDetection(), ARP::processARPPacket(), IPv6NeighbourDiscovery::processARTimeout(), IPv6NeighbourDiscovery::processDADTimeout(), LDP::processLDPHello(), IPv6NeighbourDiscovery::processNAForIncompleteNCEState(), IPv6NeighbourDiscovery::processNAForOtherNCEStates(), IPv6NeighbourDiscovery::processNAPacket(), IPv6NeighbourDiscovery::processNSPacket(), IPv6NeighbourDiscovery::processNUDTimeout(), ARP::processOutboundPacket(), IPv6NeighbourDiscovery::processRAForRouterUpdates(), IPv6NeighbourDiscovery::processRAPacket(), IPv6NeighbourDiscovery::processRSPacket(), and IPv6::routePacket().
virtual InterfaceEntry* IInterfaceTable::getInterfaceByName | ( | const char * | name | ) | [pure virtual] |
Returns an interface given by its name. Returns NULL if not found.
Referenced by IPAddressResolver::addressOf(), LDP::findPeerAddrFromInterface(), LinkStateRouting::initialize(), RoutingTableParser::parseInterfaces(), RoutingTableParser::parseRouting(), RoutingTable6::parseXMLConfigFile(), MPLS::processMPLSPacketFromL2(), OSPFRouting::ResolveInterfaceName(), RSVP::setupHello(), and MPLS::tryLabelAndForwardIPDatagram().
virtual InterfaceEntry* IInterfaceTable::getInterfaceByNetworkLayerGateIndex | ( | int | index | ) | [pure virtual] |
Returns an interface given by its getNetworkLayerGateIndex(). Returns NULL if not found.
Referenced by IPv6::getSourceInterfaceFrom(), IP::getSourceInterfaceFrom(), and MPLS::processMPLSPacketFromL2().
virtual InterfaceEntry* IInterfaceTable::getInterfaceByNodeInputGateId | ( | int | id | ) | [pure virtual] |
Returns an interface given by its getNodeInputGateId(). Returns NULL if not found.
Referenced by FlatNetworkConfigurator6::addStaticRoutes().
virtual InterfaceEntry* IInterfaceTable::getInterfaceByNodeOutputGateId | ( | int | id | ) | [pure virtual] |
Returns an interface given by its getNodeOutputGateId(). Returns NULL if not found.
Referenced by FlatNetworkConfigurator6::addStaticRoutes(), and FlatNetworkConfigurator::fillRoutingTables().
virtual int IInterfaceTable::getNumInterfaces | ( | ) | [pure virtual] |
Returns the number of interfaces.
Referenced by NetworkConfigurator::addDefaultRoutes(), FlatNetworkConfigurator::addDefaultRoutes(), FlatNetworkConfigurator6::addOwnAdvPrefixRoutes(), FlatNetworkConfigurator6::addStaticRoutes(), FlatNetworkConfigurator::assignAddresses(), IPv6NeighbourDiscovery::assignLinkLocalAddress(), FlatNetworkConfigurator6::configureAdvPrefixes(), RoutingTable::configureRouterId(), RoutingTable::gatherAddresses(), RoutingTable6::getInterfaceByAddress(), RoutingTable::getInterfaceByAddress(), IPAddressResolver::getIPv4AddressFrom(), IPAddressResolver::getIPv6AddressFrom(), IPv6::handleMessageFromHL(), IP::handleMessageFromHL(), TED::initialize(), RoutingTable6::initialize(), RoutingTable::initialize(), NAMTraceWriter::initialize(), IPv6NeighbourDiscovery::initialize(), RoutingTable6::isLocalAddress(), RoutingTable::isLocalAddress(), RoutingTable::isLocalMulticastAddress(), SCTPAssociation::processInitArrived(), LDP::rebuildFecList(), IPv6::routeMulticastPacket(), SCTPAssociation::sendInit(), and RoutingTable::updateNetmaskRoutes().
virtual void IInterfaceTable::interfaceChanged | ( | InterfaceEntry * | entry, | |
int | category | |||
) | [protected, pure virtual] |
Referenced by InterfaceEntry::changed().
friend class InterfaceEntry [friend] |
Definition at line 25 of file IInterfaceTable.h.
Referenced by InterfaceTable::initialize().