Libtrap: Internal development docs
1.16.1
|
Data Structures | |
struct | tlsclient_s |
Structure for TLS IFC client information. More... | |
struct | tls_sender_private_s |
Structure for TLS IFC private information. More... | |
Typedefs | |
typedef struct tlsclient_s | tlsclient_t |
Structure for TLS IFC client information. More... | |
typedef struct tls_sender_private_s | tls_sender_private_t |
Structure for TLS IFC private information. More... | |
Functions | |
static void | disconnect_client (tls_sender_private_t *priv, int cl_id) |
This function is called when a client was/is being disconnected. More... | |
void | tls_server_disconnect_all_clients (void *priv) |
Function disconnects all clients of the output interface whose private structure is passed via "priv" parameter. More... | |
static uint64_t | get_cur_timestamp () |
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 (tls_sender_private_t *priv, buffer_t *buffer) |
Write buffer size to its header and shift active index. More... | |
void | tls_sender_flush (void *priv) |
Force flush of active buffer. More... | |
static int | send_data (tls_sender_private_t *priv, tlsclient_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 TLS interface. More... | |
int | tls_sender_send (void *priv, const void *data, uint16_t size, int timeout) |
Store message into buffer. More... | |
void | tls_sender_terminate (void *priv) |
Set interface state as terminated. More... | |
void | tls_sender_destroy (void *priv) |
Destructor of TCP sender (output ifc) More... | |
int32_t | tls_sender_get_client_count (void *priv) |
int8_t | tls_sender_get_client_stats_json (void *priv, json_t *client_stats_arr) |
static void | tls_sender_create_dump (void *priv, uint32_t idx, const char *path) |
char * | tls_send_ifc_get_id (void *priv) |
int | create_tls_sender_ifc (trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx) |
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 TLS socket for sender module. More... | |
typedef struct tls_sender_private_s tls_sender_private_t |
Structure for TLS IFC private information.
typedef struct tlsclient_s tlsclient_t |
Structure for TLS IFC client information.
|
static |
int create_tls_sender_ifc | ( | trap_ctx_priv_t * | ctx, |
const char * | params, | ||
trap_output_ifc_t * | ifc, | ||
uint32_t | idx | ||
) |
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 space separated values of these parameters (in this exact order): server_port max_clients, where dest_addr is destination address of output TCP/IP IFC module and dest_port is the port where sender is listening. |
[in,out] | ifc | IFC interface used for calling TCP/IP module. |
[in] | idx | Index of IFC that is created. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Return current time in microseconds.
This is used to get current timestamp in tls_sender_send().
|
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. |
|
static |
|
static |
|
static |
void tls_sender_destroy | ( | void * | priv | ) |
void tls_sender_flush | ( | void * | priv | ) |
int8_t tls_sender_get_client_stats_json | ( | void * | priv, |
json_t * | client_stats_arr | ||
) |
int tls_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] |
void tls_sender_terminate | ( | void * | priv | ) |