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 (GNUNET_OS_project_data_gnunet(), "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 5131 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 3952 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, 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 3624 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 3661 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 3690 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 3710 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 3730 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 3794 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 3813 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 10990 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 3842 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 3875 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 4003 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 4095 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 4129 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 12875 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 4162 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 4254 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 4523 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 4283 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 4310 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 4351 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 4386 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 4420 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 4496 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 4553 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 4569 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 4617 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 4653 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 4690 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 11279 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 4714 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 4765 of file gnunet-service-transport.c.
References COMMUNICATOR_TOTAL_QUEUE_LIMIT, CT_COMMUNICATOR, env, free_timedout_queue_entry(), GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_htonll(), GNUNET_i2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_new, GNUNET_NO, GNUNET_ntohll(), GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_absolute_get(), GNUNET_TIME_UNIT_SECONDS, GNUNET_TRANSPORT_SendMessageTo::header, GNUNET_TRANSPORT_SendMessageTo::mid, PendingAcknowledgement::next_pa, PendingAcknowledgement::num_send, payload, Neighbour::pid, PendingAcknowledgement::pm, pm, qe, GNUNET_TRANSPORT_SendMessageTo::qid, queue(), QUEUE_LENGTH_LIMIT, GNUNET_TRANSPORT_SendMessageTo::receiver, GNUNET_MessageHeader::size, tc, and type.
Referenced by route_via_neighbour(), start_dv_learn(), transmit_on_queue(), and validation_transmit_on_queue().
|
static |
Pick a queue of n under constraints options and schedule transmission of hdr.
n | neighbour to send to |
hdr | message to send as payload |
options | whether queues must be confirmed or not, and whether we may pick multiple (2) queues |
Definition at line 4902 of file gnunet-service-transport.c.
References GNUNET_TIME_Absolute::abs_value_us, GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_u32(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_INFO, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_TIME_absolute_get(), GNUNET_TIME_relative_min(), GNUNET_TIME_UNIT_FOREVER_REL, GST_stats, options, queue_send_msg(), RMO_REDUNDANT, RMO_UNCONFIRMED_ALLOWED, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by forward_dv_box(), forward_dv_learn(), handle_communicator_backchannel(), handle_validation_challenge(), route_control_message_without_fc(), send_dv_to_neighbour(), and transmit_cummulative_ack_cb().
|
static |
Given the key material in km and the initialization vector iv, setup the key material for the backchannel in key.
km | raw master secret | |
iv | initialization vector | |
[out] | key | symmetric cipher and HMAC state to generate |
Definition at line 5014 of file gnunet-service-transport.c.
References GNUNET_assert, GNUNET_CRYPTO_hkdf_expand(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_sh2s(), GNUNET_YES, and key.
Referenced by encapsulate_for_dv(), and handle_dv_box().
|
static |
Do HMAC calculation for backchannel messages over data using key material from key.
key | key material (from DH) | |
[out] | hmac | set to the HMAC |
data | data to perform HMAC calculation over | |
data_size | number of bytes in data |
Definition at line 5059 of file gnunet-service-transport.c.
References data, data_size, GNUNET_CRYPTO_hmac(), and key.
Referenced by encapsulate_for_dv(), and handle_dv_box().
|
static |
Perform backchannel encryption using symmetric secret in key to encrypt data from in to dst.
[in,out] | key | key material to use |
dst | where to write the result | |
in | input data to encrypt (plaintext) | |
in_size | number of bytes of input in in and available at dst |
Definition at line 5078 of file gnunet-service-transport.c.
References GNUNET_assert, and key.
Referenced by encapsulate_for_dv().
|
static |
Perform backchannel encryption using symmetric secret in key to encrypt data from in to dst.
[in,out] | key | key material to use |
ciph | cipher text to decrypt | |
[out] | out | output data to generate (plaintext) |
out_size | number of bytes of input in ciph and available in out |
Definition at line 5096 of file gnunet-service-transport.c.
References GNUNET_OK, GNUNET_SYSERR, and key.
Referenced by handle_dv_box().
|
static |
Clean up key material in key.
key | key material to clean up (memory must not be free'd!) |
Definition at line 5114 of file gnunet-service-transport.c.
References GNUNET_CRYPTO_zero_keys(), and key.
Referenced by encapsulate_for_dv(), and handle_dv_box().
|
static |
Pick a path of dv under constraints options and schedule transmission of hdr.
target | neighbour to ultimately send to |
num_dvhs | length of the dvhs array |
dvhs | array of hops to send the message to |
hdr | message to send as payload |
use | function to call with the encapsulated message |
use_cls | closure for use |
options | whether path must be confirmed or not, to be passed to use |
without_fc | shall this TransportDVBoxMessage be forwarded without flow control. |
Definition at line 5151 of file gnunet-service-transport.c.
References PerformanceData::aged_rtt, DistanceVectorHop::distance, dv_encrypt(), dv_hmac(), dv_key_clean(), dv_setup_key_state_from_km(), enc, TransportDVBoxMessage::ephemeral_key, GNUNET_ALIGN, GNUNET_asprintf(), GNUNET_CRYPTO_eddsa_kem_encaps(), GNUNET_CRYPTO_QUALITY_NONCE, GNUNET_CRYPTO_random_block(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_EXTRA_LOGGING, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_TRANSPORT_DV_BOX, GNUNET_new, GNUNET_strdup, GNUNET_TIME_absolute_get_remaining(), GNUNET_TIME_absolute_hton(), GNUNET_TIME_relative_min(), GNUNET_TIME_UNIT_FOREVER_REL, GST_my_identity, TransportDVBoxMessage::header, TransportDVBoxMessage::hmac, TransportDVBoxMessage::iv, key, TransportDVBoxPayloadP::monotonic_time, DistanceVectorHop::next_hop, TransportDVBoxMessage::num_hops, options, TransportDVBoxMessage::orig_size, DistanceVectorHop::path, DistanceVectorHop::pd, GNUNET_TIME_Relative::rel_value_us, TransportDVBoxPayloadP::sender, TransportDVBoxPayloadP::sender_sig, sign_ephemeral(), GNUNET_MessageHeader::size, TransportDVBoxMessage::total_hops, GNUNET_MessageHeader::type, and TransportDVBoxMessage::without_fc.
Referenced by route_control_message_without_fc(), and transmit_on_queue().
|
static |
Wrapper around route_via_neighbour() that matches the DVMessageHandler structure.
cls | unused |
next_hop | where to send next |
hdr | header of the message to send |
options | message options for queue selection |
Definition at line 5269 of file gnunet-service-transport.c.
References RMO_UNCONFIRMED_ALLOWED, and route_via_neighbour().
Referenced by route_control_message_without_fc().
|
static |
We need to transmit hdr to target.
If necessary, this may involve DV routing. This function routes without applying flow control or congestion control and should only be used for control traffic.
target | peer to receive hdr |
hdr | header of the message to route and GNUNET_free() |
options | which transmission channels are allowed |
Definition at line 5291 of file gnunet-service-transport.c.
References DistanceVectorHop::dv, dv_routes, encapsulate_for_dv(), GNUNET_assert, GNUNET_CONTAINER_multipeermap_get(), GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_u32(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_INFO, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_TIME_relative_min(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, GST_stats, lookup_neighbour(), options, pick_random_dv_hops(), res, RMO_DV_ALLOWED, RMO_REDUNDANT, RMO_UNCONFIRMED_ALLOWED, route_via_neighbour(), send_dv_to_neighbour(), and GNUNET_MessageHeader::type.
Referenced by consider_sending_fc(), forward_dv_learn(), handle_communicator_backchannel(), handle_validation_challenge(), and transmit_cummulative_ack_cb().
|
static |
Something changed on the virtual link with respect to flow control.
Consider retransmitting the FC window size.
cls | a struct VirtualLink to work with |
Definition at line 5456 of file gnunet-service-transport.c.
References add_global_addresses(), calculate_rtt(), ctx, duration, VirtualLink::dv, VirtualLink::fc_retransmit_count, VirtualLink::fc_retransmit_task, VirtualLink::fc_seq_gen, GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_htonll(), GNUNET_i2s(), GNUNET_log, GNUNET_malloc, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_TRANSPORT_FLOW_CONTROL, GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_cancel(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_absolute_get_monotonic(), GNUNET_TIME_absolute_hton(), GNUNET_TIME_relative_hton(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_TIME_UNIT_MINUTES, GNUNET_TIME_UNIT_SECONDS, GNUNET_TIME_UNIT_ZERO, GNUNET_YES, GST_cfg, TransportFlowControlMessage::header, TransportFlowControlMessage::inbound_window_size, VirtualLink::incoming_fc_window_size, VirtualLink::incoming_fc_window_size_loss, VirtualLink::incoming_fc_window_size_used, VirtualLink::last_fc_rtt, VirtualLink::last_fc_transmission, MAX_FC_RETRANSMIT_COUNT, VirtualLink::n, TransportFlowControlMessage::number_of_addresses, Neighbour::number_of_addresses, VirtualLink::outbound_fc_window_size, VirtualLink::outbound_fc_window_size_used, TransportFlowControlMessage::outbound_sent, TransportFlowControlMessage::outbound_window_size, GNUNET_TIME_Relative::rel_value_us, RMO_DV_ALLOWED, route_control_message_without_fc(), TransportFlowControlMessage::rtt, TransportFlowControlMessage::sender_time, TransportFlowControlMessage::seq, GNUNET_MessageHeader::size, TransportFlowControlMessage::size_of_addresses, TransportFlowControlMessage::sync_ready, VirtualLink::sync_ready, VirtualLink::target, task_consider_sending_fc(), AddGlobalAddressesContext::tgnas, GNUNET_MessageHeader::type, and Neighbour::vl.
Referenced by activate_core_visible_dv_path(), check_vl_transmission(), core_env_sent_cb(), handle_flow_control(), handle_validation_response(), and task_consider_sending_fc().
|
static |
Something changed on the virtual link with respect to flow control.
Consider retransmitting the FC window size.
cls | a struct VirtualLink to work with |
Definition at line 5403 of file gnunet-service-transport.c.
References consider_sending_fc(), and VirtualLink::fc_retransmit_task.
Referenced by consider_sending_fc().
|
static |
Get the IP address without the port number.
address | The string contains a communicator prefix, IP address and port like this 'tcp-92.68.150.1:55452'. |
Definition at line 11898 of file gnunet-service-transport.c.
References address, GNUNET_free, and GNUNET_strndup.
Referenced by check_for_global_natted(), check_validation_request_pending(), create_address_entry(), handle_add_queue_message(), iterate_address_and_compare_cb(), and iterate_address_start_burst().
|
static |
Definition at line 5423 of file gnunet-service-transport.c.
References TransportGlobalNattedAddress::address_length, ctx, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_memcpy, GNUNET_OK, and value.
Referenced by consider_sending_fc().
|
static |
Definition at line 9781 of file gnunet-service-transport.c.
References GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_TIME_relative_add(), GNUNET_TIME_relative_multiply(), GNUNET_TIME_UNIT_ZERO, and ret.
Referenced by consider_sending_fc(), and handle_flow_control().
|
static |
There is a message at the head of the pending messages for vl which may be ready for transmission.
Check if a queue is ready to take it.
This function must (1) check for flow control to ensure that we can right now send to vl, (2) check that the pending message in the queue is actually eligible, (3) determine if any applicable queue (direct neighbour or DVH path) is ready to accept messages, and (4) prioritize based on the preferences associated with the pending message.
So yeah, easy.
vl | virtual link where we should check for transmission |
Definition at line 5573 of file gnunet-service-transport.c.
References GNUNET_TIME_Absolute::abs_value_us, consider_sending_fc(), VirtualLink::dv, DistanceVector::dv_head, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_SCHEDULER_PRIORITY_BACKGROUND, GNUNET_SCHEDULER_PRIORITY_DEFAULT, GNUNET_TIME_absolute_get(), GNUNET_TIME_UNIT_ZERO, GNUNET_YES, lookup_virtual_link(), VirtualLink::n, DistanceVectorHop::next_dv, VirtualLink::outbound_fc_window_size, VirtualLink::outbound_fc_window_size_used, VirtualLink::pending_msg_head, Neighbour::pid, pm, queue(), Neighbour::queue_head, schedule_transmit_on_queue(), VirtualLink::target, DistanceVector::vl, and Neighbour::vl.
Referenced by forward_dv_box(), free_queue_entry(), handle_client_send(), handle_flow_control(), and send_msg_from_cache().
|
static |
Client asked for transmission to a peer.
Process the request.
cls | the client |
obm | the send message that was sent |
Definition at line 5711 of file gnunet-service-transport.c.
References check_vl_transmission(), VirtualLink::confirmed, CT_CORE, GNUNET_assert, GNUNET_CONTAINER_MDLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_malloc, GNUNET_NO, GNUNET_SERVICE_client_continue(), GNUNET_STATISTICS_update(), GST_stats, logging_uuid_gen, lookup_virtual_link(), OutboundMessage::peer, VirtualLink::pending_msg_head, VirtualLink::pending_msg_tail, pm, OutboundMessage::priority, GNUNET_MessageHeader::size, tc, and GNUNET_MessageHeader::type.
|
static |
Communicator requests backchannel transmission.
Process the request. Just repacks it into our struct TransportBackchannelEncapsulationMessage *
(which for now has exactly the same format, only a different message type) and passes it on for routing.
cls | the client |
cb | the send message that was sent |
Definition at line 5783 of file gnunet-service-transport.c.
References VirtualLink::confirmed, GNUNET_ALIGN, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_TRANSPORT_BACKCHANNEL_ENCAPSULATION, GNUNET_SERVICE_client_continue(), GNUNET_YES, TransportBackchannelEncapsulationMessage::header, is, lookup_neighbour(), lookup_virtual_link(), GNUNET_TRANSPORT_CommunicatorBackchannel::pid, RMO_DV_ALLOWED, RMO_NONE, route_control_message_without_fc(), route_via_neighbour(), GNUNET_MessageHeader::size, tc, and GNUNET_MessageHeader::type.
|
static |
Address of our peer added.
Test message is well-formed.
cls | the client |
aam | the send message that was sent |
Definition at line 5847 of file gnunet-service-transport.c.
References CT_COMMUNICATOR, GNUNET_break, GNUNET_MQ_check_zero_termination, GNUNET_OK, GNUNET_SYSERR, and tc.
|
static |
Ask peerstore to store our address.
cls | an struct AddressListEntry * |
Definition at line 5936 of file gnunet-service-transport.c.
References AddressListEntry::address, env, GNUNET_asprintf(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_HELLO_address_to_prefix(), GNUNET_HELLO_builder_add_address(), GNUNET_HELLO_builder_to_env(), GNUNET_HELLO_sign_address(), GNUNET_log, GNUNET_MQ_env_get_msg(), GNUNET_NO, GNUNET_OK, GNUNET_PEERSTORE_hello_add(), GNUNET_STRINGS_absolute_time_to_string(), GNUNET_TIME_UNIT_ZERO, GST_my_hello, GST_my_private_key, hello_mono_time, msg, AddressListEntry::nt, peerstore, prefix, AddressListEntry::shc, shc_cont(), AddressListEntry::signed_address, AddressListEntry::signed_address_len, and AddressListEntry::st.
Referenced by create_address_entry(), peerstore_store_own_cb(), and shc_cont().
|
static |
Function called when peerstore is done storing our address.
cls | a struct AddressListEntry |
success | GNUNET_YES if peerstore was successful |
Definition at line 5878 of file gnunet-service-transport.c.
References AddressListEntry::address, AddressListEntry::expiration, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_relative_divide(), GNUNET_YES, AddressListEntry::sc, AddressListEntry::st, and store_pi().
Referenced by shc_cont().
|
static |
Definition at line 5902 of file gnunet-service-transport.c.
References AddressListEntry::address, expiration, AddressListEntry::expiration, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_PEERSTORE_store(), GNUNET_PEERSTORE_STOREOPTION_MULTIPLE, GNUNET_PEERSTORE_TRANSPORT_HELLO_KEY, GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_relative_to_absolute(), GNUNET_TIME_UNIT_SECONDS, GST_my_identity, peerstore, peerstore_store_own_cb(), AddressListEntry::sc, AddressListEntry::signed_address, AddressListEntry::signed_address_len, AddressListEntry::st, and store_pi().
Referenced by store_pi().
|
static |
Definition at line 6000 of file gnunet-service-transport.c.
References address, AddressListEntry::address, AddressListEntry::aid, expiration, AddressListEntry::expiration, get_address_without_port(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_malloc, GNUNET_SCHEDULER_add_now(), nt, AddressListEntry::nt, AddressListEntry::st, store_pi(), tc, and AddressListEntry::tc.
Referenced by handle_add_address().
|
static |
Address of our peer added.
Process the request.
cls | the client |
aam | the send message that was sent |
Definition at line 6037 of file gnunet-service-transport.c.
References address, GNUNET_TRANSPORT_AddAddressMessage::aid, create_address_entry(), GNUNET_TRANSPORT_AddAddressMessage::expiration, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_malloc, GNUNET_SERVICE_client_continue(), GNUNET_TIME_relative_ntoh(), GNUNET_TRANSPORT_AddAddressMessage::header, GNUNET_TRANSPORT_AddAddressMessage::nt, GNUNET_MessageHeader::size, and tc.
|
static |
Address of our peer deleted.
Process the request.
cls | the client |
dam | the send message that was sent |
Definition at line 6073 of file gnunet-service-transport.c.
References GNUNET_TRANSPORT_DelAddressMessage::aid, CT_COMMUNICATOR, free_address_list_entry(), GNUNET_assert, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), AddressListEntry::next, and tc.
|
static |
Given an inbound message msg from a communicator cmc, demultiplex it based on the type calling the right handler.
cmc | context for demultiplexing |
msg | message to demultiplex |
Definition at line 10172 of file gnunet-service-transport.c.
References TransportClient::client, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_VALIDATION_CHALLENGE, GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_VALIDATION_RESPONSE, GNUNET_MESSAGE_TYPE_TRANSPORT_BACKCHANNEL_ENCAPSULATION, GNUNET_MESSAGE_TYPE_TRANSPORT_DV_BOX, GNUNET_MESSAGE_TYPE_TRANSPORT_DV_LEARN, GNUNET_MESSAGE_TYPE_TRANSPORT_FLOW_CONTROL, GNUNET_MESSAGE_TYPE_TRANSPORT_FRAGMENT, GNUNET_MESSAGE_TYPE_TRANSPORT_RELIABILITY_ACK, GNUNET_MESSAGE_TYPE_TRANSPORT_RELIABILITY_BOX, GNUNET_MQ_handle_message(), GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, GNUNET_NO, GNUNET_SERVICE_client_drop(), GNUNET_SYSERR, handle_raw_message(), handlers, CommunicatorMessageContext::mh, msg, ret, GNUNET_MessageHeader::size, CommunicatorMessageContext::tc, and GNUNET_MessageHeader::type.
Referenced by backtalker_monotime_cb(), handle_dv_box(), handle_fragment_box(), handle_incoming_msg(), and handle_reliability_box().
|
static |
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.
cls | a struct CoreSentContext |
Definition at line 6126 of file gnunet-service-transport.c.
References consider_sending_fc(), VirtualLink::csc_head, VirtualLink::csc_tail, ctx, GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_free, VirtualLink::incoming_fc_window_size_ram, and VirtualLink::incoming_fc_window_size_used.
Referenced by finish_handling_raw_message().
|
static |
Definition at line 6147 of file gnunet-service-transport.c.
References VirtualLink::available_fc_window_size, clients_head, VirtualLink::cmc_head, VirtualLink::cmc_tail, core_env_sent_cb(), VirtualLink::core_recv_window, VirtualLink::csc_head, VirtualLink::csc_tail, CT_CORE, ctx, env, finish_cmc_handling_with_continue(), GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_i2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_TRANSPORT_RECV, GNUNET_MQ_msg_extra, GNUNET_MQ_notify_sent(), GNUNET_MQ_send(), GNUNET_new, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_YES, GST_stats, CommunicatorMessageContext::im, VirtualLink::incoming_fc_window_size_ram, VirtualLink::incoming_fc_window_size_used, mh, InboundMessage::peer, GNUNET_TRANSPORT_IncomingMessage::sender, size, tc, and CoreSentContext::vl.
Referenced by handle_raw_message(), and send_msg_from_cache().
|
static |
Communicator gave us an unencapsulated message to pass as-is to CORE.
Process the request.
cls | a struct CommunicatorMessageContext (must call finish_cmc_handling() when done) |
mh | the message that was received |
Definition at line 6251 of file gnunet-service-transport.c.
References TransportClient::client, RingBufferEntry::cmc, VirtualLink::confirmed, CommunicatorMessageContext::continue_send, finish_cmc_handling(), finish_cmc_handling_with_continue(), finish_handling_raw_message(), GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_malloc, GNUNET_memcpy, GNUNET_new, GNUNET_NO, GNUNET_SERVICE_client_drop(), GNUNET_YES, CommunicatorMessageContext::im, is_ring_buffer_full, lookup_virtual_link(), mh, CommunicatorMessageContext::mh, RingBufferEntry::mh, ring_buffer, ring_buffer_head, RING_BUFFER_SIZE, GNUNET_TRANSPORT_IncomingMessage::sender, size, CommunicatorMessageContext::tc, and GNUNET_MessageHeader::type.
Referenced by demultiplex_with_cmc().
|
static |
Communicator gave us a fragment box.
Check the message.
cls | a struct CommunicatorMessageContext |
fb | the send message that was sent |
Definition at line 6354 of file gnunet-service-transport.c.
References bsize, TransportFragmentBoxMessage::frag_off, GNUNET_break_op, GNUNET_SYSERR, GNUNET_YES, TransportFragmentBoxMessage::header, TransportFragmentBoxMessage::msg_size, GNUNET_MessageHeader::size, and size.
|
static |
Clean up an idle cumulative acknowledgement data structure.
cls | a struct AcknowledgementCummulator * |
Definition at line 6385 of file gnunet-service-transport.c.
References ack_cummulators, GNUNET_assert, GNUNET_CONTAINER_multipeermap_remove(), GNUNET_free, GNUNET_YES, AcknowledgementCummulator::num_acks, AcknowledgementCummulator::target, and AcknowledgementCummulator::task.
Referenced by transmit_cummulative_ack_cb().
|
static |
Do the transmission of a cumulative acknowledgement now.
cls | a struct AcknowledgementCummulator * |
Definition at line 6404 of file gnunet-service-transport.c.
References TransportReliabilityAckMessage::ack_counter, AcknowledgementCummulator::ack_counter, ACK_CUMMULATOR_TIMEOUT, TransportCummulativeAckPayloadP::ack_delay, TransportCummulativeAckPayloadP::ack_uuid, TransportCummulativeAckPayload::ack_uuid, AcknowledgementCummulator::ack_uuids, VirtualLink::confirmed, destroy_ack_cummulator(), GNUNET_ALIGN, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_TRANSPORT_RELIABILITY_ACK, GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_relative_hton(), GNUNET_YES, TransportReliabilityAckMessage::header, lookup_neighbour(), lookup_virtual_link(), AcknowledgementCummulator::num_acks, TransportCummulativeAckPayload::receive_time, RMO_DV_ALLOWED, RMO_NONE, route_control_message_without_fc(), route_via_neighbour(), GNUNET_MessageHeader::size, AcknowledgementCummulator::target, AcknowledgementCummulator::task, and GNUNET_MessageHeader::type.
Referenced by cummulative_ack().
|
static |
Transmit an acknowledgement for ack_uuid to pid delaying transmission by at most ack_delay.
pid | target peer |
ack_uuid | UUID to ack |
max_delay | how long can the ACK wait |
Definition at line 6472 of file gnunet-service-transport.c.
References ack_cummulators, TransportCummulativeAckPayload::ack_uuid, AcknowledgementCummulator::ack_uuids, GNUNET_assert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multipeermap_get(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_new, GNUNET_SCHEDULER_add_at(), GNUNET_SCHEDULER_cancel(), GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_min(), GNUNET_uuid2s(), GNUNET_YES, MAX_CUMMULATIVE_ACKS, AcknowledgementCummulator::min_transmission_time, AcknowledgementCummulator::num_acks, pid, TransportCummulativeAckPayload::receive_time, AcknowledgementCummulator::target, AcknowledgementCummulator::task, transmit_cummulative_ack_cb(), and AcknowledgementUUIDP::value.
Referenced by handle_fragment_box(), and handle_reliability_box().
|
static |
Iterator called to find a reassembly context by the message UUID in the multihashmap32.
cls | a struct FindByMessageUuidContext |
key | a key (unused) |
value | a struct ReassemblyContext |
Definition at line 6543 of file gnunet-service-transport.c.
References GNUNET_memcmp, GNUNET_NO, GNUNET_YES, key, FindByMessageUuidContext::message_uuid, ReassemblyContext::msg_uuid, FindByMessageUuidContext::rc, and value.
Referenced by handle_fragment_box().
|
static |
Communicator gave us a fragment.
Process the request.
cls | a struct CommunicatorMessageContext (must call finish_cmc_handling() when done) |
fb | the message that was received |
Definition at line 6566 of file gnunet-service-transport.c.
References GNUNET_TIME_Absolute::abs_value_us, TransportFragmentBoxMessage::ack_uuid, ReassemblyContext::bitfield, TransportClient::client, VirtualLink::confirmed, cummulative_ack(), demultiplex_with_cmc(), find_by_message_uuid(), finish_cmc_handling(), TransportFragmentBoxMessage::frag_off, free_reassembly_context(), GNUNET_assert, GNUNET_break, GNUNET_break_op, GNUNET_CONTAINER_heap_create(), GNUNET_CONTAINER_heap_insert(), GNUNET_CONTAINER_HEAP_ORDER_MIN, GNUNET_CONTAINER_multihashmap32_create(), GNUNET_CONTAINER_multihashmap32_get_multiple(), GNUNET_CONTAINER_multihashmap32_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_malloc, GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_add_delayed(), GNUNET_SERVICE_client_drop(), GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_relative_multiply(), GNUNET_TIME_relative_to_absolute(), GNUNET_TIME_UNIT_ZERO, TransportFragmentBoxMessage::header, ReassemblyContext::hn, CommunicatorMessageContext::im, ReassemblyContext::last_frag, lookup_virtual_link(), FindByMessageUuidContext::message_uuid, CommunicatorMessageContext::mh, msg, ReassemblyContext::msg_missing, TransportFragmentBoxMessage::msg_size, ReassemblyContext::msg_size, TransportFragmentBoxMessage::msg_uuid, ReassemblyContext::msg_uuid, FindByMessageUuidContext::rc, reassembly_cleanup_task(), REASSEMBLY_EXPIRATION, VirtualLink::reassembly_heap, VirtualLink::reassembly_map, ReassemblyContext::reassembly_timeout, VirtualLink::reassembly_timeout_task, GNUNET_TRANSPORT_IncomingMessage::sender, GNUNET_MessageHeader::size, CommunicatorMessageContext::tc, MessageUUIDP::uuid, and ReassemblyContext::virtual_link.
|
static |
Communicator gave us a reliability box.
Check the message.
cls | a struct CommunicatorMessageContext |
rb | the send message that was sent |
Definition at line 6736 of file gnunet-service-transport.c.
References GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MQ_check_boxed_message, GNUNET_YES, TransportReliabilityBoxMessage::header, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
|
static |
Communicator gave us a reliability box.
Process the request.
cls | a struct CommunicatorMessageContext (must call finish_cmc_handling() when done) |
rb | the message that was received |
Definition at line 6763 of file gnunet-service-transport.c.
References TransportReliabilityBoxMessage::ack_countdown, TransportReliabilityBoxMessage::ack_uuid, cummulative_ack(), demultiplex_with_cmc(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_TIME_relative_divide(), GNUNET_TIME_relative_to_absolute(), GNUNET_TIME_UNIT_SECONDS, GNUNET_TIME_UNIT_ZERO_ABS, GNUNET_uuid2s(), CommunicatorMessageContext::im, CommunicatorMessageContext::mh, GNUNET_TRANSPORT_IncomingMessage::sender, GNUNET_MessageHeader::type, and AcknowledgementUUIDP::value.
|
static |
Check if we have advanced to another age since the last time.
If so, purge ancient statistics (more than GOODPUT_AGING_SLOTS before the current age)
[in,out] | pd | data to update |
age | current age |
Definition at line 6804 of file gnunet-service-transport.c.
References TransmissionHistoryEntry::bytes_received, TransmissionHistoryEntry::bytes_sent, GNUNET_MAX, GOODPUT_AGING_SLOTS, PerformanceData::last_age, and PerformanceData::the.
Referenced by update_performance_data().
|
static |
Update pd based on the latest rtt and the number of bytes that were confirmed to be successfully transmitted.
[in,out] | pd | data to update |
rtt | latest round-trip time | |
bytes_transmitted_ok | number of bytes receiver confirmed as received |
Definition at line 6831 of file gnunet-service-transport.c.
References PerformanceData::aged_rtt, TransmissionHistoryEntry::bytes_received, get_age(), GNUNET_TIME_UNIT_FOREVER_REL, GOODPUT_AGING_SLOTS, GNUNET_TIME_Relative::rel_value_us, PerformanceData::the, and update_pd_age().
Referenced by update_dvh_performance(), and update_queue_performance().
|
static |
We have successfully transmitted data via q, update metrics.
q | queue to update |
rtt | round trip time observed |
bytes_transmitted_ok | number of bytes successfully transmitted |
Definition at line 6857 of file gnunet-service-transport.c.
References q, and update_performance_data().
Referenced by handle_acknowledged().
|
static |
We have successfully transmitted data via dvh, update metrics.
dvh | distance vector path data to update |
rtt | round trip time observed |
bytes_transmitted_ok | number of bytes successfully transmitted |
Definition at line 6873 of file gnunet-service-transport.c.
References DistanceVectorHop::pd, and update_performance_data().
Referenced by handle_acknowledged().
|
static |
We have completed transmission of pm, remove it from the transmission queues (and if it is a fragment, continue up the tree as necessary).
pm | pending message that was transmitted |
Definition at line 6889 of file gnunet-service-transport.c.
References PendingMessage::bpm, PendingMessage::bytes_msg, client_send_response(), PendingMessage::frag_off, PendingMessage::frag_parent, free_pending_message(), GNUNET_CONTAINER_MDLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, PendingMessage::head_frag, pm, PendingMessage::pmt, PMT_CORE, PMT_DV_BOX, PMT_FRAGMENT_BOX, PMT_RELIABILITY_BOX, and PendingMessage::tail_frag.
Referenced by handle_acknowledged(), and transmit_on_queue().
|
static |
The pa was acknowledged, process the acknowledgement.
pa | the pending acknowledgement that was satisfied |
ack_delay | artificial delay from cumulative acks created by the other peer |
Definition at line 6972 of file gnunet-service-transport.c.
References completed_pending_message(), PendingAcknowledgement::dvh, free_pending_acknowledgement(), GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_relative_subtract(), PendingAcknowledgement::message_size, PendingAcknowledgement::num_send, PendingAcknowledgement::pm, PendingAcknowledgement::queue, PendingAcknowledgement::transmission_time, update_dvh_performance(), and update_queue_performance().
Referenced by handle_reliability_ack().
|
static |
Communicator gave us a reliability ack.
Check it is well-formed.
cls | a struct CommunicatorMessageContext (unused) |
ra | the message that was received |
Definition at line 6997 of file gnunet-service-transport.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, TransportReliabilityAckMessage::header, and GNUNET_MessageHeader::size.
|
static |
Communicator gave us a reliability ack.
Process the request.
cls | a struct CommunicatorMessageContext (must call finish_cmc_handling() when done) |
ra | the message that was received |
Definition at line 7028 of file gnunet-service-transport.c.
References TransportReliabilityAckMessage::ack_counter, PendingAcknowledgement::ack_uuid, finish_cmc_handling(), GNUNET_CONTAINER_multiuuidmap_get(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_INFO, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_TIME_relative_ntoh(), GNUNET_uuid2s(), GST_stats, handle_acknowledged(), TransportReliabilityAckMessage::header, CommunicatorMessageContext::im, pending_acks, GNUNET_TRANSPORT_IncomingMessage::sender, GNUNET_MessageHeader::size, and AcknowledgementUUIDP::value.
|
static |
Communicator gave us a backchannel encapsulation.
Check the message.
cls | a struct CommunicatorMessageContext |
be | the send message that was sent |
Definition at line 7079 of file gnunet-service-transport.c.
References GNUNET_break_op, GNUNET_SYSERR, GNUNET_YES, TransportBackchannelEncapsulationMessage::header, is, GNUNET_MessageHeader::size, and size.
|
static |
Communicator gave us a backchannel encapsulation.
Process the request. (We are the destination of the backchannel here.)
cls | a struct CommunicatorMessageContext (must call finish_cmc_handling() when done) |
be | the message that was received |
Definition at line 7116 of file gnunet-service-transport.c.
References clients_head, CT_COMMUNICATOR, env, finish_cmc_handling(), GNUNET_asprintf(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_TRANSPORT_COMMUNICATOR_BACKCHANNEL_INCOMING, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_NO, GNUNET_STATISTICS_update(), GST_my_identity, GST_stats, CommunicatorMessageContext::im, GNUNET_TRANSPORT_CommunicatorBackchannelIncoming::pid, GNUNET_TRANSPORT_IncomingMessage::sender, GNUNET_MessageHeader::size, tc, and GNUNET_MessageHeader::type.
|
static |
Task called when we should check if any of the DV paths we have learned to a target are due for garbage collection.
Collects stale paths, and possibly frees the entire DV entry if no paths are left. Otherwise re-schedules itself.
cls | a struct DistanceVector |
Definition at line 7185 of file gnunet-service-transport.c.
References DistanceVectorHop::dv, DistanceVector::dv_head, free_distance_vector_hop(), free_dv_route(), GNUNET_assert, GNUNET_SCHEDULER_add_at(), GNUNET_TIME_absolute_get_remaining(), path_cleanup_cb(), GNUNET_TIME_Relative::rel_value_us, DistanceVectorHop::timeout, and DistanceVector::timeout_task.
Referenced by learn_dv_path(), and path_cleanup_cb().
|
static |
Definition at line 7209 of file gnunet-service-transport.c.
References check_vl_transmission(), RingBufferEntry::cmc, finish_handling_raw_message(), GNUNET_CONTAINER_MDLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_i2s2(), GNUNET_log, GNUNET_memcmp, GNUNET_NO, GNUNET_YES, is_ring_buffer_dv_full, is_ring_buffer_full, mh, RingBufferEntry::mh, VirtualLink::pending_msg_head, VirtualLink::pending_msg_tail, pm, ring_buffer, ring_buffer_dv, ring_buffer_dv_head, ring_buffer_head, RING_BUFFER_SIZE, GNUNET_TRANSPORT_IncomingMessage::sender, VirtualLink::target, PendingMessage::target, and PendingMessage::vl.
Referenced by activate_core_visible_dv_path(), and handle_validation_response().
|
static |
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.
hop | a path to some peer that is the reason for activation |
Definition at line 7355 of file gnunet-service-transport.c.
References VirtualLink::available_fc_window_size, VirtualLink::burst_addr, check_link_down(), VirtualLink::confirmed, consider_sending_fc(), VirtualLink::core_recv_window, cores_send_connect_info(), DEFAULT_WINDOW_SIZE, VirtualLink::dv, DistanceVectorHop::dv, GNUNET_break, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multipeermap_put(), GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_u64(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_new, GNUNET_NO, GNUNET_SCHEDULER_add_at(), GNUNET_YES, VirtualLink::incoming_fc_window_size, links, lookup_virtual_link(), VirtualLink::message_uuid_ctr, DistanceVectorHop::path_valid_until, RECV_WINDOW_SIZE, send_msg_from_cache(), VirtualLink::target, DistanceVector::target, VirtualLink::visibility_task, and DistanceVector::vl.
Referenced by learn_dv_path().
|
static |
We have learned a path through the network to some other peer, add it to our DV data structure (returning GNUNET_YES on success).
We do not add paths if we have a sufficient number of shorter paths to this target already (returning GNUNET_NO).
We also do not add problematic paths, like those where we lack the first hop in our neighbour list (i.e. due to a topology change) or where some non-first hop is in our neighbour list (returning GNUNET_SYSERR).
path | the path we learned, path[0] should be us, and then path contains a valid path from us to path[path_len-1] path[1] should be a direct neighbour (we should check!) |
path_len | number of entries on the path, at least three! |
network_latency | how long does the message take from us to path[path_len-1] ? set to "forever" if unknown |
path_valid_until | how long is this path considered validated? Maybe be zero. |
Definition at line 7443 of file gnunet-service-transport.c.
References activate_core_visible_dv_path(), PerformanceData::aged_rtt, DistanceVectorHop::distance, DistanceVectorHop::dv, DistanceVector::dv_head, Neighbour::dv_head, DV_PATH_DISCOVERY_FREQUENCY, DV_PATH_VALIDITY_TIMEOUT, dv_routes, DistanceVector::dv_tail, Neighbour::dv_tail, GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_MDLL_insert, GNUNET_CONTAINER_MDLL_remove, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multipeermap_get(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_INFO, GNUNET_i2s(), GNUNET_log, GNUNET_malloc, GNUNET_memcmp, GNUNET_new, GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_add_delayed(), GNUNET_STATISTICS_update(), GNUNET_STRINGS_absolute_time_to_string(), GNUNET_SYSERR, GNUNET_TIME_absolute_get_remaining(), GNUNET_TIME_absolute_max(), GNUNET_TIME_relative_subtract(), GNUNET_TIME_relative_to_absolute(), GNUNET_TIME_UNIT_ZERO_ABS, GNUNET_YES, GST_my_identity, GST_stats, lookup_neighbour(), MAX_DV_PATHS_TO_TARGET, DistanceVectorHop::next_dv, DistanceVectorHop::next_hop, DistanceVectorHop::path, path_cleanup_cb(), DistanceVectorHop::path_valid_until, DistanceVectorHop::pd, Neighbour::pid, q, Neighbour::queue_head, GNUNET_TIME_Relative::rel_value_us, DistanceVector::target, DistanceVectorHop::timeout, and DistanceVector::timeout_task.
Referenced by handle_dv_learn().
|
static |
Communicator gave us a DV learn message.
Check the message.
cls | a struct CommunicatorMessageContext |
dvl | the send message that was sent |
Definition at line 7623 of file gnunet-service-transport.c.
References GNUNET_break_op, GNUNET_memcmp, GNUNET_SYSERR, GNUNET_YES, GST_my_identity, TransportDVLearnMessage::header, DVPathEntryP::hop, TransportDVLearnMessage::initiator, MAX_DV_HOPS_ALLOWED, TransportDVLearnMessage::num_hops, GNUNET_MessageHeader::size, and size.
|
static |
Build and forward a DV learn message to next_hop.
next_hop | peer to send the message to |
msg | message received |
bi_history | bitmask specifying hops on path that were bidirectional |
nhops | length of the hops array |
hops | path the message traversed so far |
in_time | when did we receive the message, used to calculate network delay |
Definition at line 7669 of file gnunet-service-transport.c.
References TransportDVLearnMessage::bidirectional, TransportDVLearnMessage::challenge, VirtualLink::confirmed, GNUNET_ALIGN, GNUNET_assert, GNUNET_CRYPTO_eddsa_sign, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_i2s2(), GNUNET_log, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_TRANSPORT_DV_LEARN, GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_HOP, GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_relative_add(), GNUNET_TIME_relative_hton(), GNUNET_TIME_relative_ntoh(), GNUNET_YES, GST_my_identity, GST_my_private_key, TransportDVLearnMessage::header, DVPathEntryP::hop, TransportDVLearnMessage::init_sig, TransportDVLearnMessage::initiator, lookup_neighbour(), lookup_virtual_link(), MAX_DV_HOPS_ALLOWED, TransportDVLearnMessage::monotonic_time, msg, TransportDVLearnMessage::non_network_delay, TransportDVLearnMessage::num_hops, GNUNET_CRYPTO_EccSignaturePurpose::purpose, DvHopPS::purpose, RMO_UNCONFIRMED_ALLOWED, route_control_message_without_fc(), route_via_neighbour(), GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by dv_neighbour_transmission(), and handle_dv_learn().
|
static |
Check signature of type GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_INITIATOR.
sender_monotonic_time | monotonic time of the initiator |
init | the signer |
challenge | the challenge that was signed |
init_sig | signature presumably by init |
Definition at line 7751 of file gnunet-service-transport.c.
References DvInitPS::challenge, GNUNET_break_op, GNUNET_CRYPTO_eddsa_verify, GNUNET_OK, GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_INITIATOR, GNUNET_SYSERR, init, GNUNET_CRYPTO_EccSignaturePurpose::purpose, and DvInitPS::purpose.
Referenced by handle_dv_learn().
|
static |
Function called for each neighbour during handle_dv_learn.
cls | a struct NeighbourSelectionContext * |
pid | identity of the peer |
value | a struct Neighbour |
Definition at line 7833 of file gnunet-service-transport.c.
References NeighbourSelectionContext::dvl, GNUNET_memcmp, GNUNET_YES, DVPathEntryP::hop, NeighbourSelectionContext::hops, TransportDVLearnMessage::initiator, NeighbourSelectionContext::nhops, NeighbourSelectionContext::num_eligible, pid, and value.
Referenced by handle_dv_learn().
|
static |
Function called for each neighbour during handle_dv_learn.
We call forward_dv_learn() on the neighbour(s) selected during dv_neighbour_selection().
cls | a struct NeighbourSelectionContext * |
pid | identity of the peer |
value | a struct Neighbour |
Definition at line 7862 of file gnunet-service-transport.c.
References NeighbourSelectionContext::bi_history, NeighbourSelectionContext::dvl, forward_dv_learn(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_memcmp, GNUNET_YES, DVPathEntryP::hop, NeighbourSelectionContext::hops, NeighbourSelectionContext::in_time, TransportDVLearnMessage::initiator, NeighbourSelectionContext::nhops, NeighbourSelectionContext::num_eligible, NeighbourSelectionContext::num_selections, pid, NeighbourSelectionContext::selections, and value.
Referenced by handle_dv_learn().
|
static |
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.
NOTE: technically we might want to include NSE in the formula to get a better grip on the overall network size. However, for now using NSE here would create a dependency issue in the build system. => Left for later, hardcoded to 50 for now.
The goal of the formula is that we want to reach a total of LOG(NSE) peers via DV (target_total
). We want the reach to be spread out over various distances to the origin, with a bias towards shorter distances.
We make the strong assumption that the network topology looks "similar" at other hops, in particular the neighbour_count should be comparable at other hops.
If the local neighbourhood is densely connected, we expect that eligible_count is close to neighbour_count minus hops_taken as a lot of the path is already known. In that case, we should forward to few(er) peers to try to find a path out of the neighbourhood. OTOH, if eligible_count is close to neighbour_count, we should forward to many peers as we are either still close to the origin (i.e. hops_taken is small) or because we managed to get beyond a local cluster. We express this as the boost_factor
using the square of the fraction of eligible neighbours (so if only 50% are eligible, we boost by 1/4, but if 99% are eligible, the 'boost' will be almost 1).
Second, the more hops we have taken, the larger the problem of an exponential traffic explosion gets. So we take the target_total
, and compute our degree such that at each distance d 2^{-d} peers are selected (corrected by the boost_factor
).
hops_taken | number of hops DVInit has travelled so far |
neighbour_count | number of neighbours we have in total |
eligible_count | number of neighbours we could in theory forward to |
Definition at line 7940 of file gnunet-service-transport.c.
References GNUNET_break, GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_u64(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, and consensus-simulation::int.
Referenced by handle_dv_learn().
|
static |
Function called when peerstore is done storing a DV monotonic time.
cls | a struct Neighbour |
success | GNUNET_YES if peerstore was successful |
Definition at line 7987 of file gnunet-service-transport.c.
References GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_YES, and Neighbour::sc.
Referenced by handle_dv_learn().
|
static |
Definition at line 7999 of file gnunet-service-transport.c.
References GNUNET_assert, GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_absolute_ntoh(), GNUNET_TIME_relative_divide(), GNUNET_TIME_relative_ntoh(), GNUNET_TIME_relative_subtract(), and GNUNET_TIME_Relative::rel_value_us.
Referenced by handle_dv_learn().
|
static |
Communicator gave us a DV learn message.
Process the request.
cls | a struct CommunicatorMessageContext (must call finish_cmc_handling() when done) |
dvl | the message that was received |
Definition at line 8033 of file gnunet-service-transport.c.
References GNUNET_TIME_Absolute::abs_value_us, ADDRESS_VALIDATION_LIFETIME, NeighbourSelectionContext::bi_history, TransportDVLearnMessage::bidirectional, calculate_fork_degree(), TransportClient::cc, DvHopPS::challenge, TransportDVLearnMessage::challenge, TransportClient::communicator, CT_COMMUNICATOR, TransportClient::details, Neighbour::dv_monotime_available, dv_neighbour_selection(), dv_neighbour_transmission(), NeighbourSelectionContext::dvl, finish_cmc_handling(), forward_dv_learn(), get_network_latency(), GNUNET_asprintf(), GNUNET_assert, GNUNET_break, GNUNET_break_op, GNUNET_CONTAINER_multipeermap_contains(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_CONTAINER_multipeermap_size(), GNUNET_CRYPTO_eddsa_verify, GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_u32(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_EXTRA_LOGGING, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_memcmp, GNUNET_MIN, GNUNET_NO, GNUNET_OK, GNUNET_PEERSTORE_store(), GNUNET_PEERSTORE_store_cancel(), GNUNET_PEERSTORE_STOREOPTION_REPLACE, GNUNET_PEERSTORE_TRANSPORT_DVLEARN_MONOTIME, GNUNET_sh2s(), GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_HOP, GNUNET_STATISTICS_update(), GNUNET_strdup, GNUNET_STRINGS_relative_time_to_string(), GNUNET_SYSERR, GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_ntoh(), GNUNET_TIME_relative_multiply(), GNUNET_TIME_relative_to_absolute(), GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_TRANSPORT_CC_RELIABLE, GNUNET_YES, GST_my_identity, GST_stats, DVPathEntryP::hop, NeighbourSelectionContext::hops, CommunicatorMessageContext::im, NeighbourSelectionContext::in_time, TransportDVLearnMessage::init_sig, TransportDVLearnMessage::initiator, Neighbour::last_dv_learn_monotime, learn_dv_path(), lookup_neighbour(), MAX_DV_DISCOVERY_SELECTION, MAX_DV_HOPS_ALLOWED, MIN_DV_PATH_LENGTH_FOR_INITIATOR, TransportDVLearnMessage::monotonic_time, neighbour_store_dvmono_cb(), neighbours, NeighbourSelectionContext::nhops, NeighbourSelectionContext::num_eligible, TransportDVLearnMessage::num_hops, NeighbourSelectionContext::num_selections, peerstore, DvHopPS::pred, GNUNET_CRYPTO_EccSignaturePurpose::purpose, DvHopPS::purpose, Neighbour::sc, NeighbourSelectionContext::selections, GNUNET_TRANSPORT_IncomingMessage::sender, DvHopPS::succ, CommunicatorMessageContext::tc, TransportClient::type, validate_dv_initiator_signature(), and GNUNET_CRYPTO_ChallengeNonceP::value.
|
static |
Communicator gave us a DV box.
Check the message.
cls | a struct CommunicatorMessageContext |
dvb | the send message that was sent |
Definition at line 8358 of file gnunet-service-transport.c.
References GNUNET_break_op, GNUNET_memcmp, GNUNET_SYSERR, GNUNET_YES, GST_my_identity, TransportDVBoxMessage::header, TransportDVBoxMessage::num_hops, GNUNET_MessageHeader::size, and size.
|
static |
Create a DV Box message and queue it for transmission to next_hop.
next_hop | peer to receive the message next |
total_hops | how many hops did the message take so far |
num_hops | length of the hops array |
origin | origin of the message |
hops | next peer(s) to the destination, including destination |
payload | payload of the box |
payload_size | number of bytes in payload |
Definition at line 8396 of file gnunet-service-transport.c.
References check_vl_transmission(), VirtualLink::confirmed, DV_FORWARD_TIMEOUT, GNUNET_ALIGN, GNUNET_CONTAINER_MDLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_malloc, GNUNET_MQ_PRIO_BACKGROUND, GNUNET_TIME_relative_to_absolute(), GNUNET_YES, TransportDVBoxMessage::header, is_ring_buffer_dv_full, logging_uuid_gen, TransportDVBoxMessage::num_hops, VirtualLink::pending_msg_head, VirtualLink::pending_msg_tail, Neighbour::pid, pm, PMT_DV_BOX, ring_buffer_dv, ring_buffer_dv_head, RING_BUFFER_SIZE, RMO_ANYTHING_GOES, route_via_neighbour(), GNUNET_MessageHeader::size, TransportDVBoxMessage::total_hops, Neighbour::vl, and TransportDVBoxMessage::without_fc.
Referenced by handle_dv_box().
|
static |
Free data structures associated with b.
b | data structure to release |
Definition at line 8504 of file gnunet-service-transport.c.
References backtalkers, Backtalker::cmc, finish_cmc_handling(), Backtalker::get, GNUNET_assert, GNUNET_CONTAINER_multipeermap_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_PEERSTORE_iteration_stop(), GNUNET_PEERSTORE_store_cancel(), GNUNET_SCHEDULER_cancel(), GNUNET_YES, Backtalker::pid, Backtalker::sc, and Backtalker::task.
Referenced by backtalker_timeout_cb(), and free_backtalker_cb().
|
static |
Callback to free backtalker records.
cls | NULL |
pid | unused |
value | a struct Backtalker |
Definition at line 8545 of file gnunet-service-transport.c.
References free_backtalker(), GNUNET_OK, pid, and value.
Referenced by do_shutdown().
|
static |
Function called when it is time to clean up a backtalker.
cls | a struct Backtalker |
Definition at line 8564 of file gnunet-service-transport.c.
References backtalker_timeout_cb(), free_backtalker(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_SCHEDULER_add_at(), GNUNET_TIME_absolute_get_remaining(), GNUNET_TIME_Relative::rel_value_us, Backtalker::sc, Backtalker::task, and Backtalker::timeout.
Referenced by backtalker_monotime_store_cb(), backtalker_timeout_cb(), and handle_dv_box().
|
static |
Function called with the monotonic time of a backtalker by PEERSTORE.
Updates the time and continues processing.
cls | a struct Backtalker |
record | the information found, NULL for the last call |
emsg | error message |
Definition at line 8590 of file gnunet-service-transport.c.
References GNUNET_TIME_Absolute::abs_value_us, Backtalker::body_size, Backtalker::cmc, demultiplex_with_cmc(), finish_cmc_handling(), Backtalker::get, GNUNET_assert, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_PEERSTORE_iteration_next(), GNUNET_STATISTICS_update(), GNUNET_TIME_absolute_ntoh(), GST_stats, CommunicatorMessageContext::mh, Backtalker::monotonic_time, Backtalker::pid, and record().
Referenced by handle_dv_box().
|
static |
Function called by PEERSTORE when the store operation of a backtalker's monotonic time is complete.
cls | the struct Backtalker |
success | GNUNET_OK on success |
Definition at line 8648 of file gnunet-service-transport.c.
References backtalker_timeout_cb(), GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_OK, GNUNET_SCHEDULER_add_at(), GNUNET_SCHEDULER_cancel(), Backtalker::sc, Backtalker::task, and Backtalker::timeout.
Referenced by update_backtalker_monotime().
|
static |
The backtalker b monotonic time changed.
Update PEERSTORE.
b | a backtalker with updated monotonic time |
Definition at line 8673 of file gnunet-service-transport.c.
References backtalker_monotime_store_cb(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_PEERSTORE_store(), GNUNET_PEERSTORE_STOREOPTION_REPLACE, GNUNET_PEERSTORE_TRANSPORT_BACKCHANNEL_MONOTIME, GNUNET_SCHEDULER_cancel(), GNUNET_TIME_absolute_hton(), GNUNET_TIME_UNIT_FOREVER_ABS, Backtalker::monotonic_time, peerstore, Backtalker::pid, Backtalker::sc, and Backtalker::task.
Referenced by handle_dv_box().
|
static |
Communicator gave us a DV box.
Process the request.
cls | a struct CommunicatorMessageContext (must call finish_cmc_handling() when done) |
dvb | the message that was received |
Definition at line 8716 of file gnunet-service-transport.c.
References GNUNET_TIME_Absolute::abs_value_us, BACKCHANNEL_INACTIVITY_TIMEOUT, backtalker_monotime_cb(), backtalker_timeout_cb(), backtalkers, Backtalker::body_size, Backtalker::cmc, demultiplex_with_cmc(), dv_decrypt(), dv_hmac(), dv_key_clean(), dv_setup_key_state_from_km(), EphemeralConfirmationPS::ephemeral_key, TransportDVBoxMessage::ephemeral_key, finish_cmc_handling(), forward_dv_box(), Backtalker::get, GNUNET_ALIGN, GNUNET_asprintf(), GNUNET_assert, GNUNET_break_op, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multipeermap_get(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_CRYPTO_eddsa_kem_decaps(), GNUNET_CRYPTO_eddsa_verify, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_EXTRA_LOGGING, GNUNET_free, GNUNET_i2s(), GNUNET_i2s2(), GNUNET_log, GNUNET_malloc, GNUNET_memcmp, GNUNET_MESSAGE_TYPE_TRANSPORT_DV_BOX, GNUNET_MESSAGE_TYPE_TRANSPORT_DV_LEARN, GNUNET_NO, GNUNET_OK, GNUNET_PEERSTORE_iteration_start(), GNUNET_PEERSTORE_TRANSPORT_BACKCHANNEL_MONOTIME, GNUNET_SCHEDULER_add_at(), GNUNET_SIGNATURE_PURPOSE_TRANSPORT_EPHEMERAL, GNUNET_STATISTICS_update(), GNUNET_strdup, GNUNET_TIME_absolute_ntoh(), GNUNET_TIME_relative_to_absolute(), GNUNET_YES, GST_my_identity, GST_my_private_key, GST_stats, TransportDVBoxMessage::header, TransportDVBoxMessage::hmac, CommunicatorMessageContext::im, TransportDVBoxMessage::iv, key, Backtalker::last_ephemeral, lookup_neighbour(), mh, CommunicatorMessageContext::mh, TransportDVBoxPayloadP::monotonic_time, Backtalker::monotonic_time, TransportDVBoxMessage::num_hops, TransportDVBoxMessage::orig_size, peerstore, Backtalker::pid, GNUNET_PeerIdentity::public_key, GNUNET_CRYPTO_EccSignaturePurpose::purpose, EphemeralConfirmationPS::purpose, TransportDVBoxPayloadP::sender, GNUNET_TRANSPORT_IncomingMessage::sender, EphemeralConfirmationPS::sender_monotonic_time, TransportDVBoxPayloadP::sender_sig, GNUNET_MessageHeader::size, GNUNET_CRYPTO_EccSignaturePurpose::size, size, EphemeralConfirmationPS::target, Backtalker::task, Backtalker::timeout, TransportDVBoxMessage::total_hops, CommunicatorMessageContext::total_hops, and update_backtalker_monotime().
|
static |
Client notified us about transmission from a peer.
Process the request.
cls | a struct TransportClient which sent us the message |
im | the send message that was sent |
Definition at line 8979 of file gnunet-service-transport.c.
References CT_COMMUNICATOR, GNUNET_break, GNUNET_MQ_check_boxed_message, GNUNET_OK, GNUNET_SYSERR, and tc.
|
static |
Test if the validation state in value matches the address from cls.
cls | a struct CheckKnownAddressContext |
pid | unused (must match though) |
value | a struct ValidationState |
Definition at line 9021 of file gnunet-service-transport.c.
References CheckKnownAddressContext::address, GNUNET_NO, GNUNET_OK, pid, value, and CheckKnownAddressContext::vs.
Referenced by start_address_validation().
|
static |
Task run periodically to validate some address based on validation_heap.
cls | NULL |
Definition at line 11652 of file gnunet-service-transport.c.
References find_queue(), free_validation_state(), GNUNET_CONTAINER_heap_peek(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_sh2s(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_absolute_cmp, GNUNET_TIME_absolute_get_monotonic(), GNUNET_TIME_absolute_get_remaining(), GNUNET_TIME_randomized_backoff(), GNUNET_TIME_relative_to_absolute(), GNUNET_YES, GST_cfg, MAX_VALIDATION_CHALLENGE_FREQ, ValidationState::pid, q, GNUNET_TIME_Relative::rel_value_us, suggest_to_connect(), update_next_challenge_time(), ValidationState::valid_until, validation_heap, validation_task, and validation_transmit_on_queue().
Referenced by update_next_challenge_time().
|
static |
Set the time for next_challenge of vs to new_time.
Updates the heap and if necessary reschedules the job.
vs | validation state to update |
new_time | new time for revalidation |
Definition at line 9053 of file gnunet-service-transport.c.
References GNUNET_TIME_Absolute::abs_value_us, delta, GNUNET_CONTAINER_heap_insert(), GNUNET_CONTAINER_heap_peek(), GNUNET_CONTAINER_heap_update_cost(), GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_u64(), GNUNET_SCHEDULER_add_at(), GNUNET_SCHEDULER_cancel(), GNUNET_TIME_absolute_add(), MIN_DELAY_ADDRESS_VALIDATION, GNUNET_TIME_Relative::rel_value_us, validation_heap, validation_start_cb(), and validation_task.
Referenced by handle_validation_response(), revalidation_start_cb(), start_address_validation(), and validation_start_cb().
|
static |
Start address validation.
pid | peer the address is for |
address | an address to reach pid (presumably) |
Definition at line 9088 of file gnunet-service-transport.c.
References GNUNET_TIME_Absolute::abs_value_us, address, CheckKnownAddressContext::address, ADDRESS_VALIDATION_LIFETIME, check_known_address(), FAST_VALIDATION_CHALLENGE_FREQ, GNUNET_assert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CONTAINER_multipeermap_get_multiple(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_CRYPTO_hash(), GNUNET_CRYPTO_QUALITY_NONCE, GNUNET_CRYPTO_random_block(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_new, GNUNET_sh2s(), GNUNET_strdup, GNUNET_TIME_absolute_get_monotonic(), GNUNET_TIME_relative_divide(), GNUNET_TIME_relative_min(), GNUNET_TIME_relative_to_absolute(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, GST_cfg, ValidationState::pid, pid, update_next_challenge_time(), ValidationState::valid_until, ValidationState::validated_until, validation_map, and CheckKnownAddressContext::vs.
Referenced by handle_add_queue_message(), handle_request_hello_validation(), handle_validation_challenge(), hello_for_client_cb(), and hello_for_incoming_cb().
|
static |
Find the queue matching pid and address.
pid | peer the queue must go to |
address | address the queue must use |
Definition at line 9428 of file gnunet-service-transport.c.
References address, lookup_neighbour(), Queue::next_neighbour, pid, and Neighbour::queue_head.
Referenced by handle_request_hello_validation(), handle_validation_response(), hello_for_client_cb(), hello_for_incoming_cb(), revalidation_start_cb(), and validation_start_cb().
|
static |
Signature of a function called with a communicator address of a peer pid that an application wants us to connect to.
pid | target peer |
address | the address to try |
Definition at line 11548 of file gnunet-service-transport.c.
References address, env, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_HELLO_address_to_prefix(), GNUNET_i2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_NO, GNUNET_STATISTICS_update(), GST_stats, lookup_communicator(), pid, prefix, GNUNET_TRANSPORT_CreateQueue::receiver, GNUNET_TRANSPORT_CreateQueue::request_id, and tc.
Referenced by handle_request_hello_validation(), hello_for_client_cb(), hello_for_incoming_cb(), revalidation_start_cb(), and validation_start_cb().
|
static |
Definition at line 9153 of file gnunet-service-transport.c.
References address, find_queue(), GNUNET_asprintf(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, pid, q, start_address_validation(), suggest_to_connect(), and uri.
Referenced by handle_hello_for_incoming().
|
static |
Function called by PEERSTORE for each matching record.
cls | closure, a struct IncomingRequest |
record | peerstore record information |
emsg | error message, or NULL if no errors |
Definition at line 9195 of file gnunet-service-transport.c.
References GNUNET_ERROR_TYPE_WARNING, GNUNET_HELLO_parser_free(), GNUNET_HELLO_parser_from_msg(), GNUNET_HELLO_parser_iterate(), GNUNET_log, GNUNET_memcmp, GNUNET_PEERSTORE_monitor_next(), GST_my_identity, hello_for_incoming_cb(), IncomingRequest::nc, consensus-simulation::parser, and record().
Referenced by handle_validation_challenge().
|
static |
Definition at line 9225 of file gnunet-service-transport.c.
References GNUNET_ERROR_TYPE_WARNING, and GNUNET_log.
Referenced by handle_validation_challenge().
|
static |
Definition at line 9233 of file gnunet-service-transport.c.
References GNUNET_ERROR_TYPE_WARNING, and GNUNET_log.
Referenced by handle_validation_challenge().
|
static |
Communicator gave us a transport address validation challenge.
Process the request.
cls | a struct CommunicatorMessageContext (must call finish_cmc_handling() when done) |
tvc | the message that was received |
Definition at line 9249 of file gnunet-service-transport.c.
References TransportValidationChallengeMessage::challenge, TransportValidationResponseMessage::challenge, VirtualLink::confirmed, GNUNET_TRANSPORT_IncomingMessage::expected_address_validity, finish_cmc_handling(), free_incoming_request(), GNUNET_break_op, GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_eddsa_sign, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_memcmp, GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_VALIDATION_RESPONSE, GNUNET_new, GNUNET_PEERSTORE_HELLO_KEY, GNUNET_PEERSTORE_monitor_start(), GNUNET_sh2s(), GNUNET_SIGNATURE_PURPOSE_TRANSPORT_CHALLENGE, GNUNET_YES, GST_cfg, GST_my_private_key, handle_hello_for_incoming(), TransportValidationResponseMessage::header, hello_for_incoming_error_cb(), hello_for_incoming_sync_cb(), CommunicatorMessageContext::im, ir_head, ir_tail, ir_total, lookup_neighbour(), lookup_virtual_link(), MAX_INCOMING_REQUEST, IncomingRequest::nc, IncomingRequest::next, IncomingRequest::pid, GNUNET_CRYPTO_EccSignaturePurpose::purpose, TransportValidationPS::purpose, q, Neighbour::queue_head, TransportValidationResponseMessage::reserved, RMO_ANYTHING_GOES, RMO_REDUNDANT, RMO_UNCONFIRMED_ALLOWED, route_control_message_without_fc(), route_via_neighbour(), GNUNET_TRANSPORT_IncomingMessage::sender, TransportValidationChallengeMessage::sender_time, TransportValidationResponseMessage::signature, GNUNET_MessageHeader::size, start_address_validation(), CommunicatorMessageContext::total_hops, GNUNET_MessageHeader::type, TransportValidationPS::validity_duration, and GNUNET_CRYPTO_ChallengeNonceP::value.
|
static |
Test if the validation state in value matches the challenge from cls.
cls | a struct CheckKnownChallengeContext |
pid | unused (must match though) |
value | a struct ValidationState |
Definition at line 9383 of file gnunet-service-transport.c.
References CheckKnownChallengeContext::challenge, GNUNET_memcmp, GNUNET_NO, GNUNET_OK, pid, value, and CheckKnownChallengeContext::vs.
Referenced by handle_validation_response().
|
static |
Function called when peerstore is done storing a validated address.
cls | a struct ValidationState |
success | GNUNET_YES on success |
Definition at line 9406 of file gnunet-service-transport.c.
References GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_YES, and GST_stats.
Referenced by handle_validation_response().
|
static |
The queue q (which matches the peer and address in vs) is ready for queueing.
We should now queue the validation request.
q | queue to send on |
vs | state to derive validation challenge from |
Definition at line 11603 of file gnunet-service-transport.c.
References TransportValidationChallengeMessage::challenge, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_CONTAINER_multihashmap_size(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_INFO, GNUNET_h2s(), GNUNET_i2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_VALIDATION_CHALLENGE, GNUNET_SCHEDULER_cancel(), GNUNET_sh2s(), GNUNET_TIME_absolute_get_monotonic(), GNUNET_TIME_absolute_hton(), GNUNET_TIME_UNIT_ZERO_ABS, GST_cfg, TransportValidationChallengeMessage::header, q, queue_send_msg(), TransportValidationChallengeMessage::reserved, revalidation_map, TransportValidationChallengeMessage::sender_time, GNUNET_MessageHeader::size, GNUNET_MessageHeader::type, and GNUNET_CRYPTO_ChallengeNonceP::value.
Referenced by check_validation_request_pending(), revalidation_start_cb(), and validation_start_cb().
|
static |
Definition at line 9449 of file gnunet-service-transport.c.
References find_queue(), GNUNET_TIME_absolute_get(), GNUNET_YES, ValidationState::pid, q, suggest_to_connect(), update_next_challenge_time(), and validation_transmit_on_queue().
Referenced by handle_validation_response().
|
static |
Definition at line 9470 of file gnunet-service-transport.c.
References GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_log, GNUNET_YES, and key.
Referenced by handle_validation_response().
|
static |
Communicator gave us a transport address validation response.
Process the request.
cls | a struct CommunicatorMessageContext (must call finish_cmc_handling() when done) |
tvr | the message that was received |
Definition at line 9492 of file gnunet-service-transport.c.
References GNUNET_TIME_Absolute::abs_value_us, ADDRESS_VALIDATION_LIFETIME, VirtualLink::available_fc_window_size, VirtualLink::burst_addr, TransportValidationResponseMessage::challenge, CheckKnownChallengeContext::challenge, check_known_challenge(), check_link_down(), VirtualLink::confirmed, consider_sending_fc(), VirtualLink::core_recv_window, cores_send_connect_info(), DEFAULT_WINDOW_SIZE, find_queue(), finish_cmc_handling(), GNUNET_assert, GNUNET_break, GNUNET_break_op, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_multihashmap_size(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multipeermap_get_multiple(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_CRYPTO_eddsa_verify, GNUNET_CRYPTO_QUALITY_NONCE, GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_block(), GNUNET_CRYPTO_random_u64(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_i2s(), GNUNET_log, GNUNET_new, GNUNET_NO, GNUNET_OK, GNUNET_PEERSTORE_store(), GNUNET_PEERSTORE_STOREOPTION_MULTIPLE, GNUNET_PEERSTORE_TRANSPORT_URLADDRESS_KEY, GNUNET_SCHEDULER_add_at(), GNUNET_sh2s(), GNUNET_SIGNATURE_PURPOSE_TRANSPORT_CHALLENGE, GNUNET_STATISTICS_update(), GNUNET_STRINGS_absolute_time_to_string(), GNUNET_TIME_absolute_cmp, GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_absolute_get_monotonic(), GNUNET_TIME_absolute_min(), GNUNET_TIME_absolute_ntoh(), GNUNET_TIME_absolute_subtract(), GNUNET_TIME_relative_min(), GNUNET_TIME_relative_multiply(), GNUNET_TIME_relative_ntoh(), GNUNET_TIME_relative_to_absolute(), GNUNET_TIME_UNIT_MINUTES, GNUNET_TIME_UNIT_ZERO, GNUNET_TIME_UNIT_ZERO_ABS, GNUNET_YES, GST_cfg, GST_stats, CommunicatorMessageContext::im, VirtualLink::incoming_fc_window_size, links, lookup_virtual_link(), MAX_ADDRESS_VALID_UNTIL, VirtualLink::message_uuid_ctr, VirtualLink::n, peerstore, peerstore_store_validation_cb(), Neighbour::pid, ValidationState::pid, GNUNET_PeerIdentity::public_key, GNUNET_CRYPTO_EccSignaturePurpose::purpose, TransportValidationPS::purpose, q, RECV_WINDOW_SIZE, revalidate_map_it(), revalidation_map, revalidation_start_cb(), send_msg_from_cache(), GNUNET_TRANSPORT_IncomingMessage::sender, TransportValidationResponseMessage::signature, VirtualLink::target, update_next_challenge_time(), ValidationState::valid_until, ValidationState::validated_until, validation_map, VALIDATION_RTT_BUFFER_FACTOR, GNUNET_CRYPTO_ChallengeNonceP::value, VirtualLink::visibility_task, Neighbour::vl, and CheckKnownChallengeContext::vs.
|
static |
Incoming message.
Process the request.
im | the send message that was received |
Definition at line 9723 of file gnunet-service-transport.c.
References demultiplex_with_cmc(), GNUNET_TRANSPORT_IncomingMessage::fc_id, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_new, GNUNET_TRANSPORT_IncomingMessage::header, CommunicatorMessageContext::im, CommunicatorMessageContext::mh, GNUNET_TRANSPORT_IncomingMessage::neighbour_sender, GNUNET_TRANSPORT_IncomingMessage::sender, GNUNET_MessageHeader::size, tc, and CommunicatorMessageContext::tc.
|
static |
Communicator gave us a transport address validation response.
Check the request.
cls | a struct CommunicatorMessageContext |
fc | the message that was received |
Definition at line 9753 of file gnunet-service-transport.c.
References GNUNET_break_op, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_OK, GNUNET_SYSERR, TransportFlowControlMessage::header, TransportFlowControlMessage::number_of_addresses, GNUNET_MessageHeader::size, and TransportFlowControlMessage::size_of_addresses.
|
static |
Definition at line 9808 of file gnunet-service-transport.c.
References VirtualLink::burst_addr, get_address_without_port(), GNUNET_asprintf(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_strndup, prefix, and uri.
Referenced by check_for_burst_address().
|
static |
Definition at line 9848 of file gnunet-service-transport.c.
References GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_HELLO_parser_free(), GNUNET_HELLO_parser_from_msg(), GNUNET_HELLO_parser_iterate(), GNUNET_i2s(), GNUNET_log, GNUNET_PEERSTORE_iteration_stop(), VirtualLink::ic, iterate_address_start_burst(), consensus-simulation::parser, record(), VirtualLink::sb_cls, VirtualLink::target, and GNUNET_StartBurstCls::vl.
Referenced by queue_burst().
|
static |
Definition at line 9889 of file gnunet-service-transport.c.
References burst_running, and GNUNET_NO.
Referenced by start_burst().
|
static |
Definition at line 9896 of file gnunet-service-transport.c.
References VirtualLink::burst_addr, burst_running, burst_task, burst_timeout(), burst_timeout_task, clients_head, CT_COMMUNICATOR, env, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_MESSAGE_TYPE_TRANSPORT_START_BURST, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_relative_hton(), GNUNET_TIME_relative_multiply(), GNUNET_TIME_UNIT_SECONDS, GNUNET_YES, GNUNET_TRANSPORT_StartBurst::header, GNUNET_TRANSPORT_StartBurst::pid, GNUNET_TIME_Relative::rel_value_us, GNUNET_StartBurstCls::rtt, GNUNET_TRANSPORT_StartBurst::rtt, VirtualLink::sb_cls, GNUNET_MessageHeader::size, VirtualLink::target, tc, and GNUNET_StartBurstCls::vl.
Referenced by queue_burst().
|
static |
Definition at line 9948 of file gnunet-service-transport.c.
References VirtualLink::burst_addr, burst_running, burst_task, check_for_burst_address(), GNUNET_StartBurstCls::delay, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_NO, GNUNET_PEERSTORE_HELLO_KEY, GNUNET_PEERSTORE_iteration_start(), GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_cancel(), GNUNET_YES, VirtualLink::ic, peerstore, VirtualLink::sb_cls, start_burst(), GNUNET_StartBurstCls::sync_ready, VirtualLink::target, use_burst, and GNUNET_StartBurstCls::vl.
Referenced by handle_flow_control().
|
static |
Communicator gave us a transport address validation response.
Process the request.
cls | a struct CommunicatorMessageContext (must call finish_cmc_handling() when done) |
fc | the message that was received |
Definition at line 9996 of file gnunet-service-transport.c.
References GNUNET_TIME_Absolute::abs_value_us, TransportGlobalNattedAddress::address_length, VirtualLink::available_fc_window_size, VirtualLink::burst_addr, calculate_rtt(), check_vl_transmission(), VirtualLink::confirmed, consider_sending_fc(), VirtualLink::core_recv_window, DEFAULT_WINDOW_SIZE, VirtualLink::dv, FC_NO_CHANGE_REPLY_PROBABILITY, VirtualLink::fc_retransmit_count, VirtualLink::fc_retransmit_task, finish_cmc_handling(), GNUNET_break, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multipeermap_put(), GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_u32(), GNUNET_CRYPTO_random_u64(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_is_burst_ready(), GNUNET_log, GNUNET_NAT_add_global_address(), GNUNET_new, GNUNET_NO, GNUNET_ntohll(), GNUNET_SCHEDULER_cancel(), GNUNET_STATISTICS_update(), GNUNET_TIME_absolute_get_remaining(), GNUNET_TIME_absolute_max(), GNUNET_TIME_absolute_ntoh(), GNUNET_TIME_relative_ntoh(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_TIME_UNIT_ZERO_ABS, GNUNET_YES, GST_stats, CommunicatorMessageContext::im, TransportFlowControlMessage::inbound_window_size, VirtualLink::incoming_fc_window_size, VirtualLink::incoming_fc_window_size_loss, VirtualLink::incoming_fc_window_size_used, VirtualLink::last_fc_seq, VirtualLink::last_fc_timestamp, VirtualLink::last_outbound_window_size_received, links, lookup_virtual_link(), VirtualLink::message_uuid_ctr, VirtualLink::n, nh, TransportFlowControlMessage::number_of_addresses, os, VirtualLink::outbound_fc_window_size, VirtualLink::outbound_fc_window_size_used, TransportFlowControlMessage::outbound_sent, TransportFlowControlMessage::outbound_window_size, q, queue_burst(), Neighbour::queue_head, RECV_WINDOW_SIZE, GNUNET_StartBurstCls::rtt, TransportFlowControlMessage::rtt, GNUNET_BurstSync::rtt_average, VirtualLink::sb_cls, GNUNET_TRANSPORT_IncomingMessage::sender, TransportFlowControlMessage::sender_time, TransportFlowControlMessage::seq, st, GNUNET_BurstSync::sync_ready, TransportFlowControlMessage::sync_ready, VirtualLink::target, and GNUNET_StartBurstCls::vl.
|
static |
New queue became available.
Check message.
cls | the client |
aqm | the send message that was sent |
Definition at line 10244 of file gnunet-service-transport.c.
References CT_COMMUNICATOR, GNUNET_break, GNUNET_MQ_check_zero_termination, GNUNET_OK, GNUNET_SYSERR, and tc.
|
static |
If necessary, generates the UUID for a pm.
pm | pending message to generate UUID for. |
Definition at line 10265 of file gnunet-service-transport.c.
References GNUNET_YES, and pm.
Referenced by extract_box_cb(), fragment_message(), and reliability_box_message().
|
static |
Setup data structure waiting for acknowledgements.
queue | queue the pm will be sent over |
dvh | path the message will take, may be NULL |
pm | the pending message for transmission |
Definition at line 10283 of file gnunet-service-transport.c.
References PendingAcknowledgement::ack_uuid, PendingAcknowledgement::dvh, GNUNET_CONTAINER_MDLL_insert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multiuuidmap_put(), GNUNET_CRYPTO_QUALITY_NONCE, GNUNET_CRYPTO_random_block(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_new, GNUNET_TIME_absolute_get(), GNUNET_uuid2s(), GNUNET_YES, PendingAcknowledgement::message_size, DistanceVectorHop::pa_head, DistanceVectorHop::pa_tail, pending_acks, PendingAcknowledgement::pm, pm, queue(), PendingAcknowledgement::queue, PendingAcknowledgement::transmission_time, and AcknowledgementUUIDP::value.
Referenced by fragment_message(), and reliability_box_message().
|
static |
Fragment the given pm to the given mtu.
Adds additional fragments to the neighbour as well. If the mtu is too small, generates and error for the pm and returns NULL.
queue | which queue to fragment for |
dvh | path the message will take, or NULL |
pm | pending message to fragment for transmission |
Definition at line 10330 of file gnunet-service-transport.c.
References TransportFragmentBoxMessage::ack_uuid, PendingAcknowledgement::ack_uuid, PendingMessage::bytes_msg, TransportFragmentBoxMessage::frag_off, PendingMessage::frag_off, PendingMessage::frag_parent, GNUNET_assert, GNUNET_CONTAINER_MDLL_insert, GNUNET_CONTAINER_MDLL_insert_tail, GNUNET_CONTAINER_MDLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_malloc, GNUNET_MESSAGE_TYPE_TRANSPORT_FRAGMENT, GNUNET_MIN, PendingMessage::head_frag, TransportFragmentBoxMessage::header, PendingMessage::logging_uuid, logging_uuid_gen, msg, TransportFragmentBoxMessage::msg_size, TransportFragmentBoxMessage::msg_uuid, pm, PendingMessage::pmt, PMT_FRAGMENT_BOX, prepare_pending_acknowledgement(), queue(), set_pending_message_uuid(), GNUNET_MessageHeader::size, PendingMessage::tail_frag, PendingMessage::timeout, GNUNET_MessageHeader::type, and PendingMessage::vl.
Referenced by transmit_on_queue().
|
static |
Reliability-box the given pm.
On error (can there be any), NULL may be returned, otherwise the "replacement" for pm (which should then be added to the respective neighbour's queue instead of pm). If the pm is already fragmented or reliability boxed, or itself an ACK, this function simply returns pm.
queue | which queue to prepare transmission for |
dvh | path the message will take, or NULL |
pm | pending message to box for transmission over unreliabile queue |
Definition at line 10461 of file gnunet-service-transport.c.
References TransportReliabilityBoxMessage::ack_countdown, TransportReliabilityBoxMessage::ack_uuid, PendingAcknowledgement::ack_uuid, PendingMessage::bpm, PendingMessage::bytes_msg, client_send_response(), PendingMessage::frag_parent, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_malloc, GNUNET_MESSAGE_TYPE_TRANSPORT_RELIABILITY_BOX, TransportReliabilityBoxMessage::header, PendingMessage::logging_uuid, logging_uuid_gen, msg, pm, PendingMessage::pmt, PMT_CORE, PMT_DV_BOX, PMT_RELIABILITY_BOX, prepare_pending_acknowledgement(), queue(), set_pending_message_uuid(), GNUNET_MessageHeader::size, size, PendingMessage::timeout, GNUNET_MessageHeader::type, and PendingMessage::vl.
Referenced by transmit_on_queue().
|
static |
Definition at line 10528 of file gnunet-service-transport.c.
References GNUNET_TIME_Absolute::abs_value_us, GNUNET_CONTAINER_MDLL_insert_after, GNUNET_CONTAINER_MDLL_remove, PendingMessage::next_attempt, VirtualLink::pending_msg_head, VirtualLink::pending_msg_tail, pm, PendingMessage::prev_vl, and PendingMessage::vl.
Referenced by update_pm_next_attempt().
|
static |
Definition at line 10552 of file gnunet-service-transport.c.
References check_next_attempt_tree(), PendingMessage::frags_in_flight, PendingMessage::frags_in_flight_round, GNUNET_NO, GNUNET_YES, PendingMessage::next_frag, and pm.
Referenced by check_next_attempt_tree(), and update_pm_next_attempt().
|
static |
Definition at line 10576 of file gnunet-service-transport.c.
References PendingMessage::frags_in_flight_round, harmonize_flight_round(), PendingMessage::next_frag, and pm.
Referenced by harmonize_flight_round(), and update_pm_next_attempt().
|
static |
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.
pm | a pending message to update |
next_attempt | timestamp to use |
Definition at line 10599 of file gnunet-service-transport.c.
References GNUNET_TIME_Absolute::abs_value_us, PendingMessage::bytes_msg, check_next_attempt_tree(), PendingMessage::frag_count, PendingMessage::frag_off, PendingMessage::frag_parent, PendingMessage::frags_in_flight, PendingMessage::frags_in_flight_round, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_STRINGS_absolute_time_to_string(), GNUNET_TIME_absolute_get_remaining(), GNUNET_TIME_relative_add(), GNUNET_TIME_relative_divide(), GNUNET_TIME_relative_multiply_double(), GNUNET_TIME_relative_to_absolute(), GNUNET_YES, harmonize_flight_round(), PendingMessage::logging_uuid, PendingMessage::next_attempt, pm, PendingMessage::pmt, PMT_DV_BOX, PMT_RELIABILITY_BOX, and reorder_root_pm().
Referenced by transmit_on_queue().
|
static |
Select the best pending message from vl for transmission via queue.
[in,out] | sc | best message so far (NULL for none), plus scoring data |
queue | the queue that will be used for transmission | |
vl | the virtual link providing the messages | |
dvh | path we are currently considering, or NULL for none | |
overhead | number of bytes of overhead to be expected from DV encapsulation (0 for without DV) |
Definition at line 10763 of file gnunet-service-transport.c.
References GNUNET_TIME_Absolute::abs_value_us, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MQ_PREF_LOW_LATENCY, GNUNET_MQ_PREF_UNRELIABLE, GNUNET_NO, GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_get_remaining(), GNUNET_TRANSPORT_CC_RELIABLE, GNUNET_YES, PendingMessage::next_vl, VirtualLink::pending_msg_head, PMT_DV_BOX, queue(), and sc.
Referenced by transmit_on_queue().
|
static |
Function to call to further operate on the now DV encapsulated message hdr, forwarding it via next_hop under respect of options.
cls | a struct PendingMessageScoreContext |
next_hop | next hop of the DV path |
hdr | encapsulated message, technically a struct TransportDVBoxMessage |
options | options of the original message |
Definition at line 10939 of file gnunet-service-transport.c.
References PendingMessage::bpm, bsize, PendingMessage::bytes_msg, PendingMessage::frag_parent, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_malloc, PendingMessage::logging_uuid, logging_uuid_gen, Neighbour::pid, pm, PendingMessage::pmt, PMT_DV_BOX, sc, set_pending_message_uuid(), GNUNET_MessageHeader::size, PendingMessage::timeout, and PendingMessage::vl.
Referenced by transmit_on_queue().
|
static |
Queue to a peer went down.
Process the request.
cls | the client |
dqm | the send message that was sent |
Definition at line 11246 of file gnunet-service-transport.c.
References CT_COMMUNICATOR, free_queue(), GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_memcmp, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), Neighbour::pid, GNUNET_TRANSPORT_DelQueueMessage::qid, queue(), GNUNET_TRANSPORT_DelQueueMessage::receiver, and tc.
|
static |
Message was transmitted.
Process the request.
cls | the client |
sma | the send message that was sent |
Definition at line 11376 of file gnunet-service-transport.c.
References CT_COMMUNICATOR, free_queue_entry(), GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_memcmp, GNUNET_ntohll(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_TRANSPORT_SendMessageToAck::mid, qe, GNUNET_TRANSPORT_SendMessageToAck::qid, queue(), GNUNET_TRANSPORT_SendMessageToAck::receiver, and tc.
|
static |
The burst finished.
cls | the client |
Definition at line 11450 of file gnunet-service-transport.c.
References burst_running, and GNUNET_NO.
|
static |
Iterator telling new MONITOR client about all existing queues to peers.
cls | the new struct TransportClient |
pid | a connected peer |
value | the struct Neighbour with more information |
Definition at line 11466 of file gnunet-service-transport.c.
References CT_MONITOR, GNUNET_assert, GNUNET_OK, me, notify_monitor(), pid, q, Neighbour::queue_head, tc, and value.
Referenced by handle_monitor_start().
|
static |
Initialize a monitor client.
cls | the client |
start | the start message that was sent |
Definition at line 11495 of file gnunet-service-transport.c.
References CT_MONITOR, CT_NONE, GNUNET_break, GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SERVICE_client_mark_monitor(), neighbours, notify_client_queues(), start, and tc.
|
static |
Find transport client providing communication service for the protocol prefix.
prefix | communicator name |
Definition at line 11523 of file gnunet-service-transport.c.
References clients_head, CT_COMMUNICATOR, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, prefix, and tc.
Referenced by suggest_to_connect().
|
static |
Check whether any queue to the given neighbour is of a good "quality" and if so, increment the counter.
Also counts the total number of queues, and returns the k-th queue found.
cls | a struct QueueQualityContext * with counters |
pid | peer this is about |
value | a struct Neighbour |
Definition at line 11749 of file gnunet-service-transport.c.
References ctx, DV_QUALITY_RTT_THRESHOLD, GNUNET_NO, GNUNET_OK, GNUNET_YES, pid, q, Neighbour::queue_head, and value.
Referenced by start_dv_learn().
|
static |
Task run when we CONSIDER initiating a DV learn process.
We first check that sending out a message is even possible (queues exist), then that it is desirable (if not, reschedule the task for later), and finally we may then begin the job. If there are too many entries in the dvlearn_map, we purge the oldest entry using lle_tail.
cls | NULL |
Definition at line 11787 of file gnunet-service-transport.c.
References TransportDVLearnMessage::bidirectional, TransportDVLearnMessage::challenge, LearnLaunchEntry::challenge, check_connection_quality(), DV_LEARN_BASE_FREQUENCY, DV_LEARN_QUALITY_THRESHOLD, dvlearn_map, dvlearn_task, GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_DLL_insert, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_CONTAINER_multipeermap_size(), GNUNET_CONTAINER_multishortmap_put(), GNUNET_CONTAINER_multishortmap_remove(), GNUNET_CONTAINER_multishortmap_size(), GNUNET_CRYPTO_eddsa_sign, GNUNET_CRYPTO_QUALITY_NONCE, GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_block(), GNUNET_CRYPTO_random_u32(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_MESSAGE_TYPE_TRANSPORT_DV_LEARN, GNUNET_new, GNUNET_SCHEDULER_add_delayed(), GNUNET_sh2s(), GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_INITIATOR, GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_get_monotonic(), GNUNET_TIME_absolute_hton(), GNUNET_TIME_randomize(), GNUNET_TIME_relative_hton(), GNUNET_TIME_relative_multiply(), GNUNET_TIME_UNIT_ZERO, GNUNET_YES, GST_cfg, GST_my_identity, GST_my_private_key, TransportDVLearnMessage::header, TransportDVLearnMessage::init_sig, TransportDVLearnMessage::initiator, QueueQualityContext::k, LearnLaunchEntry::launch_time, lle_head, lle_tail, MAX_DV_LEARN_PENDING, TransportDVLearnMessage::monotonic_time, neighbours, TransportDVLearnMessage::non_network_delay, TransportDVLearnMessage::num_hops, QueueQualityContext::num_queues, GNUNET_CRYPTO_EccSignaturePurpose::purpose, DvInitPS::purpose, QueueQualityContext::q, QueueQualityContext::quality_count, queue_send_msg(), GNUNET_MessageHeader::size, start_dv_learn(), GNUNET_MessageHeader::type, and GNUNET_CRYPTO_ChallengeNonceP::value.
Referenced by handle_add_queue_message(), and start_dv_learn().
|
static |
A new queue has been created, check if any address validation requests have been waiting for it.
cls | a struct Queue |
pid | peer concerned (unused) |
value | a struct ValidationState |
Definition at line 11925 of file gnunet-service-transport.c.
References get_address_without_port(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_YES, pid, q, validation_transmit_on_queue(), and value.
Referenced by handle_add_queue_message().
|
static |
Function called with the monotonic time of a DV initiator by PEERSTORE.
Updates the time.
cls | a struct Neighbour |
record | the information found, NULL for the last call |
emsg | error message |
Definition at line 11969 of file gnunet-service-transport.c.
References Neighbour::dv_monotime_available, Neighbour::get, GNUNET_break, GNUNET_PEERSTORE_iteration_next(), GNUNET_TIME_absolute_max(), GNUNET_TIME_absolute_ntoh(), GNUNET_YES, Neighbour::last_dv_learn_monotime, and record().
Referenced by handle_add_queue_message().
|
static |
Definition at line 12000 of file gnunet-service-transport.c.
References get_address_without_port(), GNUNET_asprintf(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_NO, GNUNET_strndup, prefix, queue(), and uri.
Referenced by check_for_global_natted().
|
static |
Definition at line 12108 of file gnunet-service-transport.c.
References TransportGlobalNattedAddressClosure::addr, TransportGlobalNattedAddress::address_length, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_YES, TransportGlobalNattedAddressClosure::tgna, and value.
Referenced by check_for_global_natted().
|
static |
Definition at line 12133 of file gnunet-service-transport.c.
References GNUNET_ERROR_TYPE_WARNING, and GNUNET_log.
Referenced by handle_add_queue_message().
|
static |
Definition at line 12141 of file gnunet-service-transport.c.
References GNUNET_ERROR_TYPE_WARNING, and GNUNET_log.
Referenced by handle_add_queue_message().
|
static |
Definition at line 12149 of file gnunet-service-transport.c.
References TransportGlobalNattedAddressClosure::addr, TransportGlobalNattedAddress::address_length, contains_address(), get_address_without_port(), GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CONTAINER_multipeermap_get_multiple(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_CONTAINER_multipeermap_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_HELLO_parser_free(), GNUNET_HELLO_parser_from_msg(), GNUNET_HELLO_parser_iterate(), GNUNET_log, GNUNET_malloc, GNUNET_memcpy, GNUNET_NO, GNUNET_PEERSTORE_monitor_next(), GNUNET_YES, iterate_address_and_compare_cb(), Neighbour::natted_addresses, Neighbour::number_of_addresses, consensus-simulation::parser, Neighbour::pid, queue(), record(), Neighbour::size_of_global_addresses, and TransportGlobalNattedAddressClosure::tgna.
Referenced by handle_add_queue_message().
|
static |
New queue became available.
Process the request.
cls | the client |
aqm | the send message that was sent |
Definition at line 12258 of file gnunet-service-transport.c.
References check_for_global_natted(), check_for_global_natted_error_cb(), check_for_global_natted_sync_cb(), check_validation_request_pending(), GNUNET_TRANSPORT_AddQueueMessage::cs, dvlearn_task, Neighbour::get, get_address_without_port(), GNUNET_assert, GNUNET_break_op, GNUNET_CONTAINER_MDLL_insert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multipeermap_contains(), GNUNET_CONTAINER_multipeermap_create(), GNUNET_CONTAINER_multipeermap_get_multiple(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_malloc, GNUNET_new, GNUNET_ntohll(), GNUNET_OK, GNUNET_PEERSTORE_HELLO_KEY, GNUNET_PEERSTORE_iteration_start(), GNUNET_PEERSTORE_monitor_start(), GNUNET_PEERSTORE_TRANSPORT_DVLEARN_MONOTIME, GNUNET_SCHEDULER_add_now(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SYSERR, GNUNET_TIME_absolute_get_remaining(), GNUNET_TIME_absolute_max(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_TIME_UNIT_ZERO_ABS, GNUNET_TRANSPORT_QUEUE_LENGTH_UNLIMITED, GNUNET_YES, GST_cfg, GNUNET_TRANSPORT_AddQueueMessage::header, lookup_neighbour(), me, GNUNET_TRANSPORT_AddQueueMessage::mtu, Neighbour::natted_addresses, neighbour_dv_monotime_cb(), neighbours, notify_monitors(), GNUNET_TRANSPORT_AddQueueMessage::nt, peerstore, Neighbour::pid, q, GNUNET_TRANSPORT_AddQueueMessage::q_len, GNUNET_TRANSPORT_AddQueueMessage::qid, queue(), Neighbour::queue_head, Neighbour::queue_tail, receiver(), GNUNET_TRANSPORT_AddQueueMessage::receiver, GNUNET_MessageHeader::size, start_address_validation(), start_dv_learn(), tc, and validation_map.
|
static |
Handle updates to queues.
cls | the transport client. |
msg | Message struct. |
Definition at line 12422 of file gnunet-service-transport.c.
References Queue::cs, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_NO, GNUNET_ntohll(), GNUNET_SCHEDULER_PRIORITY_DEFAULT, GNUNET_SERVICE_client_continue(), GNUNET_TIME_UNIT_ZERO, GNUNET_TRANSPORT_QUEUE_LENGTH_UNLIMITED, GNUNET_YES, msg, Queue::mtu, Queue::next_client, Queue::nt, Queue::priority, Queue::q_capacity, Queue::qid, schedule_transmit_on_queue(), tc, and Queue::unlimited_length.
|
static |
Communicator tells us that our request to create a queue "worked", that is setting up the queue is now in process.
cls | the struct TransportClient |
cqr | confirmation message |
Definition at line 12476 of file gnunet-service-transport.c.
References CT_COMMUNICATOR, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_STATISTICS_update(), GST_stats, GNUNET_TRANSPORT_CreateQueueResponse::request_id, and tc.
|
static |
Communicator tells us that our request to create a queue failed.
This usually indicates that the provided address is simply invalid or that the communicator's resources are exhausted.
cls | the struct TransportClient |
cqr | failure message |
Definition at line 12507 of file gnunet-service-transport.c.
References CT_COMMUNICATOR, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_STATISTICS_update(), GST_stats, GNUNET_TRANSPORT_CreateQueueResponse::request_id, and tc.
|
static |
We have received a struct ExpressPreferenceMessage
from an application client.
cls | handle to the client |
msg | the start message |
Definition at line 12538 of file gnunet-service-transport.c.
References CT_APPLICATION, GNUNET_break, GNUNET_CONTAINER_multipeermap_get(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), msg, PeerRequest::pr, stop_peer_request(), and tc.
|
static |
Definition at line 12563 of file gnunet-service-transport.c.
References address, find_queue(), GNUNET_asprintf(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, pid, q, start_address_validation(), suggest_to_connect(), and uri.
Referenced by handle_hello_for_client().
|
static |
Function called by PEERSTORE for each matching record.
cls | closure, a struct PeerRequest |
record | peerstore record information |
emsg | error message, or NULL if no errors |
Definition at line 12606 of file gnunet-service-transport.c.
References GNUNET_ERROR_TYPE_WARNING, GNUNET_HELLO_parser_free(), GNUNET_HELLO_parser_from_msg(), GNUNET_HELLO_parser_iterate(), GNUNET_log, GNUNET_memcmp, GNUNET_PEERSTORE_monitor_next(), GST_my_identity, hello_for_client_cb(), PeerRequest::nc, consensus-simulation::parser, PeerRequest::pr, and record().
Referenced by handle_suggest().
|
static |
Definition at line 12636 of file gnunet-service-transport.c.
References GNUNET_ERROR_TYPE_WARNING, and GNUNET_log.
Referenced by handle_suggest().
|
static |
Definition at line 12644 of file gnunet-service-transport.c.
References GNUNET_ERROR_TYPE_WARNING, and GNUNET_log.
Referenced by handle_suggest().
|
static |
We have received a struct ExpressPreferenceMessage
from an application client.
cls | handle to the client |
msg | the start message |
Definition at line 12659 of file gnunet-service-transport.c.
References CT_APPLICATION, CT_NONE, GNUNET_break, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multipeermap_create(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_new, GNUNET_PEERSTORE_HELLO_KEY, GNUNET_PEERSTORE_monitor_start(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_YES, GST_cfg, handle_hello_for_client(), hello_for_client_error_cb(), hello_for_client_sync_cb(), msg, PeerRequest::pr, and tc.
|
static |
Check GNUNET_MESSAGE_TYPE_TRANSPORT_REQUEST_HELLO_VALIDATION messages.
cls | a struct TransportClient * |
m | message to verify |
Definition at line 12722 of file gnunet-service-transport.c.
References GNUNET_MQ_check_zero_termination, GNUNET_OK, and m.
|
static |
A client encountered an address of another peer.
Consider validating it, and if validation succeeds, persist it to PEERSTORE.
cls | a struct TransportClient * |
m | message to verify |
Definition at line 12739 of file gnunet-service-transport.c.
References find_queue(), GNUNET_SERVICE_client_continue(), m, q, start_address_validation(), suggest_to_connect(), and tc.
|
static |
Free neighbour entry.
cls | NULL |
pid | unused |
value | a struct Neighbour |
Definition at line 12765 of file gnunet-service-transport.c.
References free_neighbour(), GNUNET_break, GNUNET_OK, GNUNET_YES, pid, and value.
Referenced by do_shutdown().
|
static |
Free DV route entry.
cls | NULL |
pid | unused |
value | a struct DistanceVector |
Definition at line 12789 of file gnunet-service-transport.c.
References free_dv_route(), GNUNET_OK, pid, and value.
Referenced by do_shutdown().
|
static |
Free validation state.
cls | NULL |
pid | unused |
value | a struct ValidationState |
Definition at line 12812 of file gnunet-service-transport.c.
References free_validation_state(), GNUNET_OK, pid, and value.
Referenced by do_shutdown().
|
static |
Free pending acknowledgement.
cls | NULL |
key | unused |
value | a struct PendingAcknowledgement |
Definition at line 12834 of file gnunet-service-transport.c.
References free_pending_acknowledgement(), GNUNET_OK, key, and value.
Referenced by do_shutdown().
|
static |
Free acknowledgement cummulator.
cls | NULL |
pid | unused |
value | a struct AcknowledgementCummulator |
Definition at line 12854 of file gnunet-service-transport.c.
References GNUNET_free, GNUNET_OK, GNUNET_SCHEDULER_cancel(), pid, AcknowledgementCummulator::task, and value.
Referenced by do_shutdown().
|
static |
Definition at line 12965 of file gnunet-service-transport.c.
References clients_head, do_shutdown(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_YES, in_shutdown, and tc.
Referenced by run().
|
static |
Initiate transport service.
cls | closure |
c | configuration to use |
service | the initialized service |
Definition at line 12994 of file gnunet-service-transport.c.
References _, ack_cummulators, backtalkers, dv_routes, dvlearn_map, GNUNET_break, GNUNET_CONFIGURATION_get_value_yesno(), GNUNET_CONTAINER_heap_create(), GNUNET_CONTAINER_HEAP_ORDER_MIN, GNUNET_CONTAINER_multihashmap_create(), GNUNET_CONTAINER_multipeermap_create(), GNUNET_CONTAINER_multishortmap_create(), GNUNET_CONTAINER_multiuuidmap_create(), GNUNET_CRYPTO_eddsa_key_create_from_configuration(), GNUNET_CRYPTO_eddsa_key_get_public(), GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_ERROR_TYPE_WARNING, GNUNET_HELLO_builder_new(), GNUNET_i2s_full(), GNUNET_log, GNUNET_NAT_register(), GNUNET_NO, GNUNET_PEERSTORE_connect(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_shutdown(), GNUNET_STATISTICS_create(), GNUNET_SYSERR, GNUNET_TIME_absolute_get_monotonic(), GNUNET_YES, GST_cfg, GST_my_hello, GST_my_identity, GST_my_private_key, GST_stats, hello_mono_time, in_shutdown, links, MAX_DV_LEARN_PENDING, neighbours, nh, peerstore, pending_acks, GNUNET_PeerIdentity::public_key, revalidation_map, service, shutdown_task(), use_burst, validation_heap, and validation_map.
Define "main" method using service macro.
|
static |
Ring buffer for a CORE message we did not deliver to CORE, because of missing virtual link to sender.
Definition at line 2866 of file gnunet-service-transport.c.
Referenced by handle_raw_message(), and send_msg_from_cache().
|
static |
Head of the ring buffer.
Definition at line 2871 of file gnunet-service-transport.c.
Referenced by handle_raw_message(), and send_msg_from_cache().
|
static |
Is the ring buffer filled up to RING_BUFFER_SIZE.
Definition at line 2876 of file gnunet-service-transport.c.
Referenced by handle_raw_message(), and send_msg_from_cache().
|
static |
Ring buffer for a forwarded DVBox message we did not deliver to the next hop, because of missing virtual link that hop.
Definition at line 2881 of file gnunet-service-transport.c.
Referenced by forward_dv_box(), and send_msg_from_cache().
|
static |
Head of the ring buffer.
Definition at line 2886 of file gnunet-service-transport.c.
Referenced by forward_dv_box(), and send_msg_from_cache().
|
static |
Is the ring buffer filled up to RING_BUFFER_SIZE.
Definition at line 2891 of file gnunet-service-transport.c.
Referenced by forward_dv_box(), and send_msg_from_cache().
|
static |
Head of linked list of all clients to this service.
Definition at line 2896 of file gnunet-service-transport.c.
Referenced by client_connect_cb(), client_disconnect_cb(), cores_send_connect_info(), cores_send_disconnect_info(), finish_handling_raw_message(), handle_backchannel_encapsulation(), lookup_communicator(), notify_monitors(), shutdown_task(), and start_burst().
|
static |
Tail of linked list of all clients to this service.
Definition at line 2901 of file gnunet-service-transport.c.
Referenced by client_connect_cb(), and client_disconnect_cb().
|
static |
Statistics handle.
Definition at line 2906 of file gnunet-service-transport.c.
Referenced by backtalker_monotime_cb(), do_shutdown(), finish_handling_raw_message(), free_queue(), free_queue_entry(), handle_backchannel_encapsulation(), handle_client_recv_ok(), handle_client_send(), handle_dv_box(), handle_dv_learn(), handle_flow_control(), handle_queue_create_fail(), handle_queue_create_ok(), handle_reliability_ack(), handle_validation_response(), learn_dv_path(), peerstore_store_validation_cb(), route_control_message_without_fc(), route_via_neighbour(), run(), schedule_transmit_on_queue(), and suggest_to_connect().
|
static |
Configuration handle.
Definition at line 2911 of file gnunet-service-transport.c.
Referenced by consider_sending_fc(), handle_add_queue_message(), handle_suggest(), handle_validation_challenge(), handle_validation_response(), run(), sign_ephemeral(), start_address_validation(), start_dv_learn(), validation_start_cb(), and validation_transmit_on_queue().
|
static |
Our public key.
Definition at line 2916 of file gnunet-service-transport.c.
Referenced by check_dv_box(), check_dv_learn(), encapsulate_for_dv(), forward_dv_learn(), handle_backchannel_encapsulation(), handle_client_start(), handle_communicator_available(), handle_dv_box(), handle_dv_learn(), handle_hello_for_client(), handle_hello_for_incoming(), learn_dv_path(), run(), shc_cont(), and start_dv_learn().
struct GNUNET_HELLO_Builder* GST_my_hello |
Our HELLO.
Definition at line 2921 of file gnunet-service-transport.c.
Referenced by do_shutdown(), run(), and store_pi().
|
static |
Our private key.
Definition at line 2926 of file gnunet-service-transport.c.
Referenced by do_shutdown(), forward_dv_learn(), handle_dv_box(), handle_validation_challenge(), run(), sign_ephemeral(), start_dv_learn(), and store_pi().
|
static |
Map from PIDs to struct Neighbour
entries.
A peer is a neighbour if we have an MQ to it from some communicator.
Definition at line 2932 of file gnunet-service-transport.c.
Referenced by do_shutdown(), free_neighbour(), handle_add_queue_message(), handle_dv_learn(), handle_monitor_start(), lookup_neighbour(), run(), and start_dv_learn().
|
static |
Map from PIDs to struct Backtalker
entries.
A peer is a backtalker if it recently send us backchannel messages.
Definition at line 2938 of file gnunet-service-transport.c.
Referenced by do_shutdown(), free_backtalker(), handle_dv_box(), and run().
|
static |
Map from PIDs to struct AcknowledgementCummulator
s.
Here we track the cumulative ACKs for transmission.
Definition at line 2944 of file gnunet-service-transport.c.
Referenced by cummulative_ack(), destroy_ack_cummulator(), do_shutdown(), and run().
|
static |
Map of pending acknowledgements, mapping struct AcknowledgementUUID
to a struct PendingAcknowledgement
.
Definition at line 2950 of file gnunet-service-transport.c.
Referenced by do_shutdown(), free_pending_acknowledgement(), handle_reliability_ack(), prepare_pending_acknowledgement(), and run().
|
static |
Map from PIDs to struct DistanceVector
entries describing known paths to the peer.
Definition at line 2956 of file gnunet-service-transport.c.
Referenced by do_shutdown(), free_dv_route(), learn_dv_path(), route_control_message_without_fc(), and run().
|
static |
Map from PIDs to struct ValidationState
entries describing addresses we are aware of and their validity state.
Definition at line 2962 of file gnunet-service-transport.c.
Referenced by do_shutdown(), free_validation_state(), handle_add_queue_message(), handle_validation_response(), run(), and start_address_validation().
|
static |
Map from addresses to struct ValidationState
entries describing addresses we are aware of and their validity state.
Definition at line 2968 of file gnunet-service-transport.c.
Referenced by do_shutdown(), free_validation_state(), handle_validation_response(), run(), and validation_transmit_on_queue().
|
static |
Map from PIDs to struct VirtualLink
entries describing links CORE knows to exist.
Definition at line 2974 of file gnunet-service-transport.c.
Referenced by activate_core_visible_dv_path(), do_shutdown(), free_virtual_link(), handle_client_start(), handle_flow_control(), handle_validation_response(), lookup_virtual_link(), and run().
|
static |
Map from challenges to struct LearnLaunchEntry
values.
Definition at line 2979 of file gnunet-service-transport.c.
Referenced by do_shutdown(), run(), and start_dv_learn().
|
static |
Head of a DLL sorted by launch time.
Definition at line 2984 of file gnunet-service-transport.c.
Referenced by do_shutdown(), and start_dv_learn().
|
static |
Tail of a DLL sorted by launch time.
Definition at line 2989 of file gnunet-service-transport.c.
Referenced by do_shutdown(), and start_dv_learn().
|
static |
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.
Definition at line 2996 of file gnunet-service-transport.c.
Referenced by do_shutdown(), run(), update_next_challenge_time(), and validation_start_cb().
struct GNUNET_NAT_Handle* nh |
Handle for connect to the NAT service.
Definition at line 3001 of file gnunet-service-transport.c.
Referenced by do_connect(), do_fail(), do_shutdown(), do_timeout(), GNUNET_NAT_add_global_address(), GNUNET_NAT_AUTO_test_start(), GNUNET_NAT_register(), GNUNET_NAT_request_reversal(), GNUNET_NAT_stun_handle_packet(), GNUNET_NAT_test_address(), GNUNET_NAT_test_start(), GNUNET_NAT_unregister(), handle_address_change_notification(), handle_connection_reversal_request(), handle_flow_control(), mq_error_handler(), reconnect(), and run().
|
static |
Database for peer's HELLOs.
Definition at line 3006 of file gnunet-service-transport.c.
Referenced by do_shutdown(), handle_add_queue_message(), handle_dv_box(), handle_dv_learn(), handle_validation_response(), queue_burst(), run(), shc_cont(), store_pi(), and update_backtalker_monotime().
|
static |
Task run to initiate DV learning.
Definition at line 3011 of file gnunet-service-transport.c.
Referenced by do_shutdown(), handle_add_queue_message(), and start_dv_learn().
|
static |
Task to run address validation.
Definition at line 3016 of file gnunet-service-transport.c.
Referenced by do_shutdown(), update_next_challenge_time(), and validation_start_cb().
|
static |
List of incoming connections where we are trying to get a connection back established.
Length kept in ir_total.
Definition at line 3023 of file gnunet-service-transport.c.
Referenced by do_shutdown(), free_incoming_request(), and handle_validation_challenge().
|
static |
Tail of DLL starting at ir_head.
Definition at line 3028 of file gnunet-service-transport.c.
Referenced by free_incoming_request(), and handle_validation_challenge().
|
static |
Length of the DLL starting at ir_head.
Definition at line 3033 of file gnunet-service-transport.c.
Referenced by do_shutdown(), free_incoming_request(), and handle_validation_challenge().
|
static |
Generator of logging_uuid
in struct PendingMessage
.
Definition at line 3038 of file gnunet-service-transport.c.
Referenced by extract_box_cb(), forward_dv_box(), fragment_message(), handle_client_send(), and reliability_box_message().
|
static |
Is there a burst running?
Definition at line 3043 of file gnunet-service-transport.c.
Referenced by burst_timeout(), handle_burst_finished(), queue_burst(), and start_burst().
|
static |
Monotonic time we use for HELLOs generated at this time.
TODO: we should increase this value from time to time (i.e. whenever a struct AddressListEntry
actually expires), but IF we do this, we must also update all (remaining) addresses in the PEERSTORE at that time! (So for now only increased when the peer is restarted, which hopefully roughly matches whenever our addresses change.)
Definition at line 3053 of file gnunet-service-transport.c.
Referenced by run(), and store_pi().
|
static |
Indication if we have received a shutdown signal and are in the process of cleaning up.
Definition at line 3059 of file gnunet-service-transport.c.
Referenced by client_disconnect_cb(), run(), and shutdown_task().
|
static |
The task to start the burst.
Definition at line 3064 of file gnunet-service-transport.c.
Referenced by queue_burst(), and start_burst().
struct GNUNET_SCHEDULER_Task* burst_timeout_task |
Definition at line 3066 of file gnunet-service-transport.c.
Referenced by start_burst().
enum GNUNET_GenericReturnValue use_burst |
Definition at line 3068 of file gnunet-service-transport.c.
Referenced by queue_burst(), and run().