OpenVPN
mbuf.h File Reference
#include "basic.h"
#include "buffer.h"
Include dependency graph for mbuf.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mbuf_buffer
struct  mbuf_item
struct  mbuf_set

Macros

#define MBUF_INDEX(head, offset, size)
#define MBUF_SIZE_MAX   (ALLOC_SIZE_MAX / sizeof(struct mbuf_item))
#define MF_UNICAST   (1 << 0)

Functions

struct mbuf_set * mbuf_init (unsigned int size)
void mbuf_free (struct mbuf_set *ms)
struct mbuf_buffer * mbuf_alloc_buf (const struct buffer *buf)
void mbuf_free_buf (struct mbuf_buffer *mb)
void mbuf_add_item (struct mbuf_set *ms, const struct mbuf_item *item)
bool mbuf_extract_item (struct mbuf_set *ms, struct mbuf_item *item)
void mbuf_dereference_instance (struct mbuf_set *ms, const struct multi_instance *mi)
static bool mbuf_defined (const struct mbuf_set *ms)
static unsigned int mbuf_len (const struct mbuf_set *ms)
static int mbuf_maximum_queued (const struct mbuf_set *ms)
struct multi_instance * mbuf_peek_dowork (struct mbuf_set *ms)
static struct multi_instance * mbuf_peek (struct mbuf_set *ms)

Macro Definition Documentation

◆ MBUF_INDEX

#define MBUF_INDEX ( head,
offset,
size )
Value:
(((head) + (offset)) & ((size) - 1))

Definition at line 38 of file mbuf.h.

Referenced by mbuf_add_item(), mbuf_dereference_instance(), mbuf_extract_item(), mbuf_free(), mbuf_peek_dowork(), and mbuf_reclaim_head().

◆ MBUF_SIZE_MAX

#define MBUF_SIZE_MAX   (ALLOC_SIZE_MAX / sizeof(struct mbuf_item))

Definition at line 40 of file mbuf.h.

Referenced by add_option(), mbuf_init(), and test_mbuf_init().

◆ MF_UNICAST

#define MF_UNICAST   (1 << 0)

Definition at line 47 of file mbuf.h.

Referenced by multi_get_queue(), and multi_unicast().

Function Documentation

◆ mbuf_add_item()

◆ mbuf_alloc_buf()

◆ mbuf_defined()

◆ mbuf_dereference_instance()

◆ mbuf_extract_item()

◆ mbuf_free()

◆ mbuf_free_buf()

◆ mbuf_init()

◆ mbuf_len()

◆ mbuf_maximum_queued()

int mbuf_maximum_queued ( const struct mbuf_set * ms)
inlinestatic

Definition at line 93 of file mbuf.h.

References mbuf_set::max_queued.

Referenced by multi_print_status(), and test_mbuf_add_remove().

◆ mbuf_peek()

◆ mbuf_peek_dowork()

struct multi_instance * mbuf_peek_dowork ( struct mbuf_set * ms)

Definition at line 149 of file mbuf.c.

References mbuf_set::array, mbuf_set::capacity, mbuf_set::head, mbuf_item::instance, mbuf_set::len, and MBUF_INDEX.

Referenced by mbuf_peek().