diff options
author | Willow Liquorice <willow@howhill.com> | 2022-08-26 02:43:02 +0100 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-08-30 09:41:49 +0200 |
commit | 9285bb74e36fc82d8b53e6fe29391714b916fb3c (patch) | |
tree | 2eda2715efcd9bb1c082ba68e183498df9697535 /src/cadet | |
parent | 586f250f1603572861af4b1bf570b3a253306bbf (diff) | |
download | gnunet-9285bb74e36fc82d8b53e6fe29391714b916fb3c.tar.gz gnunet-9285bb74e36fc82d8b53e6fe29391714b916fb3c.zip |
-DOC: First pass of new workflow over CADET subsystem.
Diffstat (limited to 'src/cadet')
-rw-r--r-- | src/cadet/gnunet-service-cadet_channel.c | 66 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_channel.h | 14 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_connection.c | 27 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_connection.h | 4 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_paths.c | 14 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_paths.h | 3 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_peer.c | 43 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_peer.h | 8 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_tunnels.c | 51 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_tunnels.h | 17 |
10 files changed, 30 insertions, 217 deletions
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c index 9a2180cc1..f742ba4a7 100644 --- a/src/cadet/gnunet-service-cadet_channel.c +++ b/src/cadet/gnunet-service-cadet_channel.c | |||
@@ -388,11 +388,6 @@ struct CadetChannel | |||
388 | 388 | ||
389 | }; | 389 | }; |
390 | 390 | ||
391 | /** | ||
392 | * Assign type of message to drop. | ||
393 | * @param ch CadetChannel to assign type to drop. | ||
394 | * @param message GNUNET_CADET_RequestDropCadetMessage to get the type from. | ||
395 | */ | ||
396 | void | 391 | void |
397 | GCCH_assign_type_to_drop (struct CadetChannel *ch, const struct | 392 | GCCH_assign_type_to_drop (struct CadetChannel *ch, const struct |
398 | GNUNET_CADET_RequestDropCadetMessage *message) | 393 | GNUNET_CADET_RequestDropCadetMessage *message) |
@@ -660,16 +655,6 @@ GCCH_tunnel_up (struct CadetChannel *ch) | |||
660 | } | 655 | } |
661 | 656 | ||
662 | 657 | ||
663 | /** | ||
664 | * Create a new channel. | ||
665 | * | ||
666 | * @param owner local client owning the channel | ||
667 | * @param ccn local number of this channel at the @a owner | ||
668 | * @param destination peer to which we should build the channel | ||
669 | * @param port desired port at @a destination | ||
670 | * @param options options for the channel | ||
671 | * @return handle to the new channel | ||
672 | */ | ||
673 | struct CadetChannel * | 658 | struct CadetChannel * |
674 | GCCH_channel_local_new (struct CadetClient *owner, | 659 | GCCH_channel_local_new (struct CadetClient *owner, |
675 | struct GNUNET_CADET_ClientChannelNumber ccn, | 660 | struct GNUNET_CADET_ClientChannelNumber ccn, |
@@ -756,15 +741,6 @@ timeout_closed_cb (void *cls) | |||
756 | } | 741 | } |
757 | 742 | ||
758 | 743 | ||
759 | /** | ||
760 | * Create a new channel based on a request coming in over the network. | ||
761 | * | ||
762 | * @param t tunnel to the remote peer | ||
763 | * @param ctn identifier of this channel in the tunnel | ||
764 | * @param h_port desired hash of local port | ||
765 | * @param options options for the channel | ||
766 | * @return handle to the new channel | ||
767 | */ | ||
768 | struct CadetChannel * | 744 | struct CadetChannel * |
769 | GCCH_channel_incoming_new (struct CadetTunnel *t, | 745 | GCCH_channel_incoming_new (struct CadetTunnel *t, |
770 | struct GNUNET_CADET_ChannelTunnelNumber ctn, | 746 | struct GNUNET_CADET_ChannelTunnelNumber ctn, |
@@ -960,15 +936,6 @@ send_ack_to_client (struct CadetChannel *ch, int to_owner) | |||
960 | } | 936 | } |
961 | 937 | ||
962 | 938 | ||
963 | /** | ||
964 | * A client is bound to the port that we have a channel | ||
965 | * open to. Send the acknowledgement for the connection | ||
966 | * request and establish the link with the client. | ||
967 | * | ||
968 | * @param ch open incoming channel | ||
969 | * @param c client listening on the respective @a port | ||
970 | * @param port the port @a is listening on | ||
971 | */ | ||
972 | void | 939 | void |
973 | GCCH_bind (struct CadetChannel *ch, | 940 | GCCH_bind (struct CadetChannel *ch, |
974 | struct CadetClient *c, | 941 | struct CadetClient *c, |
@@ -1126,15 +1093,6 @@ GCCH_channel_local_destroy (struct CadetChannel *ch, | |||
1126 | } | 1093 | } |
1127 | 1094 | ||
1128 | 1095 | ||
1129 | /** | ||
1130 | * We got an acknowledgement for the creation of the channel | ||
1131 | * (the port is open on the other side). Verify that the | ||
1132 | * other end really has the right port, and begin transmissions. | ||
1133 | * | ||
1134 | * @param ch channel to destroy | ||
1135 | * @param cti identifier of the connection that delivered the message | ||
1136 | * @param port port number (needed to verify receiver knows the port) | ||
1137 | */ | ||
1138 | void | 1096 | void |
1139 | GCCH_handle_channel_open_ack ( | 1097 | GCCH_handle_channel_open_ack ( |
1140 | struct CadetChannel *ch, | 1098 | struct CadetChannel *ch, |
@@ -1227,14 +1185,6 @@ is_before (void *cls, | |||
1227 | } | 1185 | } |
1228 | 1186 | ||
1229 | 1187 | ||
1230 | /** | ||
1231 | * We got payload data for a channel. Pass it on to the client | ||
1232 | * and send an ACK to the other end (once flow control allows it!) | ||
1233 | * | ||
1234 | * @param ch channel that got data | ||
1235 | * @param cti identifier of the connection that delivered the message | ||
1236 | * @param msg message that was received | ||
1237 | */ | ||
1238 | void | 1188 | void |
1239 | GCCH_handle_channel_plaintext_data ( | 1189 | GCCH_handle_channel_plaintext_data ( |
1240 | struct CadetChannel *ch, | 1190 | struct CadetChannel *ch, |
@@ -1657,15 +1607,6 @@ GCCH_handle_channel_plaintext_data_ack ( | |||
1657 | } | 1607 | } |
1658 | 1608 | ||
1659 | 1609 | ||
1660 | /** | ||
1661 | * Destroy channel, based on the other peer closing the | ||
1662 | * connection. Also needs to remove this channel from | ||
1663 | * the tunnel. | ||
1664 | * | ||
1665 | * @param ch channel to destroy | ||
1666 | * @param cti identifier of the connection that delivered the message, | ||
1667 | * NULL if we are simulating receiving a destroy due to shutdown | ||
1668 | */ | ||
1669 | void | 1610 | void |
1670 | GCCH_handle_remote_destroy ( | 1611 | GCCH_handle_remote_destroy ( |
1671 | struct CadetChannel *ch, | 1612 | struct CadetChannel *ch, |
@@ -1916,13 +1857,6 @@ GCCH_handle_local_data (struct CadetChannel *ch, | |||
1916 | } | 1857 | } |
1917 | 1858 | ||
1918 | 1859 | ||
1919 | /** | ||
1920 | * Handle ACK from client on local channel. Means the client is ready | ||
1921 | * for more data, see if we have any for it. | ||
1922 | * | ||
1923 | * @param ch channel to destroy | ||
1924 | * @param client_ccn ccn of the client sending the ack | ||
1925 | */ | ||
1926 | void | 1860 | void |
1927 | GCCH_handle_local_ack (struct CadetChannel *ch, | 1861 | GCCH_handle_local_ack (struct CadetChannel *ch, |
1928 | struct GNUNET_CADET_ClientChannelNumber client_ccn) | 1862 | struct GNUNET_CADET_ClientChannelNumber client_ccn) |
diff --git a/src/cadet/gnunet-service-cadet_channel.h b/src/cadet/gnunet-service-cadet_channel.h index 6d691cafc..b09de883f 100644 --- a/src/cadet/gnunet-service-cadet_channel.h +++ b/src/cadet/gnunet-service-cadet_channel.h | |||
@@ -67,7 +67,7 @@ GCCH_is_type_to_drop (struct CadetChannel *ch, const struct | |||
67 | GNUNET_MessageHeader *message); | 67 | GNUNET_MessageHeader *message); |
68 | 68 | ||
69 | /** | 69 | /** |
70 | * Check if type of message is the one to drop. | 70 | * Assign type of message to drop. |
71 | * @param ch CadetChannel to assign type to drop. | 71 | * @param ch CadetChannel to assign type to drop. |
72 | * @param message GNUNET_CADET_RequestDropCadetMessage to get the type from. | 72 | * @param message GNUNET_CADET_RequestDropCadetMessage to get the type from. |
73 | */ | 73 | */ |
@@ -174,7 +174,6 @@ GCCH_tunnel_up (struct CadetChannel *ch); | |||
174 | * | 174 | * |
175 | * @param t tunnel to the remote peer | 175 | * @param t tunnel to the remote peer |
176 | * @param chid identifier of this channel in the tunnel | 176 | * @param chid identifier of this channel in the tunnel |
177 | * @param origin peer to who initiated the channel | ||
178 | * @param h_port hash of desired local port | 177 | * @param h_port hash of desired local port |
179 | * @param options options for the channel | 178 | * @param options options for the channel |
180 | * @return handle to the new channel | 179 | * @return handle to the new channel |
@@ -201,7 +200,8 @@ GCCH_handle_duplicate_open (struct CadetChannel *ch, | |||
201 | 200 | ||
202 | 201 | ||
203 | /** | 202 | /** |
204 | * We got payload data for a channel. Pass it on to the client. | 203 | * We got payload data for a channel. Pass it on to the client |
204 | * and send an ACK to the other end (once flow control allows it!) | ||
205 | * | 205 | * |
206 | * @param ch channel that got data | 206 | * @param ch channel that got data |
207 | * @param cti identifier of the connection that delivered the message | 207 | * @param cti identifier of the connection that delivered the message |
@@ -234,7 +234,8 @@ GCCH_handle_channel_plaintext_data_ack (struct CadetChannel *ch, | |||
234 | 234 | ||
235 | /** | 235 | /** |
236 | * We got an acknowledgement for the creation of the channel | 236 | * We got an acknowledgement for the creation of the channel |
237 | * (the port is open on the other side). Begin transmissions. | 237 | * (the port is open on the other side). Verify that the |
238 | * other end really has the right port, and begin transmissions. | ||
238 | * | 239 | * |
239 | * @param ch channel to destroy | 240 | * @param ch channel to destroy |
240 | * @param cti identifier of the connection that delivered the message, | 241 | * @param cti identifier of the connection that delivered the message, |
@@ -262,7 +263,7 @@ GCCH_handle_channel_open_ack (struct CadetChannel *ch, | |||
262 | * | 263 | * |
263 | * @param ch channel to destroy | 264 | * @param ch channel to destroy |
264 | * @param cti identifier of the connection that delivered the message, | 265 | * @param cti identifier of the connection that delivered the message, |
265 | * NULL during shutdown | 266 | * NULL if we are simulating receiving a destroy due to shutdown |
266 | */ | 267 | */ |
267 | void | 268 | void |
268 | GCCH_handle_remote_destroy (struct CadetChannel *ch, | 269 | GCCH_handle_remote_destroy (struct CadetChannel *ch, |
@@ -292,7 +293,8 @@ GCCH_handle_local_data (struct CadetChannel *ch, | |||
292 | 293 | ||
293 | 294 | ||
294 | /** | 295 | /** |
295 | * Handle ACK from client on local channel. | 296 | * Handle ACK from client on local channel. Means the client is ready |
297 | * for more data, see if we have any for it. | ||
296 | * | 298 | * |
297 | * @param ch channel to destroy | 299 | * @param ch channel to destroy |
298 | * @param client_ccn ccn of the client sending the ack | 300 | * @param client_ccn ccn of the client sending the ack |
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index 637e8663b..66b67aa64 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c | |||
@@ -449,14 +449,6 @@ GCC_ack_observed (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid) | |||
449 | } | 449 | } |
450 | 450 | ||
451 | 451 | ||
452 | /** | ||
453 | * We observed some the given @a latency on the connection | ||
454 | * identified by @a cti. (The same connection was taken | ||
455 | * in both directions.) | ||
456 | * | ||
457 | * @param cid connection identifier where we measured latency | ||
458 | * @param latency the observed latency | ||
459 | */ | ||
460 | void | 452 | void |
461 | GCC_latency_observed (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, | 453 | GCC_latency_observed (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, |
462 | struct GNUNET_TIME_Relative latency) | 454 | struct GNUNET_TIME_Relative latency) |
@@ -484,13 +476,6 @@ GCC_latency_observed (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, | |||
484 | } | 476 | } |
485 | 477 | ||
486 | 478 | ||
487 | /** | ||
488 | * A #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK was received for | ||
489 | * this connection, implying that the end-to-end connection is up. | ||
490 | * Process it. | ||
491 | * | ||
492 | * @param cc the connection that got the ACK. | ||
493 | */ | ||
494 | void | 479 | void |
495 | GCC_handle_connection_create_ack (struct CadetConnection *cc) | 480 | GCC_handle_connection_create_ack (struct CadetConnection *cc) |
496 | { | 481 | { |
@@ -943,18 +928,6 @@ GCC_create_inbound (struct CadetPeer *destination, | |||
943 | } | 928 | } |
944 | 929 | ||
945 | 930 | ||
946 | /** | ||
947 | * Create a connection to @a destination via @a path and | ||
948 | * notify @a cb whenever we are ready for more data. | ||
949 | * | ||
950 | * @param destination where to go | ||
951 | * @param path which path to take (may not be the full path) | ||
952 | * @param off offset of @a destination on @a path | ||
953 | * @param ct tunnel that uses the connection | ||
954 | * @param ready_cb function to call when ready to transmit | ||
955 | * @param ready_cb_cls closure for @a cb | ||
956 | * @return handle to the connection | ||
957 | */ | ||
958 | struct CadetConnection * | 931 | struct CadetConnection * |
959 | GCC_create (struct CadetPeer *destination, | 932 | GCC_create (struct CadetPeer *destination, |
960 | struct CadetPeerPath *path, | 933 | struct CadetPeerPath *path, |
diff --git a/src/cadet/gnunet-service-cadet_connection.h b/src/cadet/gnunet-service-cadet_connection.h index d646b3dc2..53c0c1541 100644 --- a/src/cadet/gnunet-service-cadet_connection.h +++ b/src/cadet/gnunet-service-cadet_connection.h | |||
@@ -142,7 +142,9 @@ GCC_transmit (struct CadetConnection *cc, | |||
142 | 142 | ||
143 | 143 | ||
144 | /** | 144 | /** |
145 | * A CREATE_ACK was received for this connection, process it. | 145 | * A #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK was received for |
146 | * this connection, implying that the end-to-end connection is up. | ||
147 | * Process it. | ||
146 | * | 148 | * |
147 | * @param cc the connection that got the ACK. | 149 | * @param cc the connection that got the ACK. |
148 | */ | 150 | */ |
diff --git a/src/cadet/gnunet-service-cadet_paths.c b/src/cadet/gnunet-service-cadet_paths.c index aa31aaa74..83b996e05 100644 --- a/src/cadet/gnunet-service-cadet_paths.c +++ b/src/cadet/gnunet-service-cadet_paths.c | |||
@@ -594,13 +594,6 @@ GCPP_try_path_from_dht (const struct GNUNET_DHT_PathElement *get_path, | |||
594 | } | 594 | } |
595 | 595 | ||
596 | 596 | ||
597 | /** | ||
598 | * We got an incoming connection, obtain the corresponding path. | ||
599 | * | ||
600 | * @param path_length number of segments on the @a path | ||
601 | * @param pids path through the network, in reverse order (we are at the end at index @a path_length) | ||
602 | * @return corresponding path object | ||
603 | */ | ||
604 | struct CadetPeerPath * | 597 | struct CadetPeerPath * |
605 | GCPP_get_path_from_route (unsigned int path_length, | 598 | GCPP_get_path_from_route (unsigned int path_length, |
606 | const struct GNUNET_PeerIdentity *pids) | 599 | const struct GNUNET_PeerIdentity *pids) |
@@ -723,13 +716,6 @@ GCPP_find_peer (struct CadetPeerPath *path, | |||
723 | } | 716 | } |
724 | 717 | ||
725 | 718 | ||
726 | /** | ||
727 | * Obtain the peer at offset @a off in @a path. | ||
728 | * | ||
729 | * @param path peer path to inspect | ||
730 | * @param off offset to return, must be smaller than path length | ||
731 | * @return the peer at offset @a off | ||
732 | */ | ||
733 | struct CadetPeer * | 719 | struct CadetPeer * |
734 | GCPP_get_peer_at_offset (struct CadetPeerPath *path, | 720 | GCPP_get_peer_at_offset (struct CadetPeerPath *path, |
735 | unsigned int off) | 721 | unsigned int off) |
diff --git a/src/cadet/gnunet-service-cadet_paths.h b/src/cadet/gnunet-service-cadet_paths.h index afd193596..defdd0df2 100644 --- a/src/cadet/gnunet-service-cadet_paths.h +++ b/src/cadet/gnunet-service-cadet_paths.h | |||
@@ -53,7 +53,8 @@ GCPP_try_path_from_dht (const struct GNUNET_DHT_PathElement *get_path, | |||
53 | * We got an incoming connection, obtain the corresponding path. | 53 | * We got an incoming connection, obtain the corresponding path. |
54 | * | 54 | * |
55 | * @param path_length number of segments on the @a path | 55 | * @param path_length number of segments on the @a path |
56 | * @param path through the network, in reverse order (we are at the end!) | 56 | * @param path through the network, in reverse order |
57 | * (we are at the end, at index @a path_length) | ||
57 | * @return corresponding path object | 58 | * @return corresponding path object |
58 | */ | 59 | */ |
59 | struct CadetPeerPath * | 60 | struct CadetPeerPath * |
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c index 2437a3e1b..99669eb05 100644 --- a/src/cadet/gnunet-service-cadet_peer.c +++ b/src/cadet/gnunet-service-cadet_peer.c | |||
@@ -260,21 +260,6 @@ GCP_2s (const struct CadetPeer *cp) | |||
260 | } | 260 | } |
261 | 261 | ||
262 | 262 | ||
263 | /** | ||
264 | * Calculate how desirable a path is for @a cp if @a cp | ||
265 | * is at offset @a off. | ||
266 | * | ||
267 | * The 'desirability_table.c' program can be used to compute a list of | ||
268 | * sample outputs for different scenarios. Basically, we score paths | ||
269 | * lower if there are many alternatives, and higher if they are | ||
270 | * shorter than average, and very high if they are much shorter than | ||
271 | * average and without many alternatives. | ||
272 | * | ||
273 | * @param cp a peer reachable via a path | ||
274 | * @param off offset of @a cp in the path | ||
275 | * @return score how useful a path is to reach @a cp, | ||
276 | * positive scores mean path is more desirable | ||
277 | */ | ||
278 | double | 263 | double |
279 | GCP_get_desirability_of_path (struct CadetPeer *cp, | 264 | GCP_get_desirability_of_path (struct CadetPeer *cp, |
280 | unsigned int off) | 265 | unsigned int off) |
@@ -965,17 +950,6 @@ path_heap_cleanup (void *cls) | |||
965 | } | 950 | } |
966 | 951 | ||
967 | 952 | ||
968 | /** | ||
969 | * Try adding a @a path to this @a peer. If the peer already | ||
970 | * has plenty of paths, return NULL. | ||
971 | * | ||
972 | * @param cp peer to which the @a path leads to | ||
973 | * @param path a path looking for an owner; may not be fully initialized yet! | ||
974 | * @param off offset of @a cp in @a path | ||
975 | * @param force force attaching the path | ||
976 | * @return NULL if this peer does not care to become a new owner, | ||
977 | * otherwise the node in the peer's path heap for the @a path. | ||
978 | */ | ||
979 | struct GNUNET_CONTAINER_HeapNode * | 953 | struct GNUNET_CONTAINER_HeapNode * |
980 | GCP_attach_path (struct CadetPeer *cp, | 954 | GCP_attach_path (struct CadetPeer *cp, |
981 | struct CadetPeerPath *path, | 955 | struct CadetPeerPath *path, |
@@ -1287,16 +1261,6 @@ GCP_iterate_indirect_paths (struct CadetPeer *cp, | |||
1287 | } | 1261 | } |
1288 | 1262 | ||
1289 | 1263 | ||
1290 | /** | ||
1291 | * Iterate over the paths to @a cp where | ||
1292 | * @a cp is at distance @a dist from us. | ||
1293 | * | ||
1294 | * @param cp Peer to get path info. | ||
1295 | * @param dist desired distance of @a cp to us on the path | ||
1296 | * @param callback Function to call for every path. | ||
1297 | * @param callback_cls Closure for @a callback. | ||
1298 | * @return Number of iterated paths. | ||
1299 | */ | ||
1300 | unsigned int | 1264 | unsigned int |
1301 | GCP_iterate_paths_at (struct CadetPeer *cp, | 1265 | GCP_iterate_paths_at (struct CadetPeer *cp, |
1302 | unsigned int dist, | 1266 | unsigned int dist, |
@@ -1365,13 +1329,6 @@ hello_offer_done (void *cls) | |||
1365 | } | 1329 | } |
1366 | 1330 | ||
1367 | 1331 | ||
1368 | /** | ||
1369 | * We got a HELLO for a @a peer, remember it, and possibly | ||
1370 | * trigger adequate actions (like trying to connect). | ||
1371 | * | ||
1372 | * @param cp the peer we got a HELLO for | ||
1373 | * @param hello the HELLO to remember | ||
1374 | */ | ||
1375 | void | 1332 | void |
1376 | GCP_set_hello (struct CadetPeer *cp, | 1333 | GCP_set_hello (struct CadetPeer *cp, |
1377 | const struct GNUNET_HELLO_Message *hello) | 1334 | const struct GNUNET_HELLO_Message *hello) |
diff --git a/src/cadet/gnunet-service-cadet_peer.h b/src/cadet/gnunet-service-cadet_peer.h index 7a39615ff..69436d766 100644 --- a/src/cadet/gnunet-service-cadet_peer.h +++ b/src/cadet/gnunet-service-cadet_peer.h | |||
@@ -62,6 +62,12 @@ GCP_get (const struct GNUNET_PeerIdentity *peer_id, | |||
62 | * Calculate how desirable a path is for @a cp if | 62 | * Calculate how desirable a path is for @a cp if |
63 | * @a cp is at offset @a off in the path. | 63 | * @a cp is at offset @a off in the path. |
64 | * | 64 | * |
65 | * The 'desirability_table.c' program can be used to compute a list of | ||
66 | * sample outputs for different scenarios. Basically, we score paths | ||
67 | * lower if there are many alternatives, and higher if they are | ||
68 | * shorter than average, and very high if they are much shorter than | ||
69 | * average and without many alternatives. | ||
70 | * | ||
65 | * @param cp a peer reachable via a path | 71 | * @param cp a peer reachable via a path |
66 | * @param off offset of @a cp in a path | 72 | * @param off offset of @a cp in a path |
67 | * @return score how useful a path is to reach @a cp, | 73 | * @return score how useful a path is to reach @a cp, |
@@ -229,7 +235,7 @@ GCP_drop_tunnel (struct CadetPeer *cp, | |||
229 | * @param cp peer to which the @a path leads to | 235 | * @param cp peer to which the @a path leads to |
230 | * @param path a path looking for an owner; may not be fully initialized yet! | 236 | * @param path a path looking for an owner; may not be fully initialized yet! |
231 | * @param off offset of @a cp in @a path | 237 | * @param off offset of @a cp in @a path |
232 | * @param force for attaching the path | 238 | * @param force force attaching the path |
233 | * @return NULL if this peer does not care to become a new owner, | 239 | * @return NULL if this peer does not care to become a new owner, |
234 | * otherwise the node in the peer's path heap for the @a path. | 240 | * otherwise the node in the peer's path heap for the @a path. |
235 | */ | 241 | */ |
diff --git a/src/cadet/gnunet-service-cadet_tunnels.c b/src/cadet/gnunet-service-cadet_tunnels.c index cabbeed0c..9653fd3ec 100644 --- a/src/cadet/gnunet-service-cadet_tunnels.c +++ b/src/cadet/gnunet-service-cadet_tunnels.c | |||
@@ -576,13 +576,6 @@ GCT_get_destination (struct CadetTunnel *t) | |||
576 | } | 576 | } |
577 | 577 | ||
578 | 578 | ||
579 | /** | ||
580 | * Count channels of a tunnel. | ||
581 | * | ||
582 | * @param t Tunnel on which to count. | ||
583 | * | ||
584 | * @return Number of channels. | ||
585 | */ | ||
586 | unsigned int | 579 | unsigned int |
587 | GCT_count_channels (struct CadetTunnel *t) | 580 | GCT_count_channels (struct CadetTunnel *t) |
588 | { | 581 | { |
@@ -606,13 +599,6 @@ lookup_channel (struct CadetTunnel *t, | |||
606 | } | 599 | } |
607 | 600 | ||
608 | 601 | ||
609 | /** | ||
610 | * Count all created connections of a tunnel. Not necessarily ready connections! | ||
611 | * | ||
612 | * @param t Tunnel on which to count. | ||
613 | * | ||
614 | * @return Number of connections created, either being established or ready. | ||
615 | */ | ||
616 | unsigned int | 602 | unsigned int |
617 | GCT_count_any_connections (const struct CadetTunnel *t) | 603 | GCT_count_any_connections (const struct CadetTunnel *t) |
618 | { | 604 | { |
@@ -1706,14 +1692,6 @@ retry_kx (void *cls) | |||
1706 | } | 1692 | } |
1707 | 1693 | ||
1708 | 1694 | ||
1709 | /** | ||
1710 | * Handle KX message that lacks authentication (and which will thus | ||
1711 | * only be considered authenticated after we respond with our own | ||
1712 | * KX_AUTH and finally successfully decrypt payload). | ||
1713 | * | ||
1714 | * @param ct connection/tunnel combo that received encrypted message | ||
1715 | * @param msg the key exchange message | ||
1716 | */ | ||
1717 | void | 1695 | void |
1718 | GCT_handle_kx (struct CadetTConnection *ct, | 1696 | GCT_handle_kx (struct CadetTConnection *ct, |
1719 | const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg) | 1697 | const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg) |
@@ -2839,14 +2817,6 @@ maintain_connections_cb (void *cls) | |||
2839 | } | 2817 | } |
2840 | 2818 | ||
2841 | 2819 | ||
2842 | /** | ||
2843 | * Consider using the path @a p for the tunnel @a t. | ||
2844 | * The tunnel destination is at offset @a off in path @a p. | ||
2845 | * | ||
2846 | * @param cls our tunnel | ||
2847 | * @param path a path to our destination | ||
2848 | * @param off offset of the destination on path @a path | ||
2849 | */ | ||
2850 | void | 2820 | void |
2851 | GCT_consider_path (struct CadetTunnel *t, | 2821 | GCT_consider_path (struct CadetTunnel *t, |
2852 | struct CadetPeerPath *p, | 2822 | struct CadetPeerPath *p, |
@@ -3216,16 +3186,6 @@ GCT_create_tunnel (struct CadetPeer *destination) | |||
3216 | } | 3186 | } |
3217 | 3187 | ||
3218 | 3188 | ||
3219 | /** | ||
3220 | * Add a @a connection to the @a tunnel. | ||
3221 | * | ||
3222 | * @param t a tunnel | ||
3223 | * @param cid connection identifier to use for the connection | ||
3224 | * @param options options for the connection | ||
3225 | * @param path path to use for the connection | ||
3226 | * @return #GNUNET_OK on success, | ||
3227 | * #GNUNET_SYSERR on failure (duplicate connection) | ||
3228 | */ | ||
3229 | int | 3189 | int |
3230 | GCT_add_inbound_connection (struct CadetTunnel *t, | 3190 | GCT_add_inbound_connection (struct CadetTunnel *t, |
3231 | const struct | 3191 | const struct |
@@ -3449,17 +3409,6 @@ GCT_handle_encrypted (struct CadetTConnection *ct, | |||
3449 | } | 3409 | } |
3450 | 3410 | ||
3451 | 3411 | ||
3452 | /** | ||
3453 | * Sends an already built message on a tunnel, encrypting it and | ||
3454 | * choosing the best connection if not provided. | ||
3455 | * | ||
3456 | * @param message Message to send. Function modifies it. | ||
3457 | * @param t Tunnel on which this message is transmitted. | ||
3458 | * @param cont Continuation to call once message is really sent. | ||
3459 | * @param cont_cls Closure for @c cont. | ||
3460 | * @param The ID of the channel we are using for sending. | ||
3461 | * @return Handle to cancel message | ||
3462 | */ | ||
3463 | struct CadetTunnelQueueEntry * | 3412 | struct CadetTunnelQueueEntry * |
3464 | GCT_send (struct CadetTunnel *t, | 3413 | GCT_send (struct CadetTunnel *t, |
3465 | const struct GNUNET_MessageHeader *message, | 3414 | const struct GNUNET_MessageHeader *message, |
diff --git a/src/cadet/gnunet-service-cadet_tunnels.h b/src/cadet/gnunet-service-cadet_tunnels.h index aea131542..018a3ec73 100644 --- a/src/cadet/gnunet-service-cadet_tunnels.h +++ b/src/cadet/gnunet-service-cadet_tunnels.h | |||
@@ -252,20 +252,21 @@ GCT_send_cancel (struct CadetTunnelQueueEntry *q); | |||
252 | 252 | ||
253 | 253 | ||
254 | /** | 254 | /** |
255 | * Return the number of channels using a tunnel. | 255 | * Returns the number of channels using a tunnel. |
256 | * | 256 | * |
257 | * @param t tunnel to count obtain the number of channels for | 257 | * @param t Tunnel in question. |
258 | * @return number of channels using the tunnel | 258 | * @return Number of channels using the tunnel. |
259 | */ | 259 | */ |
260 | unsigned int | 260 | unsigned int |
261 | GCT_count_channels (struct CadetTunnel *t); | 261 | GCT_count_channels (struct CadetTunnel *t); |
262 | 262 | ||
263 | 263 | ||
264 | /** | 264 | /** |
265 | * Return the number of connections available for a tunnel. | 265 | * Counts the number of connections created for a tunnel, |
266 | * including busy connections. | ||
266 | * | 267 | * |
267 | * @param t tunnel to count obtain the number of connections for | 268 | * @param t Tunnel to be counted. |
268 | * @return number of connections available for the tunnel | 269 | * @return Number of connections created for the tunnel. |
269 | */ | 270 | */ |
270 | unsigned int | 271 | unsigned int |
271 | GCT_count_any_connections (const struct CadetTunnel *t); | 272 | GCT_count_any_connections (const struct CadetTunnel *t); |
@@ -341,7 +342,9 @@ GCT_change_estate (struct CadetTunnel *t, | |||
341 | enum CadetTunnelEState state); | 342 | enum CadetTunnelEState state); |
342 | 343 | ||
343 | /** | 344 | /** |
344 | * Handle KX message. | 345 | * Handle KX message that lacks authentication (and which will thus |
346 | * only be considered authenticated after we respond with our own | ||
347 | * KX_AUTH and finally successfully decrypt the payload). | ||
345 | * | 348 | * |
346 | * @param ct connection/tunnel combo that received encrypted message | 349 | * @param ct connection/tunnel combo that received encrypted message |
347 | * @param msg the key exchange message | 350 | * @param msg the key exchange message |