[coap] update Interceptor to use Msg (#12331)

This commit updates the `CoapBase::Interceptor` function pointer type
to accept `const Msg &` instead of separate `const Message &` and
`const Ip6::MessageInfo &` arguments. It also reorders the `void *`
to match other CoAP callbacks.

Implementations in `BackboneTmfAgent::Filter` and `Agent::Filter`
have been updated to match the new signature.
This commit is contained in:
Abtin Keshavarzian
2026-01-26 10:33:00 -08:00
committed by GitHub
parent 0c4f22d69a
commit 558aea761f
6 changed files with 23 additions and 21 deletions
+5 -5
View File
@@ -197,12 +197,12 @@ bool Agent::HandleResource(const char *aUriPath, Msg &aMsg)
return didHandle;
}
Error Agent::Filter(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo, void *aContext)
{
OT_UNUSED_VARIABLE(aMessage);
Error Agent::Filter(void *aContext, const Msg &aRxMsg) { return static_cast<Agent *>(aContext)->Filter(aRxMsg); }
return static_cast<Agent *>(aContext)->IsTmfMessage(aMessageInfo.GetPeerAddr(), aMessageInfo.GetSockAddr(),
aMessageInfo.GetSockPort())
Error Agent::Filter(const Msg &aRxMsg) const
{
return IsTmfMessage(aRxMsg.mMessageInfo.GetPeerAddr(), aRxMsg.mMessageInfo.GetSockAddr(),
aRxMsg.mMessageInfo.GetSockPort())
? kErrorNone
: kErrorNotTmf;
}