Skip to main content

Module server

Module server 

Source
Expand description

CoAP message parsing, encoding, and EST-coaps URI routing.

This module implements the CoAP message format (RFC 7252 §3) and maps CoAP URI paths to EST operations per RFC 9483 §5.1.

§CoAP Message Format

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Ver| T |  TKL  |      Code     |          Message ID           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Token (if any, TKL bytes) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Options (if any) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1 1 1 1 1 1 1 1|    Payload (if any) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

§EST-coaps URI Mapping

RFC 9483 §5.1 defines abbreviated URI paths for EST operations:

CoAP PathEST OperationHTTP Method
/sensimpleenrollPOST
/srensimplereenrollPOST
/skgserverkeygenPOST
/attcsrattrsGET
/cacertscacertsGET
/crtscacertsGET (alias)

Structs§

CoapCode
CoAP response/request code (RFC 7252 §3, §5.9).
CoapEstRequest
CoAP request representing an EST-coaps operation.
CoapEstRouter
Routes CoAP URI paths to EST operations.
CoapMessage
A parsed CoAP message (RFC 7252 §3).
CoapOption
A single CoAP option (RFC 7252 §3.1).

Enums§

CoapMessageType
CoAP message type (RFC 7252 §3).
CoapMethod
CoAP request/response method codes (RFC 7252 §5.8, §12.1).
EstOperation
EST operations per RFC 7030, reused from the kipuka-est crate.

Constants§

COAP_VERSION
CoAP protocol version (RFC 7252 §3).
OPTION_BLOCK1
Block1 option (RFC 7959 §2.1).
OPTION_BLOCK2
Block2 option (RFC 7959 §2.1).
OPTION_CONTENT_FORMAT
Content-Format option (RFC 7252 §5.10.3).
OPTION_SIZE1
Size1 option (RFC 7959 §4).
OPTION_SIZE2
Size2 option (RFC 7959 §4).
OPTION_URI_HOST
Uri-Host option (RFC 7252 §5.10.1).
OPTION_URI_PATH
Uri-Path option (RFC 7252 §5.10.1).
OPTION_URI_PORT
Uri-Port option (RFC 7252 §5.10.1).
OPTION_URI_QUERY
Uri-Query option (RFC 7252 §5.10.1).