|
INET Framework for OMNeT++/OMNEST
|
00001 #include "AnsaMessageHandler.h" 00002 #include "AnsaOSPFRouter.h" 00003 00004 00005 00006 AnsaOSPF::MessageHandler::MessageHandler(AnsaOSPF::Router* containingRouter, cSimpleModule* containingModule) : 00007 AnsaOSPF::IMessageHandler(containingRouter), 00008 ospfModule(containingModule), 00009 helloHandler(containingRouter), 00010 ddHandler(containingRouter), 00011 lsRequestHandler(containingRouter), 00012 lsUpdateHandler(containingRouter), 00013 lsAckHandler(containingRouter) 00014 { 00015 } 00016 00017 void AnsaOSPF::MessageHandler::MessageReceived(cMessage* message) 00018 { 00019 if (message->isSelfMessage()) { 00020 HandleTimer(check_and_cast<OSPFTimer*> (message)); 00021 } else { 00022 OSPFPacket* packet = check_and_cast<OSPFPacket*> (message); 00023 EV << "Received packet: (" << packet->getClassName() << ")" << packet->getName() << "\n"; 00024 if (packet->getRouterID() == router->GetRouterID()) { 00025 EV << "This packet is from ourselves, discarding.\n"; 00026 delete message; 00027 } else { 00028 ProcessPacket(packet); 00029 } 00030 } 00031 } 00032 00033 void AnsaOSPF::MessageHandler::HandleTimer(OSPFTimer* timer) 00034 { 00035 switch (timer->getTimerKind()) { 00036 case InterfaceHelloTimer: 00037 { 00038 AnsaOSPF::Interface* intf; 00039 if (! (intf = reinterpret_cast <AnsaOSPF::Interface*> (timer->getContextPointer()))) { 00040 // should not reach this point 00041 EV << "Discarding invalid InterfaceHelloTimer.\n"; 00042 delete timer; 00043 } else { 00044 PrintEvent("Hello Timer expired", intf); 00045 intf->ProcessEvent(AnsaOSPF::Interface::HelloTimer); 00046 } 00047 } 00048 break; 00049 case InterfaceWaitTimer: 00050 { 00051 AnsaOSPF::Interface* intf; 00052 if (! (intf = reinterpret_cast <AnsaOSPF::Interface*> (timer->getContextPointer()))) { 00053 // should not reach this point 00054 EV << "Discarding invalid InterfaceWaitTimer.\n"; 00055 delete timer; 00056 } else { 00057 PrintEvent("Wait Timer expired", intf); 00058 intf->ProcessEvent(AnsaOSPF::Interface::WaitTimer); 00059 } 00060 } 00061 break; 00062 case InterfaceAcknowledgementTimer: 00063 { 00064 AnsaOSPF::Interface* intf; 00065 if (! (intf = reinterpret_cast <AnsaOSPF::Interface*> (timer->getContextPointer()))) { 00066 // should not reach this point 00067 EV << "Discarding invalid InterfaceAcknowledgementTimer.\n"; 00068 delete timer; 00069 } else { 00070 PrintEvent("Acknowledgement Timer expired", intf); 00071 intf->ProcessEvent(AnsaOSPF::Interface::AcknowledgementTimer); 00072 } 00073 } 00074 break; 00075 case NeighborInactivityTimer: 00076 { 00077 AnsaOSPF::Neighbor* neighbor; 00078 if (! (neighbor = reinterpret_cast <AnsaOSPF::Neighbor*> (timer->getContextPointer()))) { 00079 // should not reach this point 00080 EV << "Discarding invalid NeighborInactivityTimer.\n"; 00081 delete timer; 00082 } else { 00083 PrintEvent("Inactivity Timer expired", neighbor->GetInterface(), neighbor); 00084 neighbor->ProcessEvent(AnsaOSPF::Neighbor::InactivityTimer); 00085 } 00086 } 00087 break; 00088 case NeighborPollTimer: 00089 { 00090 AnsaOSPF::Neighbor* neighbor; 00091 if (! (neighbor = reinterpret_cast <AnsaOSPF::Neighbor*> (timer->getContextPointer()))) { 00092 // should not reach this point 00093 EV << "Discarding invalid NeighborInactivityTimer.\n"; 00094 delete timer; 00095 } else { 00096 PrintEvent("Poll Timer expired", neighbor->GetInterface(), neighbor); 00097 neighbor->ProcessEvent(AnsaOSPF::Neighbor::PollTimer); 00098 } 00099 } 00100 break; 00101 case NeighborDDRetransmissionTimer: 00102 { 00103 AnsaOSPF::Neighbor* neighbor; 00104 if (! (neighbor = reinterpret_cast <AnsaOSPF::Neighbor*> (timer->getContextPointer()))) { 00105 // should not reach this point 00106 EV << "Discarding invalid NeighborDDRetransmissionTimer.\n"; 00107 delete timer; 00108 } else { 00109 PrintEvent("Database Description Retransmission Timer expired", neighbor->GetInterface(), neighbor); 00110 neighbor->ProcessEvent(AnsaOSPF::Neighbor::DDRetransmissionTimer); 00111 } 00112 } 00113 break; 00114 case NeighborUpdateRetransmissionTimer: 00115 { 00116 AnsaOSPF::Neighbor* neighbor; 00117 if (! (neighbor = reinterpret_cast <AnsaOSPF::Neighbor*> (timer->getContextPointer()))) { 00118 // should not reach this point 00119 EV << "Discarding invalid NeighborUpdateRetransmissionTimer.\n"; 00120 delete timer; 00121 } else { 00122 PrintEvent("Update Retransmission Timer expired", neighbor->GetInterface(), neighbor); 00123 neighbor->ProcessEvent(AnsaOSPF::Neighbor::UpdateRetransmissionTimer); 00124 } 00125 } 00126 break; 00127 case NeighborRequestRetransmissionTimer: 00128 { 00129 AnsaOSPF::Neighbor* neighbor; 00130 if (! (neighbor = reinterpret_cast <AnsaOSPF::Neighbor*> (timer->getContextPointer()))) { 00131 // should not reach this point 00132 EV << "Discarding invalid NeighborRequestRetransmissionTimer.\n"; 00133 delete timer; 00134 } else { 00135 PrintEvent("Request Retransmission Timer expired", neighbor->GetInterface(), neighbor); 00136 neighbor->ProcessEvent(AnsaOSPF::Neighbor::RequestRetransmissionTimer); 00137 } 00138 } 00139 break; 00140 case DatabaseAgeTimer: 00141 { 00142 PrintEvent("Ageing the database"); 00143 router->AgeDatabase(); 00144 } 00145 break; 00146 default: break; 00147 } 00148 } 00149 00150 void AnsaOSPF::MessageHandler::ProcessPacket(OSPFPacket* packet, AnsaOSPF::Interface* unused1, AnsaOSPF::Neighbor* unused2) 00151 { 00152 // packet version must be OSPF version 2 00153 if (packet->getVersion() == 2) { 00154 IPControlInfo* controlInfo = check_and_cast<IPControlInfo *> (packet->getControlInfo()); 00155 int interfaceId = controlInfo->getInterfaceId(); 00156 AnsaOSPF::AreaID areaID = packet->getAreaID().getInt(); 00157 AnsaOSPF::Area* area = router->GetArea(areaID); 00158 00159 if (area != NULL) { 00160 // packet Area ID must either match the Area ID of the receiving interface or... 00161 AnsaOSPF::Interface* intf = area->GetInterface(interfaceId); 00162 00163 if (intf == NULL) { 00164 // it must be the backbone area and... 00165 if (areaID == BackboneAreaID) { 00166 if (router->GetAreaCount() > 1) { 00167 // it must be a virtual link and the source router's router ID must be the endpoint of this virtual link and... 00168 intf = area->FindVirtualLink(packet->getRouterID().getInt()); 00169 00170 if (intf != NULL) { 00171 AnsaOSPF::Area* virtualLinkTransitArea = router->GetArea(intf->GetTransitAreaID()); 00172 00173 if (virtualLinkTransitArea != NULL) { 00174 // the receiving interface must attach to the virtual link's configured transit area 00175 AnsaOSPF::Interface* virtualLinkInterface = virtualLinkTransitArea->GetInterface(interfaceId); 00176 00177 if (virtualLinkInterface == NULL) { 00178 intf = NULL; 00179 } 00180 } else { 00181 intf = NULL; 00182 } 00183 } 00184 } 00185 } 00186 } 00187 if (intf != NULL) { 00188 unsigned long destinationAddress = controlInfo->getDestAddr().getInt(); 00189 unsigned long allDRouters = ULongFromIPv4Address(AnsaOSPF::AllDRouters); 00190 AnsaOSPF::Interface::InterfaceStateType interfaceState = intf->GetState(); 00191 00192 // if destination address is AllDRouters the receiving interface must be in DesignatedRouter or Backup state 00193 if ( 00194 ((destinationAddress == allDRouters) && 00195 ( 00196 (interfaceState == AnsaOSPF::Interface::DesignatedRouterState) || 00197 (interfaceState == AnsaOSPF::Interface::BackupState) 00198 ) 00199 ) || 00200 (destinationAddress != allDRouters) 00201 ) 00202 { 00203 // packet authentication 00204 if (AuthenticatePacket(packet)) { 00205 OSPFPacketType packetType = static_cast<OSPFPacketType> (packet->getType()); 00206 AnsaOSPF::Neighbor* neighbor = NULL; 00207 00208 // all packets except HelloPackets are sent only along adjacencies, so a Neighbor must exist 00209 if (packetType != HelloPacket) { 00210 switch (intf->GetType()) { 00211 case AnsaOSPF::Interface::Broadcast: 00212 case AnsaOSPF::Interface::NBMA: 00213 case AnsaOSPF::Interface::PointToMultiPoint: 00214 neighbor = intf->GetNeighborByAddress(IPv4AddressFromULong(controlInfo->getSrcAddr().getInt())); 00215 break; 00216 case AnsaOSPF::Interface::PointToPoint: 00217 case AnsaOSPF::Interface::Virtual: 00218 neighbor = intf->GetNeighborByID(packet->getRouterID().getInt()); 00219 break; 00220 default: break; 00221 } 00222 } 00223 switch (packetType) { 00224 case HelloPacket: 00225 helloHandler.ProcessPacket(packet, intf); 00226 router->stat.AddHelloPacketReceived(); 00227 router->stat.AddOspfPacketReceived(); 00228 break; 00229 case DatabaseDescriptionPacket: 00230 if (neighbor != NULL) { 00231 ddHandler.ProcessPacket(packet, intf, neighbor); 00232 router->stat.AddOspfPacketReceived(); 00233 } 00234 break; 00235 case LinkStateRequestPacket: 00236 if (neighbor != NULL) { 00237 lsRequestHandler.ProcessPacket(packet, intf, neighbor); 00238 router->stat.AddOspfPacketReceived(); 00239 } 00240 break; 00241 case LinkStateUpdatePacket: 00242 if (neighbor != NULL) { 00243 lsUpdateHandler.ProcessPacket(packet, intf, neighbor); 00244 router->stat.AddOspfPacketReceived(); 00245 } 00246 break; 00247 case LinkStateAcknowledgementPacket: 00248 if (neighbor != NULL) { 00249 lsAckHandler.ProcessPacket(packet, intf, neighbor); 00250 router->stat.AddOspfPacketReceived(); 00251 } 00252 break; 00253 default: break; 00254 } 00255 } 00256 } 00257 } 00258 } 00259 } 00260 delete packet; 00261 } 00262 00263 void AnsaOSPF::MessageHandler::SendPacket(OSPFPacket* packet, IPv4Address destination, int outputIfIndex, short ttl) 00264 { 00265 IPControlInfo *ipControlInfo = new IPControlInfo(); 00266 ipControlInfo->setProtocol(IP_PROT_OSPF); 00267 ipControlInfo->setDestAddr(ULongFromIPv4Address(destination)); 00268 ipControlInfo->setTimeToLive(ttl); 00269 ipControlInfo->setInterfaceId(outputIfIndex); 00270 00271 packet->setControlInfo(ipControlInfo); 00272 switch (packet->getType()) { 00273 case HelloPacket: 00274 { 00275 packet->setKind(HelloPacket); 00276 packet->setName("OSPF_HelloPacket"); 00277 00278 OSPFHelloPacket* helloPacket = check_and_cast<OSPFHelloPacket*> (packet); 00279 PrintHelloPacket(helloPacket, destination, outputIfIndex); 00280 00281 router->stat.AddHelloPacketSend(); 00282 } 00283 break; 00284 case DatabaseDescriptionPacket: 00285 { 00286 packet->setKind(DatabaseDescriptionPacket); 00287 packet->setName("OSPF_DDPacket"); 00288 00289 OSPFDatabaseDescriptionPacket* ddPacket = check_and_cast<OSPFDatabaseDescriptionPacket*> (packet); 00290 PrintDatabaseDescriptionPacket(ddPacket, destination, outputIfIndex); 00291 } 00292 break; 00293 case LinkStateRequestPacket: 00294 { 00295 packet->setKind(LinkStateRequestPacket); 00296 packet->setName("OSPF_LSReqPacket"); 00297 00298 OSPFLinkStateRequestPacket* requestPacket = check_and_cast<OSPFLinkStateRequestPacket*> (packet); 00299 PrintLinkStateRequestPacket(requestPacket, destination, outputIfIndex); 00300 } 00301 break; 00302 case LinkStateUpdatePacket: 00303 { 00304 packet->setKind(LinkStateUpdatePacket); 00305 packet->setName("OSPF_LSUpdPacket"); 00306 00307 OSPFLinkStateUpdatePacket* updatePacket = check_and_cast<OSPFLinkStateUpdatePacket*> (packet); 00308 PrintLinkStateUpdatePacket(updatePacket, destination, outputIfIndex); 00309 } 00310 break; 00311 case LinkStateAcknowledgementPacket: 00312 { 00313 packet->setKind(LinkStateAcknowledgementPacket); 00314 packet->setName("OSPF_LSAckPacket"); 00315 00316 OSPFLinkStateAcknowledgementPacket* ackPacket = check_and_cast<OSPFLinkStateAcknowledgementPacket*> (packet); 00317 PrintLinkStateAcknowledgementPacket(ackPacket, destination, outputIfIndex); 00318 } 00319 break; 00320 default: break; 00321 } 00322 00323 ospfModule->send(packet,"ipOut"); 00324 router->stat.AddOspfPacketSend(); 00325 } 00326 00327 void AnsaOSPF::MessageHandler::ClearTimer(OSPFTimer* timer) 00328 { 00329 ospfModule->cancelEvent(timer); 00330 } 00331 00332 void AnsaOSPF::MessageHandler::StartTimer(OSPFTimer* timer, simtime_t delay) 00333 { 00334 ospfModule->scheduleAt(simTime() + delay, timer); 00335 } 00336 00337 void AnsaOSPF::MessageHandler::PrintEvent(const char* eventString, const AnsaOSPF::Interface* onInterface, const AnsaOSPF::Neighbor* forNeighbor /*= NULL*/) const 00338 { 00339 EV << eventString; 00340 if ((onInterface != NULL) || (forNeighbor != NULL)) { 00341 EV << ": "; 00342 } 00343 if (forNeighbor != NULL) { 00344 char addressString[16]; 00345 EV << "neighbor[" 00346 << AddressStringFromULong(addressString, sizeof(addressString), forNeighbor->GetNeighborID()) 00347 << "] (state: " 00348 << forNeighbor->GetStateString(forNeighbor->GetState()) 00349 << "); "; 00350 } 00351 if (onInterface != NULL) { 00352 EV << "interface[" 00353 << static_cast <short> (onInterface->GetIfIndex()) 00354 << "] "; 00355 switch (onInterface->GetType()) { 00356 case AnsaOSPF::Interface::PointToPoint: EV << "(PointToPoint)"; 00357 break; 00358 case AnsaOSPF::Interface::Broadcast: EV << "(Broadcast)"; 00359 break; 00360 case AnsaOSPF::Interface::NBMA: EV << "(NBMA).\n"; 00361 break; 00362 case AnsaOSPF::Interface::PointToMultiPoint: EV << "(PointToMultiPoint)"; 00363 break; 00364 case AnsaOSPF::Interface::Virtual: EV << "(Virtual)"; 00365 break; 00366 default: EV << "(Unknown)"; 00367 } 00368 EV << " (state: " 00369 << onInterface->GetStateString(onInterface->GetState()) 00370 << ")"; 00371 } 00372 EV << ".\n"; 00373 } 00374 00375 void AnsaOSPF::MessageHandler::PrintHelloPacket(const OSPFHelloPacket* helloPacket, IPv4Address destination, int outputIfIndex) const 00376 { 00377 char addressString[16]; 00378 EV << "Sending Hello packet to " 00379 << AddressStringFromIPv4Address(addressString, sizeof(addressString), destination) 00380 << " on interface[" 00381 << outputIfIndex 00382 << "] with contents:\n"; 00383 EV << " netMask=" 00384 << AddressStringFromULong(addressString, sizeof(addressString), helloPacket->getNetworkMask().getInt()) 00385 << "\n"; 00386 EV << " DR=" 00387 << AddressStringFromULong(addressString, sizeof(addressString), helloPacket->getDesignatedRouter().getInt()) 00388 << "\n"; 00389 EV << " BDR=" 00390 << AddressStringFromULong(addressString, sizeof(addressString), helloPacket->getBackupDesignatedRouter().getInt()) 00391 << "\n"; 00392 EV << " neighbors:\n"; 00393 00394 unsigned int neighborCount = helloPacket->getNeighborArraySize(); 00395 for (unsigned int i = 0; i < neighborCount; i++) { 00396 EV << " " 00397 << AddressStringFromULong(addressString, sizeof(addressString), helloPacket->getNeighbor(i).getInt()) 00398 << "\n"; 00399 } 00400 } 00401 00402 void AnsaOSPF::MessageHandler::PrintDatabaseDescriptionPacket(const OSPFDatabaseDescriptionPacket* ddPacket, IPv4Address destination, int outputIfIndex) const 00403 { 00404 char addressString[16]; 00405 EV << "Sending Database Description packet to " 00406 << AddressStringFromIPv4Address(addressString, sizeof(addressString), destination) 00407 << " on interface[" 00408 << outputIfIndex 00409 << "] with contents:\n"; 00410 00411 const OSPFDDOptions& ddOptions = ddPacket->getDdOptions(); 00412 EV << " ddOptions=" 00413 << ((ddOptions.I_Init) ? "I " : "_ ") 00414 << ((ddOptions.M_More) ? "M " : "_ ") 00415 << ((ddOptions.MS_MasterSlave) ? "MS" : "__") 00416 << "\n"; 00417 EV << " seqNumber=" 00418 << ddPacket->getDdSequenceNumber() 00419 << "\n"; 00420 EV << " LSA headers:\n"; 00421 00422 unsigned int lsaCount = ddPacket->getLsaHeadersArraySize(); 00423 for (unsigned int i = 0; i < lsaCount; i++) { 00424 EV << " "; 00425 PrintLSAHeader(ddPacket->getLsaHeaders(i), ev.getOStream()); 00426 EV << "\n"; 00427 } 00428 } 00429 00430 void AnsaOSPF::MessageHandler::PrintLinkStateRequestPacket(const OSPFLinkStateRequestPacket* requestPacket, IPv4Address destination, int outputIfIndex) const 00431 { 00432 char addressString[16]; 00433 EV << "Sending Link State Request packet to " 00434 << AddressStringFromIPv4Address(addressString, sizeof(addressString), destination) 00435 << " on interface[" 00436 << outputIfIndex 00437 << "] with requests:\n"; 00438 00439 unsigned int requestCount = requestPacket->getRequestsArraySize(); 00440 for (unsigned int i = 0; i < requestCount; i++) { 00441 const LSARequest& request = requestPacket->getRequests(i); 00442 EV << " type=" 00443 << request.lsType 00444 << ", LSID=" 00445 << AddressStringFromULong(addressString, sizeof(addressString), request.linkStateID); 00446 EV << ", advertisingRouter=" 00447 << AddressStringFromULong(addressString, sizeof(addressString), request.advertisingRouter.getInt()) 00448 << "\n"; 00449 } 00450 } 00451 00452 void AnsaOSPF::MessageHandler::PrintLinkStateUpdatePacket(const OSPFLinkStateUpdatePacket* updatePacket, IPv4Address destination, int outputIfIndex) const 00453 { 00454 char addressString[16]; 00455 EV << "Sending Link State Update packet to " 00456 << AddressStringFromIPv4Address(addressString, sizeof(addressString), destination) 00457 << " on interface[" 00458 << outputIfIndex 00459 << "] with updates:\n"; 00460 00461 unsigned int i = 0; 00462 unsigned int updateCount = updatePacket->getRouterLSAsArraySize(); 00463 00464 for (i = 0; i < updateCount; i++) { 00465 const OSPFRouterLSA& lsa = updatePacket->getRouterLSAs(i); 00466 EV << " "; 00467 PrintLSAHeader(lsa.getHeader(), ev.getOStream()); 00468 EV << "\n"; 00469 00470 EV << " bits=" 00471 << ((lsa.getV_VirtualLinkEndpoint()) ? "V " : "_ ") 00472 << ((lsa.getE_ASBoundaryRouter()) ? "E " : "_ ") 00473 << ((lsa.getB_AreaBorderRouter()) ? "B" : "_") 00474 << "\n"; 00475 EV << " links:\n"; 00476 00477 unsigned int linkCount = lsa.getLinksArraySize(); 00478 for (unsigned int j = 0; j < linkCount; j++) { 00479 const Link& link = lsa.getLinks(j); 00480 EV << " ID=" 00481 << AddressStringFromULong(addressString, sizeof(addressString), link.getLinkID().getInt()) 00482 << ","; 00483 EV << " data=" 00484 << AddressStringFromULong(addressString, sizeof(addressString), link.getLinkData()) 00485 << ", type="; 00486 switch (link.getType()) { 00487 case PointToPointLink: EV << "PointToPoint"; break; 00488 case TransitLink: EV << "Transit"; break; 00489 case StubLink: EV << "Stub"; break; 00490 case VirtualLink: EV << "Virtual"; break; 00491 default: EV << "Unknown"; break; 00492 } 00493 EV << ", cost=" 00494 << link.getLinkCost() 00495 << "\n"; 00496 } 00497 } 00498 00499 updateCount = updatePacket->getNetworkLSAsArraySize(); 00500 for (i = 0; i < updateCount; i++) { 00501 const OSPFNetworkLSA& lsa = updatePacket->getNetworkLSAs(i); 00502 EV << " "; 00503 PrintLSAHeader(lsa.getHeader(), ev.getOStream()); 00504 EV << "\n"; 00505 00506 EV << " netMask=" 00507 << AddressStringFromULong(addressString, sizeof(addressString), lsa.getNetworkMask().getInt()) 00508 << "\n"; 00509 EV << " attachedRouters:\n"; 00510 00511 unsigned int routerCount = lsa.getAttachedRoutersArraySize(); 00512 for (unsigned int j = 0; j < routerCount; j++) { 00513 EV << " " 00514 << AddressStringFromULong(addressString, sizeof(addressString), lsa.getAttachedRouters(j).getInt()) 00515 << "\n"; 00516 } 00517 } 00518 00519 updateCount = updatePacket->getSummaryLSAsArraySize(); 00520 for (i = 0; i < updateCount; i++) { 00521 const OSPFSummaryLSA& lsa = updatePacket->getSummaryLSAs(i); 00522 EV << " "; 00523 PrintLSAHeader(lsa.getHeader(), ev.getOStream()); 00524 EV << "\n"; 00525 00526 EV << " netMask=" 00527 << AddressStringFromULong(addressString, sizeof(addressString), lsa.getNetworkMask().getInt()) 00528 << "\n"; 00529 EV << " cost=" 00530 << lsa.getRouteCost() 00531 << "\n"; 00532 } 00533 00534 updateCount = updatePacket->getAsExternalLSAsArraySize(); 00535 for (i = 0; i < updateCount; i++) { 00536 const OSPFASExternalLSA& lsa = updatePacket->getAsExternalLSAs(i); 00537 EV << " "; 00538 PrintLSAHeader(lsa.getHeader(), ev.getOStream()); 00539 EV << "\n"; 00540 00541 const OSPFASExternalLSAContents& contents = lsa.getContents(); 00542 EV << " netMask=" 00543 << AddressStringFromULong(addressString, sizeof(addressString), contents.getNetworkMask().getInt()) 00544 << "\n"; 00545 EV << " bits=" 00546 << ((contents.getE_ExternalMetricType()) ? "E\n" : "_\n"); 00547 EV << " cost=" 00548 << contents.getRouteCost() 00549 << "\n"; 00550 EV << " forward=" 00551 << AddressStringFromULong(addressString, sizeof(addressString), contents.getForwardingAddress().getInt()) 00552 << "\n"; 00553 } 00554 } 00555 00556 void AnsaOSPF::MessageHandler::PrintLinkStateAcknowledgementPacket(const OSPFLinkStateAcknowledgementPacket* ackPacket, IPv4Address destination, int outputIfIndex) const 00557 { 00558 char addressString[16]; 00559 EV << "Sending Link State Acknowledgement packet to " 00560 << AddressStringFromIPv4Address(addressString, sizeof(addressString), destination) 00561 << " on interface[" 00562 << outputIfIndex 00563 << "] with acknowledgements:\n"; 00564 00565 unsigned int lsaCount = ackPacket->getLsaHeadersArraySize(); 00566 for (unsigned int i = 0; i < lsaCount; i++) { 00567 EV << " "; 00568 PrintLSAHeader(ackPacket->getLsaHeaders(i), ev.getOStream()); 00569 EV << "\n"; 00570 } 00571 } 00572