Libtrap: Internal development docs
1.16.1
|
Functions | |
int | file_write_buffer (void *priv, const void *data, uint32_t size, int timeout) |
Write data to a file. Data to write are expected as a trap_buffer_header_t structure, thus actual length of data to be written is determined from trap_buffer_header_t->data_length trap_buffer_header_t->data_length is expected to be in network byte order (little endian) More... | |
static void | finish_buffer (file_buffer_t *buffer) |
static void | insert_into_buffer (file_buffer_t *buffer, const void *data, uint16_t size) |
void | file_flush (void *priv) |
static int | file_send (void *priv, const void *data, uint16_t size, int timeout) |
Store message into buffer. Write buffer into file if full. If buffering is disabled, the message is sent to the output interface immediately. More... | |
int32_t | file_get_client_count (void *priv) |
int8_t | file_get_client_stats_json (void *priv, json_t *client_stats_arr) |
char * | file_send_ifc_get_id (void *priv) |
int | create_file_send_ifc (trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx) |
Allocate and initiate file output interface. This function is called by TRAP library to initialize one output interface. More... | |
int create_file_send_ifc | ( | trap_ctx_priv_t * | ctx, |
const char * | params, | ||
trap_output_ifc_t * | ifc, | ||
uint32_t | idx | ||
) |
Allocate and initiate file output interface. 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 colon separated values of these parameters (in this exact order): file_name:open_mode, where file_name is a path to a file in which data is to be written and open_mode is either a - append or w - write, if no mode is specified, the file will be opened in append mode. |
[in,out] | ifc | IFC interface used for calling file module. |
[in] | idx | Index of IFC that is created. |
Definition at line 765 of file ifc_file.c.
void file_flush | ( | void * | priv | ) |
Definition at line 655 of file ifc_file.c.
int32_t file_get_client_count | ( | void * | priv | ) |
Definition at line 738 of file ifc_file.c.
int8_t file_get_client_stats_json | ( | void * | priv, |
json_t * | client_stats_arr | ||
) |
Definition at line 743 of file ifc_file.c.
|
inlinestatic |
Store message into buffer. Write buffer into file if full. If buffering is disabled, the message is sent to the output interface immediately.
[in] | priv | pointer to module private data |
[in] | data | pointer to data to write |
[in] | size | size of data to write |
[in] | timeout | NOT USED IN THIS INTERFACE |
Definition at line 688 of file ifc_file.c.
char* file_send_ifc_get_id | ( | void * | priv | ) |
Definition at line 749 of file ifc_file.c.
int file_write_buffer | ( | void * | priv, |
const void * | data, | ||
uint32_t | size, | ||
int | timeout | ||
) |
Write data to a file. Data to write are expected as a trap_buffer_header_t structure, thus actual length of data to be written is determined from trap_buffer_header_t->data_length trap_buffer_header_t->data_length is expected to be in network byte order (little endian)
[in] | priv | pointer to module private data |
[in] | data | pointer to data to write |
[in] | size | size of data to write - NOT USED IN THIS INTERFACE |
[in] | timeout | NOT USED IN THIS INTERFACE |
Definition at line 564 of file ifc_file.c.
|
inlinestatic |
Definition at line 640 of file ifc_file.c.
|
inlinestatic |
Definition at line 647 of file ifc_file.c.