GNUnet  0.11.x
Data Fields
Queue Struct Reference

Handle for a queue. More...

Collaboration diagram for Queue:
[legend]

Data Fields

struct GNUNET_PeerIdentity target
 To whom are we talking to. More...
 
struct GNUNET_NETWORK_Handlesock
 socket that we transmit all data with on this queue More...
 
gcry_cipher_hd_t in_cipher
 cipher for decryption of incoming data. More...
 
gcry_cipher_hd_t out_cipher
 cipher for encryption of outgoing data. More...
 
struct GNUNET_HashCode in_hmac
 Shared secret for HMAC verification on incoming data. More...
 
struct GNUNET_HashCode out_hmac
 Shared secret for HMAC generation on outgoing data, ratcheted after each operation. More...
 
struct GNUNET_CRYPTO_EcdhePrivateKey ephemeral
 Our ephemeral key. More...
 
struct GNUNET_SCHEDULER_Taskread_task
 ID of read task for this connection. More...
 
struct GNUNET_SCHEDULER_Taskwrite_task
 ID of write task for this connection. More...
 
struct sockaddr * address
 Address of the other peer. More...
 
uint64_t rekey_left_bytes
 How many more bytes may we sent with the current out_cipher before we should rekey? More...
 
struct GNUNET_TIME_Absolute rekey_time
 Until what time may we sent with the current out_cipher before we should rekey? More...
 
socklen_t address_len
 Length of the address. More...
 
struct GNUNET_MQ_Handlemq
 Message queue we are providing for the ch. More...
 
struct GNUNET_TRANSPORT_QueueHandleqh
 handle for this queue with the ch. More...
 
unsigned long long bytes_in_queue
 Number of bytes we currently have in our write queue. More...
 
char cread_buf [(2 *64 *1024+sizeof(struct TCPBox))]
 Buffer for reading ciphertext from network into. More...
 
char cwrite_buf [(2 *64 *1024+sizeof(struct TCPBox))]
 buffer for writing ciphertext to network. More...
 
char pread_buf [UINT16_MAX+1+sizeof(struct TCPBox)]
 Plaintext buffer for decrypted plaintext. More...
 
char pwrite_buf [UINT16_MAX+1+sizeof(struct TCPBox)]
 Plaintext buffer for messages to be encrypted. More...
 
size_t cread_off
 At which offset in the ciphertext read buffer should we append more ciphertext for transmission next? More...
 
size_t cwrite_off
 At which offset in the ciphertext write buffer should we append more ciphertext from reading next? More...
 
size_t pread_off
 At which offset in the plaintext input buffer should we append more plaintext from decryption next? More...
 
size_t pwrite_off
 At which offset in the plaintext output buffer should we append more plaintext for encryption next? More...
 
struct GNUNET_TIME_Absolute timeout
 Timeout for this queue. More...
 
unsigned int backpressure
 How may messages did we pass from this queue to CORE for which we have yet to receive an acknoweldgement that CORE is done with them? If "large" (or even just non-zero), we should throttle reading to provide flow control. More...
 
enum GNUNET_NetworkType nt
 Which network type does this queue use? More...
 
int mq_awaits_continue
 Is MQ awaiting a GNUNET_MQ_impl_send_continue() call? More...
 
int finishing
 Did we enqueue a finish message and are closing down the queue? More...
 
int destroyed
 Did we technically destroy this queue, but kept the allocation around because of backpressure not being zero yet? Used simply to delay the final GNUNET_free() operation until core_read_finished_cb() has been called. More...
 
int rekeyed
 GNUNET_YES if we just rekeyed and must thus possibly re-decrypt ciphertext. More...
 
struct Queuenext
 Queues with pending messages (!) are kept in a DLL. More...
 
struct Queueprev
 Queues with pending messages (!) are kept in a DLL. More...
 
struct sockaddr_un * address
 Address of the other peer. More...
 
const struct GNUNET_MessageHeadermsg
 Message currently scheduled for transmission, non-NULL if and only if this queue is in the queue_head DLL. More...
 
struct GNUNET_SCHEDULER_Tasktimeout_task
 Queue timeout task. More...
 
struct Queuenext_neighbour
 Kept in a MDLL. More...
 
struct Queueprev_neighbour
 Kept in a MDLL. More...
 
struct Queueprev_client
 Kept in a MDLL. More...
 
struct Queuenext_client
 Kept in a MDLL. More...
 
struct PendingAcknowledgementpa_head
 Head of DLL of PAs that used this queue. More...
 
struct PendingAcknowledgementpa_tail
 Tail of DLL of PAs that used this queue. More...
 
struct QueueEntryqueue_head
 Head of DLL of unacked transmission requests. More...
 
struct QueueEntryqueue_tail
 End of DLL of unacked transmission requests. More...
 
struct Neighbourneighbour
 Which neighbour is this queue for? More...
 
struct TransportClienttc
 Which communicator offers this queue? More...
 
const char * address
 Address served by the queue. More...
 
struct GNUNET_SCHEDULER_Tasktransmit_task
 Task scheduled for the time when this queue can (likely) transmit the next message. More...
 
struct GNUNET_TIME_Absolute validated_until
 How long do we consider this address to be valid? In the past or zero if we have not yet validated it. More...
 
struct PerformanceData pd
 Performance data for this queue. More...
 
uint64_t mid_gen
 Message ID generator for transmissions on this queue to the communicator. More...
 
uint32_t qid
 Unique identifier of this queue with the communicator. More...
 
uint32_t mtu
 Maximum transmission unit supported by this queue. More...
 
uint32_t num_msg_pending
 Messages pending. More...
 
uint32_t num_bytes_pending
 Bytes pending. More...
 
unsigned int queue_length
 Length of the DLL starting at queue_head. More...
 
enum GNUNET_TRANSPORT_ConnectionStatus cs
 Connection status for this queue. More...
 
int idle
 Set to GNUNET_YES if this queue is idle waiting for some virtual link to give it a pending message. More...
 

Detailed Description

Handle for a queue.

A queue is a message queue provided by a communicator via which we can reach a particular neighbour.

Definition at line 260 of file gnunet-communicator-tcp.c.

Field Documentation

◆ target

struct GNUNET_PeerIdentity Queue::target

◆ sock

struct GNUNET_NETWORK_Handle* Queue::sock

socket that we transmit all data with on this queue

Definition at line 270 of file gnunet-communicator-tcp.c.

Referenced by core_read_finished_cb(), mq_init(), mq_send(), proto_read_kx(), queue_destroy(), queue_read(), queue_read_kx(), and queue_write().

◆ in_cipher

gcry_cipher_hd_t Queue::in_cipher

cipher for decryption of incoming data.

Definition at line 275 of file gnunet-communicator-tcp.c.

Referenced by decrypt_and_check_tc(), do_rekey(), proto_read_kx(), queue_destroy(), queue_read(), and setup_in_cipher().

◆ out_cipher

gcry_cipher_hd_t Queue::out_cipher

cipher for encryption of outgoing data.

Definition at line 280 of file gnunet-communicator-tcp.c.

Referenced by queue_destroy(), queue_write(), setup_out_cipher(), and transmit_kx().

◆ in_hmac

struct GNUNET_HashCode Queue::in_hmac

Shared secret for HMAC verification on incoming data.

Definition at line 285 of file gnunet-communicator-tcp.c.

Referenced by setup_in_cipher(), and try_handle_plaintext().

◆ out_hmac

struct GNUNET_HashCode Queue::out_hmac

Shared secret for HMAC generation on outgoing data, ratcheted after each operation.

Definition at line 291 of file gnunet-communicator-tcp.c.

Referenced by inject_rekey(), mq_send(), queue_finish(), and setup_out_cipher().

◆ ephemeral

struct GNUNET_CRYPTO_EcdhePrivateKey Queue::ephemeral

Our ephemeral key.

Stored here temporarily during rekeying / key generation.

Definition at line 297 of file gnunet-communicator-tcp.c.

Referenced by inject_rekey(), setup_out_cipher(), and start_initial_kx_out().

◆ read_task

struct GNUNET_SCHEDULER_Task* Queue::read_task

ID of read task for this connection.

Definition at line 302 of file gnunet-communicator-tcp.c.

Referenced by core_read_finished_cb(), mq_init(), proto_read_kx(), queue_destroy(), queue_read(), and queue_read_kx().

◆ write_task

struct GNUNET_SCHEDULER_Task* Queue::write_task

ID of write task for this connection.

Definition at line 307 of file gnunet-communicator-tcp.c.

Referenced by mq_init(), mq_send(), proto_read_kx(), queue_destroy(), and queue_write().

◆ address [1/3]

struct sockaddr* Queue::address

◆ rekey_left_bytes

uint64_t Queue::rekey_left_bytes

How many more bytes may we sent with the current out_cipher before we should rekey?

Definition at line 318 of file gnunet-communicator-tcp.c.

Referenced by queue_write(), and setup_out_cipher().

◆ rekey_time

struct GNUNET_TIME_Absolute Queue::rekey_time

Until what time may we sent with the current out_cipher before we should rekey?

Definition at line 324 of file gnunet-communicator-tcp.c.

Referenced by queue_write(), and setup_out_cipher().

◆ address_len

socklen_t Queue::address_len

Length of the address.

Definition at line 329 of file gnunet-communicator-tcp.c.

Referenced by boot_queue(), lookup_queue_it(), mq_init(), proto_read_kx(), queue_read_kx(), select_write_cb(), and setup_queue().

◆ mq

struct GNUNET_MQ_Handle * Queue::mq

Message queue we are providing for the ch.

Definition at line 334 of file gnunet-communicator-tcp.c.

Referenced by boot_queue(), mq_destroy(), mq_send(), queue_destroy(), queue_write(), select_write_cb(), and setup_queue().

◆ qh

struct GNUNET_TRANSPORT_QueueHandle * Queue::qh

handle for this queue with the ch.

Definition at line 339 of file gnunet-communicator-tcp.c.

Referenced by boot_queue(), queue_destroy(), and setup_queue().

◆ bytes_in_queue

unsigned long long Queue::bytes_in_queue

Number of bytes we currently have in our write queue.

Definition at line 344 of file gnunet-communicator-tcp.c.

Referenced by queue_destroy().

◆ cread_buf

char Queue::cread_buf[(2 *64 *1024+sizeof(struct TCPBox))]

Buffer for reading ciphertext from network into.

Definition at line 349 of file gnunet-communicator-tcp.c.

Referenced by queue_read(), and queue_read_kx().

◆ cwrite_buf

char Queue::cwrite_buf[(2 *64 *1024+sizeof(struct TCPBox))]

buffer for writing ciphertext to network.

Definition at line 354 of file gnunet-communicator-tcp.c.

Referenced by queue_write(), and transmit_kx().

◆ pread_buf

char Queue::pread_buf[UINT16_MAX+1+sizeof(struct TCPBox)]

Plaintext buffer for decrypted plaintext.

Definition at line 359 of file gnunet-communicator-tcp.c.

Referenced by mq_send(), queue_read(), and try_handle_plaintext().

◆ pwrite_buf

char Queue::pwrite_buf[UINT16_MAX+1+sizeof(struct TCPBox)]

Plaintext buffer for messages to be encrypted.

Definition at line 364 of file gnunet-communicator-tcp.c.

Referenced by inject_rekey(), queue_finish(), and queue_write().

◆ cread_off

size_t Queue::cread_off

At which offset in the ciphertext read buffer should we append more ciphertext for transmission next?

Definition at line 370 of file gnunet-communicator-tcp.c.

Referenced by queue_read(), and queue_read_kx().

◆ cwrite_off

size_t Queue::cwrite_off

At which offset in the ciphertext write buffer should we append more ciphertext from reading next?

Definition at line 376 of file gnunet-communicator-tcp.c.

Referenced by queue_write(), and transmit_kx().

◆ pread_off

size_t Queue::pread_off

At which offset in the plaintext input buffer should we append more plaintext from decryption next?

Definition at line 382 of file gnunet-communicator-tcp.c.

Referenced by mq_send(), queue_read(), and try_handle_plaintext().

◆ pwrite_off

size_t Queue::pwrite_off

At which offset in the plaintext output buffer should we append more plaintext for encryption next?

Definition at line 388 of file gnunet-communicator-tcp.c.

Referenced by inject_rekey(), mq_cancel(), queue_finish(), and queue_write().

◆ timeout

struct GNUNET_TIME_Absolute Queue::timeout

◆ backpressure

unsigned int Queue::backpressure

How may messages did we pass from this queue to CORE for which we have yet to receive an acknoweldgement that CORE is done with them? If "large" (or even just non-zero), we should throttle reading to provide flow control.

See also DEFAULT_MAX_QUEUE_LENGTH and max_queue_length.

Definition at line 402 of file gnunet-communicator-tcp.c.

Referenced by core_read_finished_cb(), pass_plaintext_to_core(), and queue_destroy().

◆ nt

enum GNUNET_NetworkType Queue::nt

Which network type does this queue use?

Network type offered by this queue.

Definition at line 407 of file gnunet-communicator-tcp.c.

Referenced by boot_queue(), free_queue(), and handle_add_queue_message().

◆ mq_awaits_continue

int Queue::mq_awaits_continue

Is MQ awaiting a GNUNET_MQ_impl_send_continue() call?

Definition at line 412 of file gnunet-communicator-tcp.c.

Referenced by queue_write().

◆ finishing

int Queue::finishing

Did we enqueue a finish message and are closing down the queue?

Definition at line 417 of file gnunet-communicator-tcp.c.

Referenced by mq_send(), queue_finish(), and queue_write().

◆ destroyed

int Queue::destroyed

Did we technically destroy this queue, but kept the allocation around because of backpressure not being zero yet? Used simply to delay the final GNUNET_free() operation until core_read_finished_cb() has been called.

Definition at line 425 of file gnunet-communicator-tcp.c.

Referenced by core_read_finished_cb(), and queue_destroy().

◆ rekeyed

int Queue::rekeyed

GNUNET_YES if we just rekeyed and must thus possibly re-decrypt ciphertext.

Definition at line 431 of file gnunet-communicator-tcp.c.

Referenced by do_rekey(), and queue_read().

◆ next

struct Queue* Queue::next

Queues with pending messages (!) are kept in a DLL.

Definition at line 91 of file gnunet-communicator-unix.c.

◆ prev

struct Queue* Queue::prev

Queues with pending messages (!) are kept in a DLL.

Definition at line 96 of file gnunet-communicator-unix.c.

◆ address [2/3]

struct sockaddr_un* Queue::address

Address of the other peer.

Definition at line 106 of file gnunet-communicator-unix.c.

◆ msg

const struct GNUNET_MessageHeader* Queue::msg

Message currently scheduled for transmission, non-NULL if and only if this queue is in the queue_head DLL.

Definition at line 117 of file gnunet-communicator-unix.c.

Referenced by mq_cancel(), mq_send(), and select_write_cb().

◆ timeout_task

struct GNUNET_SCHEDULER_Task* Queue::timeout_task

Queue timeout task.

Definition at line 142 of file gnunet-communicator-unix.c.

Referenced by queue_destroy(), queue_timeout(), reschedule_queue_timeout(), and setup_queue().

◆ next_neighbour

struct Queue* Queue::next_neighbour

Kept in a MDLL.

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

Referenced by find_queue().

◆ prev_neighbour

struct Queue* Queue::prev_neighbour

Kept in a MDLL.

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

◆ prev_client

struct Queue* Queue::prev_client

Kept in a MDLL.

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

◆ next_client

struct Queue* Queue::next_client

Kept in a MDLL.

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

◆ pa_head

struct PendingAcknowledgement* Queue::pa_head

Head of DLL of PAs that used this queue.

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

Referenced by free_pending_acknowledgement(), free_queue(), and prepare_pending_acknowledgement().

◆ pa_tail

struct PendingAcknowledgement* Queue::pa_tail

Tail of DLL of PAs that used this queue.

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

Referenced by free_pending_acknowledgement(), free_queue(), and prepare_pending_acknowledgement().

◆ queue_head

struct QueueEntry* Queue::queue_head

Head of DLL of unacked transmission requests.

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

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

◆ queue_tail

struct QueueEntry* Queue::queue_tail

End of DLL of unacked transmission requests.

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

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

◆ neighbour

struct Neighbour* Queue::neighbour

◆ tc

struct TransportClient* Queue::tc

◆ address [3/3]

const char* Queue::address

Address served by the queue.

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

◆ transmit_task

struct GNUNET_SCHEDULER_Task* Queue::transmit_task

Task scheduled for the time when this queue can (likely) transmit the next message.

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

Referenced by free_queue(), schedule_transmit_on_queue(), and transmit_on_queue().

◆ validated_until

struct GNUNET_TIME_Absolute Queue::validated_until

How long do we consider this address to be valid? In the past or zero if we have not yet validated it.

Can be updated based on challenge-response validations (via address validation logic), or when we receive ACKs that we can definitively map to transmissions via this queue.

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

Referenced by handle_validation_response().

◆ pd

struct PerformanceData Queue::pd

Performance data for this queue.

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

Referenced by handle_add_queue_message(), handle_validation_response(), transmit_on_queue(), and update_queue_performance().

◆ mid_gen

uint64_t Queue::mid_gen

Message ID generator for transmissions on this queue to the communicator.

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

Referenced by queue_send_msg().

◆ qid

uint32_t Queue::qid

Unique identifier of this queue with the communicator.

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

Referenced by handle_add_queue_message(), and queue_send_msg().

◆ mtu

uint32_t Queue::mtu

Maximum transmission unit supported by this queue.

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

Referenced by fragment_message(), handle_add_queue_message(), and select_best_pending_from_link().

◆ num_msg_pending

uint32_t Queue::num_msg_pending

Messages pending.

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

◆ num_bytes_pending

uint32_t Queue::num_bytes_pending

Bytes pending.

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

◆ queue_length

unsigned int Queue::queue_length

Length of the DLL starting at queue_head.

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

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

◆ cs

Connection status for this queue.

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

Referenced by handle_add_queue_message().

◆ idle

int Queue::idle

Set to GNUNET_YES if this queue is idle waiting for some virtual link to give it a pending message.

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

Referenced by handle_add_queue_message(), queue_send_msg(), schedule_transmit_on_queue(), and transmit_on_queue().


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