INET Framework for OMNeT++/OMNEST
inet::ospfv2::MessageHandler Class Reference

#include <MessageHandler.h>

Inheritance diagram for inet::ospfv2::MessageHandler:
inet::ospfv2::IMessageHandler

Public Member Functions

 MessageHandler (Router *containingRouter, cSimpleModule *containingModule)
 
void messageReceived (cMessage *message)
 
void handleTimer (cMessage *timer)
 
void processPacket (Packet *packet, Ospfv2Interface *unused1=nullptr, Neighbor *unused2=nullptr) override
 
void sendPacket (Packet *packet, Ipv4Address destination, Ospfv2Interface *outputIf, short ttl=1)
 
void clearTimer (cMessage *timer)
 
void startTimer (cMessage *timer, simtime_t delay)
 
void printEvent (const char *eventString, const Ospfv2Interface *onInterface=nullptr, const Neighbor *forNeighbor=nullptr) const
 
void printHelloPacket (const Ospfv2HelloPacket *helloPacket, Ipv4Address destination, int outputIfIndex) const
 
void printDatabaseDescriptionPacket (const Ospfv2DatabaseDescriptionPacket *ddPacket, Ipv4Address destination, int outputIfIndex) const
 
void printLinkStateRequestPacket (const Ospfv2LinkStateRequestPacket *requestPacket, Ipv4Address destination, int outputIfIndex) const
 
void printLinkStateUpdatePacket (const Ospfv2LinkStateUpdatePacket *updatePacket, Ipv4Address destination, int outputIfIndex) const
 
void printLinkStateAcknowledgementPacket (const Ospfv2LinkStateAcknowledgementPacket *ackPacket, Ipv4Address destination, int outputIfIndex) const
 
bool authenticatePacket (const Ospfv2Packet *packet)
 
- Public Member Functions inherited from inet::ospfv2::IMessageHandler
 IMessageHandler (Router *containingRouter)
 
virtual ~IMessageHandler ()
 

Private Attributes

cSimpleModule * ospfModule
 
HelloHandler helloHandler
 
DatabaseDescriptionHandler ddHandler
 
LinkStateRequestHandler lsRequestHandler
 
LinkStateUpdateHandler lsUpdateHandler
 
LinkStateAcknowledgementHandler lsAckHandler
 

Additional Inherited Members

- Protected Attributes inherited from inet::ospfv2::IMessageHandler
Routerrouter
 

Constructor & Destructor Documentation

◆ MessageHandler()

inet::ospfv2::MessageHandler::MessageHandler ( Router containingRouter,
cSimpleModule *  containingModule 
)
22  :
23  IMessageHandler(containingRouter),
24  ospfModule(containingModule),
25  helloHandler(containingRouter),
26  ddHandler(containingRouter),
27  lsRequestHandler(containingRouter),
28  lsUpdateHandler(containingRouter),
29  lsAckHandler(containingRouter)
30 {
31 }

Member Function Documentation

◆ authenticatePacket()

bool inet::ospfv2::MessageHandler::authenticatePacket ( const Ospfv2Packet packet)
inline
52 { return true; }

Referenced by processPacket().

◆ clearTimer()

◆ handleTimer()

void inet::ospfv2::MessageHandler::handleTimer ( cMessage *  timer)
52 {
53  switch (timer->getKind()) {
54  case INTERFACE_HELLO_TIMER: {
55  Ospfv2Interface *intf;
56  if (!(intf = reinterpret_cast<Ospfv2Interface *>(timer->getContextPointer()))) {
57  // should not reach this point
58  EV_INFO << "Discarding invalid InterfaceHelloTimer.\n";
59  delete timer;
60  }
61  else {
62  printEvent("Hello Timer expired", intf);
63  intf->processEvent(Ospfv2Interface::HELLO_TIMER);
64  }
65  }
66  break;
67 
68  case INTERFACE_WAIT_TIMER: {
69  Ospfv2Interface *intf;
70  if (!(intf = reinterpret_cast<Ospfv2Interface *>(timer->getContextPointer()))) {
71  // should not reach this point
72  EV_INFO << "Discarding invalid InterfaceWaitTimer.\n";
73  delete timer;
74  }
75  else {
76  printEvent("Wait Timer expired", intf);
77  intf->processEvent(Ospfv2Interface::WAIT_TIMER);
78  }
79  }
80  break;
81 
83  Ospfv2Interface *intf;
84  if (!(intf = reinterpret_cast<Ospfv2Interface *>(timer->getContextPointer()))) {
85  // should not reach this point
86  EV_INFO << "Discarding invalid InterfaceAcknowledgementTimer.\n";
87  delete timer;
88  }
89  else {
90  printEvent("Acknowledgement Timer expired", intf);
91  intf->processEvent(Ospfv2Interface::ACKNOWLEDGEMENT_TIMER);
92  }
93  }
94  break;
95 
97  Neighbor *neighbor;
98  if (!(neighbor = reinterpret_cast<Neighbor *>(timer->getContextPointer()))) {
99  // should not reach this point
100  EV_INFO << "Discarding invalid NeighborInactivityTimer.\n";
101  delete timer;
102  }
103  else {
104  printEvent("Inactivity Timer expired", neighbor->getInterface(), neighbor);
105  neighbor->processEvent(Neighbor::INACTIVITY_TIMER);
106  }
107  }
108  break;
109 
110  case NEIGHBOR_POLL_TIMER: {
111  Neighbor *neighbor;
112  if (!(neighbor = reinterpret_cast<Neighbor *>(timer->getContextPointer()))) {
113  // should not reach this point
114  EV_INFO << "Discarding invalid NeighborInactivityTimer.\n";
115  delete timer;
116  }
117  else {
118  printEvent("Poll Timer expired", neighbor->getInterface(), neighbor);
119  neighbor->processEvent(Neighbor::POLL_TIMER);
120  }
121  }
122  break;
123 
125  Neighbor *neighbor;
126  if (!(neighbor = reinterpret_cast<Neighbor *>(timer->getContextPointer()))) {
127  // should not reach this point
128  EV_INFO << "Discarding invalid NeighborDDRetransmissionTimer.\n";
129  delete timer;
130  }
131  else {
132  printEvent("Database Description Retransmission Timer expired", neighbor->getInterface(), neighbor);
133  neighbor->processEvent(Neighbor::DD_RETRANSMISSION_TIMER);
134  }
135  }
136  break;
137 
139  Neighbor *neighbor;
140  if (!(neighbor = reinterpret_cast<Neighbor *>(timer->getContextPointer()))) {
141  // should not reach this point
142  EV_INFO << "Discarding invalid NeighborUpdateRetransmissionTimer.\n";
143  delete timer;
144  }
145  else {
146  printEvent("Update Retransmission Timer expired", neighbor->getInterface(), neighbor);
147  neighbor->processEvent(Neighbor::UPDATE_RETRANSMISSION_TIMER);
148  }
149  }
150  break;
151 
153  Neighbor *neighbor;
154  if (!(neighbor = reinterpret_cast<Neighbor *>(timer->getContextPointer()))) {
155  // should not reach this point
156  EV_INFO << "Discarding invalid NeighborRequestRetransmissionTimer.\n";
157  delete timer;
158  }
159  else {
160  printEvent("Request Retransmission Timer expired", neighbor->getInterface(), neighbor);
161  neighbor->processEvent(Neighbor::REQUEST_RETRANSMISSION_TIMER);
162  }
163  }
164  break;
165 
166  case DATABASE_AGE_TIMER: {
167  printEvent("Ageing the database");
168  router->ageDatabase();
169  }
170  break;
171 
172  default:
173  break;
174  }
175 }

Referenced by messageReceived().

◆ messageReceived()

void inet::ospfv2::MessageHandler::messageReceived ( cMessage *  message)
34 {
35  if (message->isSelfMessage()) {
36  handleTimer(message);
37  }
38  else {
39  Packet *pk = check_and_cast<Packet *>(message);
40  auto protocol = pk->getTag<PacketProtocolTag>()->getProtocol();
41  if (protocol == &Protocol::icmpv4) {
42  EV_ERROR << "ICMP error received -- discarding\n";
43  delete message;
44  }
45  else if (protocol == &Protocol::ospf) {
46  processPacket(pk);
47  }
48  }
49 }

Referenced by inet::ospfv2::Ospfv2::handleMessageWhenUp().

◆ printDatabaseDescriptionPacket()

void inet::ospfv2::MessageHandler::printDatabaseDescriptionPacket ( const Ospfv2DatabaseDescriptionPacket ddPacket,
Ipv4Address  destination,
int  outputIfIndex 
) const
445 {
446  EV_INFO << "Sending Database Description packet to " << destination << " on interface[" << outputIfIndex << "] with contents:\n";
447 
448  const Ospfv2DdOptions& ddOptions = ddPacket->getDdOptions();
449  EV_INFO << " ddOptions="
450  << ((ddOptions.I_Init) ? "I " : "_ ")
451  << ((ddOptions.M_More) ? "M " : "_ ")
452  << ((ddOptions.MS_MasterSlave) ? "MS" : "__")
453  << "\n";
454  EV_INFO << " seqNumber=" << ddPacket->getDdSequenceNumber() << "\n";
455  EV_DETAIL << " LSA headers:\n";
456 
457  unsigned int lsaCount = ddPacket->getLsaHeadersArraySize();
458  for (unsigned int i = 0; i < lsaCount; i++) {
459  EV_DETAIL << " " << ddPacket->getLsaHeaders(i) << "\n";
460  }
461 }

Referenced by sendPacket().

◆ printEvent()

void inet::ospfv2::MessageHandler::printEvent ( const char *  eventString,
const Ospfv2Interface onInterface = nullptr,
const Neighbor forNeighbor = nullptr 
) const
381 {
382  EV_DETAIL << eventString;
383  if ((onInterface != nullptr) || (forNeighbor != nullptr)) {
384  EV_DETAIL << ": ";
385  }
386  if (forNeighbor != nullptr) {
387  EV_DETAIL << "neighbor["
388  << forNeighbor->getNeighborID()
389  << "] (state: "
390  << forNeighbor->getStateString(forNeighbor->getState())
391  << "); ";
392  }
393  if (onInterface != nullptr) {
394  EV_DETAIL << "interface["
395  << static_cast<short>(onInterface->getIfIndex())
396  << "] ";
397  switch (onInterface->getType()) {
399  EV_DETAIL << "(PointToPoint)";
400  break;
401 
403  EV_DETAIL << "(Broadcast)";
404  break;
405 
407  EV_DETAIL << "(NBMA).\n";
408  break;
409 
411  EV_DETAIL << "(PointToMultiPoint)";
412  break;
413 
415  EV_DETAIL << "(Virtual)";
416  break;
417 
418  default:
419  EV_DETAIL << "(Unknown)";
420  break;
421  }
422  EV_DETAIL << " (state: "
423  << onInterface->getStateString(onInterface->getState())
424  << ")";
425  }
426  EV_DETAIL << ".\n";
427 }

Referenced by handleTimer(), inet::ospfv2::LinkStateAcknowledgementHandler::processPacket(), inet::ospfv2::LinkStateRequestHandler::processPacket(), inet::ospfv2::HelloHandler::processPacket(), inet::ospfv2::DatabaseDescriptionHandler::processPacket(), and inet::ospfv2::LinkStateUpdateHandler::processPacket().

◆ printHelloPacket()

void inet::ospfv2::MessageHandler::printHelloPacket ( const Ospfv2HelloPacket helloPacket,
Ipv4Address  destination,
int  outputIfIndex 
) const
430 {
431  EV_INFO << "Sending Hello packet to " << destination << " on interface[" << outputIfIndex << "] with contents:\n";
432  EV_INFO << " netMask=" << helloPacket->getNetworkMask() << "\n";
433  EV_INFO << " DR=" << helloPacket->getDesignatedRouter() << "\n";
434  EV_INFO << " BDR=" << helloPacket->getBackupDesignatedRouter() << "\n";
435 
436  EV_DETAIL << " neighbors:\n";
437 
438  unsigned int neighborCount = helloPacket->getNeighborArraySize();
439  for (unsigned int i = 0; i < neighborCount; i++) {
440  EV_DETAIL << " " << helloPacket->getNeighbor(i) << "\n";
441  }
442 }

Referenced by sendPacket().

◆ printLinkStateAcknowledgementPacket()

void inet::ospfv2::MessageHandler::printLinkStateAcknowledgementPacket ( const Ospfv2LinkStateAcknowledgementPacket ackPacket,
Ipv4Address  destination,
int  outputIfIndex 
) const
568 {
569  EV_INFO << "Sending Link State Acknowledgement packet to " << destination << " on interface[" << outputIfIndex << "] with acknowledgements:\n";
570 
571  unsigned int lsaCount = ackPacket->getLsaHeadersArraySize();
572  for (unsigned int i = 0; i < lsaCount; i++) {
573  EV_DETAIL << " " << ackPacket->getLsaHeaders(i) << "\n";
574  }
575 }

Referenced by sendPacket().

◆ printLinkStateRequestPacket()

void inet::ospfv2::MessageHandler::printLinkStateRequestPacket ( const Ospfv2LinkStateRequestPacket requestPacket,
Ipv4Address  destination,
int  outputIfIndex 
) const
464 {
465  EV_INFO << "Sending Link State Request packet to " << destination << " on interface[" << outputIfIndex << "] with requests:\n";
466 
467  unsigned int requestCount = requestPacket->getRequestsArraySize();
468  for (unsigned int i = 0; i < requestCount; i++) {
469  EV_DETAIL << " " << requestPacket->getRequests(i) << "\n";
470  }
471 }

Referenced by sendPacket().

◆ printLinkStateUpdatePacket()

void inet::ospfv2::MessageHandler::printLinkStateUpdatePacket ( const Ospfv2LinkStateUpdatePacket updatePacket,
Ipv4Address  destination,
int  outputIfIndex 
) const
474 {
475  EV_INFO << "Sending Link State Update packet to " << destination << " on interface[" << outputIfIndex << "] with updates:\n";
476 
477  unsigned int i = 0;
478  unsigned int updateCount = updatePacket->getOspfLSAsArraySize();
479 
480  for (i = 0; i < updateCount; i++) {
481  const Ospfv2Lsa *ospfLsa = updatePacket->getOspfLSAs(i);
482  EV_DETAIL << " " << ospfLsa->getHeader() << "\n";
483 
484  switch (ospfLsa->getHeader().getLsType()) {
486  const Ospfv2RouterLsa& lsa = *check_and_cast<const Ospfv2RouterLsa *>(ospfLsa);
487  EV_DETAIL << " bits="
488  << ((lsa.getV_VirtualLinkEndpoint()) ? "V " : "_ ")
489  << ((lsa.getE_ASBoundaryRouter()) ? "E " : "_ ")
490  << ((lsa.getB_AreaBorderRouter()) ? "B" : "_")
491  << "\n";
492  EV_DETAIL << " links:\n";
493 
494  unsigned int linkCount = lsa.getLinksArraySize();
495  for (unsigned int j = 0; j < linkCount; j++) {
496  const auto& link = lsa.getLinks(j);
497  EV_DETAIL << " ID=" << link.getLinkID();
498  EV_DETAIL << ", data="
499  << link.getLinkData() << " (" << Ipv4Address(link.getLinkData()) << ")"
500  << ", type=";
501  switch (link.getType()) {
502  case POINTTOPOINT_LINK:
503  EV_INFO << "PointToPoint";
504  break;
505 
506  case TRANSIT_LINK:
507  EV_INFO << "Transit";
508  break;
509 
510  case STUB_LINK:
511  EV_INFO << "Stub";
512  break;
513 
514  case VIRTUAL_LINK:
515  EV_INFO << "Virtual";
516  break;
517 
518  default:
519  EV_INFO << "Unknown";
520  break;
521  }
522  EV_DETAIL << ", cost=" << link.getLinkCost() << "\n";
523  }
524  break;
525  }
527  const Ospfv2NetworkLsa& lsa = *check_and_cast<const Ospfv2NetworkLsa *>(ospfLsa);
528  EV_DETAIL << " netMask=" << lsa.getNetworkMask() << "\n";
529  EV_DETAIL << " attachedRouters:\n";
530 
531  unsigned int routerCount = lsa.getAttachedRoutersArraySize();
532  for (unsigned int j = 0; j < routerCount; j++) {
533  EV_DETAIL << " " << lsa.getAttachedRouters(j) << "\n";
534  }
535  break;
536  }
539  const Ospfv2SummaryLsa& lsa = *check_and_cast<const Ospfv2SummaryLsa *>(ospfLsa);
540  EV_DETAIL << " netMask=" << lsa.getNetworkMask() << "\n";
541  EV_DETAIL << " cost=" << lsa.getRouteCost() << "\n";
542  break;
543  }
545  const Ospfv2AsExternalLsa& lsa = *check_and_cast<const Ospfv2AsExternalLsa *>(ospfLsa);
546 
547  const Ospfv2AsExternalLsaContents& contents = lsa.getContents();
548  EV_DETAIL << " netMask=" << contents.getNetworkMask() << "\n";
549  unsigned int tosCount = contents.getExternalTOSInfoArraySize();
550  for (unsigned int j = 0; j < tosCount; j++) {
551  EV_DETAIL << " " << j << ": "
552  << " bits=" << ((contents.getExternalTOSInfo(j).E_ExternalMetricType) ? "E" : "_")
553  << " tos=" << contents.getExternalTOSInfo(j).tos
554  << " cost=" << contents.getExternalTOSInfo(j).routeCost
555  << " forward=" << contents.getExternalTOSInfo(j).forwardingAddress
556  << " routeTag=" << contents.getExternalTOSInfo(j).externalRouteTag
557  << "\n";
558  }
559  break;
560  }
561  default:
562  break;
563  }
564  }
565 }

Referenced by sendPacket().

◆ processPacket()

void inet::ospfv2::MessageHandler::processPacket ( Packet packet,
Ospfv2Interface unused1 = nullptr,
Neighbor unused2 = nullptr 
)
overridevirtual

Implements inet::ospfv2::IMessageHandler.

178 {
179  const auto& packet = pk->peekAtFront<Ospfv2Packet>();
180  EV_INFO << "Received packet: (" << packet.get()->getClassName() << ")" << pk->getName() << "\n";
181  if (packet->getRouterID() == Ipv4Address(router->getRouterID())) {
182  EV_INFO << "This packet is from ourselves, discarding.\n";
183  delete pk;
184  return;
185  }
186  // see RFC 2328 8.2
187 
188  // packet version must be OSPF version 2
189  if (packet->getVersion() == 2) {
190  int interfaceId = pk->getTag<InterfaceInd>()->getInterfaceId();
191  AreaId areaID = packet->getAreaID();
192  Ospfv2Area *area = router->getAreaByID(areaID);
193 
194  if (area != nullptr) {
195  // packet Area ID must either match the Area ID of the receiving interface or...
196  Ospfv2Interface *intf = area->getInterface(interfaceId);
197 
198  if (intf == nullptr) {
199  // it must be the backbone area and...
200  if (areaID == BACKBONE_AREAID) {
201  if (router->getAreaCount() > 1) {
202  // it must be a virtual link and the source router's router ID must be the endpoint of this virtual link and...
203  intf = area->findVirtualLink(packet->getRouterID());
204 
205  if (intf != nullptr) {
206  Ospfv2Area *virtualLinkTransitArea = router->getAreaByID(intf->getTransitAreaId());
207 
208  if (virtualLinkTransitArea != nullptr) {
209  // the receiving interface must attach to the virtual link's configured transit area
210  Ospfv2Interface *virtualLinkInterface = virtualLinkTransitArea->getInterface(interfaceId);
211 
212  if (virtualLinkInterface == nullptr) {
213  intf = nullptr;
214  }
215  }
216  else {
217  intf = nullptr;
218  }
219  }
220  }
221  }
222  }
223  if (intf != nullptr) {
224  Ipv4Address sourceAddress = pk->getTag<L3AddressInd>()->getSrcAddress().toIpv4();
225  Ipv4Address destinationAddress = pk->getTag<L3AddressInd>()->getDestAddress().toIpv4();
226  Ipv4Address allDRouters = Ipv4Address::ALL_OSPF_DESIGNATED_ROUTERS_MCAST;
227  Ospfv2Interface::Ospfv2InterfaceStateType interfaceState = intf->getState();
228 
229  // if destination address is ALL_D_ROUTERS the receiving interface must be in DesignatedRouter or Backup state
230  if (
231  ((destinationAddress == allDRouters) &&
232  (
233  (interfaceState == Ospfv2Interface::DESIGNATED_ROUTER_STATE) ||
234  (interfaceState == Ospfv2Interface::BACKUP_STATE)
235  )
236  ) ||
237  (destinationAddress != allDRouters)
238  )
239  {
240  // packet authentication
241  if (authenticatePacket(packet.get())) {
242  OspfPacketType packetType = static_cast<OspfPacketType>(packet->getType());
243  Neighbor *neighbor = nullptr;
244 
245  // all packets except HelloPackets are sent only along adjacencies, so a Neighbor must exist
246  if (packetType != HELLO_PACKET) {
247  switch (intf->getType()) {
251  neighbor = intf->getNeighborByAddress(sourceAddress);
252  break;
253 
256  neighbor = intf->getNeighborById(packet->getRouterID());
257  break;
258 
259  default:
260  break;
261  }
262  }
263  switch (packetType) {
264  case HELLO_PACKET:
265  helloHandler.processPacket(pk, intf);
266  break;
267 
269  if (neighbor != nullptr) {
270  ddHandler.processPacket(pk, intf, neighbor);
271  }
272  break;
273 
275  if (neighbor != nullptr) {
276  lsRequestHandler.processPacket(pk, intf, neighbor);
277  }
278  break;
279 
281  if (neighbor != nullptr) {
282  lsUpdateHandler.processPacket(pk, intf, neighbor);
283  }
284  break;
285 
287  if (neighbor != nullptr) {
288  lsAckHandler.processPacket(pk, intf, neighbor);
289  }
290  break;
291 
292  default:
293  break;
294  }
295  }
296  }
297  }
298  }
299  }
300  delete pk;
301 }

Referenced by messageReceived().

◆ sendPacket()

void inet::ospfv2::MessageHandler::sendPacket ( Packet packet,
Ipv4Address  destination,
Ospfv2Interface outputIf,
short  ttl = 1 
)
304 {
305  if (outputIf->getMode() == Ospfv2Interface::NO_OSPF) {
306  delete packet;
307  throw cRuntimeError("Interface '%u' is in NoOSPF mode and cannot send out OSPF messages", outputIf->getIfIndex());
308  }
309  else if (outputIf->getMode() == Ospfv2Interface::PASSIVE) {
310  delete packet;
311  return;
312  }
313 
314  int outputIfIndex = outputIf->getIfIndex();
315  packet->addTagIfAbsent<PacketProtocolTag>()->setProtocol(&Protocol::ospf);
316  packet->addTagIfAbsent<InterfaceReq>()->setInterfaceId(outputIfIndex);
317  packet->addTagIfAbsent<L3AddressReq>()->setDestAddress(destination);
318  packet->addTagIfAbsent<HopLimitReq>()->setHopLimit(ttl);
319  const auto& ospfPacket = packet->peekAtFront<Ospfv2Packet>();
320 
321  switch (ospfPacket->getType()) {
322  case HELLO_PACKET: {
323  packet->setName("OSPF_HelloPacket");
324 
325  const auto& helloPacket = packet->peekAtFront<Ospfv2HelloPacket>();
326  printHelloPacket(helloPacket.get(), destination, outputIfIndex);
327  }
328  break;
329 
331  packet->setName("OSPF_DDPacket");
332 
333  const auto& ddPacket = packet->peekAtFront<Ospfv2DatabaseDescriptionPacket>();
334  printDatabaseDescriptionPacket(ddPacket.get(), destination, outputIfIndex);
335  }
336  break;
337 
339  packet->setName("OSPF_LSReqPacket");
340 
341  const auto& requestPacket = packet->peekAtFront<Ospfv2LinkStateRequestPacket>();
342  printLinkStateRequestPacket(requestPacket.get(), destination, outputIfIndex);
343  }
344  break;
345 
347  packet->setName("OSPF_LSUpdPacket");
348 
349  const auto& updatePacket = packet->peekAtFront<Ospfv2LinkStateUpdatePacket>();
350  printLinkStateUpdatePacket(updatePacket.get(), destination, outputIfIndex);
351  }
352  break;
353 
355  packet->setName("OSPF_LSAckPacket");
356 
357  const auto& ackPacket = packet->peekAtFront<Ospfv2LinkStateAcknowledgementPacket>();
358  printLinkStateAcknowledgementPacket(ackPacket.get(), destination, outputIfIndex);
359  }
360  break;
361 
362  default:
363  break;
364  }
365 
366  packet->addTagIfAbsent<DispatchProtocolReq>()->setProtocol(&Protocol::ipv4);
367  ospfModule->send(packet, "ipOut");
368 }

Referenced by inet::ospfv2::LinkStateUpdateHandler::acknowledgeLSA(), inet::ospfv2::Ospfv2Interface::floodLsa(), inet::ospfv2::LinkStateRequestHandler::processPacket(), inet::ospfv2::LinkStateUpdateHandler::processPacket(), inet::ospfv2::Neighbor::retransmitDatabaseDescriptionPacket(), inet::ospfv2::Neighbor::retransmitUpdatePacket(), inet::ospfv2::Neighbor::sendDatabaseDescriptionPacket(), inet::ospfv2::Ospfv2Interface::sendDelayedAcknowledgements(), inet::ospfv2::Ospfv2Interface::sendHelloPacket(), inet::ospfv2::Neighbor::sendLinkStateRequestPacket(), and inet::ospfv2::Ospfv2Interface::sendLsAcknowledgement().

◆ startTimer()

Member Data Documentation

◆ ddHandler

DatabaseDescriptionHandler inet::ospfv2::MessageHandler::ddHandler
private

Referenced by processPacket().

◆ helloHandler

HelloHandler inet::ospfv2::MessageHandler::helloHandler
private

Referenced by processPacket().

◆ lsAckHandler

LinkStateAcknowledgementHandler inet::ospfv2::MessageHandler::lsAckHandler
private

Referenced by processPacket().

◆ lsRequestHandler

LinkStateRequestHandler inet::ospfv2::MessageHandler::lsRequestHandler
private

Referenced by processPacket().

◆ lsUpdateHandler

LinkStateUpdateHandler inet::ospfv2::MessageHandler::lsUpdateHandler
private

Referenced by processPacket().

◆ ospfModule

cSimpleModule* inet::ospfv2::MessageHandler::ospfModule
private

Referenced by clearTimer(), sendPacket(), and startTimer().


The documentation for this class was generated from the following files:
inet::ospfv2::Ospfv2Area::getInterface
Ospfv2Interface * getInterface(unsigned char ifIndex)
Definition: Ospfv2Area.cc:197
inet::ospfv2::MessageHandler::printEvent
void printEvent(const char *eventString, const Ospfv2Interface *onInterface=nullptr, const Neighbor *forNeighbor=nullptr) const
Definition: MessageHandler.cc:380
inet::ospf::LINKSTATE_ACKNOWLEDGEMENT_PACKET
@ LINKSTATE_ACKNOWLEDGEMENT_PACKET
Definition: OspfPacketBase_m.h:69
inet::ospfv2::Ospfv2Interface::POINTTOPOINT
@ POINTTOPOINT
Definition: Ospfv2Interface.h:32
inet::ospfv2::INTERFACE_HELLO_TIMER
@ INTERFACE_HELLO_TIMER
Definition: Ospfv2Packet_m.h:93
inet::ospfv2::STUB_LINK
@ STUB_LINK
Definition: Ospfv2Packet_m.h:432
inet::ospfv2::MessageHandler::ddHandler
DatabaseDescriptionHandler ddHandler
Definition: MessageHandler.h:27
protocol
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down protocol
Definition: IUdp-gates.txt:25
inet::ospfv2::Ospfv2Interface::WAIT_TIMER
@ WAIT_TIMER
Definition: Ospfv2Interface.h:42
inet::ospfv2::SUMMARYLSA_NETWORKS_TYPE
@ SUMMARYLSA_NETWORKS_TYPE
Definition: Ospfv2Packet_m.h:285
inet::ospfv2::Router::getAreaCount
unsigned long getAreaCount() const
Definition: Ospfv2Router.h:63
inet::ospf::LINKSTATE_REQUEST_PACKET
@ LINKSTATE_REQUEST_PACKET
Definition: OspfPacketBase_m.h:67
inet::Protocol::ipv4
static const Protocol ipv4
Definition: Protocol.h:93
inet::ospfv2::MessageHandler::printDatabaseDescriptionPacket
void printDatabaseDescriptionPacket(const Ospfv2DatabaseDescriptionPacket *ddPacket, Ipv4Address destination, int outputIfIndex) const
Definition: MessageHandler.cc:444
inet::ospfv2::Ospfv2Interface::DESIGNATED_ROUTER_STATE
@ DESIGNATED_ROUTER_STATE
Definition: Ospfv2Interface.h:58
inet::ospfv2::Ospfv2Interface::Ospfv2InterfaceStateType
Ospfv2InterfaceStateType
Definition: Ospfv2Interface.h:51
inet::ospfv2::MessageHandler::authenticatePacket
bool authenticatePacket(const Ospfv2Packet *packet)
Definition: MessageHandler.h:52
inet::ospfv2::MessageHandler::printLinkStateUpdatePacket
void printLinkStateUpdatePacket(const Ospfv2LinkStateUpdatePacket *updatePacket, Ipv4Address destination, int outputIfIndex) const
Definition: MessageHandler.cc:473
inet::Protocol::icmpv4
static const Protocol icmpv4
Definition: Protocol.h:71
InterfaceReq
removed InterfaceReq
Definition: IUdp-gates.txt:11
inet::ospfv2::NEIGHBOR_REQUEST_RETRANSMISSION_TIMER
@ NEIGHBOR_REQUEST_RETRANSMISSION_TIMER
Definition: Ospfv2Packet_m.h:100
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::ospfv2::ROUTERLSA_TYPE
@ ROUTERLSA_TYPE
Definition: Ospfv2Packet_m.h:283
inet::ospfv2::Ospfv2Interface::ACKNOWLEDGEMENT_TIMER
@ ACKNOWLEDGEMENT_TIMER
Definition: Ospfv2Interface.h:43
inet::ospfv2::MessageHandler::handleTimer
void handleTimer(cMessage *timer)
Definition: MessageHandler.cc:51
inet::ospf::HELLO_PACKET
@ HELLO_PACKET
Definition: OspfPacketBase_m.h:65
inet::ospf::LINKSTATE_UPDATE_PACKET
@ LINKSTATE_UPDATE_PACKET
Definition: OspfPacketBase_m.h:68
PacketProtocolTag
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down PacketProtocolTag
Definition: IUdp-gates.txt:25
inet::ospfv2::MessageHandler::lsRequestHandler
LinkStateRequestHandler lsRequestHandler
Definition: MessageHandler.h:28
inet::ospfv2::NEIGHBOR_POLL_TIMER
@ NEIGHBOR_POLL_TIMER
Definition: Ospfv2Packet_m.h:97
inet::ospfv2::SUMMARYLSA_ASBOUNDARYROUTERS_TYPE
@ SUMMARYLSA_ASBOUNDARYROUTERS_TYPE
Definition: Ospfv2Packet_m.h:286
inet::ospfv2::BACKBONE_AREAID
const AreaId BACKBONE_AREAID(0, 0, 0, 0)
inet::ospfv2::Router::getAreaByID
Ospfv2Area * getAreaByID(AreaId areaID)
Returns the pointer to the Area identified by the input areaID, if it's on the Area list,...
Definition: Ospfv2Router.cc:63
inet::ospfv2::Ospfv2Interface::VIRTUAL
@ VIRTUAL
Definition: Ospfv2Interface.h:36
inet::ospfv2::MessageHandler::helloHandler
HelloHandler helloHandler
Definition: MessageHandler.h:26
inet::ospfv2::AS_EXTERNAL_LSA_TYPE
@ AS_EXTERNAL_LSA_TYPE
Definition: Ospfv2Packet_m.h:287
inet::Ipv4Address::ALL_OSPF_DESIGNATED_ROUTERS_MCAST
static const Ipv4Address ALL_OSPF_DESIGNATED_ROUTERS_MCAST
224.0.0.6 All OSPF Designated Routers
Definition: Ipv4Address.h:100
inet::ospf::DATABASE_DESCRIPTION_PACKET
@ DATABASE_DESCRIPTION_PACKET
Definition: OspfPacketBase_m.h:66
inet::ospfv2::Ospfv2Interface::HELLO_TIMER
@ HELLO_TIMER
Definition: Ospfv2Interface.h:41
inet::ospfv2::MessageHandler::printLinkStateRequestPacket
void printLinkStateRequestPacket(const Ospfv2LinkStateRequestPacket *requestPacket, Ipv4Address destination, int outputIfIndex) const
Definition: MessageHandler.cc:463
HopLimitReq
removed HopLimitReq
Definition: IUdp-gates.txt:11
inet::ospfv2::Neighbor::INACTIVITY_TIMER
@ INACTIVITY_TIMER
Definition: Ospfv2Neighbor.h:41
inet::ospf::OspfPacketType
OspfPacketType
Enum generated from inet/routing/ospf_common/OspfPacketBase.msg:15 by opp_msgtool.
Definition: OspfPacketBase_m.h:64
inet::ospfv2::INTERFACE_ACKNOWLEDGEMENT_TIMER
@ INTERFACE_ACKNOWLEDGEMENT_TIMER
Definition: Ospfv2Packet_m.h:95
inet::ospfv2::VIRTUAL_LINK
@ VIRTUAL_LINK
Definition: Ospfv2Packet_m.h:433
inet::ospfv2::Ospfv2Interface::NBMA
@ NBMA
Definition: Ospfv2Interface.h:34
inet::ospfv2::MessageHandler::printLinkStateAcknowledgementPacket
void printLinkStateAcknowledgementPacket(const Ospfv2LinkStateAcknowledgementPacket *ackPacket, Ipv4Address destination, int outputIfIndex) const
Definition: MessageHandler.cc:567
inet::ospfv2::Ospfv2Interface::PASSIVE
@ PASSIVE
Definition: Ospfv2Interface.h:63
inet::ospfv2::Neighbor::UPDATE_RETRANSMISSION_TIMER
@ UPDATE_RETRANSMISSION_TIMER
Definition: Ospfv2Neighbor.h:45
inet::ospfv2::MessageHandler::ospfModule
cSimpleModule * ospfModule
Definition: MessageHandler.h:24
inet::ospfv2::IMessageHandler::IMessageHandler
IMessageHandler(Router *containingRouter)
Definition: IMessageHandler.h:27
inet::ospfv2::MessageHandler::processPacket
void processPacket(Packet *packet, Ospfv2Interface *unused1=nullptr, Neighbor *unused2=nullptr) override
Definition: MessageHandler.cc:177
inet::ospfv2::NEIGHBOR_INACTIVITY_TIMER
@ NEIGHBOR_INACTIVITY_TIMER
Definition: Ospfv2Packet_m.h:96
inet::ospfv2::MessageHandler::lsUpdateHandler
LinkStateUpdateHandler lsUpdateHandler
Definition: MessageHandler.h:29
inet::ospfv2::Router::getRouterID
RouterId getRouterID() const
Definition: Ospfv2Router.h:60
inet::ospfv2::POINTTOPOINT_LINK
@ POINTTOPOINT_LINK
Definition: Ospfv2Packet_m.h:430
inet::ospfv2::Router::ageDatabase
void ageDatabase()
Ages the LSAs in the Router's database.
Definition: Ospfv2Router.cc:278
inet::ospfv2::HelloHandler::processPacket
void processPacket(Packet *packet, Ospfv2Interface *intf, Neighbor *unused=nullptr) override
Definition: HelloHandler.cc:23
inet::ospfv2::Ospfv2Interface::POINTTOMULTIPOINT
@ POINTTOMULTIPOINT
Definition: Ospfv2Interface.h:35
inet::ospfv2::MessageHandler::lsAckHandler
LinkStateAcknowledgementHandler lsAckHandler
Definition: MessageHandler.h:30
inet::ospfv2::DATABASE_AGE_TIMER
@ DATABASE_AGE_TIMER
Definition: Ospfv2Packet_m.h:101
inet::ospfv2::Neighbor::DD_RETRANSMISSION_TIMER
@ DD_RETRANSMISSION_TIMER
Definition: Ospfv2Neighbor.h:44
inet::Protocol::ospf
static const Protocol ospf
Definition: Protocol.h:102
inet::ospfv2::NETWORKLSA_TYPE
@ NETWORKLSA_TYPE
Definition: Ospfv2Packet_m.h:284
inet::ospfv2::Neighbor::POLL_TIMER
@ POLL_TIMER
Definition: Ospfv2Neighbor.h:42
inet::ospfv2::Ospfv2Interface::BROADCAST
@ BROADCAST
Definition: Ospfv2Interface.h:33
inet::ospfv2::TRANSIT_LINK
@ TRANSIT_LINK
Definition: Ospfv2Packet_m.h:431
inet::ospfv2::NEIGHBOR_UPDATE_RETRANSMISSION_TIMER
@ NEIGHBOR_UPDATE_RETRANSMISSION_TIMER
Definition: Ospfv2Packet_m.h:99
inet::ospfv2::AreaId
Ipv4Address AreaId
Definition: Ospfv2Common.h:130
inet::ospfv2::Ospfv2Interface::NO_OSPF
@ NO_OSPF
Definition: Ospfv2Interface.h:64
inet::ospfv2::IMessageHandler::router
Router * router
Definition: IMessageHandler.h:24
inet::ospfv2::Ospfv2Interface::BACKUP_STATE
@ BACKUP_STATE
Definition: Ospfv2Interface.h:57
inet::ospfv2::INTERFACE_WAIT_TIMER
@ INTERFACE_WAIT_TIMER
Definition: Ospfv2Packet_m.h:94
inet::ospfv2::NEIGHBOR_DD_RETRANSMISSION_TIMER
@ NEIGHBOR_DD_RETRANSMISSION_TIMER
Definition: Ospfv2Packet_m.h:98
inet::ospfv2::MessageHandler::printHelloPacket
void printHelloPacket(const Ospfv2HelloPacket *helloPacket, Ipv4Address destination, int outputIfIndex) const
Definition: MessageHandler.cc:429
inet::ospfv2::Neighbor::REQUEST_RETRANSMISSION_TIMER
@ REQUEST_RETRANSMISSION_TIMER
Definition: Ospfv2Neighbor.h:46
inet::ospfv2::DatabaseDescriptionHandler::processPacket
void processPacket(Packet *packet, Ospfv2Interface *intf, Neighbor *neighbor) override
Definition: DatabaseDescriptionHandler.cc:22