GNUnet 0.21.1
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...
 
bool in_flight
 True if GNUNET_MQ_impl_send_in_flight() was called. More...
 

Detailed Description

Handle to a message queue.

Definition at line 86 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 91 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 97 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 102 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 107 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 112 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 117 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 122 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 127 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 132 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 137 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 144 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 149 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 154 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 159 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 165 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 172 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 177 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().

◆ in_flight

bool GNUNET_MQ_Handle::in_flight

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