Crate mles_utils [] [src]

Mles utils library is provided for Mles client and server implementations for easy handling of proper header and message structures.

Structs

Msg

Msg structure

Constants

HDRKEYL

HDRKEYL defines the size of the header + key

HDRL

HDRL defines the size of the header including version, length and timestamp

KEYL

KEYL defines the size of the key

TSL

TSL defines the size of the timestamp

Functions

addr2str

Do a valid UTF-8 string from a SocketAddr.

do_hash

Do a valid hash for Mles over provided UTF-8 String list.

message_decode

Decode CBOR byte string to Msg object.

message_encode

Encode Msg object to CBOR.

ms_since_this_month

Returns milliseconds from the beginning of current month UTC.

read_hdr_len

Read received buffer header len.

read_hdr_type

Read received buffer header type.

read_key

Read a key from buffer.

read_key_from_hdr

Read a key from header.

read_ts_from_hdr

Read a timestamp from header.

write_hdr

Write a valid Mles header with specified length to network byte order.

write_hdr_with_key

Write a valid Mles header with specified length and key to network byte order.

write_key

Write a valid key to network byte order.

write_ts_to_hdr

Write a valid timestamp to network byte order to the header.