aboutsummaryrefslogtreecommitdiff
path: root/src/set
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-05-07 12:06:50 +0000
committerBart Polot <bart@net.in.tum.de>2014-05-07 12:06:50 +0000
commitbe4c79e4cd4a8f118c5577874f0c95e253359595 (patch)
tree7fd74fb0cf6921c4e35a43f2593396bb4805f154 /src/set
parent15ccd7a167bcce0dde4331092975a6401393610f (diff)
downloadgnunet-be4c79e4cd4a8f118c5577874f0c95e253359595.tar.gz
gnunet-be4c79e4cd4a8f118c5577874f0c95e253359595.zip
Rename mesh->cadet
Diffstat (limited to 'src/set')
-rw-r--r--src/set/gnunet-service-set.c70
-rw-r--r--src/set/gnunet-service-set.h4
-rw-r--r--src/set/gnunet-service-set_intersection.c2
-rw-r--r--src/set/gnunet-service-set_union.c4
4 files changed, 40 insertions, 40 deletions
diff --git a/src/set/gnunet-service-set.c b/src/set/gnunet-service-set.c
index 940401d0a..3a3f91217 100644
--- a/src/set/gnunet-service-set.c
+++ b/src/set/gnunet-service-set.c
@@ -104,10 +104,10 @@ struct Listener
104static const struct GNUNET_CONFIGURATION_Handle *configuration; 104static const struct GNUNET_CONFIGURATION_Handle *configuration;
105 105
106/** 106/**
107 * Handle to the mesh service, used 107 * Handle to the cadet service, used
108 * to listen for and connect to remote peers. 108 * to listen for and connect to remote peers.
109 */ 109 */
110static struct GNUNET_MESH_Handle *mesh; 110static struct GNUNET_CADET_Handle *cadet;
111 111
112/** 112/**
113 * Sets are held in a doubly linked list. 113 * Sets are held in a doubly linked list.
@@ -289,7 +289,7 @@ void
289_GSS_operation_destroy (struct Operation *op) 289_GSS_operation_destroy (struct Operation *op)
290{ 290{
291 struct Set *set; 291 struct Set *set;
292 struct GNUNET_MESH_Channel *channel; 292 struct GNUNET_CADET_Channel *channel;
293 293
294 if (NULL == op->vt) 294 if (NULL == op->vt)
295 return; 295 return;
@@ -325,7 +325,7 @@ _GSS_operation_destroy (struct Operation *op)
325 if (NULL != (channel = op->channel)) 325 if (NULL != (channel = op->channel))
326 { 326 {
327 op->channel = NULL; 327 op->channel = NULL;
328 GNUNET_MESH_channel_destroy (channel); 328 GNUNET_CADET_channel_destroy (channel);
329 } 329 }
330 330
331 collect_generation_garbage (set); 331 collect_generation_garbage (set);
@@ -466,7 +466,7 @@ incoming_destroy (struct Operation *incoming)
466 } 466 }
467 if (NULL != incoming->channel) 467 if (NULL != incoming->channel)
468 { 468 {
469 GNUNET_MESH_channel_destroy (incoming->channel); 469 GNUNET_CADET_channel_destroy (incoming->channel);
470 incoming->channel = NULL; 470 incoming->channel = NULL;
471 } 471 }
472} 472}
@@ -847,7 +847,7 @@ handle_client_reject (void *cls,
847 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 847 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
848 "peer request rejected by client\n"); 848 "peer request rejected by client\n");
849 849
850 GNUNET_MESH_channel_destroy (incoming->channel); 850 GNUNET_CADET_channel_destroy (incoming->channel);
851 //channel destruction handler called immediately upon destruction 851 //channel destruction handler called immediately upon destruction
852 GNUNET_SERVER_receive_done (client, GNUNET_OK); 852 GNUNET_SERVER_receive_done (client, GNUNET_OK);
853} 853}
@@ -980,11 +980,11 @@ handle_client_evaluate (void *cls,
980 op->vt = set->vt; 980 op->vt = set->vt;
981 GNUNET_CONTAINER_DLL_insert (set->ops_head, set->ops_tail, op); 981 GNUNET_CONTAINER_DLL_insert (set->ops_head, set->ops_tail, op);
982 982
983 op->channel = GNUNET_MESH_channel_create (mesh, op, &msg->target_peer, 983 op->channel = GNUNET_CADET_channel_create (cadet, op, &msg->target_peer,
984 GNUNET_APPLICATION_TYPE_SET, 984 GNUNET_APPLICATION_TYPE_SET,
985 GNUNET_MESH_OPTION_RELIABLE); 985 GNUNET_CADET_OPTION_RELIABLE);
986 986
987 op->mq = GNUNET_MESH_mq_create (op->channel); 987 op->mq = GNUNET_CADET_mq_create (op->channel);
988 988
989 set->vt->evaluate (op); 989 set->vt->evaluate (op);
990 GNUNET_SERVER_receive_done (client, GNUNET_OK); 990 GNUNET_SERVER_receive_done (client, GNUNET_OK);
@@ -1173,12 +1173,12 @@ shutdown_task (void *cls,
1173 while (NULL != sets_head) 1173 while (NULL != sets_head)
1174 set_destroy (sets_head); 1174 set_destroy (sets_head);
1175 1175
1176 /* it's important to destroy mesh at the end, as all channels 1176 /* it's important to destroy cadet at the end, as all channels
1177 * must be destroyed before the mesh handle! */ 1177 * must be destroyed before the cadet handle! */
1178 if (NULL != mesh) 1178 if (NULL != cadet)
1179 { 1179 {
1180 GNUNET_MESH_disconnect (mesh); 1180 GNUNET_CADET_disconnect (cadet);
1181 mesh = NULL; 1181 cadet = NULL;
1182 } 1182 }
1183 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1183 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1184 "handled shutdown request\n"); 1184 "handled shutdown request\n");
@@ -1233,7 +1233,7 @@ handle_incoming_disconnect (struct Operation *op)
1233 * Method called whenever another peer has added us to a channel 1233 * Method called whenever another peer has added us to a channel
1234 * the other peer initiated. 1234 * the other peer initiated.
1235 * Only called (once) upon reception of data with a message type which was 1235 * Only called (once) upon reception of data with a message type which was
1236 * subscribed to in GNUNET_MESH_connect(). 1236 * subscribed to in GNUNET_CADET_connect().
1237 * 1237 *
1238 * The channel context represents the operation itself and gets added to a DLL, 1238 * The channel context represents the operation itself and gets added to a DLL,
1239 * from where it gets looked up when our local listener client responds 1239 * from where it gets looked up when our local listener client responds
@@ -1249,9 +1249,9 @@ handle_incoming_disconnect (struct Operation *op)
1249 */ 1249 */
1250static void * 1250static void *
1251channel_new_cb (void *cls, 1251channel_new_cb (void *cls,
1252 struct GNUNET_MESH_Channel *channel, 1252 struct GNUNET_CADET_Channel *channel,
1253 const struct GNUNET_PeerIdentity *initiator, 1253 const struct GNUNET_PeerIdentity *initiator,
1254 uint32_t port, enum GNUNET_MESH_ChannelOption options) 1254 uint32_t port, enum GNUNET_CADET_ChannelOption options)
1255{ 1255{
1256 struct Operation *incoming; 1256 struct Operation *incoming;
1257 static const struct SetVT incoming_vt = { 1257 static const struct SetVT incoming_vt = {
@@ -1265,7 +1265,7 @@ channel_new_cb (void *cls,
1265 if (GNUNET_APPLICATION_TYPE_SET != port) 1265 if (GNUNET_APPLICATION_TYPE_SET != port)
1266 { 1266 {
1267 GNUNET_break (0); 1267 GNUNET_break (0);
1268 GNUNET_MESH_channel_destroy (channel); 1268 GNUNET_CADET_channel_destroy (channel);
1269 return NULL; 1269 return NULL;
1270 } 1270 }
1271 1271
@@ -1274,7 +1274,7 @@ channel_new_cb (void *cls,
1274 incoming->state = GNUNET_new (struct OperationState); 1274 incoming->state = GNUNET_new (struct OperationState);
1275 incoming->state->peer = *initiator; 1275 incoming->state->peer = *initiator;
1276 incoming->channel = channel; 1276 incoming->channel = channel;
1277 incoming->mq = GNUNET_MESH_mq_create (incoming->channel); 1277 incoming->mq = GNUNET_CADET_mq_create (incoming->channel);
1278 incoming->vt = &incoming_vt; 1278 incoming->vt = &incoming_vt;
1279 incoming->state->timeout_task = 1279 incoming->state->timeout_task =
1280 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, 1280 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
@@ -1288,7 +1288,7 @@ channel_new_cb (void *cls,
1288/** 1288/**
1289 * Function called whenever a channel is destroyed. Should clean up 1289 * Function called whenever a channel is destroyed. Should clean up
1290 * any associated state. It must NOT call 1290 * any associated state. It must NOT call
1291 * GNUNET_MESH_channel_destroy() on the channel. 1291 * GNUNET_CADET_channel_destroy() on the channel.
1292 * 1292 *
1293 * The peer_disconnect function is part of a a virtual table set initially either 1293 * The peer_disconnect function is part of a a virtual table set initially either
1294 * when a peer creates a new channel with us (channel_new_cb), or once we create 1294 * when a peer creates a new channel with us (channel_new_cb), or once we create
@@ -1297,14 +1297,14 @@ channel_new_cb (void *cls,
1297 * Once we know the exact type of operation (union/intersection), the vt is 1297 * Once we know the exact type of operation (union/intersection), the vt is
1298 * replaced with an operation specific instance (_GSS_[op]_vt). 1298 * replaced with an operation specific instance (_GSS_[op]_vt).
1299 * 1299 *
1300 * @param cls closure (set from GNUNET_MESH_connect()) 1300 * @param cls closure (set from GNUNET_CADET_connect())
1301 * @param channel connection to the other end (henceforth invalid) 1301 * @param channel connection to the other end (henceforth invalid)
1302 * @param channel_ctx place where local state associated 1302 * @param channel_ctx place where local state associated
1303 * with the channel is stored 1303 * with the channel is stored
1304 */ 1304 */
1305static void 1305static void
1306channel_end_cb (void *cls, 1306channel_end_cb (void *cls,
1307 const struct GNUNET_MESH_Channel *channel, void *channel_ctx) 1307 const struct GNUNET_CADET_Channel *channel, void *channel_ctx)
1308{ 1308{
1309 struct Operation *op = channel_ctx; 1309 struct Operation *op = channel_ctx;
1310 1310
@@ -1322,7 +1322,7 @@ channel_end_cb (void *cls,
1322 if (GNUNET_YES == op->keep) 1322 if (GNUNET_YES == op->keep)
1323 return; 1323 return;
1324 1324
1325 /* mesh will never call us with the context again! */ 1325 /* cadet will never call us with the context again! */
1326 GNUNET_free (channel_ctx); 1326 GNUNET_free (channel_ctx);
1327 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1327 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1328 "channel end cb finished\n"); 1328 "channel end cb finished\n");
@@ -1331,7 +1331,7 @@ channel_end_cb (void *cls,
1331 1331
1332/** 1332/**
1333 * Functions with this signature are called whenever a message is 1333 * Functions with this signature are called whenever a message is
1334 * received via a mesh channel. 1334 * received via a cadet channel.
1335 * 1335 *
1336 * The msg_handler is a virtual table set in initially either when a peer 1336 * The msg_handler is a virtual table set in initially either when a peer
1337 * creates a new channel with us (channel_new_cb), or once we create a new channel 1337 * creates a new channel with us (channel_new_cb), or once we create a new channel
@@ -1340,7 +1340,7 @@ channel_end_cb (void *cls,
1340 * Once we know the exact type of operation (union/intersection), the vt is 1340 * Once we know the exact type of operation (union/intersection), the vt is
1341 * replaced with an operation specific instance (_GSS_[op]_vt). 1341 * replaced with an operation specific instance (_GSS_[op]_vt).
1342 * 1342 *
1343 * @param cls Closure (set from GNUNET_MESH_connect()). 1343 * @param cls Closure (set from GNUNET_CADET_connect()).
1344 * @param channel Connection to the other end. 1344 * @param channel Connection to the other end.
1345 * @param channel_ctx Place to store local state associated with the channel. 1345 * @param channel_ctx Place to store local state associated with the channel.
1346 * @param message The actual message. 1346 * @param message The actual message.
@@ -1349,7 +1349,7 @@ channel_end_cb (void *cls,
1349 */ 1349 */
1350static int 1350static int
1351dispatch_p2p_message (void *cls, 1351dispatch_p2p_message (void *cls,
1352 struct GNUNET_MESH_Channel *channel, 1352 struct GNUNET_CADET_Channel *channel,
1353 void **channel_ctx, 1353 void **channel_ctx,
1354 const struct GNUNET_MessageHeader *message) 1354 const struct GNUNET_MessageHeader *message)
1355{ 1355{
@@ -1357,16 +1357,16 @@ dispatch_p2p_message (void *cls,
1357 int ret; 1357 int ret;
1358 1358
1359 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1359 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1360 "dispatching mesh message (type: %u)\n", 1360 "dispatching cadet message (type: %u)\n",
1361 ntohs (message->type)); 1361 ntohs (message->type));
1362 /* do this before the handler, as the handler might kill the channel */ 1362 /* do this before the handler, as the handler might kill the channel */
1363 GNUNET_MESH_receive_done (channel); 1363 GNUNET_CADET_receive_done (channel);
1364 if (NULL != op->vt) 1364 if (NULL != op->vt)
1365 ret = op->vt->msg_handler (op, message); 1365 ret = op->vt->msg_handler (op, message);
1366 else 1366 else
1367 ret = GNUNET_SYSERR; 1367 ret = GNUNET_SYSERR;
1368 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1368 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1369 "handled mesh message (type: %u)\n", 1369 "handled cadet message (type: %u)\n",
1370 ntohs (message->type)); 1370 ntohs (message->type));
1371 return ret; 1371 return ret;
1372} 1372}
@@ -1403,7 +1403,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
1403 sizeof (struct GNUNET_SET_CancelMessage)}, 1403 sizeof (struct GNUNET_SET_CancelMessage)},
1404 {NULL, NULL, 0, 0} 1404 {NULL, NULL, 0, 0}
1405 }; 1405 };
1406 static const struct GNUNET_MESH_MessageHandler mesh_handlers[] = { 1406 static const struct GNUNET_CADET_MessageHandler cadet_handlers[] = {
1407 {dispatch_p2p_message, GNUNET_MESSAGE_TYPE_SET_P2P_OPERATION_REQUEST, 0}, 1407 {dispatch_p2p_message, GNUNET_MESSAGE_TYPE_SET_P2P_OPERATION_REQUEST, 0},
1408 {dispatch_p2p_message, GNUNET_MESSAGE_TYPE_SET_UNION_P2P_IBF, 0}, 1408 {dispatch_p2p_message, GNUNET_MESSAGE_TYPE_SET_UNION_P2P_IBF, 0},
1409 {dispatch_p2p_message, GNUNET_MESSAGE_TYPE_SET_P2P_ELEMENTS, 0}, 1409 {dispatch_p2p_message, GNUNET_MESSAGE_TYPE_SET_P2P_ELEMENTS, 0},
@@ -1415,7 +1415,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
1415 {dispatch_p2p_message, GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_BF_PART, 0}, 1415 {dispatch_p2p_message, GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_BF_PART, 0},
1416 {NULL, 0, 0} 1416 {NULL, 0, 0}
1417 }; 1417 };
1418 static const uint32_t mesh_ports[] = {GNUNET_APPLICATION_TYPE_SET, 0}; 1418 static const uint32_t cadet_ports[] = {GNUNET_APPLICATION_TYPE_SET, 0};
1419 1419
1420 configuration = cfg; 1420 configuration = cfg;
1421 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, 1421 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
@@ -1423,12 +1423,12 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
1423 GNUNET_SERVER_disconnect_notify (server, &handle_client_disconnect, NULL); 1423 GNUNET_SERVER_disconnect_notify (server, &handle_client_disconnect, NULL);
1424 GNUNET_SERVER_add_handlers (server, server_handlers); 1424 GNUNET_SERVER_add_handlers (server, server_handlers);
1425 1425
1426 mesh = GNUNET_MESH_connect (cfg, NULL, channel_new_cb, channel_end_cb, 1426 cadet = GNUNET_CADET_connect (cfg, NULL, channel_new_cb, channel_end_cb,
1427 mesh_handlers, mesh_ports); 1427 cadet_handlers, cadet_ports);
1428 if (NULL == mesh) 1428 if (NULL == cadet)
1429 { 1429 {
1430 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1430 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1431 _("Could not connect to mesh service\n")); 1431 _("Could not connect to cadet service\n"));
1432 return; 1432 return;
1433 } 1433 }
1434} 1434}
diff --git a/src/set/gnunet-service-set.h b/src/set/gnunet-service-set.h
index 95a24119b..d8450e242 100644
--- a/src/set/gnunet-service-set.h
+++ b/src/set/gnunet-service-set.h
@@ -32,7 +32,7 @@
32#include "gnunet_protocols.h" 32#include "gnunet_protocols.h"
33#include "gnunet_applications.h" 33#include "gnunet_applications.h"
34#include "gnunet_core_service.h" 34#include "gnunet_core_service.h"
35#include "gnunet_mesh_service.h" 35#include "gnunet_cadet_service.h"
36#include "gnunet_set_service.h" 36#include "gnunet_set_service.h"
37#include "set.h" 37#include "set.h"
38 38
@@ -301,7 +301,7 @@ struct Operation
301 /** 301 /**
302 * Tunnel to the peer. 302 * Tunnel to the peer.
303 */ 303 */
304 struct GNUNET_MESH_Channel *channel; 304 struct GNUNET_CADET_Channel *channel;
305 305
306 /** 306 /**
307 * Message queue for the tunnel. 307 * Message queue for the tunnel.
diff --git a/src/set/gnunet-service-set_intersection.c b/src/set/gnunet-service-set_intersection.c
index 5c4bc9dd5..680f91db0 100644
--- a/src/set/gnunet-service-set_intersection.c
+++ b/src/set/gnunet-service-set_intersection.c
@@ -982,7 +982,7 @@ intersection_handle_p2p_message (struct Operation *op,
982 handle_p2p_done (op, mh); 982 handle_p2p_done (op, mh);
983 break; 983 break;
984 default: 984 default:
985 /* something wrong with mesh's message handlers? */ 985 /* something wrong with cadet's message handlers? */
986 GNUNET_assert (0); 986 GNUNET_assert (0);
987 } 987 }
988 return GNUNET_OK; 988 return GNUNET_OK;
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c
index 6bb28471a..f7f94cb21 100644
--- a/src/set/gnunet-service-set_union.c
+++ b/src/set/gnunet-service-set_union.c
@@ -854,7 +854,7 @@ decode_and_send (struct Operation *op)
854 struct GNUNET_MQ_Envelope *ev; 854 struct GNUNET_MQ_Envelope *ev;
855 struct GNUNET_MessageHeader *msg; 855 struct GNUNET_MessageHeader *msg;
856 856
857 /* It may be nice to merge multiple requests, but with mesh's corking it is not worth 857 /* It may be nice to merge multiple requests, but with cadet's corking it is not worth
858 * the effort additional complexity. */ 858 * the effort additional complexity. */
859 ev = GNUNET_MQ_msg_header_extra (msg, sizeof (struct IBF_Key), 859 ev = GNUNET_MQ_msg_header_extra (msg, sizeof (struct IBF_Key),
860 GNUNET_MESSAGE_TYPE_SET_P2P_ELEMENT_REQUESTS); 860 GNUNET_MESSAGE_TYPE_SET_P2P_ELEMENT_REQUESTS);
@@ -1327,7 +1327,7 @@ union_handle_p2p_message (struct Operation *op,
1327 handle_p2p_done (op, mh); 1327 handle_p2p_done (op, mh);
1328 break; 1328 break;
1329 default: 1329 default:
1330 /* something wrong with mesh's message handlers? */ 1330 /* something wrong with cadet's message handlers? */
1331 GNUNET_assert (0); 1331 GNUNET_assert (0);
1332 } 1332 }
1333 return GNUNET_OK; 1333 return GNUNET_OK;