#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <oasys/compat/inet_aton.h>
#include <oasys/compat/inttypes.h>
#include "dtn_ipc.h"
#include "dtn_errno.h"
#include "dtn_types.h"
Go to the source code of this file.
Defines | |
#define | CASE(_type) case _type : return #_type; break; |
Functions | |
const char * | dtnipc_msgtoa (u_int8_t type) |
Type code to string conversion routine. | |
int | dtnipc_open (dtnipc_handle_t *handle) |
int | dtnipc_close (dtnipc_handle_t *handle) |
int | dtnipc_send (dtnipc_handle_t *handle, dtnapi_message_type_t type) |
int | dtnipc_recv (dtnipc_handle_t *handle, int *status) |
int | dtnipc_send_recv (dtnipc_handle_t *handle, dtnapi_message_type_t type) |
Send a message and wait for a response over the dtn ipc protocol. | |
Variables | |
int | dtnipc_version = DTN_IPC_VERSION |
#define CASE | ( | _type | ) | case _type : return #_type; break; |
int dtnipc_close | ( | dtnipc_handle_t * | handle | ) |
Definition at line 203 of file dtn_ipc.c.
References DTN_CLOSE, DTN_ECOMM, dtnipc_send_recv(), dtnipc_handle::err, dtnipc_handle::sock, dtnipc_handle::xdr_decode, and dtnipc_handle::xdr_encode.
Referenced by dtn_close(), dtnipc_open(), dtnipc_recv(), and dtnipc_send().
const char* dtnipc_msgtoa | ( | u_int8_t | type | ) |
Type code to string conversion routine.
Definition at line 41 of file dtn_ipc.c.
References CASE, DTN_BEGIN_POLL, DTN_BIND, DTN_CANCEL, DTN_CANCEL_POLL, DTN_CHANGE_REGISTRATION, DTN_CLOSE, DTN_FIND_REGISTRATION, DTN_LOCAL_EID, DTN_OPEN, DTN_RECV, DTN_REGISTER, DTN_SEND, DTN_SESSION_UPDATE, and DTN_UNREGISTER.
Referenced by dtnipc_send(), dtn::APIClient::handle_begin_poll(), and dtn::APIClient::run().
int dtnipc_open | ( | dtnipc_handle_t * | handle | ) |
Definition at line 72 of file dtn_ipc.c.
References dtnipc_handle::buf, dtnipc_handle::debug, DTN_ECOMM, DTN_EVERSION, DTN_IPC_PORT, DTN_MAX_API_MSG, DTN_OPEN, dtnipc_close(), dtnipc_version, end, dtnipc_handle::err, errno, dtnipc_handle::sock, dtnipc_handle::total_rcvd, dtnipc_handle::total_sent, dtnipc_handle::xdr_decode, and dtnipc_handle::xdr_encode.
Referenced by dtn_open().
int dtnipc_recv | ( | dtnipc_handle_t * | handle, | |
int * | status | |||
) |
Definition at line 294 of file dtn_ipc.c.
References dtnipc_handle::buf, dtnipc_handle::debug, DTN_ECOMM, dtnipc_close(), dtnipc_handle::err, errno, len, dtnipc_handle::sock, dtnipc_handle::total_rcvd, dtnipc_handle::total_sent, and dtnipc_handle::xdr_decode.
Referenced by dtn_build_local_eid(), dtn_cancel_poll(), dtn_find_registration(), dtn_recv(), dtn_register(), dtn_session_update(), dtn_unregister(), and dtnipc_send_recv().
int dtnipc_send | ( | dtnipc_handle_t * | handle, | |
dtnapi_message_type_t | type | |||
) |
Definition at line 233 of file dtn_ipc.c.
References dtnipc_handle::buf, dtnipc_handle::debug, DTN_ECOMM, dtnipc_close(), dtnipc_msgtoa(), dtnipc_handle::err, errno, len, dtnipc_handle::sock, dtnipc_handle::total_rcvd, dtnipc_handle::total_sent, and dtnipc_handle::xdr_encode.
Referenced by dtn_begin_poll(), dtn_build_local_eid(), dtn_find_registration(), dtn_register(), dtn_unregister(), and dtnipc_send_recv().
int dtnipc_send_recv | ( | dtnipc_handle_t * | handle, | |
dtnapi_message_type_t | type | |||
) |
Send a message and wait for a response over the dtn ipc protocol.
Returns 0 on success, -1 on error.
Definition at line 361 of file dtn_ipc.c.
References DTN_SUCCESS, dtnipc_recv(), dtnipc_send(), and dtnipc_handle::err.
Referenced by dtn_bind(), dtn_cancel(), dtn_cancel_poll(), dtn_recv(), dtn_send(), dtn_session_update(), dtn_unbind(), and dtnipc_close().
int dtnipc_version = DTN_IPC_VERSION |
Definition at line 38 of file dtn_ipc.c.
Referenced by dtnipc_open(), and DTNOpenCommand::exec().