Libtrap: Internal development docs
1.16.1
|
Data Structures | |
struct | msg_header_s |
Typedefs | |
typedef struct msg_header_s | msg_header_t |
Functions | |
int | service_get_data (int sock_d, uint32_t size, void **data) |
int | service_send_data (int sock_d, uint32_t size, void **data) |
int | encode_cnts_to_json (char **data, trap_ctx_priv_t *ctx) |
void * | service_thread_routine (void *arg) |
void | trap_ctx_create_ifc_dump (trap_ctx_t *ctx, const char *path) |
Create dump files. More... | |
int | trap_ctx_get_client_count (trap_ctx_t *ctx, uint32_t ifcidx) |
Get number of connected clients. More... | |
typedef struct msg_header_s msg_header_t |
int encode_cnts_to_json | ( | char ** | data, |
trap_ctx_priv_t * | ctx | ||
) |
int service_get_data | ( | int | sock_d, |
uint32_t | size, | ||
void ** | data | ||
) |
int service_send_data | ( | int | sock_d, |
uint32_t | size, | ||
void ** | data | ||
) |
void * service_thread_routine | ( | void * | arg | ) |
Service IFC thread function.
This function is run in separate thread. It waits for incoming connections e.g. from supervisor. Service IFC can send IFC counters declared in trap_ctx_priv_s
[in] | arg | Pointer to the private libtrap context data (trap_ctx_init()). |
void trap_ctx_create_ifc_dump | ( | trap_ctx_t * | ctx, |
const char * | path | ||
) |
Create dump files.
Create dump files for debug as follows: trap-i[number]-config.txt Output interface configuration. trap-i[number]-buffer.dat Output interface buffer trap-o[number]-config.txt Input interface configuration. trap-o[number]-buffer.dat Input interface buffer
[in] | ctx | Pointer to the private libtrap context data (trap_ctx_init()). |
[in] | path | Output directory, if NULL use current working directory. |
int trap_ctx_get_client_count | ( | trap_ctx_t * | ctx, |
uint32_t | ifcidx | ||
) |
Get number of connected clients.
Output interface (TCP or UNIX) allows to send messages to multiple clients. This function reads number of connected clients from internal interface structure.
[in] | ctx | Pointer to the private libtrap context data (trap_ctx_init()). |
[in] | ifcidx | IFC Index of output interface. |