Libtrap: Internal development docs  1.16.1
Functions
ifc_dummy.h File Reference

TRAP dummy interfaces (generator and blackhole) More...

#include "trap_ifc.h"
Include dependency graph for ifc_dummy.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int create_generator_ifc (trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc)
 
int create_blackhole_ifc (trap_ctx_priv_t *ctx, char *params, trap_output_ifc_t *ifc)
 

Detailed Description

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

Function Documentation

◆ create_blackhole_ifc()

int create_blackhole_ifc ( trap_ctx_priv_t ctx,
char *  params,
trap_output_ifc_t ifc 
)

Create Blackhole interface (output ifc). Send function of this interface does nothing, so everything sent to a blackhole is dropped.

Parameters
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]paramsIgnored.
[out]ifcCreated interface.
Returns
Always returns 0.

Definition at line 227 of file ifc_dummy.c.

◆ create_generator_ifc()

int create_generator_ifc ( trap_ctx_priv_t ctx,
char *  params,
trap_input_ifc_t 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]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]paramsArray of n+1 bytes. First byte is equal to n, other bytes are data the generator should generate.
[out]ifcCreated interface.
Returns
Error code (0 on success). Generated interface is returned in ifc.

Definition at line 113 of file ifc_dummy.c.