mirror of
https://github.com/espressif/openthread.git
synced 2026-09-13 12:40:05 +00:00
[border-router] add RA message dump for testing (#6567)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user