DTNMA Reference Tools v2.0.0 - 7.g88e232c
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
Loading...
Searching...
No Matches
msg.h File Reference

Handle AMP binary message encoding and decoding. More...

#include "cace/ari/containers.h"
#include <m-bstring.h>
+ Include dependency graph for msg.h:
+ This graph shows which files directly or indirectly include this file:

Functions

int cace_amp_msg_encode (m_bstring_t msgbuf, const cace_ari_list_t items)
 Encode a single AMP message from a set of ARI items.
 
int cace_amp_msg_decode (cace_ari_list_t items, const uint8_t *msgbuf_ptr, size_t msgbuf_len)
 Decode a single AMP message into a set of ARI items.
 

Detailed Description

Handle AMP binary message encoding and decoding.

Function Documentation

◆ cace_amp_msg_decode()

int cace_amp_msg_decode ( cace_ari_list_t  items,
const uint8_t *  msgbuf_ptr,
size_t  msgbuf_len 
)

Decode a single AMP message into a set of ARI items.

Parameters
[out]itemsThe items list to decode into. This must be already initialized.
[in]msgbuf_ptrThe message buffer to decode from.
msgbuf_lenThe length of valid data at msgbuf_ptr.
Returns
Zero if successful.

References cace_ari_cbor_decode(), cace_ari_deinit(), cace_ari_init(), cace_ari_text_encode(), cace_data_deinit(), cace_data_init_view(), CACE_FREE, CACE_LOG_DEBUG, CACE_LOG_ERR, cace_log_is_enabled_for(), and errm.

◆ cace_amp_msg_encode()

int cace_amp_msg_encode ( m_bstring_t  msgbuf,
const cace_ari_list_t  items 
)

Encode a single AMP message from a set of ARI items.

Parameters
[out]msgbufThe message buffer to append to. This must be already initialized.
[in]itemsThe items to encode.
Returns
Zero if successful.

References cace_ari_cbor_encode(), cace_ari_text_encode(), cace_data_deinit(), cace_data_init(), CACE_LOG_DEBUG, CACE_LOG_ERR, cace_log_is_enabled_for(), cace_data_t::len, and cace_data_t::ptr.