INET Framework for OMNeT++/OMNEST
|
IPv6 Neighbour Cache (RFC 2461 Neighbor Discovery for IPv6). More...
#include <IPv6NeighbourCache.h>
Classes | |
class | DefaultRouterList |
struct | Key |
Key into neighbour cache. More... | |
struct | Neighbour |
Stores a neighbour (or router) entry. More... | |
Public Types | |
enum | ReachabilityState { INCOMPLETE, REACHABLE, STALE, DELAY, PROBE } |
Neighbour's reachability state. More... | |
typedef std::vector< cMessage * > | MsgPtrVector |
typedef std::map< Key, Neighbour > | NeighbourMap |
The std::map underlying the Neighbour Cache data structure. More... | |
Public Member Functions | |
IPv6NeighbourCache (cSimpleModule &neighbourDiscovery) | |
virtual | ~IPv6NeighbourCache () |
virtual Neighbour * | lookup (const IPv6Address &addr, int interfaceID) |
Returns a neighbour entry, or nullptr. More... | |
virtual const Key * | lookupKeyAddr (Key &key) |
Experimental code. More... | |
DefaultRouterList & | getDefaultRouterList () |
NeighbourMap::iterator | begin () |
For iteration on the internal std::map. More... | |
NeighbourMap::iterator | end () |
For iteration on the internal std::map. More... | |
virtual Neighbour * | addNeighbour (const IPv6Address &addr, int interfaceID) |
Creates and initializes a neighbour entry with isRouter=false, state=INCOMPLETE. More... | |
virtual Neighbour * | addNeighbour (const IPv6Address &addr, int interfaceID, MACAddress macAddress) |
Creates and initializes a neighbour entry with isRouter=false, MAC address and state=STALE. More... | |
virtual Neighbour * | addRouter (const IPv6Address &addr, int interfaceID, MACAddress macAddress, simtime_t expiryTime, bool isHomeAgent=false) |
Creates and initializes a router entry (isRouter=isDefaultRouter=true), MAC address and state=STALE. More... | |
virtual void | remove (const IPv6Address &addr, int interfaceID) |
Deletes the given neighbour from the cache. More... | |
virtual void | invalidateEntriesForInterfaceID (int interfaceID) |
Set status of all neighbours on given interface to state PROBE. More... | |
virtual void | invalidateAllEntries () |
Set status of all neighbours to state PROBE. More... | |
virtual void | remove (NeighbourMap::iterator it) |
Deletes the given neighbour from the cache. More... | |
Static Public Member Functions | |
static const char * | stateName (ReachabilityState state) |
Returns the name of the given state as string. More... | |
Protected Attributes | |
cSimpleModule & | neighbourDiscovery |
NeighbourMap | neighbourMap |
DefaultRouterList | defaultRouterList |
IPv6 Neighbour Cache (RFC 2461 Neighbor Discovery for IPv6).
Used internally by the IPv6NeighbourDiscovery simple module.
This is just a plain container class – the IPv6NeighbourDiscovery module is free to manipulate the contents of the Neighbour entries as it pleases.
NOTE: IPv6NeighbourCache also stores the Default Router List. A router becomes a default router by calling getDefaultRouterList().add(router) and stops to be a default router after getDefaultRouterList().remove(router) has been called. References to default routers are stored in a circular list to ease round-robin selection.
typedef std::vector<cMessage *> inet::IPv6NeighbourCache::MsgPtrVector |
typedef std::map<Key, Neighbour> inet::IPv6NeighbourCache::NeighbourMap |
The std::map underlying the Neighbour Cache data structure.
Neighbour's reachability state.
Enumerator | |
---|---|
INCOMPLETE | |
REACHABLE | |
STALE | |
DELAY | |
PROBE |
inet::IPv6NeighbourCache::IPv6NeighbourCache | ( | cSimpleModule & | neighbourDiscovery | ) |
|
virtual |
Creates and initializes a neighbour entry with isRouter=false, state=INCOMPLETE.
Referenced by inet::IPv6NeighbourDiscovery::processIPv6Datagram(), inet::IPv6NeighbourDiscovery::processNSWithSpecifiedSrcAddr(), and inet::IPv6NeighbourDiscovery::processRAForRouterUpdates().
|
virtual |
Creates and initializes a neighbour entry with isRouter=false, MAC address and state=STALE.
|
virtual |
Creates and initializes a router entry (isRouter=isDefaultRouter=true), MAC address and state=STALE.
Update by CB: Added an optional parameter which is false by default. Specifies whether a router is also a home agent.
Referenced by inet::IPv6NeighbourDiscovery::processRAForRouterUpdates().
|
inline |
For iteration on the internal std::map.
Referenced by inet::IPv6NeighbourDiscovery::routersUnreachabilityDetection().
|
inline |
For iteration on the internal std::map.
Referenced by inet::IPv6NeighbourDiscovery::routersUnreachabilityDetection().
|
inline |
Referenced by inet::IPv6NeighbourDiscovery::processNAForIncompleteNCEState(), inet::IPv6NeighbourDiscovery::processNAForOtherNCEStates(), and inet::IPv6NeighbourDiscovery::selectDefaultRouter().
|
virtual |
Set status of all neighbours to state PROBE.
Referenced by inet::IPv6NeighbourDiscovery::invalidateNeigbourCache().
|
virtual |
Set status of all neighbours on given interface to state PROBE.
|
virtual |
Returns a neighbour entry, or nullptr.
Referenced by inet::IPv6NeighbourDiscovery::processIPv6Datagram(), inet::IPv6NeighbourDiscovery::processNAPacket(), inet::IPv6NeighbourDiscovery::processNSWithSpecifiedSrcAddr(), inet::IPv6NeighbourDiscovery::processRAForRouterUpdates(), inet::IPv6NeighbourDiscovery::reachabilityConfirmed(), and inet::IPv6NeighbourDiscovery::resolveNeighbour().
|
virtual |
|
virtual |
Deletes the given neighbour from the cache.
Referenced by inet::IPv6NeighbourDiscovery::dropQueuedPacketsAwaitingAR(), inet::IPv6NeighbourDiscovery::processNUDTimeout(), inet::IPv6NeighbourDiscovery::selectDefaultRouter(), and inet::IPv6NeighbourDiscovery::timeoutDefaultRouter().
|
virtual |
Deletes the given neighbour from the cache.
|
static |
Returns the name of the given state as string.
Referenced by inet::operator<<().
|
protected |
Referenced by addRouter(), invalidateAllEntries(), and remove().
|
protected |
Referenced by invalidateEntriesForInterfaceID(), and remove().
|
protected |
Referenced by addNeighbour(), addRouter(), invalidateAllEntries(), invalidateEntriesForInterfaceID(), IPv6NeighbourCache(), lookup(), lookupKeyAddr(), and remove().