netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
queue.c File Reference
#include "queue.h"
#include "event.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
Include dependency graph for queue.c:

Functions

struct queuequeue_create (const char *name, int max_objects, unsigned int flags)
 
void queue_destroy (struct queue *b)
 
void queue_stats_show (int fd)
 
void queue_node_init (struct queue_node *n, int type)
 
void * queue_node_data (struct queue_node *n)
 
struct queue_objectqueue_object_new (int type, size_t size)
 
void queue_object_free (struct queue_object *obj)
 
int queue_add (struct queue *b, struct queue_node *n)
 
int queue_del (struct queue_node *n)
 
struct queue_nodequeue_del_head (struct queue *b)
 
int queue_in (struct queue *b, struct queue_node *n)
 
int queue_get_eventfd (struct queue *b)
 
void queue_iterate (struct queue *b, const void *data, int(*iterate)(struct queue_node *n, const void *data2))
 
unsigned int queue_len (const struct queue *b)
 

Function Documentation

int queue_add ( struct queue b,
struct queue_node n 
)
struct queue* queue_create ( const char *  name,
int  max_objects,
unsigned int  flags 
)

References create_evfd(), queue::evfd, queue::flags, flags, queue::head, INIT_LIST_HEAD, queue::list, queue::max_elems, queue::name, NULL, QUEUE_F_EVFD, and QUEUE_NAMELEN.

Referenced by channel_init().

Here is the call graph for this function:

Here is the caller graph for this function:

int queue_del ( struct queue_node n)

References queue::evfd, queue_node::head, NULL, queue::num_elems, queue_node::owner, and read_evfd().

Referenced by queue_del_head().

Here is the call graph for this function:

Here is the caller graph for this function:

struct queue_node* queue_del_head ( struct queue b)

References queue::head, list_head::next, and queue_del().

Here is the call graph for this function:

void queue_destroy ( struct queue b)

References destroy_evfd(), queue::evfd, queue::flags, queue::list, and QUEUE_F_EVFD.

Referenced by channel_end().

Here is the call graph for this function:

Here is the caller graph for this function:

int queue_get_eventfd ( struct queue b)

References queue::evfd, and get_read_evfd().

Here is the call graph for this function:

int queue_in ( struct queue b,
struct queue_node n 
)

References queue_node::owner.

void queue_iterate ( struct queue b,
const void *  data,
int(*)(struct queue_node *n, const void *data2)  iterate 
)

References queue::head, and list_for_each_safe.

unsigned int queue_len ( const struct queue b)

References queue::num_elems.

void* queue_node_data ( struct queue_node n)
void queue_node_init ( struct queue_node n,
int  type 
)

References queue_node::head, INIT_LIST_HEAD, queue_node::type, and type.

Referenced by queue_object_new().

Here is the caller graph for this function:

void queue_object_free ( struct queue_object obj)
struct queue_object* queue_object_new ( int  type,
size_t  size 
)

References NULL, queue_object::qnode, queue_node_init(), queue_node::size, and size.

Here is the call graph for this function:

void queue_stats_show ( int  fd)