aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2016-07-20 17:13:26 +0000
committerBart Polot <bart@net.in.tum.de>2016-07-20 17:13:26 +0000
commit90c70e8315c4a366996da379f839dc84d21d5f38 (patch)
tree0bfd73d2da8b8efb8de888c09ea4dd5bfc4cdb0f
parent3aab63d5c50db0eb784d3b65b2bd989d3458c960 (diff)
downloadgnunet-90c70e8315c4a366996da379f839dc84d21d5f38.tar.gz
gnunet-90c70e8315c4a366996da379f839dc84d21d5f38.zip
- fix CADET-using services
-rw-r--r--src/conversation/gnunet-service-conversation.c32
-rw-r--r--src/exit/gnunet-daemon-exit.c16
-rw-r--r--src/fs/gnunet-service-fs_cadet_client.c8
-rw-r--r--src/fs/gnunet-service-fs_cadet_server.c20
-rw-r--r--src/multicast/gnunet-service-multicast.c16
-rw-r--r--src/pt/gnunet-daemon-pt.c6
-rw-r--r--src/rps/gnunet-service-rps.c9
-rw-r--r--src/rps/gnunet-service-rps_peers.c14
-rw-r--r--src/rps/gnunet-service-rps_peers.h6
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c6
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c13
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct_alice.c6
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct_bob.c13
-rw-r--r--src/set/gnunet-service-set.c14
-rw-r--r--src/vpn/gnunet-service-vpn.c9
15 files changed, 88 insertions, 100 deletions
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c
index dcef0f18b..b547d814c 100644
--- a/src/conversation/gnunet-service-conversation.c
+++ b/src/conversation/gnunet-service-conversation.c
@@ -720,7 +720,7 @@ handle_client_call_message (void *cls,
720 ch->channel_reliable = GNUNET_CADET_channel_create (cadet, 720 ch->channel_reliable = GNUNET_CADET_channel_create (cadet,
721 ch, 721 ch,
722 &msg->target, 722 &msg->target,
723 GNUNET_APPLICATION_TYPE_CONVERSATION_CONTROL, 723 GC_u2h (GNUNET_APPLICATION_TYPE_CONVERSATION_CONTROL),
724 GNUNET_CADET_OPTION_RELIABLE); 724 GNUNET_CADET_OPTION_RELIABLE);
725 ch->reliable_mq = GNUNET_CADET_mq_create (ch->channel_reliable); 725 ch->reliable_mq = GNUNET_CADET_mq_create (ch->channel_reliable);
726 e = GNUNET_MQ_msg (ring, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING); 726 e = GNUNET_MQ_msg (ring, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING);
@@ -1102,7 +1102,7 @@ handle_cadet_pickup_message (void *cls,
1102 ch->channel_unreliable = GNUNET_CADET_channel_create (cadet, 1102 ch->channel_unreliable = GNUNET_CADET_channel_create (cadet,
1103 ch, 1103 ch,
1104 &ch->target, 1104 &ch->target,
1105 GNUNET_APPLICATION_TYPE_CONVERSATION_AUDIO, 1105 GC_u2h (GNUNET_APPLICATION_TYPE_CONVERSATION_AUDIO),
1106 GNUNET_CADET_OPTION_DEFAULT); 1106 GNUNET_CADET_OPTION_DEFAULT);
1107 if (NULL == ch->channel_unreliable) 1107 if (NULL == ch->channel_unreliable)
1108 { 1108 {
@@ -1351,13 +1351,14 @@ handle_cadet_audio_message (void *cls,
1351 */ 1351 */
1352static void * 1352static void *
1353inbound_channel (void *cls, 1353inbound_channel (void *cls,
1354 struct GNUNET_CADET_Channel *channel, 1354 struct GNUNET_CADET_Channel *channel,
1355 const struct GNUNET_PeerIdentity *initiator, 1355 const struct GNUNET_PeerIdentity *initiator,
1356 uint32_t port, enum GNUNET_CADET_ChannelOption options) 1356 const struct GNUNET_HashCode *port,
1357 enum GNUNET_CADET_ChannelOption options)
1357{ 1358{
1358 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 1359 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1359 _("Received incoming Cadet channel on port %u\n"), 1360 _("Received incoming Cadet channel on port %s\n"),
1360 (unsigned int) port); 1361 GNUNET_h2s (port));
1361 return NULL; 1362 return NULL;
1362} 1363}
1363 1364
@@ -1557,11 +1558,6 @@ run (void *cls,
1557 0}, 1558 0},
1558 {NULL, 0, 0} 1559 {NULL, 0, 0}
1559 }; 1560 };
1560 static uint32_t ports[] = {
1561 GNUNET_APPLICATION_TYPE_CONVERSATION_CONTROL,
1562 GNUNET_APPLICATION_TYPE_CONVERSATION_AUDIO,
1563 0
1564 };
1565 1561
1566 cfg = c; 1562 cfg = c;
1567 GNUNET_assert (GNUNET_OK == 1563 GNUNET_assert (GNUNET_OK ==
@@ -1569,10 +1565,8 @@ run (void *cls,
1569 &my_identity)); 1565 &my_identity));
1570 cadet = GNUNET_CADET_connect (cfg, 1566 cadet = GNUNET_CADET_connect (cfg,
1571 NULL, 1567 NULL,
1572 &inbound_channel,
1573 &inbound_end, 1568 &inbound_end,
1574 cadet_handlers, 1569 cadet_handlers);
1575 ports);
1576 1570
1577 if (NULL == cadet) 1571 if (NULL == cadet)
1578 { 1572 {
@@ -1580,6 +1574,14 @@ run (void *cls,
1580 GNUNET_SCHEDULER_shutdown (); 1574 GNUNET_SCHEDULER_shutdown ();
1581 return; 1575 return;
1582 } 1576 }
1577
1578 GNUNET_CADET_open_port (cadet,
1579 GC_u2h (GNUNET_APPLICATION_TYPE_CONVERSATION_CONTROL),
1580 &inbound_channel, NULL);
1581 GNUNET_CADET_open_port (cadet,
1582 GC_u2h (GNUNET_APPLICATION_TYPE_CONVERSATION_AUDIO),
1583 &inbound_channel, NULL);
1584
1583 nc = GNUNET_SERVER_notification_context_create (server, 16); 1585 nc = GNUNET_SERVER_notification_context_create (server, 16);
1584 GNUNET_SERVER_add_handlers (server, server_handlers); 1586 GNUNET_SERVER_add_handlers (server, server_handlers);
1585 GNUNET_SERVER_disconnect_notify (server, 1587 GNUNET_SERVER_disconnect_notify (server,
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c
index 9f3d05c77..2b9ddc722 100644
--- a/src/exit/gnunet-daemon-exit.c
+++ b/src/exit/gnunet-daemon-exit.c
@@ -3036,7 +3036,7 @@ static void *
3036new_channel (void *cls, 3036new_channel (void *cls,
3037 struct GNUNET_CADET_Channel *channel, 3037 struct GNUNET_CADET_Channel *channel,
3038 const struct GNUNET_PeerIdentity *initiator, 3038 const struct GNUNET_PeerIdentity *initiator,
3039 uint32_t port, 3039 const struct GNUNET_HashCode *port,
3040 enum GNUNET_CADET_ChannelOption options) 3040 enum GNUNET_CADET_ChannelOption options)
3041{ 3041{
3042 struct ChannelState *s = GNUNET_new (struct ChannelState); 3042 struct ChannelState *s = GNUNET_new (struct ChannelState);
@@ -3760,16 +3760,20 @@ run (void *cls,
3760 GNUNET_SCHEDULER_shutdown (); 3760 GNUNET_SCHEDULER_shutdown ();
3761 return; 3761 return;
3762 } 3762 }
3763 cadet_handle 3763 cadet_handle = GNUNET_CADET_connect (cfg, NULL, &clean_channel, handlers);
3764 = GNUNET_CADET_connect (cfg, NULL,
3765 &new_channel,
3766 &clean_channel, handlers,
3767 apptypes);
3768 if (NULL == cadet_handle) 3764 if (NULL == cadet_handle)
3769 { 3765 {
3770 GNUNET_SCHEDULER_shutdown (); 3766 GNUNET_SCHEDULER_shutdown ();
3771 return; 3767 return;
3772 } 3768 }
3769 for (int i = 0;
3770 GNUNET_APPLICATION_TYPE_END != apptypes[i]
3771 && i < sizeof (apptypes)/sizeof (*apptypes);
3772 i++)
3773 {
3774 GNUNET_CADET_open_port (cadet_handle, GC_u2h (apptypes[i]),
3775 &new_channel, NULL);
3776 }
3773 3777
3774 /* Cadet handle acquired, now announce regular expressions matching our exit */ 3778 /* Cadet handle acquired, now announce regular expressions matching our exit */
3775 if ( (GNUNET_YES == ipv4_enabled) && (GNUNET_YES == ipv4_exit) ) 3779 if ( (GNUNET_YES == ipv4_enabled) && (GNUNET_YES == ipv4_exit) )
diff --git a/src/fs/gnunet-service-fs_cadet_client.c b/src/fs/gnunet-service-fs_cadet_client.c
index 90a0c3b7f..5b24b3116 100644
--- a/src/fs/gnunet-service-fs_cadet_client.c
+++ b/src/fs/gnunet-service-fs_cadet_client.c
@@ -236,7 +236,7 @@ reset_cadet (struct CadetHandle *mh)
236 mh->channel = GNUNET_CADET_channel_create (cadet_handle, 236 mh->channel = GNUNET_CADET_channel_create (cadet_handle,
237 mh, 237 mh,
238 &mh->target, 238 &mh->target,
239 GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER, 239 GC_u2h (GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER),
240 GNUNET_CADET_OPTION_RELIABLE); 240 GNUNET_CADET_OPTION_RELIABLE);
241 transmit_pending (mh); 241 transmit_pending (mh);
242} 242}
@@ -547,7 +547,7 @@ get_cadet (const struct GNUNET_PeerIdentity *target)
547 mh->channel = GNUNET_CADET_channel_create (cadet_handle, 547 mh->channel = GNUNET_CADET_channel_create (cadet_handle,
548 mh, 548 mh,
549 &mh->target, 549 &mh->target,
550 GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER, 550 GC_u2h (GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER),
551 GNUNET_CADET_OPTION_RELIABLE); 551 GNUNET_CADET_OPTION_RELIABLE);
552 GNUNET_assert (mh == 552 GNUNET_assert (mh ==
553 GNUNET_CONTAINER_multipeermap_get (cadet_map, 553 GNUNET_CONTAINER_multipeermap_get (cadet_map,
@@ -719,10 +719,8 @@ GSF_cadet_start_client ()
719 cadet_map = GNUNET_CONTAINER_multipeermap_create (16, GNUNET_YES); 719 cadet_map = GNUNET_CONTAINER_multipeermap_create (16, GNUNET_YES);
720 cadet_handle = GNUNET_CADET_connect (GSF_cfg, 720 cadet_handle = GNUNET_CADET_connect (GSF_cfg,
721 NULL, 721 NULL,
722 NULL,
723 &cleaner_cb, 722 &cleaner_cb,
724 handlers, 723 handlers);
725 NULL);
726} 724}
727 725
728 726
diff --git a/src/fs/gnunet-service-fs_cadet_server.c b/src/fs/gnunet-service-fs_cadet_server.c
index 21874b674..32fe4191a 100644
--- a/src/fs/gnunet-service-fs_cadet_server.c
+++ b/src/fs/gnunet-service-fs_cadet_server.c
@@ -472,7 +472,8 @@ static void *
472accept_cb (void *cls, 472accept_cb (void *cls,
473 struct GNUNET_CADET_Channel *channel, 473 struct GNUNET_CADET_Channel *channel,
474 const struct GNUNET_PeerIdentity *initiator, 474 const struct GNUNET_PeerIdentity *initiator,
475 uint32_t port, enum GNUNET_CADET_ChannelOption options) 475 const struct GNUNET_HashCode *port,
476 enum GNUNET_CADET_ChannelOption options)
476{ 477{
477 struct CadetClient *sc; 478 struct CadetClient *sc;
478 479
@@ -561,11 +562,6 @@ GSF_cadet_start_server ()
561 { &request_cb, GNUNET_MESSAGE_TYPE_FS_CADET_QUERY, sizeof (struct CadetQueryMessage)}, 562 { &request_cb, GNUNET_MESSAGE_TYPE_FS_CADET_QUERY, sizeof (struct CadetQueryMessage)},
562 { NULL, 0, 0 } 563 { NULL, 0, 0 }
563 }; 564 };
564 static const uint32_t ports[] = {
565 GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER,
566 0
567 };
568
569 if (GNUNET_YES != 565 if (GNUNET_YES !=
570 GNUNET_CONFIGURATION_get_value_number (GSF_cfg, 566 GNUNET_CONFIGURATION_get_value_number (GSF_cfg,
571 "fs", 567 "fs",
@@ -576,11 +572,13 @@ GSF_cadet_start_server ()
576 "Initializing cadet FS server with a limit of %llu connections\n", 572 "Initializing cadet FS server with a limit of %llu connections\n",
577 sc_count_max); 573 sc_count_max);
578 listen_channel = GNUNET_CADET_connect (GSF_cfg, 574 listen_channel = GNUNET_CADET_connect (GSF_cfg,
579 NULL, 575 NULL,
580 &accept_cb, 576 &cleaner_cb,
581 &cleaner_cb, 577 handlers);
582 handlers, 578 GNUNET_assert (NULL != listen_channel);
583 ports); 579 GNUNET_CADET_open_port (listen_channel,
580 GC_u2h (GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER),
581 &accept_cb, NULL);
584} 582}
585 583
586 584
diff --git a/src/multicast/gnunet-service-multicast.c b/src/multicast/gnunet-service-multicast.c
index 55c269874..91cafb707 100644
--- a/src/multicast/gnunet-service-multicast.c
+++ b/src/multicast/gnunet-service-multicast.c
@@ -789,7 +789,7 @@ cadet_channel_create (struct Group *grp, struct GNUNET_PeerIdentity *peer)
789 chn->direction = DIR_OUTGOING; 789 chn->direction = DIR_OUTGOING;
790 chn->join_status = JOIN_WAITING; 790 chn->join_status = JOIN_WAITING;
791 chn->channel = GNUNET_CADET_channel_create (cadet, chn, &chn->peer, 791 chn->channel = GNUNET_CADET_channel_create (cadet, chn, &chn->peer,
792 GNUNET_APPLICATION_TYPE_MULTICAST, 792 GC_u2h (GNUNET_APPLICATION_TYPE_MULTICAST),
793 GNUNET_CADET_OPTION_RELIABLE); 793 GNUNET_CADET_OPTION_RELIABLE);
794 GNUNET_CONTAINER_multihashmap_put (channels_out, &chn->group_pub_hash, chn, 794 GNUNET_CONTAINER_multihashmap_put (channels_out, &chn->group_pub_hash, chn,
795 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); 795 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
@@ -1484,7 +1484,7 @@ static void *
1484cadet_notify_channel_new (void *cls, 1484cadet_notify_channel_new (void *cls,
1485 struct GNUNET_CADET_Channel *channel, 1485 struct GNUNET_CADET_Channel *channel,
1486 const struct GNUNET_PeerIdentity *initiator, 1486 const struct GNUNET_PeerIdentity *initiator,
1487 uint32_t port, 1487 const struct GNUNET_HashCode *port,
1488 enum GNUNET_CADET_ChannelOption options) 1488 enum GNUNET_CADET_ChannelOption options)
1489{ 1489{
1490 return NULL; 1490 return NULL;
@@ -1810,12 +1810,6 @@ static const struct GNUNET_CADET_MessageHandler cadet_handlers[] = {
1810 1810
1811 1811
1812/** 1812/**
1813 * Listening ports for CADET.
1814 */
1815static const uint32_t cadet_ports[] = { GNUNET_APPLICATION_TYPE_MULTICAST, 0 };
1816
1817
1818/**
1819 * Connected to core service. 1813 * Connected to core service.
1820 */ 1814 */
1821static void 1815static void
@@ -1833,9 +1827,11 @@ core_connected_cb (void *cls, const struct GNUNET_PeerIdentity *my_identity)
1833 replay_req_client = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_NO); 1827 replay_req_client = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_NO);
1834 1828
1835 cadet = GNUNET_CADET_connect (cfg, NULL, 1829 cadet = GNUNET_CADET_connect (cfg, NULL,
1836 &cadet_notify_channel_new,
1837 &cadet_notify_channel_end, 1830 &cadet_notify_channel_end,
1838 cadet_handlers, cadet_ports); 1831 cadet_handlers);
1832 GNUNET_assert (NULL != cadet);
1833 GNUNET_CADET_open_port (cadet, GC_u2h (GNUNET_APPLICATION_TYPE_MULTICAST),
1834 &cadet_notify_channel_new, NULL);
1839 1835
1840 nc = GNUNET_SERVER_notification_context_create (server, 1); 1836 nc = GNUNET_SERVER_notification_context_create (server, 1);
1841 GNUNET_SERVER_add_handlers (server, server_handlers); 1837 GNUNET_SERVER_add_handlers (server, server_handlers);
diff --git a/src/pt/gnunet-daemon-pt.c b/src/pt/gnunet-daemon-pt.c
index 5d83fd883..7f4852e4b 100644
--- a/src/pt/gnunet-daemon-pt.c
+++ b/src/pt/gnunet-daemon-pt.c
@@ -351,7 +351,7 @@ try_open_exit ()
351 pos->cadet_channel = GNUNET_CADET_channel_create (cadet_handle, 351 pos->cadet_channel = GNUNET_CADET_channel_create (cadet_handle,
352 pos, 352 pos,
353 &pos->peer, 353 &pos->peer,
354 GNUNET_APPLICATION_TYPE_INTERNET_RESOLVER, 354 GC_u2h (GNUNET_APPLICATION_TYPE_INTERNET_RESOLVER),
355 GNUNET_CADET_OPTION_DEFAULT); 355 GNUNET_CADET_OPTION_DEFAULT);
356 if (NULL == pos->cadet_channel) 356 if (NULL == pos->cadet_channel)
357 { 357 {
@@ -1288,9 +1288,9 @@ run (void *cls, char *const *args GNUNET_UNUSED,
1288 GNUNET_SCHEDULER_shutdown (); 1288 GNUNET_SCHEDULER_shutdown ();
1289 return; 1289 return;
1290 } 1290 }
1291 cadet_handle = GNUNET_CADET_connect (cfg, NULL, NULL, 1291 cadet_handle = GNUNET_CADET_connect (cfg, NULL,
1292 &cadet_channel_end_cb, 1292 &cadet_channel_end_cb,
1293 cadet_handlers, NULL); 1293 cadet_handlers);
1294 if (NULL == cadet_handle) 1294 if (NULL == cadet_handle)
1295 { 1295 {
1296 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1296 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index bb2bd0881..00c541d1f 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -2334,13 +2334,14 @@ run (void *cls,
2334 {&handle_peer_pull_reply , GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY , 0}, 2334 {&handle_peer_pull_reply , GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY , 0},
2335 {NULL, 0, 0} 2335 {NULL, 0, 0}
2336 }; 2336 };
2337 const uint32_t ports[] = {GNUNET_RPS_CADET_PORT, 0}; // _PORT specified in src/rps/rps.h
2338 cadet_handle = GNUNET_CADET_connect (cfg, 2337 cadet_handle = GNUNET_CADET_connect (cfg,
2339 cls, 2338 cls,
2340 &Peers_handle_inbound_channel,
2341 &cleanup_destroyed_channel, 2339 &cleanup_destroyed_channel,
2342 cadet_handlers, 2340 cadet_handlers);
2343 ports); 2341 GNUNET_assert (NULL != cadet_handle);
2342 GNUNET_CADET_open_port (cadet_handle, GC_u2h (GNUNET_RPS_CADET_PORT),
2343 &Peers_handle_inbound_channel, cls);
2344
2344 2345
2345 peerinfo_handle = GNUNET_PEERINFO_connect (cfg); 2346 peerinfo_handle = GNUNET_PEERINFO_connect (cfg);
2346 Peers_initialise (fn_valid_peers, cadet_handle, &own_identity); 2347 Peers_initialise (fn_valid_peers, cadet_handle, &own_identity);
diff --git a/src/rps/gnunet-service-rps_peers.c b/src/rps/gnunet-service-rps_peers.c
index 2b5f39857..7c9f5ecd9 100644
--- a/src/rps/gnunet-service-rps_peers.c
+++ b/src/rps/gnunet-service-rps_peers.c
@@ -174,7 +174,7 @@ struct PeerContext
174 * Identity of the peer 174 * Identity of the peer
175 */ 175 */
176 struct GNUNET_PeerIdentity peer_id; 176 struct GNUNET_PeerIdentity peer_id;
177 177
178 /** 178 /**
179 * Flags indicating status of peer 179 * Flags indicating status of peer
180 */ 180 */
@@ -506,7 +506,7 @@ get_channel (const struct GNUNET_PeerIdentity *peer)
506 GNUNET_CADET_channel_create (cadet_handle, 506 GNUNET_CADET_channel_create (cadet_handle,
507 peer_ctx->send_channel_flags, /* context */ 507 peer_ctx->send_channel_flags, /* context */
508 peer, 508 peer,
509 GNUNET_RPS_CADET_PORT, 509 GC_u2h (GNUNET_RPS_CADET_PORT),
510 GNUNET_CADET_OPTION_RELIABLE); 510 GNUNET_CADET_OPTION_RELIABLE);
511 } 511 }
512 GNUNET_assert (NULL != peer_ctx->send_channel); 512 GNUNET_assert (NULL != peer_ctx->send_channel);
@@ -518,7 +518,7 @@ get_channel (const struct GNUNET_PeerIdentity *peer)
518 * 518 *
519 * If we already have a message queue open to this client, 519 * If we already have a message queue open to this client,
520 * simply return it, otherways create one. 520 * simply return it, otherways create one.
521 * 521 *
522 * @param peer the peer to get the mq to 522 * @param peer the peer to get the mq to
523 * @return the #GNUNET_MQ_Handle 523 * @return the #GNUNET_MQ_Handle
524 */ 524 */
@@ -1086,7 +1086,7 @@ Peers_clean_peer (const struct GNUNET_PeerIdentity *peer)
1086 1086
1087 // TODO actually remove unnecessary data 1087 // TODO actually remove unnecessary data
1088 1088
1089 if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (peer_map, peer)) 1089 if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (peer_map, peer))
1090 { 1090 {
1091 return GNUNET_NO; 1091 return GNUNET_NO;
1092 } 1092 }
@@ -1104,7 +1104,7 @@ Peers_clean_peer (const struct GNUNET_PeerIdentity *peer)
1104 1104
1105/** 1105/**
1106 * @brief Remove peer 1106 * @brief Remove peer
1107 * 1107 *
1108 * @param peer the peer to clean 1108 * @param peer the peer to clean
1109 * @return #GNUNET_YES if peer was removed 1109 * @return #GNUNET_YES if peer was removed
1110 * #GNUNET_NO otherwise 1110 * #GNUNET_NO otherwise
@@ -1114,7 +1114,7 @@ Peers_remove_peer (const struct GNUNET_PeerIdentity *peer)
1114{ 1114{
1115 struct PeerContext *peer_ctx; 1115 struct PeerContext *peer_ctx;
1116 1116
1117 if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (peer_map, peer)) 1117 if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (peer_map, peer))
1118 { 1118 {
1119 return GNUNET_NO; 1119 return GNUNET_NO;
1120 } 1120 }
@@ -1350,7 +1350,7 @@ void *
1350Peers_handle_inbound_channel (void *cls, 1350Peers_handle_inbound_channel (void *cls,
1351 struct GNUNET_CADET_Channel *channel, 1351 struct GNUNET_CADET_Channel *channel,
1352 const struct GNUNET_PeerIdentity *initiator, 1352 const struct GNUNET_PeerIdentity *initiator,
1353 uint32_t port, 1353 const struct GNUNET_HashCode *port,
1354 enum GNUNET_CADET_ChannelOption options) 1354 enum GNUNET_CADET_ChannelOption options)
1355{ 1355{
1356 struct PeerContext *peer_ctx; 1356 struct PeerContext *peer_ctx;
diff --git a/src/rps/gnunet-service-rps_peers.h b/src/rps/gnunet-service-rps_peers.h
index abb5d831a..c7b9ed265 100644
--- a/src/rps/gnunet-service-rps_peers.h
+++ b/src/rps/gnunet-service-rps_peers.h
@@ -173,7 +173,7 @@ Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer);
173 173
174/** 174/**
175 * @brief Remove unecessary data 175 * @brief Remove unecessary data
176 * 176 *
177 * If the other peer is not intending to send messages, we have messages pending 177 * If the other peer is not intending to send messages, we have messages pending
178 * to be sent to this peer and we are not waiting for a reply, remove the 178 * to be sent to this peer and we are not waiting for a reply, remove the
179 * information about it (its #PeerContext). 179 * information about it (its #PeerContext).
@@ -187,7 +187,7 @@ Peers_clean_peer (const struct GNUNET_PeerIdentity *peer);
187 187
188/** 188/**
189 * @brief Remove peer 189 * @brief Remove peer
190 * 190 *
191 * @param peer the peer to clean 191 * @param peer the peer to clean
192 * @return #GNUNET_YES if peer was removed 192 * @return #GNUNET_YES if peer was removed
193 * #GNUNET_NO otherwise 193 * #GNUNET_NO otherwise
@@ -320,7 +320,7 @@ void *
320Peers_handle_inbound_channel (void *cls, 320Peers_handle_inbound_channel (void *cls,
321 struct GNUNET_CADET_Channel *channel, 321 struct GNUNET_CADET_Channel *channel,
322 const struct GNUNET_PeerIdentity *initiator, 322 const struct GNUNET_PeerIdentity *initiator,
323 uint32_t port, 323 const struct GNUNET_HashCode *port,
324 enum GNUNET_CADET_ChannelOption options); 324 enum GNUNET_CADET_ChannelOption options);
325 325
326/** 326/**
diff --git a/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c b/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
index c9f4811e2..43a25a08d 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
@@ -858,7 +858,7 @@ client_request_complete_alice (struct AliceServiceSession *s)
858 = GNUNET_CADET_channel_create (my_cadet, 858 = GNUNET_CADET_channel_create (my_cadet,
859 s, 859 s,
860 &s->peer, 860 &s->peer,
861 GNUNET_APPLICATION_TYPE_SCALARPRODUCT_ECC, 861 GC_u2h (GNUNET_APPLICATION_TYPE_SCALARPRODUCT_ECC),
862 GNUNET_CADET_OPTION_RELIABLE); 862 GNUNET_CADET_OPTION_RELIABLE);
863 if (NULL == s->channel) 863 if (NULL == s->channel)
864 { 864 {
@@ -1184,10 +1184,8 @@ run (void *cls,
1184 &handle_client_disconnect, 1184 &handle_client_disconnect,
1185 NULL); 1185 NULL);
1186 my_cadet = GNUNET_CADET_connect (cfg, NULL, 1186 my_cadet = GNUNET_CADET_connect (cfg, NULL,
1187 NULL /* no incoming supported */,
1188 &cb_channel_destruction, 1187 &cb_channel_destruction,
1189 cadet_handlers, 1188 cadet_handlers);
1190 NULL);
1191 if (NULL == my_cadet) 1189 if (NULL == my_cadet)
1192 { 1190 {
1193 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1191 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c b/src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
index fbdf62192..7246fa6a0 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
@@ -891,7 +891,7 @@ static void *
891cb_channel_incoming (void *cls, 891cb_channel_incoming (void *cls,
892 struct GNUNET_CADET_Channel *channel, 892 struct GNUNET_CADET_Channel *channel,
893 const struct GNUNET_PeerIdentity *initiator, 893 const struct GNUNET_PeerIdentity *initiator,
894 uint32_t port, 894 const struct GNUNET_HashCode *port,
895 enum GNUNET_CADET_ChannelOption options) 895 enum GNUNET_CADET_ChannelOption options)
896{ 896{
897 struct CadetIncomingSession *in; 897 struct CadetIncomingSession *in;
@@ -1221,10 +1221,6 @@ run (void *cls,
1221 0}, 1221 0},
1222 { NULL, 0, 0} 1222 { NULL, 0, 0}
1223 }; 1223 };
1224 static const uint32_t ports[] = {
1225 GNUNET_APPLICATION_TYPE_SCALARPRODUCT_ECC,
1226 0
1227 };
1228 1224
1229 cfg = c; 1225 cfg = c;
1230 /* We don't really do DLOG, so we can setup with very minimal resources */ 1226 /* We don't really do DLOG, so we can setup with very minimal resources */
@@ -1241,10 +1237,8 @@ run (void *cls,
1241 cadet_sessions = GNUNET_CONTAINER_multihashmap_create (128, 1237 cadet_sessions = GNUNET_CONTAINER_multihashmap_create (128,
1242 GNUNET_YES); 1238 GNUNET_YES);
1243 my_cadet = GNUNET_CADET_connect (cfg, NULL, 1239 my_cadet = GNUNET_CADET_connect (cfg, NULL,
1244 &cb_channel_incoming,
1245 &cb_channel_destruction, 1240 &cb_channel_destruction,
1246 cadet_handlers, 1241 cadet_handlers);
1247 ports);
1248 if (NULL == my_cadet) 1242 if (NULL == my_cadet)
1249 { 1243 {
1250 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1244 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -1252,6 +1246,9 @@ run (void *cls,
1252 GNUNET_SCHEDULER_shutdown (); 1246 GNUNET_SCHEDULER_shutdown ();
1253 return; 1247 return;
1254 } 1248 }
1249 GNUNET_CADET_open_port (my_cadet,
1250 GC_u2h (GNUNET_APPLICATION_TYPE_SCALARPRODUCT_ECC),
1251 &cb_channel_incoming, NULL);
1255 GNUNET_SCHEDULER_add_shutdown (&shutdown_task, 1252 GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
1256 NULL); 1253 NULL);
1257} 1254}
diff --git a/src/scalarproduct/gnunet-service-scalarproduct_alice.c b/src/scalarproduct/gnunet-service-scalarproduct_alice.c
index 5478a85a7..8c3b1ed24 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct_alice.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct_alice.c
@@ -1081,7 +1081,7 @@ client_request_complete_alice (struct AliceServiceSession *s)
1081 = GNUNET_CADET_channel_create (my_cadet, 1081 = GNUNET_CADET_channel_create (my_cadet,
1082 s, 1082 s,
1083 &s->peer, 1083 &s->peer,
1084 GNUNET_APPLICATION_TYPE_SCALARPRODUCT, 1084 GC_u2h (GNUNET_APPLICATION_TYPE_SCALARPRODUCT),
1085 GNUNET_CADET_OPTION_RELIABLE); 1085 GNUNET_CADET_OPTION_RELIABLE);
1086 if (NULL == s->channel) 1086 if (NULL == s->channel)
1087 { 1087 {
@@ -1409,10 +1409,8 @@ run (void *cls,
1409 &handle_client_disconnect, 1409 &handle_client_disconnect,
1410 NULL); 1410 NULL);
1411 my_cadet = GNUNET_CADET_connect (cfg, NULL, 1411 my_cadet = GNUNET_CADET_connect (cfg, NULL,
1412 NULL /* no incoming supported */,
1413 &cb_channel_destruction, 1412 &cb_channel_destruction,
1414 cadet_handlers, 1413 cadet_handlers);
1415 NULL);
1416 if (NULL == my_cadet) 1414 if (NULL == my_cadet)
1417 { 1415 {
1418 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1416 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/scalarproduct/gnunet-service-scalarproduct_bob.c b/src/scalarproduct/gnunet-service-scalarproduct_bob.c
index 5be0a85d1..84c831c82 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct_bob.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct_bob.c
@@ -1187,7 +1187,7 @@ static void *
1187cb_channel_incoming (void *cls, 1187cb_channel_incoming (void *cls,
1188 struct GNUNET_CADET_Channel *channel, 1188 struct GNUNET_CADET_Channel *channel,
1189 const struct GNUNET_PeerIdentity *initiator, 1189 const struct GNUNET_PeerIdentity *initiator,
1190 uint32_t port, 1190 const struct GNUNET_HashCode *port,
1191 enum GNUNET_CADET_ChannelOption options) 1191 enum GNUNET_CADET_ChannelOption options)
1192{ 1192{
1193 struct CadetIncomingSession *in; 1193 struct CadetIncomingSession *in;
@@ -1512,10 +1512,6 @@ run (void *cls,
1512 0}, 1512 0},
1513 { NULL, 0, 0} 1513 { NULL, 0, 0}
1514 }; 1514 };
1515 static const uint32_t ports[] = {
1516 GNUNET_APPLICATION_TYPE_SCALARPRODUCT,
1517 0
1518 };
1519 1515
1520 cfg = c; 1516 cfg = c;
1521 /* 1517 /*
@@ -1538,10 +1534,8 @@ run (void *cls,
1538 cadet_sessions = GNUNET_CONTAINER_multihashmap_create (128, 1534 cadet_sessions = GNUNET_CONTAINER_multihashmap_create (128,
1539 GNUNET_YES); 1535 GNUNET_YES);
1540 my_cadet = GNUNET_CADET_connect (cfg, NULL, 1536 my_cadet = GNUNET_CADET_connect (cfg, NULL,
1541 &cb_channel_incoming,
1542 &cb_channel_destruction, 1537 &cb_channel_destruction,
1543 cadet_handlers, 1538 cadet_handlers);
1544 ports);
1545 if (NULL == my_cadet) 1539 if (NULL == my_cadet)
1546 { 1540 {
1547 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1541 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -1549,6 +1543,9 @@ run (void *cls,
1549 GNUNET_SCHEDULER_shutdown (); 1543 GNUNET_SCHEDULER_shutdown ();
1550 return; 1544 return;
1551 } 1545 }
1546 GNUNET_CADET_open_port (my_cadet,
1547 GC_u2h (GNUNET_APPLICATION_TYPE_SCALARPRODUCT),
1548 &cb_channel_incoming, NULL);
1552 GNUNET_SCHEDULER_add_shutdown (&shutdown_task, 1549 GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
1553 NULL); 1550 NULL);
1554} 1551}
diff --git a/src/set/gnunet-service-set.c b/src/set/gnunet-service-set.c
index a5baf8cfd..16f330a4d 100644
--- a/src/set/gnunet-service-set.c
+++ b/src/set/gnunet-service-set.c
@@ -1358,7 +1358,7 @@ handle_client_evaluate (void *cls,
1358 op->channel = GNUNET_CADET_channel_create (cadet, 1358 op->channel = GNUNET_CADET_channel_create (cadet,
1359 op, 1359 op,
1360 &msg->target_peer, 1360 &msg->target_peer,
1361 GNUNET_APPLICATION_TYPE_SET, 1361 GC_u2h (GNUNET_APPLICATION_TYPE_SET),
1362 GNUNET_CADET_OPTION_RELIABLE); 1362 GNUNET_CADET_OPTION_RELIABLE);
1363 op->mq = GNUNET_CADET_mq_create (op->channel); 1363 op->mq = GNUNET_CADET_mq_create (op->channel);
1364 set->vt->evaluate (op, 1364 set->vt->evaluate (op,
@@ -1796,7 +1796,7 @@ static void *
1796channel_new_cb (void *cls, 1796channel_new_cb (void *cls,
1797 struct GNUNET_CADET_Channel *channel, 1797 struct GNUNET_CADET_Channel *channel,
1798 const struct GNUNET_PeerIdentity *initiator, 1798 const struct GNUNET_PeerIdentity *initiator,
1799 uint32_t port, 1799 const struct GNUNET_HashCode *port,
1800 enum GNUNET_CADET_ChannelOption options) 1800 enum GNUNET_CADET_ChannelOption options)
1801{ 1801{
1802 static const struct SetVT incoming_vt = { 1802 static const struct SetVT incoming_vt = {
@@ -1805,7 +1805,7 @@ channel_new_cb (void *cls,
1805 }; 1805 };
1806 struct Operation *incoming; 1806 struct Operation *incoming;
1807 1807
1808 if (GNUNET_APPLICATION_TYPE_SET != port) 1808 if (0 != memcmp (GC_u2h (GNUNET_APPLICATION_TYPE_SET), port, sizeof (*port)))
1809 { 1809 {
1810 GNUNET_break (0); 1810 GNUNET_break (0);
1811 GNUNET_CADET_channel_destroy (channel); 1811 GNUNET_CADET_channel_destroy (channel);
@@ -1988,7 +1988,6 @@ run (void *cls,
1988 { &dispatch_p2p_message, GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_DONE, 0}, 1988 { &dispatch_p2p_message, GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_DONE, 0},
1989 {NULL, 0, 0} 1989 {NULL, 0, 0}
1990 }; 1990 };
1991 static const uint32_t cadet_ports[] = {GNUNET_APPLICATION_TYPE_SET, 0};
1992 1991
1993 configuration = cfg; 1992 configuration = cfg;
1994 GNUNET_SCHEDULER_add_shutdown (&shutdown_task, NULL); 1993 GNUNET_SCHEDULER_add_shutdown (&shutdown_task, NULL);
@@ -1998,10 +1997,11 @@ run (void *cls,
1998 server_handlers); 1997 server_handlers);
1999 _GSS_statistics = GNUNET_STATISTICS_create ("set", cfg); 1998 _GSS_statistics = GNUNET_STATISTICS_create ("set", cfg);
2000 cadet = GNUNET_CADET_connect (cfg, NULL, 1999 cadet = GNUNET_CADET_connect (cfg, NULL,
2001 &channel_new_cb,
2002 &channel_end_cb, 2000 &channel_end_cb,
2003 cadet_handlers, 2001 cadet_handlers);
2004 cadet_ports); 2002 GNUNET_CADET_open_port (cadet,
2003 GC_u2h (GNUNET_APPLICATION_TYPE_SET),
2004 &channel_new_cb, NULL);
2005 if (NULL == cadet) 2005 if (NULL == cadet)
2006 { 2006 {
2007 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 2007 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c
index ae7cb57cc..812016205 100644
--- a/src/vpn/gnunet-service-vpn.c
+++ b/src/vpn/gnunet-service-vpn.c
@@ -758,7 +758,7 @@ handle_regex_result (void *cls,
758 ts->channel = GNUNET_CADET_channel_create (cadet_handle, 758 ts->channel = GNUNET_CADET_channel_create (cadet_handle,
759 ts, 759 ts,
760 id, 760 id,
761 apptype, 761 GC_u2h (apptype),
762 GNUNET_CADET_OPTION_DEFAULT); 762 GNUNET_CADET_OPTION_DEFAULT);
763} 763}
764 764
@@ -801,7 +801,7 @@ create_channel_to_destination (struct DestinationChannel *dt,
801 ts->channel = GNUNET_CADET_channel_create (cadet_handle, 801 ts->channel = GNUNET_CADET_channel_create (cadet_handle,
802 ts, 802 ts,
803 &dt->destination->details.service_destination.target, 803 &dt->destination->details.service_destination.target,
804 apptype, 804 GC_u2h (apptype),
805 GNUNET_CADET_OPTION_DEFAULT); 805 GNUNET_CADET_OPTION_DEFAULT);
806 if (NULL == ts->channel) 806 if (NULL == ts->channel)
807 { 807 {
@@ -3090,10 +3090,9 @@ run (void *cls,
3090 3090
3091 cadet_handle = 3091 cadet_handle =
3092 GNUNET_CADET_connect (cfg_, NULL, 3092 GNUNET_CADET_connect (cfg_, NULL,
3093 NULL,
3094 &channel_cleaner, 3093 &channel_cleaner,
3095 cadet_handlers, 3094 cadet_handlers);
3096 NULL); 3095 // FIXME never opens ports???
3097 helper_handle = GNUNET_HELPER_start (GNUNET_NO, 3096 helper_handle = GNUNET_HELPER_start (GNUNET_NO,
3098 "gnunet-helper-vpn", vpn_argv, 3097 "gnunet-helper-vpn", vpn_argv,
3099 &message_token, NULL, NULL); 3098 &message_token, NULL, NULL);