#include <InterfaceEntry.h>
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 |
IInterfaceTable * | getInterfaceTable () 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 MACAddress & | getMacAddress () const |
const InterfaceToken & | getInterfaceToken () 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. | |
IPv4InterfaceData * | ipv4Data () |
IPv6InterfaceData * | ipv6Data () |
InterfaceProtocolData * | getProtocol3Data () |
InterfaceProtocolData * | getProtocol4Data () |
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 | |
IInterfaceTable * | ownerp |
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) | |
IPv4InterfaceData * | ipv4data |
IPv4-specific interface info (IP address, etc). | |
IPv6InterfaceData * | ipv6data |
IPv6-specific interface info (IPv6 addresses, etc). | |
InterfaceProtocolData * | protocol3data |
extension point: data for a 3rd network-layer protocol | |
InterfaceProtocolData * | protocol4data |
extension point: data for a 4th network-layer protocol | |
Private Member Functions | |
InterfaceEntry (const InterfaceEntry &obj) | |
InterfaceEntry & | operator= (const InterfaceEntry &obj) |
Friends | |
class | InterfaceProtocolData |
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 }
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] |
virtual void InterfaceEntry::setInterfaceId | ( | int | id | ) | [inline, virtual] |
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] |
int InterfaceEntry::getInterfaceId | ( | ) | const [inline] |
Referenced by FlatNetworkConfigurator6::addOwnAdvPrefixRoutes(), FlatNetworkConfigurator6::addStaticRoutes(), IPv6NeighbourDiscovery::createAndSendNSPacket(), IPv6NeighbourDiscovery::createAndSendRAPacket(), IPv6NeighbourDiscovery::createAndSendRSPacket(), IPv6NeighbourDiscovery::createRATimer(), IPv6::decapsulate(), IP::decapsulateIP(), InterfaceTable::deleteInterface(), IPv6NeighbourDiscovery::fetchAdvIfEntry(), IPv6NeighbourDiscovery::fetchRDEntry(), IP::handleARP(), RoutingTable6::initialize(), IPv6NeighbourDiscovery::initiateDAD(), IPv6NeighbourDiscovery::initiateRouterDiscovery(), IPv6NeighbourDiscovery::processNAPacket(), IPv6NeighbourDiscovery::processNSForNonTentativeAddress(), IPv6NeighbourDiscovery::processNSWithSpecifiedSrcAddr(), IPv6NeighbourDiscovery::processRAForRouterUpdates(), IPv6NeighbourDiscovery::processRAPrefixInfo(), OSPFRouting::ResolveInterfaceName(), IP::sendDatagramToOutput(), and IPv6NeighbourDiscovery::sendSolicitedNA().
00121 {return interfaceId;}
int InterfaceEntry::getNetworkLayerGateIndex | ( | ) | const [inline] |
int InterfaceEntry::getNodeOutputGateId | ( | ) | const [inline] |
int InterfaceEntry::getNodeInputGateId | ( | ) | const [inline] |
int InterfaceEntry::getPeerNamId | ( | ) | const [inline] |
int InterfaceEntry::getMTU | ( | ) | const [inline] |
Referenced by detailedInfo(), IP::fragmentAndSend(), info(), SCTPAssociation::pmStartPathManagement(), SCTPPathVariables::SCTPPathVariables(), and OSPF::Interface::SetIfIndex().
00126 {return mtu;}
bool InterfaceEntry::isDown | ( | ) | const [inline] |
bool InterfaceEntry::isBroadcast | ( | ) | const [inline] |
Referenced by detailedInfo(), info(), ARP::processOutboundPacket(), and IP::sendDatagramToOutput().
00128 {return broadcast;}
bool InterfaceEntry::isMulticast | ( | ) | const [inline] |
bool InterfaceEntry::isPointToPoint | ( | ) | const [inline] |
Referenced by detailedInfo(), info(), and NAMTraceWriter::initialize().
00130 {return pointToPoint;}
bool InterfaceEntry::isLoopback | ( | ) | const [inline] |
Referenced by NetworkConfigurator::addDefaultRoutes(), FlatNetworkConfigurator::addDefaultRoutes(), FlatNetworkConfigurator6::addOwnAdvPrefixRoutes(), FlatNetworkConfigurator6::addStaticRoutes(), NetworkConfigurator::assignAddresses(), FlatNetworkConfigurator::assignAddresses(), IPv6NeighbourDiscovery::assignLinkLocalAddress(), RoutingTable6::assignRequiredNodeAddresses(), FlatNetworkConfigurator6::configureAdvPrefixes(), RoutingTable::configureRouterId(), detailedInfo(), NetworkInfo::dumpRoutingInfo(), IPAddressResolver::getIPv4AddressFrom(), IPAddressResolver::getIPv6AddressFrom(), info(), TED::initialize(), RoutingTable6::initialize(), NAMTraceWriter::initialize(), and IPv6NeighbourDiscovery::initialize().
00131 {return loopback;}
double InterfaceEntry::getDatarate | ( | ) | const [inline] |
Referenced by RoutingTable::configureInterfaceForIPv4(), and NAMTraceWriter::initialize().
00132 {return datarate;}
const MACAddress& InterfaceEntry::getMacAddress | ( | ) | const [inline] |
const InterfaceToken& InterfaceEntry::getInterfaceToken | ( | ) | const [inline] |
Referenced by IPv6NeighbourDiscovery::assignLinkLocalAddress(), and FlatNetworkConfigurator6::configureAdvPrefixes().
00134 {return token;}
virtual void InterfaceEntry::setName | ( | const char * | s | ) | [inline, virtual] |
Referenced by InterfaceTable::initialize(), PPP::registerInterface(), Mac80211::registerInterface(), Ieee80211Mac::registerInterface(), ExtInterface::registerInterface(), EtherMACBase::registerInterface(), and CSMAMacLayer::registerInterface().
00139 {cNamedObject::setName(s); configChanged();}
virtual void InterfaceEntry::setNetworkLayerGateIndex | ( | int | i | ) | [inline, virtual] |
Referenced by InterfaceTable::discoverConnectingGates().
00140 {nwLayerGateIndex = i; configChanged();}
virtual void InterfaceEntry::setNodeOutputGateId | ( | int | i | ) | [inline, virtual] |
Referenced by InterfaceTable::discoverConnectingGates().
00141 {nodeOutputGateId = i; configChanged();}
virtual void InterfaceEntry::setNodeInputGateId | ( | int | i | ) | [inline, virtual] |
Referenced by InterfaceTable::discoverConnectingGates().
00142 {nodeInputGateId = i; configChanged();}
virtual void InterfaceEntry::setPeerNamId | ( | int | ni | ) | [inline, virtual] |
virtual void InterfaceEntry::setMtu | ( | int | m | ) | [inline, virtual] |
Referenced by InterfaceTable::initialize(), RoutingTableParser::parseInterfaces(), PPP::registerInterface(), Mac80211::registerInterface(), Ieee80211Mac::registerInterface(), ExtInterface::registerInterface(), EtherMACBase::registerInterface(), and CSMAMacLayer::registerInterface().
00144 {mtu = m; configChanged();}
virtual void InterfaceEntry::setDown | ( | bool | b | ) | [inline, virtual] |
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] |
virtual void InterfaceEntry::setDatarate | ( | double | d | ) | [inline, virtual] |
Referenced by PPP::registerInterface(), and EtherMACBase::registerInterface().
00150 {datarate = d; configChanged();}
virtual void InterfaceEntry::setMACAddress | ( | const MACAddress & | addr | ) | [inline, virtual] |
Referenced by Mac80211::registerInterface(), Ieee80211Mac::registerInterface(), EtherMACBase::registerInterface(), and CSMAMacLayer::registerInterface().
00151 {macAddr = addr; configChanged();}
virtual void InterfaceEntry::setInterfaceToken | ( | const InterfaceToken & | t | ) | [inline, virtual] |
Referenced by PPP::registerInterface(), Mac80211::registerInterface(), Ieee80211Mac::registerInterface(), EtherMACBase::registerInterface(), and CSMAMacLayer::registerInterface().
00152 {token = t; configChanged();}
IPv4InterfaceData* InterfaceEntry::ipv4Data | ( | ) | [inline] |
Referenced by NetworkConfigurator::addPointToPointPeerRoutes(), NetworkConfigurator::assignAddresses(), FlatNetworkConfigurator::assignAddresses(), RoutingTable::configureRouterId(), RSVP::evalNextHopInterface(), RoutingTable::gatherAddresses(), IPAddressResolver::getAddressFrom(), RoutingTable::getInterfaceByAddress(), IPAddressResolver::getIPv4AddressFrom(), TED::initialize(), LinkStateRouting::initialize(), RoutingTable::isLocalAddress(), RoutingTable::isLocalMulticastAddress(), RoutingTableParser::parseInterfaces(), RoutingTableParser::parseMulticastGroups(), SCTPAssociation::processInitArrived(), LDP::rebuildFecList(), IP::routeMulticastPacket(), IP::routePacket(), ARP::sendARPRequest(), SCTPAssociation::sendInit(), OSPF::Interface::SetIfIndex(), RSVP::setupHello(), and RoutingTable::updateNetmaskRoutes().
00157 {return ipv4data;}
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] |
InterfaceProtocolData* InterfaceEntry::getProtocol4Data | ( | ) | [inline] |
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] |
virtual void InterfaceEntry::setProtocol4Data | ( | InterfaceProtocolData * | p | ) | [inline, virtual] |
friend class InterfaceProtocolData [friend] |
IInterfaceTable* InterfaceEntry::ownerp [protected] |
IInterfaceTable that contains this interface, or NULL.
Referenced by changed(), InterfaceProtocolData::getInterfaceEntry(), InterfaceEntry(), and InterfaceProtocolData::InterfaceProtocolData().
int InterfaceEntry::interfaceId [protected] |
identifies the interface in the IInterfaceTable
int InterfaceEntry::nwLayerGateIndex [protected] |
index of ifIn[],ifOut[] gates to that interface (or -1 if virtual interface)
Referenced by InterfaceEntry().
int InterfaceEntry::nodeOutputGateId [protected] |
id of the output gate of this host/router (or -1 if this is a virtual interface)
Referenced by InterfaceEntry().
int InterfaceEntry::nodeInputGateId [protected] |
id of the input gate of this host/router (or -1 if this is a virtual interface)
Referenced by InterfaceEntry().
int InterfaceEntry::peernamid [protected] |
int InterfaceEntry::mtu [protected] |
bool InterfaceEntry::down [protected] |
bool InterfaceEntry::broadcast [protected] |
bool InterfaceEntry::multicast [protected] |
bool InterfaceEntry::pointToPoint [protected] |
bool InterfaceEntry::loopback [protected] |
double InterfaceEntry::datarate [protected] |
MACAddress InterfaceEntry::macAddr [protected] |
link-layer address (for now, only IEEE 802 MAC addresses are supported)
InterfaceToken InterfaceEntry::token [protected] |
for IPv6 stateless autoconfig (RFC 1971)
IPv4InterfaceData* InterfaceEntry::ipv4data [protected] |
IPv4-specific interface info (IP address, etc).
Referenced by detailedInfo(), info(), InterfaceEntry(), and setIPv4Data().
IPv6InterfaceData* InterfaceEntry::ipv6data [protected] |
IPv6-specific interface info (IPv6 addresses, etc).
Referenced by detailedInfo(), info(), InterfaceEntry(), and setIPv6Data().
InterfaceProtocolData* InterfaceEntry::protocol3data [protected] |
extension point: data for a 3rd network-layer protocol
Referenced by detailedInfo(), info(), and InterfaceEntry().
InterfaceProtocolData* InterfaceEntry::protocol4data [protected] |
extension point: data for a 4th network-layer protocol
Referenced by detailedInfo(), info(), and InterfaceEntry().