25 const Ospfv2LsaHeader& thisHeader =
getHeader();
26 const Ospfv2LsaHeader& lsaHeader = asExternalLSA->getHeader();
27 bool differentHeader = ((thisHeader.getLsOptions() != lsaHeader.getLsOptions()) ||
28 ((thisHeader.getLsAge() ==
MAX_AGE) && (lsaHeader.getLsAge() !=
MAX_AGE)) ||
29 ((thisHeader.getLsAge() !=
MAX_AGE) && (lsaHeader.getLsAge() ==
MAX_AGE)) ||
30 (thisHeader.getLsaLength() != lsaHeader.getLsaLength()));
31 bool differentBody =
false;
33 if (!differentHeader) {
34 const Ospfv2AsExternalLsaContents& thisContents =
getContents();
35 const Ospfv2AsExternalLsaContents& lsaContents = asExternalLSA->getContents();
37 unsigned int thisTosInfoCount = thisContents.getExternalTOSInfoArraySize();
39 differentBody = ((thisContents.getNetworkMask() != lsaContents.getNetworkMask()) ||
40 (thisTosInfoCount != lsaContents.getExternalTOSInfoArraySize()));
43 for (
unsigned int i = 0; i < thisTosInfoCount; i++) {
44 const auto& thisTOSInfo = thisContents.getExternalTOSInfo(i);
45 const auto& lsaTOSInfo = lsaContents.getExternalTOSInfo(i);
47 if ((thisTOSInfo.E_ExternalMetricType != lsaTOSInfo.E_ExternalMetricType) ||
48 (thisTOSInfo.routeCost != lsaTOSInfo.routeCost) ||
49 (thisTOSInfo.forwardingAddress != lsaTOSInfo.forwardingAddress) ||
50 (thisTOSInfo.externalRouteTag != lsaTOSInfo.externalRouteTag) ||
51 (thisTOSInfo.tos != lsaTOSInfo.tos))
60 return differentHeader || differentBody;