Functions

tls_ct_q.h File Reference

TLS clear text queue (wrappers over sbufq) (e.g. More...

#include "sbufq.h"
#include "../../compiler_opt.h"
Include dependency graph for tls_ct_q.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions


Detailed Description

queue clear text when SSL_write() cannot write it immediately due to re-keying).

Module: SIP-router TLS support

Definition in file tls_ct_q.h.


Function Documentation

static int tls_ct_q_add ( tls_ct_q **  ct_q,
const void *  data,
unsigned int  size,
unsigned int  min_buf_size 
) [inline, static]
Warning:
it does no attempt to synchronize access/lock. If needed it should be called under lock.
Parameters:
**ct_q - double pointer to the buffer queue
data 
size 
min_buf_size - min size to allocate for new buffer elements
Returns:
0 on success, -1 on error (mem. allocation)

Definition at line 55 of file tls_ct_q.h.

References sbufq_add().

Referenced by tls_ct_wq_add().

Here is the call graph for this function:

Here is the caller graph for this function:

static unsigned int tls_ct_q_destroy ( tls_ct_q **  ct_q  )  [inline, static]

Everything is destroyed from a buffer queue (shm_free()'d), included the queue head.

Warning:
it does no attempt to synchronize access/lock. If needed it should be called under lock.
Parameters:
**ct_q - double pointer to the queue
Returns:
- number of bytes that used to be queued (>=0).

Definition at line 84 of file tls_ct_q.h.

References sbufq_destroy().

Referenced by tls_ct_wq_free().

Here is the call graph for this function:

Here is the caller graph for this function:

static int tls_ct_q_flush ( tls_ct_q **  tc_q,
int *  flags,
int(*)(void *p1, void *p2, const void *buf, unsigned size)  flush_f,
void *  flush_p1,
void *  flush_p2 
) [inline, static]

Tries to flush as much as possible from the given queue, using the given callback.

Warning:
it does no attempt to synchronize access/lock. If needed it should be called under lock.
Parameters:
tc_q - buffer queue
*flags - set to: F_BUFQ_EMPTY if the queued is completely flushed F_BUFQ_FLUSH_ERR if the flush_f callback returned error.
flush_f - flush function (callback). modeled after write(): flush_f(flush_p, const void* buf, unsigned size). It should return the number of bytes "flushed" on success, or <0 on error. If the number of bytes "flushed" is smaller then the requested size, it would be assumed that no more bytes can be flushed and sbufq_flush will exit.
flush_p1 - parameter for the flush function callback.
flush_p2 - parameter for the flush function callback.
Returns:
-1 on internal error, or the number of bytes flushed on success (>=0). Note that the flags param is always set and it should be used to check for errors, since a flush_f() failure will not result in a negative return.

Definition at line 124 of file tls_ct_q.h.

References sbufq_flush().

Referenced by tls_ct_wq_flush().

Here is the call graph for this function:

Here is the caller graph for this function: