GNUnet  0.11.x
Data Fields
GNUNET_MQ_Handle Struct Reference

Handle to a message queue. More...

Collaboration diagram for GNUNET_MQ_Handle:
[legend]

Data Fields

struct GNUNET_MQ_MessageHandlerhandlers
 Handlers array, or NULL if the queue should not receive messages. More...
 
GNUNET_MQ_SendImpl send_impl
 Actual implementation of message sending, called when a message is added. More...
 
GNUNET_MQ_DestroyImpl destroy_impl
 Implementation-dependent queue destruction function. More...
 
GNUNET_MQ_CancelImpl cancel_impl
 Implementation-dependent send cancel function. More...
 
void * impl_state
 Implementation-specific state. More...
 
GNUNET_MQ_ErrorHandler error_handler
 Callback will be called when an error occurs. More...
 
void * error_handler_cls
 Closure for the error handler. More...
 
struct GNUNET_SCHEDULER_Tasksend_task
 Task to asynchronously run impl_send_continue(). More...
 
struct GNUNET_MQ_Envelopeenvelope_head
 Linked list of messages pending to be sent. More...
 
struct GNUNET_MQ_Envelopeenvelope_tail
 Linked list of messages pending to be sent. More...
 
struct GNUNET_MQ_Envelopecurrent_envelope
 Message that is currently scheduled to be sent. More...
 
struct GNUNET_CONTAINER_MultiHashMap32assoc_map
 Map of associations, lazily allocated. More...
 
struct GNUNET_MQ_DestroyNotificationHandlednh_head
 Functions to call on queue destruction; kept in a DLL. More...
 
struct GNUNET_MQ_DestroyNotificationHandlednh_tail
 Functions to call on queue destruction; kept in a DLL. More...
 
enum GNUNET_MQ_PriorityPreferences priority
 Flags that were set for this queue by GNUNET_MQ_set_options(). More...
 
uint32_t assoc_id
 Next id that should be used for the assoc_map, initialized lazily to a random value together with assoc_map. More...
 
unsigned int queue_length
 Number of entries we have in the envelope-DLL. More...
 
int evacuate_called
 GNUNET_YES if GNUNET_MQ_impl_evacuate was called. More...
 
int in_flight
 GNUNET_YES if GNUNET_MQ_impl_send_in_flight() was called. More...
 

Detailed Description

Handle to a message queue.

Definition at line 85 of file mq.c.

Field Documentation

◆ handlers

struct GNUNET_MQ_MessageHandler* GNUNET_MQ_Handle::handlers

Handlers array, or NULL if the queue should not receive messages.

Definition at line 90 of file mq.c.

Referenced by GNUNET_MQ_destroy(), GNUNET_MQ_inject_message(), GNUNET_MQ_queue_for_callbacks(), and GNUNET_MQ_set_handlers_closure().

◆ send_impl

GNUNET_MQ_SendImpl GNUNET_MQ_Handle::send_impl

Actual implementation of message sending, called when a message is added.

Definition at line 96 of file mq.c.

Referenced by GNUNET_MQ_queue_for_callbacks(), GNUNET_MQ_send(), GNUNET_MQ_send_cancel(), and impl_send_continue().

◆ destroy_impl

GNUNET_MQ_DestroyImpl GNUNET_MQ_Handle::destroy_impl

Implementation-dependent queue destruction function.

Definition at line 101 of file mq.c.

Referenced by GNUNET_MQ_destroy(), and GNUNET_MQ_queue_for_callbacks().

◆ cancel_impl

GNUNET_MQ_CancelImpl GNUNET_MQ_Handle::cancel_impl

Implementation-dependent send cancel function.

Definition at line 106 of file mq.c.

Referenced by GNUNET_MQ_queue_for_callbacks(), and GNUNET_MQ_send_cancel().

◆ impl_state

void* GNUNET_MQ_Handle::impl_state

Implementation-specific state.

Definition at line 111 of file mq.c.

Referenced by GNUNET_MQ_destroy(), GNUNET_MQ_impl_state(), GNUNET_MQ_queue_for_callbacks(), GNUNET_MQ_send(), GNUNET_MQ_send_cancel(), and impl_send_continue().

◆ error_handler

GNUNET_MQ_ErrorHandler GNUNET_MQ_Handle::error_handler

Callback will be called when an error occurs.

Definition at line 116 of file mq.c.

Referenced by GNUNET_MQ_inject_error(), and GNUNET_MQ_queue_for_callbacks().

◆ error_handler_cls

void* GNUNET_MQ_Handle::error_handler_cls

Closure for the error handler.

Definition at line 121 of file mq.c.

Referenced by GNUNET_MQ_inject_error(), and GNUNET_MQ_queue_for_callbacks().

◆ send_task

struct GNUNET_SCHEDULER_Task* GNUNET_MQ_Handle::send_task

Task to asynchronously run impl_send_continue().

Definition at line 126 of file mq.c.

Referenced by GNUNET_MQ_destroy(), GNUNET_MQ_impl_send_continue(), GNUNET_MQ_send(), and impl_send_continue().

◆ envelope_head

struct GNUNET_MQ_Envelope* GNUNET_MQ_Handle::envelope_head

Linked list of messages pending to be sent.

Definition at line 131 of file mq.c.

Referenced by GNUNET_MQ_destroy(), GNUNET_MQ_send(), GNUNET_MQ_send_cancel(), GNUNET_MQ_unsent_head(), and impl_send_continue().

◆ envelope_tail

struct GNUNET_MQ_Envelope* GNUNET_MQ_Handle::envelope_tail

Linked list of messages pending to be sent.

Definition at line 136 of file mq.c.

Referenced by GNUNET_MQ_destroy(), GNUNET_MQ_get_last_envelope(), GNUNET_MQ_send(), GNUNET_MQ_send_cancel(), GNUNET_MQ_unsent_head(), and impl_send_continue().

◆ current_envelope

struct GNUNET_MQ_Envelope* GNUNET_MQ_Handle::current_envelope

Message that is currently scheduled to be sent.

Not the head of the message queue, as the implementation needs to know if sending has been already scheduled or not.

Definition at line 143 of file mq.c.

Referenced by GNUNET_MQ_destroy(), GNUNET_MQ_get_current_envelope(), GNUNET_MQ_get_last_envelope(), GNUNET_MQ_impl_current(), GNUNET_MQ_impl_send_continue(), GNUNET_MQ_impl_send_in_flight(), GNUNET_MQ_send(), GNUNET_MQ_send_cancel(), and impl_send_continue().

◆ assoc_map

struct GNUNET_CONTAINER_MultiHashMap32* GNUNET_MQ_Handle::assoc_map

Map of associations, lazily allocated.

Definition at line 148 of file mq.c.

Referenced by GNUNET_MQ_assoc_add(), GNUNET_MQ_assoc_get(), GNUNET_MQ_assoc_remove(), and GNUNET_MQ_destroy().

◆ dnh_head

struct GNUNET_MQ_DestroyNotificationHandle* GNUNET_MQ_Handle::dnh_head

Functions to call on queue destruction; kept in a DLL.

Definition at line 153 of file mq.c.

Referenced by GNUNET_MQ_destroy(), GNUNET_MQ_destroy_notify(), and GNUNET_MQ_destroy_notify_cancel().

◆ dnh_tail

struct GNUNET_MQ_DestroyNotificationHandle* GNUNET_MQ_Handle::dnh_tail

Functions to call on queue destruction; kept in a DLL.

Definition at line 158 of file mq.c.

Referenced by GNUNET_MQ_destroy_notify(), and GNUNET_MQ_destroy_notify_cancel().

◆ priority

enum GNUNET_MQ_PriorityPreferences GNUNET_MQ_Handle::priority

Flags that were set for this queue by GNUNET_MQ_set_options().

Default is 0.

Definition at line 164 of file mq.c.

Referenced by GNUNET_MQ_env_get_options(), and GNUNET_MQ_set_options().

◆ assoc_id

uint32_t GNUNET_MQ_Handle::assoc_id

Next id that should be used for the assoc_map, initialized lazily to a random value together with assoc_map.

Definition at line 171 of file mq.c.

Referenced by GNUNET_MQ_assoc_add().

◆ queue_length

unsigned int GNUNET_MQ_Handle::queue_length

Number of entries we have in the envelope-DLL.

Definition at line 176 of file mq.c.

Referenced by GNUNET_MQ_destroy(), GNUNET_MQ_get_length(), GNUNET_MQ_impl_send_continue(), GNUNET_MQ_send(), GNUNET_MQ_send_cancel(), and GNUNET_MQ_unsent_head().

◆ evacuate_called

int GNUNET_MQ_Handle::evacuate_called

GNUNET_YES if GNUNET_MQ_impl_evacuate was called.

FIXME: is this dead?

Definition at line 182 of file mq.c.

Referenced by GNUNET_MQ_send_cancel().

◆ in_flight

int GNUNET_MQ_Handle::in_flight

The documentation for this struct was generated from the following file: