40 const OSPFLSAHeader& thisHeader =
getHeader();
41 const OSPFLSAHeader& lsaHeader = asExternalLSA->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) {
49 const OSPFASExternalLSAContents& thisContents =
getContents();
50 const OSPFASExternalLSAContents& lsaContents = asExternalLSA->getContents();
52 unsigned int thisTosInfoCount = thisContents.getExternalTOSInfoArraySize();
54 differentBody = ((thisContents.getNetworkMask() != lsaContents.getNetworkMask()) ||
55 (thisContents.getE_ExternalMetricType() != lsaContents.getE_ExternalMetricType()) ||
56 (thisContents.getRouteCost() != lsaContents.getRouteCost()) ||
57 (thisContents.getForwardingAddress() != lsaContents.getForwardingAddress()) ||
58 (thisContents.getExternalRouteTag() != lsaContents.getExternalRouteTag()) ||
59 (thisTosInfoCount != lsaContents.getExternalTOSInfoArraySize()));
62 for (
unsigned int i = 0; i < thisTosInfoCount; i++) {
63 const ExternalTOSInfo& thisTOSInfo = thisContents.getExternalTOSInfo(i);
64 const ExternalTOSInfo& lsaTOSInfo = lsaContents.getExternalTOSInfo(i);
66 if ((thisTOSInfo.tosData.tos != lsaTOSInfo.tosData.tos) ||
67 (thisTOSInfo.tosData.tosMetric[0] != lsaTOSInfo.tosData.tosMetric[0]) ||
68 (thisTOSInfo.tosData.tosMetric[1] != lsaTOSInfo.tosData.tosMetric[1]) ||
69 (thisTOSInfo.tosData.tosMetric[2] != lsaTOSInfo.tosData.tosMetric[2]) ||
70 (thisTOSInfo.E_ExternalMetricType != lsaTOSInfo.E_ExternalMetricType) ||
71 (thisTOSInfo.forwardingAddress != lsaTOSInfo.forwardingAddress) ||
72 (thisTOSInfo.externalRouteTag != lsaTOSInfo.externalRouteTag))
81 return differentHeader || differentBody;
virtual OSPFASExternalLSAContents & getContents()
#define MAX_AGE
Definition: OSPFcommon.h:36
virtual OSPFLSAHeader & getHeader()