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 |
MsgConn |
Msg connection structure |
Constants
CIDL |
CIDL defines the size of the connection id |
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 |
Functions
addr2str |
Do a valid UTF-8 string from a |
do_hash |
Do a valid hash for Mles over provided UTF-8 String list. |
has_peer |
Check if an peer is defined |
message_decode |
Decode CBOR byte string to Msg object. |
message_encode |
Encode Msg object to CBOR. |
read_cid_from_hdr |
Read a connection id from header. |
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. |
select_cid |
Return a random connection id. |
server_run |
Run an Mles server |
write_cid |
Write a random connection id in network byte order. |
write_cid_to_hdr |
Write a random connection id in network byte order to the 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_hdr_without_cid |
Write a valid Mles header with specified length to network byte order without cid. |
write_key |
Write a valid key to network byte order. |