diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-05-07 12:06:50 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-05-07 12:06:50 +0000 |
commit | be4c79e4cd4a8f118c5577874f0c95e253359595 (patch) | |
tree | 7fd74fb0cf6921c4e35a43f2593396bb4805f154 /src/conversation | |
parent | 15ccd7a167bcce0dde4331092975a6401393610f (diff) | |
download | gnunet-be4c79e4cd4a8f118c5577874f0c95e253359595.tar.gz gnunet-be4c79e4cd4a8f118c5577874f0c95e253359595.zip |
Rename mesh->cadet
Diffstat (limited to 'src/conversation')
-rw-r--r-- | src/conversation/conversation.h | 36 | ||||
-rw-r--r-- | src/conversation/conversation_api_call.c | 2 | ||||
-rw-r--r-- | src/conversation/gnunet-service-conversation.c | 252 |
3 files changed, 145 insertions, 145 deletions
diff --git a/src/conversation/conversation.h b/src/conversation/conversation.h index bc78400f1..284d5dc67 100644 --- a/src/conversation/conversation.h +++ b/src/conversation/conversation.h | |||
@@ -235,12 +235,12 @@ struct ClientPhonePickedupMessage | |||
235 | 235 | ||
236 | 236 | ||
237 | /** | 237 | /** |
238 | * Mesh message for phone is ringing. | 238 | * Cadet message for phone is ringing. |
239 | */ | 239 | */ |
240 | struct MeshPhoneRingMessage | 240 | struct CadetPhoneRingMessage |
241 | { | 241 | { |
242 | /** | 242 | /** |
243 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_RING | 243 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING |
244 | */ | 244 | */ |
245 | struct GNUNET_MessageHeader header; | 245 | struct GNUNET_MessageHeader header; |
246 | 246 | ||
@@ -288,12 +288,12 @@ struct MeshPhoneRingMessage | |||
288 | 288 | ||
289 | 289 | ||
290 | /** | 290 | /** |
291 | * Mesh message for hanging up. | 291 | * Cadet message for hanging up. |
292 | */ | 292 | */ |
293 | struct MeshPhoneHangupMessage | 293 | struct CadetPhoneHangupMessage |
294 | { | 294 | { |
295 | /** | 295 | /** |
296 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_HANG_UP | 296 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP |
297 | */ | 297 | */ |
298 | struct GNUNET_MessageHeader header; | 298 | struct GNUNET_MessageHeader header; |
299 | 299 | ||
@@ -301,12 +301,12 @@ struct MeshPhoneHangupMessage | |||
301 | 301 | ||
302 | 302 | ||
303 | /** | 303 | /** |
304 | * Mesh message for picking up. | 304 | * Cadet message for picking up. |
305 | */ | 305 | */ |
306 | struct MeshPhonePickupMessage | 306 | struct CadetPhonePickupMessage |
307 | { | 307 | { |
308 | /** | 308 | /** |
309 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_PICK_UP | 309 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP |
310 | */ | 310 | */ |
311 | struct GNUNET_MessageHeader header; | 311 | struct GNUNET_MessageHeader header; |
312 | 312 | ||
@@ -314,12 +314,12 @@ struct MeshPhonePickupMessage | |||
314 | 314 | ||
315 | 315 | ||
316 | /** | 316 | /** |
317 | * Mesh message for phone suspended. | 317 | * Cadet message for phone suspended. |
318 | */ | 318 | */ |
319 | struct MeshPhoneSuspendMessage | 319 | struct CadetPhoneSuspendMessage |
320 | { | 320 | { |
321 | /** | 321 | /** |
322 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_SUSPEND | 322 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND |
323 | */ | 323 | */ |
324 | struct GNUNET_MessageHeader header; | 324 | struct GNUNET_MessageHeader header; |
325 | 325 | ||
@@ -327,12 +327,12 @@ struct MeshPhoneSuspendMessage | |||
327 | 327 | ||
328 | 328 | ||
329 | /** | 329 | /** |
330 | * Mesh message for phone resumed. | 330 | * Cadet message for phone resumed. |
331 | */ | 331 | */ |
332 | struct MeshPhoneResumeMessage | 332 | struct CadetPhoneResumeMessage |
333 | { | 333 | { |
334 | /** | 334 | /** |
335 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_RESUME | 335 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME |
336 | */ | 336 | */ |
337 | struct GNUNET_MessageHeader header; | 337 | struct GNUNET_MessageHeader header; |
338 | 338 | ||
@@ -340,12 +340,12 @@ struct MeshPhoneResumeMessage | |||
340 | 340 | ||
341 | 341 | ||
342 | /** | 342 | /** |
343 | * Mesh message to transmit the audio. | 343 | * Cadet message to transmit the audio. |
344 | */ | 344 | */ |
345 | struct MeshAudioMessage | 345 | struct CadetAudioMessage |
346 | { | 346 | { |
347 | /** | 347 | /** |
348 | * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_AUDIO | 348 | * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO |
349 | */ | 349 | */ |
350 | struct GNUNET_MessageHeader header; | 350 | struct GNUNET_MessageHeader header; |
351 | 351 | ||
diff --git a/src/conversation/conversation_api_call.c b/src/conversation/conversation_api_call.c index 379947087..f69a6518c 100644 --- a/src/conversation/conversation_api_call.c +++ b/src/conversation/conversation_api_call.c | |||
@@ -384,7 +384,7 @@ handle_call_audio_message (void *cls, | |||
384 | break; | 384 | break; |
385 | case CS_SUSPENDED_CALLEE: | 385 | case CS_SUSPENDED_CALLEE: |
386 | case CS_SUSPENDED_BOTH: | 386 | case CS_SUSPENDED_BOTH: |
387 | /* can (rarely) also happen: other peer suspended, but mesh might | 387 | /* can (rarely) also happen: other peer suspended, but cadet might |
388 | have had delayed data on the unreliable channel */ | 388 | have had delayed data on the unreliable channel */ |
389 | break; | 389 | break; |
390 | case CS_ACTIVE: | 390 | case CS_ACTIVE: |
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c index 0fc19c510..a354c9d01 100644 --- a/src/conversation/gnunet-service-conversation.c +++ b/src/conversation/gnunet-service-conversation.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include "gnunet_applications.h" | 30 | #include "gnunet_applications.h" |
31 | #include "gnunet_constants.h" | 31 | #include "gnunet_constants.h" |
32 | #include "gnunet_signatures.h" | 32 | #include "gnunet_signatures.h" |
33 | #include "gnunet_mesh_service.h" | 33 | #include "gnunet_cadet_service.h" |
34 | #include "gnunet_conversation_service.h" | 34 | #include "gnunet_conversation_service.h" |
35 | #include "conversation.h" | 35 | #include "conversation.h" |
36 | 36 | ||
@@ -44,8 +44,8 @@ | |||
44 | 44 | ||
45 | 45 | ||
46 | /** | 46 | /** |
47 | * A line connects a local client with a mesh channel (or, if it is an | 47 | * A line connects a local client with a cadet channel (or, if it is an |
48 | * open line, is waiting for a mesh channel). | 48 | * open line, is waiting for a cadet channel). |
49 | */ | 49 | */ |
50 | struct Line; | 50 | struct Line; |
51 | 51 | ||
@@ -88,7 +88,7 @@ enum ChannelStatus | |||
88 | 88 | ||
89 | 89 | ||
90 | /** | 90 | /** |
91 | * A `struct Channel` represents a mesh channel, which is a P2P | 91 | * A `struct Channel` represents a cadet channel, which is a P2P |
92 | * connection to another conversation service. Multiple channels can | 92 | * connection to another conversation service. Multiple channels can |
93 | * be attached the the same `struct Line`, which represents a local | 93 | * be attached the the same `struct Line`, which represents a local |
94 | * client. We keep them in a linked list. | 94 | * client. We keep them in a linked list. |
@@ -114,17 +114,17 @@ struct Channel | |||
114 | /** | 114 | /** |
115 | * Handle for the reliable channel (contol data) | 115 | * Handle for the reliable channel (contol data) |
116 | */ | 116 | */ |
117 | struct GNUNET_MESH_Channel *channel_reliable; | 117 | struct GNUNET_CADET_Channel *channel_reliable; |
118 | 118 | ||
119 | /** | 119 | /** |
120 | * Handle for unreliable channel (audio data) | 120 | * Handle for unreliable channel (audio data) |
121 | */ | 121 | */ |
122 | struct GNUNET_MESH_Channel *channel_unreliable; | 122 | struct GNUNET_CADET_Channel *channel_unreliable; |
123 | 123 | ||
124 | /** | 124 | /** |
125 | * Transmit handle for pending audio messages | 125 | * Transmit handle for pending audio messages |
126 | */ | 126 | */ |
127 | struct GNUNET_MESH_TransmitHandle *unreliable_mth; | 127 | struct GNUNET_CADET_TransmitHandle *unreliable_mth; |
128 | 128 | ||
129 | /** | 129 | /** |
130 | * Message queue for control messages | 130 | * Message queue for control messages |
@@ -175,7 +175,7 @@ struct Channel | |||
175 | 175 | ||
176 | 176 | ||
177 | /** | 177 | /** |
178 | * A `struct Line` connects a local client with mesh channels. | 178 | * A `struct Line` connects a local client with cadet channels. |
179 | */ | 179 | */ |
180 | struct Line | 180 | struct Line |
181 | { | 181 | { |
@@ -228,9 +228,9 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg; | |||
228 | static struct GNUNET_SERVER_NotificationContext *nc; | 228 | static struct GNUNET_SERVER_NotificationContext *nc; |
229 | 229 | ||
230 | /** | 230 | /** |
231 | * Handle for mesh | 231 | * Handle for cadet |
232 | */ | 232 | */ |
233 | static struct GNUNET_MESH_Handle *mesh; | 233 | static struct GNUNET_CADET_Handle *cadet; |
234 | 234 | ||
235 | /** | 235 | /** |
236 | * Identity of this peer. | 236 | * Identity of this peer. |
@@ -304,7 +304,7 @@ handle_client_pickup_message (void *cls, | |||
304 | { | 304 | { |
305 | const struct ClientPhonePickupMessage *msg; | 305 | const struct ClientPhonePickupMessage *msg; |
306 | struct GNUNET_MQ_Envelope *e; | 306 | struct GNUNET_MQ_Envelope *e; |
307 | struct MeshPhonePickupMessage *mppm; | 307 | struct CadetPhonePickupMessage *mppm; |
308 | struct Line *line; | 308 | struct Line *line; |
309 | struct Channel *ch; | 309 | struct Channel *ch; |
310 | 310 | ||
@@ -350,9 +350,9 @@ handle_client_pickup_message (void *cls, | |||
350 | } | 350 | } |
351 | GNUNET_break (CS_CALLEE_CONNECTED == ch->status); | 351 | GNUNET_break (CS_CALLEE_CONNECTED == ch->status); |
352 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 352 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
353 | "Sending PICK_UP message to mesh\n"); | 353 | "Sending PICK_UP message to cadet\n"); |
354 | e = GNUNET_MQ_msg (mppm, | 354 | e = GNUNET_MQ_msg (mppm, |
355 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_PICK_UP); | 355 | GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP); |
356 | GNUNET_MQ_send (ch->reliable_mq, e); | 356 | GNUNET_MQ_send (ch->reliable_mq, e); |
357 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 357 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
358 | } | 358 | } |
@@ -364,13 +364,13 @@ handle_client_pickup_message (void *cls, | |||
364 | * @param ch channel to destroy. | 364 | * @param ch channel to destroy. |
365 | */ | 365 | */ |
366 | static void | 366 | static void |
367 | destroy_line_mesh_channels (struct Channel *ch) | 367 | destroy_line_cadet_channels (struct Channel *ch) |
368 | { | 368 | { |
369 | struct Line *line = ch->line; | 369 | struct Line *line = ch->line; |
370 | struct GNUNET_MESH_Channel *t; | 370 | struct GNUNET_CADET_Channel *t; |
371 | 371 | ||
372 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 372 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
373 | "Destroying mesh channels\n"); | 373 | "Destroying cadet channels\n"); |
374 | if (NULL != ch->reliable_mq) | 374 | if (NULL != ch->reliable_mq) |
375 | { | 375 | { |
376 | GNUNET_MQ_destroy (ch->reliable_mq); | 376 | GNUNET_MQ_destroy (ch->reliable_mq); |
@@ -378,18 +378,18 @@ destroy_line_mesh_channels (struct Channel *ch) | |||
378 | } | 378 | } |
379 | if (NULL != ch->unreliable_mth) | 379 | if (NULL != ch->unreliable_mth) |
380 | { | 380 | { |
381 | GNUNET_MESH_notify_transmit_ready_cancel (ch->unreliable_mth); | 381 | GNUNET_CADET_notify_transmit_ready_cancel (ch->unreliable_mth); |
382 | ch->unreliable_mth = NULL; | 382 | ch->unreliable_mth = NULL; |
383 | } | 383 | } |
384 | if (NULL != (t = ch->channel_unreliable)) | 384 | if (NULL != (t = ch->channel_unreliable)) |
385 | { | 385 | { |
386 | ch->channel_unreliable = NULL; | 386 | ch->channel_unreliable = NULL; |
387 | GNUNET_MESH_channel_destroy (t); | 387 | GNUNET_CADET_channel_destroy (t); |
388 | } | 388 | } |
389 | if (NULL != (t = ch->channel_reliable)) | 389 | if (NULL != (t = ch->channel_reliable)) |
390 | { | 390 | { |
391 | ch->channel_reliable = NULL; | 391 | ch->channel_reliable = NULL; |
392 | GNUNET_MESH_channel_destroy (t); | 392 | GNUNET_CADET_channel_destroy (t); |
393 | } | 393 | } |
394 | GNUNET_CONTAINER_DLL_remove (line->channel_head, | 394 | GNUNET_CONTAINER_DLL_remove (line->channel_head, |
395 | line->channel_tail, | 395 | line->channel_tail, |
@@ -419,7 +419,7 @@ mq_done_finish_caller_shutdown (void *cls) | |||
419 | GNUNET_break (0); | 419 | GNUNET_break (0); |
420 | break; | 420 | break; |
421 | case CS_CALLEE_SHUTDOWN: | 421 | case CS_CALLEE_SHUTDOWN: |
422 | destroy_line_mesh_channels (ch); | 422 | destroy_line_cadet_channels (ch); |
423 | break; | 423 | break; |
424 | case CS_CALLER_CALLING: | 424 | case CS_CALLER_CALLING: |
425 | GNUNET_break (0); | 425 | GNUNET_break (0); |
@@ -428,7 +428,7 @@ mq_done_finish_caller_shutdown (void *cls) | |||
428 | GNUNET_break (0); | 428 | GNUNET_break (0); |
429 | break; | 429 | break; |
430 | case CS_CALLER_SHUTDOWN: | 430 | case CS_CALLER_SHUTDOWN: |
431 | destroy_line_mesh_channels (ch); | 431 | destroy_line_cadet_channels (ch); |
432 | break; | 432 | break; |
433 | } | 433 | } |
434 | } | 434 | } |
@@ -448,7 +448,7 @@ handle_client_hangup_message (void *cls, | |||
448 | { | 448 | { |
449 | const struct ClientPhoneHangupMessage *msg; | 449 | const struct ClientPhoneHangupMessage *msg; |
450 | struct GNUNET_MQ_Envelope *e; | 450 | struct GNUNET_MQ_Envelope *e; |
451 | struct MeshPhoneHangupMessage *mhum; | 451 | struct CadetPhoneHangupMessage *mhum; |
452 | struct Line *line; | 452 | struct Line *line; |
453 | struct Channel *ch; | 453 | struct Channel *ch; |
454 | 454 | ||
@@ -497,9 +497,9 @@ handle_client_hangup_message (void *cls, | |||
497 | return; | 497 | return; |
498 | } | 498 | } |
499 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 499 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
500 | "Sending HANG_UP message via mesh\n"); | 500 | "Sending HANG_UP message via cadet\n"); |
501 | e = GNUNET_MQ_msg (mhum, | 501 | e = GNUNET_MQ_msg (mhum, |
502 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_HANG_UP); | 502 | GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP); |
503 | GNUNET_MQ_notify_sent (e, | 503 | GNUNET_MQ_notify_sent (e, |
504 | &mq_done_finish_caller_shutdown, | 504 | &mq_done_finish_caller_shutdown, |
505 | ch); | 505 | ch); |
@@ -522,7 +522,7 @@ handle_client_suspend_message (void *cls, | |||
522 | { | 522 | { |
523 | const struct ClientPhoneSuspendMessage *msg; | 523 | const struct ClientPhoneSuspendMessage *msg; |
524 | struct GNUNET_MQ_Envelope *e; | 524 | struct GNUNET_MQ_Envelope *e; |
525 | struct MeshPhoneSuspendMessage *mhum; | 525 | struct CadetPhoneSuspendMessage *mhum; |
526 | struct Line *line; | 526 | struct Line *line; |
527 | struct Channel *ch; | 527 | struct Channel *ch; |
528 | 528 | ||
@@ -578,9 +578,9 @@ handle_client_suspend_message (void *cls, | |||
578 | return; | 578 | return; |
579 | } | 579 | } |
580 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 580 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
581 | "Sending SUSPEND message via mesh\n"); | 581 | "Sending SUSPEND message via cadet\n"); |
582 | e = GNUNET_MQ_msg (mhum, | 582 | e = GNUNET_MQ_msg (mhum, |
583 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_SUSPEND); | 583 | GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND); |
584 | GNUNET_MQ_send (ch->reliable_mq, e); | 584 | GNUNET_MQ_send (ch->reliable_mq, e); |
585 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 585 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
586 | } | 586 | } |
@@ -600,7 +600,7 @@ handle_client_resume_message (void *cls, | |||
600 | { | 600 | { |
601 | const struct ClientPhoneResumeMessage *msg; | 601 | const struct ClientPhoneResumeMessage *msg; |
602 | struct GNUNET_MQ_Envelope *e; | 602 | struct GNUNET_MQ_Envelope *e; |
603 | struct MeshPhoneResumeMessage *mhum; | 603 | struct CadetPhoneResumeMessage *mhum; |
604 | struct Line *line; | 604 | struct Line *line; |
605 | struct Channel *ch; | 605 | struct Channel *ch; |
606 | 606 | ||
@@ -656,9 +656,9 @@ handle_client_resume_message (void *cls, | |||
656 | return; | 656 | return; |
657 | } | 657 | } |
658 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 658 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
659 | "Sending RESUME message via mesh\n"); | 659 | "Sending RESUME message via cadet\n"); |
660 | e = GNUNET_MQ_msg (mhum, | 660 | e = GNUNET_MQ_msg (mhum, |
661 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_RESUME); | 661 | GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME); |
662 | GNUNET_MQ_send (ch->reliable_mq, e); | 662 | GNUNET_MQ_send (ch->reliable_mq, e); |
663 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 663 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
664 | } | 664 | } |
@@ -680,7 +680,7 @@ handle_client_call_message (void *cls, | |||
680 | struct Line *line; | 680 | struct Line *line; |
681 | struct Channel *ch; | 681 | struct Channel *ch; |
682 | struct GNUNET_MQ_Envelope *e; | 682 | struct GNUNET_MQ_Envelope *e; |
683 | struct MeshPhoneRingMessage *ring; | 683 | struct CadetPhoneRingMessage *ring; |
684 | 684 | ||
685 | msg = (const struct ClientCallMessage *) message; | 685 | msg = (const struct ClientCallMessage *) message; |
686 | line = GNUNET_SERVER_client_get_user_context (client, struct Line); | 686 | line = GNUNET_SERVER_client_get_user_context (client, struct Line); |
@@ -706,13 +706,13 @@ handle_client_call_message (void *cls, | |||
706 | ch->target = msg->target; | 706 | ch->target = msg->target; |
707 | ch->remote_line = ntohl (msg->line); | 707 | ch->remote_line = ntohl (msg->line); |
708 | ch->status = CS_CALLER_CALLING; | 708 | ch->status = CS_CALLER_CALLING; |
709 | ch->channel_reliable = GNUNET_MESH_channel_create (mesh, | 709 | ch->channel_reliable = GNUNET_CADET_channel_create (cadet, |
710 | ch, | 710 | ch, |
711 | &msg->target, | 711 | &msg->target, |
712 | GNUNET_APPLICATION_TYPE_CONVERSATION_CONTROL, | 712 | GNUNET_APPLICATION_TYPE_CONVERSATION_CONTROL, |
713 | GNUNET_MESH_OPTION_RELIABLE); | 713 | GNUNET_CADET_OPTION_RELIABLE); |
714 | ch->reliable_mq = GNUNET_MESH_mq_create (ch->channel_reliable); | 714 | ch->reliable_mq = GNUNET_CADET_mq_create (ch->channel_reliable); |
715 | e = GNUNET_MQ_msg (ring, GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_RING); | 715 | e = GNUNET_MQ_msg (ring, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING); |
716 | ring->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING); | 716 | ring->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING); |
717 | ring->purpose.size = htonl (sizeof (struct GNUNET_PeerIdentity) * 2 + | 717 | ring->purpose.size = htonl (sizeof (struct GNUNET_PeerIdentity) * 2 + |
718 | sizeof (struct GNUNET_TIME_AbsoluteNBO) + | 718 | sizeof (struct GNUNET_TIME_AbsoluteNBO) + |
@@ -729,14 +729,14 @@ handle_client_call_message (void *cls, | |||
729 | &ring->purpose, | 729 | &ring->purpose, |
730 | &ring->signature); | 730 | &ring->signature); |
731 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 731 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
732 | "Sending RING message via mesh\n"); | 732 | "Sending RING message via cadet\n"); |
733 | GNUNET_MQ_send (ch->reliable_mq, e); | 733 | GNUNET_MQ_send (ch->reliable_mq, e); |
734 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 734 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
735 | } | 735 | } |
736 | 736 | ||
737 | 737 | ||
738 | /** | 738 | /** |
739 | * Transmit audio data via unreliable mesh channel. | 739 | * Transmit audio data via unreliable cadet channel. |
740 | * | 740 | * |
741 | * @param cls the `struct Channel` we are transmitting for | 741 | * @param cls the `struct Channel` we are transmitting for |
742 | * @param size number of bytes available in @a buf | 742 | * @param size number of bytes available in @a buf |
@@ -749,26 +749,26 @@ transmit_line_audio (void *cls, | |||
749 | void *buf) | 749 | void *buf) |
750 | { | 750 | { |
751 | struct Channel *ch = cls; | 751 | struct Channel *ch = cls; |
752 | struct MeshAudioMessage *mam = buf; | 752 | struct CadetAudioMessage *mam = buf; |
753 | 753 | ||
754 | ch->unreliable_mth = NULL; | 754 | ch->unreliable_mth = NULL; |
755 | if ( (NULL == buf) || | 755 | if ( (NULL == buf) || |
756 | (size < sizeof (struct MeshAudioMessage) + ch->audio_size) ) | 756 | (size < sizeof (struct CadetAudioMessage) + ch->audio_size) ) |
757 | { | 757 | { |
758 | /* eh, other error handling? */ | 758 | /* eh, other error handling? */ |
759 | return 0; | 759 | return 0; |
760 | } | 760 | } |
761 | mam->header.size = htons (sizeof (struct MeshAudioMessage) + ch->audio_size); | 761 | mam->header.size = htons (sizeof (struct CadetAudioMessage) + ch->audio_size); |
762 | mam->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_AUDIO); | 762 | mam->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO); |
763 | mam->remote_line = htonl (ch->remote_line); | 763 | mam->remote_line = htonl (ch->remote_line); |
764 | mam->source_line = htonl (ch->line->local_line); | 764 | mam->source_line = htonl (ch->line->local_line); |
765 | memcpy (&mam[1], ch->audio_data, ch->audio_size); | 765 | memcpy (&mam[1], ch->audio_data, ch->audio_size); |
766 | GNUNET_free (ch->audio_data); | 766 | GNUNET_free (ch->audio_data); |
767 | ch->audio_data = NULL; | 767 | ch->audio_data = NULL; |
768 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 768 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
769 | "Sending %u bytes of audio data from line %u to remote line %u via mesh\n", | 769 | "Sending %u bytes of audio data from line %u to remote line %u via cadet\n", |
770 | ch->audio_size, ch->line->local_line, ch->remote_line); | 770 | ch->audio_size, ch->line->local_line, ch->remote_line); |
771 | return sizeof (struct MeshAudioMessage) + ch->audio_size; | 771 | return sizeof (struct CadetAudioMessage) + ch->audio_size; |
772 | } | 772 | } |
773 | 773 | ||
774 | 774 | ||
@@ -825,7 +825,7 @@ handle_client_audio_message (void *cls, | |||
825 | case CS_CALLEE_SHUTDOWN: | 825 | case CS_CALLEE_SHUTDOWN: |
826 | case CS_CALLER_SHUTDOWN: | 826 | case CS_CALLER_SHUTDOWN: |
827 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, | 827 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, |
828 | "Mesh audio channel in shutdown; audio data dropped\n"); | 828 | "Cadet audio channel in shutdown; audio data dropped\n"); |
829 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 829 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
830 | return; | 830 | return; |
831 | } | 831 | } |
@@ -838,7 +838,7 @@ handle_client_audio_message (void *cls, | |||
838 | if (NULL == ch->channel_unreliable) | 838 | if (NULL == ch->channel_unreliable) |
839 | { | 839 | { |
840 | GNUNET_log (GNUNET_ERROR_TYPE_INFO | GNUNET_ERROR_TYPE_BULK, | 840 | GNUNET_log (GNUNET_ERROR_TYPE_INFO | GNUNET_ERROR_TYPE_BULK, |
841 | _("Mesh audio channel not ready; audio data dropped\n")); | 841 | _("Cadet audio channel not ready; audio data dropped\n")); |
842 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 842 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
843 | return; | 843 | return; |
844 | } | 844 | } |
@@ -848,7 +848,7 @@ handle_client_audio_message (void *cls, | |||
848 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 848 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
849 | "Bandwidth insufficient; dropping previous audio data segment with %u bytes\n", | 849 | "Bandwidth insufficient; dropping previous audio data segment with %u bytes\n", |
850 | (unsigned int) ch->audio_size); | 850 | (unsigned int) ch->audio_size); |
851 | GNUNET_MESH_notify_transmit_ready_cancel (ch->unreliable_mth); | 851 | GNUNET_CADET_notify_transmit_ready_cancel (ch->unreliable_mth); |
852 | ch->unreliable_mth = NULL; | 852 | ch->unreliable_mth = NULL; |
853 | GNUNET_free (ch->audio_data); | 853 | GNUNET_free (ch->audio_data); |
854 | ch->audio_data = NULL; | 854 | ch->audio_data = NULL; |
@@ -858,10 +858,10 @@ handle_client_audio_message (void *cls, | |||
858 | memcpy (ch->audio_data, | 858 | memcpy (ch->audio_data, |
859 | &msg[1], | 859 | &msg[1], |
860 | size); | 860 | size); |
861 | ch->unreliable_mth = GNUNET_MESH_notify_transmit_ready (ch->channel_unreliable, | 861 | ch->unreliable_mth = GNUNET_CADET_notify_transmit_ready (ch->channel_unreliable, |
862 | GNUNET_NO, | 862 | GNUNET_NO, |
863 | GNUNET_TIME_UNIT_FOREVER_REL, | 863 | GNUNET_TIME_UNIT_FOREVER_REL, |
864 | sizeof (struct MeshAudioMessage) | 864 | sizeof (struct CadetAudioMessage) |
865 | + ch->audio_size, | 865 | + ch->audio_size, |
866 | &transmit_line_audio, | 866 | &transmit_line_audio, |
867 | ch); | 867 | ch); |
@@ -873,19 +873,19 @@ handle_client_audio_message (void *cls, | |||
873 | * We are done signalling shutdown to the other peer. | 873 | * We are done signalling shutdown to the other peer. |
874 | * Destroy the channel. | 874 | * Destroy the channel. |
875 | * | 875 | * |
876 | * @param cls the `struct GNUNET_MESH_channel` to destroy | 876 | * @param cls the `struct GNUNET_CADET_channel` to destroy |
877 | */ | 877 | */ |
878 | static void | 878 | static void |
879 | mq_done_destroy_channel (void *cls) | 879 | mq_done_destroy_channel (void *cls) |
880 | { | 880 | { |
881 | struct GNUNET_MESH_Channel *channel = cls; | 881 | struct GNUNET_CADET_Channel *channel = cls; |
882 | 882 | ||
883 | GNUNET_MESH_channel_destroy (channel); | 883 | GNUNET_CADET_channel_destroy (channel); |
884 | } | 884 | } |
885 | 885 | ||
886 | 886 | ||
887 | /** | 887 | /** |
888 | * Function to handle a ring message incoming over mesh | 888 | * Function to handle a ring message incoming over cadet |
889 | * | 889 | * |
890 | * @param cls closure, NULL | 890 | * @param cls closure, NULL |
891 | * @param channel the channel over which the message arrived | 891 | * @param channel the channel over which the message arrived |
@@ -895,20 +895,20 @@ mq_done_destroy_channel (void *cls) | |||
895 | * @return #GNUNET_OK | 895 | * @return #GNUNET_OK |
896 | */ | 896 | */ |
897 | static int | 897 | static int |
898 | handle_mesh_ring_message (void *cls, | 898 | handle_cadet_ring_message (void *cls, |
899 | struct GNUNET_MESH_Channel *channel, | 899 | struct GNUNET_CADET_Channel *channel, |
900 | void **channel_ctx, | 900 | void **channel_ctx, |
901 | const struct GNUNET_MessageHeader *message) | 901 | const struct GNUNET_MessageHeader *message) |
902 | { | 902 | { |
903 | const struct MeshPhoneRingMessage *msg; | 903 | const struct CadetPhoneRingMessage *msg; |
904 | struct Line *line; | 904 | struct Line *line; |
905 | struct Channel *ch; | 905 | struct Channel *ch; |
906 | struct GNUNET_MQ_Envelope *e; | 906 | struct GNUNET_MQ_Envelope *e; |
907 | struct MeshPhoneHangupMessage *hang_up; | 907 | struct CadetPhoneHangupMessage *hang_up; |
908 | struct ClientPhoneRingMessage cring; | 908 | struct ClientPhoneRingMessage cring; |
909 | struct GNUNET_MQ_Handle *reliable_mq; | 909 | struct GNUNET_MQ_Handle *reliable_mq; |
910 | 910 | ||
911 | msg = (const struct MeshPhoneRingMessage *) message; | 911 | msg = (const struct CadetPhoneRingMessage *) message; |
912 | if ( (msg->purpose.size != htonl (sizeof (struct GNUNET_PeerIdentity) * 2 + | 912 | if ( (msg->purpose.size != htonl (sizeof (struct GNUNET_PeerIdentity) * 2 + |
913 | sizeof (struct GNUNET_TIME_AbsoluteNBO) + | 913 | sizeof (struct GNUNET_TIME_AbsoluteNBO) + |
914 | sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + | 914 | sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + |
@@ -922,7 +922,7 @@ handle_mesh_ring_message (void *cls, | |||
922 | GNUNET_break_op (0); | 922 | GNUNET_break_op (0); |
923 | return GNUNET_SYSERR; | 923 | return GNUNET_SYSERR; |
924 | } | 924 | } |
925 | GNUNET_MESH_receive_done (channel); /* needed? */ | 925 | GNUNET_CADET_receive_done (channel); /* needed? */ |
926 | for (line = lines_head; NULL != line; line = line->next) | 926 | for (line = lines_head; NULL != line; line = line->next) |
927 | if (line->local_line == ntohl (msg->remote_line)) | 927 | if (line->local_line == ntohl (msg->remote_line)) |
928 | break; | 928 | break; |
@@ -932,11 +932,11 @@ handle_mesh_ring_message (void *cls, | |||
932 | _("No available phone for incoming call on line %u, sending HANG_UP signal\n"), | 932 | _("No available phone for incoming call on line %u, sending HANG_UP signal\n"), |
933 | ntohl (msg->remote_line)); | 933 | ntohl (msg->remote_line)); |
934 | e = GNUNET_MQ_msg (hang_up, | 934 | e = GNUNET_MQ_msg (hang_up, |
935 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_HANG_UP); | 935 | GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP); |
936 | GNUNET_MQ_notify_sent (e, | 936 | GNUNET_MQ_notify_sent (e, |
937 | &mq_done_destroy_channel, | 937 | &mq_done_destroy_channel, |
938 | channel); | 938 | channel); |
939 | reliable_mq = GNUNET_MESH_mq_create (channel); | 939 | reliable_mq = GNUNET_CADET_mq_create (channel); |
940 | GNUNET_MQ_send (reliable_mq, e); | 940 | GNUNET_MQ_send (reliable_mq, e); |
941 | /* FIXME: do we need to clean up reliable_mq somehow/somewhere? */ | 941 | /* FIXME: do we need to clean up reliable_mq somehow/somewhere? */ |
942 | return GNUNET_OK; | 942 | return GNUNET_OK; |
@@ -949,7 +949,7 @@ handle_mesh_ring_message (void *cls, | |||
949 | ch->status = CS_CALLEE_RINGING; | 949 | ch->status = CS_CALLEE_RINGING; |
950 | ch->remote_line = ntohl (msg->source_line); | 950 | ch->remote_line = ntohl (msg->source_line); |
951 | ch->channel_reliable = channel; | 951 | ch->channel_reliable = channel; |
952 | ch->reliable_mq = GNUNET_MESH_mq_create (ch->channel_reliable); | 952 | ch->reliable_mq = GNUNET_CADET_mq_create (ch->channel_reliable); |
953 | ch->cid = line->cid_gen++; | 953 | ch->cid = line->cid_gen++; |
954 | ch->target = msg->source; | 954 | ch->target = msg->source; |
955 | *channel_ctx = ch; | 955 | *channel_ctx = ch; |
@@ -969,7 +969,7 @@ handle_mesh_ring_message (void *cls, | |||
969 | 969 | ||
970 | 970 | ||
971 | /** | 971 | /** |
972 | * Function to handle a hangup message incoming over mesh | 972 | * Function to handle a hangup message incoming over cadet |
973 | * | 973 | * |
974 | * @param cls closure, NULL | 974 | * @param cls closure, NULL |
975 | * @param channel the channel over which the message arrived | 975 | * @param channel the channel over which the message arrived |
@@ -979,8 +979,8 @@ handle_mesh_ring_message (void *cls, | |||
979 | * @return #GNUNET_OK | 979 | * @return #GNUNET_OK |
980 | */ | 980 | */ |
981 | static int | 981 | static int |
982 | handle_mesh_hangup_message (void *cls, | 982 | handle_cadet_hangup_message (void *cls, |
983 | struct GNUNET_MESH_Channel *channel, | 983 | struct GNUNET_CADET_Channel *channel, |
984 | void **channel_ctx, | 984 | void **channel_ctx, |
985 | const struct GNUNET_MessageHeader *message) | 985 | const struct GNUNET_MessageHeader *message) |
986 | { | 986 | { |
@@ -1001,8 +1001,8 @@ handle_mesh_hangup_message (void *cls, | |||
1001 | hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP); | 1001 | hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP); |
1002 | hup.cid = ch->cid; | 1002 | hup.cid = ch->cid; |
1003 | status = ch->status; | 1003 | status = ch->status; |
1004 | GNUNET_MESH_receive_done (channel); | 1004 | GNUNET_CADET_receive_done (channel); |
1005 | destroy_line_mesh_channels (ch); | 1005 | destroy_line_cadet_channels (ch); |
1006 | switch (status) | 1006 | switch (status) |
1007 | { | 1007 | { |
1008 | case CS_CALLEE_RINGING: | 1008 | case CS_CALLEE_RINGING: |
@@ -1027,7 +1027,7 @@ handle_mesh_hangup_message (void *cls, | |||
1027 | 1027 | ||
1028 | 1028 | ||
1029 | /** | 1029 | /** |
1030 | * Function to handle a pickup message incoming over mesh | 1030 | * Function to handle a pickup message incoming over cadet |
1031 | * | 1031 | * |
1032 | * @param cls closure, NULL | 1032 | * @param cls closure, NULL |
1033 | * @param channel the channel over which the message arrived | 1033 | * @param channel the channel over which the message arrived |
@@ -1037,8 +1037,8 @@ handle_mesh_hangup_message (void *cls, | |||
1037 | * @return #GNUNET_OK | 1037 | * @return #GNUNET_OK |
1038 | */ | 1038 | */ |
1039 | static int | 1039 | static int |
1040 | handle_mesh_pickup_message (void *cls, | 1040 | handle_cadet_pickup_message (void *cls, |
1041 | struct GNUNET_MESH_Channel *channel, | 1041 | struct GNUNET_CADET_Channel *channel, |
1042 | void **channel_ctx, | 1042 | void **channel_ctx, |
1043 | const struct GNUNET_MessageHeader *message) | 1043 | const struct GNUNET_MessageHeader *message) |
1044 | { | 1044 | { |
@@ -1053,17 +1053,17 @@ handle_mesh_pickup_message (void *cls, | |||
1053 | return GNUNET_SYSERR; | 1053 | return GNUNET_SYSERR; |
1054 | } | 1054 | } |
1055 | line = ch->line; | 1055 | line = ch->line; |
1056 | GNUNET_MESH_receive_done (channel); | 1056 | GNUNET_CADET_receive_done (channel); |
1057 | switch (ch->status) | 1057 | switch (ch->status) |
1058 | { | 1058 | { |
1059 | case CS_CALLEE_RINGING: | 1059 | case CS_CALLEE_RINGING: |
1060 | case CS_CALLEE_CONNECTED: | 1060 | case CS_CALLEE_CONNECTED: |
1061 | GNUNET_break_op (0); | 1061 | GNUNET_break_op (0); |
1062 | destroy_line_mesh_channels (ch); | 1062 | destroy_line_cadet_channels (ch); |
1063 | return GNUNET_SYSERR; | 1063 | return GNUNET_SYSERR; |
1064 | case CS_CALLEE_SHUTDOWN: | 1064 | case CS_CALLEE_SHUTDOWN: |
1065 | GNUNET_break_op (0); | 1065 | GNUNET_break_op (0); |
1066 | destroy_line_mesh_channels (ch); | 1066 | destroy_line_cadet_channels (ch); |
1067 | break; | 1067 | break; |
1068 | case CS_CALLER_CALLING: | 1068 | case CS_CALLER_CALLING: |
1069 | ch->status = CS_CALLER_CONNECTED; | 1069 | ch->status = CS_CALLER_CONNECTED; |
@@ -1085,11 +1085,11 @@ handle_mesh_pickup_message (void *cls, | |||
1085 | line->client, | 1085 | line->client, |
1086 | &pick.header, | 1086 | &pick.header, |
1087 | GNUNET_NO); | 1087 | GNUNET_NO); |
1088 | ch->channel_unreliable = GNUNET_MESH_channel_create (mesh, | 1088 | ch->channel_unreliable = GNUNET_CADET_channel_create (cadet, |
1089 | ch, | 1089 | ch, |
1090 | &ch->target, | 1090 | &ch->target, |
1091 | GNUNET_APPLICATION_TYPE_CONVERSATION_AUDIO, | 1091 | GNUNET_APPLICATION_TYPE_CONVERSATION_AUDIO, |
1092 | GNUNET_MESH_OPTION_DEFAULT); | 1092 | GNUNET_CADET_OPTION_DEFAULT); |
1093 | if (NULL == ch->channel_unreliable) | 1093 | if (NULL == ch->channel_unreliable) |
1094 | { | 1094 | { |
1095 | GNUNET_break (0); | 1095 | GNUNET_break (0); |
@@ -1099,7 +1099,7 @@ handle_mesh_pickup_message (void *cls, | |||
1099 | 1099 | ||
1100 | 1100 | ||
1101 | /** | 1101 | /** |
1102 | * Function to handle a suspend message incoming over mesh | 1102 | * Function to handle a suspend message incoming over cadet |
1103 | * | 1103 | * |
1104 | * @param cls closure, NULL | 1104 | * @param cls closure, NULL |
1105 | * @param channel the channel over which the message arrived | 1105 | * @param channel the channel over which the message arrived |
@@ -1109,8 +1109,8 @@ handle_mesh_pickup_message (void *cls, | |||
1109 | * @return #GNUNET_OK | 1109 | * @return #GNUNET_OK |
1110 | */ | 1110 | */ |
1111 | static int | 1111 | static int |
1112 | handle_mesh_suspend_message (void *cls, | 1112 | handle_cadet_suspend_message (void *cls, |
1113 | struct GNUNET_MESH_Channel *channel, | 1113 | struct GNUNET_CADET_Channel *channel, |
1114 | void **channel_ctx, | 1114 | void **channel_ctx, |
1115 | const struct GNUNET_MessageHeader *message) | 1115 | const struct GNUNET_MessageHeader *message) |
1116 | { | 1116 | { |
@@ -1128,7 +1128,7 @@ handle_mesh_suspend_message (void *cls, | |||
1128 | suspend.header.size = htons (sizeof (suspend)); | 1128 | suspend.header.size = htons (sizeof (suspend)); |
1129 | suspend.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND); | 1129 | suspend.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND); |
1130 | suspend.cid = ch->cid; | 1130 | suspend.cid = ch->cid; |
1131 | GNUNET_MESH_receive_done (channel); | 1131 | GNUNET_CADET_receive_done (channel); |
1132 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1132 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1133 | "Suspending channel CID: %u(%u:%u)\n", | 1133 | "Suspending channel CID: %u(%u:%u)\n", |
1134 | ch->cid, ch->remote_line, line->local_line); | 1134 | ch->cid, ch->remote_line, line->local_line); |
@@ -1160,7 +1160,7 @@ handle_mesh_suspend_message (void *cls, | |||
1160 | 1160 | ||
1161 | 1161 | ||
1162 | /** | 1162 | /** |
1163 | * Function to handle a resume message incoming over mesh | 1163 | * Function to handle a resume message incoming over cadet |
1164 | * | 1164 | * |
1165 | * @param cls closure, NULL | 1165 | * @param cls closure, NULL |
1166 | * @param channel the channel over which the message arrived | 1166 | * @param channel the channel over which the message arrived |
@@ -1170,8 +1170,8 @@ handle_mesh_suspend_message (void *cls, | |||
1170 | * @return #GNUNET_OK | 1170 | * @return #GNUNET_OK |
1171 | */ | 1171 | */ |
1172 | static int | 1172 | static int |
1173 | handle_mesh_resume_message (void *cls, | 1173 | handle_cadet_resume_message (void *cls, |
1174 | struct GNUNET_MESH_Channel *channel, | 1174 | struct GNUNET_CADET_Channel *channel, |
1175 | void **channel_ctx, | 1175 | void **channel_ctx, |
1176 | const struct GNUNET_MessageHeader *message) | 1176 | const struct GNUNET_MessageHeader *message) |
1177 | { | 1177 | { |
@@ -1189,7 +1189,7 @@ handle_mesh_resume_message (void *cls, | |||
1189 | resume.header.size = htons (sizeof (resume)); | 1189 | resume.header.size = htons (sizeof (resume)); |
1190 | resume.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME); | 1190 | resume.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME); |
1191 | resume.cid = ch->cid; | 1191 | resume.cid = ch->cid; |
1192 | GNUNET_MESH_receive_done (channel); | 1192 | GNUNET_CADET_receive_done (channel); |
1193 | if (GNUNET_YES != ch->suspended_remote) | 1193 | if (GNUNET_YES != ch->suspended_remote) |
1194 | { | 1194 | { |
1195 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1195 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -1224,7 +1224,7 @@ handle_mesh_resume_message (void *cls, | |||
1224 | 1224 | ||
1225 | 1225 | ||
1226 | /** | 1226 | /** |
1227 | * Function to handle an audio message incoming over mesh | 1227 | * Function to handle an audio message incoming over cadet |
1228 | * | 1228 | * |
1229 | * @param cls closure, NULL | 1229 | * @param cls closure, NULL |
1230 | * @param channel the channel over which the message arrived | 1230 | * @param channel the channel over which the message arrived |
@@ -1234,25 +1234,25 @@ handle_mesh_resume_message (void *cls, | |||
1234 | * @return #GNUNET_OK | 1234 | * @return #GNUNET_OK |
1235 | */ | 1235 | */ |
1236 | static int | 1236 | static int |
1237 | handle_mesh_audio_message (void *cls, | 1237 | handle_cadet_audio_message (void *cls, |
1238 | struct GNUNET_MESH_Channel *channel, | 1238 | struct GNUNET_CADET_Channel *channel, |
1239 | void **channel_ctx, | 1239 | void **channel_ctx, |
1240 | const struct GNUNET_MessageHeader *message) | 1240 | const struct GNUNET_MessageHeader *message) |
1241 | { | 1241 | { |
1242 | const struct MeshAudioMessage *msg; | 1242 | const struct CadetAudioMessage *msg; |
1243 | struct Channel *ch = *channel_ctx; | 1243 | struct Channel *ch = *channel_ctx; |
1244 | struct Line *line; | 1244 | struct Line *line; |
1245 | struct GNUNET_PeerIdentity sender; | 1245 | struct GNUNET_PeerIdentity sender; |
1246 | size_t msize = ntohs (message->size) - sizeof (struct MeshAudioMessage); | 1246 | size_t msize = ntohs (message->size) - sizeof (struct CadetAudioMessage); |
1247 | char buf[msize + sizeof (struct ClientAudioMessage)]; | 1247 | char buf[msize + sizeof (struct ClientAudioMessage)]; |
1248 | struct ClientAudioMessage *cam; | 1248 | struct ClientAudioMessage *cam; |
1249 | const union GNUNET_MESH_ChannelInfo *info; | 1249 | const union GNUNET_CADET_ChannelInfo *info; |
1250 | 1250 | ||
1251 | msg = (const struct MeshAudioMessage *) message; | 1251 | msg = (const struct CadetAudioMessage *) message; |
1252 | if (NULL == ch) | 1252 | if (NULL == ch) |
1253 | { | 1253 | { |
1254 | info = GNUNET_MESH_channel_get_info (channel, | 1254 | info = GNUNET_CADET_channel_get_info (channel, |
1255 | GNUNET_MESH_OPTION_PEER); | 1255 | GNUNET_CADET_OPTION_PEER); |
1256 | if (NULL == info) | 1256 | if (NULL == info) |
1257 | { | 1257 | { |
1258 | GNUNET_break (0); | 1258 | GNUNET_break (0); |
@@ -1293,13 +1293,13 @@ handle_mesh_audio_message (void *cls, | |||
1293 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1293 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1294 | "Received %u bytes of AUDIO data on suspended channel CID %u:(%u:%u); dropping\n", | 1294 | "Received %u bytes of AUDIO data on suspended channel CID %u:(%u:%u); dropping\n", |
1295 | msize, ch->cid, ch->remote_line, line->local_line); | 1295 | msize, ch->cid, ch->remote_line, line->local_line); |
1296 | GNUNET_MESH_receive_done (channel); | 1296 | GNUNET_CADET_receive_done (channel); |
1297 | return GNUNET_OK; | 1297 | return GNUNET_OK; |
1298 | } | 1298 | } |
1299 | ch->channel_unreliable = channel; | 1299 | ch->channel_unreliable = channel; |
1300 | *channel_ctx = ch; | 1300 | *channel_ctx = ch; |
1301 | } | 1301 | } |
1302 | GNUNET_MESH_receive_done (channel); | 1302 | GNUNET_CADET_receive_done (channel); |
1303 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1303 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1304 | "Forwarding %u bytes of AUDIO data to client CID %u:(%u:%u)\n", | 1304 | "Forwarding %u bytes of AUDIO data to client CID %u:(%u:%u)\n", |
1305 | msize, ch->cid, ch->remote_line, ch->line->local_line); | 1305 | msize, ch->cid, ch->remote_line, ch->line->local_line); |
@@ -1330,9 +1330,9 @@ handle_mesh_audio_message (void *cls, | |||
1330 | */ | 1330 | */ |
1331 | static void * | 1331 | static void * |
1332 | inbound_channel (void *cls, | 1332 | inbound_channel (void *cls, |
1333 | struct GNUNET_MESH_Channel *channel, | 1333 | struct GNUNET_CADET_Channel *channel, |
1334 | const struct GNUNET_PeerIdentity *initiator, | 1334 | const struct GNUNET_PeerIdentity *initiator, |
1335 | uint32_t port, enum GNUNET_MESH_ChannelOption options) | 1335 | uint32_t port, enum GNUNET_CADET_ChannelOption options) |
1336 | { | 1336 | { |
1337 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1337 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1338 | _("Received incoming channel on port %u\n"), | 1338 | _("Received incoming channel on port %u\n"), |
@@ -1345,7 +1345,7 @@ inbound_channel (void *cls, | |||
1345 | * Function called whenever an inbound channel is destroyed. Should clean up | 1345 | * Function called whenever an inbound channel is destroyed. Should clean up |
1346 | * any associated state. | 1346 | * any associated state. |
1347 | * | 1347 | * |
1348 | * @param cls closure (set from #GNUNET_MESH_connect) | 1348 | * @param cls closure (set from #GNUNET_CADET_connect) |
1349 | * @param channel connection to the other end (henceforth invalid) | 1349 | * @param channel connection to the other end (henceforth invalid) |
1350 | * @param channel_ctx place where local state associated | 1350 | * @param channel_ctx place where local state associated |
1351 | * with the channel is stored; | 1351 | * with the channel is stored; |
@@ -1353,7 +1353,7 @@ inbound_channel (void *cls, | |||
1353 | */ | 1353 | */ |
1354 | static void | 1354 | static void |
1355 | inbound_end (void *cls, | 1355 | inbound_end (void *cls, |
1356 | const struct GNUNET_MESH_Channel *channel, | 1356 | const struct GNUNET_CADET_Channel *channel, |
1357 | void *channel_ctx) | 1357 | void *channel_ctx) |
1358 | { | 1358 | { |
1359 | struct Channel *ch = channel_ctx; | 1359 | struct Channel *ch = channel_ctx; |
@@ -1363,7 +1363,7 @@ inbound_end (void *cls, | |||
1363 | if (NULL == ch) | 1363 | if (NULL == ch) |
1364 | { | 1364 | { |
1365 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1365 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1366 | "Mesh channel destroyed, but channel is unknown to us\n"); | 1366 | "Cadet channel destroyed, but channel is unknown to us\n"); |
1367 | return; | 1367 | return; |
1368 | } | 1368 | } |
1369 | line = ch->line; | 1369 | line = ch->line; |
@@ -1371,7 +1371,7 @@ inbound_end (void *cls, | |||
1371 | { | 1371 | { |
1372 | if (NULL != ch->unreliable_mth) | 1372 | if (NULL != ch->unreliable_mth) |
1373 | { | 1373 | { |
1374 | GNUNET_MESH_notify_transmit_ready_cancel (ch->unreliable_mth); | 1374 | GNUNET_CADET_notify_transmit_ready_cancel (ch->unreliable_mth); |
1375 | ch->unreliable_mth = NULL; | 1375 | ch->unreliable_mth = NULL; |
1376 | } | 1376 | } |
1377 | ch->channel_unreliable = NULL; | 1377 | ch->channel_unreliable = NULL; |
@@ -1387,7 +1387,7 @@ inbound_end (void *cls, | |||
1387 | ch->channel_reliable = NULL; | 1387 | ch->channel_reliable = NULL; |
1388 | 1388 | ||
1389 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1389 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1390 | "Mesh channel destroyed by mesh in state %d\n", | 1390 | "Cadet channel destroyed by cadet in state %d\n", |
1391 | ch->status); | 1391 | ch->status); |
1392 | hup.header.size = htons (sizeof (hup)); | 1392 | hup.header.size = htons (sizeof (hup)); |
1393 | hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP); | 1393 | hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP); |
@@ -1413,7 +1413,7 @@ inbound_end (void *cls, | |||
1413 | case CS_CALLER_SHUTDOWN: | 1413 | case CS_CALLER_SHUTDOWN: |
1414 | break; | 1414 | break; |
1415 | } | 1415 | } |
1416 | destroy_line_mesh_channels (ch); | 1416 | destroy_line_cadet_channels (ch); |
1417 | } | 1417 | } |
1418 | 1418 | ||
1419 | 1419 | ||
@@ -1441,7 +1441,7 @@ handle_client_disconnect (void *cls, | |||
1441 | lines_tail, | 1441 | lines_tail, |
1442 | line); | 1442 | line); |
1443 | while (NULL != line->channel_head) | 1443 | while (NULL != line->channel_head) |
1444 | destroy_line_mesh_channels (line->channel_head); | 1444 | destroy_line_cadet_channels (line->channel_head); |
1445 | GNUNET_free (line); | 1445 | GNUNET_free (line); |
1446 | } | 1446 | } |
1447 | 1447 | ||
@@ -1462,17 +1462,17 @@ do_shutdown (void *cls, | |||
1462 | while (NULL != (line = lines_head)) | 1462 | while (NULL != (line = lines_head)) |
1463 | { | 1463 | { |
1464 | while (NULL != (ch = line->channel_head)) | 1464 | while (NULL != (ch = line->channel_head)) |
1465 | destroy_line_mesh_channels (ch); | 1465 | destroy_line_cadet_channels (ch); |
1466 | GNUNET_CONTAINER_DLL_remove (lines_head, | 1466 | GNUNET_CONTAINER_DLL_remove (lines_head, |
1467 | lines_tail, | 1467 | lines_tail, |
1468 | line); | 1468 | line); |
1469 | GNUNET_SERVER_client_set_user_context (line->client, (void *) NULL); | 1469 | GNUNET_SERVER_client_set_user_context (line->client, (void *) NULL); |
1470 | GNUNET_free (line); | 1470 | GNUNET_free (line); |
1471 | } | 1471 | } |
1472 | if (NULL != mesh) | 1472 | if (NULL != cadet) |
1473 | { | 1473 | { |
1474 | GNUNET_MESH_disconnect (mesh); | 1474 | GNUNET_CADET_disconnect (cadet); |
1475 | mesh = NULL; | 1475 | cadet = NULL; |
1476 | } | 1476 | } |
1477 | if (NULL != nc) | 1477 | if (NULL != nc) |
1478 | { | 1478 | { |
@@ -1518,23 +1518,23 @@ run (void *cls, | |||
1518 | 0}, | 1518 | 0}, |
1519 | {NULL, NULL, 0, 0} | 1519 | {NULL, NULL, 0, 0} |
1520 | }; | 1520 | }; |
1521 | static struct GNUNET_MESH_MessageHandler mesh_handlers[] = { | 1521 | static struct GNUNET_CADET_MessageHandler cadet_handlers[] = { |
1522 | {&handle_mesh_ring_message, | 1522 | {&handle_cadet_ring_message, |
1523 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_RING, | 1523 | GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING, |
1524 | sizeof (struct MeshPhoneRingMessage)}, | 1524 | sizeof (struct CadetPhoneRingMessage)}, |
1525 | {&handle_mesh_hangup_message, | 1525 | {&handle_cadet_hangup_message, |
1526 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_HANG_UP, | 1526 | GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP, |
1527 | sizeof (struct MeshPhoneHangupMessage)}, | 1527 | sizeof (struct CadetPhoneHangupMessage)}, |
1528 | {&handle_mesh_pickup_message, | 1528 | {&handle_cadet_pickup_message, |
1529 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_PICK_UP, | 1529 | GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP, |
1530 | sizeof (struct MeshPhonePickupMessage)}, | 1530 | sizeof (struct CadetPhonePickupMessage)}, |
1531 | {&handle_mesh_suspend_message, | 1531 | {&handle_cadet_suspend_message, |
1532 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_SUSPEND, | 1532 | GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND, |
1533 | sizeof (struct MeshPhoneSuspendMessage)}, | 1533 | sizeof (struct CadetPhoneSuspendMessage)}, |
1534 | {&handle_mesh_resume_message, | 1534 | {&handle_cadet_resume_message, |
1535 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_RESUME, | 1535 | GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME, |
1536 | sizeof (struct MeshPhoneResumeMessage)}, | 1536 | sizeof (struct CadetPhoneResumeMessage)}, |
1537 | {&handle_mesh_audio_message, GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_AUDIO, | 1537 | {&handle_cadet_audio_message, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO, |
1538 | 0}, | 1538 | 0}, |
1539 | {NULL, 0, 0} | 1539 | {NULL, 0, 0} |
1540 | }; | 1540 | }; |
@@ -1548,14 +1548,14 @@ run (void *cls, | |||
1548 | GNUNET_assert (GNUNET_OK == | 1548 | GNUNET_assert (GNUNET_OK == |
1549 | GNUNET_CRYPTO_get_peer_identity (cfg, | 1549 | GNUNET_CRYPTO_get_peer_identity (cfg, |
1550 | &my_identity)); | 1550 | &my_identity)); |
1551 | mesh = GNUNET_MESH_connect (cfg, | 1551 | cadet = GNUNET_CADET_connect (cfg, |
1552 | NULL, | 1552 | NULL, |
1553 | &inbound_channel, | 1553 | &inbound_channel, |
1554 | &inbound_end, | 1554 | &inbound_end, |
1555 | mesh_handlers, | 1555 | cadet_handlers, |
1556 | ports); | 1556 | ports); |
1557 | 1557 | ||
1558 | if (NULL == mesh) | 1558 | if (NULL == cadet) |
1559 | { | 1559 | { |
1560 | GNUNET_break (0); | 1560 | GNUNET_break (0); |
1561 | GNUNET_SCHEDULER_shutdown (); | 1561 | GNUNET_SCHEDULER_shutdown (); |