diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-30 12:27:11 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-30 12:27:11 +0100 |
commit | 48332ff7d4631f9be2a059c2fe150e3be5fb37f6 (patch) | |
tree | ec9da85c16ca25f37ffc4bb4d835360ffb6f134a /src/cadet | |
parent | c4d0522fd416da83f77475e2bb8351a7b5b72cc3 (diff) | |
download | gnunet-48332ff7d4631f9be2a059c2fe150e3be5fb37f6.tar.gz gnunet-48332ff7d4631f9be2a059c2fe150e3be5fb37f6.zip |
have tunnel tell channel which connection it used for transmission, so we can track connection performance by observing ACKs on the channel-level
Diffstat (limited to 'src/cadet')
-rw-r--r-- | src/cadet/gnunet-service-cadet-new_channel.c | 20 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet-new_connection.c | 5 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet-new_tunnels.c | 10 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet-new_tunnels.h | 15 |
4 files changed, 40 insertions, 10 deletions
diff --git a/src/cadet/gnunet-service-cadet-new_channel.c b/src/cadet/gnunet-service-cadet-new_channel.c index 8633e7f74..7929d3c4b 100644 --- a/src/cadet/gnunet-service-cadet-new_channel.c +++ b/src/cadet/gnunet-service-cadet-new_channel.c | |||
@@ -501,9 +501,12 @@ send_channel_open (void *cls); | |||
501 | * create message. Delays for a bit until we retry. | 501 | * create message. Delays for a bit until we retry. |
502 | * | 502 | * |
503 | * @param cls our `struct CadetChannel`. | 503 | * @param cls our `struct CadetChannel`. |
504 | * @param cid identifier of the connection within the tunnel, NULL | ||
505 | * if transmission failed | ||
504 | */ | 506 | */ |
505 | static void | 507 | static void |
506 | channel_open_sent_cb (void *cls) | 508 | channel_open_sent_cb (void *cls, |
509 | const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid) | ||
507 | { | 510 | { |
508 | struct CadetChannel *ch = cls; | 511 | struct CadetChannel *ch = cls; |
509 | 512 | ||
@@ -755,9 +758,12 @@ GCCH_channel_incoming_new (struct CadetTunnel *t, | |||
755 | * ACKs for ACKs ;-). | 758 | * ACKs for ACKs ;-). |
756 | * | 759 | * |
757 | * @param cls our `struct CadetChannel`. | 760 | * @param cls our `struct CadetChannel`. |
761 | * @param cid identifier of the connection within the tunnel, NULL | ||
762 | * if transmission failed | ||
758 | */ | 763 | */ |
759 | static void | 764 | static void |
760 | send_ack_cb (void *cls) | 765 | send_ack_cb (void *cls, |
766 | const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid) | ||
761 | { | 767 | { |
762 | struct CadetChannel *ch = cls; | 768 | struct CadetChannel *ch = cls; |
763 | 769 | ||
@@ -1322,9 +1328,12 @@ GCCH_handle_channel_plaintext_data (struct CadetChannel *ch, | |||
1322 | * wait for ACK (or retransmit). | 1328 | * wait for ACK (or retransmit). |
1323 | * | 1329 | * |
1324 | * @param cls the `struct CadetReliableMessage` that was sent | 1330 | * @param cls the `struct CadetReliableMessage` that was sent |
1331 | * @param cid identifier of the connection within the tunnel, NULL | ||
1332 | * if transmission failed | ||
1325 | */ | 1333 | */ |
1326 | static void | 1334 | static void |
1327 | data_sent_cb (void *cls); | 1335 | data_sent_cb (void *cls, |
1336 | const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid); | ||
1328 | 1337 | ||
1329 | 1338 | ||
1330 | /** | 1339 | /** |
@@ -1549,9 +1558,12 @@ cmp_crm_by_next_retry (void *cls, | |||
1549 | * wait for ACK (or retransmit). | 1558 | * wait for ACK (or retransmit). |
1550 | * | 1559 | * |
1551 | * @param cls the `struct CadetReliableMessage` that was sent | 1560 | * @param cls the `struct CadetReliableMessage` that was sent |
1561 | * @param cid identifier of the connection within the tunnel, NULL | ||
1562 | * if transmission failed | ||
1552 | */ | 1563 | */ |
1553 | static void | 1564 | static void |
1554 | data_sent_cb (void *cls) | 1565 | data_sent_cb (void *cls, |
1566 | const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid) | ||
1555 | { | 1567 | { |
1556 | struct CadetReliableMessage *crm = cls; | 1568 | struct CadetReliableMessage *crm = cls; |
1557 | struct CadetChannel *ch = crm->ch; | 1569 | struct CadetChannel *ch = crm->ch; |
diff --git a/src/cadet/gnunet-service-cadet-new_connection.c b/src/cadet/gnunet-service-cadet-new_connection.c index 688cb1f80..894ffdcb9 100644 --- a/src/cadet/gnunet-service-cadet-new_connection.c +++ b/src/cadet/gnunet-service-cadet-new_connection.c | |||
@@ -315,9 +315,12 @@ send_keepalive (void *cls); | |||
315 | * schedule the next one. | 315 | * schedule the next one. |
316 | * | 316 | * |
317 | * @param cls the `struct CadetConnection` to keep alive. | 317 | * @param cls the `struct CadetConnection` to keep alive. |
318 | * @param cid identifier of the connection within the tunnel, NULL | ||
319 | * if transmission failed | ||
318 | */ | 320 | */ |
319 | static void | 321 | static void |
320 | keepalive_done (void *cls) | 322 | keepalive_done (void *cls, |
323 | const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid) | ||
321 | { | 324 | { |
322 | struct CadetConnection *cc = cls; | 325 | struct CadetConnection *cc = cls; |
323 | 326 | ||
diff --git a/src/cadet/gnunet-service-cadet-new_tunnels.c b/src/cadet/gnunet-service-cadet-new_tunnels.c index 1afd75bb2..5b44553ee 100644 --- a/src/cadet/gnunet-service-cadet-new_tunnels.c +++ b/src/cadet/gnunet-service-cadet-new_tunnels.c | |||
@@ -277,7 +277,7 @@ struct CadetTunnelQueueEntry | |||
277 | /** | 277 | /** |
278 | * Continuation to call once sent (on the channel layer). | 278 | * Continuation to call once sent (on the channel layer). |
279 | */ | 279 | */ |
280 | GNUNET_SCHEDULER_TaskCallback cont; | 280 | GCT_SendContinuation cont; |
281 | 281 | ||
282 | /** | 282 | /** |
283 | * Closure for @c cont. | 283 | * Closure for @c cont. |
@@ -2006,7 +2006,8 @@ destroy_tunnel (void *cls) | |||
2006 | while (NULL != (tq = t->tq_head)) | 2006 | while (NULL != (tq = t->tq_head)) |
2007 | { | 2007 | { |
2008 | if (NULL != tq->cont) | 2008 | if (NULL != tq->cont) |
2009 | tq->cont (tq->cont_cls); | 2009 | tq->cont (tq->cont_cls, |
2010 | NULL); | ||
2010 | GCT_send_cancel (tq); | 2011 | GCT_send_cancel (tq); |
2011 | } | 2012 | } |
2012 | GCP_drop_tunnel (t->destination, | 2013 | GCP_drop_tunnel (t->destination, |
@@ -2156,7 +2157,8 @@ try_send_normal_payload (struct CadetTunnel *t, | |||
2156 | GCC_transmit (ct->cc, | 2157 | GCC_transmit (ct->cc, |
2157 | tq->env); | 2158 | tq->env); |
2158 | if (NULL != tq->cont) | 2159 | if (NULL != tq->cont) |
2159 | tq->cont (tq->cont_cls); | 2160 | tq->cont (tq->cont_cls, |
2161 | GCC_get_id (ct->cc)); | ||
2160 | GNUNET_free (tq); | 2162 | GNUNET_free (tq); |
2161 | } | 2163 | } |
2162 | 2164 | ||
@@ -3114,7 +3116,7 @@ GCT_handle_encrypted (struct CadetTConnection *ct, | |||
3114 | struct CadetTunnelQueueEntry * | 3116 | struct CadetTunnelQueueEntry * |
3115 | GCT_send (struct CadetTunnel *t, | 3117 | GCT_send (struct CadetTunnel *t, |
3116 | const struct GNUNET_MessageHeader *message, | 3118 | const struct GNUNET_MessageHeader *message, |
3117 | GNUNET_SCHEDULER_TaskCallback cont, | 3119 | GCT_SendContinuation cont, |
3118 | void *cont_cls) | 3120 | void *cont_cls) |
3119 | { | 3121 | { |
3120 | struct CadetTunnelQueueEntry *tq; | 3122 | struct CadetTunnelQueueEntry *tq; |
diff --git a/src/cadet/gnunet-service-cadet-new_tunnels.h b/src/cadet/gnunet-service-cadet-new_tunnels.h index f8613d236..a81bc2341 100644 --- a/src/cadet/gnunet-service-cadet-new_tunnels.h +++ b/src/cadet/gnunet-service-cadet-new_tunnels.h | |||
@@ -202,6 +202,19 @@ GCT_send_channel_destroy (struct CadetTunnel *t, | |||
202 | 202 | ||
203 | 203 | ||
204 | /** | 204 | /** |
205 | * Function called when a transmission requested using #GCT_send is done. | ||
206 | * | ||
207 | * @param cls closure | ||
208 | * @param ctn identifier of the connection used for transmission, NULL if | ||
209 | * the transmission failed (to be used to match ACKs to the | ||
210 | * respective connection for connection performance evaluation) | ||
211 | */ | ||
212 | typedef void | ||
213 | (*GCT_SendContinuation)(void *cls, | ||
214 | const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid); | ||
215 | |||
216 | |||
217 | /** | ||
205 | * Sends an already built message on a tunnel, encrypting it and | 218 | * Sends an already built message on a tunnel, encrypting it and |
206 | * choosing the best connection if not provided. | 219 | * choosing the best connection if not provided. |
207 | * | 220 | * |
@@ -214,7 +227,7 @@ GCT_send_channel_destroy (struct CadetTunnel *t, | |||
214 | struct CadetTunnelQueueEntry * | 227 | struct CadetTunnelQueueEntry * |
215 | GCT_send (struct CadetTunnel *t, | 228 | GCT_send (struct CadetTunnel *t, |
216 | const struct GNUNET_MessageHeader *message, | 229 | const struct GNUNET_MessageHeader *message, |
217 | GNUNET_SCHEDULER_TaskCallback cont, | 230 | GCT_SendContinuation cont, |
218 | void *cont_cls); | 231 | void *cont_cls); |
219 | 232 | ||
220 | 233 | ||