90#define RING_BUFFER_SIZE 16
95#define MAX_FC_RETRANSMIT_COUNT 1000
102#define MIN_FC_RETRANSMIT_DELAY \
103 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 100)
109#define UNCONFIRMED_LINK_TIMEOUT \
110 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
116#define MAX_CUMMULATIVE_ACKS 64
130#define FC_NO_CHANGE_REPLY_PROBABILITY 8
136#define IN_PACKET_SIZE_WITHOUT_MTU 128
142#define GOODPUT_AGING_SLOTS 4
148#define DEFAULT_WINDOW_SIZE (128 * 1024)
158#define MAX_INCOMING_REQUEST 16
164#define MAX_DV_DISCOVERY_SELECTION 16
174#define RECV_WINDOW_SIZE 4
190#define CORE_FC_STALL_TIMEOUT \
191 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2)
204#define MAX_STALLED_CMCS (4 * RECV_WINDOW_SIZE)
213#define MIN_DV_PATH_LENGTH_FOR_INITIATOR 3
218#define MAX_DV_HOPS_ALLOWED 16
224#define MAX_DV_LEARN_PENDING 64
229#define MAX_DV_PATHS_TO_TARGET 3
237#define PILS_FEED_ADDRESSES_DELAY \
238 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3)
245#define DELAY_WARN_THRESHOLD \
246 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
252#define DV_FORWARD_TIMEOUT \
253 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
258#define DEFAULT_ACK_WAIT_DURATION \
259 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
266#define DV_QUALITY_RTT_THRESHOLD \
267 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
273#define DV_PATH_VALIDITY_TIMEOUT \
274 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
280#define BACKCHANNEL_INACTIVITY_TIMEOUT \
281 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
287#define DV_PATH_DISCOVERY_FREQUENCY \
288 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4)
293#define EPHEMERAL_VALIDITY \
294 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
299#define REASSEMBLY_EXPIRATION \
300 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4)
308#define MAX_REASSEMBLY_CONTEXTS 32
314#define FAST_VALIDATION_CHALLENGE_FREQ \
315 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1)
320#define MAX_VALIDATION_CHALLENGE_FREQ \
321 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_DAYS, 1)
328#define ACK_CUMMULATOR_TIMEOUT \
329 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
335#define DV_LEARN_BASE_FREQUENCY GNUNET_TIME_UNIT_MINUTES
341#define DV_LEARN_QUALITY_THRESHOLD 100
346#define MAX_ADDRESS_VALID_UNTIL \
347 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MONTHS, 1)
352#define ADDRESS_VALIDATION_LIFETIME \
353 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
371#define NEIGHBOUR_LIVENESS_TIMEOUT \
372 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 15)
402#define FC_KEEPALIVE_INTERVAL \
403 GNUNET_TIME_relative_divide (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, \
412#define MIN_DELAY_ADDRESS_VALIDATION GNUNET_TIME_UNIT_MILLISECONDS
420#define VALIDATION_RTT_BUFFER_FACTOR 3
428#define COMMUNICATOR_TOTAL_QUEUE_LIMIT 512
435#define QUEUE_LENGTH_LIMIT 32
440#define QUEUE_ENTRY_TIMEOUT \
441 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
448 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
456#define SHUTDOWN_CLIENT_GRACE_PERIOD \
457 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
3001 uint32_t last_window_consum_limit;
3289 "No private key for our peer identity, cannot sign\n");
3291 "# signatures failed (no private key)",
3430 "free_pending_acknowledgement\n");
3439 "remove pa from message\n");
3441 "remove pa from message %" PRIu64
"\n",
3444 "remove pa from message %u\n",
3447 "remove pa from message %s\n",
3478 while (NULL != (frag = root->
head_frag))
3483 while (NULL != (pa = frag->
pa_head))
3489 if (NULL != frag->
qe)
3492 frag->
qe->
pm = NULL;
3522 tc->details.core.pending_msg_head,
3523 tc->details.core.pending_msg_tail,
3529 "Removing pm %" PRIu64
"\n",
3545 while (NULL != (pa = pm->
pa_head))
3549 "free pending pa null\n");
3552 "free pending pa_tail null\n");
3555 "free pending pa prev null\n");
3558 "free pending pa next null\n");
3569 if (NULL != pm->
bpm)
3572 if (NULL != pm->
bpm->
qe)
3583 "Freeing pm done\n");
3664 unsigned int free_cmc);
3716 so_msg->
peer = *pid;
3756 "free virtual link %p\n",
3763 while (NULL != (cmc = vl->
cmc_head))
3809 while (NULL != (csc = vl->
csc_head))
3848 if (NULL != vs->revalidation_task)
3851 vs->revalidation_task = NULL;
3857 "Remove key %s for address %s map size %u contains %u during freeing state\n",
3986 "Informing CORE clients about disconnect from %s\n",
4064 if (NULL != (vl =
dv->
vl))
4112 size_t addr_len = strlen (
address) + 1;
4117 md->
nt = htonl ((uint32_t)
nt);
4123 md->
cs = htonl ((uint32_t)
me->cs);
4126 memcpy (&md[1],
address, addr_len);
4150 if (
tc->details.monitor.one_shot)
4182 "Client %p of type %u connected\n",
4222 "Freeing neighbour\n");
4227 while (NULL != (dvh = neighbour->
dv_head))
4235 if (NULL != neighbour->
get)
4238 neighbour->
get = NULL;
4240 if (NULL != neighbour->
sc)
4245 neighbour->
sc = NULL;
4247 if (NULL != (
vl = neighbour->
vl))
4260 neighbour->
vl = NULL;
4295 "Informing CORE clients about connection to %s\n",
4326 if (s->tc->details.communicator.address_prefix !=
4327 queue->tc->details.communicator.address_prefix)
4330 "queue address %s qid %u compare with queue: address %s qid %u\n",
4335 if ((s->priority >
queue->priority) && (0 < s->q_capacity) &&
4373 queue->tc->details.communicator.
4377 if (
queue->tc->details.communicator.total_queue_length >=
4381 "Transmission on queue %s (QID %u) throttled due to communicator queue limit\n",
4386 "# Transmission throttled due to communicator queue limit",
4406 "Transmission on queue %s (QID %u) throttled due to communicator queue length limit\n",
4410 "# Transmission throttled due to queue queue limit",
4418 if (0 ==
queue->q_capacity)
4421 "Transmission on queue %s (QID %u) throttled due to communicator message has capacity %"
4427 "# Transmission throttled due to message queue capacity",
4434 if (NULL !=
queue->transmit_task)
4436 queue->transmit_task =
4440 "Considering transmission on queue `%s' QID %llu to %s\n",
4442 (
unsigned long long)
queue->qid,
4468 "Checking if link is down\n");
4476 pos->path_valid_until);
4507 "Neighbour %s was silent for %s while its communicator "
4508 "kept claiming the queue works; treating link as down\n",
4514 "# links dropped (neighbour silent)",
4518 q_timeout = liveness_deadline;
4526 if ((NULL == vl->
n) && (NULL == vl->
dv))
4568 "Cleaning up queue %u\n",
queue->qid);
4569 if (NULL !=
queue->mo)
4574 if (NULL !=
queue->transmit_task)
4577 queue->transmit_task = NULL;
4579 while (NULL != (pa =
queue->pa_head))
4590 tc->details.communicator.queue_head,
4591 tc->details.communicator.queue_tail,
4594 tc->details.communicator.total_queue_length);
4596 "Cleaning up queue with length %u\n",
4597 queue->queue_length);
4598 while (NULL != (
qe =
queue->queue_head))
4601 queue->queue_length--;
4602 tc->details.communicator.total_queue_length--;
4612 tc->details.communicator.total_queue_length))
4617 "# Transmission throttled due to communicator queue limit",
4620 for (
struct Queue *s =
tc->details.communicator.queue_head; NULL != s;
4630 if ((NULL != vl) && (neighbour == vl->
n))
4664 tc->details.communicator.addr_tail,
4669 if (NULL != ale->
sc)
4676 if (NULL != ale->
shc)
4681 if (NULL != ale->
st)
4747 "Unknown Client %p disconnected, cleaning up.\n",
4754 "CORE Client %p disconnected, cleaning up.\n",
4758 while (NULL != (pm =
tc->details.core.pending_msg_head))
4761 tc->details.core.pending_msg_head,
4762 tc->details.core.pending_msg_tail,
4771 "MONITOR Client %p disconnected, cleaning up.\n",
4781 "COMMUNICATOR Client %p disconnected, cleaning up.\n",
4784 if (NULL !=
tc->details.communicator.free_queue_entry_task)
4786 tc->details.communicator.free_queue_entry_task);
4787 while (NULL != (
q =
tc->details.communicator.queue_head))
4789 while (NULL != (ale =
tc->details.communicator.addr_head))
4797 "APPLICATION Client %p disconnected, cleaning up.\n",
4810 "Our last client disconnected\n");
4837 "Telling new CORE client about existing connection to %s\n",
4863 while (NULL != (cmc = vl->
cmc_tail))
4919 "New CORE client with PID %s registered\n",
4979 "client send response\n");
4983 "Confirming transmission of <%" PRIu64
"> to %s\n",
5005 unsigned int hops_array_length)
5007 uint64_t choices[hops_array_length];
5009 unsigned int dv_count;
5027 if (dv_count <= hops_array_length)
5032 hops_array[dv_count++] = pos;
5035 for (
unsigned int i = 0; i < hops_array_length; i++)
5043 for (
unsigned int j = 0; j < i; j++)
5044 if (choices[i] == choices[j])
5062 for (
unsigned int i = 0; i < hops_array_length; i++)
5063 if ((num_dv <= choices[i]) && (num_dv +
delta > choices[i]))
5064 hops_array[dv_count++] = pos;
5119 if (0 == ntohl (cmc->
im.
fc_on))
5122 "Acknowledge message with flow control id %" PRIu64
"\n",
5219 "# RECV_OK dropped: virtual link unknown",
5228 "CORE ack receiving message, increased CORE recv window to %d\n",
5234 while (NULL != (cmc = vl->
cmc_tail))
5263 "Receive-only communicator connected\n");
5271 tc->details.communicator.address_prefix =
5273 tc->details.communicator.cc = ntohl (cam->
cc);
5274 tc->details.communicator.can_burst = ntohl (cam->
can_burst);
5279 "Communicator for peer %s with prefix '%s' connected %s\n",
5281 tc->details.communicator.address_prefix,
5282 tc->details.communicator.can_burst ?
"can burst" :
5288 "Communicator for local peer with prefix '%s' connected %s\n",
5289 tc->details.communicator.address_prefix,
5290 tc->details.communicator.can_burst ?
"can burst" :
5315 msize = ntohs (cb->
header.
size) -
sizeof(*cb);
5323 isize = ntohs (inbox->
size);
5329 is = (
const char *) inbox;
5333 if (
'\0' !=
is[msize - 1])
5385 "freeing timedout queue entries\n");
5387 tc->details.communicator.free_queue_entry_task = NULL;
5394 "checking QID %u for timedout queue entries\n",
5404 "diff to now %s \n",
5409 "Freeing timed out QueueEntry with MID %" PRIu64
5414 "# QueueEntries timed out",
5434 if (NULL !=
tc->details.communicator.free_queue_entry_task)
5439 if (NULL ==
queue->queue_head)
5441 tc->details.communicator.free_queue_entry_task =
5463 size_t payload_size)
5472 "Queueing %u bytes of payload for transmission <%" PRIu64
5473 "> on queue %llu to %s\n",
5474 (
unsigned int) payload_size,
5476 (
unsigned long long)
queue->qid,
5484 memcpy (&smt[1],
payload, payload_size);
5493 "Create QueueEntry with MID %" PRIu64
5494 " and QID %u and prefix %s\n",
5497 queue->tc->details.communicator.address_prefix);
5508 "Retransmitting message <%" PRIu64
5509 "> remove pm from qe with MID: %llu \n",
5511 (
unsigned long long)
pm->
qe->
mid);
5517 if (0 ==
queue->q_capacity)
5524 " (pm type %u) was not send because queue has no capacity.\n",
5534 queue->queue_length++;
5535 queue->tc->details.communicator.total_queue_length++;
5537 queue->q_capacity--;
5539 "Queue %s with qid %u has capacity %" PRIu64
"\n",
5544 queue->tc->details.communicator.total_queue_length)
5548 if (0 ==
queue->q_capacity)
5555 while (
pm != pa->
pm)
5561 "Sending message MID %" PRIu64
5562 " of type %u (%u) and size %lu with MQ %p queue %s (QID %u) pending %"
5567 (
unsigned long) payload_size,
5593 unsigned int candidates;
5605 for (
struct Queue *pos = n->queue_head; NULL != pos;
5606 pos = pos->next_neighbour)
5609 (pos->validated_until.abs_value_us > now.
abs_value_us))
5612 if (0 == candidates)
5617 "Could not route message of type %u to %s: no valid queue\n",
5621 "# route selection failed (all no valid queue)",
5634 for (
struct Queue *pos = n->queue_head; NULL != pos;
5635 pos = pos->next_neighbour)
5638 (pos->validated_until.abs_value_us > now.
abs_value_us))
5640 if ((sel1 == candidates) || (sel2 == candidates))
5643 "Routing message of type %u to %s using %s (#%u)\n",
5647 (sel1 == candidates) ? 1 : 2);
5689 unsigned int num_dvhs,
5700 uint16_t body_len_hbo = ntohs (hdr->
size);
5713 memset (&box_hdr, 0,
sizeof (box_hdr));
5720 || (NULL == dv->km))
5746 memcpy (&payload_hdr[1], hdr, body_len_hbo);
5748 sizeof(box_hdr.
iv));
5762 for (
unsigned int i = 0; i < num_dvhs; i++)
5765 unsigned int num_hops = dvh->
distance + 1;
5773 box_hdr.
orig_size = htons (
sizeof(buf));
5774 box_hdr.
num_hops = htons (num_hops);
5775 memcpy (buf, &box_hdr,
sizeof(box_hdr));
5786 for (
unsigned int j = 0; j < num_hops; j++)
5795 "Routing message of type %u to %s using DV (#%u/%u) via %s\n",
5804 memcpy (&dhops[num_hops], ct,
sizeof(ct));
5859 "Trying to route message of type %u to %s without fc\n",
5883 if ((NULL == n) && (NULL == dv))
5886 "Cannot route message of type %u to %s: no route\n",
5890 "# Messages dropped in routing: no acceptable method",
5896 "Routing message of type %u to %s with options %X\n",
5909 if ((NULL != n) && (NULL != dv))
5917 "Try to route message of type %u to %s without fc via neighbour\n",
5934 "Failed to route message, could not determine DV path\n");
5938 "encapsulate_for_dv 1\n");
5996 char *addr = (
char *) &tgna[1];
6003 "sending address %.*s length %lu\n",
6006 (
unsigned long) alen);
6007 if (
ctx->off + need >
ctx->size)
6039 size_t addresses_size;
6056 "Not sending FC to %s: link unconfirmed and no route\n",
6070 ->size_of_global_addresses;
6071 if (addresses_size >
6080 if (0 != addresses_size)
6122 "Sending FC seq %u to %s with new window %llu %lu %u\n",
6156 "FC retransmission to %s failed, will retry in %s\n",
6179 for (
unsigned int i = 0;
6219 "check_vl_transmission to target %s\n",
6228 "check_vl_transmission loop\n");
6235 "Stalled message %" PRIu64
6236 " transmission on VL %s due to flow control: %llu < %llu\n",
6240 (
unsigned long long) (pm->bytes_msg
6246 "Target window on VL %s not stalled. Scheduling transmission on queue\n",
6259 "Direct neighbour %s not stalled\n",
6268 "Neighbour Queue QID: %u (%u) busy or invalid\n",
6281 struct Neighbour *nh_iter = pos->next_hop;
6284 if (pos->path_valid_until.abs_value_us <= now.
abs_value_us)
6292 if ((NULL != vl_next_hop) &&
6297 "Stalled message %" PRIu64
6298 " transmission on next hop %s due to flow control: %llu < %llu\n",
6303 (
unsigned long long) (pm->bytes_msg
6305 outbound_fc_window_size_used));
6315 "Next hop neighbour %s not stalled\n",
6324 "DV Queue QID: %u (%u) busy or invalid\n",
6332 "Eligible message %" PRIu64
" of size %u to %s: %llu/%llu\n",
6337 (
unsigned long long) (pm->bytes_msg
6362 bytes_msg = ntohs (obmm->
size);
6368 "Don't have %s as a neighbour (anymore).\n",
6387 "# messages dropped (neighbour unknown)",
6395 "1 created pm %p storing vl %p\n",
6403 memcpy (&pm[1], obmm, bytes_msg);
6405 "Sending message of type %u with %u bytes as <%" PRIu64
6412 tc->details.core.pending_msg_head,
6413 tc->details.core.pending_msg_tail,
6443 uint16_t isize = ntohs (inbox->
size);
6444 const char *
is = ((
const char *) &cb[1]) + isize;
6445 size_t slen = strlen (
is) + 1;
6456 "Preparing backchannel transmission to %s:%s of type %u and size %u\n",
6459 ntohs (inbox->
type),
6460 ntohs (inbox->
size));
6465 memcpy (&be[1], inbox, isize);
6562 if (NULL !=
ale->
sc)
6572 if (NULL !=
pc->req)
6574 if (NULL !=
pc->req->op)
6594 pc->ale->shc = NULL;
6599 "Failed to store our address `%s' with peerstore\n",
6601 if (NULL ==
pc->ale->st)
6660 "Failed to store our own address `%s' in peerstore!\n",
6664 "Successfully stored our own address `%s' in peerstore!\n",
6668 if (NULL ==
pc->ale->st)
6715 (
unsigned long long)
pc->et.abs_value_us,
6716 (
unsigned int)
pc->ale->nt,
6721 "Build our HELLO URI `%s'\n",
6726 pc->ale->signed_address_len = result_size;
6804 if (NULL == ale->
st)
6833 unsigned int add_success;
6852 dash = strchr (ale->
address,
'-');
6862 "Storing our address `%s' in peerstore until %s!\n",
6882 "Not storing our address `%s': not a valid HELLO URI\n",
6889 "%s our address `%s' in PEERSTORE\n",
6890 (
GNUNET_NO == add_success) ?
"Refreshing" :
"Storing",
6909 char *address_without_port;
6913 ale->
address = (
const char *) &ale[1];
6917 memcpy (&ale[1],
address, slen);
6920 "Is this %s a local address (%s)\n",
6921 (NULL == address_without_port) ?
"<unparsable>"
6922 : address_without_port,
6924 if ((NULL == address_without_port) ||
6925 (0 != strcmp (
"127.0.0.1", address_without_port)))
6927 if (NULL != ale->
st)
6944 "Feeding addresses to PILS\n");
6969 "Communicator added address `%s'!\n",
6970 (
const char *) &aam[1]);
6971 slen = ntohs (aam->
header.
size) -
sizeof(*aam);
6973 memcpy (
address, &aam[1], slen);
6981 tc->details.communicator.addr_tail,
6989 const char *dash = strchr (iter->address,
'-');
7036 if (dam->
aid != ale->aid)
7040 "Communicator deleted address `%s'!\n",
7054 "Communicator removed address we did not even have.\n");
7128 "CORE did not acknowledge messages from %s within %s; "
7129 "releasing the flow control credit anyway\n",
7134 "# CORE flow control stalls",
7137 while (NULL != (cmc = vl->
cmc_tail))
7148 unsigned int free_cmc)
7150 uint16_t
size = ntohs (
mh->size);
7156 "# CORE messages dropped (FC arithmetic overflow)",
7160 "CORE messages of type %u with %u bytes dropped (FC arithmetic overflow)\n",
7161 (
unsigned int) ntohs (
mh->type),
7162 (
unsigned int) ntohs (
mh->size));
7170 "# CORE messages dropped (FC window overflow)",
7174 "CORE messages of type %u with %u bytes dropped (FC window overflow)\n",
7175 (
unsigned int) ntohs (
mh->type),
7176 (
unsigned int) ntohs (
mh->size));
7202 memcpy (&im[1],
mh,
size);
7209 "Dropped message to CORE: no CORE client connected!\n");
7215 "Dropped message of type %u with %u bytes to CORE: no CORE client connected!\n",
7216 (
unsigned int) ntohs (
mh->type),
7217 (
unsigned int) ntohs (
mh->size));
7223 "Delivered message from %s of type %u to CORE recv window %d\n",
7248 while (MAX_STALLED_CMCS < vl->cmc_count)
7277 uint16_t
size = ntohs (
mh->size);
7280 "Handling raw message of type %u with %u bytes\n",
7281 (
unsigned int) ntohs (
mh->type),
7282 (
unsigned int) ntohs (
mh->size));
7294 "# CORE messages dropped (bad size)",
7331 "Storing message for %s and type %u (%u) in ring buffer head %u is full %u\n",
7333 (
unsigned int) ntohs (
mh->type),
7334 (
unsigned int) ntohs (mh_copy->
type),
7346 "%u items stored in ring buffer\n",
7443 "Sending ACK with %u components to %s\n",
7453 for (
unsigned int i = 0; i < ac->
num_acks; i++)
7504 "Scheduling ACK %s for transmission to %s\n",
7623 "No virtual link for %s to handle fragment\n",
7626 "# fragments dropped (virtual link down)",
7649 fsize = ntohs (fb->
header.
size) -
sizeof(*fb);
7650 if (NULL == (
rc = fc.
rc))
7662 "# Reassembly contexts dropped (limit reached)",
7668 + (msize + 7) / 8 *
sizeof(uint8_t) );
7684 target = (
char *) &rc[1];
7692 "Received fragment with size %u at offset %u/%u %u bytes missing from %s for NEW message %"
7703 target = (
char *) &rc[1];
7705 "Received fragment at offset %u/%u from %s for message %u\n",
7726 if (frag_off + fsize > msize)
7733 memcpy (&target[frag_off], &fb[1], fsize);
7735 for (
unsigned int i = frag_off; i < frag_off + fsize; i++)
7737 if (0 == (rc->
bitfield[i / 8] & (1 << (i % 8))))
7739 rc->
bitfield[i / 8] |= (1 << (i % 8));
7770 "Fragment reassembly complete for message %u\n",
7782 memcpy (rbuf,
msg, rsize);
7806 "check_send_msg with size %u: inner msg type %u and size %u (%lu %lu)\n",
7834 "Received reliability box from %s with UUID %s of type %u\n",
7837 (
unsigned int) ntohs (inbox->
type));
7895 uint16_t bytes_transmitted_ok)
7899 unsigned int age =
get_age ();
7921 uint16_t bytes_transmitted_ok)
7937 uint16_t bytes_transmitted_ok)
7956 "Complete transmission of message %" PRIu64
" %u\n",
7973 "pos frag_off %lu pos bytes_msg %lu pmt %u parent %u\n",
8010 "Completed transmission of message %" PRIu64
" (DV Box)\n",
8062 unsigned int n_acks;
8065 n_acks = (ntohs (ra->
header.
size) -
sizeof(*ra))
8072 if ((ntohs (ra->
header.
size) -
sizeof(*ra)) !=
8095 unsigned int n_acks;
8096 uint32_t ack_counter;
8098 n_acks = (ntohs (ra->
header.
size) -
sizeof(*ra))
8101 for (
unsigned int i = 0; i < n_acks; i++)
8108 "Received ACK from %s with UUID %s which is unknown to us!\n",
8113 "# FRAGMENT_ACKS dropped, no matching pending message",
8119 "Received ACK from %s with UUID %s\n",
8165 isize = ntohs (inbox->
size);
8166 is = ((
const char *) inbox) + isize;
8168 if (
'\0' !=
is[
size - 1])
8197 uint16_t isize = ntohs (inbox->
size);
8198 const char *target_communicator = ((
const char *) inbox) + isize;
8215 (NULL !=
tc->details.communicator.address_prefix) &&
8217 strcmp (
tc->details.communicator.address_prefix, target_communicator)))
8225 "# Backchannel message dropped: target communicator `%s' unknown",
8226 target_communicator);
8236 "Delivering backchannel message from %s to %s of type %u to %s\n",
8239 ntohs (inbox->
type),
8240 target_communicator);
8246 memcpy (&cbi[1], inbox, isize);
8307 "Sending from ring buffer, which has %u items\n",
8311 for (
unsigned int i = 0; i < head; i++)
8320 "Sending message of type %u to ring buffer target %s using vl target %s index %u\n",
8328 "Finish handling message of type %u and size %u\n",
8329 (
unsigned int) ntohs (
mh->type),
8330 (
unsigned int) ntohs (
mh->size));
8353 "ring_buffer[i]->mh->type for i %u %u\n",
8362 "%u items still in ring buffer\n",
8385 "Sending from ring buffer dv, which has %u items\n",
8389 for (
unsigned int i = 0; i < head; i++)
8394 "Sending to ring buffer target %s using vl target %s\n",
8400 "Adding PendingMessage to vl, checking transmission.\n");
8430 "%u items still in ring buffer dv.\n",
8459 "Creating new virtual link %p to %s using DV!\n",
8510 "Virtual link to %s could now also use DV!\n",
8543 unsigned int path_len,
8551 unsigned int shorter_distance;
8565 if (NULL == next_hop)
8571 for (
unsigned int i = 2; i < path_len; i++)
8582 "remaining %lu to %s\n",
8592 "Path of %u hops useless: directly link to hop %u (%s)\n",
8597 "# Useless DV path ignored: hop is neighbour",
8608 dv->
target = path[path_len - 1];
8620 shorter_distance = 0;
8624 if (pos->distance < path_len - 3)
8629 if ((pos->distance == path_len - 3) && (pos->next_hop == next_hop))
8633 for (
unsigned int i = 0; i < pos->distance; i++)
8647 "# Known DV path refreshed",
8653 pos->path_valid_until =
8668 "Rediscovered path too quickly, not forwarding further\n")
8673 "Refreshed known path to %s valid until %s, forwarding further\n",
8676 pos->path_valid_until));
8687 "Have many shorter DV paths %s, not forwarding further\n",
8693 "Discovered new DV path to %s valid until %s\n",
8731 uint16_t num_hops = ntohs (dvl->
num_hops);
8749 for (
unsigned int i = 0; i < num_hops; i++)
8780 uint16_t bi_history,
8805 memset (fwd_buf, 0, fwd_size);
8809 "Forwarding DV learn message originating from %s to %s\n",
8820 msg->non_network_delay));
8836 .purpose.size = htonl (
sizeof(dhp)),
8837 .pred = (0 == nhops) ?
msg->initiator : dhops[nhops - 1].
hop,
8839 .challenge =
msg->challenge
8881 .purpose.size = htonl (
sizeof(ip)),
8882 .monotonic_time = sender_monotonic_time,
8964 for (
unsigned int i = 0; i < nsc->
nhops; i++)
8991 "transmission %s\n",
8996 for (
unsigned int i = 0; i < nsc->
nhops; i++)
9063 unsigned int neighbour_count,
9064 unsigned int eligible_count)
9066 double target_total = 50.0;
9067 double eligible_ratio =
9068 ((double) eligible_count) / ((double) neighbour_count);
9069 double boost_factor = eligible_ratio * eligible_ratio;
9073 if (hops_taken >= 64)
9078 for (
unsigned int i = 1; i < hops_taken; i++)
9082 target_total -= (target_total * boost_factor / (1LLU << i));
9085 double degree = target_total * boost_factor / (1LLU << hops_taken);
9087 rnd = (
unsigned int) floor (degree);
9092 left = degree - (double) rnd;
9094 if (UINT32_MAX * left >
9098 "Forwarding DV learn message of %u hops %u(/%u/%u) times\n",
9121 "Failed to store other peer's monotonic time in peerstore!\n");
9131 uint16_t nhops = ntohs (dvl->num_hops);;
9139 dvl->monotonic_time));
9145 "# DV learn with implausible non-network delay",
9157 return network_latency;
9175 uint16_t bi_history;
9208 "handle dv learn message last hop %s\n",
9236 "DV learn from %s discarded due to time travel",
9239 "# DV learn discarded due to time travel",
9250 "DV learn signature from %s invalid\n",
9283 for (
unsigned int i = 0; i < nhops; i++)
9287 .purpose.size = htonl (
sizeof(dhp)),
9297 &hops[i].hop.public_key))
9300 "DV learn from %s signature of hop %u invalid\n",
9304 "signature of hop %s invalid\n",
9324 for (
unsigned int i = 0; i < nhops; i++)
9331 (bi_history & (1 << (nhops - i))) ?
"<->" :
"-->",
9337 "Received DVInit via %s%s%s\n",
9339 bi_hop ?
"<->" :
"-->",
9351 path[1] = hops[0].
hop;
9355 for (
unsigned int i = 2; i <= nhops; i++)
9361 path[i] = hops[i - 1].
hop;
9363 "Learned path with %u hops to %s with latency %s\n",
9385 path[1] = hops[nhops - 1].
hop;
9386 for (
unsigned int i = 0; i < nhops; i++)
9390 if (0 == (bi_history & (1 << i)))
9398 path[i + 2] = hops[nhops - i - 2].
hop;
9402 "Learned inverse path with %u hops to %s\n",
9419 "# DV learn not forwarded due invalidity of path",
9425 if ((
GNUNET_NO == iret) && (nhops == i + 1))
9430 "# DV learn not forwarded, got better paths",
9445 bi_history = (bi_history << 1) | (bi_hop ? 1 : 0);
9453 "Sending DVL back to initiator %s\n",
9468 unsigned int n_eligible;
9487 "Forwarding DVL to %u other peers\n",
9517 uint16_t num_hops = ntohs (dvb->
num_hops);
9518 uint16_t total_hops = ntohs (dvb->
total_hops);
9519 uint16_t orig_size = ntohs (dvb->
orig_size);
9541 if ((orig_size <
size) ||
9542 (orig_size <
sizeof(*dvb)
9555 for (
unsigned int i = 0; i < num_hops; i++)
9580 uint16_t total_hops,
9583 const void *enc_payload,
9584 uint16_t enc_payload_size)
9598 memcpy (msg_buf, hdr,
sizeof(*hdr));
9603 memcpy (&dhops[num_hops], enc_payload, enc_payload_size);
9608 "Forwarding control message (payload size %u) in DV Box to next hop %s (%u/%u) \n",
9611 (
unsigned int) num_hops,
9612 (
unsigned int) total_hops);
9621 "2 created pm %p storing vl %p \n",
9631 buf = (
char *) &pm[1];
9632 memcpy (buf, msg_buf, msg_size);
9635 "Created pending message %" PRIu64
9636 " for DV Box with next hop %s (%u/%u)\n",
9639 (
unsigned int) num_hops,
9640 (
unsigned int) total_hops);
9654 "The virtual link is not ready for forwarding a DV Box with payload, storing PendingMessage in ring buffer.\n");
9672 "%u items stored in DV ring buffer\n",
9696 if (NULL != b->
task)
9709 "Removing backtalker for %s\n",
9751 "backtalker timeout.\n");
9807 if (
sizeof(*mtbe) !=
record->value_size)
9818 "Backtalker message from %s dropped, monotime in the past\n",
9822 "# Backchannel messages dropped: monotonic time not increasing",
9849 "Failed to store backtalker's monotonic time in PEERSTORE!\n");
9888 "Superseding in-flight backtalker monotime store %p\n",
9921 const unsigned char *hdr;
9931 hdr = (
const unsigned char *) &dvb[1];
9935 if (
size <
sizeof(*dvb)
9943 hdr_len =
size -
sizeof(*dvb);
9952 unsigned char *body;
9956 body = &pt[
sizeof *ppay];
9969 "Error decrypting DV payload header\n");
9977 if (ntohs (
mh->size) != hdr_len -
sizeof(*ppay))
9984 switch (ntohs (
mh->type))
10002 "Decrypted backtalk from %s\n",
10010 "# Backchannel messages dropped: monotonic time not increasing",
10047 "DVBox received for me from %s via %s\n",
10068 b->
body_size = hdr_len -
sizeof(*ppay);
10069 memcpy (&b[1], body, hdr_len -
sizeof(*ppay));
10104 uint16_t num_hops = ntohs (dvb->
num_hops);
10107 const char *enc_payload = (
const char *) &hops[num_hops];
10108 uint16_t enc_payload_size =
10120 for (
unsigned int i = 0; i < num_hops; i++)
10129 "Received DVBox with remaining path %s\n",
10138 for (
int i = num_hops - 1; i >= 0; i--)
10152 "Skipping %u/%u hops ahead while routing DV Box\n",
10166 "# DV hops skipped routing boxes",
10170 "# DV boxes routed (total)",
10178 "# DV Boxes dropped: next hop unknown",
10186 "# DV boxes opened (ultimate target)",
10272 if (0 != strcmp (vs->address, ckac->
address))
10308 if ((new_time.
abs_value_us == vs->next_challenge.abs_value_us) &&
10312 vs->next_challenge = new_time;
10313 if (NULL == vs->hn)
10370 vs->challenge_backoff =
10373 vs->challenge_backoff,
10376 vs->first_challenge_use = now;
10379 vs->challenge_backoff));
10403 if (NULL != (
vs = ckac.
vs))
10419 vs->challenge_backoff =
10422 vs->challenge_backoff,
10433 vs->first_challenge_use = now;
10436 vs->challenge_backoff));
10444 vs->first_challenge_use = now;
10447 sizeof(vs->challenge));
10462 "Starting address validation `%s' of peer %s using challenge %s\n",
10476static struct Queue *
10497 pfx_len = eou -
uri;
10506 "helo for client %s\n",
10547 (NULL ==
record->value) ||
10548 (
record->value_size <
sizeof(*hello)))
10554 if (ntohs (hello->
size) >
record->value_size)
10583 "Got failure from PEERSTORE: %s\n",
10620 if (NULL != parser)
10636 "Error in PEERSTORE monitoring\n");
10644 "Done with initial PEERSTORE iteration during monitoring\n");
10795 "Received address validation challenge %s\n",
10807 tvr.validity_duration = validity_duration;
10812 .purpose.size = htonl (
sizeof(tvp)),
10886 "# Peerstore failed to store foreign address",
10899static struct Queue *
10908 pos = pos->next_neighbour)
10910 if (0 == strcmp (pos->address,
address))
10932static struct Queue *
10945 if ((NULL ==
prefix) || (NULL == ip))
10952 pos = pos->next_neighbour)
10958 if ((NULL != q_prefix) && (NULL != q_ip) &&
10959 (0 == strcmp (q_prefix,
prefix)) &&
10960 (0 == strcmp (q_ip, ip)))
10983 vs->revalidation_task = NULL;
11005 "Key in revalidate map %s \n",
11040 if (NULL == (vs = ckac.
vs))
11045 "# Validations dropped, challenge unknown",
11049 "Validation response %s dropped, challenge unknown\n",
11057 if ((origin_time.
abs_value_us < vs->first_challenge_use.abs_value_us) ||
11058 (origin_time.
abs_value_us > vs->last_challenge_use.abs_value_us))
11061 "Diff first use %" PRIu64
" and last use %" PRIu64
"\n",
11062 vs->first_challenge_use.abs_value_us - origin_time.
abs_value_us,
11063 origin_time.
abs_value_us - vs->last_challenge_use.abs_value_us);
11073 .purpose.size = htonl (
sizeof(tvp)),
11074 .validity_duration = tvr->validity_duration,
11095 tvr->validity_duration),
11104 sizeof(vs->challenge));
11112 "First challenge use is now %" PRIu64
" %s \n",
11113 vs->first_challenge_use.abs_value_us,
11115 vs->first_challenge_use = now;
11119 "First challenge use is later %" PRIu64
" %s \n",
11120 vs->first_challenge_use.abs_value_us,
11122 vs->last_challenge_use =
11126 "Validation response %s from %s accepted, address valid until %s\n",
11134 "Key %s for address %s map size %u contains %u\n",
11149 "Address `%s' already tracked for revalidation\n",
11154 vs->revalidation_task =
11163 strlen (vs->address) + 1,
11187 "# Queues lost at time of successful validation",
11193 q->pd.aged_rtt = vs->validation_rtt;
11200 "Creating new virtual link %p to %s using direct neighbour!\n",
11243 "Virtual link to %s could now also use direct neighbour!\n",
11283 "Received message with size %u and flow control id %" PRIu64
11284 " via communicator from peer %s\n",
11319 "Flow control header size %u size of addresses %u number of addresses %u size of message struct %lu second struct %lu\n",
11325 if (0 == number_of_addresses)
11333 tgnas = (
const char *) &fc[1];
11351 if (avail - off < alen)
11366 unsigned int n_hops = 0;
11369 "calculate_rtt\n");
11371 pos = pos->next_dv)
11374 "calculate_rtt %lu\n",
11375 (
unsigned long) pos->pd.aged_rtt.rel_value_us);
11398 char *uri_without_port;
11400 slash = strrchr (
uri,
'/');
11401 if ((NULL == slash) || (slash -
uri < 2))
11415 "iterate_address_start_burst %s %s %s %s\n",
11416 (NULL == uri_without_port) ?
"<unparsable>" : uri_without_port,
11421 if ((NULL != uri_without_port) &&
11422 (0 == strcmp (uri_without_port, slash)))
11444 "Got failure from PEERSTORE: %s\n",
11456 "Hello iteration end for %s\n",
11465 "check_for_burst_address\n");
11471 if (NULL != parser)
11482 if (NULL != vl->
ic)
11509 if (NULL == uri_without_port)
11521 strlen (uri_without_port) + 1,
11525 memcpy (&sb[1], uri_without_port, strlen (uri_without_port) + 1);
11531 "iterate_address_start_burst client tc prefix %s\n",
11532 tc->details.communicator.address_prefix);
11536 "iterate_address_start_burst %s call %lu %u rtt %lu\n",
11538 strlen (uri_without_port),
11599 "burst_task %p ready %s burst addr %s (%p)\n",
11628 if (NULL !=
vl->
ic)
11668 "Discarding unconfirmed virtual link to %s\n",
11671 "# Unconfirmed virtual links timed out",
11705 "No virtual link for %p FC creating new unconfirmed virtual link to %s!\n",
11752 "remaining %lu timeout for neighbour %p\n",
11756 if (NULL == vl->
n ||
11771 "Burst attempt to %s already pending\n",
11779 if (NULL !=
vl->
dv)
11802 unsigned int off = 0;
11804 tgnas = (
const char *) &fc[1];
11806 for (
unsigned int i = 0; i < number_of_addresses; i++)
11813 addr = (
char *) &tgna[1];
11820 "received address %.*s length %u\n",
11833 "FC dropped: Message out of order\n");
11836 "# FC dropped: message out of order",
11842 seq = ntohl (fc->
seq);
11843 if (seq < vl->last_fc_seq)
11858 "Received FC from %s, seq %u, new window %llu (loss at %lld)\n",
11860 (
unsigned int) seq,
11872 if ((wnd < vl->incoming_fc_window_size
11879 "Consider re-sending our FC message, as clearly the other peer's idea of the window is not up-to-date (%llu vs %llu) or %llu last received differs, or random reply %u\n",
11880 (
unsigned long long) wnd,
11892 "Slowing FC transmission to %s to keepalive rate: peer is current at window %llu\n",
11894 (
unsigned long long) wnd);
11961 validation_challenge,
11966 validation_response,
11975 "Handling message of type %u with %u bytes\n",
11976 (
unsigned int) ntohs (
msg->
type),
11977 (
unsigned int) ntohs (
msg->
size));
12007 "# malformed messages discarded",
12094 "Waiting for ACKnowledgment `%s' for <%" PRIu64
">\n",
12122 mtu = (UINT16_MAX ==
queue->mtu)
12126 "Fragmenting message <%" PRIu64
12127 "> with size %u to %s for MTU %u\n",
12131 (
unsigned int) mtu);
12134 "Fragmenting message %" PRIu64
" <%" PRIu64
12135 "> with size %u to %s for MTU %u\n",
12140 (
unsigned int) mtu);
12152 while (((ff->
bytes_msg > mtu) || (pm == ff)) &&
12172 orig = (
const char *) &ff[1];
12189 "3 created pm %p from pm %p storing vl %p from pm %p\n",
12200 msg = (
char *) &frag[1];
12209 memcpy (
msg, &tfb,
sizeof(tfb));
12210 memcpy (&
msg[
sizeof(tfb)], &orig[ff->
frag_off], fragsize);
12256 if (NULL != pm->
bpm)
12263 if (pm->
bytes_msg +
sizeof(rbox) > UINT16_MAX)
12276 "4 created pm %p storing vl %p from pm %p\n",
12295 memcpy (
msg, &rbox,
sizeof(rbox));
12299 "Preparing reliability box for message <%" PRIu64
12300 "> of size %d (%d) to %s on queue %s\n",
12319 if ((NULL ==
vl) ||
12332 while ((NULL != pos) &&
12351 while (NULL != pos)
12374 while (NULL != pos)
12399 "Next attempt for message <%" PRIu64
"> set to %" PRIu64
"\n",
12411 "Next attempt for root message <%" PRIu64
"> set to %s\n",
12425 "frag_count next attempt %u\n",
12434 "Next attempt for fragmented message <%" PRIu64
"> (<%" PRIu64
12435 ">)set to %" PRIu64
"\n",
12461 "We have no fragments in flight for message %" PRIu64
12462 ", reorder root %" PRIu64
"! Next attempt is %" PRIu64
"\n",
12470 double factor = ((double) root->
frag_count - 1)
12480 "frag_count %u after factor\n",
12489 "We have fragments in flight for message %" PRIu64
12490 ", do not reorder root! Actual next attempt %" PRIu64
"\n",
12574 pos = pos->next_vl)
12576 size_t real_overhead = overhead;
12580 if ((NULL != dvh) && (
PMT_DV_BOX == pos->pmt))
12583 "DV messages must not be DV-routed to next hop!\n");
12586 if (pos->next_attempt.abs_value_us > now.
abs_value_us)
12592 "Fragments in flight for message %" PRIu64
"\n",
12593 pos->logging_uuid);
12598 "Maybe too early, because message are sorted by next_attempt, if there are no fragments in flight.Checked message %"
12600 pos->logging_uuid);
12603 pos->next_attempt);
12608 if (NULL != pos->qe)
12614 sc->consideration_counter++;
12618 "check %" PRIu64
" for sc->best\n",
12619 pos->logging_uuid);
12621 if (((0 !=
queue->mtu) &&
12622 (pos->bytes_msg + real_overhead >
queue->mtu)) ||
12623 (pos->bytes_msg > UINT16_MAX -
sizeof(
struct
12626 (NULL != pos->head_frag
12631 "fragment msg with size %u, realoverhead is %lu\n",
12651 if ((0 !=
queue->mtu) && (pos->bytes_msg + real_overhead >
queue->mtu))
12661 "Create reliability box of msg with size %u, realoverhead is %lu %u %u %u\n",
12681 long long sc_score =
sc->frag * 40 +
sc->relb * 20 +
sc->real_overhead;
12682 long long pm_score = frag * 40 + relb * 20 + real_overhead;
12683 long long time_delta =
12684 (
sc->best->next_attempt.abs_value_us - pos->next_attempt.abs_value_us)
12699 if (0 !=
queue->mtu)
12703 if (
queue->mtu >
sc->real_overhead +
sc->best->bytes_msg)
12704 sc_score -=
queue->mtu - (
sc->real_overhead +
sc->best->bytes_msg);
12705 if (
queue->mtu > real_overhead + pos->bytes_msg)
12706 pm_score -=
queue->mtu - (real_overhead + pos->bytes_msg);
12708 if (sc_score + time_delta > pm_score)
12711 "sc_score of %" PRIu64
" larger, keep sc->best %" PRIu64
12714 sc->best->logging_uuid);
12722 sc->real_overhead = real_overhead;
12751 "5 created pm %p storing vl %p from pm %p\n",
12763 "Creating DV Box %" PRIu64
" for original message %" PRIu64
12764 " (next hop is %s)\n",
12796 queue->transmit_task = NULL;
12797 if ((NULL == n->
vl) && (NULL == n->
dv_head))
12800 "Virtual link `%s' is down, cannot have PM for queue `%s'\n",
12806 memset (&
sc, 0,
sizeof(
sc));
12811 if (NULL ==
sc.best)
12815 dvh = dvh->next_neighbour)
12817 if (NULL == dvh->dv->vl)
12824 * (1 + dvh->distance)
12829 if (NULL ==
sc.best)
12833 "No pending messages, queue `%s' to %s now idle\n",
12849 "Selected message <%" PRIu64
">\n",
12851 if (NULL !=
sc.dvh)
12854 "Is this %u a DV box?\n",
12857 if ((NULL !=
sc.best->bpm) && (
sc.best->bpm->used_dvh !=
sc.dvh))
12860 "Discard old box, because we have a new DV path.\n");
12862 sc.best->bpm = NULL;
12865 if (NULL ==
sc.best->bpm)
12868 "encapsulate_for_dv 2\n");
12879 "%lu %lu %lu %lu %u\n",
12885 sc.best->bpm->used_dvh =
sc.dvh;
12895 "Fragmentation failed queue %s to %s for <%" PRIu64
12896 ">, trying again\n",
12899 sc.best->logging_uuid);
12914 "Reliability boxing failed queue %s to %s for <%" PRIu64
12915 ">, trying again\n",
12918 sc.best->logging_uuid);
12929 "Passing message <%" PRIu64
12930 "> to queue %s for peer %s (considered %u others)\n",
12934 sc.consideration_counter);
12943 if (pm->
vl !=
queue->neighbour->vl)
12955 if (NULL !=
queue->neighbour->vl)
12956 queue->neighbour->vl->outbound_fc_window_size_used +=
sc.best->bytes_msg;
12993 unsigned int wait_multiplier;
13005 wait_multiplier = 4;
13009 double wm = ceil ((
double) root->
bytes_msg
13013 if ((! (wm >= 1.0)) || (wm > 1024.0))
13015 wait_multiplier = (
unsigned int) wm;
13021 wait_multiplier = 4;
13028 "Wait multiplier %u\n",
13043 queue->pd.aged_rtt.rel_value_us)
13044 wait_duration =
queue->pd.aged_rtt;
13048 wait_multiplier = 4;
13053 wait_duration, wait_multiplier));
13055 wait_duration, wait_multiplier);
13057 "Waiting %s for ACK until %s\n",
13097 if ((ntohl (dqm->
qid) !=
queue->qid) ||
13101 "Dropped queue %s to peer %s\n",
13116 "QUEUE_TEARDOWN for unknown queue QID %u to peer %s ignored\n",
13120 "# QUEUE_TEARDOWN dropped: queue unknown",
13134 qe->queue->queue_tail,
13136 qe->queue->queue_length--;
13137 tc->details.communicator.total_queue_length--;
13139 "Received ACK on queue %s (QID %u) to peer %s (new length: %u/%u)\n",
13140 qe->queue->address,
13143 qe->queue->queue_length,
13144 tc->details.communicator.total_queue_length);
13148 tc->details.communicator.total_queue_length)
13154 "# Transmission throttled due to communicator queue limit",
13157 for (
struct Queue *
queue =
tc->details.communicator.queue_head;
13170 "# Transmission throttled due to queue queue limit",
13177 else if (1 ==
qe->queue->q_capacity)
13181 "Transmission rescheduled due to communicator message queue with qid %u has capacity %"
13184 qe->queue->q_capacity);
13188 "# Transmission throttled due to message queue capacity",
13196 if (NULL != (pm =
qe->pm))
13208 if ((NULL != vl) &&
13230 struct Queue *failed_queue = NULL;
13242 "Looking for queue for PID %s\n",
13261 "QueueEntry MID: %" PRIu64
" on queue QID: %u, Ack MID: %"
13262 PRIu64
" Ack QID %u\n",
13268 if ((NULL !=
qe->pm) && (
qe->pm->qe !=
qe))
13270 "For pending message %" PRIu64
" we had retransmissions.\n",
13271 qe->pm->logging_uuid);
13301 "Communicator could not send MID %" PRIu64
13302 " on QID %u to %s; dropping that queue\n",
13307 "# queues dropped (communicator send failed)",
13311 failed_queue =
qe->queue;
13313 for (
struct Queue *
queue =
tc->details.communicator.queue_head;
13316 if ((ntohl (sma->
qid) ==
queue->qid) &&
13319 failed_queue =
queue;
13322 if (NULL != failed_queue)
13335 "No QueueEntry found for Ack MID %" PRIu64
" QID: %u\n",
13387 q =
q->next_neighbour)
13391 .num_msg_pending =
q->num_msg_pending,
13392 .num_bytes_pending =
q->num_bytes_pending };
13419 tc->details.monitor.peer =
start->peer;
13420 tc->details.monitor.one_shot = ntohl (
start->one_shot);
13454 unsigned int *num_queues)
13463 const char *
prefix =
q->tc->details.communicator.address_prefix;
13464 size_t plen = strlen (
prefix);
13475 pos = strstr (pos + 1,
prefix))
13476 if (((pos ==
ret) || (
',' == pos[-1])) &&
13477 ((
'\0' == pos[plen]) || (
',' == pos[plen])))
13505 unsigned int num_queues = 0;
13506 unsigned int distance = 0;
13529 if (NULL != vl->
dv)
13532 pos = pos->next_dv)
13540 hop = (NULL != best) ? best->
next_hop : NULL;
13543 clen = strlen (ccs) + 1;
13547 memcpy (&resp[1], ccs, clen);
13551 resp->
route = htonl ((uint32_t) ((NULL != vl->
n)
13555 resp->
num_queues = htonl ((uint32_t) num_queues);
13599 .include_unconfirmed = (int) ntohl (
lr->include_unconfirmed)
13642 if (NULL ==
tc->details.communicator.address_prefix)
13644 if (0 == strcmp (
prefix,
tc->details.communicator.address_prefix))
13649 "Someone suggested use of communicator for `%s', but we do not have such a communicator!\n",
13665 static uint32_t idgen = 0;
13682 "# Suggestions ignored due to missing communicator",
13686 "Cannot connect to %s at `%s', no matching communicator present\n",
13694 "Request #%u for `%s' communicator to create queue to `%s' at `%s'\n",
13695 (
unsigned int) idgen,
13705 memcpy (&cqm[1],
address, alen);
13723 if (NULL != vs->revalidation_task)
13726 vs->revalidation_task = NULL;
13732 "Remove key %s for address %s map size %u contains %u\n",
13742 vs->last_challenge_use.abs_value_us)
13744 vs->first_challenge_use = monotonic_time;
13746 vs->last_challenge_use = monotonic_time;
13754 "Sending address validation challenge %s to %s\n",
13783 "Validation response %s cleaned up\n",
13791 "Address validation task not scheduled anymore, nothing to do\n");
13799 "To early to start next address validation for challenge %s\n",
13812 vs->first_challenge_use),
13825 vs->challenge_backoff =
13829 "Address validation task will run again in %s\n",
13834 vs->challenge_backoff));
13899 ctx->quality_count++;
13934 "# DV learn aborted: no queue left",
13949 "# DV learn aborted: no queue left",
14017 unsigned int factor;
14023 "At connection quality %u, will launch DV learn in %s\n",
14046 "Starting launch DV learn with challenge %s\n",
14070 .purpose.size = htonl (
sizeof(dvip)),
14099 dash = strchr (
address,
'-');
14102 colon = strchr (dash,
':');
14106 colon - (dash + 1));
14126 char *address_without_port_vs;
14127 char *address_without_port_q;
14139 "Check validation request pending for `%s' at `%s'/`%s' (vs)/(q)\n",
14141 (NULL == address_without_port_vs) ?
"<unparsable>"
14142 : address_without_port_vs,
14143 (NULL == address_without_port_q) ?
"<unparsable>"
14144 : address_without_port_q);
14151 (NULL != address_without_port_vs) &&
14152 (NULL != address_without_port_q) &&
14153 (NULL != prefix_vs) &&
14154 (NULL != prefix_q) &&
14155 (0 == strcmp (prefix_vs, prefix_q)) &&
14156 (0 == strcmp (address_without_port_vs, address_without_port_q)))
14197 if (0 ==
record->value_size)
14217 struct sockaddr_in v4;
14221 char *uri_without_port;
14222 char *address_uri_without_port;
14224 slash = strrchr (
uri,
'/');
14225 if ((NULL == slash) || (slash -
uri < 2))
14238 "1 not global natted_address %u %s %s %s\n",
14239 queue->is_global_natted,
14245 if ((NULL == uri_without_port) ||
14246 (1 != inet_pton (AF_INET, uri_without_port, &v4.sin_addr)))
14255 "2 not global natted_address %u %s %s\n",
14256 queue->is_global_natted,
14269 "3 not global natted_address %u %s %s\n",
14270 queue->is_global_natted,
14274 if (0 == strcmp (uri_without_port, address_uri))
14283 "4 not global natted_address %u %s %s\n",
14284 queue->is_global_natted,
14289 if ((NULL != address_uri_without_port) &&
14290 (0 == strcmp (uri_without_port, address_uri_without_port)))
14296 "not global natted_address %u %s %s %s %s %s %u\n",
14297 queue->is_global_natted,
14301 address_uri_without_port,
14332 char *addr = (
char *) &tgna[1];
14336 "Checking tgna %p with addr %.*s and length %u compare length %lu\n",
14341 strlen (tgna_cls->
addr));
14345 tgna_cls->
tgna = tgna;
14356 "Error in PEERSTORE monitoring for checking global natted\n");
14364 "Done with initial PEERSTORE iteration during monitoring for checking global natted\n");
14378 size_t address_len_without_port;
14383 "Got failure from PEERSTORE: %s\n",
14403 if (NULL == parser)
14406 "HELLO cannot be parsed!\n");
14411 "before not global natted %u\n",
14412 queue->is_global_natted);
14417 "after not global natted %u\n",
14418 queue->is_global_natted);
14422 if (NULL == tgna_cls.
addr)
14428 address_len_without_port = strlen (tgna_cls.
addr);
14437 tgna_cls.
tgna = NULL;
14442 if (NULL != tgna_cls.
tgna)
14444 " tgna_cls.tgna tgna %p %lu %u %u\n",
14454 + address_len_without_port);
14466 "Created tgna %p with address %s and length %lu\n",
14469 address_len_without_port + 1);
14484 "removed tgna %p\n",
14524 for (
queue =
tc->details.communicator.queue_head;
14528 if (
queue->qid != ntohl (aqm->
qid))
14537 neighbour =
queue->neighbour;
14544 if (NULL == neighbour)
14566 addr_len = ntohs (aqm->
header.
size) -
sizeof(*aqm);
14567 addr = (
const char *) &aqm[1];
14569 "New queue %s to %s available with QID %u and q_len %" PRIu64
14588 "New queue with QID %u inherit validated until\n",
14590 queue->validated_until = validated_until;
14595 queue->neighbour = neighbour;
14599 memcpy (&
queue[1], addr, addr_len);
14611 tc->details.communicator.queue_head,
14612 tc->details.communicator.queue_tail,
14621 if (NULL ==
queue->mo)
14625 struct sockaddr_in v4;
14627 if ((NULL != addr_without) &&
14628 (1 == inet_pton (AF_INET, addr_without, &v4.sin_addr)))
14631 "start not global natted\n");
14690 struct Queue *target_queue = NULL;
14701 "Received queue update message for %u with q_len %llu and mtu %u\n",
14705 for (target_queue =
tc->details.communicator.queue_head;
14706 NULL != target_queue;
14709 if (ntohl (
msg->qid) == target_queue->
qid)
14712 if (NULL == target_queue)
14715 "Queue to update no longer exists! Discarding update.\n");
14720 target_queue->
nt = ntohl (
msg->nt);
14721 target_queue->
mtu = ntohl (
msg->mtu);
14722 target_queue->
cs = ntohl (
msg->cs);
14760 "# Suggestions succeeded at communicator",
14764 "Request #%u for communicator to create queue succeeded\n",
14792 "Request #%u for communicator to create queue failed\n",
14795 "# Suggestions failed in queue creation at communicator",
14847 pfx_len = eou -
uri;
14856 "hello for client %s\n",
14890 "Got failure from PEERSTORE: %s\n",
14905 "No identity given yet!\n");
14923 if (NULL == parser)
14926 "HELLO cannot be parsed!\n");
14931 "HELLO for `%s' could be parsed, iterating addresses...!\n",
14946 "Error in PEERSTORE monitoring\n");
14954 "Done with initial PEERSTORE iteration during monitoring\n");
14975 tc->details.application.requests =
14988 "Still waiting for own identity!\n");
14993 "Client suggested we talk to %s with preference %d at rate %u\n",
14995 (
int) ntohl (
msg->pk),
14996 (
int) ntohl (
msg->bw.value__));
15000 "Client suggested connection to ourselves, ignoring...\n");
15006 pr->pid =
msg->peer;
15008 pr->pk = ntohl (
msg->pk);
15010 tc->details.application.requests,
15229 static int shutdown_done;
15235 "shutdown logic\n");
15342 if (NULL != pr->
op)
15359 "Disconnecting from PEERSTORE service\n");
15377 return "COMMUNICATOR";
15379 return "APPLICATION";
15400 "Client did not disconnect within the shutdown grace period, "
15401 "dropping it: %s\n",
15421 "Shutdown task executed\n");
15427 "Waiting for client to disconnect: %s\n",
15459 "Failed to store our new hello with peerstore\n");
15462 "Our hello is current in peerstore\n");
15504 "My current identity is `%s'\n",
15522 "New PID from PILS is derived from address list inconsistent with ours. Ignoring...\n");
15524 "Proposed address list:\n");
15527 "Current address list:\n");
15535 "My new identity is `%s'\n",
15584 "Could not configure burst nat use. Default to no.\n");
15628 _ (
"Failed to load our private key, "
15629 "cannot open DV boxes addressed to us\n"));
struct GNUNET_GETOPT_CommandLineOption options[]
struct GNUNET_MQ_MessageHandlers handlers[]
struct GNUNET_MessageHeader * msg
struct GNUNET_MQ_Envelope * env
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
static int start
Set if we are to start default services (including ARM).
static int ret
Final status code.
static char * init
Set to the name of a service to start.
static int end
Set if we are to shutdown all services (including ARM).
static int do_shutdown
Set to GNUNET_YES if we are shutting down.
static struct GNUNET_CADET_Handle * mh
Cadet handle.
static struct GNUNET_TESTING_Interpreter * is
static struct Queue * queue_head
Head of queue of messages to transmit.
static int prefix
If printing the value of PREFIX has been requested.
static struct GNUNET_SCHEDULER_Task * st
The shutdown task.
static void record(void *cls, size_t data_size, const void *data)
Process recorded audio data.
static char * address
GNS address for this phone.
static GNUNET_NETWORK_STRUCT_END struct GNUNET_PeerIdentity me
Our own peer identity.
static struct GNUNET_DATASTORE_QueueEntry * qe
Current operation.
struct GNUNET_HashCode key
The key used in the DHT.
static struct GNUNET_TIME_Relative expiration
User supplied expiration value.
static struct GNUNET_FS_Handle * ctx
static struct GNUNET_GNS_LookupWithTldRequest * lr
Handle to lookup request.
struct GNUNET_SCHEDULER_Task * shutdown_task
static unsigned int pending
The number of DNS queries that are outstanding.
static void queue(const char *label, uint32_t rd_count, struct GNUNET_GNSRECORD_Data *rd, const struct Zone *zone)
Add hostname to the list of requests to be made.
static char * res
Currently read line or NULL on EOF.
static char * value
Value of the record to add/remove.
static uint32_t type
Type string converted to DNS type value.
static struct GNUNET_NAT_AUTO_Test * nt
Handle to a NAT test operation.
static struct GNUNET_FS_Uri * uri
Value of URI provided on command-line (when not publishing a file but just creating UBlocks to refer ...
static struct GNUNET_FS_PublishContext * pc
Handle to FS-publishing operation.
static int result
Global testing status.
static struct GNUNET_REVOCATION_Query * q
Handle for revocation query.
static struct GNUNET_FS_SearchContext * sc
static struct GNUNET_SERVICE_Handle * service
Handle to our service instance.
static struct GNUNET_PeerIdentity my_identity
Identity of this peer.
static unsigned long long payload
How much data are we currently storing in the database?
struct GNUNET_CRYPTO_EddsaPrivateKey my_private_key
The current private key.
static unsigned int ring_buffer_dv_head
Head of the ring buffer.
static void peerstore_store_validation_cb(void *cls, int success)
Function called when peerstore is done storing a validated address.
static void handle_dv_box(void *cls, const struct TransportDVBoxMessage *dvb)
Communicator gave us a DV box.
#define DV_PATH_DISCOVERY_FREQUENCY
How long before paths expire would we like to (re)discover DV paths? Should be below DV_PATH_VALIDITY...
static struct GNUNET_SERVICE_Handle * GST_service
Our service handle; needed to force-disconnect clients that did not go away within SHUTDOWN_CLIENT_GR...
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 virt...
static int dv_neighbour_transmission(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
Function called for each neighbour during handle_dv_learn.
static void reassembly_cleanup_task(void *cls)
Task run to clean up reassembly context of a neighbour that have expired.
static enum GNUNET_GenericReturnValue remove_global_addresses(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
static void backtalker_timeout_cb(void *cls)
Function called when it is time to clean up a backtalker.
static void handle_add_address(void *cls, const struct GNUNET_TRANSPORT_AddAddressMessage *aam)
Address of our peer added.
static void send_cmc_ack(struct CommunicatorMessageContext *cmc)
Release the CORE flow control credit for cmc by acknowledging the message to the communicator that de...
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 take...
static struct GNUNET_SCHEDULER_Task * dvlearn_task
Task run to initiate DV learning.
static int check_reliability_box(void *cls, const struct TransportReliabilityBoxMessage *rb)
Communicator gave us a reliability box.
static void handle_communicator_available(void *cls, const struct GNUNET_TRANSPORT_CommunicatorAvailableMessage *cam)
Communicator started.
static int check_fragment_box(void *cls, const struct TransportFragmentBoxMessage *fb)
Communicator gave us a fragment box.
static unsigned int get_age()
Get an offset into the transmission history buffer for struct PerformanceData.
static void free_validation_state(struct ValidationState *vs)
Free validation state.
static struct PendingAcknowledgement * prepare_pending_acknowledgement(struct Queue *queue, struct DistanceVectorHop *dvh, struct PendingMessage *pm)
Setup data structure waiting for acknowledgements.
static int check_request_hello_validation(void *cls, const struct RequestHelloValidationMessage *m)
Check GNUNET_MESSAGE_TYPE_TRANSPORT_REQUEST_HELLO_VALIDATION messages.
static void hello_for_incoming_cb(void *cls, const struct GNUNET_PeerIdentity *pid, const char *uri)
#define MAX_DV_DISCOVERY_SELECTION
Maximum number of peers we select for forwarding DVInit messages at the same time (excluding initiato...
#define QUEUE_ENTRY_TIMEOUT
static struct LearnLaunchEntry * lle_tail
Tail of a DLL sorted by launch time.
static struct GNUNET_CONTAINER_Heap * validation_heap
MIN Heap sorted by "next_challenge" to struct ValidationState entries sorting addresses we are aware ...
static void core_send_connect_info(struct TransportClient *tc, const struct GNUNET_PeerIdentity *pid)
Send message to CORE clients that we lost a connection.
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.
static void harmonize_flight_round(struct PendingMessage *pm)
#define ACK_CUMMULATOR_TIMEOUT
How long until we forget about historic accumulators and thus reset the ACK counter?...
void pils_sign_address(struct AddressListEntry *ale, struct GNUNET_TIME_Absolute mono_time)
Build address record by signing raw information with private key of the peer identity.
static struct GNUNET_SCHEDULER_Task * client_grace_task
Task run when SHUTDOWN_CLIENT_GRACE_PERIOD expired and clients are still connected,...
static void free_queue(struct Queue *queue)
Free queue.
static void handle_del_address(void *cls, const struct GNUNET_TRANSPORT_DelAddressMessage *dam)
Address of our peer deleted.
static struct LearnLaunchEntry * lle_head
Head of a DLL sorted by launch time.
#define EPHEMERAL_VALIDITY
How long are ephemeral keys valid?
static void free_fragment_tree(struct PendingMessage *root)
Free fragment tree below root, excluding root itself.
static unsigned int is_ring_buffer_full
Is the ring buffer filled up to RING_BUFFER_SIZE.
static struct IncomingRequest * ir_tail
Tail of DLL starting at ir_head.
static void pils_pid_change_cb(void *cls, const struct GNUNET_HELLO_Parser *parser, const struct GNUNET_HashCode *hash)
Callback called when pils service updates us with our new peer identity.
static int free_pending_ack_cb(void *cls, const struct GNUNET_Uuid *key, void *value)
Free pending acknowledgement.
static void credit_client(struct PendingMessage *pm)
Return the send window credit that pm's client is owed, at most once for pm.
static int check_dv_box(void *cls, const struct TransportDVBoxMessage *dvb)
Communicator gave us a DV box.
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...
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.
struct GNUNET_NAT_Handle * nh
Handle for connect to the NAT service.
static int check_add_queue_message(void *cls, const struct GNUNET_TRANSPORT_AddQueueMessage *aqm)
New queue became available.
static struct GNUNET_SCHEDULER_Task * pils_feed_task
Task to feed addresses to PILS.
static void client_send_response(struct PendingMessage *pm)
Send a response to the pm that we have processed a "send" request.
static void start_dv_learn(void *cls)
Task run when we CONSIDER initiating a DV learn process.
static int dv_neighbour_selection(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
Function called for each neighbour during handle_dv_learn.
static enum GNUNET_GenericReturnValue revalidate_now_cb(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
Pull value's next challenge forward: the link to that peer is not up.
static void start_address_validation(const struct GNUNET_PeerIdentity *pid, const char *address)
Start address validation.
static void handle_del_queue_message(void *cls, const struct GNUNET_TRANSPORT_DelQueueMessage *dqm)
Queue to a peer went down.
static void drop_remaining_clients(void *cls)
The grace period we gave our clients to disconnect on their own expired.
#define QUEUE_LENGTH_LIMIT
How many messages can we have pending for a given queue (queue to a particular peer via a communicato...
static void update_backtalker_monotime(struct Backtalker *b)
The backtalker b monotonic time changed.
#define MAX_CUMMULATIVE_ACKS
Maximum number of messages we acknowledge together in one cumulative ACK.
#define MAX_DV_HOPS_ALLOWED
Maximum DV distance allowed ever.
static const char * get_client_type_name(enum ClientType type)
static void burst_timeout(void *cls)
#define BACKCHANNEL_INACTIVITY_TIMEOUT
How long do we cache backchannel (struct Backtalker) information after a backchannel goes inactive?
static struct GNUNET_TIME_Relative get_network_latency(const struct TransportDVLearnMessage *dvl)
static void hello_for_client_error_cb(void *cls)
static void check_for_global_natted(void *cls, const struct GNUNET_PEERSTORE_Record *record, const char *emsg)
#define ADDRESS_VALIDATION_LIFETIME
How long do we consider an address valid if we just checked?
static void free_distance_vector_hop(struct DistanceVectorHop *dvh)
Free a dvh.
#define MAX_FC_RETRANSMIT_COUNT
Maximum number of FC retransmissions for a running retransmission task.
static void handle_fragment_box(void *cls, const struct TransportFragmentBoxMessage *fb)
Communicator gave us a fragment.
static enum GNUNET_GenericReturnValue report_link(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
Send the state of the virtual link value to the requesting client.
static struct PendingMessage * fragment_message(struct Queue *queue, struct DistanceVectorHop *dvh, struct PendingMessage *pm)
Fragment the given pm to the given mtu.
static void update_hello_from_pid_change_cb(void *cls, int success)
static struct GNUNET_SCHEDULER_Task * validation_task
Task to run address validation.
static void handle_suggest(void *cls, const struct ExpressPreferenceMessage *msg)
We have received a struct ExpressPreferenceMessage from an application client.
static void handle_link_list_request(void *cls, const struct GNUNET_TRANSPORT_LinkListRequest *lr)
A client asks for the virtual links we currently have.
static void cores_send_connect_info(const struct GNUNET_PeerIdentity *pid)
Send message to CORE clients that we gained a connection.
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.
static void task_consider_sending_fc(void *cls)
Something changed on the virtual link with respect to flow control.
#define DV_LEARN_QUALITY_THRESHOLD
How many good connections (confirmed, bi-directional, not DV) do we need to have to suppress initiati...
static void free_neighbour(struct Neighbour *neighbour, enum GNUNET_GenericReturnValue drop_link)
Release memory used by neighbour.
PendingMessageType
Types of different pending messages.
@ PMT_FRAGMENT_BOX
Fragment box.
@ PMT_DV_BOX
Pending message created during forward_dv_box().
@ PMT_CORE
Ordinary message received from the CORE service.
@ PMT_RELIABILITY_BOX
Reliability box.
static struct GNUNET_TIME_Relative calculate_rtt(struct DistanceVector *dv)
static void arm_free_queue_entry_task(struct TransportClient *tc)
Make sure free_timedout_queue_entry() will run for tc, so that `struct QueueEntry's the communicator ...
static int check_flow_control(void *cls, const struct TransportFlowControlMessage *fc)
Communicator gave us a transport address validation response.
static int stop_peer_request(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
Stop the peer request in value.
static void handle_update_queue_message(void *cls, const struct GNUNET_TRANSPORT_UpdateQueueMessage *msg)
Handle updates to queues.
static void cores_send_disconnect_info(const struct GNUNET_PeerIdentity *pid)
Send message to CORE clients that we lost a connection.
static void handle_client_start(void *cls, const struct StartMessage *start)
Initialize a "CORE" client.
#define MAX_DV_PATHS_TO_TARGET
Maximum number of DV paths we keep simultaneously to the same target.
static void free_virtual_link(struct VirtualLink *vl)
Free virtual link.
RouteMessageOptions
Which transmission options are allowable for transmission? Interpreted bit-wise!
@ RMO_UNCONFIRMED_ALLOWED
We are allowed to use unconfirmed queues or DV routes for this message.
@ RMO_DV_ALLOWED
We are allowed to use DV routing for this hdr.
@ RMO_REDUNDANT
If we have multiple choices, it is OK to send this message over multiple channels at the same time to...
@ RMO_NONE
Only confirmed, non-DV direct neighbours.
@ RMO_ANYTHING_GOES
Reliable and unreliable, DV and non-DV are all acceptable.
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.
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 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_ho...
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.
static void queue_burst(void *cls)
static void handle_monitor_start(void *cls, const struct GNUNET_TRANSPORT_MonitorStart *start)
Initialize a monitor client.
static struct GNUNET_PEERSTORE_Handle * peerstore
Database for peer's HELLOs.
static void finish_cmc_handling(struct CommunicatorMessageContext *cmc)
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 (retur...
static void store_pi(void *cls)
Ask peerstore to store our address.
#define FC_NO_CHANGE_REPLY_PROBABILITY
What is the 1:n chance that we send a Flow control response when receiving a flow control message tha...
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.
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.
#define RECV_WINDOW_SIZE
Window size.
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.
static void store_signed_address(struct PilsAddressSignContext *pc, const struct GNUNET_PeerIdentity *pid, const struct GNUNET_CRYPTO_EddsaSignature *sig)
Turn the signed address into a HELLO URI and hand it to PEERSTORE.
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.
#define GOODPUT_AGING_SLOTS
Number of slots we keep of historic data for computation of goodput / message loss ratio.
static int free_validation_state_cb(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
Free validation state.
static int free_neighbour_cb(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
Free neighbour entry.
static void handle_client_send(void *cls, const struct OutboundMessage *obm)
Client asked for transmission to a peer.
static void decaps_dv_box_cont(struct CommunicatorMessageContext *cmc, const struct TransportDVBoxMessage *dvb, const struct GNUNET_ShortHashCode *km)
Open the DV box dvb addressed to us, using the key material km decapsulated from its ephemeral key.
static enum GNUNET_GenericReturnValue burst_running
Is there a burst running?
struct GNUNET_HELLO_Builder * GST_my_hello
Our HELLO.
static void start_burst(void *cls)
#define DV_QUALITY_RTT_THRESHOLD
We only consider queues as "quality" connections when suppressing the generation of DV initiation mes...
static struct TransportClient * clients_head
Head of linked list of all clients to this service.
static void handle_validation_challenge(void *cls, const struct TransportValidationChallengeMessage *tvc)
Communicator gave us a transport address validation challenge.
static struct PilsRequest * pils_requests_head
PILS Operation DLL.
#define COMMUNICATOR_TOTAL_QUEUE_LIMIT
How many messages can we have pending for a given communicator process before we start to throttle th...
static void free_reassembly_context(struct ReassemblyContext *rc)
Free rc.
static struct VirtualLink * lookup_virtual_link(const struct GNUNET_PeerIdentity *pid)
Lookup virtual link for peer pid.
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 counte...
static void reorder_root_pm(struct PendingMessage *pm, struct GNUNET_TIME_Absolute next_attempt)
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...
static unsigned int ir_total
Length of the DLL starting at ir_head.
static int in_shutdown
Indication if we have received a shutdown signal and are in the process of cleaning up.
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.
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...
static void free_timedout_queue_entry(void *cls)
static void handle_send_message_ack(void *cls, const struct GNUNET_TRANSPORT_SendMessageToAck *sma)
Message was transmitted.
static void update_pd_age(struct PerformanceData *pd, unsigned int age)
Check if we have advanced to another age since the last time.
#define DV_LEARN_BASE_FREQUENCY
What is the non-randomized base frequency at which we would initiate DV learn messages?
struct GNUNET_SCHEDULER_Task * burst_timeout_task
static void free_pending_acknowledgement(struct PendingAcknowledgement *pa)
Release pa data structure.
static struct GNUNET_CONTAINER_MultiUuidmap * pending_acks
Map of pending acknowledgements, mapping struct AcknowledgementUUID to a struct PendingAcknowledgemen...
static struct GNUNET_CONTAINER_MultiShortmap * dvlearn_map
Map from challenges to struct LearnLaunchEntry values.
#define DV_FORWARD_TIMEOUT
If a DVBox could not be forwarded after this number of seconds we drop it.
static void finish_handling_raw_message(struct VirtualLink *vl, const struct GNUNET_MessageHeader *mh, struct CommunicatorMessageContext *cmc, unsigned int free_cmc)
static void handle_add_queue_message(void *cls, const struct GNUNET_TRANSPORT_AddQueueMessage *aqm)
New queue became available.
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.
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 ...
static void set_pending_message_uuid(struct PendingMessage *pm)
If necessary, generates the UUID for a pm.
static void free_pending_message(struct PendingMessage *pm)
Release memory associated with pm and remove pm from associated data structures.
static void revalidation_start_cb(void *cls)
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.
static int free_reassembly_cb(void *cls, uint32_t key, void *value)
function called to free_reassembly_context().
static void * client_connect_cb(void *cls, struct GNUNET_SERVICE_Client *client, struct GNUNET_MQ_Handle *mq)
Called whenever a client connects.
#define DV_PATH_VALIDITY_TIMEOUT
How long do we consider a DV path valid if we see no further updates on it? Note: the value chosen he...
static enum GNUNET_GenericReturnValue sign_ephemeral(struct DistanceVector *dv)
Sign the ephemeral key in dv, and mark it current.
#define RING_BUFFER_SIZE
Size of ring buffer to cache CORE and forwarded DVBox messages.
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.
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.
static struct TransportClient * lookup_communicator(const char *prefix)
Find transport client providing communication service for the protocol prefix.
static unsigned int ring_buffer_head
Head of the ring buffer.
#define MAX_ADDRESS_VALID_UNTIL
When do we forget an invalid address for sure?
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.
#define SHUTDOWN_CLIENT_GRACE_PERIOD
How long do we wait during shutdown for our clients to disconnect on their own before we drop them?...
static void transmit_dv_init(struct TransportDVLearnMessage dvl, struct LearnLaunchEntry *lle, struct QueueQualityContext qqc)
Finish and transmit the DV learn message dvl we initiated.
static void handle_suggest_cancel(void *cls, const struct ExpressPreferenceMessage *msg)
We have received a struct ExpressPreferenceMessage from an application client.
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 tran...
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.
static void handle_validation_response(void *cls, const struct TransportValidationResponseMessage *tvr)
Communicator gave us a transport address validation response.
static void handle_reliability_ack(void *cls, const struct TransportReliabilityAckMessage *ra)
Communicator gave us a reliability ack.
static int free_virtual_link_cb(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
Free virtual link entry.
static void send_msg_from_cache(struct VirtualLink *vl)
static void free_address_list_entry(struct AddressListEntry *ale)
Free ale.
static void free_burst_cls(struct GNUNET_StartBurstCls *sb_cls)
Release a burst closure, detaching it from its virtual link and from the scheduled burst_task (if tha...
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.
static void handle_burst_finished(void *cls, const struct GNUNET_TRANSPORT_BurstFinished *bf)
The burst finished.
static void hello_for_incoming_sync_cb(void *cls)
static enum GNUNET_GenericReturnValue resume_communicators(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
#define FC_KEEPALIVE_INTERVAL
How long may a confirmed virtual link go without us sending anything on it before we transmit an othe...
static struct PilsRequest * pils_requests_tail
PILS Operation DLL.
static struct GNUNET_CONTAINER_MultiPeerMap * neighbours
Map from PIDs to struct Neighbour entries.
static void release_stalled_cmc(struct VirtualLink *vl, struct CommunicatorMessageContext *cmc)
Take cmc off the list of messages waiting on vl's CORE receive window, release the flow control credi...
static void transmit_on_queue(void *cls)
We believe we are ready to transmit a message on a queue.
static void handle_dv_learn(void *cls, const struct TransportDVLearnMessage *dvl)
Communicator gave us a DV learn message.
static void iterate_address_start_burst(void *cls, const struct GNUNET_PeerIdentity *pid, const char *uri)
static void disconnect_and_free_virtual_link(struct VirtualLink *vl)
Tell CORE clients the link to vl is gone, then release it.
static struct Queue * find_queue(const struct GNUNET_PeerIdentity *pid, const char *address)
Find the queue matching pid and address.
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 sche...
static void free_dv_route(struct DistanceVector *dv)
Free entry in dv_routes.
static unsigned int is_ring_buffer_dv_full
Is the ring buffer filled up to RING_BUFFER_SIZE.
static int check_communicator_backchannel(void *cls, const struct GNUNET_TRANSPORT_CommunicatorBackchannel *cb)
Communicator requests backchannel transmission.
#define DEFAULT_WINDOW_SIZE
How big is the flow control window size by default; limits per-neighbour RAM utilization.
static void run(void *cls, const struct GNUNET_CONFIGURATION_Handle *c, struct GNUNET_SERVICE_Handle *service)
Initiate transport service.
#define MAX_VALIDATION_CHALLENGE_FREQ
What is the slowest rate at which we send challenges?
static void cancel_address_store(struct AddressListEntry *ale)
Abort the asynchronous sign-and-store chain (if any) that is currently running for ale and release it...
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 no...
static enum GNUNET_GenericReturnValue sign_by_my_identity(const struct GNUNET_CRYPTO_SignaturePurpose *purpose, struct GNUNET_CRYPTO_EddsaSignature *sig)
Sign purpose with the private key of our current peer identity.
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.
static void core_fc_stalled(void *cls)
CORE never returned the flow control credit for the messages we handed it for cls,...
static void shc_cont(void *cls, int success)
static void handle_raw_message(void *cls, const struct GNUNET_MessageHeader *mh)
Communicator gave us an unencapsulated message to pass as-is to CORE.
static void handle_communicator_backchannel(void *cls, const struct GNUNET_TRANSPORT_CommunicatorBackchannel *cb)
Communicator requests backchannel transmission.
static struct Queue * find_queue_by_ip(const struct GNUNET_PeerIdentity *pid, const char *address)
Find a queue to pid whose address has the same IP as address, but possibly a different port.
static unsigned long long logging_uuid_gen
Generator of logging_uuid in struct PendingMessage.
static int check_incoming_msg(void *cls, const struct GNUNET_TRANSPORT_IncomingMessage *im)
Client notified us about transmission from a peer.
#define REASSEMBLY_EXPIRATION
How long do we keep partially reassembled messages around before giving up?
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.
static struct Neighbour * lookup_neighbour(const struct GNUNET_PeerIdentity *pid)
Lookup neighbour for peer pid.
static void peerstore_store_own_cb(void *cls, int success)
Function called when peerstore is done storing our address.
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.
#define MIN_DELAY_ADDRESS_VALIDATION
What is the maximum frequency at which we do address validation? A random value between 0 and this va...
static void handle_acknowledged(struct PendingAcknowledgement *pa, struct GNUNET_TIME_Relative ack_delay)
The pa was acknowledged, process the acknowledgement.
static struct GNUNET_CONTAINER_MultiPeerMap * backtalkers
Map from PIDs to struct Backtalker entries.
static struct GNUNET_TIME_Absolute hello_mono_time
Monotonic time we use for HELLOs generated at this time.
static int check_communicator_available(void *cls, const struct GNUNET_TRANSPORT_CommunicatorAvailableMessage *cam)
Communicator started.
static char * communicator_list(struct Neighbour *n, unsigned int *num_queues)
Build the 0-terminated, comma-separated list of address prefixes of the communicators that own the qu...
static void handle_backchannel_encapsulation(void *cls, const struct TransportBackchannelEncapsulationMessage *be)
Communicator gave us a backchannel encapsulation.
static struct GNUNET_CONTAINER_MultiHashMap * revalidation_map
Map from addresses to struct ValidationState entries describing addresses we are aware of and their v...
static const struct GNUNET_CONFIGURATION_Handle * GST_cfg
Configuration handle.
static enum GNUNET_GenericReturnValue revalidate_map_it(void *cls, const struct GNUNET_HashCode *key, void *value)
#define DEFAULT_ACK_WAIT_DURATION
Default value for how long we wait for reliability ack.
static struct PendingMessage * reliability_box_message(struct Queue *queue, struct DistanceVectorHop *dvh, struct PendingMessage *pm)
Reliability-box the given pm.
static int free_backtalker_cb(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
Callback to free backtalker records.
static enum GNUNET_GenericReturnValue contains_address(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
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 garba...
#define FAST_VALIDATION_CHALLENGE_FREQ
What is the fastest rate at which we send challenges if we keep learning an address (gossip,...
static int check_add_address(void *cls, const struct GNUNET_TRANSPORT_AddAddressMessage *aam)
Address of our peer added.
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 ri...
#define MAX_DV_LEARN_PENDING
Maximum number of DV learning activities we may have pending at the same time.
static void hello_for_client_cb(void *cls, const struct GNUNET_PeerIdentity *pid, const char *uri)
static void validation_start_cb(void *cls)
Task run periodically to validate some address based on validation_heap.
#define VALIDATION_RTT_BUFFER_FACTOR
How many network RTTs before an address validation expires should we begin trying to revalidate?...
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.
static void feed_addresses_to_pils(void *cls)
static struct GNUNET_CONTAINER_MultiPeerMap * links
Map from PIDs to struct VirtualLink entries describing links CORE knows to exist.
static int check_client_send(void *cls, const struct OutboundMessage *obm)
Client asked for transmission to a peer.
static int check_backchannel_encapsulation(void *cls, const struct TransportBackchannelEncapsulationMessage *be)
Communicator gave us a backchannel encapsulation.
static struct TransportClient * clients_tail
Tail of linked list of all clients to this service.
static struct GNUNET_CONTAINER_MultiPeerMap * ack_cummulators
Map from PIDs to struct AcknowledgementCummulators.
static void transmit_cummulative_ack_cb(void *cls)
Do the transmission of a cumulative acknowledgement now.
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.
static void resume_cmc_client(struct CommunicatorMessageContext *cmc)
Let the communicator that delivered cmc give us its next message.
static struct GNUNET_STATISTICS_Handle * GST_stats
Statistics handle.
static const struct GNUNET_MessageHeader * hello_from_record(const struct GNUNET_PEERSTORE_Record *record)
Obtain the HELLO message stored in record, if record actually carries one.
static struct GNUNET_SCHEDULER_Task * burst_task
The task to start the burst.
static void send_t_validation_response(struct CommunicatorMessageContext *cmc, struct TransportValidationResponseMessage tvr)
Route the signed validation response tvr back to the challenger and release cmc.
void print_address_list(void *cls, const struct GNUNET_PeerIdentity *pid, const char *uri)
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.
static void neighbour_store_dvmono_cb(void *cls, int success)
Function called when peerstore is done storing a DV monotonic time.
static void handle_request_hello_validation(void *cls, const struct RequestHelloValidationMessage *m)
A client encountered an address of another peer.
static void free_queue_entry(struct QueueEntry *qe, struct TransportClient *tc)
static void pils_sign_hello_cb(void *cls, const struct GNUNET_PeerIdentity *pid, const struct GNUNET_CRYPTO_EddsaSignature *sig)
Get HELLO signature and create message to store in PEERSTORE.
static void check_for_global_natted_sync_cb(void *cls)
#define UNCONFIRMED_LINK_TIMEOUT
How long do we keep a virtual link that only exists because some peer sent us a FLOW_CONTROL message,...
static void handle_reliability_box(void *cls, const struct TransportReliabilityBoxMessage *rb)
Communicator gave us a reliability box.
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.
static void check_for_burst_address(void *cls, const struct GNUNET_PEERSTORE_Record *record, const char *emsg)
static unsigned int check_next_attempt_tree(struct PendingMessage *pm, struct PendingMessage *root)
static void hello_for_incoming_error_cb(void *cls)
static struct GNUNET_StartBurstCls * burst_task_cls
Closure of the currently scheduled burst_task, or NULL.
static void send_ok_to_client(struct TransportClient *tc, const struct GNUNET_PeerIdentity *pid)
Return one unit of send window credit for pid to tc.
static void queue_send_msg(struct Queue *queue, struct PendingMessage *pm, const void *payload, size_t payload_size)
Send the message payload on queue.
static void handle_flow_control(void *cls, const struct TransportFlowControlMessage *fc)
Communicator gave us a transport address validation response.
static int check_dv_learn(void *cls, const struct TransportDVLearnMessage *dvl)
Communicator gave us a DV learn message.
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.
static void try_to_bring_link_up(const struct GNUNET_PeerIdentity *pid)
Ask for everything that could give us a confirmed virtual link to pid: revalidate the addresses we al...
static void client_disconnect_cb(void *cls, struct GNUNET_SERVICE_Client *client, void *app_ctx)
Called whenever a client is disconnected.
static int check_reliability_ack(void *cls, const struct TransportReliabilityAckMessage *ra)
Communicator gave us a reliability ack.
static void iterate_address_and_compare_cb(void *cls, const struct GNUNET_PeerIdentity *pid, const char *uri)
static struct GNUNET_CONTAINER_MultiPeerMap * validation_map
Map from PIDs to struct ValidationState entries describing addresses we are aware of and their validi...
static struct GNUNET_TIME_Relative dvlearn_pils_backoff
Backoff for start_dv_learn() while PILS still owes us an identity.
#define MIN_FC_RETRANSMIT_DELAY
Lower bound on the delay between two flow control transmissions on the same virtual link.
static int free_dv_routes_cb(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
Free DV route entry.
static enum GNUNET_GenericReturnValue add_global_addresses(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
#define MIN_DV_PATH_LENGTH_FOR_INITIATOR
Minimum number of hops we should forward DV learn messages even if they are NOT useful for us in hope...
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.
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 discon...
static void check_for_global_natted_error_cb(void *cls)
static void finish_cmc_handling_with_continue(struct CommunicatorMessageContext *cmc, unsigned int free_cmc)
Send ACK to communicator (if requested) and free cmc.
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.
static void handle_incoming_msg(void *cls, const struct GNUNET_TRANSPORT_IncomingMessage *im)
Incoming message.
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.
static int free_ack_cummulator_cb(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
Free acknowledgement cummulator.
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 ...
#define PILS_FEED_ADDRESSES_DELAY
Delay between added/removed addresses and PILS feed call.
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.
enum GNUNET_GenericReturnValue use_burst
static struct GNUNET_CONTAINER_MultiPeerMap * dv_routes
Map from PIDs to struct DistanceVector entries describing known paths to the peer.
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.
static void free_incoming_request(struct IncomingRequest *ir)
Release ir data structure.
#define MAX_INCOMING_REQUEST
For how many incoming connections do we try to create a virtual link for (at the same time!...
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.
static struct GNUNET_PILS_Handle * pils
Service that manages our peer id.
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_ho...
static char * get_address_without_port(const char *address)
Get the IP address without the communicator prefix and the port number.
ClientType
What type of client is the struct TransportClient about?
@ CT_APPLICATION
"Application" telling us where to connect (i.e.
@ CT_MONITOR
It is a monitor, forward monitor data.
@ CT_NONE
We do not know yet (client is fresh).
@ CT_CORE
Is the CORE service, we need to forward traffic to it.
@ CT_COMMUNICATOR
It is a communicator, use for communication.
#define NEIGHBOUR_LIVENESS_TIMEOUT
How long may a direct neighbour stay completely silent before we stop believing that its queues work,...
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.
#define MAX_REASSEMBLY_CONTEXTS
Maximum number of messages we are willing to reassemble in parallel for a single virtual link.
static void unconfirmed_link_timeout(void *cls)
Discard a virtual link that only ever existed because some peer sent us a FLOW_CONTROL message and th...
static struct IncomingRequest * ir_head
List of incoming connections where we are trying to get a connection back established.
static void free_backtalker(struct Backtalker *b)
Free data structures associated with b.
static void hello_for_client_sync_cb(void *cls)
static void destroy_ack_cummulator(void *cls)
Clean up an idle cumulative acknowledgement data structure.
static void consider_sending_fc(void *cls)
Something changed on the virtual link with respect to flow control.
#define CORE_FC_STALL_TIMEOUT
How long do we wait for CORE to return the flow control credit for the messages we handed it before w...
static unsigned int bsize
static struct GNUNET_TRANSPORT_LinkListContext * llc
Handle to the running listing, NULL once it completed.
static struct GNUNET_Process * p
Helper process we started.
static struct GNUNET_TIME_Relative duration
Option '-d': duration of the mapping.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
Helper library for handling HELLO URIs.
API to the peerstore service.
enum GNUNET_GenericReturnValue GNUNET_PILS_enable_private_key(struct GNUNET_PILS_Handle *handle)
Enable local access to the private key of the current peer identity.
struct GNUNET_PILS_Handle * GNUNET_PILS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_PILS_PidChangeCallback pid_change_cb, void *cls)
Connect to the PILS service.
void GNUNET_PILS_disconnect(struct GNUNET_PILS_Handle *handle)
Disconnect from the PILS service.
struct GNUNET_PILS_Operation * GNUNET_PILS_sign_hello(struct GNUNET_PILS_Handle *handle, const struct GNUNET_HELLO_Builder *builder, struct GNUNET_TIME_Absolute et, GNUNET_PILS_SignResultCallback cb, void *cb_cls)
Create HELLO signature.
const struct GNUNET_CRYPTO_EddsaPrivateKey * GNUNET_PILS_get_private_key(const struct GNUNET_PILS_Handle *handle)
Return the private key of the current peer identity.
void GNUNET_PILS_cancel(struct GNUNET_PILS_Operation *op)
Cancel request.
const struct GNUNET_PeerIdentity * GNUNET_PILS_get_identity(const struct GNUNET_PILS_Handle *handle)
Return the current peer identity of a given handle.
void GNUNET_PILS_feed_addresses(struct GNUNET_PILS_Handle *handle, const struct GNUNET_HELLO_Builder *addresses_builder)
Feed a set of addresses to pils so that it will generate a new peer id based on the given set of addr...
#define GNUNET_SIGNATURE_PURPOSE_TRANSPORT_CHALLENGE
Signature by a peer affirming that it received a challenge (and stating how long it expects the addre...
#define GNUNET_SIGNATURE_PURPOSE_TRANSPORT_EPHEMERAL
Signature by a peer affirming that the given ephemeral key is currently in use by that peer's transpo...
#define GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_INITIATOR
Signature by a peer affirming that it originated the DV path.
#define GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_HOP
Signature by a peer affirming that it is on a DV path.
#define GNUNET_SIGNATURE_PURPOSE_TRANSPORT_ADDRESS
Signature by a peer affirming that this is one of its addresses for the given time period.
API to create, modify and access statistics.
API of the transport service towards the communicator processes.
#define GNUNET_TRANSPORT_QUEUE_LENGTH_UNLIMITED
Queue length.
GNUNET_TRANSPORT_CommunicatorCharacteristics
What characteristics does this communicator have?
GNUNET_TRANSPORT_ConnectionStatus
Possible states of a connection.
@ GNUNET_TRANSPORT_CC_RELIABLE
Transmission is reliabile (with ACKs), e.g.
@ GNUNET_TRANSPORT_LINK_ROUTE_DV
Over a distance vector path.
@ GNUNET_TRANSPORT_LINK_ROUTE_DIRECT
Over one or more queues to a directly connected neighbour.
@ GNUNET_TRANSPORT_CS_DOWN
Connection is down.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_yesno(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option)
Get a configuration value that should be in a set of "YES" or "NO".
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_kem_decaps(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, const struct GNUNET_CRYPTO_HpkeEncapsulation *c, struct GNUNET_ShortHashCode *prk)
Decapsulate a key for a private EdDSA key.
uint64_t GNUNET_CRYPTO_random_u64(uint64_t max)
Generate a random unsigned 64-bit value.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_aead_decrypt(size_t ct_len, const unsigned char ct[ct_len], size_t aad_len, const unsigned char aad[aad_len], const struct GNUNET_CRYPTO_AeadSecretKey *key, const struct GNUNET_CRYPTO_AeadNonce *nonce, const struct GNUNET_CRYPTO_AeadMac *mac, void *pt)
Decrypt the given data using XChaCha20-Poly1305.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_sign_(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, const struct GNUNET_CRYPTO_SignaturePurpose *purpose, struct GNUNET_CRYPTO_EddsaSignature *sig)
EdDSA sign a given block.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_aead_encrypt(size_t pt_len, const unsigned char pt[pt_len], size_t aad_len, const unsigned char aad[aad_len], const struct GNUNET_CRYPTO_AeadSecretKey *key, const struct GNUNET_CRYPTO_AeadNonce *nonce, void *ct, struct GNUNET_CRYPTO_AeadMac *mac)
Encrypt the given data using XChaCha20-Poly1305.
void GNUNET_CRYPTO_random_block(void *buffer, size_t length)
Fill block with a random values.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_kem_encaps(const struct GNUNET_CRYPTO_EddsaPublicKey *pub, struct GNUNET_CRYPTO_HpkeEncapsulation *c, struct GNUNET_ShortHashCode *prk)
Encapsulate key material for a EdDSA public key.
#define GNUNET_CRYPTO_eddsa_verify(purp, ps, sig, pub)
Verify EdDSA signature.
uint32_t GNUNET_CRYPTO_random_u32(uint32_t i)
Produce a random value.
#define GNUNET_CONTAINER_MDLL_remove(mdll, head, tail, element)
Remove an element from a MDLL.
#define GNUNET_CONTAINER_MDLL_insert_tail(mdll, head, tail, element)
Insert an element at the tail of a MDLL.
#define GNUNET_CONTAINER_MDLL_insert_after(mdll, head, tail, other, element)
Insert an element into a MDLL after the given other element.
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_MDLL_insert(mdll, head, tail, element)
Insert an element at the head of a MDLL.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
struct GNUNET_CONTAINER_MultiUuidmap * GNUNET_CONTAINER_multiuuidmap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_contains(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Check if the map contains any value under the given key (including values that are NULL).
void * GNUNET_CONTAINER_multipeermap_get(const struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key)
Given a key find a value in the map matching the key.
int GNUNET_CONTAINER_multihashmap32_get_multiple(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, GNUNET_CONTAINER_MultiHashMapIterator32Callback it, void *it_cls)
Iterate over all entries in the map that match a particular key.
int GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap32_put(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multipeermap_contains(const struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key)
Check if the map contains any value under the given key (including values that are NULL).
void GNUNET_CONTAINER_multipeermap_destroy(struct GNUNET_CONTAINER_MultiPeerMap *map)
Destroy a hash map.
struct GNUNET_CONTAINER_MultiHashMap32 * GNUNET_CONTAINER_multihashmap32_create(unsigned int len)
Create a 32-bit key multi hash map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap32_remove(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, const void *value)
Remove the given key-value pair from the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_remove(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, const void *value)
Remove the given key-value pair from the map.
int GNUNET_CONTAINER_multipeermap_iterate(struct GNUNET_CONTAINER_MultiPeerMap *map, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map.
unsigned int GNUNET_CONTAINER_multihashmap32_size(const struct GNUNET_CONTAINER_MultiHashMap32 *map)
Get the number of key-value pairs in the map.
struct GNUNET_CONTAINER_MultiShortmap * GNUNET_CONTAINER_multishortmap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multishortmap_put(struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_put(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
unsigned int GNUNET_CONTAINER_multihashmap_size(const struct GNUNET_CONTAINER_MultiHashMap *map)
Get the number of key-value pairs in the map.
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multiuuidmap_remove(struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key, const void *value)
Remove the given key-value pair from the map.
void GNUNET_CONTAINER_multiuuidmap_destroy(struct GNUNET_CONTAINER_MultiUuidmap *map)
Destroy a hash map.
struct GNUNET_CONTAINER_MultiPeerMap * GNUNET_CONTAINER_multipeermap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
void GNUNET_CONTAINER_multishortmap_destroy(struct GNUNET_CONTAINER_MultiShortmap *map)
Destroy a hash map.
void GNUNET_CONTAINER_multihashmap32_destroy(struct GNUNET_CONTAINER_MultiHashMap32 *map)
Destroy a 32-bit key hash map.
int GNUNET_CONTAINER_multipeermap_get_multiple(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map that match a particular key.
unsigned int GNUNET_CONTAINER_multishortmap_size(const struct GNUNET_CONTAINER_MultiShortmap *map)
Get the number of key-value pairs in the map.
unsigned int GNUNET_CONTAINER_multipeermap_size(const struct GNUNET_CONTAINER_MultiPeerMap *map)
Get the number of key-value pairs in the map.
int GNUNET_CONTAINER_multipeermap_put(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
int GNUNET_CONTAINER_multihashmap32_iterate(struct GNUNET_CONTAINER_MultiHashMap32 *map, GNUNET_CONTAINER_MultiHashMapIterator32Callback it, void *it_cls)
Iterate over all entries in the map.
int GNUNET_CONTAINER_multishortmap_remove(struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, const void *value)
Remove the given key-value pair from the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multiuuidmap_iterate(struct GNUNET_CONTAINER_MultiUuidmap *map, GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multiuuidmap_put(struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
void * GNUNET_CONTAINER_multiuuidmap_get(const struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key)
Given a key find a value in the map matching the key.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multipeermap_remove(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, const void *value)
Remove the given key-value pair from the map.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY
There must only be one value per key; storing a value should fail if a value under the same key alrea...
void * GNUNET_CONTAINER_heap_remove_node(struct GNUNET_CONTAINER_HeapNode *node)
Removes a node from the heap.
void * GNUNET_CONTAINER_heap_peek(const struct GNUNET_CONTAINER_Heap *heap)
Get element stored at the root of heap.
void GNUNET_CONTAINER_heap_update_cost(struct GNUNET_CONTAINER_HeapNode *node, GNUNET_CONTAINER_HeapCostType new_cost)
Updates the cost of any node in the tree.
struct GNUNET_CONTAINER_HeapNode * GNUNET_CONTAINER_heap_insert(struct GNUNET_CONTAINER_Heap *heap, void *element, GNUNET_CONTAINER_HeapCostType cost)
Inserts a new element into the heap.
struct GNUNET_CONTAINER_Heap * GNUNET_CONTAINER_heap_create(enum GNUNET_CONTAINER_HeapOrder order)
Create a new heap.
void GNUNET_CONTAINER_heap_destroy(struct GNUNET_CONTAINER_Heap *heap)
Destroys the heap.
@ GNUNET_CONTAINER_HEAP_ORDER_MIN
Heap with the minimum cost at the root.
void GNUNET_HELLO_parser_free(struct GNUNET_HELLO_Parser *parser)
Release resources of a builder.
void GNUNET_HELLO_builder_free(struct GNUNET_HELLO_Builder *builder)
Release resources of a builder.
struct GNUNET_HELLO_Builder * GNUNET_HELLO_builder_new()
Allocate builder.
void GNUNET_HELLO_builder_iterate(const struct GNUNET_HELLO_Builder *builder, GNUNET_HELLO_UriCallback uc, void *uc_cls)
Iterate over URIs in a builder.
struct GNUNET_HELLO_Builder * GNUNET_HELLO_builder_from_parser(const struct GNUNET_HELLO_Parser *parser, struct GNUNET_PeerIdentity *pid)
Allocate builder from parser.
const struct GNUNET_PeerIdentity * GNUNET_HELLO_parser_iterate(const struct GNUNET_HELLO_Parser *parser, GNUNET_HELLO_UriCallback uc, void *uc_cls)
Iterate over URIs in a parser.
struct GNUNET_MQ_Envelope * GNUNET_HELLO_parser_to_env(const struct GNUNET_HELLO_Parser *parser)
Generate envelope with GNUnet HELLO message (including peer ID) from a parser.
enum GNUNET_GenericReturnValue GNUNET_HELLO_builder_address_list_cmp(const struct GNUNET_HELLO_Builder *abuilder, const struct GNUNET_HELLO_Builder *bbuilder)
Compare address lists of two builders.
enum GNUNET_GenericReturnValue GNUNET_HELLO_builder_del_address(struct GNUNET_HELLO_Builder *builder, const char *address)
Remove individual address from the builder.
const struct GNUNET_PeerIdentity * GNUNET_HELLO_parser_get_id(const struct GNUNET_HELLO_Parser *parser)
Get the PeerIdentity for this builder.
#define GNUNET_HELLO_ADDRESS_EXPIRATION
For how long are HELLO signatures valid?
struct GNUNET_HELLO_Parser * GNUNET_HELLO_parser_from_msg(const struct GNUNET_MessageHeader *msg, const struct GNUNET_PeerIdentity *pid)
Parse msg.
enum GNUNET_GenericReturnValue GNUNET_HELLO_builder_add_address(struct GNUNET_HELLO_Builder *builder, const char *address)
Add individual address to the builder.
char * GNUNET_HELLO_address_to_prefix(const char *address)
Given an address as a string, extract the prefix that identifies the communicator offering transmissi...
struct GNUNET_MQ_Envelope * GNUNET_HELLO_builder_to_env(const struct GNUNET_HELLO_Builder *builder, const struct GNUNET_PeerIdentity *pid, const struct GNUNET_CRYPTO_EddsaSignature *sig, struct GNUNET_TIME_Absolute expiration_time)
Generate envelope with GNUnet HELLO message (including peer ID) from a builder.
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32.
#define GNUNET_is_zero(a)
Check that memory in a is all zeros.
uint16_t type
The type of the message (GNUNET_MESSAGE_TYPE_XXXX), in big-endian format.
#define GNUNET_log(kind,...)
void GNUNET_CRYPTO_hash_context_read(struct GNUNET_HashContext *hc, const void *buf, size_t size)
Add data to be hashed.
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
GNUNET_SCHEDULER_Priority
Valid task priorities.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32;.
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.
void GNUNET_CRYPTO_hash_context_finish(struct GNUNET_HashContext *hc, struct GNUNET_HashCode *r_hash)
Finish the hash computation.
#define GNUNET_ALIGN
gcc-ism to force alignment; we use this to align char-arrays that may then be cast to 'struct's.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
GNUNET_GenericReturnValue
Named constants for return values.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
struct GNUNET_HashContext * GNUNET_CRYPTO_hash_context_start(void)
Start incremental hashing operation.
#define GNUNET_static_assert(cond)
#define GNUNET_PACKED
gcc-ism to get packed structs.
@ GNUNET_SCHEDULER_PRIORITY_BACKGROUND
Run as background job (higher than idle, lower than default).
@ GNUNET_SCHEDULER_PRIORITY_DEFAULT
Run with the default priority (normal P2P operations).
const char * GNUNET_uuid2s(const struct GNUNET_Uuid *uuid)
Convert a UUID to a string (for printing debug messages).
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
const char * GNUNET_sh2s(const struct GNUNET_ShortHashCode *shc)
Convert a short hash value to a string (for printing debug messages).
const char * GNUNET_i2s_full(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
const char * GNUNET_i2s2(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
#define GNUNET_EXTRA_LOGGING
define GNUNET_EXTRA_LOGGING if using this header outside the GNUnet source tree where gnunet_config....
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_strndup(a, length)
Wrapper around GNUNET_xstrndup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_check_zero_termination(m)
Insert code for a "check_" function that verifies that a given variable-length message received over ...
void GNUNET_MQ_discard(struct GNUNET_MQ_Envelope *mqm)
Discard the message queue message, free all allocated resources.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
#define GNUNET_MQ_check_boxed_message(m)
Insert code for a "check_" function that verifies that a given variable-length message received over ...
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
GNUNET_MQ_PriorityPreferences
Per envelope preferences and priorities.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
void GNUNET_MQ_notify_sent(struct GNUNET_MQ_Envelope *ev, GNUNET_SCHEDULER_TaskCallback cb, void *cb_cls)
Call a callback once the envelope has been sent, that is, sending it can not be canceled anymore.
const struct GNUNET_MessageHeader * GNUNET_MQ_env_get_msg(const struct GNUNET_MQ_Envelope *env)
Obtain message contained in envelope.
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
enum GNUNET_GenericReturnValue GNUNET_MQ_try_handle_message(const struct GNUNET_MQ_MessageHandler *handlers, const struct GNUNET_MessageHeader *mh)
Same as GNUNET_MQ_handle_message(), except that a message for which no handler is registered is not l...
@ GNUNET_MQ_PRIO_BACKGROUND
Lowest priority, i.e.
@ GNUNET_MQ_PREF_UNRELIABLE
Flag to indicate that unreliable delivery is acceptable.
@ GNUNET_MQ_PREF_LOW_LATENCY
Flag to indicate that low latency is important.
void GNUNET_is_burst_ready(struct GNUNET_TIME_Relative rtt_average, struct GNUNET_BurstSync *burst_sync, GNUNET_SCHEDULER_TaskCallback task, struct GNUNET_StartBurstCls *task_cls)
Checks if we are ready and starts burst when we and the other peer is ready.
struct GNUNET_NAT_Handle * GNUNET_NAT_register(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *config_section, uint8_t proto, unsigned int num_addrs, const struct sockaddr **addrs, const socklen_t *addrlens, GNUNET_NAT_AddressCallback address_callback, GNUNET_NAT_ReversalCallback reversal_callback, void *callback_cls)
Attempt to enable port redirection and detect public IP address contacting UPnP or NAT-PMP routers on...
void GNUNET_NAT_unregister(struct GNUNET_NAT_Handle *nh)
Stop port redirection and public IP address detection for the given handle.
void GNUNET_NAT_add_global_address(struct GNUNET_NAT_Handle *nh, char *addr, unsigned int address_length)
Add global address to the list of addresses and notify clients.
GNUNET_NetworkType
Types of networks (with separate quotas) we support.
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_gnunet(void)
Return default project data used by 'libgnunetutil' for GNUnet.
void GNUNET_PEERSTORE_monitor_stop(struct GNUNET_PEERSTORE_Monitor *zm)
Stop monitoring.
struct GNUNET_PEERSTORE_IterateContext * GNUNET_PEERSTORE_iteration_start(struct GNUNET_PEERSTORE_Handle *h, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, GNUNET_PEERSTORE_Processor callback, void *callback_cls)
Iterate over peerstore entries.
void GNUNET_PEERSTORE_iteration_next(struct GNUNET_PEERSTORE_IterateContext *ic, uint64_t limit)
Continue an iteration.
void GNUNET_PEERSTORE_store_cancel(struct GNUNET_PEERSTORE_StoreContext *sc)
Cancel a store request.
#define GNUNET_PEERSTORE_TRANSPORT_BACKCHANNEL_MONOTIME
Key used to store sender's monotonic time from backchannel messages.
void GNUNET_PEERSTORE_disconnect(struct GNUNET_PEERSTORE_Handle *h)
Disconnect from the PEERSTORE service.
#define GNUNET_PEERSTORE_TRANSPORT_URLADDRESS_KEY
Key used for storing addresses in URL format in the peerstore.
struct GNUNET_PEERSTORE_Monitor * GNUNET_PEERSTORE_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg, int iterate_first, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_SCHEDULER_TaskCallback sync_cb, void *sync_cb_cls, GNUNET_PEERSTORE_Processor callback, void *callback_cls)
Request watching a given key The monitoring can be filtered to contain only records matching peer and...
#define GNUNET_PEERSTORE_TRANSPORT_DVLEARN_MONOTIME
Key used to store sender's monotonic time from DV learn messages.
struct GNUNET_PEERSTORE_Handle * GNUNET_PEERSTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the PEERSTORE service.
void GNUNET_PEERSTORE_monitor_next(struct GNUNET_PEERSTORE_Monitor *zm, uint64_t limit)
Calls the monitor processor specified in GNUNET_PEERSTORE_monitor_start for the next record(s).
void GNUNET_PEERSTORE_hello_add_cancel(struct GNUNET_PEERSTORE_StoreHelloContext *huc)
Cancel the request to add a hello.
struct GNUNET_PEERSTORE_StoreContext * GNUNET_PEERSTORE_store(struct GNUNET_PEERSTORE_Handle *h, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, const void *value, size_t size, struct GNUNET_TIME_Absolute expiry, enum GNUNET_PEERSTORE_StoreOption options, GNUNET_PEERSTORE_Continuation cont, void *cont_cls)
Store a new entry in the PEERSTORE.
#define GNUNET_PEERSTORE_TRANSPORT_HELLO_KEY
Key used for storing HELLOs in the peerstore.
void GNUNET_PEERSTORE_iteration_stop(struct GNUNET_PEERSTORE_IterateContext *ic)
Cancel an iteration.
#define GNUNET_PEERSTORE_HELLO_KEY
Key used for storing HELLO in the peerstore.
struct GNUNET_PEERSTORE_StoreHelloContext * GNUNET_PEERSTORE_hello_add(struct GNUNET_PEERSTORE_Handle *h, const struct GNUNET_MessageHeader *msg, GNUNET_PEERSTORE_Continuation cont, void *cont_cls)
Add hello to peerstore.
@ GNUNET_PEERSTORE_STOREOPTION_MULTIPLE
Possibly store multiple values under given key.
@ GNUNET_PEERSTORE_STOREOPTION_REPLACE
Delete any previous values for the given key before storing the given value.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_VALIDATION_CHALLENGE
P2P message: transport requests confirmation that an address works.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG_ACK
transport acknowledges processing an incoming message
#define GNUNET_MESSAGE_TYPE_TRANSPORT_LINK_LIST_RESPONSE
Information about a single virtual link, in response to a GNUNET_MESSAGE_TYPE_TRANSPORT_LINK_LIST_REQ...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT
Message from TRANSPORT notifying about a client that connected to us.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_TEARDOWN
inform transport that a queue was torn down
#define GNUNET_MESSAGE_TYPE_TRANSPORT_REQUEST_HELLO_VALIDATION
Type of the 'struct RequestHelloValidationMessage' send by clients to TRANSPORT to trigger validation...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_START
Message from the core saying that the transport server should start giving it messages.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_DATA
Message sent to indicate to a monitor about events.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_LINK_LIST_REQUEST
Request a one-shot listing of the virtual links transport currently has, with their flow control stat...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_NEW_COMMUNICATOR
Message sent to indicate to the transport which address prefix is supported by a communicator.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_RECV_OK
Message telling transport to limit its receive rate.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_FRAGMENT
Type of a fragment of a CORE message created by transport to adjust message length to a queue's MTU.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_FAIL
Response from communicator: address bogus, will not try to create queue.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_DV_BOX
Source-routed transport message based DV information gathered.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_RELIABILITY_BOX
Wrapper around non-fragmented CORE message used to measure RTT and ensure reliability.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SUGGEST_CANCEL
Type of the 'struct ExpressPreferenceMessage' send by clients to TRANSPORT to abandon bandwidth prefe...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_RECV
Message from TRANSPORT notifying about a message that was received.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_BACKCHANNEL_ENCAPSULATION
Message type used between transport services when they internally forward communicator backchannel me...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE
transport tells communicator it wants a queue
#define GNUNET_MESSAGE_TYPE_TRANSPORT_DV_LEARN
Message sent for topology discovery at transport level.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_BURST_FINISHED
Burst message we send to another peer for hole punching.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_COMMUNICATOR_BACKCHANNEL
Tell transport that it should assist with exchanging a message between communicators.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_DISCONNECT
Message from TRANSPORT notifying about a client that disconnected from us.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG
inform transport about an incoming message
#define GNUNET_MESSAGE_TYPE_TRANSPORT_START_BURST
Burst message we send to another peer for hole punching.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_OK
Response from communicator: will try to create queue.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_COMMUNICATOR_BACKCHANNEL_INCOMING
Transport signalling incoming backchannel message to a communicator.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_LINK_LIST_RESPONSE_END
End of the responses to a GNUNET_MESSAGE_TYPE_TRANSPORT_LINK_LIST_REQUEST.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG_ACK
communicator tells transports that message was sent
#define GNUNET_MESSAGE_TYPE_TRANSPORT_ADD_ADDRESS
inform transport to add an address of this peer
#define GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_START
Message sent to indicate to the transport that a monitor wants to observe certain events.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_DEL_ADDRESS
inform transport to delete an address of this peer
#define GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_VALIDATION_RESPONSE
P2P message: transport proves that an address worked.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_FLOW_CONTROL
Transport signalling incoming backchannel message to a communicator.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG
transport tells communicator it wants to transmit
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SEND
Request to TRANSPORT to transmit a message.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK
Confirmation from TRANSPORT that message for transmission has been queued (and that the next message ...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_RELIABILITY_ACK
Confirmation for a GNUNET_MESSAGE_TYPE_TRANSPORT_RELIABILITY_BOX.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_SETUP
inform transport that a queue was setup to talk to some peer
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SUGGEST
Type of the 'struct ExpressPreferenceMessage' send by clients to TRANSPORT to establish bandwidth pre...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_UPDATE
inform transport that a queue was updated
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_at(struct GNUNET_TIME_Absolute at, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run at the specified time.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received,...
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed_with_priority(struct GNUNET_TIME_Relative delay, enum GNUNET_SCHEDULER_Priority priority, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
#define GNUNET_SERVICE_MAIN(pd, service_name, service_options, init_cb, connect_cb, disconnect_cb, cls,...)
Creates the "main" function for a GNUnet service.
void GNUNET_SERVICE_shutdown(struct GNUNET_SERVICE_Handle *sh)
Explicitly stops the service.
void GNUNET_SERVICE_client_mark_monitor(struct GNUNET_SERVICE_Client *c)
Set the 'monitor' flag on this client.
void GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c)
Ask the server to disconnect from the given client.
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
@ GNUNET_SERVICE_OPTION_SOFT_SHUTDOWN
Trigger a SOFT server shutdown on signals, allowing active non-monitor clients to complete their tran...
struct GNUNET_STATISTICS_Handle * GNUNET_STATISTICS_create(const char *subsystem, const struct GNUNET_CONFIGURATION_Handle *cfg)
Get handle for the statistics service.
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
void GNUNET_STATISTICS_destroy(struct GNUNET_STATISTICS_Handle *h, int sync_first)
Destroy a handle (free all state associated with it).
size_t GNUNET_STRINGS_base64_encode(const void *in, size_t len, char **output)
Encode into Base64.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_min(struct GNUNET_TIME_Relative t1, struct GNUNET_TIME_Relative t2)
Return the minimum of two relative time values.
const char * GNUNET_TIME_relative2s(struct GNUNET_TIME_Relative delta, bool do_round)
Give relative time in human-readable fancy format.
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
struct GNUNET_TIME_Relative GNUNET_TIME_relative_ntoh(struct GNUNET_TIME_RelativeNBO a)
Convert relative time from network byte order.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence)
Get the duration of an operation as the difference of the current time and the given start time "henc...
struct GNUNET_TIME_Relative GNUNET_TIME_relative_max(struct GNUNET_TIME_Relative t1, struct GNUNET_TIME_Relative t2)
Return the maximum of two relative time values.
#define GNUNET_TIME_relative_cmp(t1, op, t2)
Compare two relative times.
#define GNUNET_TIME_UNIT_SECONDS
One second.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining(struct GNUNET_TIME_Absolute future)
Given a timestamp in the future, how much time remains until then?
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_max(struct GNUNET_TIME_Absolute t1, struct GNUNET_TIME_Absolute t2)
Return the maximum of two absolute time values.
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
struct GNUNET_TIME_Relative GNUNET_TIME_randomized_backoff(struct GNUNET_TIME_Relative rt, struct GNUNET_TIME_Relative threshold)
Randomized exponential back-off, starting at 1 ms and going up by a factor of 2+r,...
struct GNUNET_TIME_Relative GNUNET_TIME_relative_subtract(struct GNUNET_TIME_Relative a1, struct GNUNET_TIME_Relative a2)
Subtract relative timestamp from the other.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
#define GNUNET_TIME_UNIT_MINUTES
One minute.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply_double(struct GNUNET_TIME_Relative rel, double factor)
Multiply relative time by a given factor.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_add(struct GNUNET_TIME_Relative a1, struct GNUNET_TIME_Relative a2)
Add relative times together.
struct GNUNET_TIME_Relative GNUNET_TIME_randomize(struct GNUNET_TIME_Relative r)
Return a random time value between 0.5*r and 1.5*r.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_subtract(struct GNUNET_TIME_Absolute start, struct GNUNET_TIME_Relative duration)
Subtract a given relative duration from the given start time.
struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute(struct GNUNET_TIME_Relative rel)
Convert relative time to an absolute time in the future.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min(struct GNUNET_TIME_Absolute t1, struct GNUNET_TIME_Absolute t2)
Return the minimum of two absolute time values.
#define GNUNET_TIME_UNIT_ZERO
Relative time zero.
struct GNUNET_TIME_RelativeNBO GNUNET_TIME_relative_hton(struct GNUNET_TIME_Relative a)
Convert relative time to network byte order.
#define GNUNET_TIME_absolute_cmp(t1, op, t2)
Compare two absolute times.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_add(struct GNUNET_TIME_Absolute start, struct GNUNET_TIME_Relative duration)
Add a given relative duration to the given start time.
#define GNUNET_TIME_UNIT_ZERO_ABS
Absolute time zero.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get_monotonic(const struct GNUNET_CONFIGURATION_Handle *cfg)
Obtain the current time and make sure it is monotonically increasing.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Divide relative time by a given factor.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_difference(struct GNUNET_TIME_Absolute start, struct GNUNET_TIME_Absolute end)
Compute the time difference between the given start and end times.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
const char * GNUNET_STRINGS_absolute_time_to_string(struct GNUNET_TIME_Absolute t)
Like asctime, except for GNUnet time.
#define GNUNET_TIME_UNIT_FOREVER_ABS
Constant used to specify "forever".
#define GNUNET_TIME_STD_BACKOFF(r)
Perform our standard exponential back-off calculation, starting at 1 ms and then going by a factor of...
static unsigned int size
Size of the "table".
static struct GNUNET_MQ_Handle * mq
Our connection to the resolver service, created on-demand, but then persists until error or shutdown.
static struct GNUNET_SCHEDULER_TaskContext tc
Task context of the current task.
static struct GNUNET_TIME_Relative delta
Data structure in which we track acknowledgements still to be sent to the.
struct GNUNET_SCHEDULER_Task * task
Task scheduled either to transmit the cumulative ACK message, or to clean up this data structure afte...
struct GNUNET_TIME_Absolute min_transmission_time
When is task run (only used if num_acks is non-zero)?
struct TransportCummulativeAckPayload ack_uuids[64]
ACK data being accumulated.
struct GNUNET_PeerIdentity target
Target peer for which we are accumulating ACKs here.
unsigned int num_acks
Number of entries used in ack_uuids.
uint32_t ack_counter
Counter to produce the ack_counter in the struct TransportReliabilityAckMessage.
Unique identifier to map an acknowledgement to a transmission.
struct GNUNET_Uuid value
The UUID value.
size_t size
Capacity of tgnas, so that a drift between the cached ‘number_of_addresses’ / ‘size_of_global_address...
One of the addresses of this peer.
struct GNUNET_TIME_Relative expiration
What is a typical lifetime the communicator expects this address to have? (Always from now....
uint32_t aid
Address identifier used by the communicator.
struct GNUNET_TIME_Relative pils_backoff
Backoff used while waiting for PILS to hand us our peer identity.
size_t signed_address_len
Signed address length.
enum GNUNET_NetworkType nt
Network type offered by this address.
struct AddressListEntry * prev
Kept in a DLL.
struct TransportClient * tc
Which communicator provides this address?
struct AddressListEntry * next
Kept in a DLL.
struct GNUNET_PEERSTORE_StoreHelloContext * shc
Store hello handle.
void * signed_address
Signed address.
struct PilsAddressSignContext * pc
Context of the sign-and-store chain currently running for this entry, or NULL.
const char * address
The actual address.
struct GNUNET_SCHEDULER_Task * st
Task to periodically do st operation.
struct GNUNET_PEERSTORE_StoreContext * sc
Current context for storing this address in the peerstore.
A Backtalker is a peer sending us backchannel messages.
struct GNUNET_TIME_Absolute timeout
When will this entry time out?
struct CommunicatorMessageContext * cmc
Communicator context waiting on this backchannel's get, or NULL.
struct GNUNET_CRYPTO_HpkeEncapsulation last_ephemeral
Last (valid) ephemeral key received from this sender.
struct GNUNET_PEERSTORE_StoreContext * sc
Handle to a PEERSTORE store operation for this pid's monotonic_time.
struct GNUNET_SCHEDULER_Task * task
Task associated with this backtalker.
size_t body_size
Number of bytes of the original message body that follows after this struct.
struct GNUNET_TIME_Absolute monotonic_time
Last (valid) monotonic time received from this sender.
struct GNUNET_PEERSTORE_IterateContext * get
Handle for an operation to fetch monotonic_time information from the PEERSTORE, or NULL.
struct GNUNET_PeerIdentity pid
Peer this is about.
Closure for check_known_address.
struct ValidationState * vs
Set to a matching validation state, if one was found.
const char * address
Set to the address we are looking for.
Closure for check_known_challenge.
struct ValidationState * vs
Set to a matching validation state, if one was found.
const struct GNUNET_CRYPTO_ChallengeNonceP * challenge
Set to the challenge we are looking for.
Context from handle_incoming_msg().
unsigned int client_resumed
Did we already call GNUNET_SERVICE_client_continue()? That call is per client, not per message,...
struct CommunicatorMessageContext * next
Kept in a DLL of struct VirtualLink if waiting for CORE flow control to unchoke.
uint16_t total_hops
Number of hops the message has travelled (if DV-routed).
struct GNUNET_TRANSPORT_IncomingMessage im
Additional information for flow control and about the sender.
const struct GNUNET_MessageHeader * mh
The message to demultiplex.
unsigned int ack_sent
Did we already send the flow control ACK to the communicator? The ACK is per-message and expresses CO...
struct CommunicatorMessageContext * prev
Kept in a DLL of struct VirtualLink if waiting for CORE flow control to unchoke.
struct TransportClient * tc
Which communicator provided us with the message.
Message from the transport service to the library informing about neighbors.
struct GNUNET_PeerIdentity id
Identity of the new neighbour.
Closure for core_env_sent_cb.
uint16_t isize
By how much should we increment vl's incoming_fc_window_size_used once we are done sending to CORE?...
struct CoreSentContext * next
Kept in a DLL to clear vl in case vl is lost.
struct VirtualLink * vl
Virtual link this is about.
struct CoreSentContext * prev
Kept in a DLL to clear vl in case vl is lost.
uint16_t size
How big was the message.
An entry describing a peer on a path in a struct TransportDVLearnMessage message.
struct GNUNET_CRYPTO_EddsaSignature hop_sig
Signature of this hop over the path, of purpose GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_HOP.
struct GNUNET_PeerIdentity hop
Identity of a peer on the path.
Message from the transport service to the library informing about disconnects.
One possible hop towards a DV target.
struct PerformanceData pd
Performance data for this transmission possibility.
struct PendingAcknowledgement * pa_head
Head of DLL of PAs that used our path.
unsigned int distance
Number of hops in total to the target (excluding next_hop and target itself).
struct DistanceVectorHop * next_neighbour
Kept in a MDLL.
struct Neighbour * next_hop
What would be the next hop to target?
struct GNUNET_TIME_Absolute timeout
At what time do we forget about this path unless we see it again while learning?
struct DistanceVector * dv
Distance vector entry this hop belongs with.
const struct GNUNET_PeerIdentity * path
Array of distance hops to the target, excluding next_hop.
struct DistanceVectorHop * next_dv
Kept in a MDLL, sorted by timeout.
struct GNUNET_TIME_Absolute path_valid_until
For how long is the validation of this path considered valid? Set to ZERO if the path is learned by s...
struct DistanceVectorHop * prev_dv
Kept in a MDLL, sorted by timeout.
struct DistanceVectorHop * prev_neighbour
Kept in a MDLL.
struct PendingAcknowledgement * pa_tail
Tail of DLL of PAs that used our path.
Entry in our dv_routes table, representing a (set of) distance vector routes to a particular peer.
struct DistanceVectorHop * dv_head
Known paths to target.
struct VirtualLink * vl
Do we have a confirmed working queue and are thus visible to CORE? If so, this is the virtual link,...
struct GNUNET_TIME_Absolute monotime
What time was sender_sig created.
struct GNUNET_CRYPTO_EddsaSignature sender_sig
Signature affirming ephemeral_key of type GNUNET_SIGNATURE_PURPOSE_TRANSPORT_EPHEMERAL.
struct DistanceVectorHop * dv_tail
Known paths to target.
struct GNUNET_CRYPTO_HpkeEncapsulation ephemeral_key
Our ephemeral key.
struct GNUNET_ShortHashCode * km
Master secret for the setup of the Key material for the backchannel.
struct GNUNET_PeerIdentity target
To which peer is this a route?
struct GNUNET_TIME_Absolute ephemeral_validity
How long is sender_sig valid.
struct GNUNET_SCHEDULER_Task * timeout_task
Task scheduled to purge expired paths from dv_head MDLL.
Content signed by each peer during DV learning.
struct GNUNET_PeerIdentity pred
Identity of the previous peer on the path.
struct GNUNET_CRYPTO_SignaturePurpose purpose
Purpose is GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_HOP.
struct GNUNET_CRYPTO_ChallengeNonceP challenge
Challenge value used by the initiator to re-identify the path.
struct GNUNET_PeerIdentity succ
Identity of the next peer on the path.
Content signed by the initiator during DV learning.
struct GNUNET_CRYPTO_SignaturePurpose purpose
Purpose is GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_INITIATOR.
struct GNUNET_TIME_AbsoluteNBO monotonic_time
Time at the initiator when generating the signature.
struct GNUNET_CRYPTO_ChallengeNonceP challenge
Challenge value used by the initiator to re-identify the path.
Body by which a peer confirms that it is using an ephemeral key.
struct GNUNET_TIME_AbsoluteNBO sender_monotonic_time
How long is this signature over the ephemeral key valid?
struct GNUNET_CRYPTO_SignaturePurpose purpose
Purpose is GNUNET_SIGNATURE_PURPOSE_TRANSPORT_EPHEMERAL.
struct GNUNET_PeerIdentity target
Target's peer identity.
struct GNUNET_CRYPTO_HpkeEncapsulation ephemeral_key
Ephemeral key setup by the sender for target, used to encrypt the payload.
Application client to TRANSPORT service: we would like to have address suggestions for this peer.
Closure for find_by_message_uuid.
struct ReassemblyContext * rc
Set to the reassembly context if found.
struct MessageUUIDP message_uuid
UUID to look for.
32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
Wrapper struct with the average RTT of message to some peer and if this peer und us is ready to sync.
enum GNUNET_GenericReturnValue sync_ready
Is this peer already ready to sync.
struct GNUNET_TIME_RelativeNBO rtt_average
The average RTT for the peer to communicate with.
Handle to a node in a heap.
Internal representation of the hash map.
Internal representation of the hash map.
Internal representation of the hash map.
Internal representation of the hash map.
Internal representation of the hash map.
Type of a nonce used for challenges.
struct GNUNET_ShortHashCode value
The value of the nonce.
Private ECC key encoded for transmission.
an ECC signature using EdDSA.
HPKE DHKEM encapsulation (X25519) See RFC 9180.
header of what an ECC signature signs this must be followed by "size - 8" bytes of the actual signed ...
uint32_t purpose
What does this signature vouch for? This must contain a GNUNET_SIGNATURE_PURPOSE_XXX constant (from g...
uint32_t size
How many bytes does this signature sign? (including this purpose header); in network byte order (!...
Context for building (or parsing) HELLO URIs.
Context for parsing HELLOs.
Handle to a message queue.
Message handler for a specific message type.
Handle for active NAT registrations.
Handle to the PEERSTORE service.
Context for a iterate request.
Context for a store request.
Context for a add hello uri request.
A handle for the PILS service.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_CRYPTO_EddsaPublicKey public_key
Entry in list of pending tasks.
Handle to a client that is connected to a service.
Struct wrapping information we use for starting the burst.
struct VirtualLink * vl
The VirtualLink of the peer to which we like to burst with.
struct GNUNET_TIME_Relative delay
The delay - calculate from the RTT and which peer was ready to sync first, after we will start the bu...
unsigned int sync_ready
We are ready to start the burst.
struct GNUNET_TIME_Relative rtt
The average RTT between the peers.
Time for absolute time used by GNUnet, in microseconds and in network byte order.
Time for absolute times used by GNUnet, in microseconds.
uint64_t abs_value_us
The actual value.
Time for relative time used by GNUnet, in microseconds and in network byte order.
Time for relative time used by GNUnet, in microseconds.
uint64_t rel_value_us
The actual value.
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_ADD_ADDRESS.
struct GNUNET_TIME_RelativeNBO expiration
When does the address expire?
uint32_t nt
An enum GNUNET_NetworkType in NBO.
uint32_t aid
Address identifier (used during deletion).
Add queue to the transport.
uint32_t nt
An enum GNUNET_NetworkType in NBO.
uint32_t mtu
Maximum transmission unit, in NBO.
uint64_t q_len
Queue length, in NBO.
uint32_t qid
Queue identifier (used to identify the queue).
struct GNUNET_PeerIdentity receiver
Receiver that can be addressed via the queue.
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_SETUP.
uint32_t cs
An enum GNUNET_TRANSPORT_ConnectionStatus in NBO.
Communicator goes online.
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_NEW_COMMUNICATOR.
uint32_t cc
NBO encoding of enum GNUNET_TRANSPORT_CommunicatorCharacteristics
uint32_t can_burst
The communicator can do burst msgs.
Message from transport to communicator passing along a backchannel message from the given peer pid.
struct GNUNET_PeerIdentity pid
Origin peer.
Message from communicator to transport service asking for transmission of a backchannel message with ...
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_COMMUNICATOR_BACKCHANNEL.
struct GNUNET_PeerIdentity pid
Target peer.
Communicator tells transport how queue creation went down.
uint32_t request_id
Unique ID for the request.
Transport tells communicator that it wants a new queue.
uint32_t request_id
Unique ID for the request.
struct GNUNET_PeerIdentity receiver
Receiver that can be addressed via the queue.
Remove address from the list.
uint32_t aid
Address identifier.
Remove queue, it is no longer available.
struct GNUNET_PeerIdentity receiver
Receiver that can be addressed via the queue.
uint32_t qid
Address identifier.
Transport informs us about being done with an incoming message.
struct GNUNET_PeerIdentity sender
Sender identifier of the original message.
uint64_t fc_id
Which message is being ACKed?
uint32_t reserved
Reserved (0)
Inform transport about an incoming message.
struct GNUNET_PeerIdentity neighbour_sender
Direct neighbour sender identifier.
struct GNUNET_TIME_RelativeNBO expected_address_validity
How long does the communicator believe the address on which the message was received to remain valid?
struct GNUNET_PeerIdentity sender
Sender identifier.
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG.
uint32_t fc_on
Do we use flow control or not?
uint64_t fc_id
64-bit number to identify the matching ACK.
struct GNUNET_MQ_Handle * mq
Queue to talk to the transport service.
Request a one-shot listing of our virtual links.
State of one virtual link.
uint32_t stalled
Number of messages whose flow control ACK we are withholding because core_recv_window is exhausted.
struct GNUNET_TIME_AbsoluteNBO last_fc_transmission
When did we last send a flow control message?
uint32_t fc_retransmit_count
Number of flow control retransmissions of the running task.
uint32_t num_queues
Number of queues to the neighbour, 0 if route is GNUNET_TRANSPORT_LINK_ROUTE_DV.
uint64_t incoming_fc_window_size_ram
RAM currently held for this link.
uint64_t incoming_fc_window_size_used
How much of incoming_fc_window_size the other peer used.
uint32_t pending
Number of messages queued for transmission to target.
int64_t incoming_fc_window_size_loss
Current estimate of the message loss rate for the sender.
struct GNUNET_TIME_RelativeNBO other_rtt
RTT over all DV paths, as calculated by the target.
uint64_t outbound_fc_window_size
Window the other peer granted us.
uint64_t outbound_fc_window_size_used
How much of outbound_fc_window_size we used.
uint64_t incoming_fc_window_size
Window we last granted the other peer.
uint32_t route
An ‘enum GNUNET_TRANSPORT_LinkRoute’ in NBO.
uint32_t distance
Distance of the DV path, 0 if route is GNUNET_TRANSPORT_LINK_ROUTE_DIRECT.
struct GNUNET_PeerIdentity target
Peer at the other end of the link.
struct GNUNET_TIME_RelativeNBO last_fc_rtt
RTT of the last flow control exchange.
uint32_t confirmed
GNUNET_YES if the link is confirmed, i.e.
int32_t core_recv_window
How many more messages we may hand to CORE before it must acknowledge them.
uint64_t available_fc_window_size
RAM we are willing to spend on this link.
uint32_t num_msg_pending
Messages pending (in NBO).
struct GNUNET_PeerIdentity peer
Target identifier.
struct GNUNET_TIME_AbsoluteNBO valid_until
struct GNUNET_TIME_AbsoluteNBO last_validation
uint32_t num_bytes_pending
Bytes pending (in NBO).
struct GNUNET_TIME_AbsoluteNBO next_validation
uint32_t nt
Network type (an enum GNUNET_NetworkType in NBO).
struct GNUNET_TIME_RelativeNBO rtt
Current round-trip time estimate.
uint32_t cs
Connection status (in NBO).
Request to start monitoring.
Inform transport that message was sent.
uint32_t status
Success (GNUNET_OK), failure (GNUNET_SYSERR).
uint64_t mid
Message ID of the original message.
uint32_t qid
Queue ID for the queue which was used to send the message.
struct GNUNET_PeerIdentity receiver
Receiver identifier.
Inform communicator about transport's desire to send a message.
uint32_t qid
Which queue should we use?
uint64_t mid
Message ID, used for flow control.
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG.
struct GNUNET_PeerIdentity receiver
Receiver identifier.
Message from transport to communicator to start a burst.
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_START_BURST.
struct GNUNET_TIME_RelativeNBO rtt
struct GNUNET_PeerIdentity pid
Target peer.
A UUID, a 128 bit "random" value.
Message used to notify the transport API about a message received from the network.
struct GNUNET_PeerIdentity peer
Which peer sent the message?
Another peer attempted to talk to us, we should try to establish a connection in the other direction.
struct IncomingRequest * next
Kept in a DLL.
struct IncomingRequest * prev
Kept in a DLL.
struct GNUNET_PEERSTORE_Monitor * nc
Notify context for new HELLOs.
struct GNUNET_PeerIdentity pid
Which peer is this about?
When did we launch this DV learning activity?
struct LearnLaunchEntry * next
Kept (also) in a DLL sorted by launch time.
struct GNUNET_CRYPTO_ChallengeNonceP challenge
Challenge that uniquely identifies this activity.
struct LearnLaunchEntry * prev
Kept (also) in a DLL sorted by launch time.
struct GNUNET_TIME_Absolute launch_time
When did we transmit the DV learn message (used to calculate RTT) and determine freshness of paths le...
Closure for report_link().
int include_unconfirmed
Also report links that are not confirmed?
struct TransportClient * tc
Client asking for the listing.
Unique identifier we attach to a message.
uint64_t uuid
Unique value, generated by incrementing the message_uuid_ctr of struct Neighbour.
Details about what to notify monitors about.
enum GNUNET_TRANSPORT_ConnectionStatus cs
Connection status.
struct GNUNET_TIME_Absolute last_validation
struct GNUNET_TIME_Absolute next_validation
struct GNUNET_TIME_Absolute valid_until
struct GNUNET_TIME_Relative rtt
Current round-trip time estimate.
uint32_t num_msg_pending
Messages pending.
uint32_t num_bytes_pending
Bytes pending.
Closure for dv_neighbour_selection and dv_neighbour_transmission.
const struct TransportDVLearnMessage * dvl
Original message we received.
struct GNUNET_TIME_Absolute in_time
Time we received the message.
const struct DVPathEntryP * hops
The hops taken.
uint16_t bi_history
Bitmap of bidirectional connections encountered.
unsigned int num_eligible
Number of peers eligible for selection.
unsigned int num_selections
Number of peers that were selected for forwarding.
uint32_t selections[MAX_DV_DISCOVERY_SELECTION]
Offsets of the selected peers.
uint16_t nhops
Number of hops in hops.
A neighbour that at least one communicator is connected to.
size_t size_of_global_addresses
Size of all global natted addresses for this neighbour.
struct DistanceVectorHop * dv_tail
Tail of MDLL of DV hops that have this neighbour as next hop.
struct GNUNET_CONTAINER_MultiPeerMap * natted_addresses
Map of struct TransportGlobalNattedAddress for this neighbour.
struct GNUNET_TIME_Absolute last_dv_learn_monotime
Latest DVLearn monotonic time seen from this peer.
int dv_monotime_available
Do we have the latest value for last_dv_learn_monotime from PEERSTORE yet, or are we still waiting fo...
unsigned int number_of_addresses
Number of global natted addresses for this neighbour.
struct Queue * queue_tail
Tail of DLL of queues to this peer.
struct GNUNET_PEERSTORE_StoreContext * sc
Handle to a PEERSTORE store operation to store this pid's last_dv_learn_monotime.
struct DistanceVectorHop * dv_head
Head of MDLL of DV hops that have this neighbour as next hop.
struct VirtualLink * vl
Do we have a confirmed working queue and are thus visible to CORE? If so, this is the virtual link,...
struct Queue * queue_head
Head of DLL of queues to this peer.
struct GNUNET_TIME_Absolute last_inbound
When did a communicator last hand us a message that this peer sent us directly (i....
struct GNUNET_PeerIdentity pid
Which peer is this about?
enum GNUNET_GenericReturnValue is_global_natted
A queue of this neighbour has a global natted address.
struct GNUNET_PEERSTORE_IterateContext * get
Handle for an operation to fetch last_dv_learn_monotime information from the PEERSTORE,...
Message used to notify the transport service about a message to be transmitted to another peer.
uint32_t priority
An enum GNUNET_MQ_PriorityPreferences in NBO.
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_SEND.
struct GNUNET_PeerIdentity peer
Which peer should receive the message?
Information per peer and request.
struct GNUNET_BANDWIDTH_Value32NBO bw
How much bandwidth would this tc like to see?
struct TransportClient * tc
Client responsible for the request.
enum GNUNET_MQ_PriorityPreferences pk
What kind of performance preference does this tc have?
struct GSF_PendingRequest * pr
Handle to generic request (generic: from peer or local client).
struct GNUNET_PEERSTORE_Monitor * nc
Notify context for new HELLOs.
struct GNUNET_PeerIdentity pid
Which peer is this about?
Data structure kept when we are waiting for an acknowledgement.
struct AcknowledgementUUIDP ack_uuid
Unique identifier for this transmission operation.
unsigned int num_send
How often the PendingMessage was send via the Queue of this PendingAcknowledgement.
struct PendingAcknowledgement * next_pm
If pm is non-NULL, this is the DLL in which this acknowledgement is kept in relation to its pending m...
struct PendingMessage * pm
Message that was transmitted, may be NULL if the message was ACKed via another channel.
struct PendingAcknowledgement * next_dvh
If dvh is non-NULL, this is the DLL in which this acknowledgement is kept in relation to the DVH that...
struct PendingAcknowledgement * next_pa
Pointers for the DLL of all pending acknowledgements.
struct PendingAcknowledgement * next_queue
If queue is non-NULL, this is the DLL in which this acknowledgement is kept in relation to the queue ...
struct GNUNET_TIME_Absolute transmission_time
Time of the transmission, for RTT calculation.
struct Queue * queue
Queue used for transmission, NULL if the queue has been destroyed (which may happen before we get an ...
struct DistanceVectorHop * dvh
Distance vector path chosen for this transmission, NULL if transmission was to a direct neighbour OR ...
uint16_t message_size
Number of bytes of the original message (to calculate bandwidth).
struct PendingAcknowledgement * prev_pa
Pointers for the DLL of all pending acknowledgements.
struct PendingAcknowledgement * prev_queue
If queue is non-NULL, this is the DLL in which this acknowledgement is kept in relation to the queue ...
struct PendingAcknowledgement * prev_pm
If pm is non-NULL, this is the DLL in which this acknowledgement is kept in relation to its pending m...
struct PendingAcknowledgement * prev_dvh
If dvh is non-NULL, this is the DLL in which this acknowledgement is kept in relation to the DVH that...
Context for select_best_pending_from_link().
struct GNUNET_TIME_Relative to_early_retry_delay
When will we try to transmit the message again for which it was to early to retry.
struct PendingMessage * best
Set to the best message that was found, NULL for none.
int to_early
There are pending messages, but it was to early to send one of them.
unsigned int consideration_counter
Number of pending messages we seriously considered this time.
struct DistanceVectorHop * dvh
DVH that best should take, or NULL for direct transmission.
size_t real_overhead
What is the estimated total overhead for this message?
unsigned int frags_in_flight
There is a pending messages we are sending fragments at the moment.
int frag
Did we have to fragment?
int relb
Did we have to reliability box?
List containing all messages that are yet to be send.
struct PendingMessage * tail_frag
Tail of a MDLL of fragments created for this core message.
struct PendingMessage * frag_parent
Our parent in the fragmentation tree.
enum GNUNET_MQ_PriorityPreferences prefs
Preferences for this message.
struct TransportClient * client
Client that issued the transmission request, if pmt is PMT_CORE.
struct QueueEntry * qe
Set to non-NULL value if this message is currently being given to a communicator and we are awaiting ...
struct MessageUUIDP msg_uuid
UUID to use for this message (used for reassembly of fragments, only initialized if msg_uuid_set is G...
struct PendingMessage * head_frag
Head of a MDLL of fragments created for this core message.
uint16_t bytes_msg
Size of the original message.
enum PendingMessageType pmt
Type of the pending message.
struct PendingMessage * prev_client
Kept in a MDLL of messages from this client (if pmt is PMT_CORE)
struct PendingMessage * prev_vl
Kept in a MDLL of messages for this vl.
struct PendingAcknowledgement * pa_tail
Tail of DLL of PAs for this pending message.
struct PendingMessage * next_vl
Kept in a MDLL of messages for this vl.
struct VirtualLink * vl
Target of the request (always the ultimate destination!).
struct PendingAcknowledgement * pa_head
Head of DLL of PAs for this pending message.
struct DistanceVectorHop * used_dvh
If pmt is of type PMT_DV_BOX we store the used path here.
int16_t msg_uuid_set
GNUNET_YES once msg_uuid was initialized
uint32_t frags_in_flight_round
The round we are (re)-sending fragments.
struct PendingMessage * next_client
Kept in a MDLL of messages from this client (if pmt is PMT_CORE)
uint32_t frags_in_flight
Are we sending fragments at the moment?
uint16_t frag_off
Offset at which we should generate the next fragment.
struct PendingMessage * next_frag
Kept in a MDLL of messages from this cpm (if pmt is #PMT_FRAGMENT_BOx)
uint64_t logging_uuid
UUID we use to identify this message in our logs.
uint16_t frag_count
How many fragments do we have?
struct PendingMessage * prev_frag
Kept in a MDLL of messages from this cpm (if pmt is PMT_FRAGMENT_BOX)
struct PendingMessage * bpm
This message, reliability or DV-boxed.
int16_t client_credited
GNUNET_YES once the CORE send window credit for this message has been returned to client.
struct GNUNET_TIME_Absolute next_attempt
What is the earliest time for us to retry transmission of this message?
struct GNUNET_TIME_Absolute timeout
At what time should we give up on the transmission (and no longer retry)?
struct GNUNET_PeerIdentity target
In case of a not validated neighbour, we store the target peer.
Helper context struct for HELLO update.
struct GNUNET_TIME_Absolute et
Signature expiration.
struct AddressListEntry * ale
The ale to update.
struct PilsRequest * req
Any pending PILS requests.
struct GNUNET_PILS_Operation * op
The pils operation.
struct PilsRequest * next
DLL.
struct PilsRequest * prev
DLL.
Entry identifying transmission in one of our struct Queue which still awaits an ACK.
struct QueueEntry * next
Kept as a DLL.
struct QueueEntry * prev
Kept as a DLL.
struct GNUNET_TIME_Absolute creation_timestamp
Timestamp this QueueEntry was created.
uint64_t mid
Message ID used for this message with the queue used for transmission.
struct PendingMessage * pm
Pending message this entry is for, or NULL for none.
struct Queue * queue
Queue this entry is queued with.
Closure for check_connection_quality.
unsigned int k
Decremented for each queue, for selection of the k-th queue in q.
struct Queue * q
Set to the k'th queue encountered.
unsigned int num_queues
Set to the total number of queues encountered.
unsigned int quality_count
Set to the number of quality queues encountered.
uint32_t qid
Unique identifier of this queue with the communicator.
struct QueueEntry * queue_tail
End of DLL of unacked transmission requests.
struct Queue * prev_client
Kept in a MDLL.
unsigned int queue_length
Length of the DLL starting at queue_head.
uint32_t num_msg_pending
Messages pending.
struct GNUNET_PEERSTORE_Monitor * mo
Handle for an operation to iterate through all hellos to compare the hello addresses with address whi...
uint64_t q_capacity
Capacity of the queue.
struct Queue * next_neighbour
Kept in a MDLL.
uint32_t num_bytes_pending
Bytes pending.
uint32_t priority
Queue priority.
struct Neighbour * neighbour
Which neighbour is this queue for?
int idle
Set to GNUNET_YES if this queue is idle waiting for some virtual link to give it a pending message.
struct Queue * prev_neighbour
Kept in a MDLL.
struct PerformanceData pd
Performance data for this queue.
enum GNUNET_NetworkType nt
Which network type does this queue use?
struct GNUNET_SCHEDULER_Task * transmit_task
Task scheduled for the time when this queue can (likely) transmit the next message.
struct QueueEntry * queue_head
Head of DLL of unacked transmission requests.
struct PendingAcknowledgement * pa_tail
Tail of DLL of PAs that used this queue.
struct TransportClient * tc
Which communicator offers this queue?
struct Queue * next_client
Kept in a MDLL.
enum GNUNET_GenericReturnValue is_global_natted
Set to GNUNET_YES, if this queues address is a global natted one.
struct GNUNET_TIME_Absolute validated_until
How long do we consider this address to be valid? In the past or zero if we have not yet validated it...
uint32_t mtu
Maximum transmission unit supported by this queue.
unsigned int unlimited_length
Is this queue of unlimited length.
enum GNUNET_TRANSPORT_ConnectionStatus cs
The connection status of this queue.
uint64_t mid_gen
Message ID generator for transmissions on this queue to the communicator.
struct PendingAcknowledgement * pa_head
Head of DLL of PAs that used this queue.
const char * address
Address served by the queue.
Information we keep for a message that we are reassembling.
struct GNUNET_CONTAINER_HeapNode * hn
Entry in the reassembly heap (sorted by expiration).
struct GNUNET_TIME_Absolute last_frag
Time we received the last fragment.
struct MessageUUIDP msg_uuid
Original message ID for of the message that all the fragments belong to.
struct VirtualLink * virtual_link
Which neighbour is this context for?
uint8_t * bitfield
Bitfield with msg_size bits representing the positions where we have received fragments.
uint16_t msg_size
How big is the message we are reassembling in total?
struct GNUNET_TIME_Absolute reassembly_timeout
At what time will we give up reassembly of this message?
uint16_t msg_missing
How many bytes of the message are still missing? Defragmentation is complete when msg_missing == 0.
Message used to notify the transport API that it can send another message to the transport service.
struct GNUNET_PeerIdentity peer
Which peer can CORE handle more from now?
uint32_t increase_window_delta
Number of messages by which to increase the window, greater or equal to one.
We got an address of another peer, TRANSPORT service should validate it.
Entry for the ring buffer caching messages send to core, when virtual link is available.
struct CommunicatorMessageContext * cmc
Communicator context for this ring buffer entry.
struct GNUNET_MessageHeader * mh
The message in this entry.
Message used to notify the transport API that it can send another message to the transport service.
struct GNUNET_PeerIdentity peer
Which peer can send more now?
Binary block we sign when we sign an address.
struct GNUNET_TIME_AbsoluteNBO mono_time
When was the address generated.
struct GNUNET_HashCode addr_hash GNUNET_PACKED
Hash of the address.
struct GNUNET_CRYPTO_SignaturePurpose purpose
Purpose must be GNUNET_SIGNATURE_PURPOSE_TRANSPORT_ADDRESS.
Message from the transport service to the library asking to check if both processes agree about this ...
Information we keep per GOODPUT_AGING_SLOTS about historic (or current) transmission performance.
uint64_t bytes_received
Number of bytes received and acknowledged by the other peer in the interval.
uint64_t bytes_sent
Number of bytes actually sent in the interval.
Outer layer of an encapsulated backchannel message.
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TRANSPORT_BACKCHANNEL_ENCAPSULATION.
Client connected to the transport service.
enum GNUNET_TRANSPORT_CommunicatorCharacteristics cc
Characteristics of this communicator.
struct PendingMessage * pending_msg_head
Head of list of messages pending for this client, sorted by transmission time ("next_attempt" + possi...
enum ClientType type
What type of client is this?
struct AddressListEntry * addr_tail
Tail of list of the addresses of this peer offered by this communicator.
union TransportClient::@68 details
struct TransportClient * next
Kept in a DLL.
struct GNUNET_MQ_Handle * mq
Message queue to the client.
struct GNUNET_SCHEDULER_Task * free_queue_entry_task
Task to check for timed out QueueEntry.
struct PendingMessage * pending_msg_tail
Tail of list of messages pending for this client.
struct TransportClient::@68::@72 application
Information for type CT_APPLICATION.
struct TransportClient::@68::@70 monitor
Information for type CT_MONITOR.
struct Queue * queue_head
Head of DLL of queues offered by this communicator.
struct AddressListEntry * addr_head
Head of list of the addresses of this peer offered by this communicator.
struct TransportClient::@68::@69 core
Information for type CT_CORE.
struct GNUNET_CONTAINER_MultiPeerMap * requests
Map of requests for peers the given client application would like to see connections for.
struct GNUNET_SERVICE_Client * client
Handle to the client.
struct TransportClient * prev
Kept in a DLL.
struct TransportClient::@68::@71 communicator
Information for type CT_COMMUNICATOR.
char * address_prefix
If type is CT_COMMUNICATOR, this communicator supports communicating using these addresses.
struct Queue * queue_tail
Tail of DLL of queues offered by this communicator.
unsigned int total_queue_length
Number of queue entries in all queues to this communicator.
int one_shot
Is this a one-shot monitor?
struct GNUNET_PeerIdentity peer
Peer identity to monitor the addresses of.
enum GNUNET_GenericReturnValue can_burst
Can be used for burst messages.
struct GNUNET_TIME_RelativeNBO ack_delay
How long was the ACK delayed for generating cumulative ACKs? Used to calculate the correct network RT...
struct AcknowledgementUUIDP ack_uuid
UUID of a message being acknowledged.
struct GNUNET_TIME_Absolute receive_time
When did we receive the message we are ACKing? Used to calculate the delay we introduced by cummulati...
struct AcknowledgementUUIDP ack_uuid
UUID of a message being acknowledged.
Outer layer of an encapsulated message send over multiple hops.
struct GNUNET_CRYPTO_AeadNonce iv
We use an IV here as the ephemeral_key is reused for EPHEMERAL_VALIDITY time to avoid re-signing it a...
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TRANSPORT_DV_BOX.
uint16_t num_hops
Number of hops this messages includes.
uint16_t orig_size
Size this msg had initially.
struct GNUNET_CRYPTO_HpkeEncapsulation ephemeral_key
Ephemeral key setup by the sender for target, used to encrypt the payload.
struct GNUNET_CRYPTO_AeadMac mac
HMAC over the ciphertext of the encrypted, variable-size body that follows.
uint16_t total_hops
Number of total hops this messages travelled.
uint32_t without_fc
Flag if the payload is a control message.
Plaintext of the variable-size payload that is encrypted within a struct TransportBackchannelEncapsul...
struct GNUNET_CRYPTO_EddsaSignature sender_sig
Signature of the sender over an GNUNET_SIGNATURE_PURPOSE_TRANSPORT_EPHEMERAL.
struct GNUNET_TIME_AbsoluteNBO monotonic_time
Current monotonic time of the sending transport service.
struct GNUNET_PeerIdentity sender
Sender's peer identity.
Internal message used by transport for distance vector learning.
struct GNUNET_PeerIdentity initiator
Identity of the peer that started this learning activity.
struct GNUNET_CRYPTO_ChallengeNonceP challenge
Challenge value used by the initiator to re-identify the path.
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TRANSPORT_DV_LEARN.
struct GNUNET_TIME_RelativeNBO non_network_delay
Peers receiving this message and delaying forwarding to other peers for any reason should increment t...
struct GNUNET_TIME_AbsoluteNBO monotonic_time
Time at the initiator when generating the signature.
struct GNUNET_CRYPTO_EddsaSignature init_sig
Signature of this hop over the path, of purpose GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_INITIATOR.
uint16_t num_hops
Number of hops this messages has travelled, in NBO.
uint16_t bidirectional
Bitmask of the last 16 hops indicating whether they are confirmed available (without DV) in both dire...
Message for Transport-to-Transport Flow control.
uint64_t outbound_window_size
Latest flow control window size we learned from the other peer, in bytes, in NBO.
uint32_t number_of_addresses
Number of TransportGlobalNattedAddress following the struct.
uint64_t inbound_window_size
Flow control window size in bytes, in NBO.
struct GNUNET_TIME_AbsoluteNBO sender_time
Timestamp of the sender.
uint32_t seq
Sequence number of the flow control message.
uint32_t size_of_addresses
Size of all the addresses attached to all TransportGlobalNattedAddress.
uint64_t outbound_sent
How many bytes has the sender sent that count for flow control at this time.
struct GNUNET_TIME_RelativeNBO rtt
Average RTT for the DistanceVector of the VirtualLink we tell the target.
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TRANSPORT_FLOW_CONTROL.
uint32_t sync_ready
We tell the target, if we are ready to start the burst.
Outer layer of an encapsulated fragmented application message.
uint16_t frag_off
Offset of this fragment in the overall message.
struct MessageUUIDP msg_uuid
Original message ID for of the message that all the fragments belong to.
struct AcknowledgementUUIDP ack_uuid
Unique ID of this fragment (and fragment transmission!).
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TRANSPORT_FRAGMENT.
uint16_t msg_size
Total size of the message that is being fragmented.
char * addr
The address to search for.
struct TransportGlobalNattedAddress * tgna
The struct TransportGlobalNattedAddress to set.
uint32_t address_length
Length of the address following the struct in NBO.
Confirmation that the receiver got a GNUNET_MESSAGE_TYPE_TRANSPORT_RELIABILITY_BOX.
uint32_t ack_counter
Counter of ACKs transmitted by the sender to us.
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TRANSPORT_RELIABILITY_ACK.
Outer layer of an encapsulated unfragmented application message sent over an unreliable channel.
uint32_t ack_countdown
Number of messages still to be sent before a commulative ACK is requested.
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TRANSPORT_RELIABILITY_BOX.
struct AcknowledgementUUIDP ack_uuid
Unique ID of the message used for signalling receipt of messages sent over possibly unreliable channe...
Message send to another peer to validate that it can indeed receive messages at a particular address.
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_VALIDATION_CHALLENGE.
struct GNUNET_CRYPTO_ChallengeNonceP challenge
Challenge to be signed by the receiving peer.
uint32_t reserved
Always zero.
struct GNUNET_TIME_AbsoluteNBO sender_time
Timestamp of the sender, to be copied into the reply to allow sender to calculate RTT.
Message signed by a peer to confirm that it can indeed receive messages at a particular address.
struct GNUNET_TIME_RelativeNBO validity_duration
How long does the sender believe the address on which the challenge was received to remain valid?
struct GNUNET_CRYPTO_SignaturePurpose purpose
Purpose is GNUNET_SIGNATURE_PURPOSE_TRANSPORT_CHALLENGE.
struct GNUNET_CRYPTO_ChallengeNonceP challenge
Challenge signed by the receiving peer.
Message send to a peer to respond to a #GNUNET_MESSAGE_TYPE_ADDRESS_VALIDATION_CHALLENGE.
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_VALIDATION_RESPONSE.
struct GNUNET_CRYPTO_ChallengeNonceP challenge
The challenge that was signed by the receiving peer.
uint32_t reserved
Always zero.
struct GNUNET_CRYPTO_EddsaSignature signature
The peer's signature matching the GNUNET_SIGNATURE_PURPOSE_TRANSPORT_CHALLENGE purpose.
struct GNUNET_PEERSTORE_StoreHelloContext * sc
State we keep for validation activities.
struct GNUNET_TIME_Absolute valid_until
How long did the peer claim this address to be valid? Capped at minimum of MAX_ADDRESS_VALID_UNTIL re...
struct GNUNET_PeerIdentity pid
For which peer is address to be validated (or possibly valid)? Serves as key in the validation_map.
struct GNUNET_TIME_Absolute validated_until
How long do we consider this address to be valid? In the past or zero if we have not yet validated it...
A virtual link is another reachable peer that is known to CORE.
struct GNUNET_TIME_Relative other_rtt
Average RTT for over all paths of the DistanceVector of this VirtualLink calculated by the target.
int core_recv_window
How many more messages can we send to CORE before we exhaust the receive window of CORE for this peer...
char * burst_addr
global addresses for the peer.
unsigned int confirmed
Is this VirtualLink confirmed.
uint64_t incoming_fc_window_size_used
How much of the window did the other peer successfully use (and we already passed it on to CORE)?...
uint32_t last_fc_seq
Last sequence number of a GNUNET_MESSAGE_TYPE_TRANSPORT_FLOW_CONTROL message we have received.
struct GNUNET_SCHEDULER_Task * reassembly_timeout_task
Task to free old entries from the reassembly_heap and reassembly_map.
uint64_t incoming_fc_window_size
Last flow control window size we provided to the other peer, in bytes.
unsigned int cmc_count
Number of entries in the cmc_head DLL, bounded by MAX_STALLED_CMCS.
struct GNUNET_TIME_Absolute n_challenge_time
Sender timestamp of n_challenge, used to generate out-of-order challenges (as sender's timestamps mus...
struct GNUNET_TIME_Absolute last_fc_timestamp
Sender timestamp of the last GNUNET_MESSAGE_TYPE_TRANSPORT_FLOW_CONTROL message we have received.
uint64_t outbound_fc_window_size
Our current flow control window size in bytes.
struct GNUNET_PEERSTORE_IterateContext * ic
IterationContext for searching a burst address.
uint64_t last_outbound_window_size_received
What is the most recent FC window the other peer sent us in outbound_window_size? This is basically t...
uint64_t outbound_fc_window_size_used
How much of our current flow control window size have we used (in bytes).
struct GNUNET_TIME_Absolute last_fc_transmission
When did we last send a GNUNET_MESSAGE_TYPE_TRANSPORT_FLOW_CONTROL message? Used to determine whether...
struct GNUNET_SCHEDULER_Task * visibility_task
Task scheduled to possibly notfiy core that this peer is no longer counting as confirmed.
struct GNUNET_SCHEDULER_Task * unconfirmed_timeout_task
Task that discards this link if it never becomes confirmed.
struct Neighbour * n
Neighbour used by this virtual link, NULL if dv is used.
uint64_t message_uuid_ctr
Used to generate unique UUIDs for messages that are being fragmented.
int64_t incoming_fc_window_size_loss
What is our current estimate on the message loss rate for the sender? Based on the difference between...
struct CoreSentContext * csc_head
Kept in a DLL to clear vl in case vl is lost.
struct GNUNET_PeerIdentity target
Identity of the peer at the other end of the link.
uint32_t fc_seq_gen
Generator for the sequence numbers of GNUNET_MESSAGE_TYPE_TRANSPORT_FLOW_CONTROL messages we send.
struct DistanceVector * dv
Distance vector used by this virtual link, NULL if n is used.
struct CommunicatorMessageContext * cmc_head
Communicators blocked for receiving on target as we are waiting on the core_recv_window to increase.
struct GNUNET_SCHEDULER_Task * fc_retransmit_task
Task scheduled to periodically retransmit FC messages (in case one got lost).
struct GNUNET_SCHEDULER_Task * core_fc_stall_task
Task bounding how long the communicators queued in cmc_head stay blocked waiting for CORE to increase...
uint64_t incoming_fc_window_size_ram
Memory actually used to buffer packets on this virtual link.
struct PendingMessage * pending_msg_head
Head of list of messages pending for this VL.
struct CoreSentContext * csc_tail
Kept in a DLL to clear vl in case vl is lost.
enum GNUNET_GenericReturnValue sync_ready
Are we ready to start the burst?
unsigned int fc_retransmit_count
Number of FC retransmissions for this running task.
struct PendingMessage * pending_msg_tail
Tail of list of messages pending for this VL.
struct GNUNET_CONTAINER_Heap * reassembly_heap
Heap with struct ReassemblyContext structs for fragments under reassembly.
struct GNUNET_StartBurstCls * sb_cls
The actual GNUNET_StartBurstCls of this VirtualLink.
struct GNUNET_CONTAINER_MultiHashMap32 * reassembly_map
Map with struct ReassemblyContext structs for fragments under reassembly.
struct GNUNET_TIME_Relative last_fc_rtt
Expected RTT from the last FC transmission.
uint64_t available_fc_window_size
Memory allocated for this virtual link.
struct CommunicatorMessageContext * cmc_tail
Communicators blocked for receiving on target as we are waiting on the core_recv_window to increase.
common internal definitions for transport service