Libtrap: Internal development docs  1.16.1
Functions
Buffering sublayer

Functions

int trap_check_buffer_content (void *buffer, uint32_t buffer_size)
 Check content of buffer, iterate over message headers. More...
 
static int trap_read_from_buffer (trap_ctx_priv_t *ctx, uint32_t ifc_idx, const void **data, uint16_t *size, int timeout)
 

Detailed Description

Function Documentation

◆ trap_check_buffer_content()

int trap_check_buffer_content ( void *  buffer,
uint32_t  buffer_size 
)

Check content of buffer, iterate over message headers.

Parameters
[in]bufferstart of buffer
[in]buffer_sizesize of buffer
Returns
0 on success, number of errors otherwise

Definition at line 222 of file trap.c.

◆ trap_read_from_buffer()

static int trap_read_from_buffer ( trap_ctx_priv_t ctx,
uint32_t  ifc_idx,
const void **  data,
uint16_t *  size,
int  timeout 
)
inlinestatic

Read data from buffer or receive data into buffer if buffer is empty

Parameters
[in,out]ctxpointer to the private libtrap context data (trap_ctx_init())
[in]ifc_idxindex of input interface
[out]datapointer to received message
[out]sizesize of message
[in]timeoutTRAP_WAIT | TRAP_NO_WAIT | timeout

Definition at line 253 of file trap.c.