InterfaceEntry Class Reference

#include <InterfaceEntry.h>

List of all members.


Detailed Description

Interface entry for the interface table in IInterfaceTable.

See also:
IInterfaceTable

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

Constructor & Destructor Documentation

InterfaceEntry::InterfaceEntry ( const InterfaceEntry obj  )  [private]

InterfaceEntry::InterfaceEntry (  ) 

00047 {
00048     ownerp = NULL;
00049 
00050     nwLayerGateIndex = -1;
00051     nodeOutputGateId = -1;
00052     nodeInputGateId = -1;
00053     peernamid = -1;
00054 
00055     mtu = 0;
00056 
00057     down = false;
00058     broadcast = false;
00059     multicast = false;
00060     pointToPoint= false;
00061     loopback = false;
00062     datarate = 0;
00063 
00064     ipv4data = NULL;
00065     ipv6data = NULL;
00066     protocol3data = NULL;
00067     protocol4data = NULL;
00068 }

virtual InterfaceEntry::~InterfaceEntry (  )  [inline, virtual]

00110 {}


Member Function Documentation

InterfaceEntry& InterfaceEntry::operator= ( const InterfaceEntry obj  )  [private]

virtual void InterfaceEntry::configChanged (  )  [inline, protected, virtual]

virtual void InterfaceEntry::stateChanged (  )  [inline, protected, virtual]

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

Referenced by InterfaceProtocolData::changed().

00135 {
00136     if (ownerp)
00137         ownerp->interfaceChanged(this, category);
00138 }

virtual void InterfaceEntry::setInterfaceTable ( IInterfaceTable t  )  [inline, virtual]

Referenced by InterfaceTable::addInterface().

00105 {ownerp = t;}

virtual void InterfaceEntry::setInterfaceId ( int  id  )  [inline, virtual]

Referenced by InterfaceTable::addInterface().

00106 {interfaceId = id;}

std::string InterfaceEntry::info (  )  const [virtual]

Referenced by operator<<().

00071 {
00072     std::stringstream out;
00073     out << (getName()[0] ? getName() : "*");
00074     if (getNetworkLayerGateIndex()==-1)
00075         out << "  on:-";
00076     else
00077         out << "  on:nwLayer.ifOut[" << getNetworkLayerGateIndex() << "]";
00078     out << "  MTU:" << getMTU();
00079     if (isDown()) out << " DOWN";
00080     if (isBroadcast()) out << " BROADCAST";
00081     if (isMulticast()) out << " MULTICAST";
00082     if (isPointToPoint()) out << " POINTTOPOINT";
00083     if (isLoopback()) out << " LOOPBACK";
00084     out << "  macAddr:";
00085     if (getMacAddress().isUnspecified())
00086         out << "n/a";
00087     else
00088         out << getMacAddress();
00089 
00090     if (ipv4data)
00091         out << " " << ((cPolymorphic*)ipv4data)->info(); // Khmm...
00092     if (ipv6data)
00093         out << " " << ((cPolymorphic*)ipv6data)->info(); // Khmm...
00094     if (protocol3data)
00095         out << " " << protocol3data->info();
00096     if (protocol4data)
00097         out << " " << protocol4data->info();
00098     return out.str();
00099 }

std::string InterfaceEntry::detailedInfo (  )  const [virtual]

00102 {
00103     std::stringstream out;
00104     out << "name:" << (getName()[0] ? getName() : "*");
00105     if (getNetworkLayerGateIndex()==-1)
00106         out << "  on:-";
00107     else
00108         out << "  on:nwLayer.ifOut[" << getNetworkLayerGateIndex() << "]";
00109     out << "MTU: " << getMTU() << " \t";
00110     if (isDown()) out << "DOWN ";
00111     if (isBroadcast()) out << "BROADCAST ";
00112     if (isMulticast()) out << "MULTICAST ";
00113     if (isPointToPoint()) out << "POINTTOPOINT ";
00114     if (isLoopback()) out << "LOOPBACK ";
00115     out << "\n";
00116     out << "  macAddr:";
00117     if (getMacAddress().isUnspecified())
00118         out << "n/a";
00119     else
00120         out << getMacAddress();
00121     out << "\n";
00122     if (ipv4data)
00123         out << " " << ((cPolymorphic*)ipv4data)->info() << "\n"; // Khmm...
00124     if (ipv6data)
00125         out << " " << ((cPolymorphic*)ipv6data)->info() << "\n"; // Khmm...
00126     if (protocol3data)
00127         out << " " << protocol3data->info() << "\n";
00128     if (protocol4data)
00129         out << " " << protocol4data->info() << "\n";
00130 
00131     return out.str();
00132 }

IInterfaceTable* InterfaceEntry::getInterfaceTable (  )  const [inline]

Returns the IInterfaceTable this interface is in, or NULL

00117 {return ownerp;}

int InterfaceEntry::getInterfaceId (  )  const [inline]

int InterfaceEntry::getNetworkLayerGateIndex (  )  const [inline]

int InterfaceEntry::getNodeOutputGateId (  )  const [inline]

int InterfaceEntry::getNodeInputGateId (  )  const [inline]

00124 {return nodeInputGateId;}

int InterfaceEntry::getPeerNamId (  )  const [inline]

int InterfaceEntry::getMTU (  )  const [inline]

bool InterfaceEntry::isDown (  )  const [inline]

Referenced by detailedInfo(), and info().

00127 {return down;}

bool InterfaceEntry::isBroadcast (  )  const [inline]

bool InterfaceEntry::isMulticast (  )  const [inline]

Referenced by detailedInfo(), and info().

00129 {return multicast;}

bool InterfaceEntry::isPointToPoint (  )  const [inline]

Referenced by detailedInfo(), info(), and NAMTraceWriter::initialize().

00130 {return pointToPoint;}

bool InterfaceEntry::isLoopback (  )  const [inline]

double InterfaceEntry::getDatarate (  )  const [inline]

const MACAddress& InterfaceEntry::getMacAddress (  )  const [inline]

const InterfaceToken& InterfaceEntry::getInterfaceToken (  )  const [inline]

virtual void InterfaceEntry::setName ( const char *  s  )  [inline, virtual]

virtual void InterfaceEntry::setNetworkLayerGateIndex ( int  i  )  [inline, virtual]

virtual void InterfaceEntry::setNodeOutputGateId ( int  i  )  [inline, virtual]

virtual void InterfaceEntry::setNodeInputGateId ( int  i  )  [inline, virtual]

virtual void InterfaceEntry::setPeerNamId ( int  ni  )  [inline, virtual]

Referenced by NAMTraceWriter::initialize().

00143 {peernamid = ni; configChanged();}

virtual void InterfaceEntry::setMtu ( int  m  )  [inline, virtual]

virtual void InterfaceEntry::setDown ( bool  b  )  [inline, virtual]

00145 {down = b; stateChanged();}

virtual void InterfaceEntry::setBroadcast ( bool  b  )  [inline, virtual]

virtual void InterfaceEntry::setMulticast ( bool  b  )  [inline, virtual]

virtual void InterfaceEntry::setPointToPoint ( bool  b  )  [inline, virtual]

virtual void InterfaceEntry::setLoopback ( bool  b  )  [inline, virtual]

Referenced by InterfaceTable::initialize().

00149 {loopback = b; configChanged();}

virtual void InterfaceEntry::setDatarate ( double  d  )  [inline, virtual]

virtual void InterfaceEntry::setMACAddress ( const MACAddress addr  )  [inline, virtual]

virtual void InterfaceEntry::setInterfaceToken ( const InterfaceToken t  )  [inline, virtual]

IPv4InterfaceData* InterfaceEntry::ipv4Data (  )  [inline]

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().

00158 {return ipv6data;}

InterfaceProtocolData* InterfaceEntry::getProtocol3Data (  )  [inline]

00159 {return protocol3data;}

InterfaceProtocolData* InterfaceEntry::getProtocol4Data (  )  [inline]

00160 {return protocol4data;}

void InterfaceEntry::setIPv4Data ( IPv4InterfaceData p  )  [virtual]

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

00141 {
00142 #ifndef WITHOUT_IPv4
00143     ipv4data = p;
00144     p->ownerp = this;
00145     configChanged();
00146 #else
00147     opp_error("setIPv4Data(): INET was compiled without IPv4 support");
00148 #endif
00149 }

void InterfaceEntry::setIPv6Data ( IPv6InterfaceData p  )  [virtual]

Referenced by RoutingTable6::configureInterfaceForIPv6().

00152 {
00153 #ifndef WITHOUT_IPv6
00154     ipv6data = p;
00155     p->ownerp = this;
00156     configChanged();
00157 #else
00158     opp_error("setIPv4Data(): INET was compiled without IPv6 support");
00159 #endif
00160 }

virtual void InterfaceEntry::setProtocol3Data ( InterfaceProtocolData p  )  [inline, virtual]

00167 {protocol3data = p; configChanged();}

virtual void InterfaceEntry::setProtocol4Data ( InterfaceProtocolData p  )  [inline, virtual]

00168 {protocol4data = p; configChanged();}


Friends And Related Function Documentation

friend class InterfaceProtocolData [friend]


Member Data Documentation

int InterfaceEntry::interfaceId [protected]

identifies the interface in the IInterfaceTable

index of ifIn[],ifOut[] gates to that interface (or -1 if 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().

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

Referenced by InterfaceEntry().

int InterfaceEntry::peernamid [protected]

used only when writing ns2 nam traces

Referenced by InterfaceEntry().

int InterfaceEntry::mtu [protected]

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

Referenced by InterfaceEntry().

bool InterfaceEntry::down [protected]

current state (up or down)

Referenced by InterfaceEntry().

bool InterfaceEntry::broadcast [protected]

interface supports broadcast

Referenced by InterfaceEntry().

bool InterfaceEntry::multicast [protected]

interface supports multicast

Referenced by InterfaceEntry().

bool InterfaceEntry::pointToPoint [protected]

interface is point-to-point link

Referenced by InterfaceEntry().

bool InterfaceEntry::loopback [protected]

interface is loopback interface

Referenced by InterfaceEntry().

double InterfaceEntry::datarate [protected]

data rate in bit/s

Referenced by InterfaceEntry().

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

for IPv6 stateless autoconfig (RFC 1971)

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().

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().


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

Generated on Fri Mar 20 18:51:19 2009 for INET Framework for OMNeT++/OMNEST by  doxygen 1.5.5