INET Framework for OMNeT++/OMNEST
inet::eigrp::EigrpIpv6Pdm Class Reference

#include <EigrpIpv6Pdm.h>

Inheritance diagram for inet::eigrp::EigrpIpv6Pdm:
inet::eigrp::IEigrpModule< Ipv6Address > inet::eigrp::IEigrpPdm< Ipv6Address >

Classes

struct  IPv6netPrefix
 

Public Member Functions

 EigrpIpv6Pdm ()
 
 ~EigrpIpv6Pdm ()
 
virtual void updateInterface (int interfaceId) override
 
void addInterface (int ifaceId, int networkId, bool enabled) override
 Adds interface to EIGRP. More...
 
void addInterface (int ifaceId, bool enabled) override
 Adds interface to EIGRP for IPv6. More...
 
EigrpNetwork< Ipv6Address > * addNetwork (Ipv6Address address, Ipv6Address mask) override
 Adds new network to EigrpNetworkTable for routing. More...
 
void setASNum (int asNum) override
 
int getASNum () override
 
void setKValues (const EigrpKValues &kValues) override
 
void setMaximumPath (int maximumPath) override
 
void setVariance (int variance) override
 
void setHelloInt (int interval, int ifaceId) override
 
void setHoldInt (int interval, int ifaceId) override
 
void setSplitHorizon (bool shenabled, int ifaceId) override
 
void setPassive (bool passive, int ifaceId) override
 
void setStub (const EigrpStub &stub) override
 
void setRouterId (Ipv4Address routerID) override
 Sets router ID. More...
 
void setLoad (int load, int interfaceId) override
 
void setBandwidth (int bandwith, int interfaceId) override
 
void setDelay (int delay, int interfaceId) override
 
void setReliability (int reliability, int interfaceId) override
 
void sendUpdate (int destNeighbor, EigrpRoute< Ipv6Address > *route, EigrpRouteSource< Ipv6Address > *source, bool forcePoisonRev, const char *reason) override
 Sends update message to specified neighbor. More...
 
void sendQuery (int destNeighbor, EigrpRoute< Ipv6Address > *route, EigrpRouteSource< Ipv6Address > *source, bool forcePoisonRev=false) override
 Sends query message to specified neighbor. More...
 
void sendReply (EigrpRoute< Ipv6Address > *route, int destNeighbor, EigrpRouteSource< Ipv6Address > *source, bool forcePoisonRev=false, bool isUnreachable=false) override
 Sends reply message to specified neighbor. More...
 
EigrpRouteSource< Ipv6Address > * updateRoute (EigrpRoute< Ipv6Address > *route, uint64_t dmin, bool *rtableChanged, bool removeUnreach=false) override
 Function finds successors to the destination network. More...
 
uint64_t findRouteDMin (EigrpRoute< Ipv6Address > *route) override
 Returns minimal distance to destination network. More...
 
bool hasFeasibleSuccessor (EigrpRoute< Ipv6Address > *route, uint64_t &resultDmin) override
 Determine whether there are Feasibles Successors for specified route. More...
 
EigrpRouteSource< Ipv6Address > * getBestSuccessor (EigrpRoute< Ipv6Address > *route) override
 Returns best successor for specified network. More...
 
bool setReplyStatusTable (EigrpRoute< Ipv6Address > *route, EigrpRouteSource< Ipv6Address > *source, bool forcePoisonRev, int *neighCount, int *stubCount) override
 Sets Reply Status Table for specified network. More...
 
bool hasNeighborForUpdate (EigrpRouteSource< Ipv6Address > *source) override
 Returns tru if there are recipients for update message, else false. More...
 
void setDelayedRemove (int neighId, EigrpRouteSource< Ipv6Address > *src) override
 After receiving Ack from neighbor with neighId will be route removed from TT. More...
 
void sendUpdateToStubs (EigrpRouteSource< Ipv6Address > *succ, EigrpRouteSource< Ipv6Address > *oldSucc, EigrpRoute< Ipv6Address > *route) override
 Sends update message to all stub neighbors. More...
 
bool addNetPrefix (const Ipv6Address &network, const short int prefixLen, const int ifaceId) override
 Adds information about IPv6 network prefix. More...
 
- Public Member Functions inherited from inet::eigrp::IEigrpModule< Ipv6Address >
virtual ~IEigrpModule ()
 

Protected Types

typedef std::vector< Ipv6Route * > RouteVector
 
typedef std::vector< EigrpMsgReq * > RequestVector
 
typedef std::vector< IPv6netPrefixPrefixVector
 

Protected Member Functions

virtual void initialize (int stage) override
 
virtual void preDelete (cComponent *root) override
 
virtual void handleMessage (cMessage *msg) override
 Multi-stage initialization. More...
 
virtual int numInitStages () const override
 
virtual void receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override
 
void printSentMsg (int routeCnt, Ipv6Address &destAddress, EigrpMsgReq *msgReq)
 
void printRecvMsg (const EigrpMessage *msg, Ipv6Address &addr, int ifaceId)
 
EigrpTimercreateTimer (char timerKind, void *context)
 Creates timer of specified type. More...
 
void resetTimer (EigrpTimer *timer, int interval)
 Sets specified timer to given interval. More...
 
void startHelloTimer (EigrpInterface *eigrpIface, simtime_t interval)
 Schedule hello timer to the specified interval. More...
 
void cancelHoldTimer (EigrpNeighbor< Ipv6Address > *neigh)
 Stops Hold timer. More...
 
void cancelHelloTimers ()
 Stops Hello Timers on all interfaces. More...
 
PacketcreateHelloPacket (int holdInt, EigrpKValues kValues, Ipv6Address &destAddress, EigrpMsgReq *msgReq)
 
PacketcreateAckPacket (Ipv6Address &destAddress, EigrpMsgReq *msgReq)
 
PacketcreateUpdatePacket (const Ipv6Address &destAddress, EigrpMsgReq *msgReq)
 
PacketcreateQueryPacket (Ipv6Address &destAddress, EigrpMsgReq *msgReq)
 
PacketcreateReplyPacket (Ipv6Address &destAddress, EigrpMsgReq *msgReq)
 
void addMessageHeader (const Ptr< EigrpMessage > &msg, int opcode, EigrpMsgReq *msgReq)
 Adds ControlInfo for network layer module. More...
 
void unlockRoutes (const EigrpMsgReq *msgReq)
 
void createRouteTlv (EigrpMpIpv6Internal *routeTlv, EigrpRoute< Ipv6Address > *route, bool unreachable=false)
 
void addRoutesToMsg (const Ptr< EigrpIpv6Message > &msg, const EigrpMsgReq *msgReq)
 Add routes from request to the message. More...
 
void setRouteTlvMetric (EigrpWideMetricPar *msgMetric, EigrpWideMetricPar *rtMetric)
 
EigrpMsgReqcreateMsgReq (HeaderOpcode msgType, int destNeighbor, int destIface)
 Creates request for sending of EIGRP message for RTP. More...
 
void processTimer (cMessage *msg)
 
void processMsgFromNetwork (cMessage *msg)
 Process message from network layer. More...
 
void processMsgFromRtp (cMessage *msg)
 Process message request from RTP. More...
 
void processAckPacket (Packet *pk, Ipv6Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv6Address > *neigh)
 
void processHelloPacket (Packet *pk, Ipv6Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv6Address > *neigh)
 
void processUpdatePacket (Packet *pk, Ipv6Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv6Address > *neigh)
 
void processQueryPacket (Packet *pk, Ipv6Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv6Address > *neigh)
 
void processReplyPacket (Packet *pk, Ipv6Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv6Address > *neigh)
 
EigrpRouteSource< Ipv6Address > * processInterRoute (const EigrpMpIpv6Internal &tlv, Ipv6Address &nextHop, int sourceNeighId, EigrpInterface *eigrpIface, bool *notifyDual, bool *isSourceNew)
 Process route TLV. More...
 
void sendAllEigrpPaths (EigrpInterface *eigrpIface, EigrpNeighbor< Ipv6Address > *neigh)
 Creates and sends message with all routes from routing table to specified neighbor. More...
 
void processNewNeighbor (int ifaceId, Ipv6Address &srcAddress, const EigrpIpv6Hello *helloMessage)
 Creates relationship with neighbor. More...
 
int checkNeighborshipRules (int ifaceId, int neighAsNum, Ipv6Address &neighAddr, const EigrpKValues &neighKValues)
 Checks neighborship rules. More...
 
EigrpNeighbor< Ipv6Address > * createNeighbor (EigrpInterface *eigrpIface, Ipv6Address &address, uint16_t holdInt)
 Create record in the neighbor table and start hold timer. More...
 
void removeNeighbor (EigrpNeighbor< Ipv6Address > *neigh)
 Removes neighbor from neighbor table and delete it. More...
 
void disableInterface (NetworkInterface *iface, EigrpInterface *eigrpIface)
 Remove interface from EIGRP interface table. More...
 
void enableInterface (EigrpInterface *eigrpIface)
 Add interface to the EIGRP interface table and notifies DUAL. More...
 
EigrpInterfacegetInterfaceById (int ifaceId)
 Returns EIGRP interface (enabled or disabled) or nullptr. More...
 
EigrpInterfaceaddInterfaceToEigrp (int ifaceId, bool enabled)
 Creates interface and inserts it to the table. More...
 
void processIfaceStateChange (NetworkInterface *iface)
 
void processIfaceConfigChange (EigrpInterface *eigrpIface)
 
void processRTRouteDel (const cObject *details)
 
Ipv6Address getNextHopAddr (const Ipv6Address &nextHopAddr, Ipv6Address &senderAddr)
 Returns next hop address. More...
 
bool getDestIpAddress (int destNeigh, Ipv6Address *resultAddress)
 Returns IP address for sending EIGRP message. More...
 
bool removeRouteFromRT (EigrpRouteSource< Ipv6Address > *successor, IRoute::SourceType *removedRtSrc)
 
Ipv6RoutecreateRTRoute (EigrpRouteSource< Ipv6Address > *successor)
 
bool installRouteToRT (EigrpRoute< Ipv6Address > *route, EigrpRouteSource< Ipv6Address > *source, uint64_t dmin, Ipv6Route *rtEntry)
 Updates existing route in the routing table or creates new one. More...
 
bool isRTSafeForAdd (EigrpRoute< Ipv6Address > *route, unsigned int eigrpAd)
 Returns true, if routing table does not contain route with given address, mask and smaller administrative distance. More...
 
void setRTRouteMetric (Ipv6Route *route, uint64_t metric)
 Changes metric of route in routing table. More...
 
bool removeOldSuccessor (EigrpRouteSource< Ipv6Address > *source, EigrpRoute< Ipv6Address > *route)
 Removes route from routing table and changes old successor's record in topology table. More...
 
void msgToAllIfaces (int destination, HeaderOpcode msgType, EigrpRouteSource< Ipv6Address > *source, bool forcePoisonRev, bool forceUnreachable)
 Records request to send message to all neighbors. More...
 
void msgToIface (HeaderOpcode msgType, EigrpRouteSource< Ipv6Address > *source, EigrpInterface *eigrpIface, bool forcePoisonRev=false, bool forceUnreachable=false)
 Creates request for sending message on specified interface. More...
 
void flushMsgRequests ()
 Sends all message requests to RTP. More...
 
EigrpMsgReqpushMsgRouteToQueue (HeaderOpcode msgType, int ifaceId, int neighId, const EigrpMsgRoute &msgRt)
 Insert route into the queue with requests. More...
 
bool applySplitHorizon (EigrpInterface *destInterface, EigrpRouteSource< Ipv6Address > *source, EigrpRoute< Ipv6Address > *route)
 
bool applyStubToUpdate (EigrpRouteSource< Ipv6Address > *src)
 Apply stub configuration to the route in outgoing Update message. More...
 
bool applyStubToQuery (EigrpInterface *eigrpIface, int numOfNeigh)
 Apply stub configuration to the route in outgoing Query message. More...
 
Ipv6RoutefindRoute (const Ipv6Address &prefix, int prefixLength)
 
Ipv6RoutefindRoute (const Ipv6Address &prefix, int prefixLength, const Ipv6Address &nexthop)
 

Protected Attributes

cModule * host = nullptr
 
const int64_t sizeOfMsg = 20
 
const char * SPLITTER_OUTGW
 Output gateway to the EIGRP Splitter module. More...
 
const char * RTP_OUTGW
 Output gateway to the RTP module. More...
 
const Ipv6Address EIGRP_IPV6_MULT
 Multicast address for EIGRP messages. More...
 
EigrpKValues KVALUES_MAX
 K-values (from K1 to K5) are set to max. More...
 
const Ipv6Address EIGRP_SELF_ADDR
 Next hop address 0.0.0.0 (self address) More...
 
EigrpRouteSource< Ipv6Address > * oldsource = nullptr
 Latest route change. More...
 
int asNum
 Autonomous system number. More...
 
EigrpKValues kValues
 K-values for calculation of metric. More...
 
int maximumPath
 Maximum number of parallel routes that EIGRP will support. More...
 
int variance
 Parameter for unequal cost load balancing. More...
 
unsigned int adminDistInt
 Administrative distance. More...
 
bool useClassicMetric
 Use classic metric computation or wide metric computation. More...
 
int ribScale
 Scaling factor for Wide metric. More...
 
bool eigrpStubEnabled
 True when EIGRP stub is on. More...
 
EigrpStub eigrpStub
 EIGRP stub configuration. More...
 
ModuleRefByPar< IInterfaceTableift
 
ModuleRefByPar< Ipv6RoutingTablert
 
EigrpDual< Ipv6Address > * eigrpDual
 
EigrpMetricHelpereigrpMetric
 
EigrpInterfaceTableeigrpIft
 Table with enabled EIGRP interfaces. More...
 
EigrpDisabledInterfaceseigrpIftDisabled
 Disabled EIGRP interfaces. More...
 
EigrpNeighborTable< Ipv6Address > * eigrpNt
 Table with EIGRP neighbors. More...
 
EigrpTopologyTable< Ipv6Address > * eigrpTt
 Topology table. More...
 
EigrpNetworkTable< Ipv6Address > * routingForNetworks
 Networks included in EIGRP. More...
 
RequestVector reqQueue
 Requests for sending EIGRP messages from DUAL. More...
 
PrefixVector netPrefixes
 

Additional Inherited Members

- Static Public Attributes inherited from inet::eigrp::IEigrpPdm< Ipv6Address >
static const int UNSPEC_RECEIVER
 Unspecified address of receiver - all neighbors. More...
 
static const int STUB_RECEIVER
 All stub neighbors. More...
 
static const int CONNECTED_ROUTE
 
static const int UNSPEC_SENDER
 Unspecified address of sender - input event source. More...
 
static const bool RT_UNREACHABLE
 

Member Typedef Documentation

◆ PrefixVector

◆ RequestVector

typedef std::vector<EigrpMsgReq *> inet::eigrp::EigrpIpv6Pdm::RequestVector
protected

◆ RouteVector

typedef std::vector<Ipv6Route *> inet::eigrp::EigrpIpv6Pdm::RouteVector
protected

Constructor & Destructor Documentation

◆ EigrpIpv6Pdm()

inet::eigrp::EigrpIpv6Pdm::EigrpIpv6Pdm ( )
38  : EIGRP_IPV6_MULT(Ipv6Address("FF02::A"))
39 {
40  SPLITTER_OUTGW = "splitterOut";
41  RTP_OUTGW = "rtpOut";
42 
44 
45  asNum = -1;
46  maximumPath = 4;
47  variance = 1;
48  adminDistInt = 90;
49  useClassicMetric = true;
50  ribScale = 128;
51 
52  kValues.K1 = kValues.K3 = 1;
53  kValues.K2 = kValues.K4 = kValues.K5 = kValues.K6 = 0;
54 
55  eigrpStubEnabled = false;
56 }

◆ ~EigrpIpv6Pdm()

inet::eigrp::EigrpIpv6Pdm::~EigrpIpv6Pdm ( )
59 {
60  delete this->routingForNetworks;
61  delete this->eigrpIftDisabled;
62  delete this->eigrpDual;
63  delete this->eigrpMetric;
64 }

Member Function Documentation

◆ addInterface() [1/2]

void inet::eigrp::EigrpIpv6Pdm::addInterface ( int  interfaceId,
bool  enabled 
)
inlineoverridevirtual

Adds interface to EIGRP for IPv6.

Parameters
interfaceIdID of interface
enabledstate of interface in EIGRP process, enabled or disabled

Implements inet::eigrp::IEigrpModule< Ipv6Address >.

298 { addInterfaceToEigrp(ifaceId, enabled); }

◆ addInterface() [2/2]

void inet::eigrp::EigrpIpv6Pdm::addInterface ( int  interfaceId,
int  networkId,
bool  enabled 
)
inlineoverridevirtual

Adds interface to EIGRP.

Parameters
interfaceIdID of interface
networkIDID of network in EigrpNetworkTable

Implements inet::eigrp::IEigrpModule< Ipv6Address >.

297 { /* useful only for IPv4 */ }

◆ addInterfaceToEigrp()

EigrpInterface * inet::eigrp::EigrpIpv6Pdm::addInterfaceToEigrp ( int  ifaceId,
bool  enabled 
)
protected

Creates interface and inserts it to the table.

1441 {
1442  NetworkInterface *iface = ift->getInterfaceById(ifaceId);
1443  // create EIGRP interface
1444  EigrpInterface *eigrpIface = nullptr;
1445 
1446  eigrpIface = getInterfaceById(ifaceId); // search for existing iface
1447 
1448  if (eigrpIface == nullptr) { // iface not found -> create new
1449  eigrpIface = new EigrpInterface(iface, EigrpNetworkTable<Ipv6Address>::UNSPEC_NETID, false);
1450  }
1451 
1452  if (enabled) {
1453  enableInterface(eigrpIface);
1454  startHelloTimer(eigrpIface, simTime() + uniform(0, 1));
1455  }
1456  else {
1457  eigrpIftDisabled->addInterface(eigrpIface);
1458  }
1459 
1460  return eigrpIface;
1461 }

Referenced by setHelloInt(), setHoldInt(), setPassive(), and setSplitHorizon().

◆ addMessageHeader()

void inet::eigrp::EigrpIpv6Pdm::addMessageHeader ( const Ptr< EigrpMessage > &  msg,
int  opcode,
EigrpMsgReq msgReq 
)
protected

Adds ControlInfo for network layer module.

865 {
866  msg->setOpcode(opcode);
867  msg->setAsNum(this->asNum);
868  msg->setInit(msgReq->getInit());
869  msg->setEot(msgReq->getEot());
870  msg->setRs(msgReq->getRs());
871  msg->setCr(msgReq->getCr());
872 }

Referenced by createAckPacket(), createHelloPacket(), createQueryPacket(), createReplyPacket(), and createUpdatePacket().

◆ addNetPrefix()

bool inet::eigrp::EigrpIpv6Pdm::addNetPrefix ( const Ipv6Address network,
const short int  prefixLen,
const int  ifaceId 
)
overridevirtual

Adds information about IPv6 network prefix.

Parameters
networknetwork prefix
prefixLenlength of network prefix
ifaceIdID of interface contains network prefix
Returns
True if successfully added, otherwise false (e.g. same IPv6 prefix on different interfaces)
Note
Checks duplicates

Implements inet::eigrp::IEigrpModule< Ipv6Address >.

1951 {
1952  PrefixVector::iterator it;
1953 
1954  for (it = netPrefixes.begin(); it != netPrefixes.end(); ++it) { // through all known prefixes search same prefix
1955  if (it->network == network && it->prefixLength == prefixLen) { // found same prefix
1956  if (it->ifaceId == ifaceId) { // belonging to same interface = more than one IPv6 addresses from same prefix on interface = ok -> already added
1957  return true;
1958  }
1959  else { // same prefix on different interfaces = bad -> do not add
1960  return false;
1961  }
1962  }
1963  }
1964 
1965  // Add new prefix
1966  IPv6netPrefix newprefix;
1967  newprefix.network = network;
1968  newprefix.prefixLength = prefixLen;
1969  newprefix.ifaceId = ifaceId;
1970  this->netPrefixes.push_back(newprefix);
1971 
1972 // EV_DEBUG << "Added prefix: " << this->netPrefixes.back().network << "/" << this->netPrefixes.back().prefixLength << " on iface " << this->netPrefixes.back().ifaceId << endl;
1973 
1974  return true;
1975 }

◆ addNetwork()

EigrpNetwork< Ipv6Address > * inet::eigrp::EigrpIpv6Pdm::addNetwork ( Ipv6Address  address,
Ipv6Address  mask 
)
overridevirtual

Adds new network to EigrpNetworkTable for routing.

Implements inet::eigrp::IEigrpModule< Ipv6Address >.

1542 {
1543  return routingForNetworks->addNetwork(address, mask);
1544 }

Referenced by enableInterface().

◆ addRoutesToMsg()

void inet::eigrp::EigrpIpv6Pdm::addRoutesToMsg ( const Ptr< EigrpIpv6Message > &  msg,
const EigrpMsgReq msgReq 
)
protected

Add routes from request to the message.

918 {
919  // Add routes to the message
920  int reqCnt = msgReq->getRoutesArraySize();
921  EigrpRouteSource<Ipv6Address> *source = nullptr;
922  EigrpRoute<Ipv6Address> *route = nullptr;
923 
924  msg->setInterRoutesArraySize(reqCnt);
925  for (int i = 0; i < reqCnt; i++) {
926  EigrpMpIpv6Internal routeTlv;
927  EigrpMsgRoute req = msgReq->getRoutes(i);
928 
929  if ((source = eigrpTt->findRouteById(req.sourceId)) == nullptr) { // Route was removed (only for sent Update messages to stub routers)
930  route = eigrpTt->findRouteInfoById(req.routeId);
931  ASSERT(route != nullptr);
932  }
933  else {
934  route = source->getRouteInfo();
935  }
936  routeTlv.routerID = req.originator;
937  createRouteTlv(&routeTlv, route, req.unreachable);
938 
939  msg->setInterRoutes(i, routeTlv);
940 
941 #ifdef EIGRP_DEBUG
942  EV_DEBUG << " route: " << routeTlv.destAddress << "/" << getNetmaskLength(routeTlv.destMask);
943  EV_DEBUG << " originator: " << routeTlv.routerID;
944  if (eigrpMetric->isParamMaximal(routeTlv.metric)) EV_DEBUG << " (unreachable) ";
945  EV_DEBUG << ", bw: " << routeTlv.metric.bandwidth;
946  EV_DEBUG << ", dly: " << routeTlv.metric.delay;
947  EV_DEBUG << ", hopcnt: " << (int)routeTlv.metric.hopCount;
948  EV_DEBUG << endl;
949 #endif
950  }
951 }

Referenced by createQueryPacket(), createReplyPacket(), and createUpdatePacket().

◆ applySplitHorizon()

bool inet::eigrp::EigrpIpv6Pdm::applySplitHorizon ( EigrpInterface destInterface,
EigrpRouteSource< Ipv6Address > *  source,
EigrpRoute< Ipv6Address > *  route 
)
protected
Returns
true, if Split Horizon rule is met for the route, otherwise false.
1315 {
1316  if (route->getNumSucc() <= 1) // Only 1 successor, check its interface ID (source is always successor)
1317  return destInterface->getInterfaceId() == source->getIfaceId();
1318  else // There is more than 1 successor. Is any of them on the interface?
1319  return eigrpTt->getBestSuccessorByIf(route, destInterface->getInterfaceId()) != nullptr;
1320 }

Referenced by msgToIface(), sendAllEigrpPaths(), and setReplyStatusTable().

◆ applyStubToQuery()

bool inet::eigrp::EigrpIpv6Pdm::applyStubToQuery ( EigrpInterface eigrpIface,
int  numOfNeigh 
)
protected

Apply stub configuration to the route in outgoing Query message.

Returns
true, if stub setting limits sending of the route, otherwise false
1239 {
1240  if (this->eigrpStubEnabled)
1241  return false; // Send Query to all neighbors
1242  if (numOfNeigh == eigrpIface->getNumOfStubs())
1243  return true; // Do not send Query to stub router
1244  return false;
1245 }

Referenced by msgToAllIfaces().

◆ applyStubToUpdate()

bool inet::eigrp::EigrpIpv6Pdm::applyStubToUpdate ( EigrpRouteSource< Ipv6Address > *  src)
protected

Apply stub configuration to the route in outgoing Update message.

Returns
true, if stub setting limits sending of the route, otherwise false
1323 {
1324  if (this->eigrpStub.recvOnlyRt)
1325  return true; // Do not send any route
1326 
1327  // Send only specified type of route
1328  else if (this->eigrpStub.connectedRt && src->getNexthopId() == EigrpNeighbor<Ipv6Address>::UNSPEC_ID)
1329  return false;
1330  else if (this->eigrpStub.redistributedRt && src->isRedistributed())
1331  return false;
1332  else if (this->eigrpStub.summaryRt && src->isSummary())
1333  return false;
1334  else if (this->eigrpStub.staticRt && src->isRedistributed())
1335  return false;
1336 
1337  // TODO leakMapRt
1338 
1339  return true;
1340 }

Referenced by sendAllEigrpPaths(), and sendUpdate().

◆ cancelHelloTimers()

void inet::eigrp::EigrpIpv6Pdm::cancelHelloTimers ( )
protected

Stops Hello Timers on all interfaces.

1103 {
1104  EigrpInterface *iface;
1105  EigrpTimer *timer;
1106 
1107  int cnt = this->eigrpIft->getNumInterfaces();
1108  for (int i = 0; i < cnt; i++) {
1109  iface = this->eigrpIft->getInterface(i);
1110 
1111  if ((timer = iface->getHelloTimer()) != nullptr) {
1112  if (timer->isScheduled()) {
1113  timer->getOwner();
1114  cancelEvent(timer);
1115  }
1116 
1117  iface->setHelloTimerPtr(nullptr);
1118  delete timer;
1119  }
1120  }
1121 
1122  cnt = this->eigrpIftDisabled->getNumInterfaces();
1123  for (int i = 0; i < cnt; i++) {
1124  iface = this->eigrpIftDisabled->getInterface(i);
1125 
1126  if ((timer = iface->getHelloTimer()) != nullptr) {
1127  if (timer->isScheduled()) {
1128  timer->getOwner();
1129  cancelEvent(timer);
1130  }
1131 
1132  iface->setHelloTimerPtr(nullptr);
1133  delete timer;
1134  }
1135  }
1136 }

Referenced by preDelete().

◆ cancelHoldTimer()

void inet::eigrp::EigrpIpv6Pdm::cancelHoldTimer ( EigrpNeighbor< Ipv6Address > *  neigh)
protected

Stops Hold timer.

1091 {
1092  EigrpTimer *timer;
1093 
1094  if ((timer = neigh->getHoldTimer()) != nullptr) {
1095  if (timer->isScheduled()) {
1096  timer->getOwner();
1097  cancelEvent(timer);
1098  }
1099  }
1100 }

Referenced by removeNeighbor().

◆ checkNeighborshipRules()

int inet::eigrp::EigrpIpv6Pdm::checkNeighborshipRules ( int  ifaceId,
int  neighAsNum,
Ipv6Address neighAddr,
const EigrpKValues neighKValues 
)
protected

Checks neighborship rules.

Parameters
ifaceIdID of interface where the neighbor is connected.
Returns
returns code from enumeration eigrp::UserMsgCodes.
1051 {
1052  Ipv6Address ifaceAddr, ifaceMask;
1053 
1054  if (this->eigrpIft->findInterfaceById(ifaceId) == nullptr) { // EIGRP must be enabled on interface
1055  return eigrp::M_DISABLED_ON_IF;
1056  }
1057  else if (this->asNum != neighAsNum) { // AS numbers must be equal
1058  return eigrp::M_NEIGH_BAD_AS;
1059  }
1060  else if (!(this->kValues == neighKValues)) { // K-values must be same
1062  }
1063  else {
1064  // check, if the neighbor uses as source address Link-local address
1065  if (neighAddr.getScope() != Ipv6Address::LINK) { // source address is not Link-local address -> bad
1067  }
1068  }
1069 
1070  return eigrp::M_OK;
1071 }

Referenced by processNewNeighbor().

◆ createAckPacket()

Packet * inet::eigrp::EigrpIpv6Pdm::createAckPacket ( Ipv6Address destAddress,
EigrpMsgReq msgReq 
)
protected
791 {
792  const auto& msg = makeShared<EigrpIpv6Ack>();
793  addMessageHeader(msg, EIGRP_HELLO_MSG, msgReq);
794  msg->setAckNum(msgReq->getAckNumber());
795 // addCtrInfo(msg, msgReq->getDestInterface(), destAddress);
796 
797  msg->setChunkLength(B(sizeOfMsg));
798 
799  Packet *packet = new Packet();
800  packet->insertAtBack(msg);
801  return packet;
802 }

Referenced by processMsgFromRtp().

◆ createHelloPacket()

Packet * inet::eigrp::EigrpIpv6Pdm::createHelloPacket ( int  holdInt,
EigrpKValues  kValues,
Ipv6Address destAddress,
EigrpMsgReq msgReq 
)
protected
764 {
765 
766  const auto& msg = makeShared<EigrpIpv6Hello>();
767  EigrpTlvParameter paramTlv;
768 
769  addMessageHeader(msg, EIGRP_HELLO_MSG, msgReq);
770 
771  // Add parameter type TLV
772  paramTlv.holdTimer = holdInt;
773  paramTlv.kValues = kValues;
774  msg->setParameterTlv(paramTlv);
775 
776  // Add stub TLV
777  if (this->eigrpStubEnabled) {
778  EigrpTlvStub stubTlv;
779  stubTlv.stub = this->eigrpStub;
780  msg->setStubTlv(stubTlv);
781  }
782 
783  msg->setChunkLength(B(sizeOfMsg + 12));
784 
785  Packet *packet = new Packet();
786  packet->insertAtBack(msg);
787  return packet;
788 }

Referenced by processMsgFromRtp().

◆ createMsgReq()

EigrpMsgReq * inet::eigrp::EigrpIpv6Pdm::createMsgReq ( HeaderOpcode  msgType,
int  destNeighbor,
int  destIface 
)
protected

Creates request for sending of EIGRP message for RTP.

954 {
955  EigrpMsgReq *msgReq = new EigrpMsgReq(eigrp::UserMsgs[msgType]);
956 
957  msgReq->setOpcode(msgType);
958  msgReq->setDestNeighbor(destNeighbor);
959  msgReq->setDestInterface(destIface);
960 
961  return msgReq;
962 }

Referenced by processHelloPacket(), processNewNeighbor(), processTimer(), pushMsgRouteToQueue(), and sendAllEigrpPaths().

◆ createNeighbor()

EigrpNeighbor< Ipv6Address > * inet::eigrp::EigrpIpv6Pdm::createNeighbor ( EigrpInterface eigrpIface,
Ipv6Address address,
uint16_t  holdInt 
)
protected

Create record in the neighbor table and start hold timer.

1074 {
1075  // Create record in the neighbor table
1076  EigrpNeighbor<Ipv6Address> *neigh = new EigrpNeighbor<Ipv6Address>(eigrpIface->getInterfaceId(), eigrpIface->getInterfaceName(), address);
1077  EigrpTimer *holdt = createTimer(EIGRP_HOLD_TIMER, neigh);
1078  neigh->setHoldTimer(holdt);
1079  neigh->setHoldInt(holdInt);
1080  eigrpNt->addNeighbor(neigh);
1081  // Start Hold timer
1082  scheduleAt(simTime() + holdInt, holdt);
1083 
1084  eigrpIface->incNumOfNeighbors();
1085 
1086  return neigh;
1087 }

Referenced by processNewNeighbor().

◆ createQueryPacket()

Packet * inet::eigrp::EigrpIpv6Pdm::createQueryPacket ( Ipv6Address destAddress,
EigrpMsgReq msgReq 
)
protected
824 {
825  const auto& msg = makeShared<EigrpIpv6Query>();
826  int routeCnt = msgReq->getRoutesArraySize();
827 
828  addMessageHeader(msg, EIGRP_QUERY_MSG, msgReq);
829  msg->setAckNum(msgReq->getAckNumber());
830  msg->setSeqNum(msgReq->getSeqNumber());
831 
832  // Add route TLV
833  if (routeCnt > 0) addRoutesToMsg(msg, msgReq);
834 
835  msg->setChunkLength(B(sizeOfMsg + routeCnt * 68));
836 
837  Packet *packet = new Packet();
838  packet->insertAtBack(msg);
839  return packet;
840 }

Referenced by processMsgFromRtp().

◆ createReplyPacket()

Packet * inet::eigrp::EigrpIpv6Pdm::createReplyPacket ( Ipv6Address destAddress,
EigrpMsgReq msgReq 
)
protected
843 {
844  const auto& msg = makeShared<EigrpIpv6Reply>();
845  int routeCnt = msgReq->getRoutesArraySize();
846 
847  addMessageHeader(msg, EIGRP_REPLY_MSG, msgReq);
848  msg->setAckNum(msgReq->getAckNumber());
849  msg->setSeqNum(msgReq->getSeqNumber());
850 
851  // Add route TLV
852  if (routeCnt > 0) {
853  addRoutesToMsg(msg, msgReq);
854  unlockRoutes(msgReq); // Locked RouteInfos are unlocked and can be removed
855  }
856 
857  msg->setChunkLength(B(sizeOfMsg + routeCnt * 68));
858 
859  Packet *packet = new Packet();
860  packet->insertAtBack(msg);
861  return packet;
862 }

Referenced by processMsgFromRtp().

◆ createRouteTlv()

void inet::eigrp::EigrpIpv6Pdm::createRouteTlv ( EigrpMpIpv6Internal routeTlv,
EigrpRoute< Ipv6Address > *  route,
bool  unreachable = false 
)
protected
875 {
876  EigrpWideMetricPar rtMetric = route->getRdPar();
877  routeTlv->destAddress = route->getRouteAddress();
878  routeTlv->destMask = route->getRouteMask();
879  routeTlv->nextHop = Ipv6Address::UNSPECIFIED_ADDRESS;
880  setRouteTlvMetric(&routeTlv->metric, &rtMetric);
881  if (unreachable) {
882  routeTlv->metric.delay = EigrpMetricHelper::DELAY_INF;
883  routeTlv->metric.bandwidth = EigrpMetricHelper::BANDWIDTH_INF;
884  }
885 }

Referenced by addRoutesToMsg().

◆ createRTRoute()

Ipv6Route * inet::eigrp::EigrpIpv6Pdm::createRTRoute ( EigrpRouteSource< Ipv6Address > *  successor)
protected
1193 {
1194  EigrpRoute<Ipv6Address> *route = successor->getRouteInfo();
1195 // ANSAIPv6Route *rtEntry = new ANSAIPv6Route(route->getRouteAddress(), getNetmaskLength(route->getRouteMask()), IPv6Route::ROUTING_PROT);
1196  Ipv6Route *rtEntry = new Ipv6Route(route->getRouteAddress(), getNetmaskLength(route->getRouteMask()), IRoute::EIGRP);
1197  rtEntry->setInterface(ift->getInterfaceById(successor->getIfaceId()));
1198  rtEntry->setNextHop(successor->getNextHop());
1199  setRTRouteMetric(rtEntry, successor->getMetric());
1200 
1201  // Set protocol source and AD
1202  if (successor->isInternal()) {
1203 // rtEntry->setSourceType(IPv6Route::EIGRP);
1204  rtEntry->setAdminDist(Ipv6Route::dEIGRPInternal);
1205  }
1206  else {
1207 // rtEntry->setRoutingProtocolSource(ANSAIPv6Route::pEIGRPext);
1208  rtEntry->setAdminDist(Ipv6Route::dEIGRPExternal);
1209  }
1210  return rtEntry;
1211 }

Referenced by installRouteToRT().

◆ createTimer()

EigrpTimer * inet::eigrp::EigrpIpv6Pdm::createTimer ( char  timerKind,
void *  context 
)
protected

Creates timer of specified type.

755 {
756  EigrpTimer *timer = new EigrpTimer();
757  timer->setTimerKind(timerKind);
758  timer->setContextPointer(context);
759 
760  return timer;
761 }

Referenced by createNeighbor(), and startHelloTimer().

◆ createUpdatePacket()

Packet * inet::eigrp::EigrpIpv6Pdm::createUpdatePacket ( const Ipv6Address destAddress,
EigrpMsgReq msgReq 
)
protected
805 {
806  const auto& msg = makeShared<EigrpIpv6Update>();
807  int routeCnt = msgReq->getRoutesArraySize();
808 
809  addMessageHeader(msg, EIGRP_UPDATE_MSG, msgReq);
810  msg->setAckNum(msgReq->getAckNumber());
811  msg->setSeqNum(msgReq->getSeqNumber());
812 
813  // Add route TLV
814  if (routeCnt > 0) addRoutesToMsg(msg, msgReq);
815 
816  msg->setChunkLength(B(sizeOfMsg + routeCnt * 68));
817 
818  Packet *packet = new Packet();
819  packet->insertAtBack(msg);
820  return packet;
821 }

Referenced by processMsgFromRtp().

◆ disableInterface()

void inet::eigrp::EigrpIpv6Pdm::disableInterface ( NetworkInterface iface,
EigrpInterface eigrpIface 
)
protected

Remove interface from EIGRP interface table.

Removes all neighbors on the interface.

1384 {
1385  EigrpTimer *hellot;
1386  EigrpNeighbor<Ipv6Address> *neigh;
1387  EigrpRouteSource<Ipv6Address> *source;
1388  int neighCount;
1389  int ifaceId = eigrpIface->getInterfaceId();
1390 
1391  EV_DEBUG << "EIGRP disabled on interface " << eigrpIface->getName() << "(" << ifaceId << ")" << endl;
1392 
1393  if (!eigrpIface->isPassive()) {
1394  // Unregister multicast address
1395  Ipv6InterfaceData *ipv6int = iface->getProtocolDataForUpdate<Ipv6InterfaceData>();
1396  ipv6int->leaveMulticastGroup(EIGRP_IPV6_MULT);
1397  ipv6int->removeAddress(EIGRP_IPV6_MULT);
1398  }
1399 
1400 // iface->ipv6Data()->leaveMulticastGroup(EIGRP_IPV6_MULT);
1401 // iface->ipv6Data()->removeAddress(EIGRP_IPV6_MULT);
1402 
1403  // stop hello timer
1404  if ((hellot = eigrpIface->getHelloTimer()) != nullptr)
1405  cancelEvent(hellot);
1406 
1407  std::set<int>::iterator it;
1408  EigrpNetwork<Ipv6Address> *eigrpnet = nullptr;
1409 
1410  for (it = eigrpIface->getNetworksIdsBegin(); it != eigrpIface->getNetworksIdsEnd(); ++it) {
1411  eigrpnet = routingForNetworks->findNetworkById(*it);
1412  source = eigrpTt->findRoute(eigrpnet->getAddress(), eigrpnet->getMask(), EigrpNeighbor<Ipv6Address>::UNSPEC_ID);
1413  ASSERT(source != nullptr);
1414  // Notify DUAL about event
1416  }
1417 
1418  eigrpIface->clearNetworkIds();
1419 
1420  // Remove interface from EIGRP interface table (must be there)
1421  if (eigrpIface->isEnabled()) {
1422  eigrpIft->removeInterface(eigrpIface);
1423  eigrpIftDisabled->addInterface(eigrpIface);
1424  eigrpIface->setEnabling(false);
1425  }
1426 
1427  // Delete all neighbors on the interface
1428  neighCount = eigrpNt->getNumNeighbors();
1429  for (int i = 0; i < neighCount; i++) {
1430  neigh = eigrpNt->getNeighbor(i);
1431  if (neigh->getIfaceId() == ifaceId) {
1432  removeNeighbor(neigh);
1433  }
1434  }
1435 
1436  flushMsgRequests();
1437  eigrpTt->purgeTable();
1438 }

Referenced by processIfaceStateChange().

◆ enableInterface()

void inet::eigrp::EigrpIpv6Pdm::enableInterface ( EigrpInterface eigrpIface)
protected

Add interface to the EIGRP interface table and notifies DUAL.

1464 {
1465  int ifaceId = eigrpIface->getInterfaceId();
1466  EigrpRouteSource<Ipv6Address> *src;
1467  EigrpWideMetricPar metricPar;
1468  bool isSourceNew;
1469 
1470  EV_DEBUG << "EIGRP enabled on interface " << eigrpIface->getName() << "(" << ifaceId << ")" << endl;
1471 
1472  // Move interface to EIGRP interface table
1473  if (!eigrpIface->isEnabled()) {
1474  eigrpIftDisabled->removeInterface(eigrpIface);
1475  eigrpIft->addInterface(eigrpIface);
1476  eigrpIface->setEnabling(true);
1477  }
1478 
1479  // Register multicast address on interface //TODO - should be passive interface joined in multicast group?
1480 // IPv6InterfaceData *ifaceIpv6 = ift->getInterfaceById(ifaceId)->ipv6Data();
1481  //ifaceIpv6->joinMulticastGroup(EIGRP_IPV6_MULT); //join to group FF02::A, optionally
1482  //ifaceIpv6->assignAddress(EIGRP_IPV6_MULT, false, 0, 0); //add group address to interface, mandatory
1483 
1484  Ipv6InterfaceData *ipv6int = ift->getInterfaceById(ifaceId)->getProtocolDataForUpdate<Ipv6InterfaceData>();
1485  ipv6int->joinMulticastGroup(EIGRP_IPV6_MULT);
1486  ipv6int->assignAddress(EIGRP_IPV6_MULT, false, 0, 0);
1487 
1488  PrefixVector::iterator it;
1489  EigrpNetwork<Ipv6Address> *eigrpnet = nullptr;
1490  Ipv6Address network;
1491  Ipv6Address mask;
1492 
1493  for (it = netPrefixes.begin(); it != netPrefixes.end(); ++it) { // through all known prefixes search prefixes belonging to enabling interface
1494  if (it->ifaceId == ifaceId) { // found prefix belonging to interface
1495  network = it->network;
1496  mask = Ipv6Address(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff).getPrefix(it->prefixLength);
1497 
1498  eigrpnet = addNetwork(network, mask);
1499 
1500  if (eigrpnet) { // successfully added to EigrpNetworkTable -> tie with interface
1501  eigrpIface->insertToNetworksIds(eigrpnet->getNetworkId()); // pak predelat na protected a pridat metody
1502  }
1503 
1504  // Create route
1505  src = eigrpTt->findOrCreateRoute(network, mask, eigrpTt->getRouterId(), eigrpIface, EigrpNeighbor<Ipv6Address>::UNSPEC_ID, &isSourceNew);
1506  ASSERT(isSourceNew == true);
1507  // Compute metric
1508  metricPar = eigrpMetric->getParam(eigrpIface);
1509  src->setMetricParams(metricPar);
1510  uint64_t metric = eigrpMetric->computeClassicMetric(metricPar, this->kValues);
1511  src->setMetric(metric);
1512 
1513  // Notify DUAL about event
1515  }
1516  }
1517 
1518  flushMsgRequests();
1519  eigrpTt->purgeTable();
1520 }

Referenced by addInterfaceToEigrp(), and processIfaceStateChange().

◆ findRoute() [1/2]

Ipv6Route * inet::eigrp::EigrpIpv6Pdm::findRoute ( const Ipv6Address prefix,
int  prefixLength 
)
protected
1922  {
1923  Ipv6Route *route = nullptr;
1924 
1925  for (int i = 0; i < rt->getNumRoutes(); i++) {
1926  auto it = rt->getRoute(i);
1927 
1928  if (it->getDestPrefix() == prefix && it->getPrefixLength() == prefixLength) {
1929  route = it;
1930  break;
1931  }
1932  }
1933 
1934  return route;
1935 }

Referenced by isRTSafeForAdd(), processIfaceStateChange(), removeRouteFromRT(), and updateRoute().

◆ findRoute() [2/2]

Ipv6Route * inet::eigrp::EigrpIpv6Pdm::findRoute ( const Ipv6Address prefix,
int  prefixLength,
const Ipv6Address nexthop 
)
protected
1938  {
1939  Ipv6Route *route = nullptr;
1940  for (int i = 0; i < rt->getNumRoutes(); i++) {
1941  auto it = rt->getRoute(i);
1942  if (it->getDestPrefix() == prefix && it->getPrefixLength() == prefixLength && it->getNextHop() == nexthop) {
1943  route = it;
1944  break;
1945  }
1946  }
1947  return route;
1948 }

◆ findRouteDMin()

uint64_t inet::eigrp::EigrpIpv6Pdm::findRouteDMin ( EigrpRoute< Ipv6Address > *  route)
inlineoverridevirtual

Returns minimal distance to destination network.

Implements inet::eigrp::IEigrpPdm< Ipv6Address >.

321 { return eigrpTt->findRouteDMin(route); }

◆ flushMsgRequests()

void inet::eigrp::EigrpIpv6Pdm::flushMsgRequests ( )
protected

Sends all message requests to RTP.

1343 {
1344  RequestVector::iterator it;
1345  Ipv6Address destAddress;
1346 
1347  // Send Query
1348  for (it = reqQueue.begin(); it != reqQueue.end(); it++) {
1349  if ((*it)->getOpcode() == EIGRP_QUERY_MSG) {
1350  // Check if interface exists
1351  if (eigrpIft->findInterfaceById((*it)->getDestInterface()) == nullptr)
1352  continue;
1353  else
1354  send(*it, RTP_OUTGW);
1355  }
1356  }
1357 
1358  // Send other messages
1359  for (it = reqQueue.begin(); it != reqQueue.end(); it++) {
1360  // Check if interface exists
1361  if (eigrpIft->findInterfaceById((*it)->getDestInterface()) == nullptr) {
1362  delete *it; // Discard request
1363  continue;
1364  }
1365 
1366  if ((*it)->getOpcode() != EIGRP_QUERY_MSG)
1367  send(*it, RTP_OUTGW);
1368  }
1369 
1370  reqQueue.clear();
1371 }

Referenced by disableInterface(), enableInterface(), processHelloPacket(), processIfaceConfigChange(), processQueryPacket(), processReplyPacket(), processTimer(), and processUpdatePacket().

◆ getASNum()

int inet::eigrp::EigrpIpv6Pdm::getASNum ( )
inlineoverridevirtual

Implements inet::eigrp::IEigrpModule< Ipv6Address >.

301 { return this->asNum; }

◆ getBestSuccessor()

EigrpRouteSource<Ipv6Address>* inet::eigrp::EigrpIpv6Pdm::getBestSuccessor ( EigrpRoute< Ipv6Address > *  route)
inlineoverridevirtual

Returns best successor for specified network.

Implements inet::eigrp::IEigrpPdm< Ipv6Address >.

323 { return eigrpTt->getBestSuccessor(route); }

◆ getDestIpAddress()

bool inet::eigrp::EigrpIpv6Pdm::getDestIpAddress ( int  destNeigh,
Ipv6Address resultAddress 
)
protected

Returns IP address for sending EIGRP message.

431 {
432  EigrpNeighbor<Ipv6Address> *neigh = nullptr;
433  const uint32_t *addr = nullptr;
434 
435  if (destNeigh == EigrpNeighbor<Ipv6Address>::UNSPEC_ID) { // destination neighbor unset -> use multicast
436  addr = EIGRP_IPV6_MULT.words();
437  resultAddress->set(addr[0], addr[1], addr[2], addr[3]);
438  }
439  else { // destination neighbor set -> use unicast
440  if ((neigh = eigrpNt->findNeighborById(destNeigh)) == nullptr)
441  return false;
442  addr = neigh->getIPAddress().words();
443  resultAddress->set(addr[0], addr[1], addr[2], addr[3]);
444  }
445 
446  return true;
447 }

Referenced by processMsgFromRtp().

◆ getInterfaceById()

EigrpInterface * inet::eigrp::EigrpIpv6Pdm::getInterfaceById ( int  ifaceId)
protected

Returns EIGRP interface (enabled or disabled) or nullptr.

1374 {
1375  EigrpInterface *iface;
1376 
1377  if ((iface = eigrpIft->findInterfaceById(ifaceId)) != nullptr)
1378  return iface;
1379  else
1380  return eigrpIftDisabled->findInterface(ifaceId);
1381 }

Referenced by addInterfaceToEigrp(), processIfaceStateChange(), receiveSignal(), removeNeighbor(), setHelloInt(), setHoldInt(), setPassive(), and setSplitHorizon().

◆ getNextHopAddr()

Ipv6Address inet::eigrp::EigrpIpv6Pdm::getNextHopAddr ( const Ipv6Address nextHopAddr,
Ipv6Address senderAddr 
)
inlineprotected

Returns next hop address.

If next hop in message is 0.0.0.0, then next hop must be replaced by IP address of sender.

227  { return (nextHopAddr.isUnspecified()) ? senderAddr : nextHopAddr; }

Referenced by processInterRoute(), and processUpdatePacket().

◆ handleMessage()

void inet::eigrp::EigrpIpv6Pdm::handleMessage ( cMessage *  msg)
overrideprotectedvirtual

Multi-stage initialization.

277 {
278  if (msg->isSelfMessage()) { // Timer
279  this->processTimer(msg);
280  }
281  else { // EIGRP message
282 
283  if (strcmp(msg->getArrivalGate()->getBaseName(), "splitterIn") == 0) {
285  delete msg;
286  msg = nullptr;
287  }
288  else if (strcmp(msg->getArrivalGate()->getBaseName(), "rtpIn") == 0) {
289  processMsgFromRtp(msg);
290  delete msg;
291  msg = nullptr;
292  }
293  }
294 }

◆ hasFeasibleSuccessor()

bool inet::eigrp::EigrpIpv6Pdm::hasFeasibleSuccessor ( EigrpRoute< Ipv6Address > *  route,
uint64_t &  resultDmin 
)
inlineoverridevirtual

Determine whether there are Feasibles Successors for specified route.

Parameters
resultDminreturn parameter with minimal distance to the destination.

Implements inet::eigrp::IEigrpPdm< Ipv6Address >.

322 { return eigrpTt->hasFeasibleSuccessor(route, resultDmin); }

◆ hasNeighborForUpdate()

bool inet::eigrp::EigrpIpv6Pdm::hasNeighborForUpdate ( EigrpRouteSource< Ipv6Address > *  source)
overridevirtual

Returns tru if there are recipients for update message, else false.

Implements inet::eigrp::IEigrpPdm< Ipv6Address >.

1875 {
1876  int ifaceCnt = this->eigrpIft->getNumInterfaces();
1877  EigrpInterface *eigrpIface;
1878 
1879  for (int i = 0; i < ifaceCnt; i++) {
1880  eigrpIface = eigrpIft->getInterface(i);
1881 
1882  // Do not apply Split Horizon rule
1883  if (eigrpIface != nullptr && eigrpIface->getNumOfNeighbors() > 0) {
1884  return true;
1885  }
1886  }
1887 
1888  return false;
1889 }

◆ initialize()

void inet::eigrp::EigrpIpv6Pdm::initialize ( int  stage)
overrideprotectedvirtual
67 {
68  cSimpleModule::initialize(stage);
69 
70  if (stage == INITSTAGE_LOCAL) {
71  host = getContainingNode(this);
72 
73  ift.reference(this, "interfaceTableModule", true);
74  rt.reference(this, "routingTableModule", true);
75  }
76 
77  if (stage == INITSTAGE_ROUTING_PROTOCOLS) {
78  eigrpIft = check_and_cast<EigrpInterfaceTable *>(getModuleByPath("^.eigrpInterfaceTable6"));
79  eigrpNt = check_and_cast<EigrpIpv6NeighborTable *>(getModuleByPath("^.eigrpIpv6NeighborTable"));
80  eigrpTt = check_and_cast<EigrpIpv6TopologyTable *>(getModuleByPath("^.eigrpIpv6TopologyTable"));
81 
82  this->eigrpIftDisabled = new EigrpDisabledInterfaces();
83  this->routingForNetworks = new EigrpNetworkTable<Ipv6Address>();
84  this->eigrpDual = new EigrpDual<Ipv6Address>(this);
85  this->eigrpMetric = new EigrpMetricHelper();
86 
87  EigrpDeviceConfigurator conf(par("configData"), ift);
88  conf.loadEigrpIPv6Config(this);
89 
90  // moved to splitter
91 // registerService(Protocol::eigrp, nullptr, gate("splitterIn"));
92 // registerProtocol(Protocol::eigrp, gate("splitterOut"), nullptr);
93 
94  WATCH_PTRVECTOR(*routingForNetworks->getAllNetworks());
95  WATCH(asNum);
96  WATCH(kValues.K1);
97  WATCH(kValues.K2);
98  WATCH(kValues.K3);
99  WATCH(kValues.K4);
100  WATCH(kValues.K5);
101  WATCH(kValues.K6);
102  WATCH(maximumPath);
103  WATCH(variance);
104  WATCH(eigrpStub.connectedRt);
105  WATCH(eigrpStub.leakMapRt);
106  WATCH(eigrpStub.recvOnlyRt);
107  WATCH(eigrpStub.redistributedRt);
108  WATCH(eigrpStub.staticRt);
109  WATCH(eigrpStub.summaryRt);
110 
111  host->subscribe(interfaceStateChangedSignal, this);
112  host->subscribe(interfaceConfigChangedSignal, this);
113  host->subscribe(routeDeletedSignal, this);
114  }
115 }

◆ installRouteToRT()

bool inet::eigrp::EigrpIpv6Pdm::installRouteToRT ( EigrpRoute< Ipv6Address > *  route,
EigrpRouteSource< Ipv6Address > *  source,
uint64_t  dmin,
Ipv6Route rtEntry 
)
protected

Updates existing route in the routing table or creates new one.

1807 {
1808  Ipv6Route *ansaRtEntry = rtEntry;
1809  bool rtableChanged = false;
1810 
1811  //if (rtEntry != nullptr && (ansaRtEntry = dynamic_cast<ANSAIPv6Route *>(rtEntry)) != nullptr)
1812  if (ansaRtEntry != nullptr) {
1813  //if (ansaRtEntry->getRoutingProtocolSource() != ANSAIPv4Route::pEIGRP)
1814  if (ansaRtEntry->getSourceType() != IRoute::EIGRP)
1815  return rtableChanged; // Do not add route to RT
1816  else if ((unsigned int)ansaRtEntry->getMetric() != source->getMetric()) { // Update EIGRP route in RT
1817  EV_DEBUG << "EIGRP: Update EIGRP route " << route->getRouteAddress() << " via " << source->getNextHop() << " in RT" << endl;
1818  setRTRouteMetric(ansaRtEntry, source->getMetric());
1819  }
1820  }
1821  else { // Insert new route to RT
1822  EV_DEBUG << "EIGRP: add EIGRP route " << route->getRouteAddress() << " via " << source->getNextHop() << " to RT" << endl;
1823  ansaRtEntry = createRTRoute(source);
1824 // rt->prepareForAddRoute(ansaRtEntry); // Do not check safety (already checked)
1825  rt->addRoutingProtocolRoute(ansaRtEntry);
1826 
1827  rtableChanged = true;
1828  }
1829 
1830  return rtableChanged;
1831 }

Referenced by updateRoute().

◆ isRTSafeForAdd()

bool inet::eigrp::EigrpIpv6Pdm::isRTSafeForAdd ( EigrpRoute< Ipv6Address > *  route,
unsigned int  eigrpAd 
)
protected

Returns true, if routing table does not contain route with given address, mask and smaller administrative distance.

1693 {
1694  Ipv6Route *routeInTable = findRoute(route->getRouteAddress(), getNetmaskLength(route->getRouteMask()));
1695  Ipv6Route *ansaRoute = nullptr;
1696 
1697  if (routeInTable == nullptr)
1698  return true; // Route not found
1699 
1700  ansaRoute = routeInTable;
1701  if (ansaRoute != nullptr) { // AnsaIPv4Route use own AD attribute
1702  if (ansaRoute->getAdminDist() < eigrpAd)
1703  return false;
1704  return true;
1705  }
1706  if (ansaRoute == nullptr && routeInTable->getAdminDist() == Ipv6Route::dUnknown)
1707  return false; // Connected route has AD = 255 (dUnknown) in IPv4Route
1708  if (routeInTable != nullptr && routeInTable->getAdminDist() < eigrpAd)
1709  return false; // Other IPv4Route with right AD
1710  return true;
1711 }

Referenced by updateRoute().

◆ msgToAllIfaces()

void inet::eigrp::EigrpIpv6Pdm::msgToAllIfaces ( int  destination,
HeaderOpcode  msgType,
EigrpRouteSource< Ipv6Address > *  source,
bool  forcePoisonRev,
bool  forceUnreachable 
)
protected

Records request to send message to all neighbors.

1214 {
1215  EigrpInterface *eigrpIface;
1216  int ifCount = eigrpIft->getNumInterfaces();
1217  int numOfNeigh;
1218 
1219  for (int i = 0; i < ifCount; i++) {
1220  eigrpIface = eigrpIft->getInterface(i);
1221 
1222  // Send message only to interface with stub neighbor
1223  if (destination == IEigrpPdm::STUB_RECEIVER && eigrpIface->getNumOfStubs() == 0)
1224  continue;
1225 
1226  if ((numOfNeigh = eigrpIface->getNumOfNeighbors()) > 0) {
1227  if (msgType == EIGRP_QUERY_MSG) {
1228  if (!applyStubToQuery(eigrpIface, numOfNeigh))
1229  msgToIface(msgType, source, eigrpIface, forcePoisonRev);
1230  // Else do not send Query to stub router (skip the route on interface)
1231  }
1232  else
1233  msgToIface(msgType, source, eigrpIface, forcePoisonRev, forceUnreachable);
1234  }
1235  }
1236 }

Referenced by sendQuery(), and sendUpdate().

◆ msgToIface()

void inet::eigrp::EigrpIpv6Pdm::msgToIface ( HeaderOpcode  msgType,
EigrpRouteSource< Ipv6Address > *  source,
EigrpInterface eigrpIface,
bool  forcePoisonRev = false,
bool  forceUnreachable = false 
)
protected

Creates request for sending message on specified interface.

1248 {
1249  EigrpNeighbor<Ipv6Address> *neigh = nullptr;
1250  EigrpMsgRoute msgRt;
1251  int ifaceId, destNeigh = 0;
1252 
1253  if (eigrpIface->isSplitHorizonEn() && applySplitHorizon(eigrpIface, source, source->getRouteInfo())) {
1254  if (forcePoisonRev) { // Apply Poison Reverse instead of Split Horizon
1255  msgRt.unreachable = true;
1256  }
1257  else // Apply Split Horizon rule - do not send route to the interface
1258  return;
1259  }
1260 
1261  msgRt.sourceId = source->getSourceId();
1262  msgRt.routeId = source->getRouteId();
1263  msgRt.originator = source->getOriginator();
1264  msgRt.invalid = false;
1265 
1266  // Get destination interface ID and destination neighbor ID
1267  ifaceId = eigrpIface->getInterfaceId();
1268  if (ift->getInterfaceById(ifaceId)->isMulticast()) { // Multicast
1269  destNeigh = IEigrpPdm::UNSPEC_RECEIVER;
1270  }
1271  else { // Unicast
1272  if (neigh == nullptr)
1273  neigh = eigrpNt->getFirstNeighborOnIf(ifaceId);
1274  destNeigh = neigh->getNeighborId();
1275  }
1276 
1277  pushMsgRouteToQueue(msgType, ifaceId, destNeigh, msgRt);
1278 }

Referenced by msgToAllIfaces().

◆ numInitStages()

virtual int inet::eigrp::EigrpIpv6Pdm::numInitStages ( ) const
inlineoverrideprotectedvirtual
96 { return NUM_INIT_STAGES; }

◆ preDelete()

void inet::eigrp::EigrpIpv6Pdm::preDelete ( cComponent *  root)
overrideprotectedvirtual
118 {
120 }

◆ printRecvMsg()

void inet::eigrp::EigrpIpv6Pdm::printRecvMsg ( const EigrpMessage msg,
Ipv6Address addr,
int  ifaceId 
)
protected
477 {
478  EV_DEBUG << "EIGRP: received " << eigrp::UserMsgs[msg->getOpcode()];
479  if (msg->getOpcode() == EIGRP_HELLO_MSG && msg->getAckNum() > 0)
480  EV_DEBUG << " (ack) ";
481  EV_DEBUG << " message from " << addr << " on IF " << ifaceId;
482 
483  EV_DEBUG << ", flags: ";
484  if (msg->getInit()) EV_DEBUG << "init";
485  else if (msg->getEot()) EV_DEBUG << "eot";
486  else if (msg->getCr()) EV_DEBUG << "cr";
487  else if (msg->getRs()) EV_DEBUG << "rs";
488 
489  EV_DEBUG << ", seq num:" << msg->getSeqNum();
490  EV_DEBUG << ", ack num:" << msg->getAckNum();
491  EV_DEBUG << endl;
492 }

Referenced by processAckPacket(), processHelloPacket(), processQueryPacket(), processReplyPacket(), and processUpdatePacket().

◆ printSentMsg()

void inet::eigrp::EigrpIpv6Pdm::printSentMsg ( int  routeCnt,
Ipv6Address destAddress,
EigrpMsgReq msgReq 
)
protected
450 {
451  int type = msgReq->getOpcode();
452 
453  EV_DEBUG << "EIGRP: send " << eigrp::UserMsgs[type];
454  if (type == EIGRP_HELLO_MSG) {
455  if (msgReq->getAckNumber() > 0)
456  EV_DEBUG << " (ack) ";
457  else if (msgReq->getGoodbyeMsg() == true)
458  EV_DEBUG << " (goodbye) ";
459  }
460 
461  EV_DEBUG << " message to " << destAddress << " on IF " << msgReq->getDestInterface();
462 
463  // Print flags
464  EV_DEBUG << ", flags: ";
465  if (msgReq->getInit()) EV_DEBUG << "init";
466  else if (msgReq->getEot()) EV_DEBUG << "eot";
467  else if (msgReq->getCr()) EV_DEBUG << "cr";
468  else if (msgReq->getRs()) EV_DEBUG << "rs";
469 
470  if (type != EIGRP_HELLO_MSG) EV_DEBUG << ", route count: " << routeCnt;
471  EV_DEBUG << ", seq num:" << msgReq->getSeqNumber();
472  EV_DEBUG << ", ack num:" << msgReq->getAckNumber();
473  EV_DEBUG << endl;
474 }

Referenced by processMsgFromRtp().

◆ processAckPacket()

void inet::eigrp::EigrpIpv6Pdm::processAckPacket ( Packet pk,
Ipv6Address srcAddress,
int  ifaceId,
EigrpNeighbor< Ipv6Address > *  neigh 
)
protected
547 {
548  const EigrpIpv6Ack *ack = staticPtrCast<const EigrpIpv6Ack>(pk->peekAtFront<EigrpIpv6Ack>()).get();
549  printRecvMsg(ack, srcAddress, ifaceId);
550  if (neigh->isStateUp() == false) {
551  // If neighbor is "pending", then change its state to "up"
552  neigh->setStateUp(true);
553  // Send all EIGRP paths from routing table to sender
554  sendAllEigrpPaths(eigrpIft->findInterfaceById(ifaceId), neigh);
555  }
556 
557  if (neigh->getRoutesForDeletion()) { // Remove unreachable routes waiting for Ack from neighbor
558  eigrpTt->delayedRemove(neigh->getNeighborId());
559  neigh->setRoutesForDeletion(false);
560  }
561 }

Referenced by processMsgFromNetwork().

◆ processHelloPacket()

void inet::eigrp::EigrpIpv6Pdm::processHelloPacket ( Packet pk,
Ipv6Address srcAddress,
int  ifaceId,
EigrpNeighbor< Ipv6Address > *  neigh 
)
protected
564 {
565  const EigrpIpv6Hello *hello = staticPtrCast<const EigrpIpv6Hello>(pk->peekAtFront<EigrpIpv6Hello>()).get();
566 // EigrpIpv6Hello *hello = check_and_cast<EigrpIpv6Hello *>(msg);
567 
568  EigrpTlvParameter tlvParam = hello->getParameterTlv();
569 
570  printRecvMsg(hello, srcAddress, ifaceId);
571 
572  if (tlvParam.kValues == KVALUES_MAX) { // Received Goodbye message, remove neighbor
573  if (neigh != nullptr) {
574  EV_DEBUG << " interface goodbye received" << endl;
575  EV_DEBUG << "EIGRP neighbor " << srcAddress << " is down, interface goodbye received" << endl;
576  removeNeighbor(neigh);
578  eigrpTt->purgeTable();
579  }
580  }
581  else if (neigh == nullptr) { // New neighbor
582  processNewNeighbor(ifaceId, srcAddress, hello);
583  }
584  else { // neighbor exists, its state is "up" or "pending"
585  // Check K-values
586  if (!(tlvParam.kValues == this->kValues)) { // Not satisfied
587  EV_DEBUG << "EIGRP neighbor " << srcAddress << " is down, " << eigrp::UserMsgs[eigrp::M_NEIGH_BAD_KVALUES] << endl;
588  removeNeighbor(neigh);
590  eigrpTt->purgeTable();
591 
592  // send Goodbye message and reset Hello timer
593  EigrpInterface *iface = this->eigrpIft->findInterfaceById(ifaceId);
594  resetTimer(iface->getHelloTimer(), iface->getHelloInt() - 0.5);
595  EigrpMsgReq *msgReq = createMsgReq(EIGRP_HELLO_MSG, EigrpNeighbor<Ipv6Address>::UNSPEC_ID, ifaceId);
596  msgReq->setGoodbyeMsg(true);
597  send(msgReq, RTP_OUTGW);
598  }
599  else if (tlvParam.holdTimer != neigh->getHoldInt()) // Save Hold interval
600  neigh->setHoldInt(tlvParam.holdTimer);
601  }
602 }

Referenced by processMsgFromNetwork().

◆ processIfaceConfigChange()

void inet::eigrp::EigrpIpv6Pdm::processIfaceConfigChange ( EigrpInterface eigrpIface)
protected
197 {
198  EigrpRouteSource<Ipv6Address> *source;
199  int routeCount = eigrpTt->getNumRoutes();
200  int ifaceId = eigrpIface->getInterfaceId();
201  EigrpWideMetricPar ifParam = eigrpMetric->getParam(eigrpIface);
202  EigrpWideMetricPar newParam;
203  uint64_t metric;
204 
205  // Update routes through the interface
206  for (int i = 0; i < routeCount; i++) {
207  source = eigrpTt->getRoute(i);
208  if (source->getIfaceId() == ifaceId && source->isValid()) {
209  // Update metric of source
210  if (source->getNexthopId() == EigrpNeighbor<Ipv6Address>::UNSPEC_ID) { // connected route
211  source->setMetricParams(ifParam);
212  metric = eigrpMetric->computeClassicMetric(ifParam, this->kValues);
213  source->setMetric(metric);
214  }
215  else {
216  newParam = eigrpMetric->adjustParam(ifParam, source->getRdParams());
217  source->setMetricParams(newParam);
218  metric = eigrpMetric->computeClassicMetric(newParam, this->kValues);
219  source->setMetric(metric);
220  }
221 
222  // Notify DUAL about event
223  eigrpDual->processEvent(EigrpDual<Ipv6Address>::RECV_UPDATE, source, source->getNexthopId(), false);
224  }
225  }
226 
228  eigrpTt->purgeTable();
229 }

Referenced by receiveSignal().

◆ processIfaceStateChange()

void inet::eigrp::EigrpIpv6Pdm::processIfaceStateChange ( NetworkInterface iface)
protected
153 {
154  EigrpInterface *eigrpIface;
155  int ifaceId = iface->getInterfaceId();
156 
157  if (iface->isUp()) { // an interface goes up
158 
159  // add directly-connected routes to RT
160  PrefixVector::iterator it;
161 
162  for (it = netPrefixes.begin(); it != netPrefixes.end(); ++it) { // through all known prefixes search prefixes belong to this interface
163  if (it->ifaceId == ifaceId) { // belonging to same interface -> add
164  if (findRoute(it->network, it->prefixLength, Ipv6Address::UNSPECIFIED_ADDRESS) == nullptr) { // route is not in RT -> add
165  rt->addStaticRoute(it->network, it->prefixLength, ifaceId, Ipv6Address::UNSPECIFIED_ADDRESS, 0);
166  }
167  }
168  }
169 
170  if ((eigrpIface = getInterfaceById(ifaceId)) != nullptr) { // interface is included in EIGRP process
171  if (!eigrpIface->isEnabled()) { // interface disabled -> enable
172  enableInterface(eigrpIface);
173  startHelloTimer(eigrpIface, simTime() + eigrpIface->getHelloInt() - 0.5);
174  }
175  }
176  }
177  else if (!iface->isUp() || !iface->hasCarrier()) { // an interface goes down
178 
179  // delete all directly-connected routes from RT
180  Ipv6Route *route = nullptr;
181  for (int i = 0; i < rt->getNumRoutes(); ++i) {
182  route = rt->getRoute(i);
183 
184  if (route->getInterface()->getInterfaceId() == ifaceId && route->getNextHop() == Ipv6Address::UNSPECIFIED_ADDRESS && route->getDestPrefix() != Ipv6Address::LINKLOCAL_PREFIX) { // Found Directly-connected (no link-local) route on interface -> remove
185  rt->removeRoute(route);
186  }
187  }
188 
189  eigrpIface = this->eigrpIft->findInterfaceById(ifaceId);
190  if (eigrpIface != nullptr && eigrpIface->isEnabled()) {
191  disableInterface(iface, eigrpIface);
192  }
193  }
194 }

Referenced by receiveSignal().

◆ processInterRoute()

EigrpRouteSource< Ipv6Address > * inet::eigrp::EigrpIpv6Pdm::processInterRoute ( const EigrpMpIpv6Internal tlv,
Ipv6Address srcAddr,
int  sourceNeighId,
EigrpInterface eigrpIface,
bool *  notifyDual,
bool *  isSourceNew 
)
protected

Process route TLV.

Parameters
neighNeighbor which is next hop for a route in TLV.
716 {
717  Ipv6Address nextHop = getNextHopAddr(tlv.nextHop, srcAddr);
718  EigrpNeighbor<Ipv6Address> *nextHopNeigh = eigrpNt->findNeighbor(nextHop);
719  EigrpRouteSource<Ipv6Address> *src;
720  EigrpWideMetricPar newParam, oldParam, oldNeighParam;
721  EigrpWideMetricPar ifParam = eigrpMetric->getParam(eigrpIface);
722 
723  // Find route or create one (route source is identified by ID of the next hop - not by ID of sender)
724  src = eigrpTt->findOrCreateRoute(tlv.destAddress, tlv.destMask, tlv.routerID, eigrpIface, nextHopNeigh->getNeighborId(), isSourceNew);
725 
726  // Compare old and new neighbor's parameters
727  oldNeighParam = src->getRdParams();
728  if (*isSourceNew || !eigrpMetric->compareParameters(tlv.metric, oldNeighParam, this->kValues)) {
729  // Compute reported distance (must be there)
730  uint64_t metric = eigrpMetric->computeClassicMetric(tlv.metric, this->kValues);
731  src->setRdParams(tlv.metric);
732  src->setRd(metric);
733 
734  // Get new metric parameters
735  newParam = eigrpMetric->adjustParam(ifParam, tlv.metric);
736  // Get old metric parameters for comparison
737  oldParam = src->getMetricParams();
738 
739  if (!eigrpMetric->compareParameters(newParam, oldParam, this->kValues)) {
740  // Set source of route
741  if (*isSourceNew)
742  src->setNextHop(nextHop);
743  src->setMetricParams(newParam);
744  // Compute metric
745  metric = eigrpMetric->computeClassicMetric(newParam, this->kValues);
746  src->setMetric(metric);
747  *notifyDual = true;
748  }
749  }
750 
751  return src;
752 }

Referenced by processQueryPacket(), processReplyPacket(), and processUpdatePacket().

◆ processMsgFromNetwork()

void inet::eigrp::EigrpIpv6Pdm::processMsgFromNetwork ( cMessage *  msg)
protected

Process message from network layer.

297 {
298  Packet *packet = check_and_cast<Packet *>(msg);
299 
300  auto protocol = packet->getTag<PacketProtocolTag>()->getProtocol();
301  if (protocol != &Protocol::eigrp) {
302  delete msg;
303  return;
304  }
305 
306  Ipv6Address srcAddr = packet->getTag<L3AddressInd>()->getSrcAddress().toIpv6();
307  int ifaceId = packet->getTag<InterfaceInd>()->getInterfaceId();
308  cMessage *msgDup = nullptr;
309 
310  NetworkInterface::State status = ift->getInterfaceById(ifaceId)->getState();
311  if (status == NetworkInterface::DOWN || status == NetworkInterface::GOING_UP) { // message received on DOWN or GOING_UP iface -> ignore
312  EV_DEBUG << "Received message on DOWN interface - message ignored" << endl;
313  return;
314  }
315 
316  const auto& pk = packet->peekAtFront<EigrpMessage>();
317  int8_t opcode = pk->getOpcode();
318 
319 #ifdef EIGRP_DEBUG
320  EigrpInterface *eigrpIface = eigrpIft->findInterfaceById(ifaceId);
321  ASSERT(eigrpIface != nullptr);
322  ASSERT(!eigrpIface->isPassive());
323 #endif
324 
325  // Find neighbor if exists
326  EigrpNeighbor<Ipv6Address> *neigh;
327  if ((neigh = eigrpNt->findNeighbor(srcAddr)) != nullptr) { // Reset hold timer
328  resetTimer(neigh->getHoldTimer(), neigh->getHoldInt());
329  }
330 
331  // Send message to RTP (message must be duplicated)
332  msgDup = msg->dup();
333  send(msgDup, RTP_OUTGW);
334 
335  switch (opcode) {
336  case EIGRP_HELLO_MSG:
337  if (pk->getAckNum() > 0)
338  processAckPacket(packet, srcAddr, ifaceId, neigh);
339  else
340  processHelloPacket(packet, srcAddr, ifaceId, neigh);
341  break;
342  case EIGRP_UPDATE_MSG:
343  processUpdatePacket(packet, srcAddr, ifaceId, neigh);
344  break;
345  case EIGRP_QUERY_MSG:
346  processQueryPacket(packet, srcAddr, ifaceId, neigh);
347  break;
348  case EIGRP_REPLY_MSG:
349  processReplyPacket(packet, srcAddr, ifaceId, neigh);
350  break;
351  default:
352  if (neigh != nullptr)
353  EV_DEBUG << "EIGRP: Received message of unknown type, skipped" << endl;
354  else
355  EV_DEBUG << "EIGRP: Received message from " << srcAddr << " that is not neighbor, skipped" << endl;
356  break;
357  }
358 }

Referenced by handleMessage().

◆ processMsgFromRtp()

void inet::eigrp::EigrpIpv6Pdm::processMsgFromRtp ( cMessage *  msg)
protected

Process message request from RTP.

361 {
362  EigrpMsgReq *msgReq = check_and_cast<EigrpMsgReq *>(msg);
363  int routeCnt = msgReq->getRoutesArraySize();
364  Ipv6Address destAddress;
365  int destIface = msgReq->getDestInterface();
366  EigrpInterface *eigrpIface = eigrpIft->findInterfaceById(destIface);
367 
368  Packet *pk;
369 
370 #ifdef EIGRP_DEBUG
371  ASSERT(eigrpIface != nullptr && !eigrpIface->isPassive());
372 #endif
373 
374  if (!getDestIpAddress(msgReq->getDestNeighbor(), &destAddress) || eigrpIface == nullptr) { // Discard message request
375  return;
376  }
377 
378  // Print message information
379  printSentMsg(routeCnt, destAddress, msgReq);
380 
381  // Create EIGRP message
382  switch (msgReq->getOpcode()) {
383  case EIGRP_HELLO_MSG:
384  if (msgReq->getGoodbyeMsg() == true) { // Goodbye message
385  pk = createHelloPacket(eigrpIface->getHoldInt(), this->KVALUES_MAX, destAddress, msgReq);
386  pk->setName("EIGRP_HELLO_MSG");
387  }
388  else if (msgReq->getAckNumber() > 0) { // Ack message
389  pk = createAckPacket(destAddress, msgReq);
390  pk->setName("EIGRP_ACK_MSG");
391  }
392  else { // Hello message
393  pk = createHelloPacket(eigrpIface->getHoldInt(), this->kValues, destAddress, msgReq);
394  pk->setName("EIGRP_HELLO_MSG");
395  }
396  break;
397 
398  case EIGRP_UPDATE_MSG:
399  pk = createUpdatePacket(destAddress, msgReq);
400  pk->setName("EIGRP_UPDATE_MSG");
401  break;
402 
403  case EIGRP_QUERY_MSG:
404 
405  pk = createQueryPacket(destAddress, msgReq);
406  pk->setName("EIGRP_QUERY_MSG");
407  break;
408 
409  case EIGRP_REPLY_MSG:
410  pk = createReplyPacket(destAddress, msgReq);
411  pk->setName("EIGRP_REPLY_MSG");
412  break;
413 
414  default:
415  ASSERT(false);
416  return;
417  break;
418  }
419 
420  // Send message to network
421  pk->addTagIfAbsent<PacketProtocolTag>()->setProtocol(&Protocol::eigrp);
422  pk->addTagIfAbsent<InterfaceReq>()->setInterfaceId(destIface);
423  pk->addTagIfAbsent<L3AddressReq>()->setDestAddress(destAddress);
424  pk->addTagIfAbsent<DispatchProtocolReq>()->setProtocol(&Protocol::ipv6);
425  pk->addTagIfAbsent<L3AddressReq>()->setSrcAddress(ift->getInterfaceById(destIface)->getProtocolData<Ipv6InterfaceData>()->getLinkLocalAddress());
426  pk->addTagIfAbsent<HopLimitReq>()->setHopLimit(1);
427  send(pk, SPLITTER_OUTGW);
428 }

Referenced by handleMessage().

◆ processNewNeighbor()

void inet::eigrp::EigrpIpv6Pdm::processNewNeighbor ( int  ifaceId,
Ipv6Address srcAddress,
const EigrpIpv6Hello helloMessage 
)
protected

Creates relationship with neighbor.

Parameters
srcAddressaddress of the neighbor
ifaceIdID of interface where the neighbor is connected
1004 {
1005  EigrpMsgReq *msgReqUpdate = nullptr, *msgReqHello = nullptr;
1006  EigrpNeighbor<Ipv6Address> *neigh;
1007  EigrpInterface *iface = eigrpIft->findInterfaceById(ifaceId);
1008  EigrpTlvParameter paramTlv = rcvMsg->getParameterTlv();
1009  EigrpStub stubConf = rcvMsg->getStubTlv().stub;
1010  int ecode; // Code of user message
1011 
1012  // Check rules for establishing neighborship
1013  if ((ecode = checkNeighborshipRules(ifaceId, rcvMsg->getAsNum(), srcAddress,
1014  paramTlv.kValues)) != eigrp::M_OK)
1015  {
1016  EV_DEBUG << "EIGRP can't create neighborship with " << srcAddress << ", " << eigrp::UserMsgs[ecode] << endl;
1017 
1018  if (ecode == eigrp::M_NEIGH_BAD_KVALUES) { // Send Goodbye message and reset Hello timer
1019  resetTimer(iface->getHelloTimer(), iface->getHelloInt() - 0.5);
1021  msgReqHello->setGoodbyeMsg(true);
1022  send(msgReqHello, RTP_OUTGW);
1023  }
1024  return;
1025  }
1026 
1027  EV_DEBUG << "Neighbor " << srcAddress << " is up, new adjacency" << endl;
1028 
1029  neigh = createNeighbor(iface, srcAddress, paramTlv.holdTimer);
1030 
1031  if (stubConf.connectedRt || stubConf.leakMapRt || stubConf.recvOnlyRt || stubConf.redistributedRt || stubConf.staticRt || stubConf.summaryRt) { // Process stub configuration
1032  neigh->setStubEnable(true);
1033  neigh->setStubConf(stubConf);
1034  iface->incNumOfStubs();
1035  eigrpNt->incStubCount();
1036  }
1037 
1038  // Reply with Hello message and reset Hello timer
1039  resetTimer(iface->getHelloTimer(), iface->getHelloInt() - 0.5);
1041  send(msgReqHello, RTP_OUTGW);
1042 
1043  // Send Update with INIT flag
1044  msgReqUpdate = createMsgReq(EIGRP_UPDATE_MSG, neigh->getNeighborId(), neigh->getIfaceId());
1045  msgReqUpdate->setInit(true);
1046  send(msgReqUpdate, RTP_OUTGW);
1047 }

Referenced by processHelloPacket().

◆ processQueryPacket()

void inet::eigrp::EigrpIpv6Pdm::processQueryPacket ( Packet pk,
Ipv6Address srcAddress,
int  ifaceId,
EigrpNeighbor< Ipv6Address > *  neigh 
)
protected
661 {
662 
663  const EigrpIpv6Query *query = staticPtrCast<const EigrpIpv6Query>(pk->peekAtFront<EigrpIpv6Query>()).get();
664 
665  EigrpInterface *eigrpIface = eigrpIft->findInterfaceById(ifaceId);
666  EigrpRouteSource<Ipv6Address> *src = nullptr;
667  bool notifyDual, isSourceNew;
668 
669  printRecvMsg(query, srcAddress, ifaceId);
670 
671  int cnt = query->getInterRoutesArraySize();
672 #ifdef EIGRP_DEBUG
673  EV_DEBUG << " Route count:" << cnt << endl;
674 #endif
675 
676  for (int i = 0; i < cnt; i++) {
677  src = processInterRoute(query->getInterRoutes(i), srcAddress, neigh->getNeighborId(), eigrpIface, &notifyDual, &isSourceNew);
678  src->getRouteInfo()->incrementRefCnt(); // RouteInto cannot be removed while processing Query and generating Reply
679 
680  // Always notify DUAL
681  eigrpDual->processEvent(EigrpDual<Ipv6Address>::RECV_QUERY, src, neigh->getNeighborId(), isSourceNew);
682  }
684  eigrpTt->purgeTable();
685 }

Referenced by processMsgFromNetwork().

◆ processReplyPacket()

void inet::eigrp::EigrpIpv6Pdm::processReplyPacket ( Packet pk,
Ipv6Address srcAddress,
int  ifaceId,
EigrpNeighbor< Ipv6Address > *  neigh 
)
protected
688 {
689  const EigrpIpv6Reply *reply = staticPtrCast<const EigrpIpv6Reply>(pk->peekAtFront<EigrpIpv6Reply>()).get();
690 
691  EigrpInterface *eigrpIface = eigrpIft->findInterfaceById(ifaceId);
692  EigrpRouteSource<Ipv6Address> *src;
693  bool notifyDual, isSourceNew;
694 
695  printRecvMsg(reply, srcAddress, ifaceId);
696 
697  int cnt = reply->getInterRoutesArraySize();
698 #ifdef EIGRP_DEBUG
699  EV_DEBUG << " Route count:" << cnt << endl;
700 #endif
701 
702  for (int i = 0; i < cnt; i++) {
703  src = processInterRoute(reply->getInterRoutes(i), srcAddress, neigh->getNeighborId(), eigrpIface, &notifyDual, &isSourceNew);
704  // Always notify DUAL
705  eigrpDual->processEvent(EigrpDual<Ipv6Address>::RECV_REPLY, src, neigh->getNeighborId(), isSourceNew);
706  }
708  eigrpTt->purgeTable();
709 }

Referenced by processMsgFromNetwork().

◆ processRTRouteDel()

void inet::eigrp::EigrpIpv6Pdm::processRTRouteDel ( const cObject *  details)
protected
232 {
233  if (dynamic_cast<const Ipv6Route *>(details) == nullptr) {
234  return; // route is not Ipv6
235  }
236  const Ipv6Route *changedRt = check_and_cast<const Ipv6Route *>(details);
237 // ANSAIPv6Route *changedAnsaRt = dynamic_cast<ANSAIPv6Route *>(changedRt);
238  const Ipv6Route *changedAnsaRt = changedRt;
239  unsigned adminDist;
240  EigrpRouteSource<Ipv6Address> *source = nullptr;
241 
242  if (changedAnsaRt != nullptr)
243  adminDist = changedAnsaRt->getAdminDist();
244  else
245  adminDist = changedRt->getAdminDist();
246 
247 #ifdef EIGRP_DEBUG
248 // EV_DEBUG << "EIGRP: received notification about deletion of route in RT with AD=" << adminDist << endl;
249 #endif
250 
251  if (adminDist == this->adminDistInt) { // Deletion of EIGRP internal route
252  source = eigrpTt->findRoute(changedRt->getDestPrefix(), makeNetmask(changedRt->getPrefixLength()), changedRt->getNextHop());
253  if (source == nullptr) {
254  ASSERT(false);
255  EV_DEBUG << "EIGRP: removed EIGRP route from RT, not found corresponding route source in TT" << endl;
256  return;
257  }
258 
259  if (source == oldsource)
260  return;
261  else
262  oldsource = source;
263 
264  if (source->isSuccessor()) {
265  if (!source->getRouteInfo()->isActive()) { // Process route in DUAL (no change of metric)
266  this->eigrpDual->processEvent(EigrpDual<Ipv6Address>::LOST_ROUTE, source, IEigrpPdm::UNSPEC_SENDER, false);
267  }
268  }
269  // Else do nothing - EIGRP itself removed route from RT
270  }
271  else { // Deletion of non EIGRP route
272 
273  }
274 }

Referenced by receiveSignal().

◆ processTimer()

void inet::eigrp::EigrpIpv6Pdm::processTimer ( cMessage *  msg)
protected
495 {
496  EigrpTimer *timer = check_and_cast<EigrpTimer *>(msg);
497  EigrpInterface *eigrpIface = nullptr;
498  EigrpNeighbor<Ipv6Address> *neigh = nullptr;
499  cObject *contextBasePtr = nullptr;
500  EigrpMsgReq *msgReq = nullptr;
501  int ifaceId = -1;
502 
503  switch (timer->getTimerKind()) {
504  case EIGRP_HELLO_TIMER:
505  // get interface that belongs to timer
506  contextBasePtr = (cObject *)timer->getContextPointer();
507  eigrpIface = check_and_cast<EigrpInterface *>(contextBasePtr);
508 
509  // schedule Hello timer
510  scheduleAt(simTime() + eigrpIface->getHelloInt() - 0.5, timer);
511 
512  // send Hello message
513  msgReq = createMsgReq(EIGRP_HELLO_MSG, EigrpNeighbor<Ipv6Address>::UNSPEC_ID, eigrpIface->getInterfaceId());
514  send(msgReq, RTP_OUTGW);
515  break;
516 
517  case EIGRP_HOLD_TIMER:
518  // get neighbor from context
519  contextBasePtr = (cObject *)timer->getContextPointer();
520  neigh = check_and_cast<EigrpNeighbor<Ipv6Address> *>(contextBasePtr);
521  ifaceId = neigh->getIfaceId();
522 
523  // remove neighbor
524  EV_DEBUG << "Neighbor " << neigh->getIPAddress() << " is down, holding time expired" << endl;
525  removeNeighbor(neigh);
526  neigh = nullptr;
528  eigrpTt->purgeTable();
529 
530  // Send goodbye and restart Hello timer
531  eigrpIface = eigrpIft->findInterfaceById(ifaceId);
532  resetTimer(eigrpIface->getHelloTimer(), eigrpIface->getHelloInt() - 0.5);
534  msgReq->setGoodbyeMsg(true);
535  send(msgReq, RTP_OUTGW);
536  break;
537 
538  default:
539  EV_DEBUG << "Timer with unknown kind was skipped" << endl;
540  delete timer;
541  timer = nullptr;
542  break;
543  }
544 }

Referenced by handleMessage().

◆ processUpdatePacket()

void inet::eigrp::EigrpIpv6Pdm::processUpdatePacket ( Packet pk,
Ipv6Address srcAddress,
int  ifaceId,
EigrpNeighbor< Ipv6Address > *  neigh 
)
protected
605 {
606  const EigrpIpv6Update *update = staticPtrCast<const EigrpIpv6Update>(pk->peekAtFront<EigrpIpv6Update>()).get();
607 
608  EigrpInterface *eigrpIface = eigrpIft->findInterfaceById(ifaceId);
609  EigrpRouteSource<Ipv6Address> *src;
610  bool skipRoute, notifyDual, isSourceNew;
611 
612  printRecvMsg(update, srcAddress, ifaceId);
613 
614  if (neigh->isStateUp() == false && update->getAckNum() != 0) { // First ack from neighbor
615  // If neighbor is "pending", then change its state to "up"
616  neigh->setStateUp(true);
617  // Send all EIGRP paths from routing table to sender
618  sendAllEigrpPaths(eigrpIface, neigh);
619  }
620 
621  if (update->getInit()) { // Request to send all paths from routing table
622  if (neigh->isStateUp() == true) {
623  sendAllEigrpPaths(eigrpIface, neigh);
624  }
625  }
626  else if (neigh->isStateUp()) { // Neighbor is "up", forward message to DUAL
627  int cnt = update->getInterRoutesArraySize();
628 #ifdef EIGRP_DEBUG
629  EV_DEBUG << " Route count:" << cnt << endl;
630 #endif
631 
632  for (int i = 0; i < cnt; i++) {
633  skipRoute = false;
634  notifyDual = false;
635  EigrpMpIpv6Internal tlv = update->getInterRoutes(i);
636 
637  if (tlv.routerID == eigrpTt->getRouterId() || eigrpMetric->isParamMaximal(tlv.metric)) { // Route with RID is equal to RID of router or tlv is unreachable route
638  Ipv6Address nextHop = getNextHopAddr(tlv.nextHop, srcAddress);
639  if (eigrpTt->findRoute(tlv.destAddress, tlv.destMask, nextHop) == nullptr)
640  skipRoute = true; // Route is not found in TT -> discard route
641  }
642 
643  if (skipRoute) { // Discard route
644  EV_DEBUG << "EIGRP: discard route " << tlv.destAddress << endl;
645  }
646  else { // process route
647  src = processInterRoute(tlv, srcAddress, neigh->getNeighborId(), eigrpIface, &notifyDual, &isSourceNew);
648  if (notifyDual)
649  eigrpDual->processEvent(EigrpDual<Ipv6Address>::RECV_UPDATE, src, neigh->getNeighborId(), isSourceNew);
650  else
651  EV_DEBUG << "EIGRP: route " << tlv.destAddress << " is not processed by DUAL, no change of metric" << endl;
652  }
653  }
655  eigrpTt->purgeTable();
656  }
657 // else ignore message");
658 }

Referenced by processMsgFromNetwork().

◆ pushMsgRouteToQueue()

EigrpMsgReq * inet::eigrp::EigrpIpv6Pdm::pushMsgRouteToQueue ( HeaderOpcode  msgType,
int  ifaceId,
int  neighId,
const EigrpMsgRoute msgRt 
)
protected

Insert route into the queue with requests.

1281 {
1282  EigrpMsgReq *request = nullptr;
1283  RequestVector::iterator it;
1284 
1285  // Find or create message
1286  for (it = reqQueue.begin(); it != reqQueue.end(); it++) {
1287  if ((*it)->getDestInterface() == ifaceId && (*it)->getOpcode() == msgType) {
1288  request = *it;
1289  break;
1290  }
1291  }
1292  if (request == nullptr) { // Create new request
1293  request = createMsgReq(msgType, neighId, ifaceId);
1294  request->setRoutesArraySize(1);
1295  request->setRoutes(0, msgRt);
1296  reqQueue.push_back(request);
1297  }
1298  else { // Use existing request
1299  int rtSize = request->getRoutesArraySize();
1300  int index;
1301  if ((index = request->findMsgRoute(msgRt.routeId)) >= 0) { // Use existing route
1302  if (msgRt.unreachable)
1303  request->getRoutesForUpdate(index).unreachable = true;
1304  }
1305  else { // Add route to request
1306  request->setRoutesArraySize(rtSize + 1);
1307  request->setRoutes(rtSize, msgRt);
1308  }
1309  }
1310 
1311  return request;
1312 }

Referenced by msgToIface(), and sendReply().

◆ receiveSignal()

void inet::eigrp::EigrpIpv6Pdm::receiveSignal ( cComponent *  source,
simsignal_t  signalID,
cObject *  obj,
cObject *  details 
)
overrideprotectedvirtual
124 {
125  Enter_Method("%s", cComponent::getSignalName(signalID));
126 
127  if (signalID == interfaceStateChangedSignal) {
128  NetworkInterfaceChangeDetails *ifcecd = check_and_cast<NetworkInterfaceChangeDetails *>(obj);
129  processIfaceStateChange(ifcecd->getNetworkInterface());
130  }
131  else if (signalID == interfaceConfigChangedSignal) {
132  NetworkInterfaceChangeDetails *ifcecd = check_and_cast<NetworkInterfaceChangeDetails *>(obj);
133  NetworkInterface *iface = ifcecd->getNetworkInterface();
134  EigrpInterface *eigrpIface = getInterfaceById(iface->getInterfaceId());
135  double ifParam;
136 
137  if (eigrpIface == nullptr)
138  return;
139 
140  ifParam = iface->getDatarate();
141  if (ifParam != 0 && ifParam != eigrpIface->getInterfaceDatarate()) { // Bandwidth
142  eigrpIface->setInterfaceDatarate(ifParam);
143  if (eigrpIface->isEnabled())
144  processIfaceConfigChange(eigrpIface);
145  }
146  }
147  else if (signalID == routeDeletedSignal) {
148  processRTRouteDel(obj);
149  }
150 }

◆ removeNeighbor()

void inet::eigrp::EigrpIpv6Pdm::removeNeighbor ( EigrpNeighbor< Ipv6Address > *  neigh)
protected

Removes neighbor from neighbor table and delete it.

Notifies DUAL about event.

1139 {
1140  EigrpRouteSource<Ipv6Address> *source = nullptr;
1141  EigrpRoute<Ipv6Address> *route = nullptr;
1142  // Find interface (enabled/disabled)
1143  EigrpInterface *eigrpIface = getInterfaceById(neigh->getIfaceId());
1144 
1145  int nextHopId = neigh->getNeighborId();
1146  int ifaceId = neigh->getIfaceId();
1147  const char *ifaceName = neigh->getIfaceName();
1148  int routeId;
1149 
1150  cancelHoldTimer(neigh);
1151  // Remove neighbor from NT
1152  this->eigrpNt->removeNeighbor(neigh);
1153  eigrpIface->decNumOfNeighbors();
1154  if (neigh->isStubEnabled()) {
1155  eigrpIface->decNumOfStubs();
1156  eigrpNt->decStubCount();
1157  }
1158  delete neigh;
1159  neigh = nullptr;
1160 
1161  for (int i = 0; i < eigrpTt->getNumRouteInfo(); i++) { // Process routes that go via this neighbor
1162  route = eigrpTt->getRouteInfo(i);
1163  routeId = route->getRouteId();
1164  // Note: TT can not contain two or more records with the same network address and next hop address
1165  source = eigrpTt->findRouteByNextHop(routeId, nextHopId);
1166 
1167 #ifdef EIGRP_DEBUG
1168  EV_DEBUG << "EIGRP: Destination: " << route->getRouteAddress() << "/" << getNetmaskLength(route->getRouteMask()) << ", active " << route->isActive() << endl;
1169 #endif
1170 
1171  if (route->isActive()) {
1172  if (source == nullptr) { // Create dummy source for active route (instead of Reply)
1173 #ifdef EIGRP_DEBUG
1174  EV_DEBUG << " Create dummy route " << route->getRouteAddress() << " via <unspecified> for deletion of reply status handle" << endl;
1175 #endif
1176  source = new EigrpRouteSource<Ipv6Address>(ifaceId, ifaceName, nextHopId, routeId, route);
1177  eigrpTt->addRoute(source);
1178  eigrpDual->processEvent(EigrpDual<Ipv6Address>::NEIGHBOR_DOWN, source, nextHopId, true);
1179  }
1180  else
1181  eigrpDual->processEvent(EigrpDual<Ipv6Address>::NEIGHBOR_DOWN, source, nextHopId, false);
1182  }
1183  else { // Notify DUAL about event
1184  if (source != nullptr)
1185  eigrpDual->processEvent(EigrpDual<Ipv6Address>::NEIGHBOR_DOWN, source, nextHopId, false);
1186  }
1187  }
1188 
1189  // Do not flush messages in transmit queue
1190 }

Referenced by disableInterface(), processHelloPacket(), and processTimer().

◆ removeOldSuccessor()

bool inet::eigrp::EigrpIpv6Pdm::removeOldSuccessor ( EigrpRouteSource< Ipv6Address > *  source,
EigrpRoute< Ipv6Address > *  route 
)
protected

Removes route from routing table and changes old successor's record in topology table.

1781 {
1782 // ANSAIPv4Route::RoutingProtocolSource srcProto = ANSAIPv4Route::pUnknown;
1784  bool rtFound, rtableChanged = false;
1785 
1786  // To distinguish the route deleted by EIGRP in ReceiveChangeNotification method
1787  source->setSuccessor(false);
1788 
1789  rtFound = removeRouteFromRT(source, &srcProto);
1790 #ifdef EIGRP_DEBUG
1791 // EV_DEBUG << "EIGRP: removing old successor: rt found: " << rtFound << " src: " << srcProto << endl;
1792 #endif
1793 
1794 // if (!rtFound || (rtFound && (srcProto == ANSAIPv6Route::pEIGRP || srcProto == ANSAIPv6Route::pEIGRPext)))
1795  if (!rtFound || (rtFound && (srcProto == IRoute::EIGRP))) {
1796  if (route->getSuccessor() == source)
1797  route->setSuccessor(nullptr);
1798  rtableChanged = true;
1799  }
1800  else // Route from other sources can not be removed, do not change Successor's record in TT
1801  source->setSuccessor(true);
1802 
1803  return rtableChanged;
1804 }

Referenced by updateRoute().

◆ removeRouteFromRT()

bool inet::eigrp::EigrpIpv6Pdm::removeRouteFromRT ( EigrpRouteSource< Ipv6Address > *  source,
IRoute::SourceType removedRtSrc 
)
protected
Returns
if route is found in routing table then returns true.
1671 {
1672  EigrpRoute<Ipv6Address> *route = source->getRouteInfo();
1673  Ipv6Route *rtEntry = findRoute(route->getRouteAddress(), getNetmaskLength(route->getRouteMask()), source->getNextHop());
1674 // ANSAIPv6Route *ansaRtEntry = dynamic_cast<ANSAIPv6Route *>(rtEntry);
1675  Ipv6Route *ansaRtEntry = rtEntry;
1676  if (ansaRtEntry != nullptr) {
1677  *removedRtSrc = ansaRtEntry->getSourceType();
1678  //if (*removedRtSrc == ANSAIPv6Route::pEIGRP)
1679  if (ansaRtEntry->getSourceType() == IRoute::EIGRP) {
1680  EV_DEBUG << "EIGRP: delete route " << route->getRouteAddress() << " via " << source->getNextHop() << " from RT" << endl;
1681  delete rt->removeRoute(rtEntry);
1682  }
1683  }
1684  else {
1685 #ifdef EIGRP_DEBUG
1686  EV_DEBUG << "EIGRP: EIGRP route " << route->getRouteAddress() << " via " << source->getNextHop() << " can not be removed, not found in RT" << endl;
1687 #endif
1688  }
1689  return rtEntry != nullptr;
1690 }

Referenced by removeOldSuccessor().

◆ resetTimer()

void inet::eigrp::EigrpIpv6Pdm::resetTimer ( EigrpTimer timer,
int  interval 
)
inlineprotected

Sets specified timer to given interval.

111 { cancelEvent(timer); scheduleAt(simTime() + interval /*- uniform(0,0.4)*/, timer); }

Referenced by processHelloPacket(), processMsgFromNetwork(), processNewNeighbor(), and processTimer().

◆ sendAllEigrpPaths()

void inet::eigrp::EigrpIpv6Pdm::sendAllEigrpPaths ( EigrpInterface eigrpIface,
EigrpNeighbor< Ipv6Address > *  neigh 
)
protected

Creates and sends message with all routes from routing table to specified neighbor.

965 {
966  int routeCnt = eigrpTt->getNumRouteInfo();
967  int addedRoutes = 0; // Number of routes in message
968  EigrpRoute<Ipv6Address> *route;
969  EigrpRouteSource<Ipv6Address> *source;
970  EigrpMsgReq *msgReq = createMsgReq(EIGRP_UPDATE_MSG, neigh->getNeighborId(), neigh->getIfaceId());
971 
972  msgReq->setRoutesArraySize(routeCnt);
973 
974  for (int i = 0; i < routeCnt; i++) {
975  route = eigrpTt->getRouteInfo(i);
976  if (route->isActive())
977  continue;
978 
979  if ((source = eigrpTt->getBestSuccessor(route)) != nullptr) {
980  if (this->eigrpStubEnabled && applyStubToUpdate(source))
981  continue; // Apply stub settings to the route
982  if (eigrpIface->isSplitHorizonEn() && applySplitHorizon(eigrpIface, source, route))
983  continue; // Apply Split Horizon rule
984 
985  EigrpMsgRoute routeReq;
986  routeReq.sourceId = source->getSourceId();
987  routeReq.routeId = source->getRouteId();
988  routeReq.originator = source->getOriginator();
989  routeReq.invalid = false;
990  msgReq->setRoutes(addedRoutes /* not variable i */, routeReq);
991  addedRoutes++;
992  }
993  }
994 
995  if (addedRoutes < routeCnt) // reduce size of array
996  msgReq->setRoutesArraySize(addedRoutes);
997 
998  msgReq->setEot(true);
999 
1000  send(msgReq, RTP_OUTGW);
1001 }

Referenced by processAckPacket(), and processUpdatePacket().

◆ sendQuery()

void inet::eigrp::EigrpIpv6Pdm::sendQuery ( int  destNeighbor,
EigrpRoute< Ipv6Address > *  route,
EigrpRouteSource< Ipv6Address > *  source,
bool  forcePoisonRev = false 
)
overridevirtual

Sends query message to specified neighbor.

Parameters
destNeighborID of destination neighbor. If parameter is set to 0 then sends message to all neighbors.
routeroute network
sourceroute
forcePoisonRevapply Poison Reverse instead of Split Horizon to the route.

Implements inet::eigrp::IEigrpPdm< Ipv6Address >.

1623 {
1624  bool forceUnreachable = false;
1625 
1626  EV_DEBUG << "DUAL: send Query message about " << route->getRouteAddress() << " to all neighbors" << endl;
1627 
1628  if (this->eigrpStubEnabled)
1629  forceUnreachable = true; // Send Query with infinite metric to all neighbors
1630  else {
1631  if (this->eigrpNt->getStubCount() > 0) { // Apply Poison Reverse instead of Split Horizon rule
1632  forcePoisonRev = true;
1633  }
1634  }
1635 
1636  msgToAllIfaces(destNeighbor, EIGRP_QUERY_MSG, source, forcePoisonRev, forceUnreachable);
1637 }

◆ sendReply()

void inet::eigrp::EigrpIpv6Pdm::sendReply ( EigrpRoute< Ipv6Address > *  route,
int  destNeighbor,
EigrpRouteSource< Ipv6Address > *  source,
bool  forcePoisonRev = false,
bool  isUnreachable = false 
)
overridevirtual

Sends reply message to specified neighbor.

Parameters
routeroute network
destNeighborID of destination neighbor.
sourceroute
forcePoisonRevapply Poison Reverse rule to the route
isUnreachableroute in message will have inf metric (regardless of Poisson Reverse)

Implements inet::eigrp::IEigrpPdm< Ipv6Address >.

1640 {
1641  EigrpMsgRoute msgRt;
1642  EigrpNeighbor<Ipv6Address> *neigh = eigrpNt->findNeighborById(destNeighbor);
1643 
1644  EV_DEBUG << "DUAL: send Reply message about " << route->getRouteAddress() << endl;
1645  if (neigh == nullptr)
1646  return;
1647 
1648  msgRt.invalid = false;
1649  msgRt.sourceId = source->getSourceId();
1650  msgRt.routeId = source->getRouteId();
1651  msgRt.originator = source->getOriginator();
1652  msgRt.unreachable = isUnreachable;
1653 
1654  if (this->eigrpStubEnabled)
1655  msgRt.unreachable = true; // Stub router always reply with infinite metric
1656 
1657  // Apply Poison Reverse (instead of Split Horizon)
1658  if (!isUnreachable && eigrpIft->findInterfaceById(neigh->getIfaceId())->isSplitHorizonEn()) { // Poison Reverse is enabled when Split Horizon is enabled
1659  // Note: destNeighbor is also neighbor that sent Query
1660  if (forcePoisonRev)
1661  msgRt.unreachable = true;
1662  }
1663 
1664  pushMsgRouteToQueue(EIGRP_REPLY_MSG, neigh->getIfaceId(), neigh->getNeighborId(), msgRt);
1665 }

◆ sendUpdate()

void inet::eigrp::EigrpIpv6Pdm::sendUpdate ( int  destNeighbor,
EigrpRoute< Ipv6Address > *  route,
EigrpRouteSource< Ipv6Address > *  source,
bool  forcePoisonRev,
const char *  reason 
)
overridevirtual

Sends update message to specified neighbor.

Parameters
destNeighborID of destination neighbor. If parameter is set to 0 then sends message to all neighbors.
routeroute network
sourceroute
forcePoisonRevforce poison reverse rule instead of split horizon
reasontext description for user.

Implements inet::eigrp::IEigrpPdm< Ipv6Address >.

1613 {
1614  EV_DEBUG << "DUAL: send Update message about " << route->getRouteAddress() << " to all neighbors, " << reason << endl;
1615  if (this->eigrpStubEnabled && applyStubToUpdate(source)) {
1616  EV_DEBUG << " Stub routing applied, message will not be sent" << endl;
1617  return;
1618  }
1619  msgToAllIfaces(destNeighbor, EIGRP_UPDATE_MSG, source, forcePoisonRev, false);
1620 }

Referenced by sendUpdateToStubs().

◆ sendUpdateToStubs()

void inet::eigrp::EigrpIpv6Pdm::sendUpdateToStubs ( EigrpRouteSource< Ipv6Address > *  succ,
EigrpRouteSource< Ipv6Address > *  oldSucc,
EigrpRoute< Ipv6Address > *  route 
)
overridevirtual

Sends update message to all stub neighbors.

Implements inet::eigrp::IEigrpPdm< Ipv6Address >.

1906 {
1907  if (!this->eigrpStubEnabled && eigrpNt->getStubCount() > 0) {
1908  if (succ == nullptr) { // Send old successor
1909  // Route will be removed after router receives Ack from neighbor
1910  if (oldSucc->isUnreachable()) {
1911  route->setUpdateSent(true);
1912  route->setNumSentMsgs(route->getNumSentMsgs() + 1);
1913  }
1914  sendUpdate(IEigrpPdm::STUB_RECEIVER, route, oldSucc, true, "notify stubs about change");
1915  }
1916  else // Send successor
1917  sendUpdate(IEigrpPdm::STUB_RECEIVER, route, succ, true, "notify stubs about change");
1918  }
1919 }

◆ setASNum()

void inet::eigrp::EigrpIpv6Pdm::setASNum ( int  asNum)
inlineoverridevirtual

Implements inet::eigrp::IEigrpModule< Ipv6Address >.

300 { this->asNum = asNum; }

◆ setBandwidth()

void inet::eigrp::EigrpIpv6Pdm::setBandwidth ( int  bandwith,
int  interfaceId 
)
inlineoverridevirtual

Implements inet::eigrp::IEigrpModule< Ipv6Address >.

312 { this->eigrpIft->findInterfaceById(interfaceId)->setBandwidth(bandwith); }

◆ setDelay()

void inet::eigrp::EigrpIpv6Pdm::setDelay ( int  delay,
int  interfaceId 
)
inlineoverridevirtual

Implements inet::eigrp::IEigrpModule< Ipv6Address >.

313 { this->eigrpIft->findInterfaceById(interfaceId)->setDelay(delay); }

◆ setDelayedRemove()

void inet::eigrp::EigrpIpv6Pdm::setDelayedRemove ( int  neighId,
EigrpRouteSource< Ipv6Address > *  src 
)
overridevirtual

After receiving Ack from neighbor with neighId will be route removed from TT.

Parameters
neighIdID of neighbor
srcroute

Implements inet::eigrp::IEigrpPdm< Ipv6Address >.

1892 {
1893  EigrpNeighbor<Ipv6Address> *neigh = eigrpNt->findNeighborById(neighId);
1894 
1895  ASSERT(neigh != nullptr);
1896  neigh->setRoutesForDeletion(true);
1897  src->setDelayedRemove(neighId);
1898  src->setValid(true); // Can not be invalid
1899 
1900 #ifdef EIGRP_DEBUG
1901  EV_DEBUG << "DUAL: route via " << src->getNextHop() << " will be removed from TT after receiving Ack from neighbor" << endl;
1902 #endif
1903 }

◆ setHelloInt()

void inet::eigrp::EigrpIpv6Pdm::setHelloInt ( int  interval,
int  ifaceId 
)
overridevirtual

Implements inet::eigrp::IEigrpModule< Ipv6Address >.

1547 {
1548  EigrpInterface *iface = getInterfaceById(ifaceId);
1549  if (iface == nullptr)
1550  iface = addInterfaceToEigrp(ifaceId, false);
1551  iface->setHelloInt(interval);
1552 }

◆ setHoldInt()

void inet::eigrp::EigrpIpv6Pdm::setHoldInt ( int  interval,
int  ifaceId 
)
overridevirtual

Implements inet::eigrp::IEigrpModule< Ipv6Address >.

1555 {
1556  EigrpInterface *iface = getInterfaceById(ifaceId);
1557  if (iface == nullptr)
1558  iface = addInterfaceToEigrp(ifaceId, false);
1559  iface->setHoldInt(interval);
1560 }

◆ setKValues()

void inet::eigrp::EigrpIpv6Pdm::setKValues ( const EigrpKValues kValues)
inlineoverridevirtual

◆ setLoad()

void inet::eigrp::EigrpIpv6Pdm::setLoad ( int  load,
int  interfaceId 
)
inlineoverridevirtual

Implements inet::eigrp::IEigrpModule< Ipv6Address >.

311 { this->eigrpIft->findInterfaceById(interfaceId)->setLoad(load); }

◆ setMaximumPath()

void inet::eigrp::EigrpIpv6Pdm::setMaximumPath ( int  maximumPath)
inlineoverridevirtual

◆ setPassive()

void inet::eigrp::EigrpIpv6Pdm::setPassive ( bool  passive,
int  ifaceId 
)
overridevirtual

Implements inet::eigrp::IEigrpModule< Ipv6Address >.

1571 {
1572  EigrpInterface *eigrpIface = getInterfaceById(ifaceId);
1573 
1574  if (eigrpIface == nullptr)
1575  eigrpIface = addInterfaceToEigrp(ifaceId, false);
1576  else if (eigrpIface->isEnabled()) { // Disable sending and receiving of messages
1577  NetworkInterface *iface = ift->getInterfaceById(ifaceId);
1578 
1579  Ipv6InterfaceData *ipv6int = iface->getProtocolDataForUpdate<Ipv6InterfaceData>();
1580  ipv6int->leaveMulticastGroup(EIGRP_IPV6_MULT);
1581 
1582 // iface->ipv6Data()->leaveMulticastGroup(EIGRP_IPV6_MULT);
1583 
1584  /*
1585  if(iface->ipv6Data()->hasAddress(EIGRP_IPV6_MULT))
1586  {
1587  iface->ipv6Data()->removeAddress(EIGRP_IPV6_MULT);
1588  }
1589  */
1590 
1591  if (ipv6int->hasAddress(EIGRP_IPV6_MULT)) {
1592  ipv6int->removeAddress(EIGRP_IPV6_MULT);
1593  }
1594 
1595  // Stop and delete hello timer
1596  EigrpTimer *hellot = eigrpIface->getHelloTimer();
1597  if (hellot != nullptr) {
1598  cancelEvent(hellot);
1599  delete hellot;
1600  eigrpIface->setHelloTimerPtr(nullptr);
1601  }
1602  }
1603  // Else do nothing (interface is not part of EIGRP)
1604 
1605  eigrpIface->setPassive(passive);
1606 }

◆ setReliability()

void inet::eigrp::EigrpIpv6Pdm::setReliability ( int  reliability,
int  interfaceId 
)
inlineoverridevirtual

Implements inet::eigrp::IEigrpModule< Ipv6Address >.

314 { this->eigrpIft->findInterfaceById(interfaceId)->setReliability(reliability); }

◆ setReplyStatusTable()

bool inet::eigrp::EigrpIpv6Pdm::setReplyStatusTable ( EigrpRoute< Ipv6Address > *  route,
EigrpRouteSource< Ipv6Address > *  source,
bool  forcePoisonRev,
int *  neighCount,
int *  stubCount 
)
overridevirtual

Sets Reply Status Table for specified network.

Parameters
routeroute network
forcePoisonRevuse Poison Reverse instead of Split Horizon
neighCountnumber of all neighbors.
stubCountnumber of stub neighbors.

Implements inet::eigrp::IEigrpPdm< Ipv6Address >.

1834 {
1835  int neighTotalCount = eigrpNt->getNumNeighbors();
1836  EigrpNeighbor<Ipv6Address> *neigh;
1837  EigrpInterface *eigrpIface = nullptr;
1838 
1839  for (int i = 0; i < neighTotalCount; i++) {
1840  neigh = eigrpNt->getNeighbor(i);
1841  if ((eigrpIface = eigrpIft->findInterfaceById(neigh->getIfaceId())) == nullptr)
1842  continue; // The interface has been removed
1843 
1844  // Apply stub routing
1845  if (!this->eigrpStubEnabled) {
1846  if (neigh->isStubEnabled()) {
1847  (*stubCount)++;
1848  (*neighCount)++;
1849  continue; // Non stub router can not send Query to stub router
1850  }
1851 
1852  if (this->eigrpNt->getStubCount() > 0) { // Apply Poison Reverse instead of Split Horizon rule
1853  forcePoisonRev = true;
1854  }
1855  }
1856 
1857  // Apply Split Horizon and Poison Reverse
1858  if (eigrpIface->isSplitHorizonEn() && applySplitHorizon(eigrpIface, source, route)) {
1859  if (forcePoisonRev) { // Apply Poison Reverse instead of Split Horizon
1860  route->setReplyStatus(neigh->getNeighborId());
1861  }
1862  else
1863  continue; // Do not send route
1864  }
1865  else
1866  route->setReplyStatus(neigh->getNeighborId());
1867 
1868  (*neighCount)++;
1869  }
1870 
1871  return route->getReplyStatusSum() > 0;
1872 }

◆ setRouterId()

void inet::eigrp::EigrpIpv6Pdm::setRouterId ( Ipv4Address  routerID)
inlineoverridevirtual

Sets router ID.

Parameters
routerIDEIGRP process routerID, represented as IPv4 address

Implements inet::eigrp::IEigrpModule< Ipv6Address >.

310 { this->eigrpTt->setRouterId(routerID); }

◆ setRouteTlvMetric()

void inet::eigrp::EigrpIpv6Pdm::setRouteTlvMetric ( EigrpWideMetricPar msgMetric,
EigrpWideMetricPar rtMetric 
)
protected
888 {
889  msgMetric->bandwidth = rtMetric->bandwidth;
890  msgMetric->delay = rtMetric->delay;
891  msgMetric->hopCount = rtMetric->hopCount;
892  msgMetric->load = rtMetric->load;
893  msgMetric->mtu = rtMetric->mtu;
894  msgMetric->offset = 0; // TODO
895  msgMetric->priority = 0; // TODO
896  msgMetric->reliability = rtMetric->reliability;
897 }

Referenced by createRouteTlv().

◆ setRTRouteMetric()

void inet::eigrp::EigrpIpv6Pdm::setRTRouteMetric ( Ipv6Route route,
uint64_t  metric 
)
inlineprotected

Changes metric of route in routing table.

For wide metric uses scale.

248 { if (!useClassicMetric) { metric = metric / ribScale; } route->setMetric(metric); }

Referenced by createRTRoute(), and installRouteToRT().

◆ setSplitHorizon()

void inet::eigrp::EigrpIpv6Pdm::setSplitHorizon ( bool  shenabled,
int  ifaceId 
)
overridevirtual

Implements inet::eigrp::IEigrpModule< Ipv6Address >.

1563 {
1564  EigrpInterface *iface = getInterfaceById(ifaceId);
1565  if (iface == nullptr)
1566  iface = addInterfaceToEigrp(ifaceId, false);
1567  iface->setSplitHorizon(shenabled);
1568 }

◆ setStub()

void inet::eigrp::EigrpIpv6Pdm::setStub ( const EigrpStub stub)
inlineoverridevirtual

Implements inet::eigrp::IEigrpModule< Ipv6Address >.

309 { this->eigrpStub = stub; this->eigrpStubEnabled = true; }

◆ setVariance()

void inet::eigrp::EigrpIpv6Pdm::setVariance ( int  variance)
inlineoverridevirtual

◆ startHelloTimer()

void inet::eigrp::EigrpIpv6Pdm::startHelloTimer ( EigrpInterface eigrpIface,
simtime_t  interval 
)
protected

Schedule hello timer to the specified interval.

1523 {
1524  EigrpTimer *hellot;
1525 
1526  // Start Hello timer on interface
1527  if (!eigrpIface->isPassive()) {
1528  if ((hellot = eigrpIface->getHelloTimer()) == nullptr) {
1529  hellot = createTimer(EIGRP_HELLO_TIMER, eigrpIface);
1530  eigrpIface->setHelloTimerPtr(hellot);
1531  }
1532 
1533  scheduleAt(interval, hellot);
1534  }
1535 }

Referenced by addInterfaceToEigrp(), and processIfaceStateChange().

◆ unlockRoutes()

void inet::eigrp::EigrpIpv6Pdm::unlockRoutes ( const EigrpMsgReq msgReq)
protected
900 {
901  int reqCnt = msgReq->getRoutesArraySize();
902  EigrpRoute<Ipv6Address> *route = nullptr;
903 
904  for (int i = 0; i < reqCnt; i++) {
905  EigrpMsgRoute req = msgReq->getRoutes(i);
906  route = eigrpTt->findRouteInfoById(req.routeId);
907 
908  ASSERT(route != nullptr);
909  route->decrementRefCnt();
910 
911  if (route->getRefCnt() < 1) { // Route would have been removed be removed if wasn't locked
912  delete eigrpTt->removeRouteInfo(route);
913  }
914  }
915 }

Referenced by createReplyPacket().

◆ updateInterface()

virtual void inet::eigrp::EigrpIpv6Pdm::updateInterface ( int  interfaceId)
inlineoverridevirtual

◆ updateRoute()

EigrpRouteSource< Ipv6Address > * inet::eigrp::EigrpIpv6Pdm::updateRoute ( EigrpRoute< Ipv6Address > *  route,
uint64_t  dmin,
bool *  rtableChanged,
bool  removeUnreach = false 
)
overridevirtual

Function finds successors to the destination network.

Parameters
routedestination network
dminminimal distance to the destination
rtableChangedreturn parameter, true if occurs change in the routing table
removeUnreachinvalidate unreachable sources of the route.
Returns
pointer to successor or nullptr.

Implements inet::eigrp::IEigrpPdm< Ipv6Address >.

1714 {
1715  EigrpRouteSource<Ipv6Address> *source = nullptr, *bestSuccessor = nullptr;
1716  Ipv6Route *rtEntry = nullptr;
1717  int routeNum = eigrpTt->getNumRoutes();
1718  int routeId = route->getRouteId();
1719  int pathsInRT = 0; // Number of paths in RT (equal to number of successors)
1720  int sourceCounter = 0; // Number of route sources
1721  uint64_t routeFd = route->getFd();
1722 
1723  EV_DEBUG << "EIGRP: Search successor for route " << route->getRouteAddress() << ", FD is " << route->getFd() << endl;
1724 
1725  for (int i = 0; i < routeNum; i++) {
1726  source = eigrpTt->getRoute(i);
1727  if (source->getRouteId() != routeId || !source->isValid())
1728  continue;
1729 
1730  sourceCounter++;
1731 
1732  if (source->getRd() < routeFd /* FC, use this FD (not dmin) */ &&
1733  source->getMetric() <= dmin * this->variance && pathsInRT < this->maximumPath) /* Load Balancing */
1734  {
1735  EV_DEBUG << " successor " << source->getNextHop() << " (" << source->getMetric() << "/" << source->getRd() << ")" << endl;
1736 
1737  if ((rtEntry = findRoute(route->getRouteAddress(), getNetmaskLength(route->getRouteMask()), source->getNextHop())) == nullptr)
1738  if (!isRTSafeForAdd(route, adminDistInt)) { // In RT exists route with smaller AD, do not mark the route source as successor
1739  source->setSuccessor(false);
1740  EV_DEBUG << " route can not be added into RT, there is route with smaller AD" << endl;
1741  continue; // Skip the route
1742  }
1743 
1744  if (installRouteToRT(route, source, dmin, rtEntry))
1745  *rtableChanged = true;
1746 
1747  pathsInRT++;
1748  source->setSuccessor(true);
1749  }
1750  else if (source->isSuccessor()) { // Remove old successor from RT
1751  if (removeOldSuccessor(source, route))
1752  *rtableChanged = true;
1753  }
1754 
1755  if (removeUnreach && source->isUnreachable() && source->getDelayedRemove() == 0 && source->isValid()) { // Invalidate unreachable routes in TT
1756  source->setValid(false);
1757  EV_DEBUG << " invalidate route via " << source->getNextHop() << " in TT" << endl;
1758  }
1759  }
1760 
1761  route->setNumSucc(pathsInRT);
1762 
1763  if ((bestSuccessor = eigrpTt->getBestSuccessor(route)) != nullptr) { // Update route with best Successor
1764  if (dmin < routeFd) // Set only if there is a successor
1765  route->setFd(dmin);
1766  route->setDij(dmin);
1767  route->setRdPar(bestSuccessor->getMetricParams());
1768  route->setSuccessor(bestSuccessor);
1769 
1770  if (sourceCounter == 1) { // Set FD of route to Successor metric (according to Cisco EIGRP implementation)
1771  route->setFd(bestSuccessor->getMetric());
1772  }
1773  }
1774  else
1775  route->setSuccessor(nullptr);
1776 
1777  return bestSuccessor;
1778 }

Member Data Documentation

◆ adminDistInt

unsigned int inet::eigrp::EigrpIpv6Pdm::adminDistInt
protected

Administrative distance.

Referenced by EigrpIpv6Pdm(), processRTRouteDel(), and updateRoute().

◆ asNum

int inet::eigrp::EigrpIpv6Pdm::asNum
protected

Autonomous system number.

Referenced by addMessageHeader(), checkNeighborshipRules(), EigrpIpv6Pdm(), and initialize().

◆ EIGRP_IPV6_MULT

const Ipv6Address inet::eigrp::EigrpIpv6Pdm::EIGRP_IPV6_MULT
protected

Multicast address for EIGRP messages.

Referenced by disableInterface(), enableInterface(), getDestIpAddress(), and setPassive().

◆ EIGRP_SELF_ADDR

const Ipv6Address inet::eigrp::EigrpIpv6Pdm::EIGRP_SELF_ADDR
protected

Next hop address 0.0.0.0 (self address)

◆ eigrpDual

◆ eigrpIft

◆ eigrpIftDisabled

EigrpDisabledInterfaces* inet::eigrp::EigrpIpv6Pdm::eigrpIftDisabled
protected

◆ eigrpMetric

◆ eigrpNt

◆ eigrpStub

EigrpStub inet::eigrp::EigrpIpv6Pdm::eigrpStub
protected

EIGRP stub configuration.

Referenced by applyStubToUpdate(), createHelloPacket(), and initialize().

◆ eigrpStubEnabled

bool inet::eigrp::EigrpIpv6Pdm::eigrpStubEnabled
protected

◆ eigrpTt

◆ host

cModule* inet::eigrp::EigrpIpv6Pdm::host = nullptr
protected

Referenced by initialize().

◆ ift

◆ kValues

EigrpKValues inet::eigrp::EigrpIpv6Pdm::kValues
protected

◆ KVALUES_MAX

EigrpKValues inet::eigrp::EigrpIpv6Pdm::KVALUES_MAX
protected

K-values (from K1 to K5) are set to max.

Referenced by EigrpIpv6Pdm(), and processHelloPacket().

◆ maximumPath

int inet::eigrp::EigrpIpv6Pdm::maximumPath
protected

Maximum number of parallel routes that EIGRP will support.

Referenced by EigrpIpv6Pdm(), initialize(), and updateRoute().

◆ netPrefixes

PrefixVector inet::eigrp::EigrpIpv6Pdm::netPrefixes
protected

◆ oldsource

EigrpRouteSource<Ipv6Address>* inet::eigrp::EigrpIpv6Pdm::oldsource = nullptr
protected

Latest route change.

Referenced by processRTRouteDel().

◆ reqQueue

RequestVector inet::eigrp::EigrpIpv6Pdm::reqQueue
protected

Requests for sending EIGRP messages from DUAL.

Referenced by flushMsgRequests(), and pushMsgRouteToQueue().

◆ ribScale

int inet::eigrp::EigrpIpv6Pdm::ribScale
protected

Scaling factor for Wide metric.

Referenced by EigrpIpv6Pdm().

◆ routingForNetworks

EigrpNetworkTable<Ipv6Address>* inet::eigrp::EigrpIpv6Pdm::routingForNetworks
protected

Networks included in EIGRP.

Referenced by addNetwork(), disableInterface(), initialize(), and ~EigrpIpv6Pdm().

◆ rt

◆ RTP_OUTGW

const char* inet::eigrp::EigrpIpv6Pdm::RTP_OUTGW
protected

◆ sizeOfMsg

const int64_t inet::eigrp::EigrpIpv6Pdm::sizeOfMsg = 20
protected

◆ SPLITTER_OUTGW

const char* inet::eigrp::EigrpIpv6Pdm::SPLITTER_OUTGW
protected

Output gateway to the EIGRP Splitter module.

Referenced by EigrpIpv6Pdm(), and processMsgFromRtp().

◆ useClassicMetric

bool inet::eigrp::EigrpIpv6Pdm::useClassicMetric
protected

Use classic metric computation or wide metric computation.

Referenced by EigrpIpv6Pdm().

◆ variance

int inet::eigrp::EigrpIpv6Pdm::variance
protected

Parameter for unequal cost load balancing.

Referenced by EigrpIpv6Pdm(), and initialize().


The documentation for this class was generated from the following files:
inet::eigrp::EigrpIpv6Pdm::eigrpStub
EigrpStub eigrpStub
EIGRP stub configuration.
Definition: EigrpIpv6Pdm.h:75
inet::eigrp::EigrpNeighbor::UNSPEC_ID
static const int UNSPEC_ID
Definition: EigrpNeighbor.h:50
inet::EigrpStub::redistributedRt
bool redistributedRt
Definition: EigrpMessage_m.h:192
inet::eigrp::EigrpTopologyTable::findRoute
EigrpRouteSource< IPAddress > * findRoute(const IPAddress &routeAddr, const IPAddress &routeMask, const IPAddress &nextHop)
Definition: EigrpTopologyTable.cc:115
inet::eigrp::EigrpIpv6Pdm::sendUpdate
void sendUpdate(int destNeighbor, EigrpRoute< Ipv6Address > *route, EigrpRouteSource< Ipv6Address > *source, bool forcePoisonRev, const char *reason) override
Sends update message to specified neighbor.
Definition: EigrpIpv6Pdm.cc:1612
inet::eigrp::EigrpIpv6Pdm::cancelHoldTimer
void cancelHoldTimer(EigrpNeighbor< Ipv6Address > *neigh)
Stops Hold timer.
Definition: EigrpIpv6Pdm.cc:1090
inet::eigrp::EigrpIpv6Pdm::processIfaceStateChange
void processIfaceStateChange(NetworkInterface *iface)
Definition: EigrpIpv6Pdm.cc:152
inet::EIGRP_UPDATE_MSG
@ EIGRP_UPDATE_MSG
Definition: EigrpMessage_m.h:89
inet::eigrp::EigrpInterfaceTable::getInterface
EigrpInterface * getInterface(int k) const
Returns interface by its position in the table.
Definition: EigrpInterfaceTable.h:180
inet::eigrp::EigrpIpv6Pdm::eigrpDual
EigrpDual< Ipv6Address > * eigrpDual
Definition: EigrpIpv6Pdm.h:82
inet::eigrp::EigrpDual::INTERFACE_UP
@ INTERFACE_UP
EIGRP enabled on interface.
Definition: EigrpDual.h:39
inet::eigrp::EigrpIpv6Pdm::processNewNeighbor
void processNewNeighbor(int ifaceId, Ipv6Address &srcAddress, const EigrpIpv6Hello *helloMessage)
Creates relationship with neighbor.
Definition: EigrpIpv6Pdm.cc:1003
inet::eigrp::EigrpIpv6Pdm::findRoute
Ipv6Route * findRoute(const Ipv6Address &prefix, int prefixLength)
Definition: EigrpIpv6Pdm.cc:1921
inet::EigrpStub::staticRt
bool staticRt
Definition: EigrpMessage_m.h:190
inet::eigrp::EigrpTopologyTable::getBestSuccessorByIf
EigrpRouteSource< IPAddress > * getBestSuccessorByIf(EigrpRoute< IPAddress > *route, int ifaceId)
Returns first successor on specified interface.
Definition: EigrpTopologyTable.cc:216
EIGRP_HOLD_TIMER
@ EIGRP_HOLD_TIMER
Definition: EigrpTimer_m.h:44
protocol
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down protocol
Definition: IUdp-gates.txt:25
inet::eigrp::EigrpIpv6Pdm::maximumPath
int maximumPath
Maximum number of parallel routes that EIGRP will support.
Definition: EigrpIpv6Pdm.h:69
inet::eigrp::EigrpIpv6Pdm::ift
ModuleRefByPar< IInterfaceTable > ift
Definition: EigrpIpv6Pdm.h:77
inet::eigrp::EigrpInterface::setBandwidth
void setBandwidth(uint64_t bw)
Definition: EigrpInterfaceTable.h:88
inet::eigrp::EigrpIpv6Pdm::addInterfaceToEigrp
EigrpInterface * addInterfaceToEigrp(int ifaceId, bool enabled)
Creates interface and inserts it to the table.
Definition: EigrpIpv6Pdm.cc:1440
inet::getNetmaskLength
int getNetmaskLength(const Ipv4Address &netmask)
Uses IPv4Address.getNetmaskLength() method.
Definition: EigrpDualStack.cc:22
inet::eigrp::EigrpMetricHelper::compareParameters
bool compareParameters(const EigrpWideMetricPar &par1, const EigrpWideMetricPar &par2, EigrpKValues &kValues)
Compares metric enabled parameters.
Definition: EigrpMetricHelper.cc:114
inet::Ipv6Address::LINK
@ LINK
Definition: Ipv6Address.h:46
inet::eigrp::EigrpIpv6Pdm::processQueryPacket
void processQueryPacket(Packet *pk, Ipv6Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv6Address > *neigh)
Definition: EigrpIpv6Pdm.cc:660
inet::eigrp::EigrpIpv6Pdm::KVALUES_MAX
EigrpKValues KVALUES_MAX
K-values (from K1 to K5) are set to max.
Definition: EigrpIpv6Pdm.h:63
inet::eigrp::EigrpIpv6Pdm::processRTRouteDel
void processRTRouteDel(const cObject *details)
Definition: EigrpIpv6Pdm.cc:231
inet::EigrpKValues::K1
uint16_t K1
Definition: EigrpMessage_m.h:127
inet::eigrp::EigrpIpv6Pdm::useClassicMetric
bool useClassicMetric
Use classic metric computation or wide metric computation.
Definition: EigrpIpv6Pdm.h:72
inet::Protocol::ipv6
static const Protocol ipv6
Definition: Protocol.h:94
inet::NetworkInterface::DOWN
@ DOWN
Definition: NetworkInterface.h:92
inet::eigrp::EigrpIpv6Pdm::SPLITTER_OUTGW
const char * SPLITTER_OUTGW
Output gateway to the EIGRP Splitter module.
Definition: EigrpIpv6Pdm.h:60
inet::eigrp::EigrpIpv6Pdm::isRTSafeForAdd
bool isRTSafeForAdd(EigrpRoute< Ipv6Address > *route, unsigned int eigrpAd)
Returns true, if routing table does not contain route with given address, mask and smaller administra...
Definition: EigrpIpv6Pdm.cc:1692
inet::eigrp::EigrpNeighborTable::decStubCount
void decStubCount()
Definition: EigrpNeighborTable.h:67
inet::Ipv6Route::dEIGRPExternal
@ dEIGRPExternal
Definition: Ipv6Route.h:41
inet::getContainingNode
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:40
inet::eigrp::EigrpMetricHelper::computeClassicMetric
uint64_t computeClassicMetric(const EigrpWideMetricPar &par, const EigrpKValues &kValues)
Computes classic metric.
Definition: EigrpMetricHelper.cc:69
inet::eigrp::EigrpTopologyTable::findOrCreateRoute
EigrpRouteSource< IPAddress > * findOrCreateRoute(const IPAddress &routeAddr, const IPAddress &routeMask, const Ipv4Address &routerId, eigrp::EigrpInterface *eigrpIface, int nextHopId, bool *sourceNew)
Finds and returns source with given address or create one.
Definition: EigrpTopologyTable.cc:458
InterfaceReq
removed InterfaceReq
Definition: IUdp-gates.txt:11
inet::eigrp::EigrpIpv6Pdm::unlockRoutes
void unlockRoutes(const EigrpMsgReq *msgReq)
Definition: EigrpIpv6Pdm.cc:899
inet::NetworkInterface::GOING_UP
@ GOING_UP
Definition: NetworkInterface.h:92
DispatchProtocolReq
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down DispatchProtocolReq
Definition: IUdp-gates.txt:25
inet::eigrp::EigrpIpv6Pdm::eigrpIftDisabled
EigrpDisabledInterfaces * eigrpIftDisabled
Disabled EIGRP interfaces.
Definition: EigrpIpv6Pdm.h:85
L3AddressInd
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd L3AddressInd
Definition: IUdp-gates.txt:20
inet::EIGRP_HELLO_MSG
@ EIGRP_HELLO_MSG
Definition: EigrpMessage_m.h:93
EigrpTimer::setTimerKind
virtual void setTimerKind(char timerKind)
inet::IRoute::EIGRP
@ EIGRP
Definition: IRoute.h:42
inet::eigrp::EigrpIpv6Pdm::processMsgFromNetwork
void processMsgFromNetwork(cMessage *msg)
Process message from network layer.
Definition: EigrpIpv6Pdm.cc:296
inet::eigrp::EigrpIpv6Pdm::processIfaceConfigChange
void processIfaceConfigChange(EigrpInterface *eigrpIface)
Definition: EigrpIpv6Pdm.cc:196
inet::EigrpKValues::K6
uint16_t K6
Definition: EigrpMessage_m.h:132
inet::eigrp::EigrpMetricHelper::isParamMaximal
bool isParamMaximal(const EigrpWideMetricPar &par)
Returns true, if parameters are set to infinite, otherwise false.
Definition: EigrpMetricHelper.h:78
inet::eigrp::EigrpIpv6Pdm::removeOldSuccessor
bool removeOldSuccessor(EigrpRouteSource< Ipv6Address > *source, EigrpRoute< Ipv6Address > *route)
Removes route from routing table and changes old successor's record in topology table.
Definition: EigrpIpv6Pdm.cc:1780
inet::eigrp::EigrpIpv6Pdm::disableInterface
void disableInterface(NetworkInterface *iface, EigrpInterface *eigrpIface)
Remove interface from EIGRP interface table.
Definition: EigrpIpv6Pdm.cc:1383
inet::eigrp::EigrpTopologyTable::findRouteInfoById
EigrpRoute< IPAddress > * findRouteInfoById(int routeId)
Definition: EigrpTopologyTable.cc:509
inet::Protocol::eigrp
static const Protocol eigrp
Definition: Protocol.h:63
inet::eigrp::EigrpInterfaceTable::findInterfaceById
EigrpInterface * findInterfaceById(int ifaceId)
Gets interface from table by interface ID.
Definition: EigrpInterfaceTable.cc:155
inet::eigrp::EigrpNeighborTable::getFirstNeighborOnIf
EigrpNeighbor< IPAddress > * getFirstNeighborOnIf(int ifaceId)
Returns first neighbor that resides on specified interface.
Definition: EigrpNeighborTable.cc:144
inet::NetworkInterface::State
State
Definition: NetworkInterface.h:92
inet::EigrpStub::connectedRt
bool connectedRt
Definition: EigrpMessage_m.h:189
inet::eigrp::EigrpIpv6Pdm::addRoutesToMsg
void addRoutesToMsg(const Ptr< EigrpIpv6Message > &msg, const EigrpMsgReq *msgReq)
Add routes from request to the message.
Definition: EigrpIpv6Pdm.cc:917
inet::eigrp::EigrpTopologyTable::purgeTable
void purgeTable()
Deletes unreachable routes from the topology table.
Definition: EigrpTopologyTable.cc:397
inet::eigrp::EigrpTopologyTable::hasFeasibleSuccessor
bool hasFeasibleSuccessor(EigrpRoute< IPAddress > *route, uint64_t &resultDmin)
Finds feasible successor and minimal distance to the destination.
Definition: EigrpTopologyTable.cc:238
inet::eigrp::EigrpIpv6Pdm::applyStubToQuery
bool applyStubToQuery(EigrpInterface *eigrpIface, int numOfNeigh)
Apply stub configuration to the route in outgoing Query message.
Definition: EigrpIpv6Pdm.cc:1238
inet::EigrpStub::leakMapRt
bool leakMapRt
Definition: EigrpMessage_m.h:193
inet::EigrpKValues::K3
uint16_t K3
Definition: EigrpMessage_m.h:129
inet::eigrp::EigrpNeighborTable::incStubCount
void incStubCount()
Definition: EigrpNeighborTable.h:66
inet::eigrp::EigrpIpv6Pdm::applyStubToUpdate
bool applyStubToUpdate(EigrpRouteSource< Ipv6Address > *src)
Apply stub configuration to the route in outgoing Update message.
Definition: EigrpIpv6Pdm.cc:1322
inet::eigrp::EigrpDual::LOST_ROUTE
@ LOST_ROUTE
Route in RT deleted, but not by EIGRP.
Definition: EigrpDual.h:40
inet::eigrp::EigrpIpv6Pdm::pushMsgRouteToQueue
EigrpMsgReq * pushMsgRouteToQueue(HeaderOpcode msgType, int ifaceId, int neighId, const EigrpMsgRoute &msgRt)
Insert route into the queue with requests.
Definition: EigrpIpv6Pdm.cc:1280
inet::eigrp::EigrpTopologyTable::getRouterId
Ipv4Address & getRouterId()
Definition: EigrpTopologyTable.h:95
inet::eigrp::EigrpIpv6Pdm::processUpdatePacket
void processUpdatePacket(Packet *pk, Ipv6Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv6Address > *neigh)
Definition: EigrpIpv6Pdm.cc:604
inet::eigrp::EigrpIpv6Pdm::removeNeighbor
void removeNeighbor(EigrpNeighbor< Ipv6Address > *neigh)
Removes neighbor from neighbor table and delete it.
Definition: EigrpIpv6Pdm.cc:1138
inet::eigrp::EigrpDual::RECV_QUERY
@ RECV_QUERY
Received query message.
Definition: EigrpDual.h:35
PacketProtocolTag
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down PacketProtocolTag
Definition: IUdp-gates.txt:25
inet::eigrp::IEigrpPdm::UNSPEC_RECEIVER
static const int UNSPEC_RECEIVER
Unspecified address of receiver - all neighbors.
Definition: IEigrpPdm.h:29
EIGRP_HELLO_TIMER
@ EIGRP_HELLO_TIMER
Definition: EigrpTimer_m.h:43
inet::eigrp::EigrpDual::RECV_UPDATE
@ RECV_UPDATE
Change of route distance in received update message or on interface.
Definition: EigrpDual.h:34
inet::eigrp::EigrpIpv6Pdm::getNextHopAddr
Ipv6Address getNextHopAddr(const Ipv6Address &nextHopAddr, Ipv6Address &senderAddr)
Returns next hop address.
Definition: EigrpIpv6Pdm.h:226
inet::EigrpStub::recvOnlyRt
bool recvOnlyRt
Definition: EigrpMessage_m.h:194
inet::eigrp::M_DISABLED_ON_IF
@ M_DISABLED_ON_IF
Definition: EigrpPrint.h:41
inet::eigrp::EigrpTopologyTable::getBestSuccessor
EigrpRouteSource< IPAddress > * getBestSuccessor(EigrpRoute< IPAddress > *route)
Returns best successor to the destination.
Definition: EigrpTopologyTable.cc:175
inet::eigrp::EigrpIpv6Pdm::applySplitHorizon
bool applySplitHorizon(EigrpInterface *destInterface, EigrpRouteSource< Ipv6Address > *source, EigrpRoute< Ipv6Address > *route)
Definition: EigrpIpv6Pdm.cc:1314
inet::eigrp::EigrpIpv6Pdm::cancelHelloTimers
void cancelHelloTimers()
Stops Hello Timers on all interfaces.
Definition: EigrpIpv6Pdm.cc:1102
inet::eigrp::EigrpIpv6Pdm::resetTimer
void resetTimer(EigrpTimer *timer, int interval)
Sets specified timer to given interval.
Definition: EigrpIpv6Pdm.h:111
inet::eigrp::EigrpInterfaceTable::removeInterface
EigrpInterface * removeInterface(EigrpInterface *iface)
Removes interface from table.
Definition: EigrpInterfaceTable.cc:143
inet::eigrp::EigrpIpv6Pdm::addMessageHeader
void addMessageHeader(const Ptr< EigrpMessage > &msg, int opcode, EigrpMsgReq *msgReq)
Adds ControlInfo for network layer module.
Definition: EigrpIpv6Pdm.cc:864
inet::units::units::B
intscale< b, 1, 8 > B
Definition: Units.h:1168
inet::eigrp::EigrpIpv6Pdm::createQueryPacket
Packet * createQueryPacket(Ipv6Address &destAddress, EigrpMsgReq *msgReq)
Definition: EigrpIpv6Pdm.cc:823
inet::eigrp::EigrpIpv6Pdm::setRouteTlvMetric
void setRouteTlvMetric(EigrpWideMetricPar *msgMetric, EigrpWideMetricPar *rtMetric)
Definition: EigrpIpv6Pdm.cc:887
inet::eigrp::EigrpIpv6Pdm::printSentMsg
void printSentMsg(int routeCnt, Ipv6Address &destAddress, EigrpMsgReq *msgReq)
Definition: EigrpIpv6Pdm.cc:449
inet::eigrp::EigrpIpv6Pdm::asNum
int asNum
Autonomous system number.
Definition: EigrpIpv6Pdm.h:67
inet::eigrp::EigrpIpv6Pdm::enableInterface
void enableInterface(EigrpInterface *eigrpIface)
Add interface to the EIGRP interface table and notifies DUAL.
Definition: EigrpIpv6Pdm.cc:1463
inet::Ipv6Address::LINKLOCAL_PREFIX
static const Ipv6Address LINKLOCAL_PREFIX
The link-local prefix (fe80::)
Definition: Ipv6Address.h:78
inet::eigrp::EigrpIpv6Pdm::setRTRouteMetric
void setRTRouteMetric(Ipv6Route *route, uint64_t metric)
Changes metric of route in routing table.
Definition: EigrpIpv6Pdm.h:248
inet::eigrp::EigrpInterface::isSplitHorizonEn
bool isSplitHorizonEn() const
Definition: EigrpInterfaceTable.h:109
inet::Ipv6Address::UNSPECIFIED_ADDRESS
static const Ipv6Address UNSPECIFIED_ADDRESS
The unspecified address.
Definition: Ipv6Address.h:54
inet::eigrp::EigrpTopologyTable::removeRouteInfo
EigrpRoute< IPAddress > * removeRouteInfo(EigrpRoute< IPAddress > *route)
Definition: EigrpTopologyTable.cc:483
inet::eigrp::EigrpIpv6Pdm::ribScale
int ribScale
Scaling factor for Wide metric.
Definition: EigrpIpv6Pdm.h:73
inet::eigrp::EigrpMetricHelper::BANDWIDTH_INF
static const uint64_t BANDWIDTH_INF
Definition: EigrpMetricHelper.h:49
inet::eigrp::EigrpIpv6Pdm::startHelloTimer
void startHelloTimer(EigrpInterface *eigrpIface, simtime_t interval)
Schedule hello timer to the specified interval.
Definition: EigrpIpv6Pdm.cc:1522
inet::eigrp::EigrpNeighborTable::getNeighbor
EigrpNeighbor< IPAddress > * getNeighbor(int k) const
Definition: EigrpNeighborTable.h:63
inet::eigrp::EigrpDual::NEIGHBOR_DOWN
@ NEIGHBOR_DOWN
Neighbor went down.
Definition: EigrpDual.h:37
inet::eigrp::EigrpIpv6Pdm::adminDistInt
unsigned int adminDistInt
Administrative distance.
Definition: EigrpIpv6Pdm.h:71
HopLimitReq
removed HopLimitReq
Definition: IUdp-gates.txt:11
inet::eigrp::EigrpIpv6Pdm::printRecvMsg
void printRecvMsg(const EigrpMessage *msg, Ipv6Address &addr, int ifaceId)
Definition: EigrpIpv6Pdm.cc:476
inet::eigrp::EigrpTopologyTable::getNumRoutes
int getNumRoutes() const
Definition: EigrpTopologyTable.h:60
inet::eigrp::EigrpNeighborTable::getStubCount
int getStubCount() const
Definition: EigrpNeighborTable.h:65
inet::eigrp::IEigrpPdm::STUB_RECEIVER
static const int STUB_RECEIVER
All stub neighbors.
Definition: IEigrpPdm.h:30
type
removed type
Definition: IUdp-gates.txt:7
inet::eigrp::EigrpTopologyTable::delayedRemove
void delayedRemove(int neighId)
Definition: EigrpTopologyTable.cc:381
inet::eigrp::EigrpIpv6Pdm::processMsgFromRtp
void processMsgFromRtp(cMessage *msg)
Process message request from RTP.
Definition: EigrpIpv6Pdm.cc:360
inet::eigrp::IEigrpPdm::UNSPEC_SENDER
static const int UNSPEC_SENDER
Unspecified address of sender - input event source.
Definition: IEigrpPdm.h:33
inet::EigrpKValues::K5
uint16_t K5
Definition: EigrpMessage_m.h:131
inet::eigrp::EigrpIpv6Pdm::createUpdatePacket
Packet * createUpdatePacket(const Ipv6Address &destAddress, EigrpMsgReq *msgReq)
Definition: EigrpIpv6Pdm.cc:804
inet::eigrp::EigrpTopologyTable::setRouterId
void setRouterId(Ipv4Address &routerID)
Definition: EigrpTopologyTable.h:96
inet::eigrp::EigrpIpv6Pdm::installRouteToRT
bool installRouteToRT(EigrpRoute< Ipv6Address > *route, EigrpRouteSource< Ipv6Address > *source, uint64_t dmin, Ipv6Route *rtEntry)
Updates existing route in the routing table or creates new one.
Definition: EigrpIpv6Pdm.cc:1806
inet::eigrp::EigrpIpv6Pdm::createNeighbor
EigrpNeighbor< Ipv6Address > * createNeighbor(EigrpInterface *eigrpIface, Ipv6Address &address, uint16_t holdInt)
Create record in the neighbor table and start hold timer.
Definition: EigrpIpv6Pdm.cc:1073
inet::eigrp::EigrpIpv6Pdm::createTimer
EigrpTimer * createTimer(char timerKind, void *context)
Creates timer of specified type.
Definition: EigrpIpv6Pdm.cc:754
inet::eigrp::EigrpTopologyTable::getNumRouteInfo
int getNumRouteInfo() const
Definition: EigrpTopologyTable.h:88
inet::eigrp::EigrpIpv6Pdm::createAckPacket
Packet * createAckPacket(Ipv6Address &destAddress, EigrpMsgReq *msgReq)
Definition: EigrpIpv6Pdm.cc:790
inet::interfaceStateChangedSignal
simsignal_t interfaceStateChangedSignal
Definition: Simsignals.cc:32
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::eigrp::EigrpInterface::setLoad
void setLoad(int load)
Definition: EigrpInterfaceTable.h:100
inet::eigrp::EigrpInterfaceTable::getNumInterfaces
int getNumInterfaces() const
Returns number of interfaces in the table.
Definition: EigrpInterfaceTable.h:176
inet::eigrp::EigrpIpv6Pdm::removeRouteFromRT
bool removeRouteFromRT(EigrpRouteSource< Ipv6Address > *successor, IRoute::SourceType *removedRtSrc)
Definition: EigrpIpv6Pdm.cc:1670
inet::eigrp::EigrpIpv6Pdm::host
cModule * host
Definition: EigrpIpv6Pdm.h:57
inet::Ipv6Address::words
uint32_t * words()
Returns a pointer to the internal binary representation of the address: four 32-bit words,...
Definition: Ipv6Address.h:192
NUM_INIT_STAGES
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
inet::eigrp::EigrpIpv6Pdm::getInterfaceById
EigrpInterface * getInterfaceById(int ifaceId)
Returns EIGRP interface (enabled or disabled) or nullptr.
Definition: EigrpIpv6Pdm.cc:1373
inet::eigrp::EigrpDisabledInterfaces::addInterface
void addInterface(EigrpInterface *interface)
Adds interface to the table.
Definition: EigrpDisabledInterfaces.cc:40
inet::eigrp::EigrpIpv6Pdm::createReplyPacket
Packet * createReplyPacket(Ipv6Address &destAddress, EigrpMsgReq *msgReq)
Definition: EigrpIpv6Pdm.cc:842
inet::eigrp::EigrpIpv6Pdm::processInterRoute
EigrpRouteSource< Ipv6Address > * processInterRoute(const EigrpMpIpv6Internal &tlv, Ipv6Address &nextHop, int sourceNeighId, EigrpInterface *eigrpIface, bool *notifyDual, bool *isSourceNew)
Process route TLV.
Definition: EigrpIpv6Pdm.cc:714
inet::eigrp::EigrpTopologyTable::findRouteDMin
uint64_t findRouteDMin(EigrpRoute< IPAddress > *route)
Definition: EigrpTopologyTable.cc:152
inet::eigrp::M_OK
@ M_OK
Definition: EigrpPrint.h:35
inet::EIGRP_REPLY_MSG
@ EIGRP_REPLY_MSG
Definition: EigrpMessage_m.h:92
inet::eigrp::EigrpIpv6Pdm::kValues
EigrpKValues kValues
K-values for calculation of metric.
Definition: EigrpIpv6Pdm.h:68
inet::eigrp::EigrpDisabledInterfaces::findInterface
EigrpInterface * findInterface(int ifaceId)
Finds interface by ID in table and returns it.
Definition: EigrpDisabledInterfaces.cc:58
inet::eigrp::UserMsgs
const char * UserMsgs[]
Definition: EigrpPrint.cc:23
inet::eigrp::EigrpIpv6Pdm::variance
int variance
Parameter for unequal cost load balancing.
Definition: EigrpIpv6Pdm.h:70
inet::eigrp::EigrpIpv6Pdm::oldsource
EigrpRouteSource< Ipv6Address > * oldsource
Latest route change.
Definition: EigrpIpv6Pdm.h:65
inet::eigrp::EigrpNetworkTable::UNSPEC_NETID
static const int UNSPEC_NETID
Definition: EigrpNetworkTable.h:71
inet::eigrp::EigrpInterface::setReliability
void setReliability(int rel)
Definition: EigrpInterfaceTable.h:97
inet::eigrp::EigrpIpv6Pdm::createRouteTlv
void createRouteTlv(EigrpMpIpv6Internal *routeTlv, EigrpRoute< Ipv6Address > *route, bool unreachable=false)
Definition: EigrpIpv6Pdm.cc:874
inet::eigrp::EigrpIpv6Pdm::eigrpIft
EigrpInterfaceTable * eigrpIft
Table with enabled EIGRP interfaces.
Definition: EigrpIpv6Pdm.h:84
inet::eigrp::EigrpIpv6Pdm::checkNeighborshipRules
int checkNeighborshipRules(int ifaceId, int neighAsNum, Ipv6Address &neighAddr, const EigrpKValues &neighKValues)
Checks neighborship rules.
Definition: EigrpIpv6Pdm.cc:1049
inet::eigrp::EigrpIpv6Pdm::rt
ModuleRefByPar< Ipv6RoutingTable > rt
Definition: EigrpIpv6Pdm.h:79
inet::eigrp::EigrpIpv6Pdm::sendAllEigrpPaths
void sendAllEigrpPaths(EigrpInterface *eigrpIface, EigrpNeighbor< Ipv6Address > *neigh)
Creates and sends message with all routes from routing table to specified neighbor.
Definition: EigrpIpv6Pdm.cc:964
inet::eigrp::EigrpMetricHelper::getParam
EigrpWideMetricPar getParam(EigrpInterface *eigrpIface)
Sets parameters from interface for metric computation.
Definition: EigrpMetricHelper.cc:34
inet::eigrp::EigrpIpv6Pdm::sizeOfMsg
const int64_t sizeOfMsg
Definition: EigrpIpv6Pdm.h:59
inet::eigrp::EigrpNeighborTable::addNeighbor
int addNeighbor(EigrpNeighbor< IPAddress > *neighbor)
Adds neighbor to the table.
Definition: EigrpNeighborTable.cc:118
inet::eigrp::EigrpInterface::setDelay
void setDelay(uint64_t dly)
Definition: EigrpInterfaceTable.h:94
inet::EigrpStub::summaryRt
bool summaryRt
Definition: EigrpMessage_m.h:191
Enter_Method
#define Enter_Method(...)
Definition: SelfDoc.h:71
inet::routeDeletedSignal
simsignal_t routeDeletedSignal
Definition: Simsignals.cc:42
inet::eigrp::EigrpIpv6Pdm::msgToIface
void msgToIface(HeaderOpcode msgType, EigrpRouteSource< Ipv6Address > *source, EigrpInterface *eigrpIface, bool forcePoisonRev=false, bool forceUnreachable=false)
Creates request for sending message on specified interface.
Definition: EigrpIpv6Pdm.cc:1247
inet::Ipv6Route::dEIGRPInternal
@ dEIGRPInternal
Definition: Ipv6Route.h:34
EigrpTimer::getTimerKind
virtual char getTimerKind() const
inet::eigrp::EigrpIpv6Pdm::getDestIpAddress
bool getDestIpAddress(int destNeigh, Ipv6Address *resultAddress)
Returns IP address for sending EIGRP message.
Definition: EigrpIpv6Pdm.cc:430
inet::eigrp::EigrpIpv6Pdm::flushMsgRequests
void flushMsgRequests()
Sends all message requests to RTP.
Definition: EigrpIpv6Pdm.cc:1342
inet::EigrpKValues::K4
uint16_t K4
Definition: EigrpMessage_m.h:130
inet::eigrp::EigrpTopologyTable::getRouteInfo
EigrpRoute< IPAddress > * getRouteInfo(int k)
Definition: EigrpTopologyTable.h:89
inet::eigrp::EigrpIpv6Pdm::createMsgReq
EigrpMsgReq * createMsgReq(HeaderOpcode msgType, int destNeighbor, int destIface)
Creates request for sending of EIGRP message for RTP.
Definition: EigrpIpv6Pdm.cc:953
inet::eigrp::EigrpIpv6Pdm::EIGRP_IPV6_MULT
const Ipv6Address EIGRP_IPV6_MULT
Multicast address for EIGRP messages.
Definition: EigrpIpv6Pdm.h:62
inet::eigrp::EigrpDisabledInterfaces::getInterface
EigrpInterface * getInterface(int k) const
Returns interface by its position in the table.
Definition: EigrpDisabledInterfaces.h:52
inet::eigrp::EigrpIpv6Pdm::routingForNetworks
EigrpNetworkTable< Ipv6Address > * routingForNetworks
Networks included in EIGRP.
Definition: EigrpIpv6Pdm.h:88
inet::eigrp::EigrpDisabledInterfaces::getNumInterfaces
int getNumInterfaces() const
Returns number of interfaces in the table.
Definition: EigrpDisabledInterfaces.h:36
inet::eigrp::EigrpNeighborTable::findNeighborById
EigrpNeighbor< IPAddress > * findNeighborById(int id)
Finds neighbor by ID.
Definition: EigrpNeighborTable.cc:104
inet::eigrp::EigrpIpv6Pdm::createHelloPacket
Packet * createHelloPacket(int holdInt, EigrpKValues kValues, Ipv6Address &destAddress, EigrpMsgReq *msgReq)
Definition: EigrpIpv6Pdm.cc:763
inet::eigrp::EigrpMetricHelper::adjustParam
EigrpWideMetricPar adjustParam(const EigrpWideMetricPar &ifParam, const EigrpWideMetricPar &neighParam)
Adjust parameters of metric by interface parameters.
Definition: EigrpMetricHelper.cc:48
inet::eigrp::EigrpIpv6Pdm::processHelloPacket
void processHelloPacket(Packet *pk, Ipv6Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv6Address > *neigh)
Definition: EigrpIpv6Pdm.cc:563
EigrpTimer
Class generated from inet/routing/eigrp/EigrpTimer.msg:22 by opp_msgtool.
Definition: EigrpTimer_m.h:60
inet::eigrp::EigrpDisabledInterfaces::removeInterface
EigrpInterface * removeInterface(EigrpInterface *iface)
Removes specified interface from table and returns it.
Definition: EigrpDisabledInterfaces.cc:46
inet::eigrp::EigrpIpv6Pdm::msgToAllIfaces
void msgToAllIfaces(int destination, HeaderOpcode msgType, EigrpRouteSource< Ipv6Address > *source, bool forcePoisonRev, bool forceUnreachable)
Records request to send message to all neighbors.
Definition: EigrpIpv6Pdm.cc:1213
inet::eigrp::EigrpInterfaceTable::addInterface
void addInterface(EigrpInterface *interface)
Adds interface to table.
Definition: EigrpInterfaceTable.cc:137
inet::eigrp::EigrpTopologyTable::findRouteByNextHop
EigrpRouteSource< IPAddress > * findRouteByNextHop(int routeId, int nextHopId)
Definition: EigrpTopologyTable.cc:447
inet::eigrp::M_NEIGH_BAD_SUBNET
@ M_NEIGH_BAD_SUBNET
Definition: EigrpPrint.h:44
inet::eigrp::EigrpDual::INTERFACE_DOWN
@ INTERFACE_DOWN
EIGRP disabled on interface - only for connected route.
Definition: EigrpDual.h:38
inet::eigrp::EigrpTopologyTable::addRoute
void addRoute(EigrpRouteSource< IPAddress > *source)
Definition: EigrpTopologyTable.cc:277
inet::eigrp::EigrpIpv6Pdm::processTimer
void processTimer(cMessage *msg)
Definition: EigrpIpv6Pdm.cc:494
inet::eigrp::EigrpIpv6Pdm::eigrpStubEnabled
bool eigrpStubEnabled
True when EIGRP stub is on.
Definition: EigrpIpv6Pdm.h:74
inet::makeNetmask
Ipv6Address makeNetmask(int length)
Make network mask represented as IPv6 address from netmask length.
Definition: EigrpDualStack.cc:72
inet::interfaceConfigChangedSignal
simsignal_t interfaceConfigChangedSignal
Definition: Simsignals.cc:33
inet::eigrp::EigrpIpv6Pdm::processReplyPacket
void processReplyPacket(Packet *pk, Ipv6Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv6Address > *neigh)
Definition: EigrpIpv6Pdm.cc:687
inet::eigrp::EigrpMetricHelper::DELAY_INF
static const uint64_t DELAY_INF
Definition: EigrpMetricHelper.h:48
inet::eigrp::EigrpDual::RECV_REPLY
@ RECV_REPLY
Received reply message.
Definition: EigrpDual.h:36
inet::eigrp::M_NEIGH_BAD_AS
@ M_NEIGH_BAD_AS
Definition: EigrpPrint.h:42
inet::eigrp::EigrpIpv6Pdm::eigrpTt
EigrpTopologyTable< Ipv6Address > * eigrpTt
Topology table.
Definition: EigrpIpv6Pdm.h:87
inet::eigrp::EigrpIpv6Pdm::eigrpMetric
EigrpMetricHelper * eigrpMetric
Definition: EigrpIpv6Pdm.h:83
inet::eigrp::EigrpTopologyTable::findRouteById
EigrpRouteSource< IPAddress > * findRouteById(int sourceId)
Definition: EigrpTopologyTable.cc:436
inet::eigrp::EigrpIpv6Pdm::reqQueue
RequestVector reqQueue
Requests for sending EIGRP messages from DUAL.
Definition: EigrpIpv6Pdm.h:89
inet::eigrp::M_NEIGH_BAD_KVALUES
@ M_NEIGH_BAD_KVALUES
Definition: EigrpPrint.h:43
inet::IRoute::SourceType
SourceType
Specifies where the route comes from.
Definition: IRoute.h:28
inet::EigrpKValues::K2
uint16_t K2
Definition: EigrpMessage_m.h:128
inet::eigrp::EigrpIpv6Pdm::RTP_OUTGW
const char * RTP_OUTGW
Output gateway to the RTP module.
Definition: EigrpIpv6Pdm.h:61
inet::eigrp::EigrpIpv6Pdm::netPrefixes
PrefixVector netPrefixes
Definition: EigrpIpv6Pdm.h:90
inet::eigrp::EigrpNeighborTable::getNumNeighbors
int getNumNeighbors() const
Definition: EigrpNeighborTable.h:62
inet::INITSTAGE_ROUTING_PROTOCOLS
INET_API InitStage INITSTAGE_ROUTING_PROTOCOLS
Initialization of routing protocols.
inet::eigrp::EigrpNeighborTable::findNeighbor
EigrpNeighbor< IPAddress > * findNeighbor(const IPAddress &ipAddress)
Finds neighbor by IP address.
Definition: EigrpNeighborTable.cc:88
inet::eigrp::EigrpNeighborTable::removeNeighbor
EigrpNeighbor< IPAddress > * removeNeighbor(EigrpNeighbor< IPAddress > *neighbor)
Removes neighbor form the table, but the record still exists.
Definition: EigrpNeighborTable.cc:129
inet::eigrp::EigrpIpv6Pdm::createRTRoute
Ipv6Route * createRTRoute(EigrpRouteSource< Ipv6Address > *successor)
Definition: EigrpIpv6Pdm.cc:1192
inet::eigrp::EigrpIpv6Pdm::eigrpNt
EigrpNeighborTable< Ipv6Address > * eigrpNt
Table with EIGRP neighbors.
Definition: EigrpIpv6Pdm.h:86
inet::IRoute::UNKNOWN
@ UNKNOWN
Definition: IRoute.h:42
inet::eigrp::EigrpTopologyTable::getRoute
EigrpRouteSource< IPAddress > * getRoute(int k)
Definition: EigrpTopologyTable.h:61
inet::Ipv6Route::dUnknown
@ dUnknown
Definition: Ipv6Route.h:46
inet::EIGRP_QUERY_MSG
@ EIGRP_QUERY_MSG
Definition: EigrpMessage_m.h:91
inet::eigrp::EigrpIpv6Pdm::processAckPacket
void processAckPacket(Packet *pk, Ipv6Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv6Address > *neigh)
Definition: EigrpIpv6Pdm.cc:546
inet::eigrp::EigrpIpv6Pdm::addNetwork
EigrpNetwork< Ipv6Address > * addNetwork(Ipv6Address address, Ipv6Address mask) override
Adds new network to EigrpNetworkTable for routing.
Definition: EigrpIpv6Pdm.cc:1541