40 const OSPFLSAHeader& thisHeader =
getHeader();
41 const OSPFLSAHeader& lsaHeader = routerLSA->getHeader();
42 bool differentHeader = ((thisHeader.getLsOptions() != lsaHeader.getLsOptions()) ||
43 ((thisHeader.getLsAge() ==
MAX_AGE) && (lsaHeader.getLsAge() !=
MAX_AGE)) ||
44 ((thisHeader.getLsAge() !=
MAX_AGE) && (lsaHeader.getLsAge() ==
MAX_AGE)) ||
45 (thisHeader.getLsaLength() != lsaHeader.getLsaLength()));
46 bool differentBody =
false;
48 if (!differentHeader) {
57 for (
unsigned int i = 0; i < linkCount; i++) {
59 auto lsaLink = routerLSA->getLinks(i);
60 bool differentLink = ((thisLink.getLinkID() != lsaLink.getLinkID()) ||
61 (thisLink.getLinkData() != lsaLink.getLinkData()) ||
62 (thisLink.getType() != lsaLink.getType()) ||
63 (thisLink.getNumberOfTOS() != lsaLink.getNumberOfTOS()) ||
64 (thisLink.getLinkCost() != lsaLink.getLinkCost()) ||
65 (thisLink.getTosDataArraySize() != lsaLink.getTosDataArraySize()));
68 unsigned int tosCount = thisLink.getTosDataArraySize();
69 for (
unsigned int j = 0; j < tosCount; j++) {
70 bool differentTOS = ((thisLink.getTosData(j).tos != lsaLink.getTosData(j).tos) ||
71 (thisLink.getTosData(j).tosMetric[0] != lsaLink.getTosData(j).tosMetric[0]) ||
72 (thisLink.getTosData(j).tosMetric[1] != lsaLink.getTosData(j).tosMetric[1]) ||
73 (thisLink.getTosData(j).tosMetric[2] != lsaLink.getTosData(j).tosMetric[2]));
90 return differentHeader || differentBody;
virtual unsigned short getNumberOfLinks() const
virtual Link & getLinks(unsigned int k)
unsigned int links_arraysize
Definition: OSPFPacket_m.h:486
virtual unsigned int getLinksArraySize() const
virtual bool getE_ASBoundaryRouter() const
virtual bool getB_AreaBorderRouter() const
virtual bool getV_VirtualLinkEndpoint() const
#define MAX_AGE
Definition: OSPFcommon.h:36
virtual OSPFLSAHeader & getHeader()