aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_peer.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-18 10:51:16 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-18 10:51:16 +0100
commita1bd2dcc29c126023dbd1ddf83d7514859d1775b (patch)
tree9e23f546f72f800c6451a9ab717bed6fa87e2ead /src/cadet/gnunet-service-cadet_peer.c
parent4ed4bcba53601d97793663017efcda877c3c490a (diff)
downloadgnunet-a1bd2dcc29c126023dbd1ddf83d7514859d1775b.tar.gz
gnunet-a1bd2dcc29c126023dbd1ddf83d7514859d1775b.zip
cadet message struct and type rename-fest
Diffstat (limited to 'src/cadet/gnunet-service-cadet_peer.c')
-rw-r--r--src/cadet/gnunet-service-cadet_peer.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c
index a3defb87e..2c2c552c6 100644
--- a/src/cadet/gnunet-service-cadet_peer.c
+++ b/src/cadet/gnunet-service-cadet_peer.c
@@ -456,7 +456,7 @@ core_disconnect_handler (void *cls,
456 * @return #GNUNET_YES if size is correct, #GNUNET_NO otherwise. 456 * @return #GNUNET_YES if size is correct, #GNUNET_NO otherwise.
457 */ 457 */
458static int 458static int
459check_create (void *cls, const struct GNUNET_CADET_ConnectionCreate *msg) 459check_create (void *cls, const struct GNUNET_CADET_ConnectionCreateMessage *msg)
460{ 460{
461 uint16_t size; 461 uint16_t size;
462 462
@@ -476,7 +476,7 @@ check_create (void *cls, const struct GNUNET_CADET_ConnectionCreate *msg)
476 * @param msg Message itself. 476 * @param msg Message itself.
477 */ 477 */
478static void 478static void
479handle_create (void *cls, const struct GNUNET_CADET_ConnectionCreate *msg) 479handle_create (void *cls, const struct GNUNET_CADET_ConnectionCreateMessage *msg)
480{ 480{
481 struct CadetPeer *peer = cls; 481 struct CadetPeer *peer = cls;
482 GCC_handle_create (peer, msg); 482 GCC_handle_create (peer, msg);
@@ -484,13 +484,13 @@ handle_create (void *cls, const struct GNUNET_CADET_ConnectionCreate *msg)
484 484
485 485
486/** 486/**
487 * Handle for #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK 487 * Handle for #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK
488 * 488 *
489 * @param cls Closure (CadetPeer for neighbor that sent the message). 489 * @param cls Closure (CadetPeer for neighbor that sent the message).
490 * @param msg Message itself. 490 * @param msg Message itself.
491 */ 491 */
492static void 492static void
493handle_confirm (void *cls, const struct GNUNET_CADET_ConnectionACK *msg) 493handle_confirm (void *cls, const struct GNUNET_CADET_ConnectionCreateMessageAckMessage *msg)
494{ 494{
495 struct CadetPeer *peer = cls; 495 struct CadetPeer *peer = cls;
496 GCC_handle_confirm (peer, msg); 496 GCC_handle_confirm (peer, msg);
@@ -504,7 +504,7 @@ handle_confirm (void *cls, const struct GNUNET_CADET_ConnectionACK *msg)
504 * @param msg Message itself. 504 * @param msg Message itself.
505 */ 505 */
506static void 506static void
507handle_broken (void *cls, const struct GNUNET_CADET_ConnectionBroken *msg) 507handle_broken (void *cls, const struct GNUNET_CADET_ConnectionBrokenMessage *msg)
508{ 508{
509 struct CadetPeer *peer = cls; 509 struct CadetPeer *peer = cls;
510 GCC_handle_broken (peer, msg); 510 GCC_handle_broken (peer, msg);
@@ -518,7 +518,7 @@ handle_broken (void *cls, const struct GNUNET_CADET_ConnectionBroken *msg)
518 * @param msg Message itself. 518 * @param msg Message itself.
519 */ 519 */
520static void 520static void
521handle_destroy (void *cls, const struct GNUNET_CADET_ConnectionDestroy *msg) 521handle_destroy (void *cls, const struct GNUNET_CADET_ConnectionDestroyMessage *msg)
522{ 522{
523 struct CadetPeer *peer = cls; 523 struct CadetPeer *peer = cls;
524 GCC_handle_destroy (peer, msg); 524 GCC_handle_destroy (peer, msg);
@@ -526,13 +526,13 @@ handle_destroy (void *cls, const struct GNUNET_CADET_ConnectionDestroy *msg)
526 526
527 527
528/** 528/**
529 * Handle for #GNUNET_MESSAGE_TYPE_CADET_ACK 529 * Handle for #GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK
530 * 530 *
531 * @param cls Closure (CadetPeer for neighbor that sent the message). 531 * @param cls Closure (CadetPeer for neighbor that sent the message).
532 * @param msg Message itself. 532 * @param msg Message itself.
533 */ 533 */
534static void 534static void
535handle_ack (void *cls, const struct GNUNET_CADET_ACK *msg) 535handle_ack (void *cls, const struct GNUNET_CADET_ConnectionEncryptedAckMessage *msg)
536{ 536{
537 struct CadetPeer *peer = cls; 537 struct CadetPeer *peer = cls;
538 GCC_handle_ack (peer, msg); 538 GCC_handle_ack (peer, msg);
@@ -540,13 +540,13 @@ handle_ack (void *cls, const struct GNUNET_CADET_ACK *msg)
540 540
541 541
542/** 542/**
543 * Handle for #GNUNET_MESSAGE_TYPE_CADET_POLL 543 * Handle for #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL
544 * 544 *
545 * @param cls Closure (CadetPeer for neighbor that sent the message). 545 * @param cls Closure (CadetPeer for neighbor that sent the message).
546 * @param msg Message itself. 546 * @param msg Message itself.
547 */ 547 */
548static void 548static void
549handle_poll (void *cls, const struct GNUNET_CADET_Poll *msg) 549handle_poll (void *cls, const struct GNUNET_CADET_ConnectionHopByHopPollMessage *msg)
550{ 550{
551 struct CadetPeer *peer = cls; 551 struct CadetPeer *peer = cls;
552 GCC_handle_poll (peer, msg); 552 GCC_handle_poll (peer, msg);
@@ -554,13 +554,13 @@ handle_poll (void *cls, const struct GNUNET_CADET_Poll *msg)
554 554
555 555
556/** 556/**
557 * Handle for #GNUNET_MESSAGE_TYPE_CADET_KX 557 * Handle for #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX
558 * 558 *
559 * @param cls Closure (CadetPeer for neighbor that sent the message). 559 * @param cls Closure (CadetPeer for neighbor that sent the message).
560 * @param msg Message itself. 560 * @param msg Message itself.
561 */ 561 */
562static void 562static void
563handle_kx (void *cls, const struct GNUNET_CADET_KX *msg) 563handle_kx (void *cls, const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg)
564{ 564{
565 struct CadetPeer *peer = cls; 565 struct CadetPeer *peer = cls;
566 GCC_handle_kx (peer, msg); 566 GCC_handle_kx (peer, msg);
@@ -576,13 +576,13 @@ handle_kx (void *cls, const struct GNUNET_CADET_KX *msg)
576 * @return #GNUNET_YES if size is correct, #GNUNET_NO otherwise. 576 * @return #GNUNET_YES if size is correct, #GNUNET_NO otherwise.
577 */ 577 */
578static int 578static int
579check_encrypted (void *cls, const struct GNUNET_CADET_Encrypted *msg) 579check_encrypted (void *cls, const struct GNUNET_CADET_ConnectionEncryptedMessage *msg)
580{ 580{
581 uint16_t size; 581 uint16_t size;
582 uint16_t minimum_size; 582 uint16_t minimum_size;
583 583
584 size = ntohs (msg->header.size); 584 size = ntohs (msg->header.size);
585 minimum_size = sizeof (struct GNUNET_CADET_Encrypted) 585 minimum_size = sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage)
586 + sizeof (struct GNUNET_MessageHeader); 586 + sizeof (struct GNUNET_MessageHeader);
587 587
588 if (size < minimum_size) 588 if (size < minimum_size)
@@ -594,13 +594,13 @@ check_encrypted (void *cls, const struct GNUNET_CADET_Encrypted *msg)
594} 594}
595 595
596/** 596/**
597 * Handle for #GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED. 597 * Handle for #GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED.
598 * 598 *
599 * @param cls Closure (CadetPeer for neighbor that sent the message). 599 * @param cls Closure (CadetPeer for neighbor that sent the message).
600 * @param msg Message itself. 600 * @param msg Message itself.
601 */ 601 */
602static void 602static void
603handle_encrypted (void *cls, const struct GNUNET_CADET_Encrypted *msg) 603handle_encrypted (void *cls, const struct GNUNET_CADET_ConnectionEncryptedMessage *msg)
604{ 604{
605 struct CadetPeer *peer = cls; 605 struct CadetPeer *peer = cls;
606 GCC_handle_encrypted (peer, msg); 606 GCC_handle_encrypted (peer, msg);
@@ -624,35 +624,35 @@ connect_to_core (const struct GNUNET_CONFIGURATION_Handle *c)
624 struct GNUNET_MQ_MessageHandler core_handlers[] = { 624 struct GNUNET_MQ_MessageHandler core_handlers[] = {
625 GNUNET_MQ_hd_var_size (create, 625 GNUNET_MQ_hd_var_size (create,
626 GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE, 626 GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE,
627 struct GNUNET_CADET_ConnectionCreate, 627 struct GNUNET_CADET_ConnectionCreateMessage,
628 NULL), 628 NULL),
629 GNUNET_MQ_hd_fixed_size (confirm, 629 GNUNET_MQ_hd_fixed_size (confirm,
630 GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK, 630 GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK,
631 struct GNUNET_CADET_ConnectionACK, 631 struct GNUNET_CADET_ConnectionCreateMessageAckMessage,
632 NULL), 632 NULL),
633 GNUNET_MQ_hd_fixed_size (broken, 633 GNUNET_MQ_hd_fixed_size (broken,
634 GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN, 634 GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN,
635 struct GNUNET_CADET_ConnectionBroken, 635 struct GNUNET_CADET_ConnectionBrokenMessage,
636 NULL), 636 NULL),
637 GNUNET_MQ_hd_fixed_size (destroy, 637 GNUNET_MQ_hd_fixed_size (destroy,
638 GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY, 638 GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY,
639 struct GNUNET_CADET_ConnectionDestroy, 639 struct GNUNET_CADET_ConnectionDestroyMessage,
640 NULL), 640 NULL),
641 GNUNET_MQ_hd_fixed_size (ack, 641 GNUNET_MQ_hd_fixed_size (ack,
642 GNUNET_MESSAGE_TYPE_CADET_ACK, 642 GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK,
643 struct GNUNET_CADET_ACK, 643 struct GNUNET_CADET_ConnectionEncryptedAckMessage,
644 NULL), 644 NULL),
645 GNUNET_MQ_hd_fixed_size (poll, 645 GNUNET_MQ_hd_fixed_size (poll,
646 GNUNET_MESSAGE_TYPE_CADET_POLL, 646 GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL,
647 struct GNUNET_CADET_Poll, 647 struct GNUNET_CADET_ConnectionHopByHopPollMessage,
648 NULL), 648 NULL),
649 GNUNET_MQ_hd_fixed_size (kx, 649 GNUNET_MQ_hd_fixed_size (kx,
650 GNUNET_MESSAGE_TYPE_CADET_KX, 650 GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX,
651 struct GNUNET_CADET_KX, 651 struct GNUNET_CADET_TunnelKeyExchangeMessage,
652 NULL), 652 NULL),
653 GNUNET_MQ_hd_var_size (encrypted, 653 GNUNET_MQ_hd_var_size (encrypted,
654 GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED, 654 GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED,
655 struct GNUNET_CADET_Encrypted, 655 struct GNUNET_CADET_ConnectionEncryptedMessage,
656 NULL), 656 NULL),
657 GNUNET_MQ_handler_end () 657 GNUNET_MQ_handler_end ()
658 }; 658 };
@@ -735,7 +735,7 @@ get_priority (struct CadetPeerQueue *q)
735 } 735 }
736 736
737 /* Bulky payload has lower priority, control traffic has higher. */ 737 /* Bulky payload has lower priority, control traffic has higher. */
738 if (GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED == q->type) 738 if (GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED == q->type)
739 return low; 739 return low;
740 return high; 740 return high;
741} 741}
@@ -1059,8 +1059,8 @@ search_handler (void *cls, const struct CadetPeerPath *path)
1059static int 1059static int
1060is_connection_management (uint16_t type) 1060is_connection_management (uint16_t type)
1061{ 1061{
1062 return type == GNUNET_MESSAGE_TYPE_CADET_ACK || 1062 return type == GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK ||
1063 type == GNUNET_MESSAGE_TYPE_CADET_POLL; 1063 type == GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL;
1064} 1064}
1065 1065
1066 1066