aboutsummaryrefslogtreecommitdiff
path: root/src/cadet
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet')
-rw-r--r--src/cadet/cadet.h4
-rw-r--r--src/cadet/cadet_api.c4
-rw-r--r--src/cadet/cadet_api_drop_message.c16
-rw-r--r--src/cadet/cadet_protocol.h4
-rw-r--r--src/cadet/gnunet-service-cadet.c100
-rw-r--r--src/cadet/gnunet-service-cadet.h1
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c28
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c3
-rw-r--r--src/cadet/gnunet-service-cadet_core.c6
-rw-r--r--src/cadet/gnunet-service-cadet_peer.c2
-rw-r--r--src/cadet/gnunet-service-cadet_tunnels.c2
-rw-r--r--src/cadet/gnunet-service-cadet_tunnels.h2
-rw-r--r--src/cadet/test_cadet.c11
13 files changed, 101 insertions, 82 deletions
diff --git a/src/cadet/cadet.h b/src/cadet/cadet.h
index d17eab1d6..31dad4117 100644
--- a/src/cadet/cadet.h
+++ b/src/cadet/cadet.h
@@ -325,7 +325,7 @@ struct GNUNET_CADET_RequestDropCadetMessage
325 * Type: #GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE 325 * Type: #GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE
326 */ 326 */
327 struct GNUNET_MessageHeader header; 327 struct GNUNET_MessageHeader header;
328 328
329 /** 329 /**
330 * Type of the message this handler covers, in host byte order. 330 * Type of the message this handler covers, in host byte order.
331 */ 331 */
@@ -337,7 +337,7 @@ struct GNUNET_CADET_RequestDropCadetMessage
337 struct GNUNET_CADET_ClientChannelNumber ccn; 337 struct GNUNET_CADET_ClientChannelNumber ccn;
338 338
339}; 339};
340 340
341/** 341/**
342 * Message to inform the client about channels in the service. 342 * Message to inform the client about channels in the service.
343 */ 343 */
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index 67f6571c5..45cc508a6 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -1001,8 +1001,8 @@ GNUNET_CADET_open_port (struct GNUNET_CADET_Handle *h,
1001 p->window_changes = window_changes; 1001 p->window_changes = window_changes;
1002 p->disconnects = disconnects; 1002 p->disconnects = disconnects;
1003 p->handlers = (NULL == pd->agpl_url) 1003 p->handlers = (NULL == pd->agpl_url)
1004 ? GNUNET_MQ_copy_handlers (handlers) 1004 ? GNUNET_MQ_copy_handlers (handlers)
1005 : GNUNET_MQ_copy_handlers2 (handlers, &return_agpl, NULL); 1005 : GNUNET_MQ_copy_handlers2 (handlers, &return_agpl, NULL);
1006 1006
1007 GNUNET_assert (GNUNET_OK == open_port_cb (h, &p->id, p)); 1007 GNUNET_assert (GNUNET_OK == open_port_cb (h, &p->id, p));
1008 return p; 1008 return p;
diff --git a/src/cadet/cadet_api_drop_message.c b/src/cadet/cadet_api_drop_message.c
index d9f7e003e..2b031b5c0 100644
--- a/src/cadet/cadet_api_drop_message.c
+++ b/src/cadet/cadet_api_drop_message.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
@@ -35,8 +35,8 @@
35 */ 35 */
36void 36void
37GNUNET_CADET_drop_message (struct GNUNET_MQ_Handle *mq, 37GNUNET_CADET_drop_message (struct GNUNET_MQ_Handle *mq,
38 struct GNUNET_CADET_ClientChannelNumber ccn, 38 struct GNUNET_CADET_ClientChannelNumber ccn,
39 uint16_t type) 39 uint16_t type)
40{ 40{
41 struct GNUNET_CADET_RequestDropCadetMessage *message; 41 struct GNUNET_CADET_RequestDropCadetMessage *message;
42 struct GNUNET_MQ_Envelope *env; 42 struct GNUNET_MQ_Envelope *env;
@@ -45,15 +45,15 @@ GNUNET_CADET_drop_message (struct GNUNET_MQ_Handle *mq,
45 45
46 message->ccn = ccn; 46 message->ccn = ccn;
47 message->type = type; 47 message->type = type;
48 48
49 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 49 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
50 "Dropping message for channel of type %s (%d)\n", type == GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY ? "GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY" : "UNKNOWN", type); 50 "Dropping message for channel of type %s (%d)\n", type ==
51 GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY ?
52 "GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY" : "UNKNOWN", type);
51 53
52 GNUNET_MQ_send (mq, env); 54 GNUNET_MQ_send (mq, env);
53
54}
55
56 55
56}
57 57
58 58
59/* end of cadet_api_drop_message.c */ 59/* end of cadet_api_drop_message.c */
diff --git a/src/cadet/cadet_protocol.h b/src/cadet/cadet_protocol.h
index 08298e224..117a7922e 100644
--- a/src/cadet/cadet_protocol.h
+++ b/src/cadet/cadet_protocol.h
@@ -85,11 +85,11 @@ struct GNUNET_CADET_ConnectionCreateMessage
85 uint32_t options GNUNET_PACKED; 85 uint32_t options GNUNET_PACKED;
86 86
87 /** 87 /**
88 * This flag indicates the peer sending the connection create 88 * This flag indicates the peer sending the connection create
89 * meassage likes to trigger a KX handshake. 89 * meassage likes to trigger a KX handshake.
90 */ 90 */
91 int has_monotime; 91 int has_monotime;
92 92
93 /** 93 /**
94 * This monotonic time is set, if a peer likes to trigger a KX, but is not 94 * This monotonic time is set, if a peer likes to trigger a KX, but is not
95 * the peer that should start the KX. (xrs,t3ss) 95 * the peer that should start the KX. (xrs,t3ss)
diff --git a/src/cadet/gnunet-service-cadet.c b/src/cadet/gnunet-service-cadet.c
index f3767fb01..2d3b548dd 100644
--- a/src/cadet/gnunet-service-cadet.c
+++ b/src/cadet/gnunet-service-cadet.c
@@ -1010,6 +1010,7 @@ handle_info_tunnels (void *cls,
1010 GNUNET_SERVICE_client_continue (c->client); 1010 GNUNET_SERVICE_client_continue (c->client);
1011} 1011}
1012 1012
1013
1013/** 1014/**
1014 * Handler for client's #GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE request. 1015 * Handler for client's #GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE request.
1015 * 1016 *
@@ -1026,11 +1027,12 @@ handle_drop_message (void *cls,
1026 ch = lookup_channel (c, 1027 ch = lookup_channel (c,
1027 message->ccn); 1028 message->ccn);
1028 1029
1029 GCCH_assign_type_to_drop(ch, message); 1030 GCCH_assign_type_to_drop (ch, message);
1030 1031
1031 GNUNET_SERVICE_client_continue (c->client); 1032 GNUNET_SERVICE_client_continue (c->client);
1032} 1033}
1033 1034
1035
1034/** 1036/**
1035 * Callback called when a client connects to the service. 1037 * Callback called when a client connects to the service.
1036 * 1038 *
@@ -1327,52 +1329,52 @@ run (void *cls,
1327 * Define "main" method using service macro. 1329 * Define "main" method using service macro.
1328 */ 1330 */
1329GNUNET_SERVICE_MAIN 1331GNUNET_SERVICE_MAIN
1330("cadet", 1332 ("cadet",
1331 GNUNET_SERVICE_OPTION_NONE, 1333 GNUNET_SERVICE_OPTION_NONE,
1332 &run, 1334 &run,
1333 &client_connect_cb, 1335 &client_connect_cb,
1334 &client_disconnect_cb, 1336 &client_disconnect_cb,
1335 NULL, 1337 NULL,
1336 GNUNET_MQ_hd_fixed_size (port_open, 1338 GNUNET_MQ_hd_fixed_size (port_open,
1337 GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_OPEN, 1339 GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_OPEN,
1338 struct GNUNET_CADET_PortMessage, 1340 struct GNUNET_CADET_PortMessage,
1339 NULL), 1341 NULL),
1340 GNUNET_MQ_hd_fixed_size (port_close, 1342 GNUNET_MQ_hd_fixed_size (port_close,
1341 GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE, 1343 GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE,
1342 struct GNUNET_CADET_PortMessage, 1344 struct GNUNET_CADET_PortMessage,
1343 NULL), 1345 NULL),
1344 GNUNET_MQ_hd_fixed_size (channel_create, 1346 GNUNET_MQ_hd_fixed_size (channel_create,
1345 GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE, 1347 GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE,
1346 struct GNUNET_CADET_LocalChannelCreateMessage, 1348 struct GNUNET_CADET_LocalChannelCreateMessage,
1347 NULL), 1349 NULL),
1348 GNUNET_MQ_hd_fixed_size (channel_destroy, 1350 GNUNET_MQ_hd_fixed_size (channel_destroy,
1349 GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY, 1351 GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY,
1350 struct GNUNET_CADET_LocalChannelDestroyMessage, 1352 struct GNUNET_CADET_LocalChannelDestroyMessage,
1351 NULL), 1353 NULL),
1352 GNUNET_MQ_hd_var_size (local_data, 1354 GNUNET_MQ_hd_var_size (local_data,
1353 GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA, 1355 GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA,
1354 struct GNUNET_CADET_LocalData, 1356 struct GNUNET_CADET_LocalData,
1355 NULL), 1357 NULL),
1356 GNUNET_MQ_hd_fixed_size (local_ack, 1358 GNUNET_MQ_hd_fixed_size (local_ack,
1357 GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK, 1359 GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK,
1358 struct GNUNET_CADET_LocalAck, 1360 struct GNUNET_CADET_LocalAck,
1359 NULL), 1361 NULL),
1360 GNUNET_MQ_hd_fixed_size (get_peers, 1362 GNUNET_MQ_hd_fixed_size (get_peers,
1361 GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PEERS, 1363 GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PEERS,
1362 struct GNUNET_MessageHeader, 1364 struct GNUNET_MessageHeader,
1363 NULL), 1365 NULL),
1364 GNUNET_MQ_hd_fixed_size (show_path, 1366 GNUNET_MQ_hd_fixed_size (show_path,
1365 GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PATH, 1367 GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PATH,
1366 struct GNUNET_CADET_RequestPathInfoMessage, 1368 struct GNUNET_CADET_RequestPathInfoMessage,
1367 NULL), 1369 NULL),
1368 GNUNET_MQ_hd_fixed_size (info_tunnels, 1370 GNUNET_MQ_hd_fixed_size (info_tunnels,
1369 GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_TUNNELS, 1371 GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_TUNNELS,
1370 struct GNUNET_MessageHeader, 1372 struct GNUNET_MessageHeader,
1371 NULL), 1373 NULL),
1372 GNUNET_MQ_hd_fixed_size (drop_message, 1374 GNUNET_MQ_hd_fixed_size (drop_message,
1373 GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE, 1375 GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE,
1374 struct GNUNET_CADET_RequestDropCadetMessage, 1376 struct GNUNET_CADET_RequestDropCadetMessage,
1375 NULL), 1377 NULL),
1376 GNUNET_MQ_handler_end ()); 1378 GNUNET_MQ_handler_end ());
1377 1379
1378/* end of gnunet-service-cadet-new.c */ 1380/* end of gnunet-service-cadet-new.c */
diff --git a/src/cadet/gnunet-service-cadet.h b/src/cadet/gnunet-service-cadet.h
index ff216f8c3..6da0950f1 100644
--- a/src/cadet/gnunet-service-cadet.h
+++ b/src/cadet/gnunet-service-cadet.h
@@ -325,5 +325,4 @@ const char *
325GSC_2s (struct CadetClient *c); 325GSC_2s (struct CadetClient *c);
326 326
327 327
328
329#endif 328#endif
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c
index e6fce562f..dab53b8c4 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -385,29 +385,32 @@ struct CadetChannel
385 * Type of message to be droped. See GCT_send. 385 * Type of message to be droped. See GCT_send.
386 */ 386 */
387 uint16_t type GNUNET_PACKED; 387 uint16_t type GNUNET_PACKED;
388 388
389}; 389};
390 390
391/** 391/**
392 * Assign type of message to drop. 392 * Assign type of message to drop.
393 * @param ch CadetChannel to assign type to drop. 393 * @param ch CadetChannel to assign type to drop.
394 * @param message GNUNET_CADET_RequestDropCadetMessage to get the type from. 394 * @param message GNUNET_CADET_RequestDropCadetMessage to get the type from.
395 */ 395 */
396void 396void
397GCCH_assign_type_to_drop(struct CadetChannel *ch, const struct GNUNET_CADET_RequestDropCadetMessage *message) 397GCCH_assign_type_to_drop (struct CadetChannel *ch, const struct
398 GNUNET_CADET_RequestDropCadetMessage *message)
398{ 399{
399 400
400 ch->type = message->type; 401 ch->type = message->type;
401 402
402} 403}
403 404
405
404/** 406/**
405 * Check if type of message is the one to drop. 407 * Check if type of message is the one to drop.
406 * @param ch CadetChannel to check for message type to drop. 408 * @param ch CadetChannel to check for message type to drop.
407 * @param message GNUNET_MessageHeader to compare the type with. 409 * @param message GNUNET_MessageHeader to compare the type with.
408 */ 410 */
409int 411int
410GCCH_is_type_to_drop(struct CadetChannel *ch, const struct GNUNET_MessageHeader *message) 412GCCH_is_type_to_drop (struct CadetChannel *ch, const struct
413 GNUNET_MessageHeader *message)
411{ 414{
412 415
413 if (ch->type == message->type) 416 if (ch->type == message->type)
@@ -419,6 +422,7 @@ GCCH_is_type_to_drop(struct CadetChannel *ch, const struct GNUNET_MessageHeader
419 return GNUNET_NO; 422 return GNUNET_NO;
420} 423}
421 424
425
422/** 426/**
423 * Get the static string for identification of the channel. 427 * Get the static string for identification of the channel.
424 * 428 *
@@ -854,7 +858,8 @@ send_channel_data_ack (struct CadetChannel *ch)
854 GCCH_2s (ch)); 858 GCCH_2s (ch));
855 if (NULL != ch->last_control_qe) 859 if (NULL != ch->last_control_qe)
856 GCT_send_cancel (ch->last_control_qe); 860 GCT_send_cancel (ch->last_control_qe);
857 ch->last_control_qe = GCT_send (ch->t, &msg.header, &send_ack_cb, ch, &msg.ctn); 861 ch->last_control_qe = GCT_send (ch->t, &msg.header, &send_ack_cb, ch,
862 &msg.ctn);
858} 863}
859 864
860 865
@@ -881,7 +886,8 @@ send_open_ack (void *cls)
881 msg.port = ch->port; 886 msg.port = ch->port;
882 if (NULL != ch->last_control_qe) 887 if (NULL != ch->last_control_qe)
883 GCT_send_cancel (ch->last_control_qe); 888 GCT_send_cancel (ch->last_control_qe);
884 ch->last_control_qe = GCT_send (ch->t, &msg.header, &send_ack_cb, ch, &msg.ctn); 889 ch->last_control_qe = GCT_send (ch->t, &msg.header, &send_ack_cb, ch,
890 &msg.ctn);
885} 891}
886 892
887 893
@@ -1513,7 +1519,8 @@ retry_transmission (void *cls)
1513 "Retrying transmission on %s of message %u\n", 1519 "Retrying transmission on %s of message %u\n",
1514 GCCH_2s (ch), 1520 GCCH_2s (ch),
1515 (unsigned int) ntohl (crm->data_message->mid.mid)); 1521 (unsigned int) ntohl (crm->data_message->mid.mid));
1516 crm->qe = GCT_send (ch->t, &crm->data_message->header, &data_sent_cb, crm, &crm->data_message->ctn); 1522 crm->qe = GCT_send (ch->t, &crm->data_message->header, &data_sent_cb, crm,
1523 &crm->data_message->ctn);
1517 GNUNET_assert (NULL == ch->retry_data_task); 1524 GNUNET_assert (NULL == ch->retry_data_task);
1518} 1525}
1519 1526
@@ -1901,7 +1908,8 @@ GCCH_handle_local_data (struct CadetChannel *ch,
1901 GNUNET_SCHEDULER_cancel (ch->retry_data_task); 1908 GNUNET_SCHEDULER_cancel (ch->retry_data_task);
1902 ch->retry_data_task = NULL; 1909 ch->retry_data_task = NULL;
1903 } 1910 }
1904 crm->qe = GCT_send (ch->t, &crm->data_message->header, &data_sent_cb, crm, &crm->data_message->ctn); 1911 crm->qe = GCT_send (ch->t, &crm->data_message->header, &data_sent_cb, crm,
1912 &crm->data_message->ctn);
1905 GNUNET_assert (NULL == ch->retry_data_task); 1913 GNUNET_assert (NULL == ch->retry_data_task);
1906 return GNUNET_OK; 1914 return GNUNET_OK;
1907} 1915}
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index a7c1d9fb0..3e1f779ad 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -614,6 +614,7 @@ set_monotime_sig (struct GNUNET_CADET_ConnectionCreateMessage *msg)
614 614
615} 615}
616 616
617
617/** 618/**
618 * Send a #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE message to the 619 * Send a #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE message to the
619 * first hop. 620 * first hop.
@@ -641,7 +642,7 @@ send_create (void *cls)
641 642
642 // check for tunnel state and set signed monotime (xrs,t3ss) 643 // check for tunnel state and set signed monotime (xrs,t3ss)
643 t = GCP_get_tunnel (cc->destination, GNUNET_YES); 644 t = GCP_get_tunnel (cc->destination, GNUNET_YES);
644 if ((NULL != t)&& (GCT_get_estate (t) == CADET_TUNNEL_KEY_UNINITIALIZED) && 645 if ((NULL != t) && (GCT_get_estate (t) == CADET_TUNNEL_KEY_UNINITIALIZED) &&
645 (GCT_alice_or_betty (GCP_get_id (cc->destination)) == GNUNET_NO)) 646 (GCT_alice_or_betty (GCP_get_id (cc->destination)) == GNUNET_NO))
646 { 647 {
647 create_msg->has_monotime = GNUNET_YES; 648 create_msg->has_monotime = GNUNET_YES;
diff --git a/src/cadet/gnunet-service-cadet_core.c b/src/cadet/gnunet-service-cadet_core.c
index db47c8a90..9a83fa31d 100644
--- a/src/cadet/gnunet-service-cadet_core.c
+++ b/src/cadet/gnunet-service-cadet_core.c
@@ -826,9 +826,9 @@ handle_connection_create (
826 826
827 // Check for CADET state in case the other side has lost the tunnel (xrs,t3ss) 827 // Check for CADET state in case the other side has lost the tunnel (xrs,t3ss)
828 if ((GNUNET_YES == msg->has_monotime) && 828 if ((GNUNET_YES == msg->has_monotime) &&
829 (GNUNET_YES == GCP_check_and_update_monotime(origin, msg->monotime)) && 829 (GNUNET_YES == GCP_check_and_update_monotime (origin, msg->monotime)) &&
830 ( GNUNET_OK == GCP_check_monotime_sig(origin, msg)) && 830 (GNUNET_OK == GCP_check_monotime_sig (origin, msg)) &&
831 (CADET_TUNNEL_KEY_OK == GCT_get_estate(t))) 831 (CADET_TUNNEL_KEY_OK == GCT_get_estate (t)))
832 { 832 {
833 GCT_change_estate (t, CADET_TUNNEL_KEY_UNINITIALIZED); 833 GCT_change_estate (t, CADET_TUNNEL_KEY_UNINITIALIZED);
834 } 834 }
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c
index e5885278b..a2068b31b 100644
--- a/src/cadet/gnunet-service-cadet_peer.c
+++ b/src/cadet/gnunet-service-cadet_peer.c
@@ -1552,6 +1552,7 @@ GCP_send_ooo (struct CadetPeer *cp,
1552 env); 1552 env);
1553} 1553}
1554 1554
1555
1555/** 1556/**
1556 * Checking if a monotime value is newer than the last monotime value received from a peer. If the time value is newer it will be stored at the peer. 1557 * Checking if a monotime value is newer than the last monotime value received from a peer. If the time value is newer it will be stored at the peer.
1557 * 1558 *
@@ -1574,6 +1575,7 @@ GCP_check_and_update_monotime (struct CadetPeer *peer,
1574 return GNUNET_NO; 1575 return GNUNET_NO;
1575} 1576}
1576 1577
1578
1577/** 1579/**
1578 * Checking the signature for a monotime of a GNUNET_CADET_ConnectionCreateMessage. 1580 * Checking the signature for a monotime of a GNUNET_CADET_ConnectionCreateMessage.
1579 * 1581 *
diff --git a/src/cadet/gnunet-service-cadet_tunnels.c b/src/cadet/gnunet-service-cadet_tunnels.c
index 66e7d5b1e..2ca46b5aa 100644
--- a/src/cadet/gnunet-service-cadet_tunnels.c
+++ b/src/cadet/gnunet-service-cadet_tunnels.c
@@ -3476,7 +3476,7 @@ GCT_send (struct CadetTunnel *t,
3476 { 3476 {
3477 ch = lookup_channel (t, 3477 ch = lookup_channel (t,
3478 *ctn); 3478 *ctn);
3479 if ((NULL != ch)&& GCCH_is_type_to_drop (ch, message)) 3479 if ((NULL != ch) && GCCH_is_type_to_drop (ch, message))
3480 { 3480 {
3481 GNUNET_break (0); 3481 GNUNET_break (0);
3482 return NULL; 3482 return NULL;
diff --git a/src/cadet/gnunet-service-cadet_tunnels.h b/src/cadet/gnunet-service-cadet_tunnels.h
index 147f2e56f..075cd03f8 100644
--- a/src/cadet/gnunet-service-cadet_tunnels.h
+++ b/src/cadet/gnunet-service-cadet_tunnels.h
@@ -235,7 +235,7 @@ GCT_send (struct CadetTunnel *t,
235 const struct GNUNET_MessageHeader *message, 235 const struct GNUNET_MessageHeader *message,
236 GCT_SendContinuation cont, 236 GCT_SendContinuation cont,
237 void *cont_cls, 237 void *cont_cls,
238 struct GNUNET_CADET_ChannelTunnelNumber *ctn); 238 struct GNUNET_CADET_ChannelTunnelNumber *ctn);
239 239
240 240
241/** 241/**
diff --git a/src/cadet/test_cadet.c b/src/cadet/test_cadet.c
index 779d3bc9f..23f2ccbe3 100644
--- a/src/cadet/test_cadet.c
+++ b/src/cadet/test_cadet.c
@@ -550,6 +550,7 @@ get_from_p_ids ()
550 } 550 }
551} 551}
552 552
553
553static struct GNUNET_CADET_Handle * 554static struct GNUNET_CADET_Handle *
554get_from_cadets () 555get_from_cadets ()
555{ 556{
@@ -568,6 +569,7 @@ get_from_cadets ()
568 569
569} 570}
570 571
572
571static unsigned int 573static unsigned int
572get_peer_nr (int outgoing) 574get_peer_nr (int outgoing)
573{ 575{
@@ -581,6 +583,7 @@ get_peer_nr (int outgoing)
581 } 583 }
582} 584}
583 585
586
584/** 587/**
585 * Task to reconnect to other peer. 588 * Task to reconnect to other peer.
586 * 589 *
@@ -626,6 +629,7 @@ reconnect_op (void *cls)
626 send_test_message (outgoing_ch); 629 send_test_message (outgoing_ch);
627} 630}
628 631
632
629void 633void
630reopen_channel () 634reopen_channel ()
631{ 635{
@@ -659,6 +663,7 @@ reopen_channel ()
659 send_test_message (outgoing_ch); 663 send_test_message (outgoing_ch);
660} 664}
661 665
666
662static void 667static void
663peers_callback (void *cls, const struct GNUNET_CADET_PeerListEntry *ple); 668peers_callback (void *cls, const struct GNUNET_CADET_PeerListEntry *ple);
664 669
@@ -676,6 +681,7 @@ get_peers (void *cls)
676 681
677} 682}
678 683
684
679/** 685/**
680 * Method called to retrieve information about all peers in CADET, called 686 * Method called to retrieve information about all peers in CADET, called
681 * once per peer. 687 * once per peer.
@@ -712,7 +718,7 @@ peers_callback (void *cls, const struct GNUNET_CADET_PeerListEntry *ple)
712 "p_id %s\n", 718 "p_id %s\n",
713 GNUNET_i2s_full (p_id)); 719 GNUNET_i2s_full (p_id));
714 720
715 if ((0 == GNUNET_memcmp (&ple->peer, p_id))&& ple->have_tunnel) 721 if ((0 == GNUNET_memcmp (&ple->peer, p_id)) && ple->have_tunnel)
716 { 722 {
717 723
718 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 724 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -733,6 +739,7 @@ peers_callback (void *cls, const struct GNUNET_CADET_PeerListEntry *ple)
733 } 739 }
734} 740}
735 741
742
736/** 743/**
737 * Function called whenever an MQ-channel is destroyed, unless the destruction 744 * Function called whenever an MQ-channel is destroyed, unless the destruction
738 * was requested by #GNUNET_CADET_channel_destroy. 745 * was requested by #GNUNET_CADET_channel_destroy.
@@ -1169,7 +1176,7 @@ connect_handler (void *cls,
1169 1176
1170 if (peer == get_peer_nr (GNUNET_NO)) 1177 if (peer == get_peer_nr (GNUNET_NO))
1171 { 1178 {
1172 if ((DESTROY != test)&&(NULL != incoming_ch)) 1179 if ((DESTROY != test) && (NULL != incoming_ch))
1173 { 1180 {
1174 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1181 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1175 "Duplicate incoming channel for client %lu\n", 1182 "Duplicate incoming channel for client %lu\n",