GNUnet  0.11.x
Data Fields
PendingMessage Struct Reference

List containing all messages that are yet to be send. More...

Collaboration diagram for PendingMessage:
[legend]

Data Fields

struct PendingMessagenext
 DLL next, prev. More...
 
struct PendingMessageprev
 This is a doubly-linked list. More...
 
struct GNUNET_MQ_Envelopeev
 The envelope to the corresponding message. More...
 
struct PeerContextpeer_ctx
 The corresponding context. More...
 
const char * type
 The message type. More...
 
struct PendingMessagenext_vl
 Kept in a MDLL of messages for this vl. More...
 
struct PendingMessageprev_vl
 Kept in a MDLL of messages for this vl. More...
 
struct PendingMessagenext_client
 Kept in a MDLL of messages from this client (if pmt is PMT_CORE) More...
 
struct PendingMessageprev_client
 Kept in a MDLL of messages from this client (if pmt is PMT_CORE) More...
 
struct PendingMessagenext_frag
 Kept in a MDLL of messages from this cpm (if pmt is #PMT_FRAGMENT_BOx) More...
 
struct PendingMessageprev_frag
 Kept in a MDLL of messages from this cpm (if pmt is PMT_FRAGMENT_BOX) More...
 
struct PendingAcknowledgementpa_head
 Head of DLL of PAs for this pending message. More...
 
struct PendingAcknowledgementpa_tail
 Tail of DLL of PAs for this pending message. More...
 
struct PendingMessagebpm
 This message, reliability or DV-boxed. More...
 
struct VirtualLinkvl
 Target of the request (always the ultimate destination!). More...
 
struct QueueEntryqe
 Set to non-NULL value if this message is currently being given to a communicator and we are awaiting that communicator's acknowledgement. More...
 
struct TransportClientclient
 Client that issued the transmission request, if pmt is PMT_CORE. More...
 
struct PendingMessagehead_frag
 Head of a MDLL of fragments created for this core message. More...
 
struct PendingMessagetail_frag
 Tail of a MDLL of fragments created for this core message. More...
 
struct PendingMessagefrag_parent
 Our parent in the fragmentation tree. More...
 
struct GNUNET_TIME_Absolute timeout
 At what time should we give up on the transmission (and no longer retry)? More...
 
struct GNUNET_TIME_Absolute next_attempt
 What is the earliest time for us to retry transmission of this message? More...
 
struct MessageUUIDP msg_uuid
 UUID to use for this message (used for reassembly of fragments, only initialized if msg_uuid_set is GNUNET_YES). More...
 
unsigned long long logging_uuid
 UUID we use to identify this message in our logs. More...
 
enum PendingMessageType pmt
 Type of the pending message. More...
 
enum GNUNET_MQ_PriorityPreferences prefs
 Preferences for this message. More...
 
uint16_t bytes_msg
 Size of the original message. More...
 
uint16_t frag_off
 Offset at which we should generate the next fragment. More...
 
int16_t msg_uuid_set
 GNUNET_YES once msg_uuid was initialized More...
 
const char * msg
 The pending message. More...
 
GNUNET_TRANSPORT_TransmitContinuation transmit_cont
 Continuation function to call once the message has been sent. More...
 
void * transmit_cont_cls
 Closure for transmit_cont. More...
 
size_t message_size
 So that the gnunet-service-transport can group messages together, these pending messages need to accept a message buffer and size instead of just a struct GNUNET_MessageHeader. More...
 
struct WlanHeadermsg
 The pending message. More...
 
struct GNUNET_SCHEDULER_Tasktimeout_task
 Timeout task (for this message). More...
 

Detailed Description

List containing all messages that are yet to be send.

Information kept for each message that is yet to be fragmented and transmitted.

Information kept for each message that is yet to be transmitted.

Transmission request that is awaiting delivery.

This is used to keep track of all messages that have not been sent yet. When a peer is to be removed the pending messages can be removed properly.

The original transmission requests from CORE may be too big for some queues. In this case, a tree of fragments is created. At each level of the tree, fragments are kept in a DLL ordered by which fragment should be sent next (at the head). The tree is searched top-down, with the original message at the root.

To select a node for transmission, first it is checked if the current node's message fits with the MTU. If it does not, we either calculate the next fragment (based on frag_off) from the current node, or, if all fragments have already been created, descend to the head_frag. Even though the node was already fragmented, the fragment may be too big if the fragment was generated for a queue with a larger MTU. In this case, the node may be fragmented again, thus creating a tree.

When acknowledgements for fragments are received, the tree must be pruned, removing those parts that were already acknowledged. When fragments are sent over a reliable channel, they can be immediately removed.

If a message is ever fragmented, then the original "full" message is never again transmitted (even if it fits below the MTU), and only (remaining) fragments are sent.

Definition at line 113 of file gnunet-service-rps.c.

Field Documentation

◆ next

struct PendingMessage * PendingMessage::next

DLL next, prev.

next entry in the DLL

This is a doubly-linked list.

Definition at line 118 of file gnunet-service-rps.c.

◆ prev

struct PendingMessage * PendingMessage::prev

This is a doubly-linked list.

previous entry in the DLL

Definition at line 119 of file gnunet-service-rps.c.

◆ ev

struct GNUNET_MQ_Envelope* PendingMessage::ev

The envelope to the corresponding message.

Definition at line 124 of file gnunet-service-rps.c.

Referenced by insert_pending_message().

◆ peer_ctx

struct PeerContext* PendingMessage::peer_ctx

The corresponding context.

Definition at line 129 of file gnunet-service-rps.c.

Referenced by insert_pending_message(), mq_notify_sent_cb(), and remove_pending_message().

◆ type

const char* PendingMessage::type

The message type.

Definition at line 134 of file gnunet-service-rps.c.

Referenced by destroy_peer(), insert_pending_message(), and mq_notify_sent_cb().

◆ next_vl

struct PendingMessage* PendingMessage::next_vl

Kept in a MDLL of messages for this vl.

Definition at line 2082 of file gnunet-service-tng.c.

Referenced by select_best_pending_from_link().

◆ prev_vl

struct PendingMessage* PendingMessage::prev_vl

Kept in a MDLL of messages for this vl.

Definition at line 2087 of file gnunet-service-tng.c.

Referenced by update_pm_next_attempt().

◆ next_client

struct PendingMessage* PendingMessage::next_client

Kept in a MDLL of messages from this client (if pmt is PMT_CORE)

Definition at line 2092 of file gnunet-service-tng.c.

◆ prev_client

struct PendingMessage* PendingMessage::prev_client

Kept in a MDLL of messages from this client (if pmt is PMT_CORE)

Definition at line 2097 of file gnunet-service-tng.c.

◆ next_frag

struct PendingMessage* PendingMessage::next_frag

Kept in a MDLL of messages from this cpm (if pmt is #PMT_FRAGMENT_BOx)

Definition at line 2103 of file gnunet-service-tng.c.

◆ prev_frag

struct PendingMessage* PendingMessage::prev_frag

Kept in a MDLL of messages from this cpm (if pmt is PMT_FRAGMENT_BOX)

Definition at line 2109 of file gnunet-service-tng.c.

Referenced by update_pm_next_attempt().

◆ pa_head

struct PendingAcknowledgement* PendingMessage::pa_head

Head of DLL of PAs for this pending message.

Definition at line 2114 of file gnunet-service-tng.c.

Referenced by free_fragment_tree(), free_pending_acknowledgement(), free_pending_message(), and prepare_pending_acknowledgement().

◆ pa_tail

struct PendingAcknowledgement* PendingMessage::pa_tail

Tail of DLL of PAs for this pending message.

Definition at line 2119 of file gnunet-service-tng.c.

Referenced by free_fragment_tree(), free_pending_acknowledgement(), free_pending_message(), and prepare_pending_acknowledgement().

◆ bpm

struct PendingMessage* PendingMessage::bpm

This message, reliability or DV-boxed.

Only possibly available if pmt is PMT_CORE.

Definition at line 2125 of file gnunet-service-tng.c.

Referenced by extract_box_cb(), free_pending_message(), reliability_box_message(), and transmit_on_queue().

◆ vl

struct VirtualLink* PendingMessage::vl

◆ qe

struct QueueEntry* PendingMessage::qe

Set to non-NULL value if this message is currently being given to a communicator and we are awaiting that communicator's acknowledgement.

Note that we must not retransmit a pending message while we're still in the process of giving it to a communicator. If a pending message is free'd while this entry is non-NULL, the qe reference to us should simply be set to NULL.

Definition at line 2140 of file gnunet-service-tng.c.

Referenced by free_pending_message(), free_queue(), handle_send_message_ack(), and queue_send_msg().

◆ client

struct TransportClient* PendingMessage::client

Client that issued the transmission request, if pmt is PMT_CORE.

Definition at line 2145 of file gnunet-service-tng.c.

Referenced by client_disconnect_cb(), client_send_response(), create_session(), free_pending_message(), and handle_client_send().

◆ head_frag

struct PendingMessage* PendingMessage::head_frag

Head of a MDLL of fragments created for this core message.

Definition at line 2150 of file gnunet-service-tng.c.

Referenced by completed_pending_message(), fragment_message(), free_fragment_tree(), reliability_box_message(), and update_pm_next_attempt().

◆ tail_frag

struct PendingMessage* PendingMessage::tail_frag

Tail of a MDLL of fragments created for this core message.

Definition at line 2155 of file gnunet-service-tng.c.

Referenced by completed_pending_message(), fragment_message(), free_fragment_tree(), reliability_box_message(), and update_pm_next_attempt().

◆ frag_parent

struct PendingMessage* PendingMessage::frag_parent

Our parent in the fragmentation tree.

Definition at line 2160 of file gnunet-service-tng.c.

Referenced by completed_pending_message(), fragment_message(), reliability_box_message(), and update_pm_next_attempt().

◆ timeout

struct GNUNET_TIME_Absolute PendingMessage::timeout

At what time should we give up on the transmission (and no longer retry)?

Timeout value for the pending message.

Definition at line 2165 of file gnunet-service-tng.c.

Referenced by create_session(), do_transmit(), fragment_message(), process_pending_messages(), reliability_box_message(), and tcp_plugin_send().

◆ next_attempt

struct GNUNET_TIME_Absolute PendingMessage::next_attempt

What is the earliest time for us to retry transmission of this message?

Definition at line 2170 of file gnunet-service-tng.c.

Referenced by select_best_pending_from_link(), and update_pm_next_attempt().

◆ msg_uuid

struct MessageUUIDP PendingMessage::msg_uuid

UUID to use for this message (used for reassembly of fragments, only initialized if msg_uuid_set is GNUNET_YES).

Definition at line 2176 of file gnunet-service-tng.c.

Referenced by fragment_message(), and set_pending_message_uuid().

◆ logging_uuid

unsigned long long PendingMessage::logging_uuid

UUID we use to identify this message in our logs.

Generated by incrementing the "logging_uuid_gen".

Definition at line 2182 of file gnunet-service-tng.c.

Referenced by client_send_response(), completed_pending_message(), extract_box_cb(), fragment_message(), handle_client_send(), prepare_pending_acknowledgement(), queue_send_msg(), reliability_box_message(), transmit_on_queue(), and update_pm_next_attempt().

◆ pmt

enum PendingMessageType PendingMessage::pmt

Type of the pending message.

Definition at line 2187 of file gnunet-service-tng.c.

Referenced by completed_pending_message(), extract_box_cb(), fragment_message(), reliability_box_message(), and transmit_on_queue().

◆ prefs

enum GNUNET_MQ_PriorityPreferences PendingMessage::prefs

Preferences for this message.

TODO: actually use this!

Definition at line 2193 of file gnunet-service-tng.c.

Referenced by handle_client_send(), and select_best_pending_from_link().

◆ bytes_msg

uint16_t PendingMessage::bytes_msg

◆ frag_off

uint16_t PendingMessage::frag_off

Offset at which we should generate the next fragment.

Definition at line 2203 of file gnunet-service-tng.c.

Referenced by completed_pending_message(), and fragment_message().

◆ msg_uuid_set

int16_t PendingMessage::msg_uuid_set

GNUNET_YES once msg_uuid was initialized

Definition at line 2208 of file gnunet-service-tng.c.

Referenced by set_pending_message_uuid().

◆ msg [1/2]

const char* PendingMessage::msg

The pending message.

Definition at line 731 of file plugin_transport_tcp.c.

Referenced by create_session(), do_transmit(), and tcp_plugin_send().

◆ transmit_cont

GNUNET_TRANSPORT_TransmitContinuation PendingMessage::transmit_cont

Continuation function to call once the message has been sent.

Can be NULL if there is no continuation to call.

Definition at line 738 of file plugin_transport_tcp.c.

Referenced by do_transmit(), tcp_plugin_disconnect_session(), and tcp_plugin_send().

◆ transmit_cont_cls

void * PendingMessage::transmit_cont_cls

Closure for transmit_cont.

Cls for transmit_cont.

Definition at line 743 of file plugin_transport_tcp.c.

Referenced by do_transmit(), tcp_plugin_disconnect_session(), and tcp_plugin_send().

◆ message_size

size_t PendingMessage::message_size

So that the gnunet-service-transport can group messages together, these pending messages need to accept a message buffer and size instead of just a struct GNUNET_MessageHeader.

Definition at line 755 of file plugin_transport_tcp.c.

Referenced by create_session(), do_transmit(), process_pending_messages(), tcp_plugin_disconnect_session(), and tcp_plugin_send().

◆ msg [2/2]

struct WlanHeader* PendingMessage::msg

The pending message.

Definition at line 230 of file plugin_transport_wlan.c.

◆ timeout_task

struct GNUNET_SCHEDULER_Task* PendingMessage::timeout_task

Timeout task (for this message).

Definition at line 247 of file plugin_transport_wlan.c.


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