minimal overhead buffer queue in shm memory. More...
#include "../../compiler_opt.h"#include "../../ut.h"#include "../../mem/shm_mem.h"#include "../../timer_ticks.h"#include "../../timer.h"#include "../../dprint.h"#include <string.h>

Go to the source code of this file.
: Module: SIP-router TLS support
Definition in file sbufq.h.
| static int sbufq_add | ( | struct sbuffer_queue * | 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.
| q | - buffer queue | |
| data | ||
| size | ||
| min_buf_size | - min size to allocate for new buffer elements |
Definition at line 77 of file sbufq.h.
Referenced by sbufq_insert(), and tls_ct_q_add().

| static unsigned int sbufq_destroy | ( | struct sbuffer_queue * | q | ) | [inline, static] |
Only the content is destroyed (shm_free()'d), the queue head is re-intialized. WARNING: it does no attempt to synchronize access/lock. If needed it should be called under lock.
| q | - buffer queue |
Definition at line 191 of file sbufq.h.
Referenced by tls_ct_q_destroy().

| static int sbufq_flush | ( | struct sbuffer_queue * | 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.
| q | - buffer queue | |
| *flags | - set to: F_BUFQ_EMPTY if the queued is completely flushed F_BUFQ_ERROR_FLUSH if the flush_f callback returned error. | |
| flush_f | - flush function (callback). modeled after write(): flush_f(param1, param2, 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. |
Definition at line 238 of file sbufq.h.
Referenced by tls_ct_q_flush().

| static int sbufq_insert | ( | struct sbuffer_queue * | q, | |
| const void * | data, | |||
| unsigned int | size, | |||
| unsigned int | min_buf_size | |||
| ) | [inline, static] |
Note: should never be called after sbufq_run(). WARNING: it does no attempt to synchronize access/lock. If needed it should be called under lock.
| q | - buffer queue | |
| data | ||
| size | ||
| min_buf_size | - min size to allocate for new buffer elements |
Definition at line 146 of file sbufq.h.
References sbufq_add().

1.7.1