38 OSPFDatabaseDescriptionPacket *ddPacket = check_and_cast<OSPFDatabaseDescriptionPacket *>(packet);
42 if ((ddPacket->getInterfaceMTU() <= intf->getMTU()) &&
45 switch (neighborState) {
54 OSPFDDOptions& ddOptions = ddPacket->getDdOptions();
56 if (ddOptions.I_Init && ddOptions.M_More && ddOptions.MS_MasterSlave &&
57 (ddPacket->getLsaHeadersArraySize() == 0))
60 Neighbor::DDPacketID packetID;
61 packetID.ddOptions = ddOptions;
62 packetID.options = ddPacket->getOptions();
63 packetID.sequenceNumber = ddPacket->getDdSequenceNumber();
65 neighbor->setOptions(packetID.options);
67 neighbor->setDDSequenceNumber(packetID.sequenceNumber);
68 neighbor->setLastReceivedDDPacket(packetID);
75 if (!neighbor->isLinkStateRequestListEmpty() &&
76 !neighbor->isRequestRetransmissionTimerActive())
78 neighbor->sendLinkStateRequestPacket();
79 neighbor->clearRequestRetransmissionTimer();
80 neighbor->startRequestRetransmissionTimer();
84 neighbor->sendDatabaseDescriptionPacket(
true);
87 if (!ddOptions.I_Init && !ddOptions.MS_MasterSlave &&
88 (ddPacket->getDdSequenceNumber() == neighbor->getDDSequenceNumber()) &&
91 Neighbor::DDPacketID packetID;
92 packetID.ddOptions = ddOptions;
93 packetID.options = ddPacket->getOptions();
94 packetID.sequenceNumber = ddPacket->getDdSequenceNumber();
96 neighbor->setOptions(packetID.options);
98 neighbor->setLastReceivedDDPacket(packetID);
105 if (!neighbor->isLinkStateRequestListEmpty() &&
106 !neighbor->isRequestRetransmissionTimerActive())
108 neighbor->sendLinkStateRequestPacket();
109 neighbor->clearRequestRetransmissionTimer();
110 neighbor->startRequestRetransmissionTimer();
117 Neighbor::DDPacketID packetID;
118 packetID.ddOptions = ddPacket->getDdOptions();
119 packetID.options = ddPacket->getOptions();
120 packetID.sequenceNumber = ddPacket->getDdSequenceNumber();
122 if (packetID != neighbor->getLastReceivedDDPacket()) {
123 if ((packetID.ddOptions.MS_MasterSlave &&
125 (!packetID.ddOptions.MS_MasterSlave &&
127 packetID.ddOptions.I_Init ||
128 (packetID.options != neighbor->getLastReceivedDDPacket().options))
134 (packetID.sequenceNumber == neighbor->getDDSequenceNumber())) ||
136 (packetID.sequenceNumber == (neighbor->getDDSequenceNumber() + 1))))
138 neighbor->setLastReceivedDDPacket(packetID);
142 if (!neighbor->isLinkStateRequestListEmpty() &&
143 !neighbor->isRequestRetransmissionTimerActive())
145 neighbor->sendLinkStateRequestPacket();
146 neighbor->clearRequestRetransmissionTimer();
147 neighbor->startRequestRetransmissionTimer();
157 neighbor->retransmitDatabaseDescriptionPacket();
165 Neighbor::DDPacketID packetID;
166 packetID.ddOptions = ddPacket->getDdOptions();
167 packetID.options = ddPacket->getOptions();
168 packetID.sequenceNumber = ddPacket->getDdSequenceNumber();
170 if ((packetID != neighbor->getLastReceivedDDPacket()) ||
171 (packetID.ddOptions.I_Init))
177 if (!neighbor->retransmitDatabaseDescriptionPacket()) {
Definition: OSPFNeighbor.h:74
Definition: OSPFNeighbor.h:64
Definition: OSPFNeighbor.h:66
Definition: OSPFNeighbor.h:65
void printEvent(const char *eventString, const Interface *onInterface=nullptr, const Neighbor *forNeighbor=nullptr) const
Definition: MessageHandler.cc:377
Router * router
Definition: IMessageHandler.h:35
Definition: OSPFNeighbor.h:63
Definition: OSPFNeighbor.h:44
NeighborStateType
Definition: OSPFNeighbor.h:61
RouterID getRouterID() const
Definition: OSPFRouter.h:72
Definition: OSPFNeighbor.h:50
Definition: OSPFNeighbor.h:45
Definition: OSPFNeighbor.h:68
bool processDDPacket(OSPFDatabaseDescriptionPacket *ddPacket, Interface *intf, Neighbor *neighbor, bool inExchangeStart)
Definition: DatabaseDescriptionHandler.cc:191
Definition: OSPFNeighbor.h:73
Definition: OSPFNeighbor.h:69
MessageHandler * getMessageHandler()
Definition: OSPFRouter.h:77
Definition: OSPFNeighbor.h:67