ddn.net.dtls.record
DTLS record layer implementation.
Handles reading and writing DTLS records (13-byte header + payload). Unlike TLS, each UDP datagram may contain multiple DTLS records.
Provides parsing of received datagrams into individual records, building records for transmission, and coalescing multiple records into single datagrams for efficient network usage.
Includes anti-replay protection using a sliding window algorithm as specified in RFC 6347 §4.1.2.6.
Types 2
Parsed DTLS record.
Represents a single DTLS record extracted from a datagram, containing the 13-byte header and the payload data.
DtlsRecordHeader headerThe parsed DTLS record header.const(ubyte)[] payloadThe record payload (may be encrypted application data).bool validWhether parsing succeeded.DTLS record layer.
Handles reading and writing DTLS records (13-byte header + payload). Unlike TLS, each UDP datagram may contain multiple DTLS records.
Manages epoch transitions and sequence number generation for outgoing records, and provides anti-replay protection for incoming records using a sliding window algorithm.
TlsProgress processDatagram(const(ubyte)[] datagram, out DtlsRecord[] records) @safe pure nothrowProcess a received datagram, which may contain multiple DTLS records.ubyte[] buildRecord(ContentType type, const(ubyte)[] payload, ushort epoch) @safe pure nothrowBuild a DTLS record for sending.ubyte[] coalesceDatagram(const(ubyte[])[] records) @safe pure nothrowCoalesce multiple records into a single datagram.ulong nextSequence() @property const @safe pure nothrow @nogcGet the next sequence number that will be used.this()Constructs a new DTLS record layer.