DTNMA Reference Tools v2.0.0 - 9.gaff6489
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
Loading...
Searching...
No Matches
proxy_msg.h File Reference

This header is associated with proxied messaging from the provider side, where the peer identity is accessed and the rest of the message is treated as opaque data. More...

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

Functions

int cace_amp_proxy_msg_send (int sock_fd, const cace_ari_t *dst, const uint8_t *data_ptr, size_t data_len)
 Send a message via datagram socket proxy to an ultimate destination.
 
int cace_amp_proxy_msg_recv (int sock_fd, cace_ari_t *src, m_bstring_t data)
 Receive a message via datagram socket proxy from an ultimate source.
 

Detailed Description

This header is associated with proxied messaging from the provider side, where the peer identity is accessed and the rest of the message is treated as opaque data.

Function Documentation

◆ cace_amp_proxy_msg_recv()

int cace_amp_proxy_msg_recv ( int  sock_fd,
cace_ari_t src,
m_bstring_t  data 
)

Receive a message via datagram socket proxy from an ultimate source.

Parameters
sock_fdThe socket file descriptor. The socket must be ready for reading (e.g. determined via poll() and POLLIN event) before this call.
[out]srcThe ultimate source endpoint being received from.
[out]dataThe data to populate, which must already be initialized.
Returns
Zero if successful.

References cace_ari_cbor_decode(), cace_ari_text_encode(), cace_data_init_view(), CACE_LOG_ERR, CACE_LOG_INFO, CACE_LOG_WARNING, and CHKERR1.

◆ cace_amp_proxy_msg_send()

int cace_amp_proxy_msg_send ( int  sock_fd,
const cace_ari_t dst,
const uint8_t *  data_ptr,
size_t  data_len 
)

Send a message via datagram socket proxy to an ultimate destination.

Parameters
sock_fdThe socket file descriptor. The socket must be ready for writing (e.g. determined via poll() and POLLOUT event) before this call.
[in]dstThe ultimate destination endpoint to send to.
Returns
Zero if successful.

References cace_ari_cbor_encode(), cace_data_deinit(), cace_data_init(), CACE_LOG_ERR, CACE_LOG_INFO, CHKERR1, cace_data_t::len, and cace_data_t::ptr.