mirror of
https://github.com/espressif/openthread.git
synced 2026-08-17 16:09:51 +00:00
[icmp6] use Icmp6Header instead of Icmp::Header (#13194)
This commit updates the codebase to use the `Icmp6Header` type directly, replacing the nested `Ip6::Icmp::Header` definition. This change aligns the ICMPv6 header type definition with the conventions used for other network protocol headers and simplifies type references across the network, border router, and utility modules.
This commit is contained in:
@@ -302,8 +302,8 @@ otError otPlatInfraIfSendIcmp6Nd(otInstance *aInstance,
|
||||
const uint8_t *aBuffer,
|
||||
uint16_t aBufferLength)
|
||||
{
|
||||
Icmp6Packet packet;
|
||||
Ip6::Icmp::Header *header;
|
||||
Icmp6Packet packet;
|
||||
Ip6::Icmp6Header *header;
|
||||
|
||||
Log("otPlatInfraIfSendIcmp6Nd(aDestAddr: %s, aBufferLength:%u)", AsCoreType(aDestAddress).ToString().AsCString(),
|
||||
aBufferLength);
|
||||
@@ -313,19 +313,19 @@ otError otPlatInfraIfSendIcmp6Nd(otInstance *aInstance,
|
||||
|
||||
packet.Init(aBuffer, aBufferLength);
|
||||
|
||||
VerifyOrQuit(aBufferLength >= sizeof(Ip6::Icmp::Header));
|
||||
VerifyOrQuit(aBufferLength >= sizeof(Ip6::Icmp6Header));
|
||||
|
||||
header = reinterpret_cast<Ip6::Icmp::Header *>(const_cast<uint8_t *>(aBuffer));
|
||||
header = reinterpret_cast<Ip6::Icmp6Header *>(const_cast<uint8_t *>(aBuffer));
|
||||
|
||||
switch (header->GetType())
|
||||
{
|
||||
case Ip6::Icmp::Header::kTypeRouterSolicit:
|
||||
case Ip6::Icmp6Header::kTypeRouterSolicit:
|
||||
Log(" Router Solicit message");
|
||||
sRsEmitted = true;
|
||||
otPlatInfraIfRecvIcmp6Nd(sInstance, kInfraIfIndex, &sInfraIfAddress, aBuffer, aBufferLength);
|
||||
break;
|
||||
|
||||
case Ip6::Icmp::Header::kTypeRouterAdvert:
|
||||
case Ip6::Icmp6Header::kTypeRouterAdvert:
|
||||
Log(" Router Advertisement message");
|
||||
LogRouterAdvert(packet);
|
||||
ValidateRouterAdvert(packet);
|
||||
@@ -335,7 +335,7 @@ otError otPlatInfraIfSendIcmp6Nd(otInstance *aInstance,
|
||||
otPlatInfraIfRecvIcmp6Nd(sInstance, kInfraIfIndex, &sInfraIfAddress, aBuffer, aBufferLength);
|
||||
break;
|
||||
|
||||
case Ip6::Icmp::Header::kTypeNeighborSolicit:
|
||||
case Ip6::Icmp6Header::kTypeNeighborSolicit:
|
||||
{
|
||||
const Ip6::Nd::NeighborSolicitHeader *nsMsg =
|
||||
reinterpret_cast<const Ip6::Nd::NeighborSolicitHeader *>(packet.GetBytes());
|
||||
|
||||
Reference in New Issue
Block a user