#include <glib.h>
#include "gnutella.h"
#include "pmsg.h"
#include "tx.h"
Go to the source code of this file.
Data Structures | |
struct | mq_ops |
Operations defined on all mq types. More... | |
struct | mq_cops |
struct | mqueue |
A message queue. More... | |
Defines | |
#define | MQ_FLOWC 0x00000001 /**< In flow control */ |
In flow control. | |
#define | MQ_DISCARD 0x00000002 /**< No writing, discard message */ |
No writing, discard message. | |
#define | MQ_SWIFT 0x00000004 /**< Swift mode, dropping more traffic */ |
Swift mode, dropping more traffic. | |
#define | MQ_WARNZONE 0x00000008 /**< Between hiwat and lowat */ |
Between hiwat and lowat. | |
#define | mq_is_flow_controlled(q) ((q)->flags & MQ_FLOWC) |
#define | mq_is_swift_controlled(q) ((q)->flags & MQ_SWIFT) |
#define | mq_maxsize(q) ((q)->maxsize) |
#define | mq_size(q) ((q)->size) |
#define | mq_lowat(q) ((q)->lowat) |
#define | mq_hiwat(q) ((q)->hiwat) |
#define | mq_count(q) ((q)->count) |
#define | mq_pending(q) ((q)->size + tx_pending((q)->tx_drv)) |
#define | mq_bio(q) (tx_bio_source((q)->tx_drv)) |
#define | mq_node(q) ((q)->node) |
Typedefs | |
typedef mqueue | mqueue_t |
Functions | |
void | mq_putq (mqueue_t *q, pmsg_t *mb) |
Enqueue message, which becomes owned by the queue. | |
void | mq_free (mqueue_t *q) |
Free queue and all enqueued messages. | |
void | mq_clear (mqueue_t *q) |
Remove all unsent messages from the queue. | |
void | mq_discard (mqueue_t *q) |
Forbid further writes to the queue. | |
void | mq_shutdown (mqueue_t *q) |
Disable all further writes from the queue. | |
void | mq_fill_ops (struct mq_ops *ops) |
const struct mq_cops * | mq_get_cops (void) |
Get common operations. |
|
|
|
|
|
No writing, discard message.
|
|
In flow control.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Swift mode, dropping more traffic.
|
|
Between hiwat and lowat.
|
|
|
|
Remove all unsent messages from the queue.
|
|
Forbid further writes to the queue.
|
|
|
|
Free queue and all enqueued messages. Since the message queue is the top of the network TX stack, calling mq_free() recursively requests freeing to lower layers. |
|
Get common operations.
|
|
Enqueue message, which becomes owned by the queue.
|
|
Disable all further writes from the queue.
|