INET Framework for OMNeT++/OMNEST
inet::IPv6InterfaceData Class Reference

IPv6-specific data for InterfaceEntry. More...

#include <IPv6InterfaceData.h>

Inheritance diagram for inet::IPv6InterfaceData:
inet::InterfaceProtocolData

Classes

struct  AddressData
 
struct  AdvPrefix
 For routers: advertised prefix configuration. More...
 
struct  HomeNetworkInfo
 Zarrar 03.09.07: Home Network Information maintains home network information like the MN's home address (HoA) and the HA's address and its prefix. More...
 
struct  HostConstants
 
struct  HostMulticastData
 
struct  HostVariables
 
struct  NodeConstants
 
struct  NodeVariables
 
struct  RouterConstants
 
struct  RouterMulticastData
 
struct  RouterVariables
 

Public Types

enum  { F_IP_ADDRESS, F_MULTICAST_ADDRESSES, F_MULTICAST_LISTENERS }
 
enum  AddressType { HoA, CoA }
 The enum AddressType defined below and the new member of the struct AddressData {AddressType addrType} is relevant for MN(s) only as the address(es) configured on the MN interface needs to be tagged as either HoA or CoA, based upon the status of the H-Flag recieved in the RA. More...
 
typedef std::vector< IPv6AddressIPv6AddressVector
 

Public Member Functions

bool isDADInProgress ()
 
void setDADInProgress (bool val)
 
 IPv6InterfaceData ()
 
virtual ~IPv6InterfaceData ()
 
std::string info () const override
 
std::string detailedInfo () const override
 
Addresses
virtual void assignAddress (const IPv6Address &addr, bool tentative, simtime_t expiryTime, simtime_t prefExpiryTime, bool hFlag=false)
 Assigns the given address to the interface. More...
 
virtual void updateMatchingAddressExpiryTimes (const IPv6Address &prefix, int length, simtime_t expiryTime=SIMTIME_ZERO, simtime_t prefExpiryTime=SIMTIME_ZERO)
 Update expiry times of addresses. More...
 
int getNumAddresses () const
 Returns the number of addresses the interface has. More...
 
const IPv6AddressgetAddress (int i) const
 Returns ith address of the interface. More...
 
bool isTentativeAddress (int i) const
 Returns true if the ith address of the interface is tentative. More...
 
AddressType getAddressType (int i) const
 Returns the address type (HoA, CoA) of the ith address of the interface. More...
 
AddressType getAddressType (const IPv6Address &addr) const
 Returns the address type (HoA, CoA) of the provided address of the interface. More...
 
bool hasAddress (const IPv6Address &addr) const
 Returns true if the given address is one of the addresses assigned, regardless whether it is tentative or not. More...
 
bool matchesSolicitedNodeMulticastAddress (const IPv6Address &solNodeAddr) const
 Returns true if the interface has an address matching the given solicited-node multicast addresses. More...
 
bool isTentativeAddress (const IPv6Address &addr) const
 Returns true if the interface has the given address and it is tentative. More...
 
virtual void permanentlyAssign (const IPv6Address &addr)
 Clears the "tentative" flag of an existing interface address. More...
 
const IPv6AddressVectorgetJoinedMulticastGroups () const
 
const IPv6AddressVectorgetReportedMulticastGroups () const
 
bool isMemberOfMulticastGroup (const IPv6Address &multicastAddress) const
 
virtual void joinMulticastGroup (const IPv6Address &multicastAddress)
 
virtual void leaveMulticastGroup (const IPv6Address &multicastAddress)
 
bool hasMulticastListener (const IPv6Address &multicastAddress) const
 
virtual void addMulticastListener (const IPv6Address &multicastAddress)
 
virtual void removeMulticastListener (const IPv6Address &multicastAddress)
 
void tentativelyAssign (int i)
 Sets the "tentative" flag of of the ith address of the interface. More...
 
const IPv6AddressgetPreferredAddress () const
 Chooses a preferred address for the interface and returns it. More...
 
const IPv6AddressgetLinkLocalAddress () const
 Returns the first valid link-local address of the interface, or UNSPECIFIED_ADDRESS if there's none. More...
 
virtual void removeAddress (const IPv6Address &address)
 Removes the address. More...
 
simtime_t _getMaxInitialRtrAdvertInterval () const
 Getters/Setters for all variables and constants defined in RFC 2461/2462 can be found here. More...
 
uint _getMaxInitialRtrAdvertisements () const
 
uint _getMaxFinalRtrAdvertisements () const
 
simtime_t _getMinDelayBetweenRAs () const
 
simtime_t _getMaxRADelayTime () const
 
virtual void _setMaxInitialRtrAdvertInterval (simtime_t d)
 
virtual void _setMaxInitialRtrAdvertisements (uint d)
 
virtual void _setMaxFinalRtrAdvertisements (uint d)
 
virtual void _setMinDelayBetweenRAs (simtime_t d)
 
virtual void _setMaxRADelayTime (simtime_t d)
 
simtime_t _getMaxRtrSolicitationDelay () const
 
simtime_t _getRtrSolicitationInterval () const
 
uint _getMaxRtrSolicitations () const
 
simtime_t _getInitialBindAckTimeout () const
 
simtime_t _getMaxBindAckTimeout () const
 
simtime_t _getInitialBindAckTimeoutFirst () const
 
uint _getMaxRRBindingLifeTime () const
 
uint _getMaxHABindingLifeTime () const
 
uint _getMaxTokenLifeTime () const
 
virtual void _setMaxRtrSolicitationDelay (simtime_t d)
 
virtual void _setRtrSolicitationInterval (simtime_t d)
 
virtual void _setMaxRtrSolicitations (uint d)
 
virtual void _setInitialBindAckTimeout (simtime_t d)
 
virtual void _setMaxBindAckTimeout (simtime_t d)
 
virtual void _setInitialBindAckTimeoutFirst (simtime_t d)
 
virtual void _setMaxRRBindingLifeTime (uint d)
 
virtual void _setMaxHABindingLifeTime (uint d)
 
virtual void _setMaxTokenLifeTime (uint d)
 
uint _getMaxMulticastSolicit () const
 
uint _getMaxUnicastSolicit () const
 
simtime_t _getMaxAnycastDelayTime () const
 
uint _getMaxNeighbourAdvertisement () const
 
simtime_t _getReachableTime () const
 
simtime_t _getRetransTimer () const
 
simtime_t _getDelayFirstProbeTime () const
 
double _getMinRandomFactor () const
 
double _getMaxRandomFactor () const
 
virtual void _setMaxMulticastSolicit (uint d)
 
virtual void _setMaxUnicastSolicit (uint d)
 
virtual void _setMaxAnycastDelayTime (simtime_t d)
 
virtual void _setMaxNeighbourAdvertisement (uint d)
 
virtual void _setReachableTime (simtime_t d)
 
virtual void _setRetransTimer (simtime_t d)
 
virtual void _setDelayFirstProbeTime (simtime_t d)
 
virtual void _setMinRandomFactor (double d)
 
virtual void _setMaxRandomFactor (double d)
 
int getDupAddrDetectTransmits () const
 
virtual void setDupAddrDetectTransmits (int d)
 
uint getLinkMTU () const
 
short getCurHopLimit () const
 
uint getBaseReachableTime () const
 
simtime_t getReachableTime () const
 
uint getRetransTimer () const
 
virtual void setLinkMTU (uint d)
 
virtual void setCurHopLimit (short d)
 
virtual void setBaseReachableTime (uint d)
 
virtual void setReachableTime (simtime_t d)
 
virtual void setRetransTimer (uint d)
 
bool getAdvSendAdvertisements () const
 
simtime_t getMaxRtrAdvInterval () const
 
simtime_t getMinRtrAdvInterval () const
 
bool getAdvManagedFlag () const
 
bool getAdvOtherConfigFlag () const
 
bool getAdvHomeAgentFlag () const
 
int getAdvLinkMTU () const
 
int getAdvReachableTime () const
 
int getAdvRetransTimer () const
 
short getAdvCurHopLimit () const
 
simtime_t getAdvDefaultLifetime () const
 
virtual void setAdvSendAdvertisements (bool d)
 
virtual void setMaxRtrAdvInterval (simtime_t d)
 
virtual void setMinRtrAdvInterval (simtime_t d)
 
virtual void setAdvManagedFlag (bool d)
 
virtual void setAdvOtherConfigFlag (bool d)
 
virtual void setAdvHomeAgentFlag (bool d)
 
virtual void setAdvLinkMTU (int d)
 
virtual void setAdvReachableTime (int d)
 
virtual void setAdvRetransTimer (int d)
 
virtual void setAdvCurHopLimit (short d)
 
virtual void setAdvDefaultLifetime (simtime_t d)
 
- Public Member Functions inherited from inet::InterfaceProtocolData
 InterfaceProtocolData ()
 
InterfaceEntrygetInterfaceEntry () const
 Returns the InterfaceEntry that contains this data object, or nullptr. More...
 

Public Attributes

RouterConstants routerConstants
 
HostConstants hostConstants
 
NodeConstants nodeConstants
 

Protected Types

typedef std::vector< AddressDataAddressDataVector
 
typedef std::vector< AdvPrefixAdvPrefixList
 

Protected Member Functions

int findAddress (const IPv6Address &addr) const
 
void choosePreferredAddress ()
 
void changed1 (int fieldId)
 
HostMulticastDatagetHostData ()
 
const HostMulticastDatagetHostData () const
 
RouterMulticastDatagetRouterData ()
 
const RouterMulticastDatagetRouterData () const
 
- Protected Member Functions inherited from inet::InterfaceProtocolData
virtual void changed (simsignal_t signalID, int fieldId)
 

Static Protected Member Functions

static bool addrLess (const AddressData &a, const AddressData &b)
 

Protected Attributes

HostMulticastDatahostMcastData = nullptr
 
RouterMulticastDatarouterMcastData = nullptr
 
HomeNetworkInfo homeInfo
 
bool dadInProgress = false
 
AddressDataVector addresses
 
IPv6Address preferredAddr
 
simtime_t preferredAddrExpiryTime
 
NodeVariables nodeVars
 
HostVariables hostVars
 
RouterVariables rtrVars
 
- Protected Attributes inherited from inet::InterfaceProtocolData
InterfaceEntryownerp = nullptr
 

Friends

std::ostream & operator<< (std::ostream &os, const HomeNetworkInfo &homeNetInfo)
 

Router advertised prefixes

IPv6RoutingTablert6 = nullptr
 
virtual void addAdvPrefix (const AdvPrefix &advPrefix)
 Adds the given advertised prefix to the interface. More...
 
int getNumAdvPrefixes () const
 Returns the number of advertised prefixes on the interface. More...
 
const AdvPrefixgetAdvPrefix (int i) const
 Returns the ith advertised prefix on the interface. More...
 
virtual void setAdvPrefix (int i, const AdvPrefix &advPrefix)
 Changes the configuration of the ith advertised prefix on the interface. More...
 
virtual void removeAdvPrefix (int i)
 Remove the ith advertised prefix on the interface. More...
 
virtual simtime_t generateReachableTime (double MIN_RANDOM_FACTOR, double MAX_RANDOM_FACTOR, uint baseReachableTime)
 This method randomly generates a reachableTime given the MIN_RANDOM_FACTOR MAX_RANDOM_FACTOR and baseReachableTime. More...
 
virtual simtime_t generateReachableTime ()
 Arg-less version. More...
 
const IPv6AddressgetGlobalAddress (AddressType type=HoA) const
 Returns the first valid global address of the interface, or UNSPECIFIED_ADDRESS if there's none. More...
 
const IPv6Address autoConfRouterGlobalScopeAddress (int i)
 This function autoconfigures a global scope address for the router only, if and only the prefix is provided via some exernal method, For instance FlatNetworkConfigurator6 assigning prefixes to routers interfaces during initialization. More...
 
void autoConfRouterGlobalScopeAddress (AdvPrefix &p)
 
void deduceAdvPrefix ()
 
void updateHomeNetworkInfo (const IPv6Address &hoa, const IPv6Address &ha, const IPv6Address &prefix, const int prefixLength)
 03.09.07 This updates the struct HomeNetwork Info with the MN's Home Address(HoA), the global scope address of the MNs Home Agent (HA) and the home network prefix. More...
 
const IPv6AddressgetHomeAgentAddress () const
 
const IPv6AddressgetMNHomeAddress () const
 
const IPv6AddressgetMNPrefix () const
 
IPv6Address removeAddress (IPv6InterfaceData::AddressType type)
 Removes a CoA address from the interface if one exists. More...
 

Detailed Description

IPv6-specific data for InterfaceEntry.

Most of this comes from section 6.2.1 of RFC 2461 (IPv6 Neighbor Discovery, Router Configuration Variables).

Member Typedef Documentation

typedef std::vector<AdvPrefix> inet::IPv6InterfaceData::AdvPrefixList
protected

Member Enumeration Documentation

anonymous enum
Enumerator
F_IP_ADDRESS 
F_MULTICAST_ADDRESSES 
F_MULTICAST_LISTENERS 
112 { F_IP_ADDRESS, F_MULTICAST_ADDRESSES, F_MULTICAST_LISTENERS }; //FIXME missed field IDs and missed notifications in setter functions
Definition: IPv6InterfaceData.h:112
Definition: IPv6InterfaceData.h:112
Definition: IPv6InterfaceData.h:112

The enum AddressType defined below and the new member of the struct AddressData {AddressType addrType} is relevant for MN(s) only as the address(es) configured on the MN interface needs to be tagged as either HoA or CoA, based upon the status of the H-Flag recieved in the RA.

This is

Enumerator
HoA 
CoA 
211 { HoA, CoA }; // to tag a MN's address as Home-Address or Care-of-Address. Zarrar Yousaf 20.07.07
Definition: IPv6InterfaceData.h:211
Definition: IPv6InterfaceData.h:211

Constructor & Destructor Documentation

inet::IPv6InterfaceData::IPv6InterfaceData ( )
82 {
83 #ifdef WITH_xMIPv6
84  // rt6 = IPv6RoutingTableAccess().get();
85 #endif /* WITH_xMIPv6 */
86  /*******************Setting host/node/router Protocol Constants************/
92 
96 
97 #ifdef WITH_xMIPv6
98  hostConstants.initialBindAckTimeout = MIPv6_INITIAL_BINDACK_TIMEOUT; //MIPv6: added by Zarrar Yousaf @ CNI UniDo 17.06.07
99  hostConstants.maxBindAckTimeout = MIPv6_MAX_BINDACK_TIMEOUT; //MIPv6: added by Zarrar Yousaf @ CNI UniDo 17.06.07
104 #endif /* WITH_xMIPv6 */
105 
115 
116  /*******************Setting host/node/router variables*********************/
118 
120  hostVars.curHopLimit = IPv6_DEFAULT_ADVCURHOPLIMIT; //value specified in RFC 1700-can't find it
125 
126  //rtrVars.advSendAdvertisements is set in IPv6RoutingTable.cc:line 143
129  rtrVars.advManagedFlag = false;
130  rtrVars.advOtherConfigFlag = false;
131 
132 #ifdef WITH_xMIPv6
133  rtrVars.advHomeAgentFlag = false; //Zarrar Yousaf Feb-March 2007
134 #endif /* WITH_xMIPv6 */
135 
141 
142 #if USE_MOBILITY
143  if (rtrVars.advDefaultLifetime < 1)
145 #endif // if USE_MOBILITY
146 }
uint maxTokenLifeTime
Definition: IPv6InterfaceData.h:185
uint linkMTU
The MTU of the link.
Definition: IPv6InterfaceData.h:295
uint getBaseReachableTime() const
Definition: IPv6InterfaceData.h:661
int advLinkMTU
The value to be placed in MTU options sent by the router.
Definition: IPv6InterfaceData.h:385
bool advManagedFlag
The TRUE/FALSE value to be placed in the "Managed address configuration" flag field in the Router Adv...
Definition: IPv6InterfaceData.h:360
short advCurHopLimit
The default value to be placed in the Cur Hop Limit field in the Router Advertisement messages sent b...
Definition: IPv6InterfaceData.h:412
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
#define IPv6_MAX_INITIAL_RTR_ADVERTISEMENTS
Definition: IPv6InterfaceData.h:49
int maxRtrSolicitations
Definition: IPv6InterfaceData.h:177
#define IPv6_DEFAULT_ADVCURHOPLIMIT
Definition: IPv6InterfaceData.h:39
simtime_t maxRtrAdvInterval
The maximum time allowed between sending unsolicited multicast Router Advertisements from the interfa...
Definition: IPv6InterfaceData.h:345
#define IPv6_DEFAULT_ADV_REACHABLE_TIME
Definition: IPv6InterfaceData.h:42
simtime_t reachableTime
Definition: IPv6InterfaceData.h:196
virtual simtime_t generateReachableTime()
Arg-less version.
Definition: IPv6InterfaceData.cc:448
#define MIPv6_INITIAL_BINDACK_TIMEOUT_FIRST
Definition: IPv6InterfaceData.h:84
#define IPv6_MAX_RA_DELAY_TIME
Definition: IPv6InterfaceData.h:52
#define MIPv6_MAX_HA_BINDING_LIFETIME
Definition: IPv6InterfaceData.h:86
bool advOtherConfigFlag
The TRUE/FALSE value to be placed in the "Other stateful configuration" flag field in the Router Adve...
Definition: IPv6InterfaceData.h:367
simtime_t maxRtrSolicitationDelay
Definition: IPv6InterfaceData.h:175
#define IPv6_RETRANS_TIMER
Definition: IPv6InterfaceData.h:65
#define MIPv6_MAX_BINDACK_TIMEOUT
Definition: IPv6InterfaceData.h:77
simtime_t retransTimer
Definition: IPv6InterfaceData.h:197
uint maxInitialRtrAdvertisements
Definition: IPv6InterfaceData.h:166
#define IPv6_MAX_RANDOM_FACTOR
Definition: IPv6InterfaceData.h:68
NodeVariables nodeVars
Definition: IPv6InterfaceData.h:284
HostVariables hostVars
Definition: IPv6InterfaceData.h:324
simtime_t initialBindAckTimeoutFirst
Definition: IPv6InterfaceData.h:182
#define IPv6_MAX_INITIAL_RTR_ADVERT_INTERVAL
Definition: IPv6InterfaceData.h:48
#define MIPv6_INITIAL_BINDACK_TIMEOUT
Definition: IPv6InterfaceData.h:74
#define IPv6_MAX_RTR_SOLICITATIONS
Definition: IPv6InterfaceData.h:57
#define IPv6_MAX_RTR_SOLICITATION_DELAY
Definition: IPv6InterfaceData.h:55
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
#define IPv6_MIN_MTU
Definition: IPv6InterfaceData.h:38
int advReachableTime
The value to be placed in the Reachable Time field in the Router Advertisement messages sent by the r...
Definition: IPv6InterfaceData.h:394
simtime_t delayFirstProbeTime
Definition: IPv6InterfaceData.h:198
uint maxMulticastSolicit
Definition: IPv6InterfaceData.h:192
#define MIPv6_MAX_TOKEN_LIFETIME
Definition: IPv6InterfaceData.h:79
#define IPv6_MAX_NEIGHBOUR_ADVERTISEMENT
Definition: IPv6InterfaceData.h:63
uint maxRRBindingLifeTime
Definition: IPv6InterfaceData.h:183
simtime_t advDefaultLifetime
The value to be placed in the Router Lifetime field of Router Advertisements sent from the interface...
Definition: IPv6InterfaceData.h:421
simtime_t reachableTime
The time a neighbor is considered reachable after receiving a reachability confirmation.
Definition: IPv6InterfaceData.h:315
simtime_t minRtrAdvInterval
The minimum time allowed between sending unsolicited multicast Router Advertisements from the interfa...
Definition: IPv6InterfaceData.h:353
simtime_t maxInitialRtrAdvertInterval
Definition: IPv6InterfaceData.h:165
uint retransTimer
The time between retransmissions of Neighbor Solicitation messages to a neighbor when resolving the a...
Definition: IPv6InterfaceData.h:322
double _getMinRandomFactor() const
Definition: IPv6InterfaceData.h:638
double minRandomFactor
Definition: IPv6InterfaceData.h:199
simtime_t maxRADelayTime
Definition: IPv6InterfaceData.h:169
uint maxNeighbourAdvertisement
Definition: IPv6InterfaceData.h:195
uint baseReachableTime
A base value used for computing the random ReachableTime value.
Definition: IPv6InterfaceData.h:306
#define IPv6_MAX_FINAL_RTR_ADVERTISEMENTS
Definition: IPv6InterfaceData.h:50
uint maxUnicastSolicit
Definition: IPv6InterfaceData.h:193
RouterConstants routerConstants
Definition: IPv6InterfaceData.h:171
bool advHomeAgentFlag
The TRUE/FALSE value to be placed in the "Home Agent" flag field in the Router Advertisement.
Definition: IPv6InterfaceData.h:376
#define IPv6_RTR_SOLICITATION_INTERVAL
Definition: IPv6InterfaceData.h:56
#define IPv6_MAX_UNICAST_SOLICIT
Definition: IPv6InterfaceData.h:61
simtime_t rtrSolicitationInterval
Definition: IPv6InterfaceData.h:176
int dupAddrDetectTransmits
The number of consecutive Neighbor Solicitation messages sent while performing Duplicate Address Dete...
Definition: IPv6InterfaceData.h:282
#define IPv6_DEFAULT_ADV_RETRANS_TIMER
Definition: IPv6InterfaceData.h:43
uint maxFinalRtrAdvertisements
Definition: IPv6InterfaceData.h:167
double maxRandomFactor
Definition: IPv6InterfaceData.h:200
simtime_t minDelayBetweenRAs
Definition: IPv6InterfaceData.h:168
short curHopLimit
The default hop limit to be used when sending (unicast) IP packets.
Definition: IPv6InterfaceData.h:301
#define IPv6_MIN_RANDOM_FACTOR
Definition: IPv6InterfaceData.h:67
#define MIPv6_MAX_RR_BINDING_LIFETIME
Definition: IPv6InterfaceData.h:85
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
double _getMaxRandomFactor() const
Definition: IPv6InterfaceData.h:639
uint initialBindAckTimeout
Definition: IPv6InterfaceData.h:180
#define IPv6_DEFAULT_MAX_RTR_ADV_INT
Definition: IPv6InterfaceData.h:41
simtime_t maxAnycastDelayTime
Definition: IPv6InterfaceData.h:194
uint maxBindAckTimeout
Definition: IPv6InterfaceData.h:181
int advRetransTimer
The value to be placed in the Retrans Timer field in the Router Advertisement messages sent by the ro...
Definition: IPv6InterfaceData.h:402
#define IPv6_DELAY_FIRST_PROBE_TIME
Definition: IPv6InterfaceData.h:66
#define IPv6_MAX_MULTICAST_SOLICIT
Definition: IPv6InterfaceData.h:60
#define IPv6_MAX_ANYCAST_DELAY_TIME
Definition: IPv6InterfaceData.h:62
#define IPv6_DEFAULT_DUPADDRDETECTTRANSMITS
Definition: IPv6InterfaceData.h:36
#define IPv6_MIN_DELAY_BETWEEN_RAS
Definition: IPv6InterfaceData.h:51
uint maxHABindingLifeTime
Definition: IPv6InterfaceData.h:184
#define IPv6_REACHABLE_TIME
Definition: IPv6InterfaceData.h:64
inet::IPv6InterfaceData::~IPv6InterfaceData ( )
virtual
149 {
150  delete hostMcastData;
151  delete routerMcastData;
152 }
HostMulticastData * hostMcastData
Definition: IPv6InterfaceData.h:132
RouterMulticastData * routerMcastData
Definition: IPv6InterfaceData.h:133

Member Function Documentation

simtime_t inet::IPv6InterfaceData::_getDelayFirstProbeTime ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::initiateNeighbourUnreachabilityDetection().

simtime_t delayFirstProbeTime
Definition: IPv6InterfaceData.h:198
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
simtime_t inet::IPv6InterfaceData::_getInitialBindAckTimeout ( ) const
inline

Referenced by inet::xMIPv6::createBUTimer(), inet::xMIPv6::createTestInitTimer(), and inet::xMIPv6::resetBUIfEntry().

607 { return hostConstants.initialBindAckTimeout; } //MIPv6: added by Zarrar Yousaf @ CNI UniDo 17.06.07
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
uint initialBindAckTimeout
Definition: IPv6InterfaceData.h:180
simtime_t inet::IPv6InterfaceData::_getInitialBindAckTimeoutFirst ( ) const
inline

Referenced by inet::xMIPv6::createBUTimer().

609 { return hostConstants.initialBindAckTimeoutFirst; } //MIPv6, 12.9.07 - CB
simtime_t initialBindAckTimeoutFirst
Definition: IPv6InterfaceData.h:182
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
simtime_t inet::IPv6InterfaceData::_getMaxAnycastDelayTime ( ) const
inline
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
simtime_t maxAnycastDelayTime
Definition: IPv6InterfaceData.h:194
simtime_t inet::IPv6InterfaceData::_getMaxBindAckTimeout ( ) const
inline

Referenced by inet::xMIPv6::sendPeriodicBU(), and inet::xMIPv6::sendTestInit().

608 { return hostConstants.maxBindAckTimeout; } //MIPv6: added by Zarrar Yousaf @ CNI UniDo 17.06.07
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
uint maxBindAckTimeout
Definition: IPv6InterfaceData.h:181
uint inet::IPv6InterfaceData::_getMaxFinalRtrAdvertisements ( ) const
inline
RouterConstants routerConstants
Definition: IPv6InterfaceData.h:171
uint maxFinalRtrAdvertisements
Definition: IPv6InterfaceData.h:167
uint inet::IPv6InterfaceData::_getMaxHABindingLifeTime ( ) const
inline

Referenced by inet::xMIPv6::createBUTimer().

611 { return hostConstants.maxHABindingLifeTime; } //MIPv6, 14.9.07 - CB
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
uint maxHABindingLifeTime
Definition: IPv6InterfaceData.h:184
simtime_t inet::IPv6InterfaceData::_getMaxInitialRtrAdvertInterval ( ) const
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 inet::IPv6NeighbourDiscovery::sendPeriodicRA().

simtime_t maxInitialRtrAdvertInterval
Definition: IPv6InterfaceData.h:165
RouterConstants routerConstants
Definition: IPv6InterfaceData.h:171
uint inet::IPv6InterfaceData::_getMaxInitialRtrAdvertisements ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::sendPeriodicRA().

uint maxInitialRtrAdvertisements
Definition: IPv6InterfaceData.h:166
RouterConstants routerConstants
Definition: IPv6InterfaceData.h:171
uint inet::IPv6InterfaceData::_getMaxMulticastSolicit ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::processARTimeout().

uint maxMulticastSolicit
Definition: IPv6InterfaceData.h:192
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
uint inet::IPv6InterfaceData::_getMaxNeighbourAdvertisement ( ) const
inline
uint maxNeighbourAdvertisement
Definition: IPv6InterfaceData.h:195
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
simtime_t inet::IPv6InterfaceData::_getMaxRADelayTime ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::processRSPacket().

simtime_t maxRADelayTime
Definition: IPv6InterfaceData.h:169
RouterConstants routerConstants
Definition: IPv6InterfaceData.h:171
double inet::IPv6InterfaceData::_getMaxRandomFactor ( ) const
inline

Referenced by generateReachableTime(), and IPv6InterfaceData().

639 { return nodeConstants.maxRandomFactor; }
double maxRandomFactor
Definition: IPv6InterfaceData.h:200
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
uint inet::IPv6InterfaceData::_getMaxRRBindingLifeTime ( ) const
inline

Referenced by inet::xMIPv6::createBUTimer().

610 { return hostConstants.maxRRBindingLifeTime; } //MIPv6, 14.9.07 - CB
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
uint maxRRBindingLifeTime
Definition: IPv6InterfaceData.h:183
simtime_t inet::IPv6InterfaceData::_getMaxRtrSolicitationDelay ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::makeTentativeAddressPermanent(), and inet::IPv6NeighbourDiscovery::processRDTimeout().

simtime_t maxRtrSolicitationDelay
Definition: IPv6InterfaceData.h:175
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
uint inet::IPv6InterfaceData::_getMaxRtrSolicitations ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::processRDTimeout().

int maxRtrSolicitations
Definition: IPv6InterfaceData.h:177
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
uint inet::IPv6InterfaceData::_getMaxTokenLifeTime ( ) const
inline
uint inet::IPv6InterfaceData::_getMaxUnicastSolicit ( ) const
inline
uint maxUnicastSolicit
Definition: IPv6InterfaceData.h:193
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
simtime_t inet::IPv6InterfaceData::_getMinDelayBetweenRAs ( ) const
inline
RouterConstants routerConstants
Definition: IPv6InterfaceData.h:171
simtime_t minDelayBetweenRAs
Definition: IPv6InterfaceData.h:168
double inet::IPv6InterfaceData::_getMinRandomFactor ( ) const
inline

Referenced by generateReachableTime(), and IPv6InterfaceData().

638 { return nodeConstants.minRandomFactor; }
double minRandomFactor
Definition: IPv6InterfaceData.h:199
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
simtime_t inet::IPv6InterfaceData::_getReachableTime ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::processNAForIncompleteNCEState(), and inet::IPv6NeighbourDiscovery::processNAForOtherNCEStates().

635 { return nodeConstants.reachableTime; }
simtime_t reachableTime
Definition: IPv6InterfaceData.h:196
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
simtime_t inet::IPv6InterfaceData::_getRetransTimer ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::initiateAddressResolution(), and inet::IPv6NeighbourDiscovery::processARTimeout().

636 { return nodeConstants.retransTimer; }
simtime_t retransTimer
Definition: IPv6InterfaceData.h:197
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
simtime_t inet::IPv6InterfaceData::_getRtrSolicitationInterval ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::initiateRouterDiscovery(), and inet::IPv6NeighbourDiscovery::processRDTimeout().

HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
simtime_t rtrSolicitationInterval
Definition: IPv6InterfaceData.h:176
virtual void inet::IPv6InterfaceData::_setDelayFirstProbeTime ( simtime_t  d)
inlinevirtual
simtime_t delayFirstProbeTime
Definition: IPv6InterfaceData.h:198
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
virtual void inet::IPv6InterfaceData::_setInitialBindAckTimeout ( simtime_t  d)
inlinevirtual
621 { hostConstants.initialBindAckTimeout = SIMTIME_DBL(d); }
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
uint initialBindAckTimeout
Definition: IPv6InterfaceData.h:180
virtual void inet::IPv6InterfaceData::_setInitialBindAckTimeoutFirst ( simtime_t  d)
inlinevirtual
simtime_t initialBindAckTimeoutFirst
Definition: IPv6InterfaceData.h:182
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
virtual void inet::IPv6InterfaceData::_setMaxAnycastDelayTime ( simtime_t  d)
inlinevirtual
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
simtime_t maxAnycastDelayTime
Definition: IPv6InterfaceData.h:194
virtual void inet::IPv6InterfaceData::_setMaxBindAckTimeout ( simtime_t  d)
inlinevirtual
622 { hostConstants.maxBindAckTimeout = SIMTIME_DBL(d); }
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
uint maxBindAckTimeout
Definition: IPv6InterfaceData.h:181
virtual void inet::IPv6InterfaceData::_setMaxFinalRtrAdvertisements ( uint  d)
inlinevirtual
RouterConstants routerConstants
Definition: IPv6InterfaceData.h:171
uint maxFinalRtrAdvertisements
Definition: IPv6InterfaceData.h:167
virtual void inet::IPv6InterfaceData::_setMaxHABindingLifeTime ( uint  d)
inlinevirtual
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
uint maxHABindingLifeTime
Definition: IPv6InterfaceData.h:184
virtual void inet::IPv6InterfaceData::_setMaxInitialRtrAdvertInterval ( simtime_t  d)
inlinevirtual
simtime_t maxInitialRtrAdvertInterval
Definition: IPv6InterfaceData.h:165
RouterConstants routerConstants
Definition: IPv6InterfaceData.h:171
virtual void inet::IPv6InterfaceData::_setMaxInitialRtrAdvertisements ( uint  d)
inlinevirtual
uint maxInitialRtrAdvertisements
Definition: IPv6InterfaceData.h:166
RouterConstants routerConstants
Definition: IPv6InterfaceData.h:171
virtual void inet::IPv6InterfaceData::_setMaxMulticastSolicit ( uint  d)
inlinevirtual
uint maxMulticastSolicit
Definition: IPv6InterfaceData.h:192
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
virtual void inet::IPv6InterfaceData::_setMaxNeighbourAdvertisement ( uint  d)
inlinevirtual
uint maxNeighbourAdvertisement
Definition: IPv6InterfaceData.h:195
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
virtual void inet::IPv6InterfaceData::_setMaxRADelayTime ( simtime_t  d)
inlinevirtual
simtime_t maxRADelayTime
Definition: IPv6InterfaceData.h:169
RouterConstants routerConstants
Definition: IPv6InterfaceData.h:171
virtual void inet::IPv6InterfaceData::_setMaxRandomFactor ( double  d)
inlinevirtual
double maxRandomFactor
Definition: IPv6InterfaceData.h:200
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
virtual void inet::IPv6InterfaceData::_setMaxRRBindingLifeTime ( uint  d)
inlinevirtual
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
uint maxRRBindingLifeTime
Definition: IPv6InterfaceData.h:183
virtual void inet::IPv6InterfaceData::_setMaxRtrSolicitationDelay ( simtime_t  d)
inlinevirtual
simtime_t maxRtrSolicitationDelay
Definition: IPv6InterfaceData.h:175
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
virtual void inet::IPv6InterfaceData::_setMaxRtrSolicitations ( uint  d)
inlinevirtual
int maxRtrSolicitations
Definition: IPv6InterfaceData.h:177
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
virtual void inet::IPv6InterfaceData::_setMaxTokenLifeTime ( uint  d)
inlinevirtual
uint maxTokenLifeTime
Definition: IPv6InterfaceData.h:185
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
virtual void inet::IPv6InterfaceData::_setMaxUnicastSolicit ( uint  d)
inlinevirtual
uint maxUnicastSolicit
Definition: IPv6InterfaceData.h:193
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
virtual void inet::IPv6InterfaceData::_setMinDelayBetweenRAs ( simtime_t  d)
inlinevirtual
RouterConstants routerConstants
Definition: IPv6InterfaceData.h:171
simtime_t minDelayBetweenRAs
Definition: IPv6InterfaceData.h:168
virtual void inet::IPv6InterfaceData::_setMinRandomFactor ( double  d)
inlinevirtual
double minRandomFactor
Definition: IPv6InterfaceData.h:199
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
virtual void inet::IPv6InterfaceData::_setReachableTime ( simtime_t  d)
inlinevirtual
simtime_t reachableTime
Definition: IPv6InterfaceData.h:196
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
virtual void inet::IPv6InterfaceData::_setRetransTimer ( simtime_t  d)
inlinevirtual
simtime_t retransTimer
Definition: IPv6InterfaceData.h:197
NodeConstants nodeConstants
Definition: IPv6InterfaceData.h:202
virtual void inet::IPv6InterfaceData::_setRtrSolicitationInterval ( simtime_t  d)
inlinevirtual
HostConstants hostConstants
Definition: IPv6InterfaceData.h:188
simtime_t rtrSolicitationInterval
Definition: IPv6InterfaceData.h:176
void inet::IPv6InterfaceData::addAdvPrefix ( const AdvPrefix advPrefix)
virtual

Adds the given advertised prefix to the interface.

Referenced by inet::FlatNetworkConfigurator6::configureAdvPrefixes(), and inet::IPv6RoutingTable::configureInterfaceFromXML().

418 {
419  rtrVars.advPrefixList.push_back(advPrefix);
420 }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
AdvPrefixList advPrefixList
Definition: IPv6InterfaceData.h:427
void inet::IPv6InterfaceData::addMulticastListener ( const IPv6Address multicastAddress)
virtual
518 {
519  if (!multicastAddress.isMulticast())
520  throw cRuntimeError("IPv6InterfaceData::addMulticastListener(): multicast address expected, received %s.", multicastAddress.str().c_str());
521 
522  if (!hasMulticastListener(multicastAddress)) {
523  getRouterData()->reportedMulticastGroups.push_back(multicastAddress);
525  }
526 }
void changed1(int fieldId)
Definition: IPv6InterfaceData.h:435
Definition: IPv6InterfaceData.h:112
bool hasMulticastListener(const IPv6Address &multicastAddress) const
Definition: IPv6InterfaceData.cc:511
RouterMulticastData * getRouterData()
Definition: IPv6InterfaceData.h:438
IPv6AddressVector reportedMulticastGroups
multicast groups that have listeners on the link connected to this interface
Definition: IPv6InterfaceData.h:126
bool inet::IPv6InterfaceData::addrLess ( const AddressData a,
const AddressData b 
)
staticprotected

Referenced by choosePreferredAddress().

372 {
373  // This method is used in choosePreferredAddress().
374  // sort() produces increasing order, so "better" addresses should
375  // compare as "less", to make them appear first in the array
376  if (a.tentative != b.tentative)
377  return !a.tentative; // tentative=false is better
378  if (a.address.getScope() != b.address.getScope())
379  return a.address.getScope() > b.address.getScope(); // bigger scope is better
380 
381 #ifdef WITH_xMIPv6
382  // FIXME check a.address.isGlobal() != b.address.isGlobal()
383 
384  if (a.address.isGlobal() && b.address.isGlobal() && a.addrType != b.addrType)
385  return a.addrType == CoA; // HoA is better than CoA, 24.9.07 - CB
386 #endif /* WITH_xMIPv6 */
387 
388  return (a.expiryTime == SIMTIME_ZERO && b.expiryTime != SIMTIME_ZERO) || a.expiryTime > b.expiryTime; // longer expiry time is better
389 }
Definition: IPv6InterfaceData.h:211
value< double, units::m > b
Definition: Units.h:1054
void inet::IPv6InterfaceData::assignAddress ( const IPv6Address addr,
bool  tentative,
simtime_t  expiryTime,
simtime_t  prefExpiryTime,
bool  hFlag = false 
)
virtual

Assigns the given address to the interface.

WITH_xMIPv6: Also takes into account the status of the H-Flag in the recieved RA. Called from IPv6NeighbourDiscovery::processRAPrefixInfoForAddrAutoConf( IPv6NDPrefixInformation& prefixInfo, InterfaceEntry* ie, bool hFlag). Relevant only when MIPv6 is supported. (Zarrar Yousaf 20.07.07)

Referenced by inet::UDP::addMulticastAddressToInterface(), inet::IPv6NeighbourDiscovery::assignLinkLocalAddress(), inet::IPv6RoutingTable::assignRequiredNodeAddresses(), inet::FlatNetworkConfigurator6::configureAdvPrefixes(), inet::IPv6RoutingTable::configureInterfaceFromXML(), deduceAdvPrefix(), detailedInfo(), inet::IPv6NeighbourDiscovery::makeTentativeAddressPermanent(), inet::IPv6NeighbourDiscovery::processRAPrefixInfo(), inet::IPv6NeighbourDiscovery::processRAPrefixInfoForAddrAutoConf(), and updateHomeNetworkInfo().

247 {
248  addresses.push_back(AddressData());
249  AddressData& a = addresses.back();
250  a.address = addr;
251  a.tentative = tentative;
252  a.expiryTime = expiryTime;
253  a.prefExpiryTime = prefExpiryTime;
254 
255 #ifdef WITH_xMIPv6
256  if (addr.isGlobal()) { //only tag a global scope address as HoA or CoA, depending on the status of the H-Flag
257  if (hFlag == true)
258  a.addrType = HoA; //if H-Flag is set then the auto-conf address is the Home address -.....
259  else
260  a.addrType = CoA; // else it is a care of address (CoA)
261  }
262  // FIXME else a.addrType = ???;
263 #endif /* WITH_xMIPv6 */
264 
267 }
Definition: IPv6InterfaceData.h:112
AddressDataVector addresses
Definition: IPv6InterfaceData.h:256
Definition: IPv6InterfaceData.h:211
void changed1(int fieldId)
Definition: IPv6InterfaceData.h:435
void choosePreferredAddress()
Definition: IPv6InterfaceData.cc:391
Definition: IPv6InterfaceData.h:211
const IPv6Address inet::IPv6InterfaceData::autoConfRouterGlobalScopeAddress ( int  i)

This function autoconfigures a global scope address for the router only, if and only the prefix is provided via some exernal method, For instance FlatNetworkConfigurator6 assigning prefixes to routers interfaces during initialization.

Referenced by deduceAdvPrefix(), and inet::IPv6NeighbourDiscovery::makeTentativeAddressPermanent().

559 {
560  AdvPrefix& p = rtrVars.advPrefixList[i];
561  IPv6Address prefix = p.prefix;
562  short length = p.prefixLength;
563  IPv6Address linkLocalAddr = getLinkLocalAddress();
564  IPv6Address globalAddress = linkLocalAddr.setPrefix(prefix, length); //the global address gets autoconfigured, given its prefix, which during initialisation is supplied by the FlatnetworkConfigurator6
565  p.rtrAddress = globalAddress; //the newly formed global address from the respective adv prefix is stored in the AdvPrefix list, which will be used later by the RA prefix info option
566  return globalAddress;
567 }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
const IPv6Address & getLinkLocalAddress() const
Returns the first valid link-local address of the interface, or UNSPECIFIED_ADDRESS if there&#39;s none...
Definition: IPv6InterfaceData.cc:353
AdvPrefixList advPrefixList
Definition: IPv6InterfaceData.h:427
void inet::IPv6InterfaceData::autoConfRouterGlobalScopeAddress ( AdvPrefix p)
570 {
571  IPv6Address prefix = p.prefix;
572  short length = p.prefixLength;
573  IPv6Address linkLocalAddr = getLinkLocalAddress();
574  IPv6Address globalAddress = linkLocalAddr.setPrefix(prefix, length); //the global address gets autoconfigured, given its prefix, which during initialisation is supplied by the FlatnetworkConfigurator6
575  p.rtrAddress = globalAddress; //the newly formed global address from the respective adv prefix is stored in the AdvPrefix list, which will be used later by the RA prefix info option
576 }
const IPv6Address & getLinkLocalAddress() const
Returns the first valid link-local address of the interface, or UNSPECIFIED_ADDRESS if there&#39;s none...
Definition: IPv6InterfaceData.cc:353
void inet::IPv6InterfaceData::changed1 ( int  fieldId)
inlineprotected

Referenced by addMulticastListener(), assignAddress(), joinMulticastGroup(), leaveMulticastGroup(), removeAddress(), and removeMulticastListener().

virtual void changed(simsignal_t signalID, int fieldId)
Definition: InterfaceEntry.cc:51
simsignal_t NF_INTERFACE_IPv6CONFIG_CHANGED
Definition: NotifierConsts.cc:54
void inet::IPv6InterfaceData::choosePreferredAddress ( )
protected

Referenced by assignAddress(), permanentlyAssign(), removeAddress(), tentativelyAssign(), and updateMatchingAddressExpiryTimes().

392 {
393  // do we have addresses?
394  if (addresses.size() == 0) {
395  preferredAddr = IPv6Address();
396  return;
397  }
398 
399  // FIXME shouldn't we stick to the current preferredAddress if its prefLifetime
400  // hasn't expired yet?
401 
402  // FIXME TBD throw out expired addresses! 0 should be treated as infinity
403 
404  // sort addresses by scope and expiry time, then pick the first one
405  std::stable_sort(addresses.begin(), addresses.end(), addrLess);
406  // choose first unicast address
407  for (auto & elem : addresses) {
408  if (elem.address.isUnicast()) {
409  preferredAddr = elem.address;
410  preferredAddrExpiryTime = elem.expiryTime;
411  return;
412  }
413  }
415 }
static bool addrLess(const AddressData &a, const AddressData &b)
Definition: IPv6InterfaceData.cc:371
AddressDataVector addresses
Definition: IPv6InterfaceData.h:256
static const IPv6Address UNSPECIFIED_ADDRESS
The unspecified address.
Definition: IPv6Address.h:66
IPv6Address preferredAddr
Definition: IPv6InterfaceData.h:257
simtime_t preferredAddrExpiryTime
Definition: IPv6InterfaceData.h:258
void inet::IPv6InterfaceData::deduceAdvPrefix ( )
579 {
580  for (int i = 0; i < getNumAdvPrefixes(); i++) {
581  IPv6InterfaceData::AdvPrefix& p = rtrVars.advPrefixList[i];
582  /*IPv6Address globalAddr = */
584  assignAddress(p.rtrAddress, false, SIMTIME_ZERO, SIMTIME_ZERO);
585  }
586 }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
const IPv6Address autoConfRouterGlobalScopeAddress(int i)
This function autoconfigures a global scope address for the router only, if and only the prefix is pr...
Definition: IPv6InterfaceData.cc:558
virtual void assignAddress(const IPv6Address &addr, bool tentative, simtime_t expiryTime, simtime_t prefExpiryTime, bool hFlag=false)
Assigns the given address to the interface.
Definition: IPv6InterfaceData.cc:244
int getNumAdvPrefixes() const
Returns the number of advertised prefixes on the interface.
Definition: IPv6InterfaceData.h:716
AdvPrefixList advPrefixList
Definition: IPv6InterfaceData.h:427
std::string inet::IPv6InterfaceData::detailedInfo ( ) const
override
236 {
237  return info(); // TBD this could be improved: multi-line text, etc
238 }
std::string info() const override
Definition: IPv6InterfaceData.cc:154
int inet::IPv6InterfaceData::findAddress ( const IPv6Address addr) const
protected

Referenced by getAddressType(), hasAddress(), isTentativeAddress(), permanentlyAssign(), and removeAddress().

282 {
283  for (AddressDataVector::const_iterator it = addresses.begin(); it != addresses.end(); it++)
284  if (it->address == addr)
285  return it - addresses.begin();
286 
287  return -1;
288 }
AddressDataVector addresses
Definition: IPv6InterfaceData.h:256
simtime_t inet::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 inet::IPv6NeighbourDiscovery::processRAForRouterUpdates().

444 {
445  return RNGCONTEXT uniform(MIN_RANDOM_FACTOR, MAX_RANDOM_FACTOR) * baseReachableTime;
446 }
#define RNGCONTEXT
Definition: INETDefs.h:85
simtime_t inet::IPv6InterfaceData::generateReachableTime ( )
virtual

Arg-less version.

Referenced by IPv6InterfaceData().

449 {
451 }
uint getBaseReachableTime() const
Definition: IPv6InterfaceData.h:661
#define RNGCONTEXT
Definition: INETDefs.h:85
double _getMinRandomFactor() const
Definition: IPv6InterfaceData.h:638
double _getMaxRandomFactor() const
Definition: IPv6InterfaceData.h:639
const IPv6Address & inet::IPv6InterfaceData::getAddress ( int  i) const
IPv6InterfaceData::AddressType inet::IPv6InterfaceData::getAddressType ( int  i) const

Returns the address type (HoA, CoA) of the ith address of the interface.

4.9.07 - CB

Referenced by getAddressType(), and inet::IPv6NeighbourDiscovery::processRAPrefixInfoForAddrAutoConf().

304 {
305  ASSERT(i >= 0 && i < (int)addresses.size());
306  return addresses[i].addrType;
307 }
AddressDataVector addresses
Definition: IPv6InterfaceData.h:256
IPv6InterfaceData::AddressType inet::IPv6InterfaceData::getAddressType ( const IPv6Address addr) const

Returns the address type (HoA, CoA) of the provided address of the interface.

27.9.07 - CB

310 {
311  return getAddressType(findAddress(addr));
312 }
int findAddress(const IPv6Address &addr) const
Definition: IPv6InterfaceData.cc:281
AddressType getAddressType(int i) const
Returns the address type (HoA, CoA) of the ith address of the interface.
Definition: IPv6InterfaceData.cc:303
short inet::IPv6InterfaceData::getAdvCurHopLimit ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::createAndSendRAPacket().

686 { return rtrVars.advCurHopLimit; }
short advCurHopLimit
The default value to be placed in the Cur Hop Limit field in the Router Advertisement messages sent b...
Definition: IPv6InterfaceData.h:412
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
simtime_t inet::IPv6InterfaceData::getAdvDefaultLifetime ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::createAndSendRAPacket().

687 { return rtrVars.advDefaultLifetime; }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
simtime_t advDefaultLifetime
The value to be placed in the Router Lifetime field of Router Advertisements sent from the interface...
Definition: IPv6InterfaceData.h:421
bool inet::IPv6InterfaceData::getAdvHomeAgentFlag ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::createAndSendRAPacket().

680 { return rtrVars.advHomeAgentFlag; }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
bool advHomeAgentFlag
The TRUE/FALSE value to be placed in the "Home Agent" flag field in the Router Advertisement.
Definition: IPv6InterfaceData.h:376
int inet::IPv6InterfaceData::getAdvLinkMTU ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::createAndSendRAPacket().

683 { return rtrVars.advLinkMTU; }
int advLinkMTU
The value to be placed in MTU options sent by the router.
Definition: IPv6InterfaceData.h:385
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
bool inet::IPv6InterfaceData::getAdvManagedFlag ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::createAndSendRAPacket().

676 { return rtrVars.advManagedFlag; }
bool advManagedFlag
The TRUE/FALSE value to be placed in the "Managed address configuration" flag field in the Router Adv...
Definition: IPv6InterfaceData.h:360
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
bool inet::IPv6InterfaceData::getAdvOtherConfigFlag ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::createAndSendRAPacket().

677 { return rtrVars.advOtherConfigFlag; }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
bool advOtherConfigFlag
The TRUE/FALSE value to be placed in the "Other stateful configuration" flag field in the Router Adve...
Definition: IPv6InterfaceData.h:367
const IPv6InterfaceData::AdvPrefix & inet::IPv6InterfaceData::getAdvPrefix ( int  i) const

Returns the ith advertised prefix on the interface.

Referenced by inet::FlatNetworkConfigurator6::addOwnAdvPrefixRoutes(), inet::FlatNetworkConfigurator6::addStaticRoutes(), inet::IPv6NeighbourDiscovery::createAndSendRAPacket(), info(), inet::IPv6RoutingTable::initialize(), inet::InterfaceTable::isNeighborAddress(), and inet::IPv6RoutingTable::isOnLinkAddress().

423 {
424  ASSERT(i >= 0 && i < (int)rtrVars.advPrefixList.size());
425  return rtrVars.advPrefixList[i];
426 }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
AdvPrefixList advPrefixList
Definition: IPv6InterfaceData.h:427
int inet::IPv6InterfaceData::getAdvReachableTime ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::createAndSendRAPacket().

684 { return rtrVars.advReachableTime; }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
int advReachableTime
The value to be placed in the Reachable Time field in the Router Advertisement messages sent by the r...
Definition: IPv6InterfaceData.h:394
int inet::IPv6InterfaceData::getAdvRetransTimer ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::createAndSendRAPacket().

685 { return rtrVars.advRetransTimer; }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
int advRetransTimer
The value to be placed in the Retrans Timer field in the Router Advertisement messages sent by the ro...
Definition: IPv6InterfaceData.h:402
bool inet::IPv6InterfaceData::getAdvSendAdvertisements ( ) const
inline
uint inet::IPv6InterfaceData::getBaseReachableTime ( ) const
inline

Referenced by generateReachableTime(), and IPv6InterfaceData().

661 { return hostVars.baseReachableTime; }
HostVariables hostVars
Definition: IPv6InterfaceData.h:324
uint baseReachableTime
A base value used for computing the random ReachableTime value.
Definition: IPv6InterfaceData.h:306
short inet::IPv6InterfaceData::getCurHopLimit ( ) const
inline
660 { return hostVars.curHopLimit; }
HostVariables hostVars
Definition: IPv6InterfaceData.h:324
short curHopLimit
The default hop limit to be used when sending (unicast) IP packets.
Definition: IPv6InterfaceData.h:301
int inet::IPv6InterfaceData::getDupAddrDetectTransmits ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::assignLinkLocalAddress(), and inet::IPv6NeighbourDiscovery::processDADTimeout().

NodeVariables nodeVars
Definition: IPv6InterfaceData.h:284
int dupAddrDetectTransmits
The number of consecutive Neighbor Solicitation messages sent while performing Duplicate Address Dete...
Definition: IPv6InterfaceData.h:282
const IPv6Address & inet::IPv6InterfaceData::getGlobalAddress ( AddressType  type = HoA) const

Returns the first valid global address of the interface, or UNSPECIFIED_ADDRESS if there's none.

Referenced by inet::xMIPv6::createAndSendBRRMessage(), inet::xMIPv6::createAndSendBUMessage(), inet::IPv6NeighbourDiscovery::processRAPacket(), inet::IPv6NeighbourDiscovery::processRAPrefixInfoForAddrAutoConf(), inet::IPv6::resolveMACAddressAndSendPacket(), inet::xMIPv6::sendTestInit(), inet::xMIPv6::triggerRouteOptimization(), updateHomeNetworkInfo(), and inet::xMIPv6::validateCoTMessage().

548 {
549  for (const auto & elem : addresses)
550  if (elem.address.isGlobal() && elem.addrType == type) // FIXME and valid, 25.9.07 - CB
551  return elem.address;
552 
554 }
AddressDataVector addresses
Definition: IPv6InterfaceData.h:256
static const IPv6Address UNSPECIFIED_ADDRESS
The unspecified address.
Definition: IPv6Address.h:66
HostMulticastData* inet::IPv6InterfaceData::getHostData ( )
inlineprotected

Referenced by joinMulticastGroup(), and leaveMulticastGroup().

436 { if (!hostMcastData) hostMcastData = new HostMulticastData(); return hostMcastData; }
HostMulticastData * hostMcastData
Definition: IPv6InterfaceData.h:132
const HostMulticastData* inet::IPv6InterfaceData::getHostData ( ) const
inlineprotected

Referenced by getHostData().

437 { return const_cast<IPv6InterfaceData *>(this)->getHostData(); }
IPv6InterfaceData()
Definition: IPv6InterfaceData.cc:81
HostMulticastData * getHostData()
Definition: IPv6InterfaceData.h:436
const IPv6AddressVector& inet::IPv6InterfaceData::getJoinedMulticastGroups ( ) const
inline

Referenced by isMemberOfMulticastGroup().

532 { return getHostData()->joinedMulticastGroups; }
IPv6AddressVector joinedMulticastGroups
Definition: IPv6InterfaceData.h:117
HostMulticastData * getHostData()
Definition: IPv6InterfaceData.h:436
const IPv6Address & inet::IPv6InterfaceData::getLinkLocalAddress ( ) const

Returns the first valid link-local address of the interface, or UNSPECIFIED_ADDRESS if there's none.

Referenced by inet::FlatNetworkConfigurator6::addStaticRoutes(), inet::IPv6NeighbourDiscovery::assignLinkLocalAddress(), autoConfRouterGlobalScopeAddress(), inet::FlatNetworkConfigurator6::configureAdvPrefixes(), inet::IPv6NeighbourDiscovery::createAndSendRAPacket(), inet::IPv6NeighbourDiscovery::createAndSendRSPacket(), inet::IPv6AddressType::getLinkLocalAddress(), inet::IPv6NeighbourDiscovery::processRAPrefixInfo(), and inet::IPv6NeighbourDiscovery::processRAPrefixInfoForAddrAutoConf().

354 {
355  for (const auto & elem : addresses)
356  if (elem.address.isLinkLocal()) // FIXME and valid
357  return elem.address;
358 
360 }
AddressDataVector addresses
Definition: IPv6InterfaceData.h:256
static const IPv6Address UNSPECIFIED_ADDRESS
The unspecified address.
Definition: IPv6Address.h:66
uint inet::IPv6InterfaceData::getLinkMTU ( ) const
inline
659 { return hostVars.linkMTU; }
uint linkMTU
The MTU of the link.
Definition: IPv6InterfaceData.h:295
HostVariables hostVars
Definition: IPv6InterfaceData.h:324
simtime_t inet::IPv6InterfaceData::getMaxRtrAdvInterval ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::createRATimer(), and inet::IPv6NeighbourDiscovery::sendPeriodicRA().

674 { return rtrVars.maxRtrAdvInterval; }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
simtime_t maxRtrAdvInterval
The maximum time allowed between sending unsolicited multicast Router Advertisements from the interfa...
Definition: IPv6InterfaceData.h:345
simtime_t inet::IPv6InterfaceData::getMinRtrAdvInterval ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::createRATimer(), and inet::IPv6NeighbourDiscovery::sendPeriodicRA().

675 { return rtrVars.minRtrAdvInterval; }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
simtime_t minRtrAdvInterval
The minimum time allowed between sending unsolicited multicast Router Advertisements from the interfa...
Definition: IPv6InterfaceData.h:353
const IPv6Address& inet::IPv6InterfaceData::getMNPrefix ( ) const
inline
776 { return homeInfo.prefix /*.prefix()*/; } // Zarrar 03.09.07
IPv6Address prefix
Definition: IPv6InterfaceData.h:229
HomeNetworkInfo homeInfo
Definition: IPv6InterfaceData.h:232
int inet::IPv6InterfaceData::getNumAddresses ( ) const
inline
const IPv6Address& inet::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 inet::xMIPv6::createAndSendBUMessage(), inet::IPv6NeighbourDiscovery::createAndSendRSPacket(), inet::IPv6::fragmentAndSend(), inet::L3AddressResolver::getInterfaceIPv6Address(), inet::L3AddressResolver::getIPv6AddressFrom(), inet::GPSR::getSelfAddress(), inet::IPv6NeighbourDiscovery::initiateAddressResolution(), inet::IPv6NeighbourDiscovery::sendSolicitedNA(), inet::IPv6NeighbourDiscovery::sendUnsolicitedNA(), and inet::InterfaceTable::updateLinkDisplayString().

562 { return preferredAddr; } // FIXME TBD check expiry time!
IPv6Address preferredAddr
Definition: IPv6InterfaceData.h:257
simtime_t inet::IPv6InterfaceData::getReachableTime ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::processRAForRouterUpdates().

662 { return hostVars.reachableTime; }
HostVariables hostVars
Definition: IPv6InterfaceData.h:324
simtime_t reachableTime
The time a neighbor is considered reachable after receiving a reachability confirmation.
Definition: IPv6InterfaceData.h:315
const IPv6AddressVector& inet::IPv6InterfaceData::getReportedMulticastGroups ( ) const
inline
RouterMulticastData * getRouterData()
Definition: IPv6InterfaceData.h:438
IPv6AddressVector reportedMulticastGroups
multicast groups that have listeners on the link connected to this interface
Definition: IPv6InterfaceData.h:126
uint inet::IPv6InterfaceData::getRetransTimer ( ) const
inline

Referenced by inet::IPv6NeighbourDiscovery::initiateDAD(), and inet::IPv6NeighbourDiscovery::processDADTimeout().

663 { return hostVars.retransTimer; }
HostVariables hostVars
Definition: IPv6InterfaceData.h:324
uint retransTimer
The time between retransmissions of Neighbor Solicitation messages to a neighbor when resolving the a...
Definition: IPv6InterfaceData.h:322
RouterMulticastData* inet::IPv6InterfaceData::getRouterData ( )
inlineprotected

Referenced by addMulticastListener(), hasMulticastListener(), and removeMulticastListener().

438 { if (!routerMcastData) routerMcastData = new RouterMulticastData(); return routerMcastData; }
RouterMulticastData * routerMcastData
Definition: IPv6InterfaceData.h:133
const RouterMulticastData* inet::IPv6InterfaceData::getRouterData ( ) const
inlineprotected

Referenced by getRouterData().

439 { return const_cast<IPv6InterfaceData *>(this)->getRouterData(); }
IPv6InterfaceData()
Definition: IPv6InterfaceData.cc:81
RouterMulticastData * getRouterData()
Definition: IPv6InterfaceData.h:438
bool inet::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 inet::L3AddressResolver::findHostWithAddress(), inet::InterfaceTable::findInterfaceByAddress(), inet::IPv6RoutingTable::getInterfaceByAddress(), inet::IPv6NeighbourDiscovery::initiateAddressResolution(), inet::IPv6RoutingTable::isLocalAddress(), and inet::IPv6NeighbourDiscovery::processNSPacket().

316 {
317  return findAddress(addr) != -1;
318 }
int findAddress(const IPv6Address &addr) const
Definition: IPv6InterfaceData.cc:281
bool inet::IPv6InterfaceData::hasMulticastListener ( const IPv6Address multicastAddress) const

Referenced by addMulticastListener().

512 {
513  const IPv6AddressVector& multicastGroups = getRouterData()->reportedMulticastGroups;
514  return find(multicastGroups.begin(), multicastGroups.end(), multicastAddress) != multicastGroups.end();
515 }
std::vector< IPv6Address > IPv6AddressVector
Definition: IPv6InterfaceData.h:109
RouterMulticastData * getRouterData()
Definition: IPv6InterfaceData.h:438
IPv6AddressVector reportedMulticastGroups
multicast groups that have listeners on the link connected to this interface
Definition: IPv6InterfaceData.h:126
std::vector< T >::iterator find(std::vector< T > &v, const T &a)
Definition: stlutils.h:48
std::string inet::IPv6InterfaceData::info ( ) const
override
155 {
156  // FIXME FIXME FIXME FIXME info() should never print a newline
157  std::ostringstream os;
158  os << "IPv6:{" << endl;
159  for (int i = 0; i < getNumAddresses(); i++) {
160  os << (i ? "\t , " : "\tAddrs:") << getAddress(i)
161  << "(" << IPv6Address::scopeName(getAddress(i).getScope())
162  << (isTentativeAddress(i) ? " tent" : "") << ") "
163 
164  #ifdef WITH_xMIPv6
165 // TODO: revise, routing table is not that simple to access
166 // << ((rt6->isMobileNode() && getAddress(i).isGlobal())
167 // ? (addresses[i].addrType==HoA ? "HoA" : "CoA") : "")
168  #endif /* WITH_xMIPv6 */
169 
170  << " expiryTime: " << (addresses[i].expiryTime == SIMTIME_ZERO ? "inf" : SIMTIME_STR(addresses[i].expiryTime))
171  << " prefExpiryTime: " << (addresses[i].prefExpiryTime == SIMTIME_ZERO ? "inf" : SIMTIME_STR(addresses[i].prefExpiryTime))
172  << endl;
173  }
174 
175  if (hostMcastData)
176  os << hostMcastData->info();
177 
178  for (int i = 0; i < getNumAdvPrefixes(); i++) {
179  const AdvPrefix& a = getAdvPrefix(i);
180  os << (i ? ", " : "\tAdvPrefixes: ") << a.prefix << "/" << a.prefixLength << "("
181  << (a.advOnLinkFlag ? "" : "off-link ")
182  << (a.advAutonomousFlag ? "" : "non-auto ");
183 
184 #ifdef WITH_xMIPv6
185  os << "R-Flag = " << (a.advRtrAddr ? "1 " : "0 ");
186 #endif /* WITH_xMIPv6 */
187 
188  if (a.advValidLifetime == SIMTIME_ZERO)
189  os << "lifetime:inf";
190  else if (a.advValidLifetime > SIMTIME_ZERO)
191  os << "expires:" << a.advValidLifetime;
192  else
193  os << "lifetime:+" << (-1 * a.advValidLifetime);
194  os << ")" << endl;
195  }
196  os << " ";
197 
198  if (routerMcastData)
199  os << routerMcastData->info();
200 
201  // uncomment the following as needed!
202  os << "\tNode:";
203  os << " dupAddrDetectTrans=" << nodeVars.dupAddrDetectTransmits;
204  //os << " curHopLimit=" << hostVars.curHopLimit;
205  //os << " retransTimer=" << hostVars.retransTimer;
206  //os << " baseReachableTime=" << hostVars.baseReachableTime;
207  os << " reachableTime=" << hostVars.reachableTime << endl;
208 
209 #ifdef WITH_xMIPv6
210  // the following is for MIPv6 support
211  // 4.9.07 - Zarrar, CB
212 // TODO: revise, routing table is not that simple to access
213 // if ( rt6->isMobileNode() )
214 // os << "\tHome Network Info: " << " HoA="<< homeInfo.HoA << ", HA=" << homeInfo.homeAgentAddr
215 // << ", home prefix=" << homeInfo.prefix/*.prefix()*/ << "\n";
216 #endif /* WITH_xMIPv6 */
217 
219  os << "\tRouter:";
220  os << " maxRtrAdvInt=" << rtrVars.maxRtrAdvInterval;
221  os << " minRtrAdvInt=" << rtrVars.minRtrAdvInterval << endl;
222  //os << " advManagedFlag=" << rtrVars.advManagedFlag;
223  //os << " advOtherFlag=" << rtrVars.advOtherFlag;
224  //os << " advLinkMTU=" << rtrVars.advLinkMTU;
225  //os << " advReachableTime=" << rtrVars.advReachableTime;
226  //os << " advRetransTimer=" << rtrVars.advRetransTimer;
227  //os << " advCurHopLimit=" << rtrVars.advCurHopLimit;
228  //os << " advDefaultLifetime=" << rtrVars.advDefaultLifetime;
229  }
230 
231  os << " }" << endl;
232  return os.str();
233 }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
simtime_t maxRtrAdvInterval
The maximum time allowed between sending unsolicited multicast Router Advertisements from the interfa...
Definition: IPv6InterfaceData.h:345
bool isTentativeAddress(int i) const
Returns true if the ith address of the interface is tentative.
Definition: IPv6InterfaceData.cc:296
AddressDataVector addresses
Definition: IPv6InterfaceData.h:256
HostMulticastData * hostMcastData
Definition: IPv6InterfaceData.h:132
const AdvPrefix & getAdvPrefix(int i) const
Returns the ith advertised prefix on the interface.
Definition: IPv6InterfaceData.cc:422
NodeVariables nodeVars
Definition: IPv6InterfaceData.h:284
HostVariables hostVars
Definition: IPv6InterfaceData.h:324
const IPv6Address & getAddress(int i) const
Returns ith address of the interface.
Definition: IPv6InterfaceData.cc:290
static const char * scopeName(Scope s)
Return the string representation of the given scope.
Definition: IPv6Address.cc:237
simtime_t reachableTime
The time a neighbor is considered reachable after receiving a reachability confirmation.
Definition: IPv6InterfaceData.h:315
simtime_t minRtrAdvInterval
The minimum time allowed between sending unsolicited multicast Router Advertisements from the interfa...
Definition: IPv6InterfaceData.h:353
RouterMulticastData * routerMcastData
Definition: IPv6InterfaceData.h:133
int getNumAdvPrefixes() const
Returns the number of advertised prefixes on the interface.
Definition: IPv6InterfaceData.h:716
int dupAddrDetectTransmits
The number of consecutive Neighbor Solicitation messages sent while performing Duplicate Address Dete...
Definition: IPv6InterfaceData.h:282
std::string info()
Definition: IPv6InterfaceData.cc:60
std::string info()
Definition: IPv6InterfaceData.cc:32
bool advSendAdvertisements
A flag indicating whether or not the router sends periodic Router Advertisements and responds to Rout...
Definition: IPv6InterfaceData.h:337
int getNumAddresses() const
Returns the number of addresses the interface has.
Definition: IPv6InterfaceData.h:482
bool inet::IPv6InterfaceData::isDADInProgress ( )
inline

Referenced by inet::IPv6NeighbourDiscovery::processRAPacket().

236 { return dadInProgress; };
bool dadInProgress
Definition: IPv6InterfaceData.h:233
bool inet::IPv6InterfaceData::isMemberOfMulticastGroup ( const IPv6Address multicastAddress) const
454 {
455  const IPv6AddressVector& multicastGroups = getJoinedMulticastGroups();
456  return find(multicastGroups.begin(), multicastGroups.end(), multicastAddress) != multicastGroups.end();
457 }
std::vector< IPv6Address > IPv6AddressVector
Definition: IPv6InterfaceData.h:109
const IPv6AddressVector & getJoinedMulticastGroups() const
Definition: IPv6InterfaceData.h:532
std::vector< T >::iterator find(std::vector< T > &v, const T &a)
Definition: stlutils.h:48
bool inet::IPv6InterfaceData::isTentativeAddress ( int  i) const
bool inet::IPv6InterfaceData::isTentativeAddress ( const IPv6Address addr) const

Returns true if the interface has the given address and it is tentative.

330 {
331  int k = findAddress(addr);
332  return k != -1 && addresses[k].tentative;
333 }
AddressDataVector addresses
Definition: IPv6InterfaceData.h:256
int findAddress(const IPv6Address &addr) const
Definition: IPv6InterfaceData.cc:281
const double k
Definition: QAM16Modulation.cc:24
void inet::IPv6InterfaceData::joinMulticastGroup ( const IPv6Address multicastAddress)
virtual

Referenced by inet::IPv6RoutingTable::configureInterfaceForIPv6().

460 {
461  if (!multicastAddress.isMulticast())
462  throw cRuntimeError("IPv6InterfaceData::joinMulticastGroup(): multicast address expected, received %s.", multicastAddress.str().c_str());
463 
465 
466  std::vector<int>& refCounts = getHostData()->refCounts;
467  for (int i = 0; i < (int)multicastGroups.size(); ++i) {
468  if (multicastGroups[i] == multicastAddress) {
469  refCounts[i]++;
470  return;
471  }
472  }
473 
474  multicastGroups.push_back(multicastAddress);
475  refCounts.push_back(1);
476 
478 
479  cModule *m = ownerp ? dynamic_cast<cModule *>(ownerp->getInterfaceTable()) : nullptr;
480  if (m) {
481  IPv6MulticastGroupInfo info(ownerp, multicastAddress);
482  m->emit(NF_IPv6_MCAST_JOIN, &info);
483  }
484 }
simsignal_t NF_IPv6_MCAST_JOIN
Definition: NotifierConsts.cc:87
Definition: IPv6InterfaceData.h:112
void changed1(int fieldId)
Definition: IPv6InterfaceData.h:435
IPv6AddressVector joinedMulticastGroups
Definition: IPv6InterfaceData.h:117
IInterfaceTable * getInterfaceTable() const
Returns the IInterfaceTable this interface is in, or nullptr.
Definition: InterfaceEntry.h:168
std::vector< int > refCounts
Definition: IPv6InterfaceData.h:118
std::vector< IPv6Address > IPv6AddressVector
Definition: IPv6InterfaceData.h:109
std::string info() const override
Definition: IPv6InterfaceData.cc:154
InterfaceEntry * ownerp
Definition: InterfaceEntry.h:65
HostMulticastData * getHostData()
Definition: IPv6InterfaceData.h:436
value< double, units::m > m
Definition: Units.h:1047
void inet::IPv6InterfaceData::leaveMulticastGroup ( const IPv6Address multicastAddress)
virtual
487 {
488  if (!multicastAddress.isMulticast())
489  throw cRuntimeError("IPv6InterfaceData::leaveMulticastGroup(): multicast address expected, received %s.", multicastAddress.str().c_str());
490 
492  std::vector<int>& refCounts = getHostData()->refCounts;
493  for (int i = 0; i < (int)multicastGroups.size(); ++i) {
494  if (multicastGroups[i] == multicastAddress) {
495  if (--refCounts[i] == 0) {
496  multicastGroups.erase(multicastGroups.begin() + i);
497  refCounts.erase(refCounts.begin() + i);
498 
500 
501  cModule *m = ownerp ? dynamic_cast<cModule *>(ownerp->getInterfaceTable()) : nullptr;
502  if (m) {
503  IPv6MulticastGroupInfo info(ownerp, multicastAddress);
504  m->emit(NF_IPv6_MCAST_LEAVE, &info);
505  }
506  }
507  }
508  }
509 }
simsignal_t NF_IPv6_MCAST_LEAVE
Definition: NotifierConsts.cc:88
Definition: IPv6InterfaceData.h:112
void changed1(int fieldId)
Definition: IPv6InterfaceData.h:435
IPv6AddressVector joinedMulticastGroups
Definition: IPv6InterfaceData.h:117
IInterfaceTable * getInterfaceTable() const
Returns the IInterfaceTable this interface is in, or nullptr.
Definition: InterfaceEntry.h:168
std::vector< int > refCounts
Definition: IPv6InterfaceData.h:118
std::vector< IPv6Address > IPv6AddressVector
Definition: IPv6InterfaceData.h:109
std::string info() const override
Definition: IPv6InterfaceData.cc:154
InterfaceEntry * ownerp
Definition: InterfaceEntry.h:65
HostMulticastData * getHostData()
Definition: IPv6InterfaceData.h:436
value< double, units::m > m
Definition: Units.h:1047
bool inet::IPv6InterfaceData::matchesSolicitedNodeMulticastAddress ( const IPv6Address solNodeAddr) const

Returns true if the interface has an address matching the given solicited-node multicast addresses.

Referenced by inet::IPv6RoutingTable::isLocalAddress().

321 {
322  for (const auto & elem : addresses)
323  if (elem.address.formSolicitedNodeMulticastAddress() == solNodeAddr)
324  return true;
325 
326  return false;
327 }
AddressDataVector addresses
Definition: IPv6InterfaceData.h:256
void inet::IPv6InterfaceData::permanentlyAssign ( const IPv6Address addr)
virtual

Clears the "tentative" flag of an existing interface address.

Referenced by inet::IPv6NeighbourDiscovery::makeTentativeAddressPermanent().

336 {
337  int k = findAddress(addr);
338  ASSERT(k != -1);
339  addresses[k].tentative = false;
341 }
AddressDataVector addresses
Definition: IPv6InterfaceData.h:256
void choosePreferredAddress()
Definition: IPv6InterfaceData.cc:391
int findAddress(const IPv6Address &addr) const
Definition: IPv6InterfaceData.cc:281
const double k
Definition: QAM16Modulation.cc:24
void inet::IPv6InterfaceData::removeAddress ( const IPv6Address address)
virtual

Removes the address.

Called when the valid lifetime expires.

Referenced by inet::IPv6NeighbourDiscovery::makeTentativeAddressPermanent(), and inet::IPv6NeighbourDiscovery::processRAPrefixInfoForAddrAutoConf().

363 {
364  int k = findAddress(address);
365  ASSERT(k != -1);
366  addresses.erase(addresses.begin() + k);
369 }
Definition: IPv6InterfaceData.h:112
AddressDataVector addresses
Definition: IPv6InterfaceData.h:256
void changed1(int fieldId)
Definition: IPv6InterfaceData.h:435
void choosePreferredAddress()
Definition: IPv6InterfaceData.cc:391
int findAddress(const IPv6Address &addr) const
Definition: IPv6InterfaceData.cc:281
const double k
Definition: QAM16Modulation.cc:24
IPv6Address inet::IPv6InterfaceData::removeAddress ( IPv6InterfaceData::AddressType  type)

Removes a CoA address from the interface if one exists.

This method traverses the address list and searches for a specific address.

The element is removed and returned.

593 {
594  IPv6Address addr;
595 
596  for (auto it = addresses.begin(); it != addresses.end(); ++it) { // 24.9.07 - CB
597  if ((*it).addrType == type) {
598  addr = it->address;
599  addresses.erase(it);
600  break; // it is assumed that we do not have more than one CoA
601  }
602  }
603 
604  // pick new address as we've removed the old one
607 
608  return addr;
609 }
Definition: IPv6InterfaceData.h:112
AddressDataVector addresses
Definition: IPv6InterfaceData.h:256
void changed1(int fieldId)
Definition: IPv6InterfaceData.h:435
void choosePreferredAddress()
Definition: IPv6InterfaceData.cc:391
void inet::IPv6InterfaceData::removeAdvPrefix ( int  i)
virtual

Remove the ith advertised prefix on the interface.

Prefixes at larger indices will shift down.

437 {
438  ASSERT(i >= 0 && i < (int)rtrVars.advPrefixList.size());
439  rtrVars.advPrefixList.erase(rtrVars.advPrefixList.begin() + i);
440 }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
AdvPrefixList advPrefixList
Definition: IPv6InterfaceData.h:427
void inet::IPv6InterfaceData::removeMulticastListener ( const IPv6Address multicastAddress)
virtual
529 {
531 
532  int n = multicastGroups.size();
533  int i;
534  for (i = 0; i < n; i++)
535  if (multicastGroups[i] == multicastAddress)
536  break;
537 
538  if (i != n) {
539  multicastGroups.erase(multicastGroups.begin() + i);
541  }
542 }
void changed1(int fieldId)
Definition: IPv6InterfaceData.h:435
Definition: IPv6InterfaceData.h:112
std::vector< IPv6Address > IPv6AddressVector
Definition: IPv6InterfaceData.h:109
RouterMulticastData * getRouterData()
Definition: IPv6InterfaceData.h:438
IPv6AddressVector reportedMulticastGroups
multicast groups that have listeners on the link connected to this interface
Definition: IPv6InterfaceData.h:126
virtual void inet::IPv6InterfaceData::setAdvCurHopLimit ( short  d)
inlinevirtual
702 { rtrVars.advCurHopLimit = d; }
short advCurHopLimit
The default value to be placed in the Cur Hop Limit field in the Router Advertisement messages sent b...
Definition: IPv6InterfaceData.h:412
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
virtual void inet::IPv6InterfaceData::setAdvDefaultLifetime ( simtime_t  d)
inlinevirtual
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
simtime_t advDefaultLifetime
The value to be placed in the Router Lifetime field of Router Advertisements sent from the interface...
Definition: IPv6InterfaceData.h:421
virtual void inet::IPv6InterfaceData::setAdvHomeAgentFlag ( bool  d)
inlinevirtual
696 { rtrVars.advHomeAgentFlag = d; }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
bool advHomeAgentFlag
The TRUE/FALSE value to be placed in the "Home Agent" flag field in the Router Advertisement.
Definition: IPv6InterfaceData.h:376
virtual void inet::IPv6InterfaceData::setAdvLinkMTU ( int  d)
inlinevirtual
699 { rtrVars.advLinkMTU = d; }
int advLinkMTU
The value to be placed in MTU options sent by the router.
Definition: IPv6InterfaceData.h:385
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
virtual void inet::IPv6InterfaceData::setAdvManagedFlag ( bool  d)
inlinevirtual
692 { rtrVars.advManagedFlag = d; }
bool advManagedFlag
The TRUE/FALSE value to be placed in the "Managed address configuration" flag field in the Router Adv...
Definition: IPv6InterfaceData.h:360
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
virtual void inet::IPv6InterfaceData::setAdvOtherConfigFlag ( bool  d)
inlinevirtual
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
bool advOtherConfigFlag
The TRUE/FALSE value to be placed in the "Other stateful configuration" flag field in the Router Adve...
Definition: IPv6InterfaceData.h:367
void inet::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.

429 {
430  ASSERT(i >= 0 && i < (int)rtrVars.advPrefixList.size());
431  ASSERT(rtrVars.advPrefixList[i].prefix == advPrefix.prefix);
432  ASSERT(rtrVars.advPrefixList[i].prefixLength == advPrefix.prefixLength);
433  rtrVars.advPrefixList[i] = advPrefix;
434 }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
AdvPrefixList advPrefixList
Definition: IPv6InterfaceData.h:427
virtual void inet::IPv6InterfaceData::setAdvReachableTime ( int  d)
inlinevirtual
700 { rtrVars.advReachableTime = d; }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
int advReachableTime
The value to be placed in the Reachable Time field in the Router Advertisement messages sent by the r...
Definition: IPv6InterfaceData.h:394
virtual void inet::IPv6InterfaceData::setAdvRetransTimer ( int  d)
inlinevirtual
701 { rtrVars.advRetransTimer = d; }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
int advRetransTimer
The value to be placed in the Retrans Timer field in the Router Advertisement messages sent by the ro...
Definition: IPv6InterfaceData.h:402
virtual void inet::IPv6InterfaceData::setAdvSendAdvertisements ( bool  d)
inlinevirtual

Referenced by inet::IPv6RoutingTable::configureInterfaceForIPv6(), and inet::IPv6RoutingTable::configureInterfaceFromXML().

RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
bool advSendAdvertisements
A flag indicating whether or not the router sends periodic Router Advertisements and responds to Rout...
Definition: IPv6InterfaceData.h:337
virtual void inet::IPv6InterfaceData::setBaseReachableTime ( uint  d)
inlinevirtual

Referenced by inet::IPv6NeighbourDiscovery::processRAForRouterUpdates().

HostVariables hostVars
Definition: IPv6InterfaceData.h:324
uint baseReachableTime
A base value used for computing the random ReachableTime value.
Definition: IPv6InterfaceData.h:306
virtual void inet::IPv6InterfaceData::setCurHopLimit ( short  d)
inlinevirtual

Referenced by inet::IPv6NeighbourDiscovery::processRAForRouterUpdates().

666 { hostVars.curHopLimit = d; }
HostVariables hostVars
Definition: IPv6InterfaceData.h:324
short curHopLimit
The default hop limit to be used when sending (unicast) IP packets.
Definition: IPv6InterfaceData.h:301
void inet::IPv6InterfaceData::setDADInProgress ( bool  val)
inline
virtual void inet::IPv6InterfaceData::setDupAddrDetectTransmits ( int  d)
inlinevirtual
NodeVariables nodeVars
Definition: IPv6InterfaceData.h:284
int dupAddrDetectTransmits
The number of consecutive Neighbor Solicitation messages sent while performing Duplicate Address Dete...
Definition: IPv6InterfaceData.h:282
virtual void inet::IPv6InterfaceData::setLinkMTU ( uint  d)
inlinevirtual
665 { hostVars.linkMTU = d; }
uint linkMTU
The MTU of the link.
Definition: IPv6InterfaceData.h:295
HostVariables hostVars
Definition: IPv6InterfaceData.h:324
virtual void inet::IPv6InterfaceData::setMaxRtrAdvInterval ( simtime_t  d)
inlinevirtual

Referenced by inet::IPv6NeighbourDiscovery::createRATimer().

690 { rtrVars.maxRtrAdvInterval = d; }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
simtime_t maxRtrAdvInterval
The maximum time allowed between sending unsolicited multicast Router Advertisements from the interfa...
Definition: IPv6InterfaceData.h:345
virtual void inet::IPv6InterfaceData::setMinRtrAdvInterval ( simtime_t  d)
inlinevirtual

Referenced by inet::IPv6NeighbourDiscovery::createRATimer().

691 { rtrVars.minRtrAdvInterval = d; }
RouterVariables rtrVars
Definition: IPv6InterfaceData.h:429
simtime_t minRtrAdvInterval
The minimum time allowed between sending unsolicited multicast Router Advertisements from the interfa...
Definition: IPv6InterfaceData.h:353
virtual void inet::IPv6InterfaceData::setReachableTime ( simtime_t  d)
inlinevirtual

Referenced by inet::IPv6NeighbourDiscovery::processRAForRouterUpdates().

668 { hostVars.reachableTime = d; }
HostVariables hostVars
Definition: IPv6InterfaceData.h:324
simtime_t reachableTime
The time a neighbor is considered reachable after receiving a reachability confirmation.
Definition: IPv6InterfaceData.h:315
virtual void inet::IPv6InterfaceData::setRetransTimer ( uint  d)
inlinevirtual

Referenced by inet::IPv6NeighbourDiscovery::processRAForRouterUpdates().

669 { hostVars.retransTimer = d; }
HostVariables hostVars
Definition: IPv6InterfaceData.h:324
uint retransTimer
The time between retransmissions of Neighbor Solicitation messages to a neighbor when resolving the a...
Definition: IPv6InterfaceData.h:322
void inet::IPv6InterfaceData::tentativelyAssign ( int  i)

Sets the "tentative" flag of of the ith address of the interface.

28.09.07 - CB

Referenced by inet::IPv6NeighbourDiscovery::processRAPrefixInfoForAddrAutoConf().

345 {
346  ASSERT(i >= 0 && i < (int)addresses.size());
347  addresses[i].tentative = true;
349 }
AddressDataVector addresses
Definition: IPv6InterfaceData.h:256
void choosePreferredAddress()
Definition: IPv6InterfaceData.cc:391
void inet::IPv6InterfaceData::updateHomeNetworkInfo ( const IPv6Address hoa,
const IPv6Address ha,
const IPv6Address prefix,
const int  prefixLength 
)

03.09.07 This updates the struct HomeNetwork Info with the MN's Home Address(HoA), the global scope address of the MNs Home Agent (HA) and the home network prefix.

Referenced by inet::IPv6NeighbourDiscovery::processRAPacket().

619 {
620  EV_INFO << "\n++++++ Updating the Home Network Information \n";
621  homeInfo.HoA = hoa;
622  homeInfo.homeAgentAddr = ha;
623  homeInfo.prefix = prefix;
624 
625  // check if we already have a HoA on this interface
626  // if not, then we create one
627  IPv6Address addr = getGlobalAddress(HoA);
628 
630  this->assignAddress(hoa, false, SIMTIME_ZERO, SIMTIME_ZERO, true);
631 }
IPv6Address prefix
Definition: IPv6InterfaceData.h:229
Definition: IPv6InterfaceData.h:211
virtual void assignAddress(const IPv6Address &addr, bool tentative, simtime_t expiryTime, simtime_t prefExpiryTime, bool hFlag=false)
Assigns the given address to the interface.
Definition: IPv6InterfaceData.cc:244
IPv6Address HoA
Definition: IPv6InterfaceData.h:226
HomeNetworkInfo homeInfo
Definition: IPv6InterfaceData.h:232
const IPv6Address & getGlobalAddress(AddressType type=HoA) const
Returns the first valid global address of the interface, or UNSPECIFIED_ADDRESS if there&#39;s none...
Definition: IPv6InterfaceData.cc:547
static const IPv6Address UNSPECIFIED_ADDRESS
The unspecified address.
Definition: IPv6Address.h:66
IPv6Address homeAgentAddr
Definition: IPv6InterfaceData.h:227
void inet::IPv6InterfaceData::updateMatchingAddressExpiryTimes ( const IPv6Address prefix,
int  length,
simtime_t  expiryTime = SIMTIME_ZERO,
simtime_t  prefExpiryTime = SIMTIME_ZERO 
)
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.

271 {
272  for (auto & elem : addresses) {
273  if (elem.address.matches(prefix, length)) {
274  elem.expiryTime = expiryTime;
275  elem.prefExpiryTime = prefExpiryTime;
276  }
277  }
279 }
AddressDataVector addresses
Definition: IPv6InterfaceData.h:256
void choosePreferredAddress()
Definition: IPv6InterfaceData.cc:391

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const HomeNetworkInfo homeNetInfo 
)
friend
612 {
613  os << "HoA of MN:" << homeNetInfo.HoA << " HA Address: " << homeNetInfo.homeAgentAddr
614  << " Home Network Prefix: " << homeNetInfo.prefix /*.prefix()*/;
615  return os;
616 }

Member Data Documentation

bool inet::IPv6InterfaceData::dadInProgress = false
protected
HomeNetworkInfo inet::IPv6InterfaceData::homeInfo
protected

Referenced by updateHomeNetworkInfo().

HostConstants inet::IPv6InterfaceData::hostConstants

Referenced by IPv6InterfaceData().

HostMulticastData* inet::IPv6InterfaceData::hostMcastData = nullptr
protected

Referenced by info(), and ~IPv6InterfaceData().

HostVariables inet::IPv6InterfaceData::hostVars
protected

Referenced by info(), and IPv6InterfaceData().

NodeConstants inet::IPv6InterfaceData::nodeConstants

Referenced by IPv6InterfaceData().

NodeVariables inet::IPv6InterfaceData::nodeVars
protected

Referenced by info(), and IPv6InterfaceData().

IPv6Address inet::IPv6InterfaceData::preferredAddr
protected

Referenced by choosePreferredAddress().

simtime_t inet::IPv6InterfaceData::preferredAddrExpiryTime
protected

Referenced by choosePreferredAddress().

RouterConstants inet::IPv6InterfaceData::routerConstants

Referenced by IPv6InterfaceData().

RouterMulticastData* inet::IPv6InterfaceData::routerMcastData = nullptr
protected

Referenced by info(), and ~IPv6InterfaceData().

IPv6RoutingTable* inet::IPv6InterfaceData::rt6 = nullptr
protected

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