INET Framework for OMNeT++/OMNEST
InterfaceEntry Class Reference

#include <InterfaceEntry.h>

List of all members.

Public Member Functions

virtual void setInterfaceTable (IInterfaceTable *t)
virtual void setInterfaceId (int id)
 InterfaceEntry ()
virtual ~InterfaceEntry ()
virtual std::string info () const
virtual std::string detailedInfo () const
IInterfaceTablegetInterfaceTable () const
Field getters. Note they are non-virtual and inline, for performance reasons.
int getInterfaceId () const
int getNetworkLayerGateIndex () const
int getNodeOutputGateId () const
int getNodeInputGateId () const
int getPeerNamId () const
int getMTU () const
bool isDown () const
bool isBroadcast () const
bool isMulticast () const
bool isPointToPoint () const
bool isLoopback () const
double getDatarate () const
const MACAddressgetMacAddress () const
const InterfaceTokengetInterfaceToken () const
Field setters
virtual void setName (const char *s)
virtual void setNetworkLayerGateIndex (int i)
virtual void setNodeOutputGateId (int i)
virtual void setNodeInputGateId (int i)
virtual void setPeerNamId (int ni)
virtual void setMtu (int m)
virtual void setDown (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)
Accessing protocol-specific interface data. Note methods are non-virtual, for performance reasons.
IPv4InterfaceDataipv4Data ()
IPv6InterfaceDataipv6Data ()
InterfaceProtocolDatagetProtocol3Data ()
InterfaceProtocolDatagetProtocol4Data ()
Installing protocol-specific interface data
virtual void setIPv4Data (IPv4InterfaceData *p)
virtual void setIPv6Data (IPv6InterfaceData *p)
virtual void setProtocol3Data (InterfaceProtocolData *p)
virtual void setProtocol4Data (InterfaceProtocolData *p)

Protected Member Functions

virtual void configChanged ()
virtual void stateChanged ()
virtual void changed (int category)

Protected Attributes

IInterfaceTableownerp
 IInterfaceTable that contains this interface, or NULL.
int interfaceId
 identifies the interface in the IInterfaceTable
int nwLayerGateIndex
 index of ifIn[],ifOut[] gates to that interface (or -1 if virtual interface)
int nodeOutputGateId
 id of the output gate of this host/router (or -1 if this is a virtual interface)
int nodeInputGateId
 id of the input gate of this host/router (or -1 if this is a virtual interface)
int peernamid
 used only when writing ns2 nam traces
int mtu
 Maximum Transmission Unit (e.g. 1500 on Ethernet)
bool down
 current state (up or down)
bool broadcast
 interface supports broadcast
bool multicast
 interface supports multicast
bool pointToPoint
 interface is point-to-point link
bool loopback
 interface is loopback interface
double datarate
 data rate in bit/s
MACAddress macAddr
 link-layer address (for now, only IEEE 802 MAC addresses are supported)
InterfaceToken token
 for IPv6 stateless autoconfig (RFC 1971)
IPv4InterfaceDataipv4data
 IPv4-specific interface info (IP address, etc)
IPv6InterfaceDataipv6data
 IPv6-specific interface info (IPv6 addresses, etc)
InterfaceProtocolDataprotocol3data
 extension point: data for a 3rd network-layer protocol
InterfaceProtocolDataprotocol4data
 extension point: data for a 4th network-layer protocol

Private Member Functions

 InterfaceEntry (const InterfaceEntry &obj)
InterfaceEntryoperator= (const InterfaceEntry &obj)

Friends

class InterfaceProtocolData

Detailed Description

Interface entry for the interface table in IInterfaceTable.

See also:
IInterfaceTable

Constructor & Destructor Documentation

InterfaceEntry::InterfaceEntry ( const InterfaceEntry obj) [private]
InterfaceEntry::InterfaceEntry ( )
{
    ownerp = NULL;

    nwLayerGateIndex = -1;
    nodeOutputGateId = -1;
    nodeInputGateId = -1;
    peernamid = -1;

    mtu = 0;

    down = false;
    broadcast = false;
    multicast = false;
    pointToPoint= false;
    loopback = false;
    datarate = 0;

    ipv4data = NULL;
    ipv6data = NULL;
    protocol3data = NULL;
    protocol4data = NULL;
}
virtual InterfaceEntry::~InterfaceEntry ( ) [inline, virtual]
{}

Member Function Documentation

void InterfaceEntry::changed ( int  category) [protected, virtual]

Referenced by InterfaceProtocolData::changed().

{
    if (ownerp)
        ownerp->interfaceChanged(this, category);
}
virtual void InterfaceEntry::configChanged ( ) [inline, protected, virtual]
std::string InterfaceEntry::detailedInfo ( ) const [virtual]
{
    std::stringstream out;
    out << "name:" << (getName()[0] ? getName() : "*");
    if (getNetworkLayerGateIndex()==-1)
        out << "  on:-";
    else
        out << "  on:nwLayer.ifOut[" << getNetworkLayerGateIndex() << "]";
    out << "MTU: " << getMTU() << " \t";
    if (isDown()) out << "DOWN ";
    if (isBroadcast()) out << "BROADCAST ";
    if (isMulticast()) out << "MULTICAST ";
    if (isPointToPoint()) out << "POINTTOPOINT ";
    if (isLoopback()) out << "LOOPBACK ";
    out << "\n";
    out << "  macAddr:";
    if (getMacAddress().isUnspecified())
        out << "n/a";
    else
        out << getMacAddress();
    out << "\n";
    if (ipv4data)
        out << " " << ((cPolymorphic*)ipv4data)->info() << "\n"; // Khmm...
    if (ipv6data)
        out << " " << ((cPolymorphic*)ipv6data)->info() << "\n"; // Khmm...
    if (protocol3data)
        out << " " << protocol3data->info() << "\n";
    if (protocol4data)
        out << " " << protocol4data->info() << "\n";

    return out.str();
}
double InterfaceEntry::getDatarate ( ) const [inline]
IInterfaceTable* InterfaceEntry::getInterfaceTable ( ) const [inline]

Returns the IInterfaceTable this interface is in, or NULL

{return ownerp;}
const InterfaceToken& InterfaceEntry::getInterfaceToken ( ) const [inline]
int InterfaceEntry::getNodeInputGateId ( ) const [inline]
{return nodeInputGateId;}
int InterfaceEntry::getNodeOutputGateId ( ) const [inline]
int InterfaceEntry::getPeerNamId ( ) const [inline]
InterfaceProtocolData* InterfaceEntry::getProtocol3Data ( ) [inline]
{return protocol3data;}
InterfaceProtocolData* InterfaceEntry::getProtocol4Data ( ) [inline]
{return protocol4data;}
std::string InterfaceEntry::info ( ) const [virtual]

Referenced by operator<<().

{
    std::stringstream out;
    out << (getName()[0] ? getName() : "*");
    if (getNetworkLayerGateIndex()==-1)
        out << "  on:-";
    else
        out << "  on:nwLayer.ifOut[" << getNetworkLayerGateIndex() << "]";
    out << "  MTU:" << getMTU();
    if (isDown()) out << " DOWN";
    if (isBroadcast()) out << " BROADCAST";
    if (isMulticast()) out << " MULTICAST";
    if (isPointToPoint()) out << " POINTTOPOINT";
    if (isLoopback()) out << " LOOPBACK";
    out << "  macAddr:";
    if (getMacAddress().isUnspecified())
        out << "n/a";
    else
        out << getMacAddress();

    if (ipv4data)
        out << " " << ((cPolymorphic*)ipv4data)->info(); // Khmm...
    if (ipv6data)
        out << " " << ((cPolymorphic*)ipv6data)->info(); // Khmm...
    if (protocol3data)
        out << " " << protocol3data->info();
    if (protocol4data)
        out << " " << protocol4data->info();
    return out.str();
}
IPv6InterfaceData* InterfaceEntry::ipv6Data ( ) [inline]

Referenced by FlatNetworkConfigurator6::addOwnAdvPrefixRoutes(), FlatNetworkConfigurator6::addStaticRoutes(), IPv6NeighbourDiscovery::assignLinkLocalAddress(), RoutingTable6::assignRequiredNodeAddresses(), FlatNetworkConfigurator6::configureAdvPrefixes(), RoutingTable6::configureInterfaceFromXML(), IPv6NeighbourDiscovery::createAndSendRAPacket(), IPv6NeighbourDiscovery::createAndSendRSPacket(), IPv6NeighbourDiscovery::createRATimer(), IPAddressResolver::getAddressFrom(), RoutingTable6::getInterfaceByAddress(), IPAddressResolver::getInterfaceIPv6Address(), IPAddressResolver::getIPv6AddressFrom(), RoutingTable6::initialize(), IPv6NeighbourDiscovery::initialize(), IPv6NeighbourDiscovery::initiateAddressResolution(), IPv6NeighbourDiscovery::initiateDAD(), IPv6NeighbourDiscovery::initiateNeighbourUnreachabilityDetection(), IPv6NeighbourDiscovery::initiateRouterDiscovery(), RoutingTable6::isLocalAddress(), IPv6NeighbourDiscovery::processARTimeout(), IPv6NeighbourDiscovery::processDADTimeout(), SCTPAssociation::processInitArrived(), IPv6NeighbourDiscovery::processNAForIncompleteNCEState(), IPv6NeighbourDiscovery::processNAForOtherNCEStates(), IPv6NeighbourDiscovery::processNAPacket(), IPv6NeighbourDiscovery::processNSPacket(), IPv6NeighbourDiscovery::processNUDTimeout(), IPv6NeighbourDiscovery::processRAForRouterUpdates(), IPv6NeighbourDiscovery::processRAPacket(), IPv6NeighbourDiscovery::processRAPrefixInfoForAddrAutoConf(), IPv6NeighbourDiscovery::processRDTimeout(), IPv6NeighbourDiscovery::processRSPacket(), IPv6::routePacket(), SCTPAssociation::sendInit(), IPv6NeighbourDiscovery::sendPeriodicRA(), and IPv6NeighbourDiscovery::sendSolicitedNA().

{return ipv6data;}
bool InterfaceEntry::isBroadcast ( ) const [inline]
bool InterfaceEntry::isDown ( ) const [inline]

Referenced by detailedInfo(), and info().

{return down;}
bool InterfaceEntry::isMulticast ( ) const [inline]

Referenced by detailedInfo(), and info().

{return multicast;}
bool InterfaceEntry::isPointToPoint ( ) const [inline]
InterfaceEntry& InterfaceEntry::operator= ( const InterfaceEntry obj) [private]
virtual void InterfaceEntry::setDatarate ( double  d) [inline, virtual]
virtual void InterfaceEntry::setDown ( bool  b) [inline, virtual]
{down = b; stateChanged();}
virtual void InterfaceEntry::setInterfaceId ( int  id) [inline, virtual]
virtual void InterfaceEntry::setInterfaceTable ( IInterfaceTable t) [inline, virtual]

Referenced by InterfaceTable::addInterface().

{ownerp = t;}
void InterfaceEntry::setIPv4Data ( IPv4InterfaceData p) [virtual]

Referenced by RoutingTable::configureInterfaceForIPv4(), and RoutingTable::configureLoopbackForIPv4().

{
#ifndef WITHOUT_IPv4
    ipv4data = p;
    p->ownerp = this;
    configChanged();
#else
    opp_error("setIPv4Data(): INET was compiled without IPv4 support");
#endif
}
void InterfaceEntry::setIPv6Data ( IPv6InterfaceData p) [virtual]

Referenced by RoutingTable6::configureInterfaceForIPv6().

{
#ifndef WITHOUT_IPv6
    ipv6data = p;
    p->ownerp = this;
    configChanged();
#else
    opp_error("setIPv4Data(): INET was compiled without IPv6 support");
#endif
}
virtual void InterfaceEntry::setLoopback ( bool  b) [inline, virtual]
virtual void InterfaceEntry::setMACAddress ( const MACAddress addr) [inline, virtual]
virtual void InterfaceEntry::setNetworkLayerGateIndex ( int  i) [inline, virtual]
virtual void InterfaceEntry::setNodeInputGateId ( int  i) [inline, virtual]
virtual void InterfaceEntry::setNodeOutputGateId ( int  i) [inline, virtual]
virtual void InterfaceEntry::setPeerNamId ( int  ni) [inline, virtual]
virtual void InterfaceEntry::setProtocol3Data ( InterfaceProtocolData p) [inline, virtual]
virtual void InterfaceEntry::setProtocol4Data ( InterfaceProtocolData p) [inline, virtual]
virtual void InterfaceEntry::stateChanged ( ) [inline, protected, virtual]

Friends And Related Function Documentation

friend class InterfaceProtocolData [friend]

Member Data Documentation

bool InterfaceEntry::broadcast [protected]

interface supports broadcast

Referenced by InterfaceEntry().

double InterfaceEntry::datarate [protected]

data rate in bit/s

Referenced by InterfaceEntry().

bool InterfaceEntry::down [protected]

current state (up or down)

Referenced by InterfaceEntry().

int InterfaceEntry::interfaceId [protected]

identifies the interface in the IInterfaceTable

IPv4-specific interface info (IP address, etc)

Referenced by detailedInfo(), info(), InterfaceEntry(), and setIPv4Data().

IPv6-specific interface info (IPv6 addresses, etc)

Referenced by detailedInfo(), info(), InterfaceEntry(), and setIPv6Data().

bool InterfaceEntry::loopback [protected]

interface is loopback interface

Referenced by InterfaceEntry().

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

int InterfaceEntry::mtu [protected]

Maximum Transmission Unit (e.g. 1500 on Ethernet)

Referenced by InterfaceEntry().

bool InterfaceEntry::multicast [protected]

interface supports multicast

Referenced by InterfaceEntry().

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

Referenced by InterfaceEntry().

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

Referenced by InterfaceEntry().

index of ifIn[],ifOut[] gates to that interface (or -1 if virtual interface)

Referenced by InterfaceEntry().

int InterfaceEntry::peernamid [protected]

used only when writing ns2 nam traces

Referenced by InterfaceEntry().

bool InterfaceEntry::pointToPoint [protected]

interface is point-to-point link

Referenced by InterfaceEntry().

extension point: data for a 3rd network-layer protocol

Referenced by detailedInfo(), info(), and InterfaceEntry().

extension point: data for a 4th network-layer protocol

Referenced by detailedInfo(), info(), and InterfaceEntry().

for IPv6 stateless autoconfig (RFC 1971)


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