netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
queue.h File Reference
#include <stdint.h>
#include "linux_list.h"
Include dependency graph for queue.h:

Data Structures

struct  queue_node
 
struct  queue_object
 
struct  queue
 

Macros

#define QUEUE_NAMELEN   16
 
#define QUEUE_F_EVFD   (1U << 0)
 

Enumerations

enum  {
  Q_ELEM_OBJ = 0,
  Q_ELEM_CTL = 1,
  Q_ELEM_ERR = 2
}
 

Functions

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)
 
struct queuequeue_create (const char *name, int max_objects, unsigned int flags)
 
void queue_destroy (struct queue *b)
 
void queue_stats_show (int fd)
 
unsigned int queue_len (const struct queue *b)
 
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)
 
void queue_iterate (struct queue *b, const void *data, int(*iterate)(struct queue_node *n, const void *data2))
 
int queue_get_eventfd (struct queue *b)
 

Macro Definition Documentation

#define QUEUE_F_EVFD   (1U << 0)

Referenced by queue_create(), and queue_destroy().

#define QUEUE_NAMELEN   16

Referenced by queue_create().

Enumeration Type Documentation

anonymous enum
Enumerator
Q_ELEM_OBJ 
Q_ELEM_CTL 
Q_ELEM_ERR 

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)