45 #include <arpa/inet.h> 47 #include <netinet/in.h> 51 #include <sys/socket.h> 53 #include <sys/types.h> 61 #include <semaphore.h> 65 #include "../include/libtrap/trap.h" 82 #define MAX_RECOVERY_TRY 10 84 #define RECOVERY_WAIT_USEC 500000 85 #define USEC_IN_SEC 1000000 86 #define ACK_MESS_SIZE 1 87 #define CRIT_1VS2SEND 10000 89 #define MAX(a,b) ((a)<(b)?(b):(a)) 92 #define MIN(a,b) ((a)>(b)?(b):(a)) 110 static int client_socket_connect(
void *priv,
const char *dest_addr,
const char *dest_port,
int *socket_descriptor,
struct timeval *tv);
121 if (sa->sa_family == AF_INET) {
122 return &(((
struct sockaddr_in*)sa)->sin_addr);
125 return &(((
struct sockaddr_in6*)sa)->sin6_addr);
140 uint32_t portnum = 0;
147 ret = sscanf(port,
"%" SCNu32, &portnum);
149 if (portnum < 1 || portnum > 65535) {
150 VERBOSE(
CL_ERROR,
"Given port (%" PRIu32
") number is out of the allowed range (1-65535).", portnum);
179 void *data_p = (*data);
181 ssize_t numbytes = *size;
184 struct timespec ts, *tempts = NULL;
186 ts.tv_sec = tm->tv_sec;
187 ts.tv_nsec = tm->tv_usec * 1000l;
191 assert(data_p != NULL);
195 "s%"PRIu64
"us", tm->tv_sec, tm->tv_usec)});
201 pfds = (
struct pollfd) {.fd = config->
sd, .events = POLLIN};
202 retval = ppoll(&pfds, 1, tempts, NULL);
203 if (retval > 0 && pfds.revents & POLLIN) {
205 recvb = recv(config->
sd, data_p, numbytes, 0);
232 }
while (numbytes > 0);
236 }
else if ((retval == 0) || (retval < 0 && errno == EINTR)) {
260 struct timespec spec_time;
262 clock_gettime(CLOCK_MONOTONIC, &spec_time);
264 return spec_time.tv_sec * 1000000 + (spec_time.tv_nsec / 1000);
304 #ifdef LIMITED_RECOVERY 305 uint32_t recovery = 0;
310 void *p = &messageframe;
311 struct timeval tm, *temptm;
314 uint64_t curr_time = 0;
319 struct timespec sleeptimespec;
325 if ((config == NULL) || (
data == NULL) || (size == NULL)) {
334 temptm = (timeout ==
TRAP_WAIT) ? NULL : &tm;
364 #ifdef LIMITED_RECOVERY 376 if ((curr_time - entry_time) >= timeout) {
383 sleeptime = timeout - (curr_time - entry_time);
385 if (sleeptime < 1000000) {
386 sleeptimespec.tv_sec = sleeptime / 1000000;
387 sleeptimespec.tv_nsec = (sleeptime % 1000000) * 1000;
389 " us: %"PRIu64
"s%"PRIu64
"ns", sleeptime,
390 sleeptimespec.tv_sec, sleeptimespec.tv_nsec));
392 sleeptimespec.tv_sec = 1;
393 sleeptimespec.tv_nsec = 0;
397 if (nanosleep(&sleeptimespec, NULL) == -1) {
398 if (errno == EINTR) {
409 sleeptime = timeout - (int) (curr_time - entry_time);
410 if ((
int) sleeptime > 0) {
465 #ifdef ENABLE_CHECK_HEADER 467 if (tcpip_check_header(&messageframe) == 0) {
507 if (config != NULL) {
522 #define X(p) if (p != NULL) { \ 527 if (config != NULL) {
547 char *conf_file = NULL;
549 char *buf_file = NULL;
554 r = asprintf(&conf_file,
"%s/trap-i%02"PRIu32
"-config.txt", path, idx);
556 VERBOSE(
CL_ERROR,
"Not enough memory, dump failed. (%s:%d)", __FILE__, __LINE__);
560 f = fopen(conf_file,
"w");
561 fprintf(f,
"Dest addr: %s\nDest port: %s\nConnected: %d\n" 562 "Terminated: %d\nSocket descriptor: %d\nSocket type: %d\n" 563 "Data pointer: %p\nData wait size: %"PRIu32
"\nMessage header: %"PRIu32
"\n" 564 "Extern buffer pointer: %p\nExtern buffer data size: %"PRIu32
"\n" 565 "Timeout: %"PRId32
"us (%s)\n",
574 r = asprintf(&buf_file,
"%s/trap-i%02"PRIu32
"-buffer.dat", path, idx);
577 VERBOSE(
CL_ERROR,
"Not enough memory, dump failed. (%s:%d)", __FILE__, __LINE__);
580 f = fopen(buf_file,
"w");
582 VERBOSE(
CL_ERROR,
"Writing buffer header failed. (%s:%d)", __FILE__, __LINE__);
586 VERBOSE(
CL_ERROR,
"Writing buffer content failed. (%s:%d)", __FILE__, __LINE__);
638 #define X(pointer) free(pointer); \ 642 char *param_iterator = NULL;
643 char *dest_addr = NULL;
644 char *dest_port = NULL;
647 if (params == NULL) {
653 if (config == NULL) {
654 VERBOSE(
CL_ERROR,
"Failed to allocate internal memory for input IFC.");
664 if (param_iterator == NULL) {
666 if ((dest_addr == NULL) || (strlen(dest_addr) == 0)) {
669 goto failsafe_cleanup;
673 if ((dest_port == NULL) || (strlen(dest_port) == 0)) {
676 dest_port = dest_addr;
677 dest_addr = strdup(
"localhost");
678 VERBOSE(
CL_VERBOSE_BASIC,
"Using the only parameter as 'destination port' and \"localhost\" as 'destination address' for TCPIP IFC.");
690 VERBOSE(
CL_ERROR,
"Malformed params for input IFC, missing destination address and port.");
692 goto failsafe_cleanup;
703 #ifndef ENABLE_NEGOTIATION 705 struct timeval tv = {5, 0};
708 config->connected = 0;
712 goto failsafe_cleanup;
715 config->connected = 1;
728 #ifndef ENABLE_NEGOTIATION 729 if (config->connected == 0) {
733 goto failsafe_cleanup;
772 struct pollfd pfds = {.fd = sock, .events = POLLOUT};
773 struct timespec ts, *tempts = NULL;
775 ts.tv_sec = tv->tv_sec;
776 ts.tv_nsec = tv->tv_usec * 1000l;
780 rv = ppoll(&pfds, 1, tempts, NULL);
781 if (rv == 1 && pfds.revents & POLLOUT) {
783 socklen_t len =
sizeof so_error;
785 getsockopt(sock, SOL_SOCKET, SO_ERROR, &so_error, &len);
804 static int client_socket_connect(
void *priv,
const char *dest_addr,
const char *dest_port,
int *socket_descriptor,
struct timeval *tv)
807 int sockfd = -1, options;
809 struct addrinfo *servinfo, *p = NULL;
810 int rv = 0, addr_count = 0;
811 char s[INET6_ADDRSTRLEN];
813 if ((config == NULL) || (dest_addr == NULL) || (dest_port == NULL) || (socket_descriptor == NULL)) {
820 memset(&addr, 0,
sizeof(addr));
826 if ((rv = getaddrinfo(dest_addr, dest_port, &addr.
tcpip_addr, &servinfo)) != 0) {
835 for (p = servinfo; p != NULL; p = p->ai_next) {
838 tv->tv_sec = (tv->tv_sec * 1000000 + tv->tv_usec) / addr_count;
839 tv->tv_usec = tv->tv_sec % 1000000;
840 tv->tv_sec /= 1000000;
842 tv->tv_sec, tv->tv_usec);
846 for (p = servinfo; p != NULL; p = p->ai_next) {
847 if ((sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) {
853 if ((options = fcntl(sockfd, F_GETFL)) != -1) {
854 if (fcntl(sockfd, F_SETFL, O_NONBLOCK | options) == -1) {
860 if (connect(sockfd, p->ai_addr, p->ai_addrlen) == -1) {
861 if (errno != EINPROGRESS && errno != EAGAIN) {
887 if (inet_ntop(p->ai_family,
get_in_addr((
struct sockaddr *)p->ai_addr), s,
sizeof s) != NULL) {
891 freeaddrinfo(servinfo);
896 sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
898 if (connect(sockfd, (
struct sockaddr *) &addr.
unix_addr,
sizeof(addr.
unix_addr)) < 0) {
922 *socket_descriptor = sockfd;
926 #ifdef ENABLE_NEGOTIATION 938 VERBOSE(
CL_VERBOSE_LIBRARY,
"Input_ifc_negotiation result: success (format has changed; it was not first negotiation).");
942 VERBOSE(
CL_VERBOSE_LIBRARY,
"Input_ifc_negotiation result: success (required set of fields of the input interface is subset of the recevied format).");
946 VERBOSE(
CL_VERBOSE_LIBRARY,
"Input_ifc_negotiation result: success (new recevied format specifier is subset of the old one; it was not first negotiation).");
950 VERBOSE(
CL_VERBOSE_LIBRARY,
"Input_ifc_negotiation result: failed (error while receiving hello message from output interface).");
996 shutdown(c->
sd, SHUT_RDWR);
1028 char remoteIP[INET6_ADDRSTRLEN];
1029 struct sockaddr_storage remoteaddr;
1035 struct sockaddr *tmpaddr;
1037 uint32_t ucredlen =
sizeof(
struct ucred);
1038 uint32_t client_id = 0;
1042 addrlen =
sizeof(remoteaddr);
1047 pfds = (
struct pollfd) {.fd = c->
server_sd, .events = POLLIN};
1049 if (poll(&pfds, 1, -1) == -1) {
1050 if (errno == EINTR) {
1056 VERBOSE(
CL_ERROR,
"%s:%d unexpected error code %d", __func__, __LINE__, errno);
1060 if (pfds.revents & POLLIN) {
1061 newclient = accept(c->
server_sd, (
struct sockaddr *) &remoteaddr, &addrlen);
1062 if (newclient == -1) {
1066 tmpaddr = (
struct sockaddr *) &remoteaddr;
1067 switch (((
struct sockaddr *) tmpaddr)->sa_family) {
1069 client_id = ntohs(((
struct sockaddr_in *) tmpaddr)->sin_port);
1072 client_id = ntohs(((
struct sockaddr_in6 *) tmpaddr)->sin6_port);
1077 if (getsockopt(newclient, SOL_SOCKET, SO_PEERCRED, &ucred, &ucredlen) == -1) {
1080 client_id = (uint32_t) ucred.pid;
1085 inet_ntop(remoteaddr.ss_family,
get_in_addr((
struct sockaddr*) &remoteaddr), remoteIP, INET6_ADDRSTRLEN),
1109 #ifdef ENABLE_NEGOTIATION 1114 VERBOSE(
CL_VERBOSE_LIBRARY,
"Output_ifc_negotiation result: failed (unknown data format of this output interface -> refuse client).");
1118 VERBOSE(
CL_VERBOSE_LIBRARY,
"Output_ifc_negotiation result: failed (error while sending hello message to input interface).");
1129 shutdown(newclient, SHUT_RDWR);
1149 uint32_t header = htonl(buffer->
wr_index);
1150 memcpy(buffer->
header, &header,
sizeof(header));
1246 uint64_t send_entry_time;
1247 uint64_t send_exit_time;
1248 uint8_t waiting_clients;
1250 int clients_pfds_size;
1251 struct pollfd *pfds;
1252 int64_t time_since_flush;
1271 clients_pfds_size = 0;
1272 waiting_clients = 0;
1289 receiving_clients_array[i] = 0;
1296 ++clients_pfds_size;
1297 *pfds = (
struct pollfd) {.fd = cl->
sd, .events = POLLIN};
1309 pfds->events = pfds->events | POLLOUT;
1310 receiving_clients_array[i] = 1;
1316 clock_gettime(CLOCK_REALTIME, &ts);
1318 ts.tv_nsec += (ts.tv_sec * 1000000000L) + (timeout * 1000L);
1319 ts.tv_sec = (ts.tv_nsec / 1000000000L);
1320 ts.tv_nsec %= 1000000000L;
1328 res = poll(c->
clients_pfds, clients_pfds_size, poll_timeout);
1336 VERBOSE(
CL_ERROR,
"Sending thread: unexpected error in select (errno: %i)", errno);
1343 }
else if (res == 0) {
1354 if (receiving_clients_array[i] && cl->
timeouts > 0) {
1357 receiving_clients_array[i] = 0;
1359 }
else if (cl->
sd < 0) {
1361 receiving_clients_array[i] = 0;
1379 receiving_clients_array[i] = 0;
1391 assert(pfds->fd == cl->
sd);
1394 if (pfds->revents & POLLIN) {
1404 if (pfds->revents & POLLOUT) {
1410 cl->
timer_last = (send_exit_time - send_entry_time);
1437 uint32_t free_bytes;
1446 VERBOSE(
CL_ERROR,
"Buffer is too small for this message. Skipping...");
1466 while (buffer->clients_bit_arr != 0) {
1467 clock_gettime(CLOCK_REALTIME, &ts);
1469 ts.tv_nsec += (ts.tv_sec * 1000000000L) + (timeout * 1000L);
1470 ts.tv_sec = (ts.tv_nsec / 1000000000L);
1471 ts.tv_nsec %= 1000000000L;
1497 if (free_bytes >= (size +
sizeof(size))) {
1552 VERBOSE(
CL_ERROR,
"Destroying IFC that is probably not initialized.");
1564 char *unix_socket_path = NULL;
1568 #define X(x) free(x); x = NULL; 1573 if (unix_socket_path != NULL) {
1574 unlink(unix_socket_path);
1575 X(unix_socket_path);
1630 json_t *client_stats = NULL;
1643 if (client_stats == NULL) {
1647 if (json_array_append_new(client_stats_arr, client_stats) == -1) {
1660 char *conf_file = NULL;
1665 r = asprintf(&conf_file,
"%s/trap-o%02"PRIu32
"-config.txt", path, idx);
1667 VERBOSE(
CL_ERROR,
"Not enough memory, dump failed. (%s:%d)", __FILE__, __LINE__);
1671 f = fopen(conf_file,
"w");
1672 fprintf(f,
"Server port: %s\n" 1673 "Server socket descriptor: %d\n" 1674 "Connected clients: %d\n" 1676 "Active buffer: %d\n" 1677 "Buffer count: %u\n" 1694 fprintf(f,
"Clients:\n");
1733 char *param_iterator = NULL;
1734 char *param_str = NULL;
1735 char *server_port = NULL;
1742 #define X(pointer) free(pointer); \ 1746 if (params == NULL) {
1756 goto failsafe_cleanup;
1761 if ((server_port == NULL) || (strlen(server_port) == 0)) {
1764 goto failsafe_cleanup;
1768 while (param_iterator != NULL) {
1770 if (param_str == NULL)
1774 VERBOSE(
CL_ERROR,
"Optional buffer count given, but it is probably in wrong format.");
1779 VERBOSE(
CL_ERROR,
"Optional buffer size given, but it is probably in wrong format.");
1784 VERBOSE(
CL_ERROR,
"Optional max clients number given, but it is probably in wrong format.");
1797 goto failsafe_cleanup;
1799 for (i = 0; i < buffer_count; ++i) {
1802 b->
header = malloc(buffer_size +
sizeof(buffer_size));
1806 goto failsafe_cleanup;
1817 goto failsafe_cleanup;
1823 goto failsafe_cleanup;
1825 for (i = 0; i < max_clients; ++i) {
1858 VERBOSE(
CL_ERROR,
"Socket could not be opened on given port '%s'.", server_port);
1859 goto failsafe_cleanup;
1863 VERBOSE(
CL_ERROR,
"Opening of pipe failed. Using stdin as a fall back.");
1916 struct addrinfo *ai, *p = NULL;
1922 memset(&addr, 0,
sizeof(addr));
1937 for (p = ai; p != NULL; p = p->ai_next) {
1938 c->
server_sd = socket(p->ai_family, p->ai_socktype, p->ai_protocol);
1944 if (setsockopt(c->
server_sd, SOL_SOCKET, SO_REUSEADDR, &yes,
sizeof(
int)) == -1) {
1945 VERBOSE(
CL_ERROR,
"Failed to set socket to reuse address. (%d)", errno);
1948 if (bind(c->
server_sd, p->ai_addr, p->ai_addrlen) < 0) {
1961 c->
server_sd = socket(AF_UNIX, SOCK_STREAM, 0);
1964 p = (
struct addrinfo *) &addr.
unix_addr;
1965 if (chmod(addr.
unix_addr.sun_path, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) == -1) {
static int client_socket_connect(void *priv, const char *dest_addr, const char *dest_port, int *socket_descriptor, struct timeval *tv)
client_socket is used as a receiver
#define BUFFER_SIZE_PARAM_LENGTH
#define TRAP_E_OK
Success, no error.
int tcpip_receiver_recv(void *priv, void *data, uint32_t *size, int timeout)
Receive data from interface.
char * trap_get_param_by_delimiter(const char *source, char **dest, const char delimiter)
Splitter of params string. Cut the first param, copy it into dest and returns pointer to the start of...
uint32_t connected_clients
ifc_get_client_stats_json_func_t get_client_stats_json
Pointer to get_client_stats_json function.
#define NEG_RES_SENDER_FMT_SUBSET
If the data format of input and output interfaces is the same and new data specifier of the output in...
char * tcpip_send_ifc_get_id(void *priv)
Internal functions and macros for libtrap Verbose and debug macros from libcommlbr.
static void disconnect_client(tcpip_sender_private_t *priv, int cl_id)
This function is called when a client was/is being disconnected.
#define TRAP_IFC_PARAM_DELIMITER
int create_tcpip_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type)
Constructor of input TCP/IP IFC module. This function is called by TRAP library to initialize one inp...
pthread_cond_t cond_full_buffer
struct trap_buffer_header_s trap_buffer_header_t
pthread_mutex_t ifc_mtx
Locking mutex for interface.
char * trap_default_socket_path_format
static int server_socket_open(void *priv)
Open TCPIP socket for sender module.
pthread_mutex_t mtx_no_data
#define NEG_RES_FAILED
If receiving the data from output interface fails or sending the data to input interface fails...
void tcpip_sender_terminate(void *priv)
Set interface state as terminated.
void trap_set_timeouts(int timeout, struct timeval *tm, struct timespec *tmnblk)
Internal function for setting of timeout structs according to libtrap timeout.
ifc_get_id_func_t get_id
Pointer to get_id function.
enum tcpip_ifc_sockettype socket_type
#define TRAP_TIMEOUT_STR(t)
#define TRAP_E_FIELDS_MISMATCH
Returned when receiver fields are not subset of sender fields.
static uint64_t get_cur_timestamp()
struct sockaddr_un unix_addr
used for path of UNIX socket
TRAP TCP/IP interfaces private structures.
static void tcpip_receiver_create_dump(void *priv, uint32_t idx, const char *path)
int output_ifc_negotiation(void *ifc_priv_data, char ifc_type, uint32_t client_idx)
static void insert_into_buffer(file_buffer_t *buffer, const void *data, uint16_t size)
static void set_index(uint64_t *bits, int i)
Set i-th element (one bit) of 'bits' to 1.
void tcpip_receiver_destroy(void *priv)
Destructor of TCPIP receiver (input ifc)
#define UNIX_PATH_FILENAME_FORMAT
uint64_t autoflush_timestamp
void tcpip_sender_flush(void *priv)
Force flush of active buffer.
use UNIX socket as a service interface
static void del_index(uint64_t *bits, int i)
Set i-th element (one bit) of 'bits' to 0.
#define TRAP_E_TERMINATED
Interface was terminated during reading/writing.
static void client_socket_disconnect(void *priv)
static int wait_for_connection(int sock, struct timeval *tv)
ifc_create_dump_func_t create_dump
Pointer to function for generating of dump.
void tcpip_sender_destroy(void *priv)
Destructor of TCP sender (output ifc)
#define TRAP_E_IO_ERROR
IO Error.
#define NEG_RES_FMT_CHANGED
If the data format has changed (for JSON type, UNIREC type uses *SUBSET variants) ...
struct pollfd * clients_pfds
#define VERBOSE(level, format, args...)
static void tcpip_sender_create_dump(void *priv, uint32_t idx, const char *path)
static int trap_errorf(trap_ctx_priv_t *ctx, int err_num, const char *msg,...)
ifc_get_client_count_func_t get_client_count
Pointer to get_client_count function.
#define NEG_RES_CONT
If the data format and data specifier of input and output interface are the same (input interface can...
ifc_disconn_clients_func_t disconn_clients
Pointer to disconnect_clients function.
int32_t tcpip_sender_get_client_count(void *priv)
void tcpip_receiver_terminate(void *priv)
Set interface state as terminated.
Structure for TCP/IP IFC private information.
int8_t tcpip_sender_get_client_stats_json(void *priv, json_t *client_stats_arr)
#define TRAP_E_BAD_FPARAMS
Bad parameters of function.
use UNIX socket for local communication
int tcpip_sender_send(void *priv, const void *data, uint16_t size, int timeout)
Store message into buffer.
pthread_cond_t cond_no_data
static void * accept_clients_thread(void *arg)
This function runs in a separate thread and handles new client's connection requests.
char bufferswitch
Enable (1) or Disable (0) buffering, default is Enabled (1).
#define TRAP_IFC_TYPE_TCPIP
trap_ifc_tcpip (input&output part)
#define DEFAULT_BUFFER_SIZE
trap_buffer_header_t int_mess_header
static uint64_t check_index(uint64_t bits, int i)
Return value of i-th element (one bit) in the 'bits' array.
Structure for TCP/IP IFC client information.
int32_t datatimeout
Timeout for *_send() calls.
#define TRAP_E_NEGOTIATION_FAILED
Returned by trap_recv when negotiation of the output and input interfaces failed. ...
static int check_portrange(const char *port)
Check if the given port is a correct port number.
ifc_send_func_t send
Pointer to send function.
void tcpip_server_disconnect_all_clients(void *priv)
Function disconnects all clients of the output interface whose private structure is passed via "priv"...
#define NEG_RES_FMT_UNKNOWN
If the output interface has not specified data format.
#define DEFAULT_MAX_CLIENTS
#define TRAP_E_FORMAT_MISMATCH
Returned by trap_recv when data format or data specifier of the output and input interfaces doesn't m...
#define NEG_RES_FMT_MISMATCH
If the data format or data specifier of input and output interfaces does not match.
#define DEFAULT_BUFFER_COUNT
int64_t timeout
Internal structure to send partial data after timeout (autoflush).
static int receive_part(void *priv, void **data, uint32_t *size, struct timeval *tm)
#define TRAP_E_MEMORY
Memory allocation error.
#define NEG_RES_OK
Signaling success (hello message successfully sent to input interface)
struct addrinfo tcpip_addr
used for TCPIP socket
ifc_destroy_func_t destroy
Pointer to destructor function.
int create_tcpip_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type)
Constructor of output TCP/IP IFC module. This function is called by TRAP library to initialize one ou...
ifc_terminate_func_t terminate
Pointer to terminate function.
This file contains common functions and structures used in socket based interfaces (tcp-ip / tls)...
uint32_t clients_arr_size
static int send_data(tcpip_sender_private_t *priv, client_t *c, uint32_t cl_id)
Send data to client from his assigned buffer.
#define TRAP_E_TIMEOUT
Read or write operation timeout.
enum tcpip_ifc_sockettype socket_type
uint64_t * counter_autoflush
#define NEG_RES_RECEIVER_FMT_SUBSET
If the data format of input and output interfaces is the same and data specifier of the input interfa...
static void finish_buffer(tcpip_sender_private_t *priv, buffer_t *buffer)
Write buffer size to its header and shift active index.
#define TCPIP_SOCKETTYPE_STR(st)
#define DEFAULT_MAX_DATA_LENGTH
ifc_flush_func_t flush
Pointer to flush function.
static void * sending_thread_func(void *priv)
This function runs in a separate thread. It handles sending data to connected clients for TCPIP and U...
uint64_t * counter_send_buffer
int input_ifc_negotiation(void *ifc_priv_data, char ifc_type)
void * priv
Pointer to instance's private data.
static void * get_in_addr(struct sockaddr *sa)
Get sockaddr, IPv4 or IPv6.
trap_output_ifc_t * out_ifc_list
#define MAX_CLIENTS_PARAM_LENGTH
Interface of TRAP interfaces.
#define BUFFER_COUNT_PARAM_LENGTH
uint8_t tcpip_recv_ifc_is_conn(void *priv)
char * tcpip_recv_ifc_get_id(void *priv)
trap_input_ifc_t * in_ifc_list
#define TRAP_E_BADPARAMS
Bad parameters passed to interface initializer.
char *trap_default_socket_path_format __attribute__((used))