ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
coaps.h File Reference

CoAP over DTLS (RFC 7252 sec 9): the bridge between one DTLS connection and the CoAP server. More...

#include "protocore_config.h"

Go to the source code of this file.

Detailed Description

CoAP over DTLS (RFC 7252 sec 9): the bridge between one DTLS connection and the CoAP server.

RFC 7252 sec 9.1 binds CoAP to DTLS, and sec 6.2 gives that binding the "coaps" URI scheme; sec 12.7 registers its port, 5684. This is the transport-neutral half: it drives one DtlsConn through its handshake and, once the connection is established, opens each protected application record, answers the CoAP message inside it through Coap, and seals the response back into one record. The socket and the per-peer routing sit above it in coaps_server.h, so nothing here binds a port and the whole path is host-testable against an in-test DTLS client.

The record layer is RFC 9147 (DTLS 1.3). Its sec 4 Figure 3 gives the DTLSCiphertext unified header: the three high bits of the first byte are 001, the C bit (0x10) marks a Connection ID, and the two low bits (0x03) carry the low-order bits of the epoch. Epoch 3 is application data; anything else is a handshake record and goes back to the state machine, which is what re-answers a retransmitted client Finished whose acknowledgement was lost (RFC 9147 sec 5.8.3).

The module exports one symbol, Coaps. Everything in coaps.c has internal linkage.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file coaps.h.