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

#include <EigrpIpv4Pdm.h>

Inheritance diagram for inet::eigrp::EigrpIpv4Pdm:
inet::eigrp::IEigrpModule< Ipv4Address > inet::eigrp::IEigrpPdm< Ipv4Address >

Public Member Functions

 EigrpIpv4Pdm ()
 
 ~EigrpIpv4Pdm ()
 
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< Ipv4Address > * addNetwork (Ipv4Address address, Ipv4Address 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...
 
bool addNetPrefix (const Ipv4Address &network, const short int prefixLen, const int ifaceId) override
 Adds information about IPv6 network prefix. 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< Ipv4Address > *route, EigrpRouteSource< Ipv4Address > *source, bool forcePoisonRev, const char *reason) override
 Sends update message to specified neighbor. More...
 
void sendQuery (int destNeighbor, EigrpRoute< Ipv4Address > *route, EigrpRouteSource< Ipv4Address > *source, bool forcePoisonRev=false) override
 Sends query message to specified neighbor. More...
 
void sendReply (EigrpRoute< Ipv4Address > *route, int destNeighbor, EigrpRouteSource< Ipv4Address > *source, bool forcePoisonRev=false, bool isUnreachable=false) override
 Sends reply message to specified neighbor. More...
 
EigrpRouteSource< Ipv4Address > * updateRoute (EigrpRoute< Ipv4Address > *route, uint64_t dmin, bool *rtableChanged, bool removeUnreach=false) override
 Function finds successors to the destination network. More...
 
uint64_t findRouteDMin (EigrpRoute< Ipv4Address > *route) override
 Returns minimal distance to destination network. More...
 
bool hasFeasibleSuccessor (EigrpRoute< Ipv4Address > *route, uint64_t &resultDmin) override
 Determine whether there are Feasibles Successors for specified route. More...
 
EigrpRouteSource< Ipv4Address > * getBestSuccessor (EigrpRoute< Ipv4Address > *route) override
 Returns best successor for specified network. More...
 
bool setReplyStatusTable (EigrpRoute< Ipv4Address > *route, EigrpRouteSource< Ipv4Address > *source, bool forcePoisonRev, int *neighCount, int *stubCount) override
 Sets Reply Status Table for specified network. More...
 
bool hasNeighborForUpdate (EigrpRouteSource< Ipv4Address > *source) override
 Returns tru if there are recipients for update message, else false. More...
 
void setDelayedRemove (int neighId, EigrpRouteSource< Ipv4Address > *src) override
 After receiving Ack from neighbor with neighId will be route removed from TT. More...
 
void sendUpdateToStubs (EigrpRouteSource< Ipv4Address > *succ, EigrpRouteSource< Ipv4Address > *oldSucc, EigrpRoute< Ipv4Address > *route) override
 Sends update message to all stub neighbors. More...
 
- Public Member Functions inherited from inet::eigrp::IEigrpModule< Ipv4Address >
virtual ~IEigrpModule ()
 

Protected Types

typedef std::vector< Ipv4Route * > RouteVector
 
typedef std::vector< EigrpMsgReq * > RequestVector
 

Protected Member Functions

void printSentMsg (int routeCnt, Ipv4Address &destAddress, EigrpMsgReq *msgReq)
 
void printRecvMsg (const EigrpMessage *msg, Ipv4Address &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< Ipv4Address > *neigh)
 Stops Hold timer. More...
 
void cancelHelloTimers ()
 Stops Hello Timers on all interfaces. More...
 
PacketcreateHelloPacket (int holdInt, EigrpKValues kValues, Ipv4Address &destAddress, EigrpMsgReq *msgReq)
 
PacketcreateAckPacket (Ipv4Address &destAddress, EigrpMsgReq *msgReq)
 
PacketcreateUpdatePacket (const Ipv4Address &destAddress, EigrpMsgReq *msgReq)
 
PacketcreateQueryPacket (Ipv4Address &destAddress, EigrpMsgReq *msgReq)
 
PacketcreateReplyPacket (Ipv4Address &destAddress, EigrpMsgReq *msgReq)
 
void addMessageHeader (const Ptr< EigrpMessage > &msg, int opcode, EigrpMsgReq *msgReq)
 
void unlockRoutes (const EigrpMsgReq *msgReq)
 
void createRouteTlv (EigrpMpIpv4Internal *routeTlv, EigrpRoute< Ipv4Address > *route, bool unreachable=false)
 
void addRoutesToMsg (const Ptr< EigrpIpv4Message > &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, Ipv4Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv4Address > *neigh)
 
void processHelloPacket (Packet *pk, Ipv4Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv4Address > *neigh)
 
void processUpdatePacket (Packet *pk, Ipv4Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv4Address > *neigh)
 
void processQueryPacket (Packet *pk, Ipv4Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv4Address > *neigh)
 
void processReplyPacket (Packet *pk, Ipv4Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv4Address > *neigh)
 
EigrpRouteSource< Ipv4Address > * processInterRoute (const EigrpMpIpv4Internal &tlv, Ipv4Address &nextHop, int sourceNeighId, EigrpInterface *eigrpIface, bool *notifyDual, bool *isSourceNew)
 Process route TLV. More...
 
void sendAllEigrpPaths (EigrpInterface *eigrpIface, EigrpNeighbor< Ipv4Address > *neigh)
 Creates and sends message with all routes from routing table to specified neighbor. More...
 
void processNewNeighbor (int ifaceId, Ipv4Address &srcAddress, const EigrpIpv4Hello *helloMessage)
 Creates relationship with neighbor. More...
 
int checkNeighborshipRules (int ifaceId, int neighAsNum, Ipv4Address &neighAddr, const EigrpKValues &neighKValues)
 Checks neighborship rules. More...
 
EigrpNeighbor< Ipv4Address > * createNeighbor (EigrpInterface *eigrpIface, Ipv4Address &address, uint16_t holdInt)
 Create record in the neighbor table and start hold timer. More...
 
void removeNeighbor (EigrpNeighbor< Ipv4Address > *neigh)
 Removes neighbor from neighbor table and delete it. More...
 
void disableInterface (NetworkInterface *iface, EigrpInterface *eigrpIface, Ipv4Address &ifAddress, Ipv4Address &ifMask)
 Remove interface from EIGRP interface table. More...
 
void enableInterface (EigrpInterface *eigrpIface, Ipv4Address &ifAddress, Ipv4Address &ifMask, int networkId)
 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, int networkId, bool enabled)
 Creates interface and inserts it to the table. More...
 
void processIfaceStateChange (NetworkInterface *iface)
 
void processIfaceConfigChange (EigrpInterface *eigrpIface)
 
void processRTRouteDel (const cObject *details)
 
Ipv4Address getNextHopAddr (const Ipv4Address &nextHopAddr, Ipv4Address &senderAddr)
 Returns next hop address. More...
 
bool getDestIpAddress (int destNeigh, Ipv4Address *resultAddress)
 Returns IP address for sending EIGRP message. More...
 
bool removeRouteFromRT (EigrpRouteSource< Ipv4Address > *successor, IRoute::SourceType *removedRtSrc)
 
Ipv4RoutecreateRTRoute (EigrpRouteSource< Ipv4Address > *successor)
 
bool installRouteToRT (EigrpRoute< Ipv4Address > *route, EigrpRouteSource< Ipv4Address > *source, uint64_t dmin, Ipv4Route *rtEntry)
 Updates existing route in the routing table or creates new one. More...
 
bool isRTSafeForAdd (EigrpRoute< Ipv4Address > *route, unsigned int eigrpAd)
 Returns true, if routing table does not contain route with given address, mask and smaller administrative distance. More...
 
void setRTRouteMetric (Ipv4Route *route, uint64_t metric)
 Changes metric of route in routing table. More...
 
bool removeOldSuccessor (EigrpRouteSource< Ipv4Address > *source, EigrpRoute< Ipv4Address > *route)
 Removes route from routing table and changes old successor's record in topology table. More...
 
void msgToAllIfaces (int destination, HeaderOpcode msgType, EigrpRouteSource< Ipv4Address > *source, bool forcePoisonRev, bool forceUnreachable)
 Records request to send message to all neighbors. More...
 
void msgToIface (HeaderOpcode msgType, EigrpRouteSource< Ipv4Address > *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< Ipv4Address > *source, EigrpRoute< Ipv4Address > *route)
 
bool applyStubToUpdate (EigrpRouteSource< Ipv4Address > *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...
 
Ipv4RoutefindRoute (const Ipv4Address &network, const Ipv4Address &netmask)
 
Ipv4RoutefindRoute (const Ipv4Address &network, const Ipv4Address &netmask, const Ipv4Address &nexthop)
 
virtual int numInitStages () const override
 
virtual void initialize (int stage) override
 
virtual void preDelete (cComponent *root) override
 
virtual void handleMessage (cMessage *msg) override
 
virtual void receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override
 

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 Ipv4Address EIGRP_IPV4_MULT
 Multicast address for EIGRP messages. More...
 
EigrpKValues KVALUES_MAX
 K-values (from K1 to K5) are set to max. More...
 
const Ipv4Address EIGRP_SELF_ADDR
 Next hop address 0.0.0.0 (self address) More...
 
EigrpRouteSource< Ipv4Address > * 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< IIpv4RoutingTablert
 
EigrpDual< Ipv4Address > * eigrpDual
 
EigrpMetricHelpereigrpMetric
 
EigrpInterfaceTableeigrpIft
 Table with enabled EIGRP interfaces. More...
 
EigrpDisabledInterfaceseigrpIftDisabled
 Disabled EIGRP interfaces. More...
 
EigrpIpv4NeighborTableeigrpNt
 Table with EIGRP neighbors. More...
 
EigrpIpv4TopologyTableeigrpTt
 Topology table. More...
 
EigrpNetworkTable< Ipv4Address > * routingForNetworks
 Networks included in EIGRP. More...
 
RequestVector reqQueue
 Requests for sending EIGRP messages from DUAL. More...
 

Additional Inherited Members

- Static Public Attributes inherited from inet::eigrp::IEigrpPdm< Ipv4Address >
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

◆ RequestVector

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

◆ RouteVector

typedef std::vector<Ipv4Route *> inet::eigrp::EigrpIpv4Pdm::RouteVector
protected

Constructor & Destructor Documentation

◆ EigrpIpv4Pdm()

inet::eigrp::EigrpIpv4Pdm::EigrpIpv4Pdm ( )
37  : EIGRP_IPV4_MULT(Ipv4Address(224, 0, 0, 10))
38 {
39  SPLITTER_OUTGW = "splitterOut";
40  RTP_OUTGW = "rtpOut";
41 
43 
44  asNum = -1;
45  maximumPath = 4;
46  variance = 1;
47  adminDistInt = 90;
48  useClassicMetric = true;
49  ribScale = 128;
50 
51  kValues.K1 = kValues.K3 = 1;
52  kValues.K2 = kValues.K4 = kValues.K5 = kValues.K6 = 0;
53 
54  eigrpStubEnabled = false;
55 }

◆ ~EigrpIpv4Pdm()

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

Member Function Documentation

◆ addInterface() [1/2]

void inet::eigrp::EigrpIpv4Pdm::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< Ipv4Address >.

282 { /* useful only for IPv6 */ }

◆ addInterface() [2/2]

void inet::eigrp::EigrpIpv4Pdm::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< Ipv4Address >.

281 { addInterfaceToEigrp(ifaceId, networkId, enabled); }

◆ addInterfaceToEigrp()

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

Creates interface and inserts it to the table.

1506 {
1507 // std::cout << "addInterfaceToEigrp with ifaceid, networkid, enabled set: "<< ifaceId <<", "<< networkId << ", "<< enabled << endl;
1508  NetworkInterface *iface = ift->getInterfaceById(ifaceId);
1509  // create EIGRP interface
1510  EigrpInterface *eigrpIface = new EigrpInterface(iface, networkId, false);
1511  Ipv4Address ifAddress, ifMask;
1512 
1513  if (enabled) {
1514  // Get address and mask of interface
1515  ifMask = iface->getIpv4Netmask();
1516  ifAddress = iface->getIpv4Address().doAnd(ifMask);
1517 
1518  enableInterface(eigrpIface, ifAddress, ifMask, networkId);
1519  startHelloTimer(eigrpIface, simTime() + uniform(0, 1));
1520  }
1521  else {
1522  eigrpIftDisabled->addInterface(eigrpIface);
1523  }
1524 
1525  return eigrpIface;
1526 }

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

◆ addMessageHeader()

void inet::eigrp::EigrpIpv4Pdm::addMessageHeader ( const Ptr< EigrpMessage > &  msg,
int  opcode,
EigrpMsgReq msgReq 
)
protected
851 {
852  msg->setOpcode(opcode);
853  msg->setAsNum(this->asNum);
854  msg->setInit(msgReq->getInit());
855  msg->setEot(msgReq->getEot());
856  msg->setRs(msgReq->getRs());
857  msg->setCr(msgReq->getCr());
858 }

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

◆ addNetPrefix()

bool inet::eigrp::EigrpIpv4Pdm::addNetPrefix ( const Ipv4Address network,
const short int  prefixLen,
const int  ifaceId 
)
inlineoverridevirtual

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< Ipv4Address >.

295 { return false; /* useful only for IPv6 */ }

◆ addNetwork()

EigrpNetwork< Ipv4Address > * inet::eigrp::EigrpIpv4Pdm::addNetwork ( Ipv4Address  address,
Ipv4Address  mask 
)
overridevirtual

Adds new network to EigrpNetworkTable for routing.

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

1547 {
1548  return routingForNetworks->addNetwork(address, mask);
1549 }

◆ addRoutesToMsg()

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

Add routes from request to the message.

904 {
905  // Add routes to the message
906  int reqCnt = msgReq->getRoutesArraySize();
907  EigrpRouteSource<Ipv4Address> *source = nullptr;
908  EigrpRoute<Ipv4Address> *route = nullptr;
909 
910  msg->setInterRoutesArraySize(reqCnt);
911  for (int i = 0; i < reqCnt; i++) {
912  EigrpMpIpv4Internal routeTlv;
913  EigrpMsgRoute req = msgReq->getRoutes(i);
914 
915  if ((source = eigrpTt->findRouteById(req.sourceId)) == nullptr) { // Route was removed (only for sent Update messages to stub routers)
916  route = eigrpTt->findRouteInfoById(req.routeId);
917  ASSERT(route != nullptr);
918  }
919  else {
920  route = source->getRouteInfo();
921  }
922  routeTlv.routerID = req.originator;
923  createRouteTlv(&routeTlv, route, req.unreachable);
924 
925  msg->setInterRoutes(i, routeTlv);
926 
927 #ifdef EIGRP_DEBUG
928  EV_DEBUG << " route: " << routeTlv.destAddress << "/" << routeTlv.destMask.getNetmaskLength();
929  EV_DEBUG << " originator: " << routeTlv.routerID;
930  if (eigrpMetric->isParamMaximal(routeTlv.metric)) EV_DEBUG << " (unreachable) ";
931  EV_DEBUG << ", bw: " << routeTlv.metric.bandwidth;
932  EV_DEBUG << ", dly: " << routeTlv.metric.delay;
933  EV_DEBUG << ", hopcnt: " << (int)routeTlv.metric.hopCount;
934  EV_DEBUG << endl;
935 
936 #endif
937  }
938 }

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

◆ applySplitHorizon()

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

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

◆ applyStubToQuery()

bool inet::eigrp::EigrpIpv4Pdm::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
1237 {
1238  if (this->eigrpStubEnabled)
1239  return false; // Send Query to all neighbors
1240  if (numOfNeigh == eigrpIface->getNumOfStubs())
1241  return true; // Do not send Query to stub router
1242  return false;
1243 }

Referenced by msgToAllIfaces().

◆ applyStubToUpdate()

bool inet::eigrp::EigrpIpv4Pdm::applyStubToUpdate ( EigrpRouteSource< Ipv4Address > *  src)
protected

Apply stub configuration to the route in outgoing Update message.

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

Referenced by sendAllEigrpPaths(), and sendUpdate().

◆ cancelHelloTimers()

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

Stops Hello Timers on all interfaces.

1094 {
1095  EigrpInterface *iface;
1096  EigrpTimer *timer;
1097 
1098  int cnt = this->eigrpIft->getNumInterfaces();
1099  for (int i = 0; i < cnt; i++) {
1100  iface = this->eigrpIft->getInterface(i);
1101 
1102  if ((timer = iface->getHelloTimer()) != nullptr) {
1103  if (timer->isScheduled()) {
1104  timer->getOwner();
1105  cancelEvent(timer);
1106  }
1107 
1108  iface->setHelloTimerPtr(nullptr);
1109  delete timer;
1110  }
1111  }
1112 
1113  cnt = this->eigrpIftDisabled->getNumInterfaces();
1114  for (int i = 0; i < cnt; i++) {
1115  iface = this->eigrpIftDisabled->getInterface(i);
1116 
1117  if ((timer = iface->getHelloTimer()) != nullptr) {
1118  if (timer->isScheduled()) {
1119  timer->getOwner();
1120  cancelEvent(timer);
1121  }
1122 
1123  iface->setHelloTimerPtr(nullptr);
1124  delete timer;
1125  }
1126  }
1127 }

Referenced by preDelete().

◆ cancelHoldTimer()

void inet::eigrp::EigrpIpv4Pdm::cancelHoldTimer ( EigrpNeighbor< Ipv4Address > *  neigh)
protected

Stops Hold timer.

1083 {
1084  EigrpTimer *timer;
1085 
1086  if ((timer = neigh->getHoldTimer()) != nullptr) {
1087  if (timer->isScheduled()) {
1088  cancelEvent(timer);
1089  }
1090  }
1091 }

Referenced by removeNeighbor().

◆ checkNeighborshipRules()

int inet::eigrp::EigrpIpv4Pdm::checkNeighborshipRules ( int  ifaceId,
int  neighAsNum,
Ipv4Address neighAddr,
const EigrpKValues neighKValues 
)
protected

Checks neighborship rules.

Parameters
ifaceIdID of interface where the neighbor is connected.
Returns
returns code from enumeration eigrp::UserMsgCodes.
1038 {
1039  Ipv4Address ifaceAddr, ifaceMask;
1040 
1041  if (this->eigrpIft->findInterfaceById(ifaceId) == nullptr) { // EIGRP must be enabled on interface
1042  return eigrp::M_DISABLED_ON_IF;
1043  }
1044  else if (this->asNum != neighAsNum) { // AS numbers must be equal
1045  return eigrp::M_NEIGH_BAD_AS;
1046  }
1047  else if (!(this->kValues == neighKValues)) { // K-values must be same
1049  }
1050  else {
1051  // get IP address of interface and mask
1052  NetworkInterface *iface = ift->getInterfaceById(ifaceId);
1053  ifaceAddr.set(iface->getIpv4Address().getInt());
1054  ifaceMask.set(iface->getIpv4Netmask().getInt());
1055 
1056  // check, if the neighbor is on same subnet
1057  if (!ifaceAddr.maskedAddrAreEqual(ifaceAddr, neighAddr, ifaceMask)) {
1059  }
1060  }
1061 
1062  return eigrp::M_OK;
1063 }

Referenced by processNewNeighbor().

◆ createAckPacket()

Packet * inet::eigrp::EigrpIpv4Pdm::createAckPacket ( Ipv4Address destAddress,
EigrpMsgReq msgReq 
)
protected
774 {
775  const auto& msg = makeShared<EigrpIpv4Ack>();
776  addMessageHeader(msg, EIGRP_HELLO_MSG, msgReq);
777  msg->setAckNum(msgReq->getAckNumber());
778 // addCtrInfo(msg, msgReq->getDestInterface(), destAddress);
779 
780  msg->setChunkLength(B(sizeOfMsg));
781 
782  Packet *packet = new Packet();
783  packet->insertAtBack(msg);
784  return packet;
785 }

Referenced by processMsgFromRtp().

◆ createHelloPacket()

Packet * inet::eigrp::EigrpIpv4Pdm::createHelloPacket ( int  holdInt,
EigrpKValues  kValues,
Ipv4Address destAddress,
EigrpMsgReq msgReq 
)
protected
749 {
750  const auto& msg = makeShared<EigrpIpv4Hello>();
751  EigrpTlvParameter paramTlv;
752 
753  addMessageHeader(msg, EIGRP_HELLO_MSG, msgReq);
754 // addCtrInfo(msg, msgReq->getDestInterface(), destAddress);
755  // Add parameter type TLV
756  paramTlv.holdTimer = holdInt;
757  paramTlv.kValues = kValues;
758  msg->setParameterTlv(paramTlv);
759  // Add stub TLV
760  if (this->eigrpStubEnabled) {
761  EigrpTlvStub stubTlv;
762  stubTlv.stub = this->eigrpStub;
763  msg->setStubTlv(stubTlv);
764  }
765 
766  msg->setChunkLength(B(sizeOfMsg + 12));
767 
768  Packet *packet = new Packet();
769  packet->insertAtBack(msg);
770  return packet;
771 }

Referenced by processMsgFromRtp().

◆ createMsgReq()

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

Creates request for sending of EIGRP message for RTP.

941 {
942  EigrpMsgReq *msgReq = new EigrpMsgReq(eigrp::UserMsgs[msgType]);
943 
944  msgReq->setOpcode(msgType);
945  msgReq->setDestNeighbor(destNeighbor);
946  msgReq->setDestInterface(destIface);
947 
948  return msgReq;
949 }

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

◆ createNeighbor()

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

Create record in the neighbor table and start hold timer.

1066 {
1067  // Create record in the neighbor table
1068  EigrpNeighbor<Ipv4Address> *neigh = new EigrpNeighbor<Ipv4Address>(eigrpIface->getInterfaceId(), eigrpIface->getInterfaceName(), address);
1069  EigrpTimer *holdt = createTimer(EIGRP_HOLD_TIMER, neigh);
1070  neigh->setHoldTimer(holdt);
1071  neigh->setHoldInt(holdInt);
1072  eigrpNt->addNeighbor(neigh);
1073  // Start Hold timer
1074  scheduleAt(simTime() + holdInt, holdt);
1075 
1076  eigrpIface->incNumOfNeighbors();
1077 
1078  return neigh;
1079 }

Referenced by processNewNeighbor().

◆ createQueryPacket()

Packet * inet::eigrp::EigrpIpv4Pdm::createQueryPacket ( Ipv4Address destAddress,
EigrpMsgReq msgReq 
)
protected
808 {
809  const auto& msg = makeShared<EigrpIpv4Query>();
810  int routeCnt = msgReq->getRoutesArraySize();
811 
812  addMessageHeader(msg, EIGRP_QUERY_MSG, msgReq);
813  msg->setAckNum(msgReq->getAckNumber());
814  msg->setSeqNum(msgReq->getSeqNumber());
815 // addCtrInfo(msg, msgReq->getDestInterface(), destAddress);
816 
817  // Add route TLV
818  if (routeCnt > 0) addRoutesToMsg(msg, msgReq);
819 
820  msg->setChunkLength(B(sizeOfMsg + routeCnt * 44));
821 
822  Packet *packet = new Packet();
823  packet->insertAtBack(msg);
824  return packet;
825 }

Referenced by processMsgFromRtp().

◆ createReplyPacket()

Packet * inet::eigrp::EigrpIpv4Pdm::createReplyPacket ( Ipv4Address destAddress,
EigrpMsgReq msgReq 
)
protected
828 {
829  const auto& msg = makeShared<EigrpIpv4Reply>();
830  int routeCnt = msgReq->getRoutesArraySize();
831 
832  addMessageHeader(msg, EIGRP_REPLY_MSG, msgReq);
833  msg->setAckNum(msgReq->getAckNumber());
834  msg->setSeqNum(msgReq->getSeqNumber());
835 // addCtrInfo(msg, msgReq->getDestInterface(), destAddress);
836 
837  // Add route TLV
838  if (routeCnt > 0) {
839  addRoutesToMsg(msg, msgReq);
840  unlockRoutes(msgReq); // Locked RouteInfos are unlocked and can be removed
841  }
842 
843  msg->setChunkLength(B(sizeOfMsg + routeCnt * 44));
844 
845  Packet *packet = new Packet();
846  packet->insertAtBack(msg);
847  return packet;
848 }

Referenced by processMsgFromRtp().

◆ createRouteTlv()

void inet::eigrp::EigrpIpv4Pdm::createRouteTlv ( EigrpMpIpv4Internal routeTlv,
EigrpRoute< Ipv4Address > *  route,
bool  unreachable = false 
)
protected
861 {
862  EigrpWideMetricPar rtMetric = route->getRdPar();
863  routeTlv->destAddress = route->getRouteAddress();
864  routeTlv->destMask = route->getRouteMask();
865  routeTlv->nextHop = Ipv4Address::UNSPECIFIED_ADDRESS;
866  setRouteTlvMetric(&routeTlv->metric, &rtMetric);
867  if (unreachable) {
868  routeTlv->metric.delay = EigrpMetricHelper::DELAY_INF;
869  routeTlv->metric.bandwidth = EigrpMetricHelper::BANDWIDTH_INF;
870  }
871 }

Referenced by addRoutesToMsg().

◆ createRTRoute()

Ipv4Route * inet::eigrp::EigrpIpv4Pdm::createRTRoute ( EigrpRouteSource< Ipv4Address > *  successor)
protected
1184 {
1185 // int ifaceId = successor->getIfaceId();
1186  EigrpRoute<Ipv4Address> *route = successor->getRouteInfo();
1187 // ANSAIPv4Route *rtEntry = new ANSAIPv4Route();
1188  Ipv4Route *rtEntry = new Ipv4Route();
1189  rtEntry->setDestination(route->getRouteAddress());
1190  rtEntry->setNetmask(route->getRouteMask());
1191  rtEntry->setSourceType(IRoute::EIGRP);
1192  rtEntry->setInterface(ift->getInterfaceById(successor->getIfaceId()));
1193  rtEntry->setGateway(successor->getNextHop());
1194  setRTRouteMetric(rtEntry, successor->getMetric());
1195 
1196  if (successor->isInternal()) {
1197  // Set any source except IFACENETMASK and MANUAL
1198 // rtEntry->setSource(IPv4Route::ZEBRA);
1199  // Set right protocol source
1200 // rtEntry->setRoutingProtocolSource(ANSAIPv4Route::pEIGRP);
1201 // rtEntry->setAdminDist(ANSAIPv4Route::dEIGRPInternal);
1202  rtEntry->setAdminDist(Ipv4Route::dEIGRPInternal);
1203  }
1204  else {
1205  rtEntry->setAdminDist(Ipv4Route::dEIGRPExternal);
1206  }
1207 
1208  return rtEntry;
1209 }

Referenced by installRouteToRT().

◆ createTimer()

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

Creates timer of specified type.

740 {
741  EigrpTimer *timer = new EigrpTimer();
742  timer->setTimerKind(timerKind);
743  timer->setContextPointer(context);
744 
745  return timer;
746 }

Referenced by createNeighbor(), and startHelloTimer().

◆ createUpdatePacket()

Packet * inet::eigrp::EigrpIpv4Pdm::createUpdatePacket ( const Ipv4Address destAddress,
EigrpMsgReq msgReq 
)
protected
788 {
789  const auto& msg = makeShared<EigrpIpv4Update>();
790  int routeCnt = msgReq->getRoutesArraySize();
791 
792  addMessageHeader(msg, EIGRP_UPDATE_MSG, msgReq);
793  msg->setAckNum(msgReq->getAckNumber());
794  msg->setSeqNum(msgReq->getSeqNumber());
795 // addCtrInfo(msg, msgReq->getDestInterface(), destAddress);
796 
797  // Add route TLV
798  if (routeCnt > 0) addRoutesToMsg(msg, msgReq);
799 
800  msg->setChunkLength(B(sizeOfMsg + routeCnt * 44));
801 
802  Packet *packet = new Packet();
803  packet->insertAtBack(msg);
804  return packet;
805 }

Referenced by processMsgFromRtp().

◆ disableInterface()

void inet::eigrp::EigrpIpv4Pdm::disableInterface ( NetworkInterface iface,
EigrpInterface eigrpIface,
Ipv4Address ifAddress,
Ipv4Address ifMask 
)
protected

Remove interface from EIGRP interface table.

Removes all neighbors on the interface.

1415 {
1416  EigrpTimer *hellot = nullptr;
1417  EigrpNeighbor<Ipv4Address> *neigh = nullptr;
1418  EigrpRouteSource<Ipv4Address> *source = nullptr;
1419  int neighCount;
1420  int ifaceId = eigrpIface->getInterfaceId();
1421 
1422  EV_DEBUG << "EIGRP disabled on interface " << eigrpIface->getName() << "(" << ifaceId << ")" << endl;
1423 
1424  if (!eigrpIface->isPassive()) {
1425 // iface->ipv4Data()->leaveMulticastGroup(EIGRP_IPV4_MULT);
1426  Ipv4InterfaceData *idata = iface->getProtocolDataForUpdate<Ipv4InterfaceData>();
1427  idata->leaveMulticastGroup(EIGRP_IPV4_MULT);
1428  }
1429 
1430  // stop hello timer
1431  if ((hellot = eigrpIface->getHelloTimer()) != nullptr)
1432  cancelEvent(hellot);
1433  // First process route on the interface
1434  Ipv4Address ifNetwork = ifAddress.doAnd(ifMask);
1435 
1436  source = eigrpTt->findRoute(ifNetwork, ifMask, EigrpNeighbor<Ipv4Address>::UNSPEC_ID);
1437  ASSERT(source != nullptr);
1438  // Notify DUAL about event
1440 
1441  // Remove interface from EIGRP interface table (must be there)
1442  if (eigrpIface->isEnabled()) {
1443  eigrpIft->removeInterface(eigrpIface);
1444  eigrpIftDisabled->addInterface(eigrpIface);
1445  eigrpIface->setEnabling(false);
1446  }
1447 
1448  // Delete all neighbors on the interface
1449  neighCount = eigrpNt->getNumNeighbors();
1450  for (int i = 0; i < neighCount; i++) {
1451  neigh = eigrpNt->getNeighbor(i);
1452  if (neigh->getIfaceId() == ifaceId) {
1453  removeNeighbor(neigh);
1454  }
1455  }
1456 
1457  flushMsgRequests();
1458  eigrpTt->purgeTable();
1459 }

Referenced by processIfaceStateChange().

◆ enableInterface()

void inet::eigrp::EigrpIpv4Pdm::enableInterface ( EigrpInterface eigrpIface,
Ipv4Address ifAddress,
Ipv4Address ifMask,
int  networkId 
)
protected

Add interface to the EIGRP interface table and notifies DUAL.

1462 {
1463  int ifaceId = eigrpIface->getInterfaceId();
1464  EigrpRouteSource<Ipv4Address> *src;
1465  EigrpWideMetricPar metricPar;
1466  bool isSourceNew;
1467 
1468  EV_DEBUG << "EIGRP enabled on interface " << eigrpIface->getName() << "(" << ifaceId << ")" << endl;
1469 
1470  // Move interface to EIGRP interface table
1471  if (!eigrpIface->isEnabled()) {
1472  eigrpIftDisabled->removeInterface(eigrpIface);
1473  eigrpIft->addInterface(eigrpIface);
1474  eigrpIface->setEnabling(true);
1475  }
1476 
1477  // Register multicast address on interface
1478 // Ipv4InterfaceData *ifaceIpv4 = ift->getInterfaceById(ifaceId)->ipv4Data();
1479 // ifaceIpv4->joinMulticastGroup(EIGRP_IPV4_MULT);
1480 
1481  NetworkInterface *ie = ift->getInterfaceById(ifaceId);
1482  Ipv4InterfaceData *idata = ie->getProtocolDataForUpdate<Ipv4InterfaceData>();
1483  idata->joinMulticastGroup(EIGRP_IPV4_MULT);
1484 
1485  eigrpIface->setNetworkId(networkId);
1486 
1487  // Create route
1488  src = eigrpTt->findOrCreateRoute(ifAddress, ifMask, eigrpTt->getRouterId(), eigrpIface, EigrpNeighbor<Ipv4Address>::UNSPEC_ID, &isSourceNew);
1489  ASSERT(isSourceNew == true);
1490  // Compute metric
1491 
1492  metricPar = eigrpMetric->getParam(eigrpIface);
1493 
1494  src->setMetricParams(metricPar);
1495 
1496  uint64_t metric = eigrpMetric->computeClassicMetric(metricPar, this->kValues);
1497  src->setMetric(metric);
1498  // Notify DUAL about event
1500 
1501  flushMsgRequests();
1502  eigrpTt->purgeTable();
1503 }

Referenced by addInterfaceToEigrp(), and processIfaceStateChange().

◆ findRoute() [1/2]

Ipv4Route * inet::eigrp::EigrpIpv4Pdm::findRoute ( const Ipv4Address network,
const Ipv4Address netmask 
)
protected
1912  {
1913  Ipv4Route *route = nullptr;
1914  for (int i = 0; i < rt->getNumRoutes(); i++) {
1915  auto it = rt->getRoute(i);
1916  if (it->getDestination() == network && it->getNetmask() == netmask) { // match
1917  route = it;
1918  break;
1919  }
1920  }
1921 
1922  return route;
1923 }

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

◆ findRoute() [2/2]

Ipv4Route * inet::eigrp::EigrpIpv4Pdm::findRoute ( const Ipv4Address network,
const Ipv4Address netmask,
const Ipv4Address nexthop 
)
protected
1926  {
1927  Ipv4Route *route = nullptr;
1928  for (int i = 0; i < rt->getNumRoutes(); i++) {
1929  auto it = rt->getRoute(i);
1930  if (it->getDestination() == network && it->getNetmask() == netmask && it->getGateway() == nexthop) {
1931  route = it;
1932  break;
1933  }
1934  }
1935  return route;
1936 }

◆ findRouteDMin()

uint64_t inet::eigrp::EigrpIpv4Pdm::findRouteDMin ( EigrpRoute< Ipv4Address > *  route)
inlineoverridevirtual

Returns minimal distance to destination network.

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

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

◆ flushMsgRequests()

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

Sends all message requests to RTP.

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

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

◆ getASNum()

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

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

285 { return this->asNum; }

◆ getBestSuccessor()

EigrpRouteSource<Ipv4Address>* inet::eigrp::EigrpIpv4Pdm::getBestSuccessor ( EigrpRoute< Ipv4Address > *  route)
inlineoverridevirtual

Returns best successor for specified network.

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

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

◆ getDestIpAddress()

bool inet::eigrp::EigrpIpv4Pdm::getDestIpAddress ( int  destNeigh,
Ipv4Address resultAddress 
)
protected

Returns IP address for sending EIGRP message.

417 {
418  EigrpNeighbor<Ipv4Address> *neigh = nullptr;
419 
420  if (destNeigh == EigrpNeighbor<Ipv4Address>::UNSPEC_ID)
421  resultAddress->set(EIGRP_IPV4_MULT.getInt());
422  else {
423  if ((neigh = eigrpNt->findNeighborById(destNeigh)) == nullptr)
424  return false;
425  resultAddress->set(neigh->getIPAddress().getInt());
426  }
427 
428  return true;
429 }

Referenced by processMsgFromRtp().

◆ getInterfaceById()

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

Returns EIGRP interface (enabled or disabled) or nullptr.

1405 {
1406  EigrpInterface *iface;
1407 
1408  if ((iface = eigrpIft->findInterfaceById(ifaceId)) != nullptr)
1409  return iface;
1410  else
1411  return eigrpIftDisabled->findInterface(ifaceId);
1412 }

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

◆ getNextHopAddr()

Ipv4Address inet::eigrp::EigrpIpv4Pdm::getNextHopAddr ( const Ipv4Address nextHopAddr,
Ipv4Address 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.

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

Referenced by processInterRoute(), and processUpdatePacket().

◆ handleMessage()

void inet::eigrp::EigrpIpv4Pdm::handleMessage ( cMessage *  msg)
overrideprotectedvirtual
156  {
157  if (msg->isSelfMessage()) { // Timer Message
158  this->processTimer(msg);
159  }
160  else { // EIGRP Message
161 
162  if (strcmp(msg->getArrivalGate()->getBaseName(), "splitterIn") == 0) {
164  delete msg;
165  msg = nullptr;
166  }
167  else if (strcmp(msg->getArrivalGate()->getBaseName(), "rtpIn") == 0) {
168  processMsgFromRtp(msg);
169  delete msg;
170  msg = nullptr;
171  }
172  }
173 }

◆ hasFeasibleSuccessor()

bool inet::eigrp::EigrpIpv4Pdm::hasFeasibleSuccessor ( EigrpRoute< Ipv4Address > *  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< Ipv4Address >.

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

◆ hasNeighborForUpdate()

bool inet::eigrp::EigrpIpv4Pdm::hasNeighborForUpdate ( EigrpRouteSource< Ipv4Address > *  source)
overridevirtual

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

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

1881 {
1882  int ifaceCnt = this->eigrpIft->getNumInterfaces();
1883  EigrpInterface *eigrpIface;
1884 
1885  for (int i = 0; i < ifaceCnt; i++) {
1886  eigrpIface = eigrpIft->getInterface(i);
1887 
1888  // Do not apply Split Horizon rule
1889  if (eigrpIface != nullptr && eigrpIface->getNumOfNeighbors() > 0) {
1890  return true;
1891  }
1892  }
1893 
1894  return false;
1895 }

◆ initialize()

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

◆ installRouteToRT()

bool inet::eigrp::EigrpIpv4Pdm::installRouteToRT ( EigrpRoute< Ipv4Address > *  route,
EigrpRouteSource< Ipv4Address > *  source,
uint64_t  dmin,
Ipv4Route rtEntry 
)
protected

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

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

Referenced by updateRoute().

◆ isRTSafeForAdd()

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

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

1700 {
1701  Ipv4Route *routeInTable = findRoute(route->getRouteAddress(), route->getRouteMask());
1702  Ipv4Route *ansaRoute = nullptr;
1703 
1704  if (routeInTable == nullptr)
1705  return true; // Route not found
1706 
1707  ansaRoute = routeInTable;
1708  if (ansaRoute != nullptr) { // AnsaIPv4Route use own AD attribute
1709  if (ansaRoute->getAdminDist() < eigrpAd)
1710  return false;
1711  return true;
1712  }
1713  if (ansaRoute == nullptr && routeInTable->getAdminDist() == Ipv4Route::dUnknown)
1714  return false; // Connected route has AD = 255 (dUnknown) in IPv4Route
1715  if (routeInTable != nullptr && routeInTable->getAdminDist() < eigrpAd)
1716  return false; // Other IPv4Route with right AD
1717  return true;
1718 }

Referenced by updateRoute().

◆ msgToAllIfaces()

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

Records request to send message to all neighbors.

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

Referenced by sendQuery(), and sendUpdate().

◆ msgToIface()

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

Creates request for sending message on specified interface.

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

Referenced by msgToAllIfaces().

◆ numInitStages()

virtual int inet::eigrp::EigrpIpv4Pdm::numInitStages ( ) const
inlineoverrideprotectedvirtual
315 { return NUM_INIT_STAGES; }

◆ preDelete()

void inet::eigrp::EigrpIpv4Pdm::preDelete ( cComponent *  root)
overrideprotectedvirtual
123 {
125 }

◆ printRecvMsg()

void inet::eigrp::EigrpIpv4Pdm::printRecvMsg ( const EigrpMessage msg,
Ipv4Address addr,
int  ifaceId 
)
protected
460 {
461  EV_DEBUG << "EIGRP: received " << eigrp::UserMsgs[msg->getOpcode()];
462  if (msg->getOpcode() == EIGRP_HELLO_MSG && msg->getAckNum() > 0)
463  EV_DEBUG << " (ack) ";
464  EV_DEBUG << " message from " << addr << " on IF " << ifaceId;
465 
466  EV_DEBUG << ", flags: ";
467  if (msg->getInit()) EV_DEBUG << "init";
468  else if (msg->getEot()) EV_DEBUG << "eot";
469  else if (msg->getCr()) EV_DEBUG << "cr";
470  else if (msg->getRs()) EV_DEBUG << "rs";
471 
472  EV_DEBUG << ", seq num:" << msg->getSeqNum();
473  EV_DEBUG << ", ack num:" << msg->getAckNum();
474  EV_DEBUG << endl;
475 }

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

◆ printSentMsg()

void inet::eigrp::EigrpIpv4Pdm::printSentMsg ( int  routeCnt,
Ipv4Address destAddress,
EigrpMsgReq msgReq 
)
protected
432 {
433  int type = msgReq->getOpcode();
434 
435  EV_DEBUG << "EIGRP: send " << eigrp::UserMsgs[type];
436 
437  if (type == EIGRP_HELLO_MSG) {
438  if (msgReq->getAckNumber() > 0)
439  EV_DEBUG << " (ack) ";
440  else if (msgReq->getGoodbyeMsg() == true)
441  EV_DEBUG << " (goodbye) ";
442  }
443 
444  EV_DEBUG << " message to " << destAddress << " on IF " << msgReq->getDestInterface();
445 
446  // Print flags
447  EV_DEBUG << ", flags: ";
448  if (msgReq->getInit()) EV_DEBUG << "init";
449  else if (msgReq->getEot()) EV_DEBUG << "eot";
450  else if (msgReq->getCr()) EV_DEBUG << "cr";
451  else if (msgReq->getRs()) EV_DEBUG << "rs";
452 
453  if (type != EIGRP_HELLO_MSG) EV_DEBUG << ", route count: " << routeCnt;
454  EV_DEBUG << ", seq num:" << msgReq->getSeqNumber();
455  EV_DEBUG << ", ack num:" << msgReq->getAckNumber();
456  EV_DEBUG << endl;
457 }

Referenced by processMsgFromRtp().

◆ processAckPacket()

void inet::eigrp::EigrpIpv4Pdm::processAckPacket ( Packet pk,
Ipv4Address srcAddress,
int  ifaceId,
EigrpNeighbor< Ipv4Address > *  neigh 
)
protected
530 {
531  const EigrpIpv4Ack *ack = staticPtrCast<const EigrpIpv4Ack>(pk->peekAtFront<EigrpIpv4Ack>()).get();
532 
533  printRecvMsg(ack, srcAddress, ifaceId);
534  if (neigh->isStateUp() == false) {
535  // If neighbor is "pending", then change its state to "up"
536  neigh->setStateUp(true);
537  // Send all EIGRP paths from routing table to sender
538  sendAllEigrpPaths(eigrpIft->findInterfaceById(ifaceId), neigh);
539  }
540 
541  if (neigh->getRoutesForDeletion()) { // Remove unreachable routes waiting for Ack from neighbor
542  eigrpTt->delayedRemove(neigh->getNeighborId());
543  neigh->setRoutesForDeletion(false);
544  }
545 }

Referenced by processMsgFromNetwork().

◆ processHelloPacket()

void inet::eigrp::EigrpIpv4Pdm::processHelloPacket ( Packet pk,
Ipv4Address srcAddress,
int  ifaceId,
EigrpNeighbor< Ipv4Address > *  neigh 
)
protected
548 {
549 
550 // EigrpIpv4Hello *hello = const_cast<EigrpIpv4Hello *>(static_cast<const EigrpIpv4Hello *>(pk->peekAtFront<EigrpIpv4Hello>().get()));
551 
552  const EigrpIpv4Hello *hello = staticPtrCast<const EigrpIpv4Hello>(pk->peekAtFront<EigrpIpv4Hello>()).get();
553 
554  EigrpTlvParameter tlvParam = hello->getParameterTlv();
555 
556  printRecvMsg(hello, srcAddress, ifaceId);
557 
558  if (tlvParam.kValues == KVALUES_MAX) { // Received Goodbye message, remove neighbor
559  if (neigh != nullptr) {
560  EV_DEBUG << " interface goodbye received" << endl;
561  EV_DEBUG << "EIGRP neighbor " << srcAddress << " is down, interface goodbye received" << endl;
562  removeNeighbor(neigh);
564  eigrpTt->purgeTable();
565  }
566  }
567  else if (neigh == nullptr) { // New neighbor
568  processNewNeighbor(ifaceId, srcAddress, hello);
569  }
570  else { // neighbor exists, its state is "up" or "pending"
571  // Check K-values
572  if (!(tlvParam.kValues == this->kValues)) { // Not satisfied
573  EV_DEBUG << "EIGRP neighbor " << srcAddress << " is down, " << eigrp::UserMsgs[eigrp::M_NEIGH_BAD_KVALUES] << endl;
574  removeNeighbor(neigh);
576  eigrpTt->purgeTable();
577 
578  // send Goodbye message and reset Hello timer
579  EigrpInterface *iface = this->eigrpIft->findInterfaceById(ifaceId);
580  resetTimer(iface->getHelloTimer(), iface->getHelloInt() - 0.5);
581  EigrpMsgReq *msgReq = createMsgReq(EIGRP_HELLO_MSG, EigrpNeighbor<Ipv4Address>::UNSPEC_ID, ifaceId);
582  msgReq->setGoodbyeMsg(true);
583  send(msgReq, RTP_OUTGW);
584  }
585  else if (tlvParam.holdTimer != neigh->getHoldInt()) // Save Hold interval
586  neigh->setHoldInt(tlvParam.holdTimer);
587  }
588 }

Referenced by processMsgFromNetwork().

◆ processIfaceConfigChange()

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

Referenced by receiveSignal().

◆ processIfaceStateChange()

void inet::eigrp::EigrpIpv4Pdm::processIfaceStateChange ( NetworkInterface iface)
protected
176 {
177  EigrpInterface *eigrpIface;
178  int ifaceId = iface->getInterfaceId();
179  // Get address and mask of interface
180  Ipv4Address ifMask = iface->getIpv4Netmask();
181  Ipv4Address ifAddress = iface->getIpv4Address().doAnd(ifMask);
182  int networkId;
183 
184  if (iface->isUp()) { // an interface goes up
185  if (routingForNetworks->isInterfaceIncluded(ifAddress, ifMask, &networkId)) { // Interface is included in EIGRP
186  if ((eigrpIface = getInterfaceById(ifaceId)) == nullptr) { // Create EIGRP interface
187  eigrpIface = new EigrpInterface(iface, networkId, false);
188  }
189  if (!eigrpIface->isEnabled()) {
190  enableInterface(eigrpIface, ifAddress, ifMask, networkId);
191  startHelloTimer(eigrpIface, simTime() + eigrpIface->getHelloInt() - 0.5);
192  }
193  }
194  }
195  else if (!iface->isUp() || !iface->hasCarrier()) { // an interface goes down
196  eigrpIface = this->eigrpIft->findInterfaceById(ifaceId);
197 
198  if (eigrpIface != nullptr && eigrpIface->isEnabled()) {
199  disableInterface(iface, eigrpIface, ifAddress, ifMask);
200  }
201  }
202 }

Referenced by receiveSignal().

◆ processInterRoute()

EigrpRouteSource< Ipv4Address > * inet::eigrp::EigrpIpv4Pdm::processInterRoute ( const EigrpMpIpv4Internal tlv,
Ipv4Address srcAddr,
int  sourceNeighId,
EigrpInterface eigrpIface,
bool *  notifyDual,
bool *  isSourceNew 
)
protected

Process route TLV.

Parameters
neighNeighbor which is next hop for a route in TLV.
701 {
702  Ipv4Address nextHop = getNextHopAddr(tlv.nextHop, srcAddr);
703  EigrpNeighbor<Ipv4Address> *nextHopNeigh = eigrpNt->findNeighbor(nextHop);
704  EigrpRouteSource<Ipv4Address> *src;
705  EigrpWideMetricPar newParam, oldParam, oldNeighParam;
706  EigrpWideMetricPar ifParam = eigrpMetric->getParam(eigrpIface);
707 
708  // Find route or create one (route source is identified by ID of the next hop - not by ID of sender)
709  src = eigrpTt->findOrCreateRoute(tlv.destAddress, tlv.destMask, tlv.routerID, eigrpIface, nextHopNeigh->getNeighborId(), isSourceNew);
710 
711  // Compare old and new neighbor's parameters
712  oldNeighParam = src->getRdParams();
713  if (*isSourceNew || !eigrpMetric->compareParameters(tlv.metric, oldNeighParam, this->kValues)) {
714  // Compute reported distance (must be there)
715  uint64_t metric = eigrpMetric->computeClassicMetric(tlv.metric, this->kValues);
716  src->setRdParams(tlv.metric);
717  src->setRd(metric);
718 
719  // Get new metric parameters
720  newParam = eigrpMetric->adjustParam(ifParam, tlv.metric);
721  // Get old metric parameters for comparison
722  oldParam = src->getMetricParams();
723 
724  if (!eigrpMetric->compareParameters(newParam, oldParam, this->kValues)) {
725  // Set source of route
726  if (*isSourceNew)
727  src->setNextHop(nextHop);
728  src->setMetricParams(newParam);
729  // Compute metric
730  metric = eigrpMetric->computeClassicMetric(newParam, this->kValues);
731  src->setMetric(metric);
732  *notifyDual = true;
733  }
734  }
735 
736  return src;
737 }

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

◆ processMsgFromNetwork()

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

Process message from network layer.

286 {
287  Packet *packet = check_and_cast<Packet *>(msg);
288 
289  auto protocol = packet->getTag<PacketProtocolTag>()->getProtocol();
290  if (protocol != &Protocol::eigrp) {
291  delete msg;
292  return;
293  }
294 
295  Ipv4Address srcAddr = packet->getTag<L3AddressInd>()->getSrcAddress().toIpv4();
296  int ifaceId = packet->getTag<InterfaceInd>()->getInterfaceId();
297 
298  cMessage *msgDup = nullptr;
299 
300  const auto& pk = packet->peekAtFront<EigrpMessage>();
301  int8_t opcode = pk->getOpcode();
302 
303 #ifdef EIGRP_DEBUG
304  EigrpInterface *eigrpIface = eigrpIft->findInterfaceById(ifaceId);
305  ASSERT(eigrpIface != nullptr);
306  ASSERT(!eigrpIface->isPassive());
307 #endif
308 
309  // Find neighbor if exists
310  EigrpNeighbor<Ipv4Address> *neigh = nullptr;
311  if ((neigh = eigrpNt->findNeighbor(srcAddr)) != nullptr) { // Reset hold timer
312  resetTimer(neigh->getHoldTimer(), neigh->getHoldInt());
313  }
314 
315  // Send message to RTP (message must be duplicated)
316  msgDup = msg->dup();
317  send(msgDup, RTP_OUTGW);
318 
319  switch (opcode) {
320  case EIGRP_HELLO_MSG:
321  if (pk->getAckNum() > 0)
322  processAckPacket(packet, srcAddr, ifaceId, neigh);
323  else
324  processHelloPacket(packet, srcAddr, ifaceId, neigh);
325  break;
326  case EIGRP_UPDATE_MSG:
327  processUpdatePacket(packet, srcAddr, ifaceId, neigh);
328  break;
329  case EIGRP_QUERY_MSG:
330  processQueryPacket(packet, srcAddr, ifaceId, neigh);
331  break;
332  case EIGRP_REPLY_MSG:
333  processReplyPacket(packet, srcAddr, ifaceId, neigh);
334  break;
335  default:
336  if (neigh != nullptr)
337  EV_DEBUG << "EIGRP: Received message of unknown type, skipped" << endl;
338  else
339  EV_DEBUG << "EIGRP: Received message from " << srcAddr << " that is not neighbor, skipped" << endl;
340  break;
341  }
342 }

Referenced by handleMessage().

◆ processMsgFromRtp()

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

Process message request from RTP.

345 {
346  EigrpMsgReq *msgReq = check_and_cast<EigrpMsgReq *>(msg);
347  int routeCnt = msgReq->getRoutesArraySize();
348  Ipv4Address destAddress;
349  int destIface = msgReq->getDestInterface();
350  EigrpInterface *eigrpIface = eigrpIft->findInterfaceById(destIface);
351 
352  Packet *pk;
353 
354 #ifdef EIGRP_DEBUG
355  ASSERT(eigrpIface != nullptr && !eigrpIface->isPassive());
356 #endif
357 
358  if (!getDestIpAddress(msgReq->getDestNeighbor(), &destAddress) || eigrpIface == nullptr) { // Discard message request
359  return;
360  }
361 
362  // Print message information
363  printSentMsg(routeCnt, destAddress, msgReq);
364 
365  // Create EIGRP message
366  switch (msgReq->getOpcode()) {
367  case EIGRP_HELLO_MSG:
368 
369  if (msgReq->getGoodbyeMsg() == true) { // Goodbye message
370  pk = createHelloPacket(eigrpIface->getHoldInt(), this->KVALUES_MAX, destAddress, msgReq);
371  pk->setName("EIGRP_HELLO_MSG");
372  }
373  else if (msgReq->getAckNumber() > 0) { // Ack message
374  pk = createAckPacket(destAddress, msgReq);
375  pk->setName("EIGRP_ACK_MSG");
376  }
377  else { // Hello message
378  pk = createHelloPacket(eigrpIface->getHoldInt(), this->kValues, destAddress, msgReq);
379  pk->setName("EIGRP_HELLO_MSG");
380  }
381  break;
382 
383  case EIGRP_UPDATE_MSG:
384 
385  pk = createUpdatePacket(destAddress, msgReq);
386  pk->setName("EIGRP_UPDATE_MSG");
387  break;
388 
389  case EIGRP_QUERY_MSG:
390 
391  pk = createQueryPacket(destAddress, msgReq);
392  pk->setName("EIGRP_QUERY_MSG");
393  break;
394 
395  case EIGRP_REPLY_MSG:
396 
397  pk = createReplyPacket(destAddress, msgReq);
398  pk->setName("EIGRP_REPLY_MSG");
399  break;
400 
401  default:
402  ASSERT(false);
403  return;
404  break;
405  }
406 
407  // Send message to network
408  pk->addTagIfAbsent<PacketProtocolTag>()->setProtocol(&Protocol::eigrp);
409  pk->addTagIfAbsent<InterfaceReq>()->setInterfaceId(destIface);
410  pk->addTagIfAbsent<L3AddressReq>()->setDestAddress(destAddress);
411  pk->addTagIfAbsent<DispatchProtocolReq>()->setProtocol(&Protocol::ipv4);
412  pk->addTagIfAbsent<HopLimitReq>()->setHopLimit(1);
413  send(pk, SPLITTER_OUTGW);
414 }

Referenced by handleMessage().

◆ processNewNeighbor()

void inet::eigrp::EigrpIpv4Pdm::processNewNeighbor ( int  ifaceId,
Ipv4Address srcAddress,
const EigrpIpv4Hello helloMessage 
)
protected

Creates relationship with neighbor.

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

Referenced by processHelloPacket().

◆ processQueryPacket()

void inet::eigrp::EigrpIpv4Pdm::processQueryPacket ( Packet pk,
Ipv4Address srcAddress,
int  ifaceId,
EigrpNeighbor< Ipv4Address > *  neigh 
)
protected
647 {
648  const EigrpIpv4Query *query = staticPtrCast<const EigrpIpv4Query>(pk->peekAtFront<EigrpIpv4Query>()).get();
649 
650  EigrpInterface *eigrpIface = eigrpIft->findInterfaceById(ifaceId);
651  EigrpRouteSource<Ipv4Address> *src = nullptr;
652  bool notifyDual, isSourceNew;
653 
654  printRecvMsg(query, srcAddress, ifaceId);
655 
656  int cnt = query->getInterRoutesArraySize();
657 #ifdef EIGRP_DEBUG
658  EV_DEBUG << " Route count:" << cnt << endl;
659 #endif
660 
661  for (int i = 0; i < cnt; i++) {
662  src = processInterRoute(query->getInterRoutes(i), srcAddress, neigh->getNeighborId(), eigrpIface, &notifyDual, &isSourceNew);
663  src->getRouteInfo()->incrementRefCnt(); // RouteInto cannot be removed while processing Query and generating Reply
664 
665  // Always notify DUAL
666  eigrpDual->processEvent(EigrpDual<Ipv4Address>::RECV_QUERY, src, neigh->getNeighborId(), isSourceNew);
667  }
669  eigrpTt->purgeTable();
670 }

Referenced by processMsgFromNetwork().

◆ processReplyPacket()

void inet::eigrp::EigrpIpv4Pdm::processReplyPacket ( Packet pk,
Ipv4Address srcAddress,
int  ifaceId,
EigrpNeighbor< Ipv4Address > *  neigh 
)
protected
673 {
674  const EigrpIpv4Reply *reply = staticPtrCast<const EigrpIpv4Reply>(pk->peekAtFront<EigrpIpv4Reply>()).get();
675 
676  EigrpInterface *eigrpIface = eigrpIft->findInterfaceById(ifaceId);
677  EigrpRouteSource<Ipv4Address> *src;
678  bool notifyDual, isSourceNew;
679 
680  printRecvMsg(reply, srcAddress, ifaceId);
681 
682  int cnt = reply->getInterRoutesArraySize();
683 #ifdef EIGRP_DEBUG
684  EV_DEBUG << " Route count:" << cnt << endl;
685 #endif
686 
687  for (int i = 0; i < cnt; i++) {
688  src = processInterRoute(reply->getInterRoutes(i), srcAddress, neigh->getNeighborId(), eigrpIface, &notifyDual, &isSourceNew);
689  // Always notify DUAL
690  eigrpDual->processEvent(EigrpDual<Ipv4Address>::RECV_REPLY, src, neigh->getNeighborId(), isSourceNew);
691  }
693  eigrpTt->purgeTable();
694 }

Referenced by processMsgFromNetwork().

◆ processRTRouteDel()

void inet::eigrp::EigrpIpv4Pdm::processRTRouteDel ( const cObject *  details)
protected
240 {
241  if (dynamic_cast<const Ipv4Route *>(details) == nullptr) {
242  return; // route is not Ipv4
243  }
244 
245  const Ipv4Route *changedRt = check_and_cast<const Ipv4Route *>(details);
246 // ANSAIPv4Route *changedAnsaRt = dynamic_cast<ANSAIPv4Route *>(changedRt);
247  const Ipv4Route *changedAnsaRt = changedRt;
248  unsigned adminDist;
249  EigrpRouteSource<Ipv4Address> *source = nullptr;
250 
251  if (changedAnsaRt != nullptr)
252  adminDist = changedAnsaRt->getAdminDist();
253  else
254  adminDist = changedRt->getAdminDist();
255 
256 #ifdef EIGRP_DEBUG
257 // std::cout << "EIGRP: received notification about deletion of route in RT with AD=" << adminDist << endl;
258 #endif
259 
260  if (adminDist == this->adminDistInt) { // Deletion of EIGRP internal route
261  source = eigrpTt->findRoute(changedRt->getDestination(), changedRt->getNetmask(), changedRt->getGateway());
262  if (source == nullptr) {
263  ASSERT(false);
264  EV_DEBUG << "EIGRP: removed EIGRP route from RT, not found corresponding route source in TT" << endl;
265  return;
266  }
267 
268  if (source == oldsource)
269  return;
270  else
271  oldsource = source;
272 
273  if (source->isSuccessor()) {
274  if (!source->getRouteInfo()->isActive()) { // Process route in DUAL (no change of metric)
275  this->eigrpDual->processEvent(EigrpDual<Ipv4Address>::LOST_ROUTE, source, IEigrpPdm::UNSPEC_SENDER, false);
276  }
277  }
278  // Else do nothing - EIGRP itself removed route from RT
279  }
280  else { // Deletion of non EIGRP route
281 
282  }
283 }

Referenced by receiveSignal().

◆ processTimer()

void inet::eigrp::EigrpIpv4Pdm::processTimer ( cMessage *  msg)
protected
478 {
479  EigrpTimer *timer = check_and_cast<EigrpTimer *>(msg);
480  EigrpInterface *eigrpIface = nullptr;
481  EigrpNeighbor<Ipv4Address> *neigh = nullptr;
482  cObject *contextBasePtr = nullptr;
483  EigrpMsgReq *msgReq = nullptr;
484  int ifaceId = -1;
485 
486  switch (timer->getTimerKind()) {
487  case EIGRP_HELLO_TIMER:
488  // get interface that belongs to timer
489  contextBasePtr = (cObject *)timer->getContextPointer();
490  eigrpIface = check_and_cast<EigrpInterface *>(contextBasePtr);
491 
492  // schedule Hello timer
493  scheduleAt(simTime() + eigrpIface->getHelloInt() - 0.5, timer);
494 
495  // send Hello message
496  msgReq = createMsgReq(EIGRP_HELLO_MSG, EigrpNeighbor<Ipv4Address>::UNSPEC_ID, eigrpIface->getInterfaceId());
497  this->send(msgReq, RTP_OUTGW);
498  break;
499 
500  case EIGRP_HOLD_TIMER:
501  // get neighbor from context
502  contextBasePtr = (cObject *)timer->getContextPointer();
503  neigh = check_and_cast<EigrpNeighbor<Ipv4Address> *>(contextBasePtr);
504  ifaceId = neigh->getIfaceId();
505 
506  // remove neighbor
507  EV_DEBUG << "Neighbor " << neigh->getIPAddress() << " is down, holding time expired" << endl;
508  removeNeighbor(neigh);
509  neigh = nullptr;
511  eigrpTt->purgeTable();
512 
513  // Send goodbye and restart Hello timer
514  eigrpIface = eigrpIft->findInterfaceById(ifaceId);
515  resetTimer(eigrpIface->getHelloTimer(), eigrpIface->getHelloInt() - 0.5);
517  msgReq->setGoodbyeMsg(true);
518  send(msgReq, RTP_OUTGW);
519  break;
520 
521  default:
522  EV_DEBUG << "Timer with unknown kind was skipped" << endl;
523  delete timer;
524  timer = nullptr;
525  break;
526  }
527 }

Referenced by handleMessage().

◆ processUpdatePacket()

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

Referenced by processMsgFromNetwork().

◆ pushMsgRouteToQueue()

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

Insert route into the queue with requests.

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

Referenced by msgToIface(), and sendReply().

◆ receiveSignal()

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

◆ removeNeighbor()

void inet::eigrp::EigrpIpv4Pdm::removeNeighbor ( EigrpNeighbor< Ipv4Address > *  neigh)
protected

Removes neighbor from neighbor table and delete it.

Notifies DUAL about event.

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

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

◆ removeOldSuccessor()

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

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

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

Referenced by updateRoute().

◆ removeRouteFromRT()

bool inet::eigrp::EigrpIpv4Pdm::removeRouteFromRT ( EigrpRouteSource< Ipv4Address > *  source,
IRoute::SourceType removedRtSrc 
)
protected
Returns
if route is found in routing table then returns true.
1663 {
1664  EigrpRoute<Ipv4Address> *route = source->getRouteInfo();
1665  Ipv4Route *rtEntry = findRoute(route->getRouteAddress(), route->getRouteMask(), source->getNextHop());
1666 
1667 // ANSAIPv4Route *ansaRtEntry = dynamic_cast<ANSAIPv4Route *>(rtEntry);
1668  Ipv4Route *ansaRtEntry = rtEntry;
1669  if (ansaRtEntry != nullptr) {
1670  *removedRtSrc = ansaRtEntry->getSourceType();
1671  //if (*removedRtSrc == ANSAIPv4Route::pEIGRP)
1672  if (ansaRtEntry->getSourceType() == IRoute::EIGRP) {
1673  EV_DEBUG << "EIGRP: delete route " << route->getRouteAddress() << " via " << source->getNextHop() << " from RT" << endl;
1674  delete rt->removeRoute(rtEntry);
1675  }
1676  }
1677  else {
1678 #ifdef EIGRP_DEBUG
1679  EV_DEBUG << "EIGRP: EIGRP route " << route->getRouteAddress() << " via " << source->getNextHop() << " can not be removed, not found in RT" << endl;
1680 #endif
1681  }
1682  return rtEntry != nullptr;
1683 }

Referenced by removeOldSuccessor().

◆ resetTimer()

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

Sets specified timer to given interval.

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

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

◆ sendAllEigrpPaths()

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

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

952 {
953  int routeCnt = eigrpTt->getNumRouteInfo();
954  int addedRoutes = 0; // Number of routes in message
955  EigrpRoute<Ipv4Address> *route;
956  EigrpRouteSource<Ipv4Address> *source;
957  EigrpMsgReq *msgReq = createMsgReq(EIGRP_UPDATE_MSG, neigh->getNeighborId(), neigh->getIfaceId());
958 
959  msgReq->setRoutesArraySize(routeCnt);
960 
961  for (int i = 0; i < routeCnt; i++) {
962  route = eigrpTt->getRouteInfo(i);
963  if (route->isActive())
964  continue;
965 
966  if ((source = eigrpTt->getBestSuccessor(route)) != nullptr) {
967  if (this->eigrpStubEnabled && applyStubToUpdate(source))
968  continue; // Apply stub settings to the route
969  if (eigrpIface->isSplitHorizonEn() && applySplitHorizon(eigrpIface, source, route))
970  continue; // Apply Split Horizon rule
971 
972  EigrpMsgRoute routeReq;
973  routeReq.sourceId = source->getSourceId();
974  routeReq.routeId = source->getRouteId();
975  routeReq.originator = source->getOriginator();
976  routeReq.invalid = false;
977  msgReq->setRoutes(addedRoutes /* not variable i */, routeReq);
978  addedRoutes++;
979  }
980  }
981 
982  if (addedRoutes < routeCnt) // reduce size of array
983  msgReq->setRoutesArraySize(addedRoutes);
984 
985  msgReq->setEot(true);
986 
987  send(msgReq, RTP_OUTGW);
988 }

Referenced by processAckPacket(), and processUpdatePacket().

◆ sendQuery()

void inet::eigrp::EigrpIpv4Pdm::sendQuery ( int  destNeighbor,
EigrpRoute< Ipv4Address > *  route,
EigrpRouteSource< Ipv4Address > *  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< Ipv4Address >.

1615 {
1616  bool forceUnreachable = false;
1617 
1618  EV_DEBUG << "DUAL: send Query message about " << route->getRouteAddress() << " to all neighbors" << endl;
1619 
1620  if (this->eigrpStubEnabled)
1621  forceUnreachable = true; // Send Query with infinite metric to all neighbors
1622  else {
1623  if (this->eigrpNt->getStubCount() > 0) { // Apply Poison Reverse instead of Split Horizon rule
1624  forcePoisonRev = true;
1625  }
1626  }
1627 
1628  msgToAllIfaces(destNeighbor, EIGRP_QUERY_MSG, source, forcePoisonRev, forceUnreachable);
1629 }

◆ sendReply()

void inet::eigrp::EigrpIpv4Pdm::sendReply ( EigrpRoute< Ipv4Address > *  route,
int  destNeighbor,
EigrpRouteSource< Ipv4Address > *  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< Ipv4Address >.

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

◆ sendUpdate()

void inet::eigrp::EigrpIpv4Pdm::sendUpdate ( int  destNeighbor,
EigrpRoute< Ipv4Address > *  route,
EigrpRouteSource< Ipv4Address > *  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< Ipv4Address >.

1605 {
1606  EV_DEBUG << "DUAL: send Update message about " << route->getRouteAddress() << " to all neighbors, " << reason << endl;
1607  if (this->eigrpStubEnabled && applyStubToUpdate(source)) {
1608  EV_DEBUG << " Stub routing applied, message will not be sent" << endl;
1609  return;
1610  }
1611  msgToAllIfaces(destNeighbor, EIGRP_UPDATE_MSG, source, forcePoisonRev, false);
1612 }

Referenced by sendUpdateToStubs().

◆ sendUpdateToStubs()

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

Sends update message to all stub neighbors.

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

1939 {
1940  if (!this->eigrpStubEnabled && eigrpNt->getStubCount() > 0) {
1941  if (succ == nullptr) { // Send old successor
1942  // Route will be removed after router receives Ack from neighbor
1943  if (oldSucc->isUnreachable()) {
1944  route->setUpdateSent(true);
1945  route->setNumSentMsgs(route->getNumSentMsgs() + 1);
1946  }
1947  sendUpdate(IEigrpPdm::STUB_RECEIVER, route, oldSucc, true, "notify stubs about change");
1948  }
1949  else // Send successor
1950  sendUpdate(IEigrpPdm::STUB_RECEIVER, route, succ, true, "notify stubs about change");
1951  }
1952 }

◆ setASNum()

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

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

284 { this->asNum = asNum; }

◆ setBandwidth()

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

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

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

◆ setDelay()

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

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

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

◆ setDelayedRemove()

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

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

Parameters
neighIdID of neighbor
srcroute

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

1898 {
1899  EigrpNeighbor<Ipv4Address> *neigh = eigrpNt->findNeighborById(neighId);
1900 
1901  ASSERT(neigh != nullptr);
1902  neigh->setRoutesForDeletion(true);
1903  src->setDelayedRemove(neighId);
1904  src->setValid(true); // Can not be invalid
1905 
1906 #ifdef EIGRP_DEBUG
1907  EV_DEBUG << "DUAL: route via " << src->getNextHop() << " will be removed from TT after receiving Ack from neighbor" << endl;
1908 #endif
1909 }

◆ setHelloInt()

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

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

1552 {
1553  EigrpInterface *iface = getInterfaceById(ifaceId);
1554  if (iface == nullptr)
1556  iface->setHelloInt(interval);
1557 }

◆ setHoldInt()

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

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

1560 {
1561  EigrpInterface *iface = getInterfaceById(ifaceId);
1562  if (iface == nullptr)
1564  iface->setHoldInt(interval);
1565 }

◆ setKValues()

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

◆ setLoad()

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

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

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

◆ setMaximumPath()

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

◆ setPassive()

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

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

1576 {
1577  EigrpInterface *eigrpIface = getInterfaceById(ifaceId);
1578 
1579  if (eigrpIface == nullptr)
1581  else if (eigrpIface->isEnabled()) { // Disable sending and receiving of messages
1582  NetworkInterface *iface = ift->getInterfaceById(ifaceId);
1583  Ipv4InterfaceData *idata = iface->getProtocolDataForUpdate<Ipv4InterfaceData>();
1584  idata->leaveMulticastGroup(EIGRP_IPV4_MULT);
1585 // iface->ipv4Data()->leaveMulticastGroup(EIGRP_IPV4_MULT);
1586 
1587  // Stop and delete hello timer
1588  EigrpTimer *hellot = eigrpIface->getHelloTimer();
1589  if (hellot != nullptr) {
1590  cancelEvent(hellot);
1591  delete hellot;
1592  eigrpIface->setHelloTimerPtr(nullptr);
1593  }
1594  }
1595  // Else do nothing (interface is not part of EIGRP)
1596 
1597  eigrpIface->setPassive(passive);
1598 }

◆ setReliability()

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

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

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

◆ setReplyStatusTable()

bool inet::eigrp::EigrpIpv4Pdm::setReplyStatusTable ( EigrpRoute< Ipv4Address > *  route,
EigrpRouteSource< Ipv4Address > *  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< Ipv4Address >.

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

◆ setRouterId()

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

Sets router ID.

Parameters
routerIDEIGRP process routerID, represented as IPv4 address

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

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

◆ setRouteTlvMetric()

void inet::eigrp::EigrpIpv4Pdm::setRouteTlvMetric ( EigrpWideMetricPar msgMetric,
EigrpWideMetricPar rtMetric 
)
protected
874 {
875  msgMetric->bandwidth = rtMetric->bandwidth;
876  msgMetric->delay = rtMetric->delay;
877  msgMetric->hopCount = rtMetric->hopCount;
878  msgMetric->load = rtMetric->load;
879  msgMetric->mtu = rtMetric->mtu;
880  msgMetric->offset = 0; // TODO
881  msgMetric->priority = 0; // TODO
882  msgMetric->reliability = rtMetric->reliability;
883 }

Referenced by createRouteTlv().

◆ setRTRouteMetric()

void inet::eigrp::EigrpIpv4Pdm::setRTRouteMetric ( Ipv4Route route,
uint64_t  metric 
)
inlineprotected

Changes metric of route in routing table.

For wide metric uses scale.

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

Referenced by createRTRoute(), and installRouteToRT().

◆ setSplitHorizon()

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

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

1568 {
1569  EigrpInterface *iface = getInterfaceById(ifaceId);
1570  if (iface == nullptr)
1572  iface->setSplitHorizon(shenabled);
1573 }

◆ setStub()

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

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

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

◆ setVariance()

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

◆ startHelloTimer()

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

Schedule hello timer to the specified interval.

1529 {
1530  EigrpTimer *hellot;
1531 
1532  // Start Hello timer on interface
1533  if (!eigrpIface->isPassive()) {
1534  if ((hellot = eigrpIface->getHelloTimer()) == nullptr) {
1535  hellot = createTimer(EIGRP_HELLO_TIMER, eigrpIface);
1536  eigrpIface->setHelloTimerPtr(hellot);
1537  }
1538  scheduleAt(interval, hellot);
1539  }
1540 }

Referenced by addInterfaceToEigrp(), and processIfaceStateChange().

◆ unlockRoutes()

void inet::eigrp::EigrpIpv4Pdm::unlockRoutes ( const EigrpMsgReq msgReq)
protected
886 {
887  int reqCnt = msgReq->getRoutesArraySize();
888  EigrpRoute<Ipv4Address> *route = nullptr;
889 
890  for (int i = 0; i < reqCnt; i++) {
891  EigrpMsgRoute req = msgReq->getRoutes(i);
892  route = eigrpTt->findRouteInfoById(req.routeId);
893 
894  ASSERT(route != nullptr);
895  route->decrementRefCnt();
896 
897  if (route->getRefCnt() < 1) { // Route would have been removed be removed if wasn't locked
898  delete eigrpTt->removeRouteInfo(route);
899  }
900  }
901 }

Referenced by createReplyPacket().

◆ updateInterface()

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

◆ updateRoute()

EigrpRouteSource< Ipv4Address > * inet::eigrp::EigrpIpv4Pdm::updateRoute ( EigrpRoute< Ipv4Address > *  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< Ipv4Address >.

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

Member Data Documentation

◆ adminDistInt

unsigned int inet::eigrp::EigrpIpv4Pdm::adminDistInt
protected

Administrative distance.

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

◆ asNum

int inet::eigrp::EigrpIpv4Pdm::asNum
protected

Autonomous system number.

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

◆ EIGRP_IPV4_MULT

const Ipv4Address inet::eigrp::EigrpIpv4Pdm::EIGRP_IPV4_MULT
protected

Multicast address for EIGRP messages.

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

◆ EIGRP_SELF_ADDR

const Ipv4Address inet::eigrp::EigrpIpv4Pdm::EIGRP_SELF_ADDR
protected

Next hop address 0.0.0.0 (self address)

◆ eigrpDual

◆ eigrpIft

◆ eigrpIftDisabled

EigrpDisabledInterfaces* inet::eigrp::EigrpIpv4Pdm::eigrpIftDisabled
protected

◆ eigrpMetric

◆ eigrpNt

◆ eigrpStub

EigrpStub inet::eigrp::EigrpIpv4Pdm::eigrpStub
protected

EIGRP stub configuration.

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

◆ eigrpStubEnabled

bool inet::eigrp::EigrpIpv4Pdm::eigrpStubEnabled
protected

◆ eigrpTt

◆ host

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

Referenced by initialize().

◆ ift

◆ kValues

EigrpKValues inet::eigrp::EigrpIpv4Pdm::kValues
protected

◆ KVALUES_MAX

EigrpKValues inet::eigrp::EigrpIpv4Pdm::KVALUES_MAX
protected

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

Referenced by EigrpIpv4Pdm(), and processHelloPacket().

◆ maximumPath

int inet::eigrp::EigrpIpv4Pdm::maximumPath
protected

Maximum number of parallel routes that EIGRP will support.

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

◆ oldsource

EigrpRouteSource<Ipv4Address>* inet::eigrp::EigrpIpv4Pdm::oldsource = nullptr
protected

Latest route change.

Referenced by processRTRouteDel().

◆ reqQueue

RequestVector inet::eigrp::EigrpIpv4Pdm::reqQueue
protected

Requests for sending EIGRP messages from DUAL.

Referenced by flushMsgRequests(), and pushMsgRouteToQueue().

◆ ribScale

int inet::eigrp::EigrpIpv4Pdm::ribScale
protected

Scaling factor for Wide metric.

Referenced by EigrpIpv4Pdm().

◆ routingForNetworks

EigrpNetworkTable<Ipv4Address>* inet::eigrp::EigrpIpv4Pdm::routingForNetworks
protected

Networks included in EIGRP.

Referenced by addNetwork(), initialize(), processIfaceStateChange(), and ~EigrpIpv4Pdm().

◆ rt

ModuleRefByPar<IIpv4RoutingTable> inet::eigrp::EigrpIpv4Pdm::rt
protected

◆ RTP_OUTGW

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

◆ sizeOfMsg

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

◆ SPLITTER_OUTGW

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

Output gateway to the EIGRP Splitter module.

Referenced by EigrpIpv4Pdm(), and processMsgFromRtp().

◆ useClassicMetric

bool inet::eigrp::EigrpIpv4Pdm::useClassicMetric
protected

Use classic metric computation or wide metric computation.

Referenced by EigrpIpv4Pdm().

◆ variance

int inet::eigrp::EigrpIpv4Pdm::variance
protected

Parameter for unequal cost load balancing.

Referenced by EigrpIpv4Pdm(), and initialize().


The documentation for this class was generated from the following files:
inet::eigrp::EigrpIpv4Pdm::createUpdatePacket
Packet * createUpdatePacket(const Ipv4Address &destAddress, EigrpMsgReq *msgReq)
Definition: EigrpIpv4Pdm.cc:787
inet::IRoute::dEIGRPExternal
@ dEIGRPExternal
Definition: IRoute.h:72
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::EigrpIpv4Pdm::eigrpTt
EigrpIpv4TopologyTable * eigrpTt
Topology table.
Definition: EigrpIpv4Pdm.h:86
inet::eigrp::EigrpTopologyTable::findRoute
EigrpRouteSource< IPAddress > * findRoute(const IPAddress &routeAddr, const IPAddress &routeMask, const IPAddress &nextHop)
Definition: EigrpTopologyTable.cc:115
inet::eigrp::EigrpIpv4Pdm::asNum
int asNum
Autonomous system number.
Definition: EigrpIpv4Pdm.h:68
inet::eigrp::EigrpIpv4Pdm::reqQueue
RequestVector reqQueue
Requests for sending EIGRP messages from DUAL.
Definition: EigrpIpv4Pdm.h:88
inet::EIGRP_UPDATE_MSG
@ EIGRP_UPDATE_MSG
Definition: EigrpMessage_m.h:89
inet::Ipv4Address::getInt
uint32_t getInt() const
Returns the address as an uint32_t in host byte order (e.g.
Definition: Ipv4Address.h:186
inet::eigrp::EigrpInterfaceTable::getInterface
EigrpInterface * getInterface(int k) const
Returns interface by its position in the table.
Definition: EigrpInterfaceTable.h:180
inet::eigrp::EigrpDual::INTERFACE_UP
@ INTERFACE_UP
EIGRP enabled on interface.
Definition: EigrpDual.h:39
inet::eigrp::EigrpIpv4Pdm::SPLITTER_OUTGW
const char * SPLITTER_OUTGW
Output gateway to the EIGRP Splitter module.
Definition: EigrpIpv4Pdm.h:61
inet::eigrp::EigrpIpv4Pdm::msgToIface
void msgToIface(HeaderOpcode msgType, EigrpRouteSource< Ipv4Address > *source, EigrpInterface *eigrpIface, bool forcePoisonRev=false, bool forceUnreachable=false)
Creates request for sending message on specified interface.
Definition: EigrpIpv4Pdm.cc:1245
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::EigrpIpv4Pdm::resetTimer
void resetTimer(EigrpTimer *timer, int interval)
Sets specified timer to given interval.
Definition: EigrpIpv4Pdm.h:101
inet::eigrp::EigrpInterface::setBandwidth
void setBandwidth(uint64_t bw)
Definition: EigrpInterfaceTable.h:88
inet::eigrp::EigrpMetricHelper::compareParameters
bool compareParameters(const EigrpWideMetricPar &par1, const EigrpWideMetricPar &par2, EigrpKValues &kValues)
Compares metric enabled parameters.
Definition: EigrpMetricHelper.cc:114
inet::eigrp::EigrpIpv4Pdm::getInterfaceById
EigrpInterface * getInterfaceById(int ifaceId)
Returns EIGRP interface (enabled or disabled) or nullptr.
Definition: EigrpIpv4Pdm.cc:1404
inet::eigrp::EigrpIpv4Pdm::routingForNetworks
EigrpNetworkTable< Ipv4Address > * routingForNetworks
Networks included in EIGRP.
Definition: EigrpIpv4Pdm.h:87
inet::Protocol::ipv4
static const Protocol ipv4
Definition: Protocol.h:93
inet::eigrp::EigrpIpv4Pdm::eigrpIftDisabled
EigrpDisabledInterfaces * eigrpIftDisabled
Disabled EIGRP interfaces.
Definition: EigrpIpv4Pdm.h:84
inet::EigrpKValues::K1
uint16_t K1
Definition: EigrpMessage_m.h:127
inet::eigrp::EigrpIpv4Pdm::cancelHelloTimers
void cancelHelloTimers()
Stops Hello Timers on all interfaces.
Definition: EigrpIpv4Pdm.cc:1093
inet::eigrp::EigrpIpv4Pdm::msgToAllIfaces
void msgToAllIfaces(int destination, HeaderOpcode msgType, EigrpRouteSource< Ipv4Address > *source, bool forcePoisonRev, bool forceUnreachable)
Records request to send message to all neighbors.
Definition: EigrpIpv4Pdm.cc:1211
inet::eigrp::EigrpIpv4Pdm::EIGRP_IPV4_MULT
const Ipv4Address EIGRP_IPV4_MULT
Multicast address for EIGRP messages.
Definition: EigrpIpv4Pdm.h:63
inet::eigrp::EigrpNeighborTable::decStubCount
void decStubCount()
Definition: EigrpNeighborTable.h:67
inet::eigrp::EigrpIpv4Pdm::processHelloPacket
void processHelloPacket(Packet *pk, Ipv4Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv4Address > *neigh)
Definition: EigrpIpv4Pdm.cc:547
inet::getContainingNode
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:40
inet::eigrp::EigrpIpv4Pdm::processNewNeighbor
void processNewNeighbor(int ifaceId, Ipv4Address &srcAddress, const EigrpIpv4Hello *helloMessage)
Creates relationship with neighbor.
Definition: EigrpIpv4Pdm.cc:990
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::EigrpIpv4Pdm::processUpdatePacket
void processUpdatePacket(Packet *pk, Ipv4Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv4Address > *neigh)
Definition: EigrpIpv4Pdm.cc:590
DispatchProtocolReq
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down DispatchProtocolReq
Definition: IUdp-gates.txt:25
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
inet::eigrp::EigrpIpv4Pdm::applyStubToUpdate
bool applyStubToUpdate(EigrpRouteSource< Ipv4Address > *src)
Apply stub configuration to the route in outgoing Update message.
Definition: EigrpIpv4Pdm.cc:1320
EigrpTimer::setTimerKind
virtual void setTimerKind(char timerKind)
inet::IRoute::EIGRP
@ EIGRP
Definition: IRoute.h:42
inet::eigrp::EigrpIpv4Pdm::kValues
EigrpKValues kValues
K-values for calculation of metric.
Definition: EigrpIpv4Pdm.h:69
inet::eigrp::EigrpIpv4Pdm::processQueryPacket
void processQueryPacket(Packet *pk, Ipv4Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv4Address > *neigh)
Definition: EigrpIpv4Pdm.cc:646
inet::EigrpKValues::K6
uint16_t K6
Definition: EigrpMessage_m.h:132
inet::eigrp::EigrpIpv4Pdm::pushMsgRouteToQueue
EigrpMsgReq * pushMsgRouteToQueue(HeaderOpcode msgType, int ifaceId, int neighId, const EigrpMsgRoute &msgRt)
Insert route into the queue with requests.
Definition: EigrpIpv4Pdm.cc:1278
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::EigrpTopologyTable::findRouteInfoById
EigrpRoute< IPAddress > * findRouteInfoById(int routeId)
Definition: EigrpTopologyTable.cc:509
inet::Protocol::eigrp
static const Protocol eigrp
Definition: Protocol.h:63
inet::eigrp::EigrpIpv4Pdm::processMsgFromNetwork
void processMsgFromNetwork(cMessage *msg)
Process message from network layer.
Definition: EigrpIpv4Pdm.cc:285
inet::eigrp::EigrpIpv4Pdm::findRoute
Ipv4Route * findRoute(const Ipv4Address &network, const Ipv4Address &netmask)
Definition: EigrpIpv4Pdm.cc:1911
inet::eigrp::EigrpInterfaceTable::findInterfaceById
EigrpInterface * findInterfaceById(int ifaceId)
Gets interface from table by interface ID.
Definition: EigrpInterfaceTable.cc:155
inet::IRoute::dEIGRPInternal
@ dEIGRPInternal
Definition: IRoute.h:65
inet::eigrp::EigrpNeighborTable::getFirstNeighborOnIf
EigrpNeighbor< IPAddress > * getFirstNeighborOnIf(int ifaceId)
Returns first neighbor that resides on specified interface.
Definition: EigrpNeighborTable.cc:144
inet::eigrp::EigrpIpv4Pdm::printRecvMsg
void printRecvMsg(const EigrpMessage *msg, Ipv4Address &addr, int ifaceId)
Definition: EigrpIpv4Pdm.cc:459
inet::EigrpStub::connectedRt
bool connectedRt
Definition: EigrpMessage_m.h:189
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::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::EigrpIpv4Pdm::applyStubToQuery
bool applyStubToQuery(EigrpInterface *eigrpIface, int numOfNeigh)
Apply stub configuration to the route in outgoing Query message.
Definition: EigrpIpv4Pdm.cc:1236
inet::eigrp::EigrpIpv4Pdm::maximumPath
int maximumPath
Maximum number of parallel routes that EIGRP will support.
Definition: EigrpIpv4Pdm.h:70
inet::eigrp::EigrpDual::LOST_ROUTE
@ LOST_ROUTE
Route in RT deleted, but not by EIGRP.
Definition: EigrpDual.h:40
inet::eigrp::EigrpIpv4Pdm::getNextHopAddr
Ipv4Address getNextHopAddr(const Ipv4Address &nextHopAddr, Ipv4Address &senderAddr)
Returns next hop address.
Definition: EigrpIpv4Pdm.h:210
inet::eigrp::EigrpTopologyTable::getRouterId
Ipv4Address & getRouterId()
Definition: EigrpTopologyTable.h:95
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::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::EigrpIpv4Pdm::processMsgFromRtp
void processMsgFromRtp(cMessage *msg)
Process message request from RTP.
Definition: EigrpIpv4Pdm.cc:344
inet::eigrp::EigrpInterfaceTable::removeInterface
EigrpInterface * removeInterface(EigrpInterface *iface)
Removes interface from table.
Definition: EigrpInterfaceTable.cc:143
inet::eigrp::EigrpIpv4Pdm::sendAllEigrpPaths
void sendAllEigrpPaths(EigrpInterface *eigrpIface, EigrpNeighbor< Ipv4Address > *neigh)
Creates and sends message with all routes from routing table to specified neighbor.
Definition: EigrpIpv4Pdm.cc:951
inet::units::units::B
intscale< b, 1, 8 > B
Definition: Units.h:1168
inet::eigrp::EigrpIpv4Pdm::host
cModule * host
Definition: EigrpIpv4Pdm.h:58
inet::eigrp::EigrpIpv4Pdm::adminDistInt
unsigned int adminDistInt
Administrative distance.
Definition: EigrpIpv4Pdm.h:72
inet::eigrp::EigrpIpv4Pdm::createAckPacket
Packet * createAckPacket(Ipv4Address &destAddress, EigrpMsgReq *msgReq)
Definition: EigrpIpv4Pdm.cc:773
inet::eigrp::EigrpIpv4Pdm::processIfaceConfigChange
void processIfaceConfigChange(EigrpInterface *eigrpIface)
Definition: EigrpIpv4Pdm.cc:204
inet::eigrp::EigrpInterface::isSplitHorizonEn
bool isSplitHorizonEn() const
Definition: EigrpInterfaceTable.h:109
inet::eigrp::EigrpTopologyTable::removeRouteInfo
EigrpRoute< IPAddress > * removeRouteInfo(EigrpRoute< IPAddress > *route)
Definition: EigrpTopologyTable.cc:483
inet::eigrp::EigrpIpv4Pdm::cancelHoldTimer
void cancelHoldTimer(EigrpNeighbor< Ipv4Address > *neigh)
Stops Hold timer.
Definition: EigrpIpv4Pdm.cc:1082
inet::eigrp::EigrpIpv4Pdm::variance
int variance
Parameter for unequal cost load balancing.
Definition: EigrpIpv4Pdm.h:71
inet::eigrp::EigrpMetricHelper::BANDWIDTH_INF
static const uint64_t BANDWIDTH_INF
Definition: EigrpMetricHelper.h:49
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
HopLimitReq
removed HopLimitReq
Definition: IUdp-gates.txt:11
inet::eigrp::EigrpIpv4Pdm::addInterfaceToEigrp
EigrpInterface * addInterfaceToEigrp(int ifaceId, int networkId, bool enabled)
Creates interface and inserts it to the table.
Definition: EigrpIpv4Pdm.cc:1505
inet::eigrp::EigrpIpv4Pdm::createRouteTlv
void createRouteTlv(EigrpMpIpv4Internal *routeTlv, EigrpRoute< Ipv4Address > *route, bool unreachable=false)
Definition: EigrpIpv4Pdm.cc:860
inet::eigrp::EigrpIpv4Pdm::processRTRouteDel
void processRTRouteDel(const cObject *details)
Definition: EigrpIpv4Pdm.cc:239
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::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::EigrpTopologyTable::setRouterId
void setRouterId(Ipv4Address &routerID)
Definition: EigrpTopologyTable.h:96
inet::eigrp::EigrpTopologyTable::getNumRouteInfo
int getNumRouteInfo() const
Definition: EigrpTopologyTable.h:88
inet::eigrp::EigrpIpv4Pdm::createReplyPacket
Packet * createReplyPacket(Ipv4Address &destAddress, EigrpMsgReq *msgReq)
Definition: EigrpIpv4Pdm.cc:827
inet::eigrp::EigrpIpv4Pdm::createTimer
EigrpTimer * createTimer(char timerKind, void *context)
Creates timer of specified type.
Definition: EigrpIpv4Pdm.cc:739
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::EigrpIpv4Pdm::addMessageHeader
void addMessageHeader(const Ptr< EigrpMessage > &msg, int opcode, EigrpMsgReq *msgReq)
Definition: EigrpIpv4Pdm.cc:850
inet::eigrp::EigrpIpv4Pdm::checkNeighborshipRules
int checkNeighborshipRules(int ifaceId, int neighAsNum, Ipv4Address &neighAddr, const EigrpKValues &neighKValues)
Checks neighborship rules.
Definition: EigrpIpv4Pdm.cc:1036
inet::eigrp::EigrpIpv4Pdm::applySplitHorizon
bool applySplitHorizon(EigrpInterface *destInterface, EigrpRouteSource< Ipv4Address > *source, EigrpRoute< Ipv4Address > *route)
Definition: EigrpIpv4Pdm.cc:1312
inet::eigrp::EigrpIpv4Pdm::sizeOfMsg
const int64_t sizeOfMsg
Definition: EigrpIpv4Pdm.h:60
inet::eigrp::EigrpIpv4Pdm::eigrpStub
EigrpStub eigrpStub
EIGRP stub configuration.
Definition: EigrpIpv4Pdm.h:76
inet::eigrp::EigrpIpv4Pdm::removeNeighbor
void removeNeighbor(EigrpNeighbor< Ipv4Address > *neigh)
Removes neighbor from neighbor table and delete it.
Definition: EigrpIpv4Pdm.cc:1129
NUM_INIT_STAGES
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
inet::eigrp::EigrpIpv4Pdm::isRTSafeForAdd
bool isRTSafeForAdd(EigrpRoute< Ipv4Address > *route, unsigned int eigrpAd)
Returns true, if routing table does not contain route with given address, mask and smaller administra...
Definition: EigrpIpv4Pdm.cc:1699
inet::eigrp::EigrpDisabledInterfaces::addInterface
void addInterface(EigrpInterface *interface)
Adds interface to the table.
Definition: EigrpDisabledInterfaces.cc:40
inet::eigrp::EigrpIpv4Pdm::createNeighbor
EigrpNeighbor< Ipv4Address > * createNeighbor(EigrpInterface *eigrpIface, Ipv4Address &address, uint16_t holdInt)
Create record in the neighbor table and start hold timer.
Definition: EigrpIpv4Pdm.cc:1065
inet::eigrp::EigrpIpv4Pdm::eigrpStubEnabled
bool eigrpStubEnabled
True when EIGRP stub is on.
Definition: EigrpIpv4Pdm.h:75
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::EigrpIpv4Pdm::createQueryPacket
Packet * createQueryPacket(Ipv4Address &destAddress, EigrpMsgReq *msgReq)
Definition: EigrpIpv4Pdm.cc:807
inet::eigrp::EigrpIpv4Pdm::oldsource
EigrpRouteSource< Ipv4Address > * oldsource
Latest route change.
Definition: EigrpIpv4Pdm.h:66
inet::EIGRP_REPLY_MSG
@ EIGRP_REPLY_MSG
Definition: EigrpMessage_m.h:92
inet::eigrp::EigrpIpv4Pdm::removeOldSuccessor
bool removeOldSuccessor(EigrpRouteSource< Ipv4Address > *source, EigrpRoute< Ipv4Address > *route)
Removes route from routing table and changes old successor's record in topology table.
Definition: EigrpIpv4Pdm.cc:1787
inet::eigrp::EigrpDisabledInterfaces::findInterface
EigrpInterface * findInterface(int ifaceId)
Finds interface by ID in table and returns it.
Definition: EigrpDisabledInterfaces.cc:58
inet::eigrp::EigrpIpv4Pdm::eigrpIft
EigrpInterfaceTable * eigrpIft
Table with enabled EIGRP interfaces.
Definition: EigrpIpv4Pdm.h:83
inet::eigrp::UserMsgs
const char * UserMsgs[]
Definition: EigrpPrint.cc:23
inet::eigrp::EigrpIpv4Pdm::processTimer
void processTimer(cMessage *msg)
Definition: EigrpIpv4Pdm.cc:477
inet::eigrp::EigrpIpv4Pdm::getDestIpAddress
bool getDestIpAddress(int destNeigh, Ipv4Address *resultAddress)
Returns IP address for sending EIGRP message.
Definition: EigrpIpv4Pdm.cc:416
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::EigrpIpv4Pdm::enableInterface
void enableInterface(EigrpInterface *eigrpIface, Ipv4Address &ifAddress, Ipv4Address &ifMask, int networkId)
Add interface to the EIGRP interface table and notifies DUAL.
Definition: EigrpIpv4Pdm.cc:1461
inet::eigrp::EigrpMetricHelper::getParam
EigrpWideMetricPar getParam(EigrpInterface *eigrpIface)
Sets parameters from interface for metric computation.
Definition: EigrpMetricHelper.cc:34
inet::eigrp::EigrpIpv4Pdm::createRTRoute
Ipv4Route * createRTRoute(EigrpRouteSource< Ipv4Address > *successor)
Definition: EigrpIpv4Pdm.cc:1183
inet::eigrp::EigrpIpv4Pdm::processAckPacket
void processAckPacket(Packet *pk, Ipv4Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv4Address > *neigh)
Definition: EigrpIpv4Pdm.cc:529
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::eigrp::EigrpIpv4Pdm::addRoutesToMsg
void addRoutesToMsg(const Ptr< EigrpIpv4Message > &msg, const EigrpMsgReq *msgReq)
Add routes from request to the message.
Definition: EigrpIpv4Pdm.cc:903
inet::EigrpStub::summaryRt
bool summaryRt
Definition: EigrpMessage_m.h:191
inet::eigrp::EigrpIpv4Pdm::ift
ModuleRefByPar< IInterfaceTable > ift
Definition: EigrpIpv4Pdm.h:78
inet::Ipv4Address::UNSPECIFIED_ADDRESS
static const Ipv4Address UNSPECIFIED_ADDRESS
0.0.0.0
Definition: Ipv4Address.h:91
inet::eigrp::EigrpIpv4Pdm::startHelloTimer
void startHelloTimer(EigrpInterface *eigrpIface, simtime_t interval)
Schedule hello timer to the specified interval.
Definition: EigrpIpv4Pdm.cc:1528
Enter_Method
#define Enter_Method(...)
Definition: SelfDoc.h:71
inet::routeDeletedSignal
simsignal_t routeDeletedSignal
Definition: Simsignals.cc:42
inet::eigrp::EigrpIpv4Pdm::removeRouteFromRT
bool removeRouteFromRT(EigrpRouteSource< Ipv4Address > *successor, IRoute::SourceType *removedRtSrc)
Definition: EigrpIpv4Pdm.cc:1662
inet::eigrp::EigrpIpv4Pdm::KVALUES_MAX
EigrpKValues KVALUES_MAX
K-values (from K1 to K5) are set to max.
Definition: EigrpIpv4Pdm.h:64
inet::eigrp::EigrpIpv4Pdm::createHelloPacket
Packet * createHelloPacket(int holdInt, EigrpKValues kValues, Ipv4Address &destAddress, EigrpMsgReq *msgReq)
Definition: EigrpIpv4Pdm.cc:748
EigrpTimer::getTimerKind
virtual char getTimerKind() const
inet::EigrpKValues::K4
uint16_t K4
Definition: EigrpMessage_m.h:130
inet::eigrp::EigrpIpv4Pdm::useClassicMetric
bool useClassicMetric
Use classic metric computation or wide metric computation.
Definition: EigrpIpv4Pdm.h:73
inet::eigrp::EigrpIpv4Pdm::ribScale
int ribScale
Scaling factor for Wide metric.
Definition: EigrpIpv4Pdm.h:74
inet::eigrp::EigrpTopologyTable::getRouteInfo
EigrpRoute< IPAddress > * getRouteInfo(int k)
Definition: EigrpTopologyTable.h:89
inet::IRoute::dUnknown
@ dUnknown
Definition: IRoute.h:77
inet::eigrp::EigrpDisabledInterfaces::getInterface
EigrpInterface * getInterface(int k) const
Returns interface by its position in the table.
Definition: EigrpDisabledInterfaces.h:52
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::EigrpIpv4Pdm::setRTRouteMetric
void setRTRouteMetric(Ipv4Route *route, uint64_t metric)
Changes metric of route in routing table.
Definition: EigrpIpv4Pdm.h:232
inet::eigrp::EigrpIpv4Pdm::RTP_OUTGW
const char * RTP_OUTGW
Output gateway to the RTP module.
Definition: EigrpIpv4Pdm.h:62
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::EigrpIpv4Pdm::setRouteTlvMetric
void setRouteTlvMetric(EigrpWideMetricPar *msgMetric, EigrpWideMetricPar *rtMetric)
Definition: EigrpIpv4Pdm.cc:873
EigrpTimer
Class generated from inet/routing/eigrp/EigrpTimer.msg:22 by opp_msgtool.
Definition: EigrpTimer_m.h:60
inet::eigrp::EigrpIpv4Pdm::unlockRoutes
void unlockRoutes(const EigrpMsgReq *msgReq)
Definition: EigrpIpv4Pdm.cc:885
inet::eigrp::EigrpDisabledInterfaces::removeInterface
EigrpInterface * removeInterface(EigrpInterface *iface)
Removes specified interface from table and returns it.
Definition: EigrpDisabledInterfaces.cc:46
inet::eigrp::EigrpIpv4Pdm::processReplyPacket
void processReplyPacket(Packet *pk, Ipv4Address &srcAddress, int ifaceId, EigrpNeighbor< Ipv4Address > *neigh)
Definition: EigrpIpv4Pdm.cc:672
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::interfaceConfigChangedSignal
simsignal_t interfaceConfigChangedSignal
Definition: Simsignals.cc:33
inet::eigrp::EigrpIpv4Pdm::eigrpMetric
EigrpMetricHelper * eigrpMetric
Definition: EigrpIpv4Pdm.h:82
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::EigrpIpv4Pdm::eigrpDual
EigrpDual< Ipv4Address > * eigrpDual
Definition: EigrpIpv4Pdm.h:81
inet::eigrp::EigrpIpv4Pdm::flushMsgRequests
void flushMsgRequests()
Sends all message requests to RTP.
Definition: EigrpIpv4Pdm.cc:1340
inet::eigrp::EigrpIpv4Pdm::eigrpNt
EigrpIpv4NeighborTable * eigrpNt
Table with EIGRP neighbors.
Definition: EigrpIpv4Pdm.h:85
inet::eigrp::EigrpTopologyTable::findRouteById
EigrpRouteSource< IPAddress > * findRouteById(int sourceId)
Definition: EigrpTopologyTable.cc:436
inet::eigrp::EigrpIpv4Pdm::disableInterface
void disableInterface(NetworkInterface *iface, EigrpInterface *eigrpIface, Ipv4Address &ifAddress, Ipv4Address &ifMask)
Remove interface from EIGRP interface table.
Definition: EigrpIpv4Pdm.cc:1414
inet::eigrp::EigrpIpv4Pdm::installRouteToRT
bool installRouteToRT(EigrpRoute< Ipv4Address > *route, EigrpRouteSource< Ipv4Address > *source, uint64_t dmin, Ipv4Route *rtEntry)
Updates existing route in the routing table or creates new one.
Definition: EigrpIpv4Pdm.cc:1812
inet::eigrp::EigrpIpv4Pdm::processIfaceStateChange
void processIfaceStateChange(NetworkInterface *iface)
Definition: EigrpIpv4Pdm.cc:175
inet::eigrp::EigrpIpv4Pdm::printSentMsg
void printSentMsg(int routeCnt, Ipv4Address &destAddress, EigrpMsgReq *msgReq)
Definition: EigrpIpv4Pdm.cc:431
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::EigrpIpv4Pdm::rt
ModuleRefByPar< IIpv4RoutingTable > rt
Definition: EigrpIpv4Pdm.h:79
inet::eigrp::EigrpIpv4Pdm::processInterRoute
EigrpRouteSource< Ipv4Address > * processInterRoute(const EigrpMpIpv4Internal &tlv, Ipv4Address &nextHop, int sourceNeighId, EigrpInterface *eigrpIface, bool *notifyDual, bool *isSourceNew)
Process route TLV.
Definition: EigrpIpv4Pdm.cc:699
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::EigrpIpv4Pdm::createMsgReq
EigrpMsgReq * createMsgReq(HeaderOpcode msgType, int destNeighbor, int destIface)
Creates request for sending of EIGRP message for RTP.
Definition: EigrpIpv4Pdm.cc:940
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::EigrpIpv4Pdm::sendUpdate
void sendUpdate(int destNeighbor, EigrpRoute< Ipv4Address > *route, EigrpRouteSource< Ipv4Address > *source, bool forcePoisonRev, const char *reason) override
Sends update message to specified neighbor.
Definition: EigrpIpv4Pdm.cc:1604
inet::IRoute::UNKNOWN
@ UNKNOWN
Definition: IRoute.h:42
inet::eigrp::EigrpTopologyTable::getRoute
EigrpRouteSource< IPAddress > * getRoute(int k)
Definition: EigrpTopologyTable.h:61
inet::EIGRP_QUERY_MSG
@ EIGRP_QUERY_MSG
Definition: EigrpMessage_m.h:91