main for gnunet-service-transport More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_statistics_service.h"
#include "gnunet_peerstore_service.h"
#include "gnunet_transport_communication_service.h"
#include "gnunet_nat_service.h"
#include "gnunet_hello_uri_lib.h"
#include "gnunet_signatures.h"
#include "transport.h"
Go to the source code of this file.
Data Structures | |
struct | MessageUUIDP |
Unique identifier we attach to a message. More... | |
struct | AcknowledgementUUIDP |
Unique identifier to map an acknowledgement to a transmission. More... | |
struct | TransportBackchannelEncapsulationMessage |
Outer layer of an encapsulated backchannel message. More... | |
struct | EphemeralConfirmationPS |
Body by which a peer confirms that it is using an ephemeral key. More... | |
struct | TransportDVBoxPayloadP |
Plaintext of the variable-size payload that is encrypted within a struct TransportBackchannelEncapsulationMessage More... | |
struct | TransportReliabilityBoxMessage |
Outer layer of an encapsulated unfragmented application message sent over an unreliable channel. More... | |
struct | TransportCummulativeAckPayloadP |
Acknowledgement payload. More... | |
struct | TransportReliabilityAckMessage |
Confirmation that the receiver got a GNUNET_MESSAGE_TYPE_TRANSPORT_RELIABILITY_BOX. More... | |
struct | TransportFragmentBoxMessage |
Outer layer of an encapsulated fragmented application message. More... | |
struct | DvInitPS |
Content signed by the initiator during DV learning. More... | |
struct | DvHopPS |
Content signed by each peer during DV learning. More... | |
struct | DVPathEntryP |
An entry describing a peer on a path in a struct TransportDVLearnMessage message. More... | |
struct | TransportDVLearnMessage |
Internal message used by transport for distance vector learning. More... | |
struct | TransportDVBoxMessage |
Outer layer of an encapsulated message send over multiple hops. More... | |
struct | TransportValidationChallengeMessage |
Message send to another peer to validate that it can indeed receive messages at a particular address. More... | |
struct | TransportValidationPS |
Message signed by a peer to confirm that it can indeed receive messages at a particular address. More... | |
struct | TransportValidationResponseMessage |
Message send to a peer to respond to a #GNUNET_MESSAGE_TYPE_ADDRESS_VALIDATION_CHALLENGE. More... | |
struct | TransportGlobalNattedAddress |
struct | TransportFlowControlMessage |
Message for Transport-to-Transport Flow control. More... | |
struct | LearnLaunchEntry |
When did we launch this DV learning activity? More... | |
struct | TransmissionHistoryEntry |
Information we keep per GOODPUT_AGING_SLOTS about historic (or current) transmission performance. More... | |
struct | PerformanceData |
Performance data for a transmission possibility. More... | |
struct | CommunicatorMessageContext |
Context from handle_incoming_msg(). More... | |
struct | RingBufferEntry |
Entry for the ring buffer caching messages send to core, when virtual link is available. More... | |
struct | CoreSentContext |
Closure for core_env_sent_cb. More... | |
struct | ReassemblyContext |
Information we keep for a message that we are reassembling. More... | |
struct | VirtualLink |
A virtual link is another reachable peer that is known to CORE. More... | |
struct | PendingAcknowledgement |
Data structure kept when we are waiting for an acknowledgement. More... | |
struct | DistanceVectorHop |
One possible hop towards a DV target. More... | |
struct | DistanceVector |
Entry in our dv_routes table, representing a (set of) distance vector routes to a particular peer. More... | |
struct | QueueEntry |
Entry identifying transmission in one of our struct Queue which still awaits an ACK. More... | |
struct | Queue |
Handle for a queue. More... | |
struct | Neighbour |
A neighbour that at least one communicator is connected to. More... | |
struct | IncomingRequest |
Another peer attempted to talk to us, we should try to establish a connection in the other direction. More... | |
struct | PeerRequest |
Information per peer and request. More... | |
struct | PendingMessage |
List containing all messages that are yet to be send. More... | |
struct | TransportCummulativeAckPayload |
Acknowledgement payload. More... | |
struct | AcknowledgementCummulator |
Data structure in which we track acknowledgements still to be sent to the. More... | |
struct | AddressListEntry |
One of the addresses of this peer. More... | |
struct | TransportClient |
Client connected to the transport service. More... | |
struct | ValidationState |
State we keep for validation activities. More... | |
struct | Backtalker |
A Backtalker is a peer sending us backchannel messages. More... | |
struct | MonitorEvent |
Details about what to notify monitors about. More... | |
struct | DVKeyState |
Structure of the key material used to encrypt backchannel messages. More... | |
struct | AddGlobalAddressesContext |
struct | FindByMessageUuidContext |
Closure for find_by_message_uuid. More... | |
struct | NeighbourSelectionContext |
Closure for dv_neighbour_selection and dv_neighbour_transmission. More... | |
struct | CheckKnownAddressContext |
Closure for check_known_address. More... | |
struct | CheckKnownChallengeContext |
Closure for check_known_challenge. More... | |
struct | PendingMessageScoreContext |
Context for select_best_pending_from_link(). More... | |
struct | QueueQualityContext |
Closure for check_connection_quality. More... | |
struct | TransportGlobalNattedAddressClosure |
Macros | |
#define | RING_BUFFER_SIZE 16 |
Size of ring buffer to cache CORE and forwarded DVBox messages. More... | |
#define | MAX_FC_RETRANSMIT_COUNT 1000 |
Maximum number of FC retransmissions for a running retransmission task. More... | |
#define | MAX_CUMMULATIVE_ACKS 64 |
Maximum number of messages we acknowledge together in one cumulative ACK. More... | |
#define | FC_NO_CHANGE_REPLY_PROBABILITY 8 |
What is the 1:n chance that we send a Flow control response when receiving a flow control message that did not change anything for us? Basically, this is used in the case where both peers are stuck on flow control (no window changes), but one might continue sending flow control messages to the other peer as the first FC message when things stalled got lost, and then subsequently the other peer does usually not respond as nothing changed. More... | |
#define | IN_PACKET_SIZE_WITHOUT_MTU 128 |
What is the size we assume for a read operation in the absence of an MTU for the purpose of flow control? More... | |
#define | GOODPUT_AGING_SLOTS 4 |
Number of slots we keep of historic data for computation of goodput / message loss ratio. More... | |
#define | DEFAULT_WINDOW_SIZE (128 * 1024) |
How big is the flow control window size by default; limits per-neighbour RAM utilization. More... | |
#define | MAX_INCOMING_REQUEST 16 |
For how many incoming connections do we try to create a virtual link for (at the same time!). More... | |
#define | MAX_DV_DISCOVERY_SELECTION 16 |
Maximum number of peers we select for forwarding DVInit messages at the same time (excluding initiator). More... | |
#define | RECV_WINDOW_SIZE 4 |
Window size. More... | |
#define | MIN_DV_PATH_LENGTH_FOR_INITIATOR 3 |
Minimum number of hops we should forward DV learn messages even if they are NOT useful for us in hope of looping back to the initiator? More... | |
#define | MAX_DV_HOPS_ALLOWED 16 |
Maximum DV distance allowed ever. More... | |
#define | MAX_DV_LEARN_PENDING 64 |
Maximum number of DV learning activities we may have pending at the same time. More... | |
#define | MAX_DV_PATHS_TO_TARGET 3 |
Maximum number of DV paths we keep simultaneously to the same target. More... | |
#define | DELAY_WARN_THRESHOLD GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) |
If a queue delays the next message by more than this number of seconds we log a warning. More... | |
#define | DV_FORWARD_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) |
If a DVBox could not be forwarded after this number of seconds we drop it. More... | |
#define | DEFAULT_ACK_WAIT_DURATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1) |
Default value for how long we wait for reliability ack. More... | |
#define | DV_QUALITY_RTT_THRESHOLD GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1) |
We only consider queues as "quality" connections when suppressing the generation of DV initiation messages if the latency of the queue is below this threshold. More... | |
#define | DV_PATH_VALIDITY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) |
How long do we consider a DV path valid if we see no further updates on it? Note: the value chosen here might be too low! More... | |
#define | BACKCHANNEL_INACTIVITY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) |
How long do we cache backchannel (struct Backtalker) information after a backchannel goes inactive? More... | |
#define | DV_PATH_DISCOVERY_FREQUENCY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4) |
How long before paths expire would we like to (re)discover DV paths? Should be below DV_PATH_VALIDITY_TIMEOUT. More... | |
#define | EPHEMERAL_VALIDITY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) |
How long are ephemeral keys valid? More... | |
#define | REASSEMBLY_EXPIRATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4) |
How long do we keep partially reassembled messages around before giving up? More... | |
#define | FAST_VALIDATION_CHALLENGE_FREQ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1) |
What is the fastest rate at which we send challenges if we keep learning an address (gossip, DHT, etc.)? More... | |
#define | MAX_VALIDATION_CHALLENGE_FREQ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_DAYS, 1) |
What is the slowest rate at which we send challenges? More... | |
#define | ACK_CUMMULATOR_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) |
How long until we forget about historic accumulators and thus reset the ACK counter? Should exceed the maximum time an active connection experiences without an ACK. More... | |
#define | DV_LEARN_BASE_FREQUENCY GNUNET_TIME_UNIT_MINUTES |
What is the non-randomized base frequency at which we would initiate DV learn messages? More... | |
#define | DV_LEARN_QUALITY_THRESHOLD 100 |
How many good connections (confirmed, bi-directional, not DV) do we need to have to suppress initiating DV learn messages? More... | |
#define | MAX_ADDRESS_VALID_UNTIL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MONTHS, 1) |
When do we forget an invalid address for sure? More... | |
#define | ADDRESS_VALIDATION_LIFETIME GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) |
How long do we consider an address valid if we just checked? More... | |
#define | MIN_DELAY_ADDRESS_VALIDATION GNUNET_TIME_UNIT_MILLISECONDS |
What is the maximum frequency at which we do address validation? A random value between 0 and this value is added when scheduling the validation_task (both to ensure we do not validate too often, and to randomize a bit). More... | |
#define | VALIDATION_RTT_BUFFER_FACTOR 3 |
How many network RTTs before an address validation expires should we begin trying to revalidate? (Note that the RTT used here is the one that we experienced during the last validation, not necessarily the latest RTT observed). More... | |
#define | COMMUNICATOR_TOTAL_QUEUE_LIMIT 512 |
How many messages can we have pending for a given communicator process before we start to throttle that communicator? More... | |
#define | QUEUE_LENGTH_LIMIT 32 |
How many messages can we have pending for a given queue (queue to a particular peer via a communicator) process before we start to throttle that queue? More... | |
#define | QUEUE_ENTRY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) |
#define | RTT_DIFF GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1) |
Difference of the average RTT for the DistanceVector calculate by us and the target we are willing to accept for starting the burst. More... | |
Typedefs | |
typedef void(* | DVMessageHandler) (void *cls, struct Neighbour *next_hop, const struct GNUNET_MessageHeader *hdr, enum RouteMessageOptions options) |
Function to call to further operate on the now DV encapsulated message hdr, forwarding it via next_hop under respect of options. More... | |
Enumerations | |
enum | ClientType { CT_NONE = 0 , CT_CORE = 1 , CT_MONITOR = 2 , CT_COMMUNICATOR = 3 , CT_APPLICATION = 4 } |
What type of client is the struct TransportClient about? More... | |
enum | RouteMessageOptions { RMO_NONE = 0 , RMO_DV_ALLOWED = 1 , RMO_UNCONFIRMED_ALLOWED = 2 , RMO_ANYTHING_GOES = (RMO_DV_ALLOWED | RMO_UNCONFIRMED_ALLOWED) , RMO_REDUNDANT = 4 } |
Which transmission options are allowable for transmission? Interpreted bit-wise! More... | |
enum | PendingMessageType { PMT_CORE = 0 , PMT_FRAGMENT_BOX = 1 , PMT_RELIABILITY_BOX = 2 , PMT_DV_BOX = 3 } |
Types of different pending messages. More... | |
Functions | |
static unsigned int | get_age () |
Get an offset into the transmission history buffer for struct PerformanceData . More... | |
static void | free_incoming_request (struct IncomingRequest *ir) |
Release ir data structure. More... | |
static void | free_pending_acknowledgement (struct PendingAcknowledgement *pa) |
Release pa data structure. More... | |
static void | free_fragment_tree (struct PendingMessage *root) |
Free fragment tree below root, excluding root itself. More... | |
static void | free_pending_message (struct PendingMessage *pm) |
Release memory associated with pm and remove pm from associated data structures. More... | |
static void | free_reassembly_context (struct ReassemblyContext *rc) |
Free rc. More... | |
static void | reassembly_cleanup_task (void *cls) |
Task run to clean up reassembly context of a neighbour that have expired. More... | |
static int | free_reassembly_cb (void *cls, uint32_t key, void *value) |
function called to free_reassembly_context(). More... | |
static void | free_virtual_link (struct VirtualLink *vl) |
Free virtual link. More... | |
static void | free_validation_state (struct ValidationState *vs) |
Free validation state. More... | |
static struct Neighbour * | lookup_neighbour (const struct GNUNET_PeerIdentity *pid) |
Lookup neighbour for peer pid. More... | |
static struct VirtualLink * | lookup_virtual_link (const struct GNUNET_PeerIdentity *pid) |
Lookup virtual link for peer pid. More... | |
static void | free_distance_vector_hop (struct DistanceVectorHop *dvh) |
Free a dvh. More... | |
static void | check_link_down (void *cls) |
Task run to check whether the hops of the cls still are validated, or if we need to core about disconnection. More... | |
static void | cores_send_disconnect_info (const struct GNUNET_PeerIdentity *pid) |
Send message to CORE clients that we lost a connection. More... | |
static void | free_dv_route (struct DistanceVector *dv) |
Free entry in dv_routes. More... | |
static void | notify_monitor (struct TransportClient *tc, const struct GNUNET_PeerIdentity *peer, const char *address, enum GNUNET_NetworkType nt, const struct MonitorEvent *me) |
Notify monitor tc about an event. More... | |
static void | notify_monitors (const struct GNUNET_PeerIdentity *peer, const char *address, enum GNUNET_NetworkType nt, const struct MonitorEvent *me) |
Send information in me about a peer's status with respect to some address to all monitors that care. More... | |
static void * | client_connect_cb (void *cls, struct GNUNET_SERVICE_Client *client, struct GNUNET_MQ_Handle *mq) |
Called whenever a client connects. More... | |
static enum GNUNET_GenericReturnValue | remove_global_addresses (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
static void | free_neighbour (struct Neighbour *neighbour, enum GNUNET_GenericReturnValue drop_link) |
Release memory used by neighbour. More... | |
static void | core_send_connect_info (struct TransportClient *tc, const struct GNUNET_PeerIdentity *pid) |
Send message to CORE clients that we lost a connection. More... | |
static void | cores_send_connect_info (const struct GNUNET_PeerIdentity *pid) |
Send message to CORE clients that we gained a connection. More... | |
static void | transmit_on_queue (void *cls) |
We believe we are ready to transmit a message on a queue. More... | |
static unsigned int | check_for_queue_with_higher_prio (struct Queue *queue, struct Queue *queue_head) |
Check if the communicator has another queue with higher prio ready for sending. More... | |
static void | schedule_transmit_on_queue (struct GNUNET_TIME_Relative delay, struct Queue *queue, enum GNUNET_SCHEDULER_Priority p) |
Called whenever something changed that might effect when we try to do the next transmission on queue using transmit_on_queue(). More... | |
static void | free_queue (struct Queue *queue) |
Free queue. More... | |
static void | free_address_list_entry (struct AddressListEntry *ale) |
Free ale. More... | |
static int | stop_peer_request (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
Stop the peer request in value. More... | |
static void | do_shutdown (void *cls) |
Function called when the service shuts down. More... | |
static void | client_disconnect_cb (void *cls, struct GNUNET_SERVICE_Client *client, void *app_ctx) |
Called whenever a client is disconnected. More... | |
static int | notify_client_connect_info (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
Iterator telling new CORE client about all existing connections to peers. More... | |
static void | finish_cmc_handling_with_continue (struct CommunicatorMessageContext *cmc, unsigned int free_cmc) |
Send ACK to communicator (if requested) and free cmc. More... | |
static enum GNUNET_GenericReturnValue | resume_communicators (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
static void | handle_client_start (void *cls, const struct StartMessage *start) |
Initialize a "CORE" client. More... | |
static int | check_client_send (void *cls, const struct OutboundMessage *obm) |
Client asked for transmission to a peer. More... | |
static void | client_send_response (struct PendingMessage *pm) |
Send a response to the pm that we have processed a "send" request. More... | |
static unsigned int | pick_random_dv_hops (const struct DistanceVector *dv, enum RouteMessageOptions options, struct DistanceVectorHop **hops_array, unsigned int hops_array_length) |
Pick hops_array_length random DV paths satisfying options. More... | |
static int | check_communicator_available (void *cls, const struct GNUNET_TRANSPORT_CommunicatorAvailableMessage *cam) |
Communicator started. More... | |
static void | finish_cmc_handling (struct CommunicatorMessageContext *cmc) |
static void | handle_client_recv_ok (void *cls, const struct RecvOkMessage *rom) |
Client confirms that it is done handling message(s) to a particular peer. More... | |
static void | handle_communicator_available (void *cls, const struct GNUNET_TRANSPORT_CommunicatorAvailableMessage *cam) |
Communicator started. More... | |
static int | check_communicator_backchannel (void *cls, const struct GNUNET_TRANSPORT_CommunicatorBackchannel *cb) |
Communicator requests backchannel transmission. More... | |
static void | sign_ephemeral (struct DistanceVector *dv) |
Sign ephemeral keys in our dv are current. More... | |
static void | free_queue_entry (struct QueueEntry *qe, struct TransportClient *tc) |
static void | free_timedout_queue_entry (void *cls) |
static void | queue_send_msg (struct Queue *queue, struct PendingMessage *pm, const void *payload, size_t payload_size) |
Send the message payload on queue. More... | |
static struct GNUNET_TIME_Relative | route_via_neighbour (const struct Neighbour *n, const struct GNUNET_MessageHeader *hdr, enum RouteMessageOptions options) |
Pick a queue of n under constraints options and schedule transmission of hdr. More... | |
static void | dv_setup_key_state_from_km (const struct GNUNET_ShortHashCode *km, const struct GNUNET_ShortHashCode *iv, struct DVKeyState *key) |
Given the key material in km and the initialization vector iv, setup the key material for the backchannel in key. More... | |
static void | dv_hmac (const struct DVKeyState *key, struct GNUNET_HashCode *hmac, const void *data, size_t data_size) |
Do HMAC calculation for backchannel messages over data using key material from key. More... | |
static void | dv_encrypt (struct DVKeyState *key, const void *in, void *dst, size_t in_size) |
Perform backchannel encryption using symmetric secret in key to encrypt data from in to dst. More... | |
static enum GNUNET_GenericReturnValue | dv_decrypt (struct DVKeyState *key, void *out, const void *ciph, size_t out_size) |
Perform backchannel encryption using symmetric secret in key to encrypt data from in to dst. More... | |
static void | dv_key_clean (struct DVKeyState *key) |
Clean up key material in key. More... | |
static struct GNUNET_TIME_Relative | encapsulate_for_dv (struct DistanceVector *dv, unsigned int num_dvhs, struct DistanceVectorHop **dvhs, const struct GNUNET_MessageHeader *hdr, DVMessageHandler use, void *use_cls, enum RouteMessageOptions options, enum GNUNET_GenericReturnValue without_fc) |
Pick a path of dv under constraints options and schedule transmission of hdr. More... | |
static void | send_dv_to_neighbour (void *cls, struct Neighbour *next_hop, const struct GNUNET_MessageHeader *hdr, enum RouteMessageOptions options) |
Wrapper around route_via_neighbour() that matches the DVMessageHandler structure. More... | |
static struct GNUNET_TIME_Relative | route_control_message_without_fc (struct VirtualLink *vl, const struct GNUNET_MessageHeader *hdr, enum RouteMessageOptions options) |
We need to transmit hdr to target. More... | |
static void | consider_sending_fc (void *cls) |
Something changed on the virtual link with respect to flow control. More... | |
static void | task_consider_sending_fc (void *cls) |
Something changed on the virtual link with respect to flow control. More... | |
static char * | get_address_without_port (const char *address) |
Get the IP address without the port number. More... | |
static enum GNUNET_GenericReturnValue | add_global_addresses (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
static struct GNUNET_TIME_Relative | calculate_rtt (struct DistanceVector *dv) |
static void | check_vl_transmission (struct VirtualLink *vl) |
There is a message at the head of the pending messages for vl which may be ready for transmission. More... | |
static void | handle_client_send (void *cls, const struct OutboundMessage *obm) |
Client asked for transmission to a peer. More... | |
static void | handle_communicator_backchannel (void *cls, const struct GNUNET_TRANSPORT_CommunicatorBackchannel *cb) |
Communicator requests backchannel transmission. More... | |
static int | check_add_address (void *cls, const struct GNUNET_TRANSPORT_AddAddressMessage *aam) |
Address of our peer added. More... | |
static void | store_pi (void *cls) |
Ask peerstore to store our address. More... | |
static void | peerstore_store_own_cb (void *cls, int success) |
Function called when peerstore is done storing our address. More... | |
static void | shc_cont (void *cls, int success) |
static struct AddressListEntry * | create_address_entry (struct TransportClient *tc, struct GNUNET_TIME_Relative expiration, enum GNUNET_NetworkType nt, const char *address, uint32_t aid, size_t slen) |
static void | handle_add_address (void *cls, const struct GNUNET_TRANSPORT_AddAddressMessage *aam) |
Address of our peer added. More... | |
static void | handle_del_address (void *cls, const struct GNUNET_TRANSPORT_DelAddressMessage *dam) |
Address of our peer deleted. More... | |
static void | demultiplex_with_cmc (struct CommunicatorMessageContext *cmc) |
Given an inbound message msg from a communicator cmc, demultiplex it based on the type calling the right handler. More... | |
static void | core_env_sent_cb (void *cls) |
Function called when we are done giving a message of a certain size to CORE and should thus decrement the number of bytes of RAM reserved for that peer's MQ. More... | |
static void | finish_handling_raw_message (struct VirtualLink *vl, const struct GNUNET_MessageHeader *mh, struct CommunicatorMessageContext *cmc, unsigned int free_cmc) |
static void | handle_raw_message (void *cls, const struct GNUNET_MessageHeader *mh) |
Communicator gave us an unencapsulated message to pass as-is to CORE. More... | |
static int | check_fragment_box (void *cls, const struct TransportFragmentBoxMessage *fb) |
Communicator gave us a fragment box. More... | |
static void | destroy_ack_cummulator (void *cls) |
Clean up an idle cumulative acknowledgement data structure. More... | |
static void | transmit_cummulative_ack_cb (void *cls) |
Do the transmission of a cumulative acknowledgement now. More... | |
static void | cummulative_ack (const struct GNUNET_PeerIdentity *pid, const struct AcknowledgementUUIDP *ack_uuid, struct GNUNET_TIME_Absolute max_delay) |
Transmit an acknowledgement for ack_uuid to pid delaying transmission by at most ack_delay. More... | |
static int | find_by_message_uuid (void *cls, uint32_t key, void *value) |
Iterator called to find a reassembly context by the message UUID in the multihashmap32. More... | |
static void | handle_fragment_box (void *cls, const struct TransportFragmentBoxMessage *fb) |
Communicator gave us a fragment. More... | |
static int | check_reliability_box (void *cls, const struct TransportReliabilityBoxMessage *rb) |
Communicator gave us a reliability box. More... | |
static void | handle_reliability_box (void *cls, const struct TransportReliabilityBoxMessage *rb) |
Communicator gave us a reliability box. More... | |
static void | update_pd_age (struct PerformanceData *pd, unsigned int age) |
Check if we have advanced to another age since the last time. More... | |
static void | update_performance_data (struct PerformanceData *pd, struct GNUNET_TIME_Relative rtt, uint16_t bytes_transmitted_ok) |
Update pd based on the latest rtt and the number of bytes that were confirmed to be successfully transmitted. More... | |
static void | update_queue_performance (struct Queue *q, struct GNUNET_TIME_Relative rtt, uint16_t bytes_transmitted_ok) |
We have successfully transmitted data via q, update metrics. More... | |
static void | update_dvh_performance (struct DistanceVectorHop *dvh, struct GNUNET_TIME_Relative rtt, uint16_t bytes_transmitted_ok) |
We have successfully transmitted data via dvh, update metrics. More... | |
static void | completed_pending_message (struct PendingMessage *pm) |
We have completed transmission of pm, remove it from the transmission queues (and if it is a fragment, continue up the tree as necessary). More... | |
static void | handle_acknowledged (struct PendingAcknowledgement *pa, struct GNUNET_TIME_Relative ack_delay) |
The pa was acknowledged, process the acknowledgement. More... | |
static int | check_reliability_ack (void *cls, const struct TransportReliabilityAckMessage *ra) |
Communicator gave us a reliability ack. More... | |
static void | handle_reliability_ack (void *cls, const struct TransportReliabilityAckMessage *ra) |
Communicator gave us a reliability ack. More... | |
static int | check_backchannel_encapsulation (void *cls, const struct TransportBackchannelEncapsulationMessage *be) |
Communicator gave us a backchannel encapsulation. More... | |
static void | handle_backchannel_encapsulation (void *cls, const struct TransportBackchannelEncapsulationMessage *be) |
Communicator gave us a backchannel encapsulation. More... | |
static void | path_cleanup_cb (void *cls) |
Task called when we should check if any of the DV paths we have learned to a target are due for garbage collection. More... | |
static void | send_msg_from_cache (struct VirtualLink *vl) |
static void | activate_core_visible_dv_path (struct DistanceVectorHop *hop) |
The hop is a validated path to the respective target peer and we should tell core about it – and schedule a job to revoke the state. More... | |
static int | learn_dv_path (const struct GNUNET_PeerIdentity *path, unsigned int path_len, struct GNUNET_TIME_Relative network_latency, struct GNUNET_TIME_Absolute path_valid_until) |
We have learned a path through the network to some other peer, add it to our DV data structure (returning GNUNET_YES on success). More... | |
static int | check_dv_learn (void *cls, const struct TransportDVLearnMessage *dvl) |
Communicator gave us a DV learn message. More... | |
static void | forward_dv_learn (const struct GNUNET_PeerIdentity *next_hop, const struct TransportDVLearnMessage *msg, uint16_t bi_history, uint16_t nhops, const struct DVPathEntryP *hops, struct GNUNET_TIME_Absolute in_time) |
Build and forward a DV learn message to next_hop. More... | |
static int | validate_dv_initiator_signature (struct GNUNET_TIME_AbsoluteNBO sender_monotonic_time, const struct GNUNET_PeerIdentity *init, const struct GNUNET_CRYPTO_ChallengeNonceP *challenge, const struct GNUNET_CRYPTO_EddsaSignature *init_sig) |
Check signature of type GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_INITIATOR. More... | |
static int | dv_neighbour_selection (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
Function called for each neighbour during handle_dv_learn. More... | |
static int | dv_neighbour_transmission (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
Function called for each neighbour during handle_dv_learn. More... | |
static unsigned int | calculate_fork_degree (unsigned int hops_taken, unsigned int neighbour_count, unsigned int eligible_count) |
Computes the number of neighbours we should forward a DVInit message to given that it has so far taken hops_taken hops though the network and that the number of neighbours we have in total is neighbour_count, out of which eligible_count are not yet on the path. More... | |
static void | neighbour_store_dvmono_cb (void *cls, int success) |
Function called when peerstore is done storing a DV monotonic time. More... | |
static struct GNUNET_TIME_Relative | get_network_latency (const struct TransportDVLearnMessage *dvl) |
static void | handle_dv_learn (void *cls, const struct TransportDVLearnMessage *dvl) |
Communicator gave us a DV learn message. More... | |
static int | check_dv_box (void *cls, const struct TransportDVBoxMessage *dvb) |
Communicator gave us a DV box. More... | |
static void | forward_dv_box (struct Neighbour *next_hop, struct TransportDVBoxMessage *hdr, uint16_t total_hops, uint16_t num_hops, const struct GNUNET_PeerIdentity *hops, const void *enc_payload, uint16_t enc_payload_size) |
Create a DV Box message and queue it for transmission to next_hop. More... | |
static void | free_backtalker (struct Backtalker *b) |
Free data structures associated with b. More... | |
static int | free_backtalker_cb (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
Callback to free backtalker records. More... | |
static void | backtalker_timeout_cb (void *cls) |
Function called when it is time to clean up a backtalker. More... | |
static void | backtalker_monotime_cb (void *cls, const struct GNUNET_PEERSTORE_Record *record, const char *emsg) |
Function called with the monotonic time of a backtalker by PEERSTORE. More... | |
static void | backtalker_monotime_store_cb (void *cls, int success) |
Function called by PEERSTORE when the store operation of a backtalker's monotonic time is complete. More... | |
static void | update_backtalker_monotime (struct Backtalker *b) |
The backtalker b monotonic time changed. More... | |
static void | handle_dv_box (void *cls, const struct TransportDVBoxMessage *dvb) |
Communicator gave us a DV box. More... | |
static int | check_incoming_msg (void *cls, const struct GNUNET_TRANSPORT_IncomingMessage *im) |
Client notified us about transmission from a peer. More... | |
static int | check_known_address (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
Test if the validation state in value matches the address from cls. More... | |
static void | validation_start_cb (void *cls) |
Task run periodically to validate some address based on validation_heap. More... | |
static void | update_next_challenge_time (struct ValidationState *vs, struct GNUNET_TIME_Absolute new_time) |
Set the time for next_challenge of vs to new_time. More... | |
static void | start_address_validation (const struct GNUNET_PeerIdentity *pid, const char *address) |
Start address validation. More... | |
static struct Queue * | find_queue (const struct GNUNET_PeerIdentity *pid, const char *address) |
Find the queue matching pid and address. More... | |
static void | suggest_to_connect (const struct GNUNET_PeerIdentity *pid, const char *address) |
Signature of a function called with a communicator address of a peer pid that an application wants us to connect to. More... | |
static void | hello_for_incoming_cb (void *cls, const struct GNUNET_PeerIdentity *pid, const char *uri) |
static void | handle_hello_for_incoming (void *cls, const struct GNUNET_PEERSTORE_Record *record, const char *emsg) |
Function called by PEERSTORE for each matching record. More... | |
static void | hello_for_incoming_error_cb (void *cls) |
static void | hello_for_incoming_sync_cb (void *cls) |
static void | handle_validation_challenge (void *cls, const struct TransportValidationChallengeMessage *tvc) |
Communicator gave us a transport address validation challenge. More... | |
static int | check_known_challenge (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
Test if the validation state in value matches the challenge from cls. More... | |
static void | peerstore_store_validation_cb (void *cls, int success) |
Function called when peerstore is done storing a validated address. More... | |
static void | validation_transmit_on_queue (struct Queue *q, struct ValidationState *vs) |
The queue q (which matches the peer and address in vs) is ready for queueing. More... | |
static void | revalidation_start_cb (void *cls) |
static enum GNUNET_GenericReturnValue | revalidate_map_it (void *cls, const struct GNUNET_HashCode *key, void *value) |
static void | handle_validation_response (void *cls, const struct TransportValidationResponseMessage *tvr) |
Communicator gave us a transport address validation response. More... | |
static void | handle_incoming_msg (void *cls, const struct GNUNET_TRANSPORT_IncomingMessage *im) |
Incoming message. More... | |
static int | check_flow_control (void *cls, const struct TransportFlowControlMessage *fc) |
Communicator gave us a transport address validation response. More... | |
static void | iterate_address_start_burst (void *cls, const struct GNUNET_PeerIdentity *pid, const char *uri) |
static void | check_for_burst_address (void *cls, const struct GNUNET_PEERSTORE_Record *record, const char *emsg) |
static void | burst_timeout (void *cls) |
static void | start_burst (void *cls) |
static void | queue_burst (void *cls) |
static void | handle_flow_control (void *cls, const struct TransportFlowControlMessage *fc) |
Communicator gave us a transport address validation response. More... | |
static int | check_add_queue_message (void *cls, const struct GNUNET_TRANSPORT_AddQueueMessage *aqm) |
New queue became available. More... | |
static void | set_pending_message_uuid (struct PendingMessage *pm) |
If necessary, generates the UUID for a pm. More... | |
static struct PendingAcknowledgement * | prepare_pending_acknowledgement (struct Queue *queue, struct DistanceVectorHop *dvh, struct PendingMessage *pm) |
Setup data structure waiting for acknowledgements. More... | |
static struct PendingMessage * | fragment_message (struct Queue *queue, struct DistanceVectorHop *dvh, struct PendingMessage *pm) |
Fragment the given pm to the given mtu. More... | |
static struct PendingMessage * | reliability_box_message (struct Queue *queue, struct DistanceVectorHop *dvh, struct PendingMessage *pm) |
Reliability-box the given pm. More... | |
static void | reorder_root_pm (struct PendingMessage *pm, struct GNUNET_TIME_Absolute next_attempt) |
static unsigned int | check_next_attempt_tree (struct PendingMessage *pm, struct PendingMessage *root) |
static void | harmonize_flight_round (struct PendingMessage *pm) |
static void | update_pm_next_attempt (struct PendingMessage *pm, struct GNUNET_TIME_Absolute next_attempt) |
Change the value of the next_attempt field of pm to next_attempt and re-order pm in the transmission list as required by the new timestamp. More... | |
static void | select_best_pending_from_link (struct PendingMessageScoreContext *sc, struct Queue *queue, struct VirtualLink *vl, struct DistanceVectorHop *dvh, size_t overhead) |
Select the best pending message from vl for transmission via queue. More... | |
static void | extract_box_cb (void *cls, struct Neighbour *next_hop, const struct GNUNET_MessageHeader *hdr, enum RouteMessageOptions options) |
Function to call to further operate on the now DV encapsulated message hdr, forwarding it via next_hop under respect of options. More... | |
static void | handle_del_queue_message (void *cls, const struct GNUNET_TRANSPORT_DelQueueMessage *dqm) |
Queue to a peer went down. More... | |
static void | handle_send_message_ack (void *cls, const struct GNUNET_TRANSPORT_SendMessageToAck *sma) |
Message was transmitted. More... | |
static void | handle_burst_finished () |
The burst finished. More... | |
static int | notify_client_queues (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
Iterator telling new MONITOR client about all existing queues to peers. More... | |
static void | handle_monitor_start (void *cls, const struct GNUNET_TRANSPORT_MonitorStart *start) |
Initialize a monitor client. More... | |
static struct TransportClient * | lookup_communicator (const char *prefix) |
Find transport client providing communication service for the protocol prefix. More... | |
static int | check_connection_quality (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
Check whether any queue to the given neighbour is of a good "quality" and if so, increment the counter. More... | |
static void | start_dv_learn (void *cls) |
Task run when we CONSIDER initiating a DV learn process. More... | |
static int | check_validation_request_pending (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
A new queue has been created, check if any address validation requests have been waiting for it. More... | |
static void | neighbour_dv_monotime_cb (void *cls, const struct GNUNET_PEERSTORE_Record *record, const char *emsg) |
Function called with the monotonic time of a DV initiator by PEERSTORE. More... | |
static void | iterate_address_and_compare_cb (void *cls, const struct GNUNET_PeerIdentity *pid, const char *uri) |
static enum GNUNET_GenericReturnValue | contains_address (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
static void | check_for_global_natted_error_cb (void *cls) |
static void | check_for_global_natted_sync_cb (void *cls) |
static void | check_for_global_natted (void *cls, const struct GNUNET_PEERSTORE_Record *record, const char *emsg) |
static void | handle_add_queue_message (void *cls, const struct GNUNET_TRANSPORT_AddQueueMessage *aqm) |
New queue became available. More... | |
static void | handle_update_queue_message (void *cls, const struct GNUNET_TRANSPORT_UpdateQueueMessage *msg) |
Handle updates to queues. More... | |
static void | handle_queue_create_ok (void *cls, const struct GNUNET_TRANSPORT_CreateQueueResponse *cqr) |
Communicator tells us that our request to create a queue "worked", that is setting up the queue is now in process. More... | |
static void | handle_queue_create_fail (void *cls, const struct GNUNET_TRANSPORT_CreateQueueResponse *cqr) |
Communicator tells us that our request to create a queue failed. More... | |
static void | handle_suggest_cancel (void *cls, const struct ExpressPreferenceMessage *msg) |
We have received a struct ExpressPreferenceMessage from an application client. More... | |
static void | hello_for_client_cb (void *cls, const struct GNUNET_PeerIdentity *pid, const char *uri) |
static void | handle_hello_for_client (void *cls, const struct GNUNET_PEERSTORE_Record *record, const char *emsg) |
Function called by PEERSTORE for each matching record. More... | |
static void | hello_for_client_error_cb (void *cls) |
static void | hello_for_client_sync_cb (void *cls) |
static void | handle_suggest (void *cls, const struct ExpressPreferenceMessage *msg) |
We have received a struct ExpressPreferenceMessage from an application client. More... | |
static int | check_request_hello_validation (void *cls, const struct RequestHelloValidationMessage *m) |
Check GNUNET_MESSAGE_TYPE_TRANSPORT_REQUEST_HELLO_VALIDATION messages. More... | |
static void | handle_request_hello_validation (void *cls, const struct RequestHelloValidationMessage *m) |
A client encountered an address of another peer. More... | |
static int | free_neighbour_cb (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
Free neighbour entry. More... | |
static int | free_dv_routes_cb (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
Free DV route entry. More... | |
static int | free_validation_state_cb (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
Free validation state. More... | |
static int | free_pending_ack_cb (void *cls, const struct GNUNET_Uuid *key, void *value) |
Free pending acknowledgement. More... | |
static int | free_ack_cummulator_cb (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) |
Free acknowledgement cummulator. More... | |
static void | shutdown_task (void *cls) |
static void | run (void *cls, const struct GNUNET_CONFIGURATION_Handle *c, struct GNUNET_SERVICE_Handle *service) |
Initiate transport service. More... | |
GNUNET_SERVICE_MAIN ("transport", GNUNET_SERVICE_OPTION_SOFT_SHUTDOWN, &run, &client_connect_cb, &client_disconnect_cb, NULL, GNUNET_MQ_hd_fixed_size(suggest, GNUNET_MESSAGE_TYPE_TRANSPORT_SUGGEST, struct ExpressPreferenceMessage, NULL), GNUNET_MQ_hd_fixed_size(suggest_cancel, GNUNET_MESSAGE_TYPE_TRANSPORT_SUGGEST_CANCEL, struct ExpressPreferenceMessage, NULL), GNUNET_MQ_hd_var_size(request_hello_validation, GNUNET_MESSAGE_TYPE_TRANSPORT_REQUEST_HELLO_VALIDATION, struct RequestHelloValidationMessage, NULL), GNUNET_MQ_hd_fixed_size(client_start, GNUNET_MESSAGE_TYPE_TRANSPORT_START, struct StartMessage, NULL), GNUNET_MQ_hd_var_size(client_send, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND, struct OutboundMessage, NULL), GNUNET_MQ_hd_fixed_size(client_recv_ok, GNUNET_MESSAGE_TYPE_TRANSPORT_RECV_OK, struct RecvOkMessage, NULL), GNUNET_MQ_hd_var_size(communicator_available, GNUNET_MESSAGE_TYPE_TRANSPORT_NEW_COMMUNICATOR, struct GNUNET_TRANSPORT_CommunicatorAvailableMessage, NULL), GNUNET_MQ_hd_var_size(communicator_backchannel, GNUNET_MESSAGE_TYPE_TRANSPORT_COMMUNICATOR_BACKCHANNEL, struct GNUNET_TRANSPORT_CommunicatorBackchannel, NULL), GNUNET_MQ_hd_var_size(add_address, GNUNET_MESSAGE_TYPE_TRANSPORT_ADD_ADDRESS, struct GNUNET_TRANSPORT_AddAddressMessage, NULL), GNUNET_MQ_hd_fixed_size(del_address, GNUNET_MESSAGE_TYPE_TRANSPORT_DEL_ADDRESS, struct GNUNET_TRANSPORT_DelAddressMessage, NULL), GNUNET_MQ_hd_var_size(incoming_msg, GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG, struct GNUNET_TRANSPORT_IncomingMessage, NULL), GNUNET_MQ_hd_fixed_size(queue_create_ok, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_OK, struct GNUNET_TRANSPORT_CreateQueueResponse, NULL), GNUNET_MQ_hd_fixed_size(queue_create_fail, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_FAIL, struct GNUNET_TRANSPORT_CreateQueueResponse, NULL), GNUNET_MQ_hd_var_size(add_queue_message, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_SETUP, struct GNUNET_TRANSPORT_AddQueueMessage, NULL), GNUNET_MQ_hd_fixed_size(update_queue_message, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_UPDATE, struct GNUNET_TRANSPORT_UpdateQueueMessage, NULL), GNUNET_MQ_hd_fixed_size(del_queue_message, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_TEARDOWN, struct GNUNET_TRANSPORT_DelQueueMessage, NULL), GNUNET_MQ_hd_fixed_size(send_message_ack, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG_ACK, struct GNUNET_TRANSPORT_SendMessageToAck, NULL), GNUNET_MQ_hd_fixed_size(burst_finished, GNUNET_MESSAGE_TYPE_TRANSPORT_BURST_FINISHED, struct GNUNET_TRANSPORT_BurstFinished, NULL), GNUNET_MQ_hd_fixed_size(monitor_start, GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_START, struct GNUNET_TRANSPORT_MonitorStart, NULL), GNUNET_MQ_handler_end()) | |
Define "main" method using service macro. More... | |
Variables | |
static struct RingBufferEntry * | ring_buffer [RING_BUFFER_SIZE] |
Ring buffer for a CORE message we did not deliver to CORE, because of missing virtual link to sender. More... | |
static unsigned int | ring_buffer_head |
Head of the ring buffer. More... | |
static unsigned int | is_ring_buffer_full |
Is the ring buffer filled up to RING_BUFFER_SIZE. More... | |
static struct PendingMessage * | ring_buffer_dv [RING_BUFFER_SIZE] |
Ring buffer for a forwarded DVBox message we did not deliver to the next hop, because of missing virtual link that hop. More... | |
static unsigned int | ring_buffer_dv_head |
Head of the ring buffer. More... | |
static unsigned int | is_ring_buffer_dv_full |
Is the ring buffer filled up to RING_BUFFER_SIZE. More... | |
static struct TransportClient * | clients_head |
Head of linked list of all clients to this service. More... | |
static struct TransportClient * | clients_tail |
Tail of linked list of all clients to this service. More... | |
static struct GNUNET_STATISTICS_Handle * | GST_stats |
Statistics handle. More... | |
static const struct GNUNET_CONFIGURATION_Handle * | GST_cfg |
Configuration handle. More... | |
static struct GNUNET_PeerIdentity | GST_my_identity |
Our public key. More... | |
struct GNUNET_HELLO_Builder * | GST_my_hello |
Our HELLO. More... | |
static struct GNUNET_CRYPTO_EddsaPrivateKey * | GST_my_private_key |
Our private key. More... | |
static struct GNUNET_CONTAINER_MultiPeerMap * | neighbours |
Map from PIDs to struct Neighbour entries. More... | |
static struct GNUNET_CONTAINER_MultiPeerMap * | backtalkers |
Map from PIDs to struct Backtalker entries. More... | |
static struct GNUNET_CONTAINER_MultiPeerMap * | ack_cummulators |
Map from PIDs to struct AcknowledgementCummulator s. More... | |
static struct GNUNET_CONTAINER_MultiUuidmap * | pending_acks |
Map of pending acknowledgements, mapping struct AcknowledgementUUID to a struct PendingAcknowledgement . More... | |
static struct GNUNET_CONTAINER_MultiPeerMap * | dv_routes |
Map from PIDs to struct DistanceVector entries describing known paths to the peer. More... | |
static struct GNUNET_CONTAINER_MultiPeerMap * | validation_map |
Map from PIDs to struct ValidationState entries describing addresses we are aware of and their validity state. More... | |
static struct GNUNET_CONTAINER_MultiHashMap * | revalidation_map |
Map from addresses to struct ValidationState entries describing addresses we are aware of and their validity state. More... | |
static struct GNUNET_CONTAINER_MultiPeerMap * | links |
Map from PIDs to struct VirtualLink entries describing links CORE knows to exist. More... | |
static struct GNUNET_CONTAINER_MultiShortmap * | dvlearn_map |
Map from challenges to struct LearnLaunchEntry values. More... | |
static struct LearnLaunchEntry * | lle_head = NULL |
Head of a DLL sorted by launch time. More... | |
static struct LearnLaunchEntry * | lle_tail = NULL |
Tail of a DLL sorted by launch time. More... | |
static struct GNUNET_CONTAINER_Heap * | validation_heap |
MIN Heap sorted by "next_challenge" to struct ValidationState entries sorting addresses we are aware of by when we should next try to (re)validate (or expire) them. More... | |
struct GNUNET_NAT_Handle * | nh |
Handle for connect to the NAT service. More... | |
static struct GNUNET_PEERSTORE_Handle * | peerstore |
Database for peer's HELLOs. More... | |
static struct GNUNET_SCHEDULER_Task * | dvlearn_task |
Task run to initiate DV learning. More... | |
static struct GNUNET_SCHEDULER_Task * | validation_task |
Task to run address validation. More... | |
static struct IncomingRequest * | ir_head |
List of incoming connections where we are trying to get a connection back established. More... | |
static struct IncomingRequest * | ir_tail |
Tail of DLL starting at ir_head. More... | |
static unsigned int | ir_total |
Length of the DLL starting at ir_head. More... | |
static unsigned long long | logging_uuid_gen |
Generator of logging_uuid in struct PendingMessage . More... | |
static enum GNUNET_GenericReturnValue | burst_running |
Is there a burst running? More... | |
static struct GNUNET_TIME_Absolute | hello_mono_time |
Monotonic time we use for HELLOs generated at this time. More... | |
static int | in_shutdown |
Indication if we have received a shutdown signal and are in the process of cleaning up. More... | |
static struct GNUNET_SCHEDULER_Task * | burst_task |
The task to start the burst. More... | |
struct GNUNET_SCHEDULER_Task * | burst_timeout_task |
enum GNUNET_GenericReturnValue | use_burst |
main for gnunet-service-transport
TODO: Implement next:
Optimizations-Statistics:
Optimizations-DV:
struct IncomingRequest
. (i.e. if DVH is unconfirmed, incoming requests cause us to try to validate a passively learned path (requires new message type!))Optimizations-Fragmentation:
Optimizations-internals:
Definition in file gnunet-service-transport.c.
#define RING_BUFFER_SIZE 16 |
Size of ring buffer to cache CORE and forwarded DVBox messages.
Definition at line 88 of file gnunet-service-transport.c.
#define MAX_FC_RETRANSMIT_COUNT 1000 |
Maximum number of FC retransmissions for a running retransmission task.
Definition at line 93 of file gnunet-service-transport.c.
#define MAX_CUMMULATIVE_ACKS 64 |
Maximum number of messages we acknowledge together in one cumulative ACK.
Larger values may save a bit of bandwidth.
Definition at line 99 of file gnunet-service-transport.c.
#define FC_NO_CHANGE_REPLY_PROBABILITY 8 |
What is the 1:n chance that we send a Flow control response when receiving a flow control message that did not change anything for us? Basically, this is used in the case where both peers are stuck on flow control (no window changes), but one might continue sending flow control messages to the other peer as the first FC message when things stalled got lost, and then subsequently the other peer does usually not respond as nothing changed.
So to ensure that eventually the FC messages stop, we do send with 1/8th probability an FC message even if nothing changed. That prevents one peer being stuck in sending (useless) FC messages "forever".
Definition at line 113 of file gnunet-service-transport.c.
#define IN_PACKET_SIZE_WITHOUT_MTU 128 |
What is the size we assume for a read operation in the absence of an MTU for the purpose of flow control?
Definition at line 119 of file gnunet-service-transport.c.
#define GOODPUT_AGING_SLOTS 4 |
Number of slots we keep of historic data for computation of goodput / message loss ratio.
Definition at line 125 of file gnunet-service-transport.c.
#define DEFAULT_WINDOW_SIZE (128 * 1024) |
How big is the flow control window size by default; limits per-neighbour RAM utilization.
Definition at line 131 of file gnunet-service-transport.c.
#define MAX_INCOMING_REQUEST 16 |
For how many incoming connections do we try to create a virtual link for (at the same time!).
This does NOT limit the number of incoming connections, just the number for which we are actively trying to find working addresses in the absence (!) of our own applications wanting the link to go up.
Definition at line 141 of file gnunet-service-transport.c.
#define MAX_DV_DISCOVERY_SELECTION 16 |
Maximum number of peers we select for forwarding DVInit messages at the same time (excluding initiator).
Definition at line 147 of file gnunet-service-transport.c.
#define RECV_WINDOW_SIZE 4 |
Window size.
How many messages to the same target do we pass to CORE without a RECV_OK in between? Small values limit throughput, large values will increase latency.
FIXME-OPTIMIZE: find out what good values are experimentally, maybe set adaptively (i.e. to observed available bandwidth).
Definition at line 157 of file gnunet-service-transport.c.
#define MIN_DV_PATH_LENGTH_FOR_INITIATOR 3 |
Minimum number of hops we should forward DV learn messages even if they are NOT useful for us in hope of looping back to the initiator?
FIXME: allow initiator some control here instead?
Definition at line 166 of file gnunet-service-transport.c.
#define MAX_DV_HOPS_ALLOWED 16 |
Maximum DV distance allowed ever.
Definition at line 171 of file gnunet-service-transport.c.
#define MAX_DV_LEARN_PENDING 64 |
Maximum number of DV learning activities we may have pending at the same time.
Definition at line 177 of file gnunet-service-transport.c.
#define MAX_DV_PATHS_TO_TARGET 3 |
Maximum number of DV paths we keep simultaneously to the same target.
Definition at line 182 of file gnunet-service-transport.c.
#define DELAY_WARN_THRESHOLD GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) |
If a queue delays the next message by more than this number of seconds we log a warning.
Note: this is for testing, the value chosen here might be too aggressively low!
Definition at line 189 of file gnunet-service-transport.c.
#define DV_FORWARD_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) |
If a DVBox could not be forwarded after this number of seconds we drop it.
Definition at line 196 of file gnunet-service-transport.c.
#define DEFAULT_ACK_WAIT_DURATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1) |
Default value for how long we wait for reliability ack.
Definition at line 202 of file gnunet-service-transport.c.
#define DV_QUALITY_RTT_THRESHOLD GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1) |
We only consider queues as "quality" connections when suppressing the generation of DV initiation messages if the latency of the queue is below this threshold.
Definition at line 210 of file gnunet-service-transport.c.
#define DV_PATH_VALIDITY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) |
How long do we consider a DV path valid if we see no further updates on it? Note: the value chosen here might be too low!
Definition at line 217 of file gnunet-service-transport.c.
#define BACKCHANNEL_INACTIVITY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) |
How long do we cache backchannel (struct Backtalker) information after a backchannel goes inactive?
Definition at line 224 of file gnunet-service-transport.c.
#define DV_PATH_DISCOVERY_FREQUENCY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4) |
How long before paths expire would we like to (re)discover DV paths? Should be below DV_PATH_VALIDITY_TIMEOUT.
Definition at line 231 of file gnunet-service-transport.c.
#define EPHEMERAL_VALIDITY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) |
How long are ephemeral keys valid?
Definition at line 237 of file gnunet-service-transport.c.
#define REASSEMBLY_EXPIRATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4) |
How long do we keep partially reassembled messages around before giving up?
Definition at line 243 of file gnunet-service-transport.c.
#define FAST_VALIDATION_CHALLENGE_FREQ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1) |
What is the fastest rate at which we send challenges if we keep learning an address (gossip, DHT, etc.)?
Definition at line 250 of file gnunet-service-transport.c.
#define MAX_VALIDATION_CHALLENGE_FREQ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_DAYS, 1) |
What is the slowest rate at which we send challenges?
Definition at line 256 of file gnunet-service-transport.c.
#define ACK_CUMMULATOR_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) |
How long until we forget about historic accumulators and thus reset the ACK counter? Should exceed the maximum time an active connection experiences without an ACK.
Definition at line 264 of file gnunet-service-transport.c.
#define DV_LEARN_BASE_FREQUENCY GNUNET_TIME_UNIT_MINUTES |
What is the non-randomized base frequency at which we would initiate DV learn messages?
Definition at line 271 of file gnunet-service-transport.c.
#define DV_LEARN_QUALITY_THRESHOLD 100 |
How many good connections (confirmed, bi-directional, not DV) do we need to have to suppress initiating DV learn messages?
Definition at line 277 of file gnunet-service-transport.c.
#define MAX_ADDRESS_VALID_UNTIL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MONTHS, 1) |
When do we forget an invalid address for sure?
Definition at line 282 of file gnunet-service-transport.c.
#define ADDRESS_VALIDATION_LIFETIME GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) |
How long do we consider an address valid if we just checked?
Definition at line 288 of file gnunet-service-transport.c.
#define MIN_DELAY_ADDRESS_VALIDATION GNUNET_TIME_UNIT_MILLISECONDS |
What is the maximum frequency at which we do address validation? A random value between 0 and this value is added when scheduling the validation_task (both to ensure we do not validate too often, and to randomize a bit).
Definition at line 297 of file gnunet-service-transport.c.
#define VALIDATION_RTT_BUFFER_FACTOR 3 |
How many network RTTs before an address validation expires should we begin trying to revalidate? (Note that the RTT used here is the one that we experienced during the last validation, not necessarily the latest RTT observed).
Definition at line 305 of file gnunet-service-transport.c.
#define COMMUNICATOR_TOTAL_QUEUE_LIMIT 512 |
How many messages can we have pending for a given communicator process before we start to throttle that communicator?
Used if a communicator might be CPU-bound and cannot handle the traffic.
Definition at line 313 of file gnunet-service-transport.c.
#define QUEUE_LENGTH_LIMIT 32 |
How many messages can we have pending for a given queue (queue to a particular peer via a communicator) process before we start to throttle that queue?
Definition at line 320 of file gnunet-service-transport.c.
#define QUEUE_ENTRY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) |
Definition at line 325 of file gnunet-service-transport.c.
#define RTT_DIFF GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1) |
Difference of the average RTT for the DistanceVector calculate by us and the target we are willing to accept for starting the burst.
Definition at line 332 of file gnunet-service-transport.c.
typedef void(* DVMessageHandler) (void *cls, struct Neighbour *next_hop, const struct GNUNET_MessageHeader *hdr, enum RouteMessageOptions options) |
Function to call to further operate on the now DV encapsulated message hdr, forwarding it via next_hop under respect of options.
cls | closure |
next_hop | next hop of the DV path |
hdr | encapsulated message, technically a struct TransportDFBoxMessage |
options | options of the original message |
Definition at line 5134 of file gnunet-service-transport.c.
enum ClientType |
What type of client is the struct TransportClient
about?
Definition at line 1022 of file gnunet-service-transport.c.
enum RouteMessageOptions |
Which transmission options are allowable for transmission? Interpreted bit-wise!
Definition at line 1055 of file gnunet-service-transport.c.
enum PendingMessageType |
Types of different pending messages.
Enumerator | |
---|---|
PMT_CORE | Ordinary message received from the CORE service. |
PMT_FRAGMENT_BOX | Fragment box. |
PMT_RELIABILITY_BOX | Reliability box. |
PMT_DV_BOX | Pending message created during forward_dv_box(). |
Definition at line 2205 of file gnunet-service-transport.c.
|
static |
Get an offset into the transmission history buffer for struct PerformanceData
.
Note that the caller must perform the required modulo GOODPUT_AGING_SLOTS operation before indexing into the array!
An 'age' lasts 15 minute slots.
Definition at line 3081 of file gnunet-service-transport.c.
References GNUNET_TIME_Absolute::abs_value_us, GNUNET_TIME_absolute_get(), and GNUNET_TIME_UNIT_MINUTES.
Referenced by update_performance_data().
|
static |
Release ir data structure.
ir | data structure to release |
Definition at line 3096 of file gnunet-service-transport.c.
References GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_PEERSTORE_monitor_stop(), ir_head, ir_tail, ir_total, and IncomingRequest::nc.
Referenced by do_shutdown(), and handle_validation_challenge().
|
static |
Release pa data structure.
pa | data structure to release |
Definition at line 3114 of file gnunet-service-transport.c.
References PendingAcknowledgement::ack_uuid, PendingAcknowledgement::dvh, GNUNET_assert, GNUNET_CONTAINER_MDLL_remove, GNUNET_CONTAINER_multiuuidmap_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_uuid2s(), GNUNET_YES, DistanceVectorHop::pa_head, DistanceVectorHop::pa_tail, pending_acks, PendingAcknowledgement::pm, pm, q, queue(), PendingAcknowledgement::queue, and AcknowledgementUUIDP::value.
Referenced by free_pending_ack_cb(), and handle_acknowledged().
|
static |
Free fragment tree below root, excluding root itself.
FIXME: this does NOT seem to have the intended semantics based on how this is called. Seems we generally DO expect root to be free'ed itself as well!
root | root of the tree to free |
Definition at line 3165 of file gnunet-service-transport.c.
References free_fragment_tree(), GNUNET_assert, GNUNET_CONTAINER_MDLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, PendingMessage::head_frag, PendingMessage::pa_head, PendingMessage::pa_tail, PendingAcknowledgement::pm, QueueEntry::pm, pm, PendingMessage::qe, and PendingMessage::tail_frag.
Referenced by free_fragment_tree(), and free_pending_message().
|
static |
Release memory associated with pm and remove pm from associated data structures.
pm must be a top-level pending message and not a fragment in the tree. The entire tree is freed (if applicable).
pm | the pending message to free |
Definition at line 3201 of file gnunet-service-transport.c.
References PendingMessage::frag_count, PendingMessage::frag_parent, free_fragment_tree(), GNUNET_assert, GNUNET_CONTAINER_MDLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, PendingAcknowledgement::next_pa, VirtualLink::pending_msg_head, VirtualLink::pending_msg_tail, PendingAcknowledgement::pm, pm, PendingMessage::pmt, PMT_DV_BOX, PendingAcknowledgement::prev_pa, qe, and tc.
Referenced by client_send_response(), completed_pending_message(), free_virtual_link(), and transmit_on_queue().
|
static |
Free rc.
rc | data structure to free |
Definition at line 3284 of file gnunet-service-transport.c.
References GNUNET_assert, GNUNET_CONTAINER_heap_remove_node(), GNUNET_CONTAINER_multihashmap32_remove(), GNUNET_free, GNUNET_OK, ReassemblyContext::hn, ReassemblyContext::msg_uuid, VirtualLink::reassembly_map, MessageUUIDP::uuid, and ReassemblyContext::virtual_link.
Referenced by free_reassembly_cb(), handle_fragment_box(), and reassembly_cleanup_task().
|
static |
Task run to clean up reassembly context of a neighbour that have expired.
cls | a struct Neighbour |
Definition at line 3303 of file gnunet-service-transport.c.
References free_reassembly_context(), GNUNET_assert, GNUNET_CONTAINER_heap_peek(), GNUNET_SCHEDULER_add_at(), GNUNET_TIME_absolute_get_remaining(), reassembly_cleanup_task(), VirtualLink::reassembly_heap, ReassemblyContext::reassembly_timeout, VirtualLink::reassembly_timeout_task, and GNUNET_TIME_Relative::rel_value_us.
Referenced by handle_fragment_box(), and reassembly_cleanup_task().
|
static |
function called to free_reassembly_context().
cls | NULL |
key | unused |
value | a struct ReassemblyContext to free |
Definition at line 3336 of file gnunet-service-transport.c.
References free_reassembly_context(), GNUNET_OK, key, and value.
Referenced by free_virtual_link().
|
static |
Free virtual link.
vl | link data to free |
Definition at line 3353 of file gnunet-service-transport.c.
References VirtualLink::csc_head, VirtualLink::csc_tail, VirtualLink::dv, VirtualLink::fc_retransmit_task, free_pending_message(), free_reassembly_cb(), GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_heap_destroy(), GNUNET_CONTAINER_multihashmap32_destroy(), GNUNET_CONTAINER_multihashmap32_iterate(), GNUNET_CONTAINER_multipeermap_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_SCHEDULER_cancel(), GNUNET_YES, links, VirtualLink::n, VirtualLink::pending_msg_head, pm, VirtualLink::reassembly_heap, VirtualLink::reassembly_map, VirtualLink::reassembly_timeout_task, VirtualLink::target, VirtualLink::visibility_task, and CoreSentContext::vl.
Referenced by check_link_down(), free_dv_route(), and free_neighbour().
|
static |
Free validation state.
vs | validation state to free |
Definition at line 3409 of file gnunet-service-transport.c.
References GNUNET_assert, GNUNET_CONTAINER_heap_remove_node(), GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_CONTAINER_multihashmap_size(), GNUNET_CONTAINER_multipeermap_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_h2s(), GNUNET_log, GNUNET_PEERSTORE_store_cancel(), GNUNET_SCHEDULER_cancel(), GNUNET_YES, ValidationState::pid, revalidation_map, and validation_map.
Referenced by free_validation_state_cb(), and validation_start_cb().
|
static |
Lookup neighbour for peer pid.
pid | neighbour to look for |
Definition at line 3451 of file gnunet-service-transport.c.
References GNUNET_CONTAINER_multipeermap_get(), neighbours, and pid.
Referenced by find_queue(), forward_dv_learn(), handle_add_queue_message(), handle_communicator_backchannel(), handle_dv_box(), handle_dv_learn(), handle_validation_challenge(), learn_dv_path(), route_control_message_without_fc(), and transmit_cummulative_ack_cb().
|
static |
Lookup virtual link for peer pid.
pid | virtual link to look for |
Definition at line 3464 of file gnunet-service-transport.c.
References GNUNET_CONTAINER_multipeermap_get(), links, and pid.
Referenced by activate_core_visible_dv_path(), check_vl_transmission(), forward_dv_learn(), free_queue(), handle_client_recv_ok(), handle_client_send(), handle_communicator_backchannel(), handle_flow_control(), handle_fragment_box(), handle_raw_message(), handle_validation_challenge(), handle_validation_response(), and transmit_cummulative_ack_cb().
|
static |
Free a dvh.
Callers MAY want to check if this was the last path to the target
, and if so call free_dv_route to also free the associated DV entry in dv_routes (if not, the associated scheduler job should eventually take care of it).
dvh | hop to free |
Definition at line 3513 of file gnunet-service-transport.c.
References DistanceVectorHop::dv, DistanceVector::dv_head, Neighbour::dv_head, DistanceVector::dv_tail, Neighbour::dv_tail, PendingAcknowledgement::dvh, GNUNET_CONTAINER_MDLL_remove, GNUNET_free, DistanceVectorHop::next_hop, DistanceVectorHop::pa_head, and DistanceVectorHop::pa_tail.
Referenced by free_dv_route(), free_neighbour(), and path_cleanup_cb().
|
static |
Task run to check whether the hops of the cls still are validated, or if we need to core about disconnection.
cls | a struct VirtualLink |
Definition at line 3955 of file gnunet-service-transport.c.
References check_link_down(), cores_send_disconnect_info(), VirtualLink::dv, DistanceVector::dv_head, free_virtual_link(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_SCHEDULER_add_at(), GNUNET_TIME_absolute_get_remaining(), GNUNET_TIME_absolute_max(), GNUNET_TIME_UNIT_ZERO_ABS, VirtualLink::n, DistanceVectorHop::next_dv, q, Neighbour::queue_head, VirtualLink::target, VirtualLink::visibility_task, DistanceVector::vl, and Neighbour::vl.
Referenced by activate_core_visible_dv_path(), check_link_down(), free_dv_route(), free_neighbour(), free_queue(), and handle_validation_response().
|
static |
Send message to CORE clients that we lost a connection.
pid | peer the connection was for |
Definition at line 3546 of file gnunet-service-transport.c.
References clients_head, CT_CORE, dim, env, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_TRANSPORT_DISCONNECT, GNUNET_MQ_msg, GNUNET_MQ_send(), pid, and tc.
Referenced by check_link_down(), free_dv_route(), and free_neighbour().
|
static |
Free entry in dv_routes.
First frees all hops to the target, and if there are no entries left, frees dv as well.
dv | route to free |
Definition at line 3572 of file gnunet-service-transport.c.
References check_link_down(), cores_send_disconnect_info(), VirtualLink::dv, DistanceVectorHop::dv, DistanceVector::dv_head, dv_routes, free_distance_vector_hop(), free_virtual_link(), GNUNET_assert, GNUNET_CONTAINER_multipeermap_remove(), GNUNET_free, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_cancel(), GNUNET_YES, DistanceVector::km, VirtualLink::n, DistanceVector::target, DistanceVector::timeout_task, VirtualLink::visibility_task, and DistanceVector::vl.
Referenced by free_dv_routes_cb(), free_neighbour(), and path_cleanup_cb().
|
static |
Notify monitor tc about an event.
That tc cares about the event has already been checked.
Send tc information in me about a peer's status with respect to some address to all monitors that care.
tc | monitor to inform |
peer | peer the information is about |
address | address the information is about |
nt | network type associated with address |
me | detailed information to transmit |
Definition at line 3627 of file gnunet-service-transport.c.
References address, GNUNET_TRANSPORT_MonitorData::cs, env, GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_DATA, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_TIME_absolute_hton(), GNUNET_TIME_relative_hton(), GNUNET_TRANSPORT_MonitorData::last_validation, me, GNUNET_TRANSPORT_MonitorData::next_validation, nt, GNUNET_TRANSPORT_MonitorData::nt, GNUNET_TRANSPORT_MonitorData::num_bytes_pending, GNUNET_TRANSPORT_MonitorData::num_msg_pending, GNUNET_TRANSPORT_MonitorData::peer, GNUNET_TRANSPORT_MonitorData::rtt, tc, and GNUNET_TRANSPORT_MonitorData::valid_until.
Referenced by notify_client_queues(), and notify_monitors().
|
static |
Send information in me about a peer's status with respect to some address to all monitors that care.
peer | peer the information is about |
address | address the information is about |
nt | network type associated with address |
me | detailed information to transmit |
Definition at line 3664 of file gnunet-service-transport.c.
References address, clients_head, CT_MONITOR, GNUNET_is_zero, GNUNET_memcmp, GNUNET_NO, me, notify_monitor(), nt, GNUNET_TRANSPORT_MonitorData::peer, and tc.
Referenced by free_queue(), and handle_add_queue_message().
|
static |
Called whenever a client connects.
Allocates our data structures associated with that client.
cls | closure, NULL |
client | identification of the client |
mq | message queue for the client |
struct TransportClient
Definition at line 3693 of file gnunet-service-transport.c.
References TransportClient::client, clients_head, clients_tail, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_new, mq, and tc.
|
static |
Definition at line 3713 of file gnunet-service-transport.c.
References GNUNET_free, GNUNET_OK, and value.
Referenced by free_neighbour().
|
static |
Release memory used by neighbour.
neighbour | neighbour entry to free |
drop_link | flag to decide whether to drop its virtual link |
Definition at line 3733 of file gnunet-service-transport.c.
References check_link_down(), cores_send_disconnect_info(), VirtualLink::dv, DistanceVectorHop::dv, DistanceVector::dv_head, Neighbour::dv_head, free_distance_vector_hop(), free_dv_route(), free_virtual_link(), Neighbour::get, GNUNET_assert, GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_CONTAINER_multipeermap_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_PEERSTORE_iteration_stop(), GNUNET_PEERSTORE_store_cancel(), GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_cancel(), GNUNET_YES, VirtualLink::n, Neighbour::natted_addresses, neighbours, Neighbour::pid, Neighbour::queue_head, remove_global_addresses(), Neighbour::sc, VirtualLink::target, VirtualLink::visibility_task, DistanceVector::vl, and Neighbour::vl.
Referenced by free_neighbour_cb(), and free_queue().
|
static |
Send message to CORE clients that we lost a connection.
tc | client to inform (must be CORE client) |
pid | peer the connection is for |
Definition at line 3797 of file gnunet-service-transport.c.
References CT_CORE, env, GNUNET_assert, GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT, GNUNET_MQ_msg, GNUNET_MQ_send(), ConnectInfoMessage::id, pid, and tc.
Referenced by cores_send_connect_info(), and notify_client_connect_info().
|
static |
Send message to CORE clients that we gained a connection.
pid | peer the queue was for |
Definition at line 3816 of file gnunet-service-transport.c.
References clients_head, core_send_connect_info(), CT_CORE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, pid, and tc.
Referenced by activate_core_visible_dv_path(), and handle_validation_response().
|
static |
We believe we are ready to transmit a message on a queue.
We believe we are ready to transmit a struct PendingMessage
on a queue, the big question is which one! We need to see if there is one pending that is allowed by flow control and congestion control and (ideally) matches our queue's performance profile.
Gives the message to the communicator for transmission (updating the tracker, and re-scheduling itself if applicable).
cls | the struct Queue to process transmissions for |
If such a message is found, we give the message to the communicator for transmission (updating the tracker, and re-scheduling ourselves if applicable).
If no such message is found, the queue's idle
field must be set to GNUNET_YES.
cls | the struct Queue to process transmissions for |
Definition at line 10993 of file gnunet-service-transport.c.
References PendingMessage::bytes_msg, completed_pending_message(), DEFAULT_ACK_WAIT_DURATION, Neighbour::dv_head, encapsulate_for_dv(), extract_box_cb(), PendingMessage::frag_count, PendingMessage::frag_off, PendingMessage::frag_parent, fragment_message(), free_pending_message(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_SCHEDULER_PRIORITY_DEFAULT, GNUNET_STRINGS_absolute_time_to_string(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_relative_multiply(), GNUNET_TIME_relative_to_absolute(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_TIME_UNIT_ZERO, GNUNET_TRANSPORT_CC_RELIABLE, GNUNET_YES, consensus-simulation::int, DistanceVectorHop::next_neighbour, Neighbour::pid, pm, PendingMessage::pmt, PMT_CORE, PMT_DV_BOX, PMT_FRAGMENT_BOX, queue(), queue_send_msg(), reliability_box_message(), RMO_NONE, sc, schedule_transmit_on_queue(), select_best_pending_from_link(), update_pm_next_attempt(), and Neighbour::vl.
Referenced by schedule_transmit_on_queue().
|
static |
Check if the communicator has another queue with higher prio ready for sending.
Definition at line 3845 of file gnunet-service-transport.c.
References GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_YES, Queue::next_client, queue(), queue_head, and QUEUE_LENGTH_LIMIT.
Referenced by schedule_transmit_on_queue().
|
static |
Called whenever something changed that might effect when we try to do the next transmission on queue using transmit_on_queue().
queue | the queue to do scheduling for |
p | task priority to use, if queue is scheduled |
Definition at line 3878 of file gnunet-service-transport.c.
References GNUNET_TIME_Absolute::abs_value_us, check_for_queue_with_higher_prio(), COMMUNICATOR_TOTAL_QUEUE_LIMIT, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_SCHEDULER_add_delayed_with_priority(), GNUNET_SCHEDULER_cancel(), GNUNET_STATISTICS_update(), GNUNET_TIME_absolute_get(), GST_stats, p, queue(), queue_head, QUEUE_LENGTH_LIMIT, and transmit_on_queue().
Referenced by check_vl_transmission(), free_queue(), free_queue_entry(), handle_update_queue_message(), and transmit_on_queue().
|
static |
Free queue.
queue | the queue to free |
Definition at line 4006 of file gnunet-service-transport.c.
References check_link_down(), COMMUNICATOR_TOTAL_QUEUE_LIMIT, free_neighbour(), GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_MDLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_NO, GNUNET_PEERSTORE_monitor_stop(), GNUNET_SCHEDULER_cancel(), GNUNET_SCHEDULER_PRIORITY_DEFAULT, GNUNET_STATISTICS_update(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_TIME_UNIT_ZERO, GNUNET_TRANSPORT_CS_DOWN, GST_stats, lookup_virtual_link(), me, VirtualLink::n, notify_monitors(), Neighbour::pid, qe, queue(), PendingAcknowledgement::queue, Neighbour::queue_head, Neighbour::queue_tail, schedule_transmit_on_queue(), tc, and VirtualLink::visibility_task.
Referenced by client_disconnect_cb(), and handle_del_queue_message().
|
static |
Free ale.
ale | address list entry to free |
Definition at line 4098 of file gnunet-service-transport.c.
References GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_PEERSTORE_store_cancel(), GNUNET_SCHEDULER_cancel(), AddressListEntry::sc, AddressListEntry::signed_address, AddressListEntry::st, tc, and AddressListEntry::tc.
Referenced by client_disconnect_cb(), and handle_del_address().
|
static |
Stop the peer request in value.
cls | a struct TransportClient that no longer makes the request |
pid | the peer's identity |
value | a struct PeerRequest |
Definition at line 4132 of file gnunet-service-transport.c.
References GNUNET_assert, GNUNET_CONTAINER_multipeermap_remove(), GNUNET_free, GNUNET_OK, GNUNET_PEERSTORE_monitor_stop(), GNUNET_YES, pid, PeerRequest::pr, tc, and value.
Referenced by client_disconnect_cb(), and handle_suggest_cancel().
|
static |
Function called when the service shuts down.
Unloads our plugins and cancels pending validations.
cls | closure, unused |
Definition at line 12878 of file gnunet-service-transport.c.
References ack_cummulators, backtalkers, dv_routes, dvlearn_map, dvlearn_task, free_ack_cummulator_cb(), free_backtalker_cb(), free_dv_routes_cb(), free_incoming_request(), free_neighbour_cb(), free_pending_ack_cb(), free_validation_state_cb(), GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_heap_destroy(), GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_CONTAINER_multipeermap_size(), GNUNET_CONTAINER_multishortmap_destroy(), GNUNET_CONTAINER_multiuuidmap_destroy(), GNUNET_CONTAINER_multiuuidmap_iterate(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_HELLO_builder_free(), GNUNET_log, GNUNET_NAT_unregister(), GNUNET_NO, GNUNET_PEERSTORE_disconnect(), GNUNET_SCHEDULER_cancel(), GNUNET_SCHEDULER_shutdown(), GNUNET_STATISTICS_destroy(), GST_my_hello, GST_my_private_key, GST_stats, ir_head, ir_total, links, lle_head, lle_tail, neighbours, nh, peerstore, pending_acks, revalidation_map, validation_heap, validation_map, and validation_task.
Referenced by client_disconnect_cb(), and shutdown_task().
|
static |
Called whenever a client is disconnected.
Frees our resources associated with that client.
cls | closure, NULL |
client | identification of the client |
app_ctx | our struct TransportClient |
Definition at line 4165 of file gnunet-service-transport.c.
References PendingMessage::client, TransportClient::client, clients_head, clients_tail, CT_APPLICATION, CT_COMMUNICATOR, CT_CORE, CT_MONITOR, CT_NONE, do_shutdown(), free_address_list_entry(), free_queue(), GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_MDLL_remove, GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_SCHEDULER_cancel(), GNUNET_YES, in_shutdown, pm, q, stop_peer_request(), and tc.
|
static |
Iterator telling new CORE client about all existing connections to peers.
cls | the new struct TransportClient |
pid | a connected peer |
value | the struct Neighbour with more information |
Definition at line 4257 of file gnunet-service-transport.c.
References VirtualLink::confirmed, core_send_connect_info(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_OK, pid, tc, and value.
Referenced by handle_client_start().
|
static |
Send ACK to communicator (if requested) and free cmc.
cmc | context for which we are done handling the message |
Definition at line 4526 of file gnunet-service-transport.c.
References TransportClient::client, env, GNUNET_TRANSPORT_IncomingMessage::fc_id, GNUNET_TRANSPORT_IncomingMessageAck::fc_id, GNUNET_TRANSPORT_IncomingMessage::fc_on, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG_ACK, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_SERVICE_client_continue(), GNUNET_YES, CommunicatorMessageContext::im, TransportClient::mq, GNUNET_TRANSPORT_IncomingMessage::neighbour_sender, GNUNET_TRANSPORT_IncomingMessageAck::reserved, GNUNET_TRANSPORT_IncomingMessageAck::sender, and CommunicatorMessageContext::tc.
Referenced by finish_cmc_handling(), finish_handling_raw_message(), handle_client_recv_ok(), handle_raw_message(), and resume_communicators().
|
static |
Definition at line 4286 of file gnunet-service-transport.c.
References VirtualLink::cmc_head, VirtualLink::cmc_tail, CommunicatorMessageContext::continue_send, finish_cmc_handling_with_continue(), GNUNET_CONTAINER_DLL_remove, GNUNET_NO, GNUNET_OK, GNUNET_YES, and value.
Referenced by handle_client_start().
|
static |
Initialize a "CORE" client.
We got a start message from this client, so add it to the list of clients for broadcasting of inbound messages.
cls | the client |
start | the start message that was sent |
Definition at line 4313 of file gnunet-service-transport.c.
References CT_CORE, CT_NONE, GNUNET_break, GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_memcmp, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GST_my_identity, links, notify_client_connect_info(), options, resume_communicators(), start, and tc.
|
static |
Client asked for transmission to a peer.
Process the request.
cls | the client |
obm | the send message that was sent |
Definition at line 4354 of file gnunet-service-transport.c.
References CT_CORE, GNUNET_break, GNUNET_OK, GNUNET_SYSERR, OutboundMessage::header, GNUNET_MessageHeader::size, size, and tc.
|
static |
Send a response to the pm that we have processed a "send" request.
Sends a confirmation to the "core" client responsible for the original request and free's pm.
pm | handle to the original pending message |
Definition at line 4389 of file gnunet-service-transport.c.
References env, free_pending_message(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK, GNUNET_MQ_msg, GNUNET_MQ_send(), SendOkMessage::peer, pm, VirtualLink::target, and tc.
Referenced by completed_pending_message(), and reliability_box_message().
|
static |
Pick hops_array_length random DV paths satisfying options.
dv | data structure to pick paths from | |
options | constraints to satisfy | |
[out] | hops_array | set to the result |
hops_array_length | length of the hops_array |
Definition at line 4423 of file gnunet-service-transport.c.
References warningfilter::choices, delta, DistanceVector::dv_head, GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_u64(), GNUNET_NO, GNUNET_TIME_absolute_get_remaining(), GNUNET_YES, MAX_DV_HOPS_ALLOWED, DistanceVectorHop::next_dv, options, GNUNET_TIME_Relative::rel_value_us, and RMO_UNCONFIRMED_ALLOWED.
Referenced by route_control_message_without_fc().
|
static |
Communicator started.
Test message is well-formed.
cls | the client |
cam | the send message that was sent |
Definition at line 4499 of file gnunet-service-transport.c.
References CT_COMMUNICATOR, CT_NONE, GNUNET_break, GNUNET_MQ_check_zero_termination, GNUNET_OK, GNUNET_SYSERR, GNUNET_TRANSPORT_CommunicatorAvailableMessage::header, GNUNET_MessageHeader::size, size, and tc.
|
static |
Definition at line 4556 of file gnunet-service-transport.c.
References finish_cmc_handling_with_continue(), and GNUNET_YES.
Referenced by backtalker_monotime_cb(), free_backtalker(), handle_backchannel_encapsulation(), handle_dv_box(), handle_dv_learn(), handle_flow_control(), handle_fragment_box(), handle_raw_message(), handle_reliability_ack(), handle_validation_challenge(), and handle_validation_response().
|
static |
Client confirms that it is done handling message(s) to a particular peer.
We may now provide more messages to CORE for this peer.
Notifies the respective queues that more messages can now be received.
cls | the client |
rom | the message that was sent |
Definition at line 4572 of file gnunet-service-transport.c.
References VirtualLink::cmc_head, VirtualLink::cmc_tail, VirtualLink::confirmed, CommunicatorMessageContext::continue_send, VirtualLink::core_recv_window, CT_CORE, delta, finish_cmc_handling_with_continue(), GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_STATISTICS_update(), GNUNET_YES, GST_stats, RecvOkMessage::increase_window_delta, lookup_virtual_link(), RecvOkMessage::peer, and tc.
|
static |
Communicator started.
Process the request.
cls | the client |
cam | the send message that was sent |
Definition at line 4620 of file gnunet-service-transport.c.
References GNUNET_TRANSPORT_CommunicatorAvailableMessage::can_burst, GNUNET_TRANSPORT_CommunicatorAvailableMessage::cc, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_SERVICE_client_continue(), GNUNET_strdup, GST_my_identity, GNUNET_TRANSPORT_CommunicatorAvailableMessage::header, GNUNET_MessageHeader::size, size, and tc.
|
static |
Communicator requests backchannel transmission.
Check the request.
cls | the client |
cb | the send message that was sent |
Definition at line 4656 of file gnunet-service-transport.c.
References GNUNET_assert, GNUNET_break, GNUNET_OK, GNUNET_SYSERR, GNUNET_TRANSPORT_CommunicatorBackchannel::header, is, and GNUNET_MessageHeader::size.
|
static |
Sign ephemeral keys in our dv are current.
[in,out] | dv | virtual link to update ephemeral for |
Definition at line 4693 of file gnunet-service-transport.c.
References EphemeralConfirmationPS::ephemeral_key, DistanceVector::ephemeral_key, EPHEMERAL_VALIDITY, DistanceVector::ephemeral_validity, GNUNET_CRYPTO_eddsa_sign, GNUNET_SIGNATURE_PURPOSE_TRANSPORT_EPHEMERAL, GNUNET_TIME_absolute_add(), GNUNET_TIME_absolute_get_monotonic(), GNUNET_TIME_absolute_hton(), GST_cfg, GST_my_private_key, DistanceVector::monotime, GNUNET_CRYPTO_EccSignaturePurpose::purpose, EphemeralConfirmationPS::purpose, EphemeralConfirmationPS::sender_monotonic_time, DistanceVector::sender_sig, GNUNET_CRYPTO_EccSignaturePurpose::size, EphemeralConfirmationPS::target, and DistanceVector::target.
Referenced by encapsulate_for_dv().
|
static |
Definition at line 11282 of file gnunet-service-transport.c.
References check_vl_transmission(), COMMUNICATOR_TOTAL_QUEUE_LIMIT, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_SCHEDULER_PRIORITY_DEFAULT, GNUNET_STATISTICS_update(), GNUNET_TIME_UNIT_ZERO, GST_stats, VirtualLink::pending_msg_head, pm, qe, queue(), QUEUE_LENGTH_LIMIT, schedule_transmit_on_queue(), and tc.
Referenced by free_timedout_queue_entry(), and handle_send_message_ack().
|
static |
Definition at line 4717 of file gnunet-service-transport.c.
References QueueEntry::creation_timestamp, free_queue_entry(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_get_difference(), GNUNET_TIME_relative2s(), GNUNET_TIME_relative_cmp, QueueEntry::mid, QueueEntry::next, queue(), QUEUE_ENTRY_TIMEOUT, and tc.
Referenced by queue_send_msg().
|
static |
Send the message payload on queue.
queue | the queue to use for transmission |
pm | pending message to update once transmission is done, may be NULL! |
payload | the payload to send (encapsulated in a GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG). |
payload_size | number of bytes in payload |
Definition at line 4768 of file gnunet-service-transport.c.