Libtrap: Internal development docs
1.16.1
|
Data Structures | |
struct | client_s |
Structure for TCP/IP IFC client information. More... | |
struct | tcpip_sender_private_s |
Structure for TCP/IP IFC private information. More... | |
Typedefs | |
typedef struct client_s | client_t |
Structure for TCP/IP IFC client information. More... | |
typedef struct tcpip_sender_private_s | tcpip_sender_private_t |
Structure for TCP/IP IFC private information. More... | |
Functions | |
static void | disconnect_client (tcpip_sender_private_t *priv, int cl_id) |
This function is called when a client was/is being disconnected. More... | |
void | tcpip_server_disconnect_all_clients (void *priv) |
Function disconnects all clients of the output interface whose private structure is passed via "priv" parameter. More... | |
static void * | accept_clients_thread (void *arg) |
This function runs in a separate thread and handles new client's connection requests. More... | |
static void | finish_buffer (tcpip_sender_private_t *priv, buffer_t *buffer) |
Write buffer size to its header and shift active index. More... | |
void | tcpip_sender_flush (void *priv) |
Force flush of active buffer. More... | |
static int | send_data (tcpip_sender_private_t *priv, client_t *c, uint32_t cl_id) |
Send data to client from his assigned buffer. More... | |
static void * | sending_thread_func (void *priv) |
This function runs in a separate thread. It handles sending data to connected clients for TCPIP and UNIX interfaces. More... | |
int | tcpip_sender_send (void *priv, const void *data, uint16_t size, int timeout) |
Store message into buffer. More... | |
void | tcpip_sender_terminate (void *priv) |
Set interface state as terminated. More... | |
void | tcpip_sender_destroy (void *priv) |
Destructor of TCP sender (output ifc) More... | |
int32_t | tcpip_sender_get_client_count (void *priv) |
int8_t | tcpip_sender_get_client_stats_json (void *priv, json_t *client_stats_arr) |
static void | tcpip_sender_create_dump (void *priv, uint32_t idx, const char *path) |
char * | tcpip_send_ifc_get_id (void *priv) |
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 output interface. More... | |
static int | server_socket_open (void *priv) |
Open TCPIP socket for sender module. More... | |
typedef struct tcpip_sender_private_s tcpip_sender_private_t |
Structure for TCP/IP IFC private information.
|
static |
This function runs in a separate thread and handles new client's connection requests.
[in] | arg | Pointer to interface's private data structure. |
Definition at line 1026 of file ifc_tcpip.c.
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 output interface.
[in,out] | ctx | Pointer to the private libtrap context data (trap_ctx_init()). |
[in] | params | Configuration string containing interface specific parameters -
|
[in,out] | ifc | IFC interface used for calling TCP/IP module. |
[in] | idx | Index of IFC that is created. |
[in] | type | select the type of socket (see tcpip_ifc_sockettype for options) |
Definition at line 1730 of file ifc_tcpip.c.
|
inlinestatic |
This function is called when a client was/is being disconnected.
[in] | priv | Pointer to interface's private data structure. |
[in] | cl_id | Index of the client in 'clients' array. |
Definition at line 982 of file ifc_tcpip.c.
|
inlinestatic |
Write buffer size to its header and shift active index.
[in] | priv | Pointer to output interface private structure. |
[in] | buffer | Pointer to the buffer. |
Definition at line 1144 of file ifc_tcpip.c.
|
inlinestatic |
Send data to client from his assigned buffer.
[in] | priv | Pointer to iterface's private data structure. |
[in] | c | Pointer to the client's structure. |
[in] | cl_id | Client's index in the 'clients' array. |
Definition at line 1190 of file ifc_tcpip.c.
|
static |
This function runs in a separate thread. It handles sending data to connected clients for TCPIP and UNIX interfaces.
[in] | priv | pointer to interface private data |
Definition at line 1239 of file ifc_tcpip.c.
|
static |
Open TCPIP socket for sender module.
[in] | priv | tcpip_sender_private_t structure (private data) |
Definition at line 1910 of file ifc_tcpip.c.
char* tcpip_send_ifc_get_id | ( | void * | priv | ) |
Definition at line 1705 of file ifc_tcpip.c.
|
static |
Definition at line 1654 of file ifc_tcpip.c.
void tcpip_sender_destroy | ( | void * | priv | ) |
Destructor of TCP sender (output ifc)
[in] | priv | pointer to module private data |
Definition at line 1561 of file ifc_tcpip.c.
void tcpip_sender_flush | ( | void * | priv | ) |
Force flush of active buffer.
[in] | priv | pointer to interface private data |
Definition at line 1168 of file ifc_tcpip.c.
int32_t tcpip_sender_get_client_count | ( | void * | priv | ) |
Definition at line 1616 of file ifc_tcpip.c.
int8_t tcpip_sender_get_client_stats_json | ( | void * | priv, |
json_t * | client_stats_arr | ||
) |
Definition at line 1627 of file ifc_tcpip.c.
int tcpip_sender_send | ( | void * | priv, |
const void * | data, | ||
uint16_t | size, | ||
int | timeout | ||
) |
Store message into buffer.
[in] | priv | pointer to module private data |
[in] | data | pointer to data to write |
[in] | size | size of data to write |
[in] | timeout | maximum time spent waiting for the message to be stored [microseconds] |
Definition at line 1434 of file ifc_tcpip.c.
void tcpip_sender_terminate | ( | void * | priv | ) |
Set interface state as terminated.
[in] | priv | pointer to module private data |
Definition at line 1531 of file ifc_tcpip.c.
void tcpip_server_disconnect_all_clients | ( | void * | priv | ) |
Function disconnects all clients of the output interface whose private structure is passed via "priv" parameter.
[in] | priv | Pointer to output interface private structure. |
Definition at line 1009 of file ifc_tcpip.c.