[coaps] introduce Coap::SecureSession along with Dtls::Transport (#11056)

This commit introduces the `Dtls::Transport` and `Dtls::Session`
classes, separating session-related functions from transport-related
behaviors. It also introduces the `Coap::SecureSession` class, which
handles CoAP processing over a DTLS session. This simplifies the code
by allowing `Coap::SecureSession` to inherit many of its methods from
`Dtls::Session`, avoiding repetition. It also separates CoAP-specific
message processing from transport-related functionality.

`Tmf::SecureAgent` and `ApplicationCoapSecure` are updated to act as
both a `Dtls::Transport` and a single `Coap::SecureSession`.
This commit is contained in:
Abtin Keshavarzian
2024-12-26 12:40:08 -08:00
committed by GitHub
parent 4c378f798d
commit 2e39577111
16 changed files with 271 additions and 471 deletions
+2 -2
View File
@@ -273,8 +273,8 @@ Message::Priority Agent::DscpToPriority(uint8_t aDscp)
#if OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE
SecureAgent::SecureAgent(Instance &aInstance)
: Coap::CoapSecureBase(aInstance, mDtls)
, mDtls(aInstance, kNoLinkSecurity)
: Coap::Dtls::Transport(aInstance, kNoLinkSecurity)
, Coap::SecureSession(aInstance, static_cast<Coap::Dtls::Transport &>(*this))
{
SetResourceHandler(&HandleResource);
}