[border-router] add RA message dump for testing (#6567)

This commit is contained in:
kangping
2021-05-08 18:10:11 -07:00
committed by GitHub
parent 8dc9a53cc7
commit e7c4236c0a
2 changed files with 23 additions and 1 deletions
@@ -757,6 +757,9 @@ void RoutingManager::SendRouterAdvertisement(const Ip6::Prefix *aNewOmrPrefixes,
if (error == kErrorNone)
{
otLogInfoBr("sent Router Advertisement on interface %u", mInfraIfIndex);
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
otDumpCertBr("[BR-CERT] direction=send | type=RA |", buffer, bufferLength);
#endif
}
else
{
@@ -918,6 +921,9 @@ void RoutingManager::HandleRouterAdvertisement(const Ip6::Address &aSrcAddress,
otLogInfoBr("received Router Advertisement from %s on interface %u", aSrcAddress.ToString().AsCString(),
mInfraIfIndex);
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
otDumpCertBr("[BR-CERT] direction=recv | type=RA |", aBuffer, aBufferLength);
#endif
routerAdvMessage = reinterpret_cast<const RouterAdvMessage *>(aBuffer);
optionsBegin = aBuffer + sizeof(RouterAdvMessage);
+17 -1
View File
@@ -2462,7 +2462,7 @@ void otLogOtns(const char *aFormat, ...);
#endif
/**
* @def otDumpCert
* @def otDumpCertMeshCoP
*
* This function generates a memory dump with log level none for the certification test.
*
@@ -2477,6 +2477,22 @@ void otLogOtns(const char *aFormat, ...);
#define otDumpCertMeshCoP(aId, aBuf, aLength)
#endif
/**
* @def otDumpCertBr
*
* This function generates a memory dump with log level none for the BR certification test.
*
* @param[in] aId A pointer to a NULL-terminated string that is printed before the bytes.
* @param[in] aBuf A pointer to the buffer.
* @param[in] aLength Number of bytes to print.
*
*/
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
#define otDumpCertBr(aId, aBuf, aLength) otDump(OT_LOG_LEVEL_NONE, OT_LOG_REGION_BR, aId, aBuf, aLength)
#else
#define otDumpCertBr(aId, aBuf, aLength)
#endif
/**
* This function dumps bytes to the log in a human-readable fashion.
*