Libtrap: Internal development docs  1.16.1
Data Structures | Typedefs | Functions
Supervisor monitoring feature

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...
 

Detailed Description

Typedef Documentation

◆ msg_header_t

typedef struct msg_header_s msg_header_t

Function Documentation

◆ encode_cnts_to_json()

int encode_cnts_to_json ( char **  data,
trap_ctx_priv_t ctx 
)

Definition at line 2192 of file trap.c.

◆ service_get_data()

int service_get_data ( int  sock_d,
uint32_t  size,
void **  data 
)

Definition at line 2141 of file trap.c.

◆ service_send_data()

int service_send_data ( int  sock_d,
uint32_t  size,
void **  data 
)

Definition at line 2168 of file trap.c.

◆ service_thread_routine()

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

Parameters
[in]argPointer to the private libtrap context data (trap_ctx_init()).

Definition at line 2294 of file trap.c.

◆ trap_ctx_create_ifc_dump()

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

Parameters
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]pathOutput directory, if NULL use current working directory.

Definition at line 2473 of file trap.c.

◆ trap_ctx_get_client_count()

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.

Parameters
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]ifcidxIFC Index of output interface.
Returns
Number of connected clients. -1 on error.

Definition at line 2495 of file trap.c.