Libtrap: Internal development docs
1.16.1
|
TRAP file interfaces. More...
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <inttypes.h>
#include <arpa/inet.h>
#include <wordexp.h>
#include <unistd.h>
#include <sys/stat.h>
#include <errno.h>
#include "../include/libtrap/trap.h"
#include "trap_ifc.h"
#include "trap_internal.h"
#include "trap_error.h"
#include "ifc_file.h"
Go to the source code of this file.
Macros | |
#define | _GNU_SOURCE |
Functions | |
void | file_destroy (void *priv) |
Close file and free allocated memory. More... | |
void | file_terminate (void *priv) |
Set interface state as terminated. More... | |
int | _mkdir (const char *path) |
Create path, recursive. More... | |
static void | file_create_dump (void *priv, uint32_t idx, const char *path) |
Create file dump with current configuration (for debugging) More... | |
int | create_next_filename (file_private_t *config) |
Create a new path and filename from the template created during interface initialization. New filename is stored in file_private_t->filename. More... | |
int | switch_file (file_private_t *c) |
Close previous file, open next file (name taken in file_private_t->filename). Negotiation must be performed after changing the file. More... | |
int | file_recv (void *priv, void *data, uint32_t *size, int timeout) |
Read data from a file. More... | |
char * | file_recv_ifc_get_id (void *priv) |
uint8_t | file_recv_ifc_is_conn (void *priv) |
int | create_file_recv_ifc (trap_ctx_priv_t *ctx, const char *params, trap_input_ifc_t *ifc, uint32_t idx) |
Allocate and initiate file input interface. This function is called by TRAP library to initialize one input interface. More... | |
void | switch_file_wrapper (void *priv) |
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... | |
#define _GNU_SOURCE |
Definition at line 43 of file ifc_file.c.