TRAP dummy interfaces (generator and blackhole)
More...
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <assert.h>
#include "../include/libtrap/trap.h"
#include "trap_ifc.h"
#include "trap_error.h"
Go to the source code of this file.
|
static void | create_dump (void *priv, uint32_t idx, const char *path) |
|
int | generator_recv (void *priv, void *data, uint32_t *size, int timeout) |
|
void | generator_terminate (void *priv) |
|
void | generator_destroy (void *priv) |
|
char * | generator_ifc_get_id (void *priv) |
|
uint8_t | generator_ifc_is_conn (void *priv) |
|
int | create_generator_ifc (trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc) |
|
int | blackhole_send (void *priv, const void *data, uint16_t size, int timeout) |
|
void | blackhole_flush (void *priv) |
|
void | blackhole_terminate (void *priv) |
|
void | blackhole_destroy (void *priv) |
|
int32_t | blackhole_get_client_count (void *priv) |
|
int8_t | blackhole_get_client_stats_json (void *priv, json_t *client_stats_arr) |
|
char * | blackhole_ifc_get_id (void *priv) |
|
int | create_blackhole_ifc (trap_ctx_priv_t *ctx, char *params, trap_output_ifc_t *ifc) |
|
TRAP dummy interfaces (generator and blackhole)
- Author
- Vaclav Bartos ibart.nosp@m.osv@.nosp@m.fit.v.nosp@m.utbr.nosp@m..cz
- Date
- 2013
-
2014
Definition in file ifc_dummy.c.
◆ generator_private_t
◆ blackhole_destroy()
void blackhole_destroy |
( |
void * |
priv | ) |
|
◆ blackhole_flush()
void blackhole_flush |
( |
void * |
priv | ) |
|
◆ blackhole_get_client_count()
int32_t blackhole_get_client_count |
( |
void * |
priv | ) |
|
◆ blackhole_get_client_stats_json()
int8_t blackhole_get_client_stats_json |
( |
void * |
priv, |
|
|
json_t * |
client_stats_arr |
|
) |
| |
◆ blackhole_ifc_get_id()
char* blackhole_ifc_get_id |
( |
void * |
priv | ) |
|
◆ blackhole_send()
int blackhole_send |
( |
void * |
priv, |
|
|
const void * |
data, |
|
|
uint16_t |
size, |
|
|
int |
timeout |
|
) |
| |
◆ blackhole_terminate()
void blackhole_terminate |
( |
void * |
priv | ) |
|
◆ create_blackhole_ifc()
Create Blackhole interface (output ifc). Send function of this interface does nothing, so everything sent to a blackhole is dropped.
- Parameters
-
[in] | ctx | Pointer to the private libtrap context data (trap_ctx_init()). |
[in] | params | Ignored. |
[out] | ifc | Created interface. |
- Returns
- Always returns 0.
Definition at line 227 of file ifc_dummy.c.
◆ create_dump()
static void create_dump |
( |
void * |
priv, |
|
|
uint32_t |
idx, |
|
|
const char * |
path |
|
) |
| |
|
static |
◆ create_generator_ifc()
Create Generator interface (input ifc). Receive function of this interface returns always the same data. These data are given in params on creation.
- Parameters
-
[in] | ctx | Pointer to the private libtrap context data (trap_ctx_init()). |
[in] | params | Array of n+1 bytes. First byte is equal to n, other bytes are data the generator should generate. |
[out] | ifc | Created interface. |
- Returns
- Error code (0 on success). Generated interface is returned in ifc.
Definition at line 113 of file ifc_dummy.c.
◆ generator_destroy()
void generator_destroy |
( |
void * |
priv | ) |
|
◆ generator_ifc_get_id()
char* generator_ifc_get_id |
( |
void * |
priv | ) |
|
◆ generator_ifc_is_conn()
uint8_t generator_ifc_is_conn |
( |
void * |
priv | ) |
|
◆ generator_recv()
int generator_recv |
( |
void * |
priv, |
|
|
void * |
data, |
|
|
uint32_t * |
size, |
|
|
int |
timeout |
|
) |
| |
◆ generator_terminate()
void generator_terminate |
( |
void * |
priv | ) |
|