INET Framework for OMNeT++/OMNEST
|
#include <IPv6InterfaceData.h>
IPv6-specific data for InterfaceEntry. Most of this comes from section 6.2.1 of RFC 2461 (IPv6 Neighbor Discovery, Router Configuration Variables).
typedef std::vector<AddressData> IPv6InterfaceData::AddressDataVector [protected] |
typedef std::vector<AdvPrefix> IPv6InterfaceData::AdvPrefixList [protected] |
IPv6InterfaceData::IPv6InterfaceData | ( | ) |
{ /*******************Setting host/node/router Protocol Constants************/ routerConstants.maxInitialRtrAdvertInterval = IPv6_MAX_INITIAL_RTR_ADVERT_INTERVAL; routerConstants.maxInitialRtrAdvertisements = IPv6_MAX_INITIAL_RTR_ADVERTISEMENTS; routerConstants.maxFinalRtrAdvertisements = IPv6_MAX_FINAL_RTR_ADVERTISEMENTS; routerConstants.minDelayBetweenRAs = IPv6_MIN_DELAY_BETWEEN_RAS; routerConstants.maxRADelayTime = IPv6_MAX_RA_DELAY_TIME; hostConstants.maxRtrSolicitationDelay = IPv6_MAX_RTR_SOLICITATION_DELAY; hostConstants.rtrSolicitationInterval = IPv6_RTR_SOLICITATION_INTERVAL; hostConstants.maxRtrSolicitations = IPv6_MAX_RTR_SOLICITATIONS; nodeConstants.maxMulticastSolicit = IPv6_MAX_MULTICAST_SOLICIT; nodeConstants.maxUnicastSolicit = IPv6_MAX_UNICAST_SOLICIT; nodeConstants.maxAnycastDelayTime = IPv6_MAX_ANYCAST_DELAY_TIME; nodeConstants.maxNeighbourAdvertisement = IPv6_MAX_NEIGHBOUR_ADVERTISEMENT; nodeConstants.reachableTime = IPv6_REACHABLE_TIME; nodeConstants.retransTimer = IPv6_RETRANS_TIMER; nodeConstants.delayFirstProbeTime = IPv6_DELAY_FIRST_PROBE_TIME; nodeConstants.minRandomFactor = IPv6_MIN_RANDOM_FACTOR; nodeConstants.maxRandomFactor = IPv6_MAX_RANDOM_FACTOR; /*******************Setting host/node/router variables*********************/ nodeVars.dupAddrDetectTransmits = IPv6_DEFAULT_DUPADDRDETECTTRANSMITS; hostVars.linkMTU = IPv6_MIN_MTU; hostVars.curHopLimit = IPv6_DEFAULT_ADVCURHOPLIMIT;//value specified in RFC 1700-can't find it hostVars.baseReachableTime = IPv6_REACHABLE_TIME; hostVars.reachableTime = generateReachableTime(_getMinRandomFactor(), _getMaxRandomFactor(), getBaseReachableTime()); hostVars.retransTimer = IPv6_RETRANS_TIMER; //rtrVars.advSendAdvertisements is set in RoutingTable6.cc:line 143 rtrVars.maxRtrAdvInterval = IPv6_DEFAULT_MAX_RTR_ADV_INT; rtrVars.minRtrAdvInterval = 0.33*rtrVars.maxRtrAdvInterval; rtrVars.advManagedFlag = false; rtrVars.advOtherConfigFlag = false; rtrVars.advLinkMTU = IPv6_MIN_MTU; rtrVars.advReachableTime = IPv6_DEFAULT_ADV_REACHABLE_TIME; rtrVars.advRetransTimer = IPv6_DEFAULT_ADV_RETRANS_TIMER; rtrVars.advCurHopLimit = IPv6_DEFAULT_ADVCURHOPLIMIT; rtrVars.advDefaultLifetime = 3*rtrVars.maxRtrAdvInterval; #if USE_MOBILITY if (rtrVars.advDefaultLifetime<1) rtrVars.advDefaultLifetime = 1; #endif }
virtual IPv6InterfaceData::~IPv6InterfaceData | ( | ) | [inline, virtual] |
{}
simtime_t IPv6InterfaceData::_getDelayFirstProbeTime | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::initiateNeighbourUnreachabilityDetection().
{return nodeConstants.delayFirstProbeTime;}
simtime_t IPv6InterfaceData::_getMaxAnycastDelayTime | ( | ) | [inline] |
{return nodeConstants.maxAnycastDelayTime;}
uint IPv6InterfaceData::_getMaxFinalRtrAdvertisements | ( | ) | [inline] |
{return routerConstants.maxFinalRtrAdvertisements;}
simtime_t IPv6InterfaceData::_getMaxInitialRtrAdvertInterval | ( | ) | [inline] |
Getters/Setters for all variables and constants defined in RFC 2461/2462 can be found here. Operations responsible for protocol constants are marked with a "_" prefix. Constants in this class are stored as instance variables. Default values for certain variables are defined at the top of this file, while certain variables have to be generated. Protocol constants are subject to change as specified in RFC2461:section 10 depending on different link layer operation. Getters and setters have been implemented for protocol constants so that a wireless interface may be set to a different set of constant values. (ie. changed by the FlatNetworkConfigurator) Such a design allows both wired and wireless networks to co-exist within a simulation run.
Referenced by IPv6NeighbourDiscovery::sendPeriodicRA().
{return routerConstants.maxInitialRtrAdvertInterval;}
uint IPv6InterfaceData::_getMaxInitialRtrAdvertisements | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::sendPeriodicRA().
{return routerConstants.maxInitialRtrAdvertisements;}
uint IPv6InterfaceData::_getMaxMulticastSolicit | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::processARTimeout().
{return nodeConstants.maxMulticastSolicit;}
uint IPv6InterfaceData::_getMaxNeighbourAdvertisement | ( | ) | [inline] |
{return nodeConstants.maxNeighbourAdvertisement;}
simtime_t IPv6InterfaceData::_getMaxRADelayTime | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::processRSPacket().
{return routerConstants.maxRADelayTime;}
double IPv6InterfaceData::_getMaxRandomFactor | ( | ) | [inline] |
Referenced by generateReachableTime(), and IPv6InterfaceData().
{return nodeConstants.maxRandomFactor;}
simtime_t IPv6InterfaceData::_getMaxRtrSolicitationDelay | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::processDADTimeout(), and IPv6NeighbourDiscovery::processRDTimeout().
{return hostConstants.maxRtrSolicitationDelay;}
uint IPv6InterfaceData::_getMaxRtrSolicitations | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::processRDTimeout().
{return hostConstants.maxRtrSolicitations;}
uint IPv6InterfaceData::_getMaxUnicastSolicit | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::processNUDTimeout().
{return nodeConstants.maxUnicastSolicit;}
simtime_t IPv6InterfaceData::_getMinDelayBetweenRAs | ( | ) | [inline] |
{return routerConstants.minDelayBetweenRAs;}
double IPv6InterfaceData::_getMinRandomFactor | ( | ) | [inline] |
Referenced by generateReachableTime(), and IPv6InterfaceData().
{return nodeConstants.minRandomFactor;}
simtime_t IPv6InterfaceData::_getReachableTime | ( | ) | [inline] |
simtime_t IPv6InterfaceData::_getRetransTimer | ( | ) | [inline] |
simtime_t IPv6InterfaceData::_getRtrSolicitationInterval | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::initiateRouterDiscovery(), and IPv6NeighbourDiscovery::processRDTimeout().
{return hostConstants.rtrSolicitationInterval;}
virtual void IPv6InterfaceData::_setDelayFirstProbeTime | ( | simtime_t | d | ) | [inline, virtual] |
{nodeConstants.delayFirstProbeTime = d;}
virtual void IPv6InterfaceData::_setMaxAnycastDelayTime | ( | simtime_t | d | ) | [inline, virtual] |
{nodeConstants.maxAnycastDelayTime = d;}
virtual void IPv6InterfaceData::_setMaxFinalRtrAdvertisements | ( | uint | d | ) | [inline, virtual] |
virtual void IPv6InterfaceData::_setMaxInitialRtrAdvertInterval | ( | simtime_t | d | ) | [inline, virtual] |
virtual void IPv6InterfaceData::_setMaxInitialRtrAdvertisements | ( | uint | d | ) | [inline, virtual] |
virtual void IPv6InterfaceData::_setMaxMulticastSolicit | ( | uint | d | ) | [inline, virtual] |
{nodeConstants.maxMulticastSolicit = d;}
virtual void IPv6InterfaceData::_setMaxNeighbourAdvertisement | ( | uint | d | ) | [inline, virtual] |
virtual void IPv6InterfaceData::_setMaxRADelayTime | ( | simtime_t | d | ) | [inline, virtual] |
{routerConstants.maxRADelayTime = d;}
virtual void IPv6InterfaceData::_setMaxRandomFactor | ( | double | d | ) | [inline, virtual] |
{nodeConstants.maxRandomFactor = d;}
virtual void IPv6InterfaceData::_setMaxRtrSolicitationDelay | ( | simtime_t | d | ) | [inline, virtual] |
virtual void IPv6InterfaceData::_setMaxRtrSolicitations | ( | uint | d | ) | [inline, virtual] |
{hostConstants.maxRtrSolicitations = d;}
virtual void IPv6InterfaceData::_setMaxUnicastSolicit | ( | uint | d | ) | [inline, virtual] |
{nodeConstants.maxUnicastSolicit = d;}
virtual void IPv6InterfaceData::_setMinDelayBetweenRAs | ( | simtime_t | d | ) | [inline, virtual] |
virtual void IPv6InterfaceData::_setMinRandomFactor | ( | double | d | ) | [inline, virtual] |
{nodeConstants.minRandomFactor = d;}
virtual void IPv6InterfaceData::_setReachableTime | ( | simtime_t | d | ) | [inline, virtual] |
{nodeConstants.reachableTime = d;}
virtual void IPv6InterfaceData::_setRetransTimer | ( | simtime_t | d | ) | [inline, virtual] |
{nodeConstants.retransTimer = d;}
virtual void IPv6InterfaceData::_setRtrSolicitationInterval | ( | simtime_t | d | ) | [inline, virtual] |
void IPv6InterfaceData::addAdvPrefix | ( | const AdvPrefix & | advPrefix | ) | [virtual] |
Adds the given advertised prefix to the interface.
Referenced by FlatNetworkConfigurator6::configureAdvPrefixes(), and RoutingTable6::configureInterfaceFromXML().
{ rtrVars.advPrefixList.push_back(advPrefix); }
bool IPv6InterfaceData::addrLess | ( | const AddressData & | a, |
const AddressData & | b | ||
) | [static, protected] |
Referenced by choosePreferredAddress().
{ // This method is used in choosePreferredAddress(). // sort() produces increasing order, so "better" addresses should // compare as "less", to make them appear first in the array if (a.tentative!=b.tentative) return !a.tentative; // tentative=false is better if (a.address.getScope()!=b.address.getScope()) return a.address.getScope()>b.address.getScope(); // bigger scope is better return (a.expiryTime==0 && b.expiryTime!=0) || a.expiryTime>b.expiryTime; // longer expiry time is better }
void IPv6InterfaceData::assignAddress | ( | const IPv6Address & | addr, |
bool | tentative, | ||
simtime_t | expiryTime, | ||
simtime_t | prefExpiryTime | ||
) | [virtual] |
Assigns the given address to the interface.
Referenced by IPv6NeighbourDiscovery::assignLinkLocalAddress(), RoutingTable6::assignRequiredNodeAddresses(), FlatNetworkConfigurator6::configureAdvPrefixes(), RoutingTable6::configureInterfaceFromXML(), and IPv6NeighbourDiscovery::processRAPrefixInfoForAddrAutoConf().
{ addresses.push_back(AddressData()); AddressData& a = addresses.back(); a.address = addr; a.tentative = tentative; a.expiryTime = expiryTime; a.prefExpiryTime = prefExpiryTime; choosePreferredAddress(); }
void IPv6InterfaceData::changed1 | ( | ) | [inline, protected] |
void IPv6InterfaceData::choosePreferredAddress | ( | ) | [protected] |
Referenced by assignAddress(), permanentlyAssign(), removeAddress(), and updateMatchingAddressExpiryTimes().
{ // do we have addresses? if (addresses.size()==0) { preferredAddr = IPv6Address(); return; } // FIXME shouldn't we stick to the current preferredAddress if its prefLifetime // hasn't expired yet? // FIXME TBD throw out expired addresses! 0 should be treated as infinity // sort addresses by scope and expiry time, then pick the first one std::sort(addresses.begin(), addresses.end(), addrLess); preferredAddr = addresses[0].address; preferredAddrExpiryTime = addresses[0].expiryTime; }
std::string IPv6InterfaceData::detailedInfo | ( | ) | const |
{ return info(); // TBD this could be improved: multi-line text, etc }
int IPv6InterfaceData::dupAddrDetectTransmits | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::processDADTimeout().
{return nodeVars.dupAddrDetectTransmits;}
int IPv6InterfaceData::findAddress | ( | const IPv6Address & | addr | ) | const [protected] |
Referenced by hasAddress(), isTentativeAddress(), permanentlyAssign(), and removeAddress().
simtime_t IPv6InterfaceData::generateReachableTime | ( | double | MIN_RANDOM_FACTOR, |
double | MAX_RANDOM_FACTOR, | ||
uint | baseReachableTime | ||
) | [virtual] |
This method randomly generates a reachableTime given the MIN_RANDOM_FACTOR MAX_RANDOM_FACTOR and baseReachableTime. Refer to RFC 2461: Section 6.3.2
Referenced by IPv6NeighbourDiscovery::processRAForRouterUpdates().
{
return uniform(MIN_RANDOM_FACTOR, MAX_RANDOM_FACTOR) * baseReachableTime;
}
simtime_t IPv6InterfaceData::generateReachableTime | ( | ) | [virtual] |
Arg-less version.
Referenced by IPv6InterfaceData().
{ return uniform(_getMinRandomFactor(), _getMaxRandomFactor()) * getBaseReachableTime(); }
const IPv6Address & IPv6InterfaceData::getAddress | ( | int | i | ) | const |
Returns ith address of the interface.
Referenced by info(), SCTPAssociation::processInitArrived(), IPv6NeighbourDiscovery::processRAPrefixInfoForAddrAutoConf(), and SCTPAssociation::sendInit().
short IPv6InterfaceData::getAdvCurHopLimit | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::createAndSendRAPacket().
{return rtrVars.advCurHopLimit;}
simtime_t IPv6InterfaceData::getAdvDefaultLifetime | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::createAndSendRAPacket().
{return rtrVars.advDefaultLifetime;}
int IPv6InterfaceData::getAdvLinkMTU | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::createAndSendRAPacket().
{return rtrVars.advLinkMTU;}
bool IPv6InterfaceData::getAdvManagedFlag | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::createAndSendRAPacket().
{return rtrVars.advManagedFlag;}
bool IPv6InterfaceData::getAdvOtherConfigFlag | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::createAndSendRAPacket().
{return rtrVars.advOtherConfigFlag;}
const IPv6InterfaceData::AdvPrefix & IPv6InterfaceData::getAdvPrefix | ( | int | i | ) | const |
Returns the ith advertised prefix on the interface.
Referenced by FlatNetworkConfigurator6::addOwnAdvPrefixRoutes(), FlatNetworkConfigurator6::addStaticRoutes(), IPv6NeighbourDiscovery::createAndSendRAPacket(), info(), and RoutingTable6::initialize().
{ ASSERT(i>=0 && i<(int)rtrVars.advPrefixList.size()); return rtrVars.advPrefixList[i]; }
int IPv6InterfaceData::getAdvReachableTime | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::createAndSendRAPacket().
{return rtrVars.advReachableTime;}
int IPv6InterfaceData::getAdvRetransTimer | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::createAndSendRAPacket().
{return rtrVars.advRetransTimer;}
bool IPv6InterfaceData::getAdvSendAdvertisements | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::createAndSendRAPacket(), IPv6NeighbourDiscovery::createAndSendRSPacket(), IPv6NeighbourDiscovery::initialize(), IPv6NeighbourDiscovery::processDADTimeout(), IPv6NeighbourDiscovery::processRAPacket(), and IPv6NeighbourDiscovery::processRSPacket().
{return rtrVars.advSendAdvertisements;}
uint IPv6InterfaceData::getBaseReachableTime | ( | ) | [inline] |
Referenced by generateReachableTime(), and IPv6InterfaceData().
{return hostVars.baseReachableTime;}
short IPv6InterfaceData::getCurHopLimit | ( | ) | [inline] |
{return hostVars.curHopLimit;}
const IPv6Address & IPv6InterfaceData::getLinkLocalAddress | ( | ) | const |
Returns the first valid link-local address of the interface, or UNSPECIFIED_ADDRESS if there's none.
Referenced by FlatNetworkConfigurator6::addStaticRoutes(), IPv6NeighbourDiscovery::assignLinkLocalAddress(), FlatNetworkConfigurator6::configureAdvPrefixes(), IPv6NeighbourDiscovery::createAndSendRAPacket(), IPv6NeighbourDiscovery::createAndSendRSPacket(), and IPv6NeighbourDiscovery::processRAPrefixInfoForAddrAutoConf().
{ for (AddressDataVector::const_iterator it=addresses.begin(); it!=addresses.end(); it++) if (it->address.isLinkLocal()) // FIXME and valid return it->address; return IPv6Address::UNSPECIFIED_ADDRESS; }
simtime_t IPv6InterfaceData::getMaxRtrAdvInterval | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::createRATimer(), and IPv6NeighbourDiscovery::sendPeriodicRA().
{return rtrVars.maxRtrAdvInterval;}
simtime_t IPv6InterfaceData::getMinRtrAdvInterval | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::createRATimer(), and IPv6NeighbourDiscovery::sendPeriodicRA().
{return rtrVars.minRtrAdvInterval;}
int IPv6InterfaceData::getNumAddresses | ( | ) | const [inline] |
Returns the number of addresses the interface has.
Referenced by info(), IPv6NeighbourDiscovery::processRAPrefixInfoForAddrAutoConf(), and SCTPAssociation::sendInit().
{return addresses.size();}
int IPv6InterfaceData::getNumAdvPrefixes | ( | ) | const [inline] |
Returns the number of advertised prefixes on the interface.
Referenced by FlatNetworkConfigurator6::addOwnAdvPrefixRoutes(), FlatNetworkConfigurator6::addStaticRoutes(), FlatNetworkConfigurator6::configureAdvPrefixes(), IPv6NeighbourDiscovery::createAndSendRAPacket(), info(), and RoutingTable6::initialize().
{return rtrVars.advPrefixList.size();}
const IPv6Address& IPv6InterfaceData::getPreferredAddress | ( | ) | const [inline] |
Chooses a preferred address for the interface and returns it. This is the address that should be used as source address for outgoing datagrams, if one is not explicitly specified.
Selection is based on scope (globally routable addresses are preferred), then on lifetime (the one that expires last is chosen). See private choosePreferredAddress() function.
FIXME turn into preferredGLOBALAddress()!
Referenced by IPv6NeighbourDiscovery::createAndSendRSPacket(), IPAddressResolver::getInterfaceIPv6Address(), IPAddressResolver::getIPv6AddressFrom(), IPv6NeighbourDiscovery::initiateAddressResolution(), IPv6NeighbourDiscovery::processNUDTimeout(), IPv6::routePacket(), and IPv6NeighbourDiscovery::sendSolicitedNA().
{return preferredAddr;} // FIXME TBD check expiry time!
simtime_t IPv6InterfaceData::getReachableTime | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::processRAForRouterUpdates().
{return hostVars.reachableTime;}
uint IPv6InterfaceData::getRetransTimer | ( | ) | [inline] |
Referenced by IPv6NeighbourDiscovery::initiateDAD(), and IPv6NeighbourDiscovery::processDADTimeout().
{return hostVars.retransTimer;}
bool IPv6InterfaceData::hasAddress | ( | const IPv6Address & | addr | ) | const |
Returns true if the given address is one of the addresses assigned, regardless whether it is tentative or not.
Referenced by RoutingTable6::getInterfaceByAddress(), IPv6NeighbourDiscovery::initiateAddressResolution(), RoutingTable6::isLocalAddress(), and IPv6NeighbourDiscovery::processNSPacket().
{ return findAddress(addr)!=-1; }
std::string IPv6InterfaceData::info | ( | ) | const |
Referenced by detailedInfo().
{ // FIXME FIXME FIXME FIXME info() should never print a newline std::ostringstream os; os << "IPv6:{" << endl; for (int i=0; i<getNumAddresses(); i++) { os << (i?"\t , ":"\tAddrs:") << getAddress(i) << "(" << IPv6Address::scopeName(getAddress(i).getScope()) << (isTentativeAddress(i)?" tent":"") << ") " << " expiryTime: " << (addresses[i].expiryTime==0 ? "inf" : SIMTIME_STR(addresses[i].expiryTime)) << " prefExpiryTime: " << (addresses[i].prefExpiryTime==0 ? "inf" : SIMTIME_STR(addresses[i].prefExpiryTime)) << endl; } for (int i=0; i<getNumAdvPrefixes(); i++) { const AdvPrefix& a = getAdvPrefix(i); os << (i?", ":"\tAdvPrefixes: ") << a.prefix << "/" << a.prefixLength << "(" << (a.advOnLinkFlag?"":"off-link ") << (a.advAutonomousFlag?"":"non-auto "); if (a.advValidLifetime==0) os << "lifetime:inf"; else if (a.advValidLifetime>0) os << "expires:" << a.advValidLifetime; else os << "lifetime:+" << (-1 * a.advValidLifetime); os << ")" << endl; } os << " "; // uncomment the following as needed! os << "\tNode:"; os << " dupAddrDetectTrans=" << nodeVars.dupAddrDetectTransmits; //os << " curHopLimit=" << hostVars.curHopLimit; //os << " retransTimer=" << hostVars.retransTimer; //os << " baseReachableTime=" << hostVars.baseReachableTime; os << " reachableTime=" << hostVars.reachableTime << endl; if (rtrVars.advSendAdvertisements) { os << "\tRouter:"; os << " maxRtrAdvInt=" << rtrVars.maxRtrAdvInterval; os << " minRtrAdvInt=" << rtrVars.minRtrAdvInterval << endl; //os << " advManagedFlag=" << rtrVars.advManagedFlag; //os << " advOtherFlag=" << rtrVars.advOtherFlag; //os << " advLinkMTU=" << rtrVars.advLinkMTU; //os << " advReachableTime=" << rtrVars.advReachableTime; //os << " advRetransTimer=" << rtrVars.advRetransTimer; //os << " advCurHopLimit=" << rtrVars.advCurHopLimit; //os << " advDefaultLifetime=" << rtrVars.advDefaultLifetime; } os << " }" << endl; return os.str(); }
bool IPv6InterfaceData::isTentativeAddress | ( | int | i | ) | const |
Returns true if the ith address of the interface is tentative.
Referenced by IPv6NeighbourDiscovery::createAndSendRSPacket(), info(), IPv6NeighbourDiscovery::processNAPacket(), and IPv6NeighbourDiscovery::processNSPacket().
bool IPv6InterfaceData::isTentativeAddress | ( | const IPv6Address & | addr | ) | const |
Returns true if the interface has the given address and it is tentative.
{ int k = findAddress(addr); return k!=-1 && addresses[k].tentative; }
bool IPv6InterfaceData::matchesSolicitedNodeMulticastAddress | ( | const IPv6Address & | solNodeAddr | ) | const |
Returns true if the interface has an address matching the given solicited-node multicast addresses.
Referenced by RoutingTable6::isLocalAddress().
void IPv6InterfaceData::permanentlyAssign | ( | const IPv6Address & | addr | ) | [virtual] |
Clears the "tentative" flag of an existing interface address.
Referenced by IPv6NeighbourDiscovery::processDADTimeout().
{ int k = findAddress(addr); ASSERT(k!=-1); addresses[k].tentative = false; choosePreferredAddress(); }
void IPv6InterfaceData::removeAddress | ( | const IPv6Address & | address | ) | [virtual] |
Removes the address. Called when the valid lifetime expires.
{ int k = findAddress(address); ASSERT(k!=-1); addresses.erase(addresses.begin()+k); choosePreferredAddress(); }
void IPv6InterfaceData::removeAdvPrefix | ( | int | i | ) | [virtual] |
Remove the ith advertised prefix on the interface. Prefixes at larger indices will shift down.
{ ASSERT(i>=0 && i<(int)rtrVars.advPrefixList.size()); rtrVars.advPrefixList.erase(rtrVars.advPrefixList.begin()+i); }
virtual void IPv6InterfaceData::setAdvCurHopLimit | ( | short | d | ) | [inline, virtual] |
{rtrVars.advCurHopLimit = d;}
virtual void IPv6InterfaceData::setAdvDefaultLifetime | ( | simtime_t | d | ) | [inline, virtual] |
{rtrVars.advDefaultLifetime = d;}
virtual void IPv6InterfaceData::setAdvLinkMTU | ( | int | d | ) | [inline, virtual] |
{rtrVars.advLinkMTU = d;}
virtual void IPv6InterfaceData::setAdvManagedFlag | ( | bool | d | ) | [inline, virtual] |
{rtrVars.advManagedFlag = d;}
virtual void IPv6InterfaceData::setAdvOtherConfigFlag | ( | bool | d | ) | [inline, virtual] |
{rtrVars.advOtherConfigFlag = d;}
void IPv6InterfaceData::setAdvPrefix | ( | int | i, |
const AdvPrefix & | advPrefix | ||
) | [virtual] |
Changes the configuration of the ith advertised prefix on the interface. The prefix itself should stay the same.
{ ASSERT(i>=0 && i<(int)rtrVars.advPrefixList.size()); ASSERT(rtrVars.advPrefixList[i].prefix == advPrefix.prefix); ASSERT(rtrVars.advPrefixList[i].prefixLength == advPrefix.prefixLength); rtrVars.advPrefixList[i] = advPrefix; }
virtual void IPv6InterfaceData::setAdvReachableTime | ( | int | d | ) | [inline, virtual] |
{rtrVars.advReachableTime = d;}
virtual void IPv6InterfaceData::setAdvRetransTimer | ( | int | d | ) | [inline, virtual] |
{rtrVars.advRetransTimer = d;}
virtual void IPv6InterfaceData::setAdvSendAdvertisements | ( | bool | d | ) | [inline, virtual] |
Referenced by RoutingTable6::configureInterfaceForIPv6(), and RoutingTable6::configureInterfaceFromXML().
{rtrVars.advSendAdvertisements = d;}
virtual void IPv6InterfaceData::setBaseReachableTime | ( | uint | d | ) | [inline, virtual] |
Referenced by IPv6NeighbourDiscovery::processRAForRouterUpdates().
{hostVars.baseReachableTime = d;}
virtual void IPv6InterfaceData::setCurHopLimit | ( | short | d | ) | [inline, virtual] |
Referenced by IPv6NeighbourDiscovery::processRAForRouterUpdates().
{hostVars.curHopLimit = d;}
virtual void IPv6InterfaceData::setDupAddrDetectTransmits | ( | int | d | ) | [inline, virtual] |
{nodeVars.dupAddrDetectTransmits = d;}
virtual void IPv6InterfaceData::setMaxRtrAdvInterval | ( | simtime_t | d | ) | [inline, virtual] |
{rtrVars.maxRtrAdvInterval = d;}
virtual void IPv6InterfaceData::setMinRtrAdvInterval | ( | simtime_t | d | ) | [inline, virtual] |
{rtrVars.minRtrAdvInterval = d;}
virtual void IPv6InterfaceData::setReachableTime | ( | simtime_t | d | ) | [inline, virtual] |
Referenced by IPv6NeighbourDiscovery::processRAForRouterUpdates().
{hostVars.reachableTime = d;}
virtual void IPv6InterfaceData::setRetransTimer | ( | uint | d | ) | [inline, virtual] |
Referenced by IPv6NeighbourDiscovery::processRAForRouterUpdates().
{hostVars.retransTimer = d;}
void IPv6InterfaceData::updateMatchingAddressExpiryTimes | ( | const IPv6Address & | prefix, |
int | length, | ||
simtime_t | expiryTime = 0 , |
||
simtime_t | prefExpiryTime = 0 |
||
) | [virtual] |
Update expiry times of addresses. Expiry times possibly come from prefixes (with on-link flag set to either zero or one) in Router Advertisements. Zero expiry time means infinity.
{ for (AddressDataVector::iterator it=addresses.begin(); it!=addresses.end(); it++) { if (it->address.matches(prefix,length)) { it->expiryTime = expiryTime; it->prefExpiryTime = prefExpiryTime; } } choosePreferredAddress(); }
AddressDataVector IPv6InterfaceData::addresses [protected] |
Referenced by IPv6InterfaceData().
HostVariables IPv6InterfaceData::hostVars [protected] |
Referenced by info(), and IPv6InterfaceData().
Referenced by IPv6InterfaceData().
NodeVariables IPv6InterfaceData::nodeVars [protected] |
Referenced by info(), and IPv6InterfaceData().
IPv6Address IPv6InterfaceData::preferredAddr [protected] |
Referenced by choosePreferredAddress().
simtime_t IPv6InterfaceData::preferredAddrExpiryTime [protected] |
Referenced by choosePreferredAddress().
Referenced by IPv6InterfaceData().
RouterVariables IPv6InterfaceData::rtrVars [protected] |
Referenced by addAdvPrefix(), getAdvPrefix(), info(), IPv6InterfaceData(), removeAdvPrefix(), and setAdvPrefix().