mirror of
https://github.com/espressif/openthread.git
synced 2026-08-10 20:57:47 +00:00
[mesh-forwarder] update aIp6Header arg name to follow style guide (#9378)
This commit is contained in:
@@ -544,7 +544,7 @@ private:
|
||||
void SendMesh(Message &aMessage, Mac::TxFrame &aFrame);
|
||||
void SendDestinationUnreachable(uint16_t aMeshSource, const Ip6::Headers &aIp6Headers);
|
||||
Error UpdateIp6Route(Message &aMessage);
|
||||
Error UpdateIp6RouteFtd(Ip6::Header &ip6Header, Message &aMessage);
|
||||
Error UpdateIp6RouteFtd(const Ip6::Header &aIp6Header, Message &aMessage);
|
||||
void EvaluateRoutingCost(uint16_t aDest, uint8_t &aBestCost, uint16_t &aBestDest) const;
|
||||
Error AnycastRouteLookup(uint8_t aServiceId, AnycastType aType, uint16_t &aMeshDest) const;
|
||||
Error UpdateMeshRoute(Message &aMessage);
|
||||
|
||||
@@ -497,7 +497,7 @@ exit:
|
||||
return (bestDest != Mac::kShortAddrInvalid) ? kErrorNone : kErrorNoRoute;
|
||||
}
|
||||
|
||||
Error MeshForwarder::UpdateIp6RouteFtd(Ip6::Header &ip6Header, Message &aMessage)
|
||||
Error MeshForwarder::UpdateIp6RouteFtd(const Ip6::Header &aIp6Header, Message &aMessage)
|
||||
{
|
||||
Mle::MleRouter &mle = Get<Mle::MleRouter>();
|
||||
Error error = kErrorNone;
|
||||
@@ -507,15 +507,15 @@ Error MeshForwarder::UpdateIp6RouteFtd(Ip6::Header &ip6Header, Message &aMessage
|
||||
{
|
||||
mMeshDest = aMessage.GetMeshDest();
|
||||
}
|
||||
else if (mle.IsRoutingLocator(ip6Header.GetDestination()))
|
||||
else if (mle.IsRoutingLocator(aIp6Header.GetDestination()))
|
||||
{
|
||||
uint16_t rloc16 = ip6Header.GetDestination().GetIid().GetLocator();
|
||||
uint16_t rloc16 = aIp6Header.GetDestination().GetIid().GetLocator();
|
||||
VerifyOrExit(mle.IsRouterIdValid(Mle::RouterIdFromRloc16(rloc16)), error = kErrorDrop);
|
||||
mMeshDest = rloc16;
|
||||
}
|
||||
else if (mle.IsAnycastLocator(ip6Header.GetDestination()))
|
||||
else if (mle.IsAnycastLocator(aIp6Header.GetDestination()))
|
||||
{
|
||||
uint16_t aloc16 = ip6Header.GetDestination().GetIid().GetLocator();
|
||||
uint16_t aloc16 = aIp6Header.GetDestination().GetIid().GetLocator();
|
||||
|
||||
if (aloc16 == Mle::kAloc16Leader)
|
||||
{
|
||||
@@ -554,25 +554,25 @@ Error MeshForwarder::UpdateIp6RouteFtd(Ip6::Header &ip6Header, Message &aMessage
|
||||
ExitNow(error = kErrorDrop);
|
||||
}
|
||||
}
|
||||
else if ((neighbor = Get<NeighborTable>().FindNeighbor(ip6Header.GetDestination())) != nullptr)
|
||||
else if ((neighbor = Get<NeighborTable>().FindNeighbor(aIp6Header.GetDestination())) != nullptr)
|
||||
{
|
||||
mMeshDest = neighbor->GetRloc16();
|
||||
}
|
||||
else if (Get<NetworkData::Leader>().IsOnMesh(ip6Header.GetDestination()))
|
||||
else if (Get<NetworkData::Leader>().IsOnMesh(aIp6Header.GetDestination()))
|
||||
{
|
||||
SuccessOrExit(error = Get<AddressResolver>().Resolve(ip6Header.GetDestination(), mMeshDest));
|
||||
SuccessOrExit(error = Get<AddressResolver>().Resolve(aIp6Header.GetDestination(), mMeshDest));
|
||||
}
|
||||
else
|
||||
{
|
||||
IgnoreError(
|
||||
Get<NetworkData::Leader>().RouteLookup(ip6Header.GetSource(), ip6Header.GetDestination(), mMeshDest));
|
||||
Get<NetworkData::Leader>().RouteLookup(aIp6Header.GetSource(), aIp6Header.GetDestination(), mMeshDest));
|
||||
}
|
||||
|
||||
VerifyOrExit(mMeshDest != Mac::kShortAddrInvalid, error = kErrorDrop);
|
||||
|
||||
mMeshSource = Get<Mac::Mac>().GetShortAddress();
|
||||
|
||||
SuccessOrExit(error = mle.CheckReachability(mMeshDest, ip6Header));
|
||||
SuccessOrExit(error = mle.CheckReachability(mMeshDest, aIp6Header));
|
||||
aMessage.SetMeshDest(mMeshDest);
|
||||
mMacAddrs.mDestination.SetShort(mle.GetNextHop(mMeshDest));
|
||||
|
||||
|
||||
@@ -785,7 +785,7 @@ public:
|
||||
|
||||
Error SendChildUpdateRequest(void) { return Mle::SendChildUpdateRequest(); }
|
||||
|
||||
Error CheckReachability(uint16_t aMeshDest, Ip6::Header &aIp6Header)
|
||||
Error CheckReachability(uint16_t aMeshDest, const Ip6::Header &aIp6Header)
|
||||
{
|
||||
return Mle::CheckReachability(aMeshDest, aIp6Header);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user