|
DTNMA Reference Tools v2.1.0 - 13.gc5c0bac
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
|
#include "proxy_cli.h"#include "msg.h"#include "cace/ari/cbor.h"#include "cace/ari/text.h"#include "cace/ari/time_util.h"#include "cace/util/logging.h"#include "cace/util/defs.h"#include <qcbor/qcbor.h>#include <m-bstring.h>#include <sys/socket.h>#include <sys/un.h>#include <unistd.h>#include <errno.h>
Include dependency graph for proxy_cli.c:Functions | |
| void | cace_amp_proxy_cli_state_init (cace_amp_proxy_cli_state_t *state) |
| Initialize an empty state. | |
| void | cace_amp_proxy_cli_state_deinit (cace_amp_proxy_cli_state_t *state) |
| Deinitialize any resources. | |
| static int | cace_amp_proxy_cli_real_connect (cace_amp_proxy_cli_state_t *state) |
| Check socket state and reconnect if necessary. | |
| static void | cace_amp_proxy_cli_real_disconnect (cace_amp_proxy_cli_state_t *state) |
| Disconnect without affecting the configured path. | |
| int | cace_amp_proxy_cli_state_connect (cace_amp_proxy_cli_state_t *state, const m_string_t sock_path) |
| Connect a unix domain SEQDATA socket to a specific filesystem path. | |
| void | cace_amp_proxy_cli_state_disconnect (cace_amp_proxy_cli_state_t *state) |
| Disconnect any current socket and remove it if necessary. | |
| int | cace_amp_proxy_cli_state_getfd (cace_amp_proxy_cli_state_t *state) |
| int | cace_amp_proxy_cli_send (const cace_ari_list_t data, const cace_amm_msg_if_metadata_t *meta, void *ctx) |
| Provider of cace_amm_msg_if_t::send interface for BP-proxy socket transport. | |
| int | cace_amp_proxy_cli_recv (cace_ari_list_t data, cace_amm_msg_if_metadata_t *meta, cace_daemon_run_t *running, void *ctx) |
| Provider of cace_amm_msg_if_t::recv interface for BP-proxy socket transport. | |
|
static |
Check socket state and reconnect if necessary.
References CACE_LOG_ERR, CACE_LOG_INFO, cace_amp_proxy_cli_state_t::path, and cace_amp_proxy_cli_state_t::sock_fd.
Referenced by cace_amp_proxy_cli_recv(), cace_amp_proxy_cli_send(), and cace_amp_proxy_cli_state_connect().
|
static |
Disconnect without affecting the configured path.
References CACE_LOG_INFO, cace_amp_proxy_cli_state_t::path, and cace_amp_proxy_cli_state_t::sock_fd.
Referenced by cace_amp_proxy_cli_recv(), cace_amp_proxy_cli_send(), and cace_amp_proxy_cli_state_disconnect().
| int cace_amp_proxy_cli_recv | ( | cace_ari_list_t | data, |
| cace_amm_msg_if_metadata_t * | meta, | ||
| cace_daemon_run_t * | running, | ||
| void * | ctx | ||
| ) |
Provider of cace_amm_msg_if_t::recv interface for BP-proxy socket transport.
The user data for this function is a cace_amp_proxy_cli_state_t instance.
References CACE_AMM_MSG_IF_RECV_END, cace_amp_msg_decode(), cace_amp_proxy_cli_real_connect(), cace_amp_proxy_cli_real_disconnect(), cace_ari_cbor_decode(), CACE_ARI_TEXT_ENC_OPTS_DEFAULT, cace_ari_text_encode(), cace_daemon_run_get(), cace_data_deinit(), cace_data_init_view(), cace_get_system_time(), CACE_LOG_DEBUG, CACE_LOG_ERR, CACE_LOG_INFO, cace_log_is_enabled_for(), CACE_LOG_WARNING, CHKERR1, result, running, cace_amp_proxy_cli_state_t::sock_mutex, cace_amm_msg_if_metadata_t::src, and cace_amm_msg_if_metadata_t::timestamp.
Referenced by main().
| int cace_amp_proxy_cli_send | ( | const cace_ari_list_t | data, |
| const cace_amm_msg_if_metadata_t * | meta, | ||
| void * | ctx | ||
| ) |
Provider of cace_amm_msg_if_t::send interface for BP-proxy socket transport.
The user data for this function is a cace_amp_proxy_cli_state_t instance.
References cace_amp_msg_encode(), cace_amp_proxy_cli_real_connect(), cace_amp_proxy_cli_real_disconnect(), cace_ari_cbor_encode(), CACE_ARI_TEXT_ENC_OPTS_DEFAULT, cace_ari_text_encode(), cace_data_deinit(), cace_data_init(), CACE_LOG_ERR, CACE_LOG_INFO, CHKERR1, cace_amm_msg_if_metadata_t::dest, cace_data_t::len, cace_data_t::ptr, result, and cace_amp_proxy_cli_state_t::sock_mutex.
Referenced by main().
| int cace_amp_proxy_cli_state_connect | ( | cace_amp_proxy_cli_state_t * | state, |
| const m_string_t | sock_path | ||
| ) |
Connect a unix domain SEQDATA socket to a specific filesystem path.
| [in,out] | state | The state to bind. |
| [in] | sock_path | The file path to bind to. |
References cace_amp_proxy_cli_real_connect(), CHKERR1, cace_amp_proxy_cli_state_t::path, and cace_amp_proxy_cli_state_t::sock_mutex.
Referenced by main().
| void cace_amp_proxy_cli_state_deinit | ( | cace_amp_proxy_cli_state_t * | state | ) |
Deinitialize any resources.
References CHKVOID, cace_amp_proxy_cli_state_t::path, and cace_amp_proxy_cli_state_t::sock_mutex.
Referenced by main().
| void cace_amp_proxy_cli_state_disconnect | ( | cace_amp_proxy_cli_state_t * | state | ) |
Disconnect any current socket and remove it if necessary.
| [in,out] | state | The state to bind. |
References cace_amp_proxy_cli_real_disconnect(), CHKVOID, cace_amp_proxy_cli_state_t::path, and cace_amp_proxy_cli_state_t::sock_mutex.
| int cace_amp_proxy_cli_state_getfd | ( | cace_amp_proxy_cli_state_t * | state | ) |
References cace_amp_proxy_cli_state_t::sock_fd, and cace_amp_proxy_cli_state_t::sock_mutex.
Referenced by daemon_signal_handler().
| void cace_amp_proxy_cli_state_init | ( | cace_amp_proxy_cli_state_t * | state | ) |
Initialize an empty state.
References CHKVOID, cace_amp_proxy_cli_state_t::path, cace_amp_proxy_cli_state_t::sock_fd, and cace_amp_proxy_cli_state_t::sock_mutex.
Referenced by main().