aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
authorArthur Dewarumez <arthur.dewarumez@etudiant.univ-lille1.fr>2015-04-27 13:10:22 +0000
committerArthur Dewarumez <arthur.dewarumez@etudiant.univ-lille1.fr>2015-04-27 13:10:22 +0000
commit352bea64600bf916141a5e4df6bdc9899b89d0e3 (patch)
treef86ca7ae49b72d0e7fcc3cd8e5dec07c1de07f1f /src/dht
parentb35c6118ce34e237b499a64eb625029ef376431f (diff)
downloadgnunet-352bea64600bf916141a5e4df6bdc9899b89d0e3.tar.gz
gnunet-352bea64600bf916141a5e4df6bdc9899b89d0e3.zip
Adding some function in the handler
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/gnunet-service-wdht_neighbours.c95
1 files changed, 95 insertions, 0 deletions
diff --git a/src/dht/gnunet-service-wdht_neighbours.c b/src/dht/gnunet-service-wdht_neighbours.c
index 1e77685c6..ea1cd77bd 100644
--- a/src/dht/gnunet-service-wdht_neighbours.c
+++ b/src/dht/gnunet-service-wdht_neighbours.c
@@ -610,7 +610,87 @@ handle_dht_p2p_finger_setup (void *cls,
610 return GNUNET_OK; 610 return GNUNET_OK;
611} 611}
612 612
613/**
614 * Handle a `struct FingerSetupResponseMessage`.
615 *
616 * @param cls closure (NULL)
617 * @param peer sender identity
618 * @param message the setup response message
619 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
620 */
621static int
622handle_dht_p2p_finger_setup_response (void *cls,
623 const struct GNUNET_PeerIdentity *peer,
624 const struct GNUNET_MessageHeader *message)
625{
626 const struct FingerSetupResponseMessage *fsrm;
627
628 fsm = (const struct *) message;
629
630 return GNUNET_OK;
631}
632
633
634/**
635 * Handle a `struct FingerDestroyMessage`.
636 *
637 * @param cls closure (NULL)
638 * @param peer sender identity
639 * @param message the finger destroy message
640 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
641 */
642static int
643handle_dht_p2p_finger_destroy (void *cls,
644 const struct GNUNET_PeerIdentity *peer,
645 const struct GNUNET_MessageHeader *message)
646{
647 const struct FingerDestroyMessage *fdm;
648
649 fsm = (const struct *) message;
650
651 return GNUNET_OK;
652}
653
654/**
655 * Handle a `struct FingerRouteMessage`.
656 *
657 * @param cls closure (NULL)
658 * @param peer sender identity
659 * @param message the finger route message
660 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
661 */
662static int
663handle_dht_p2p_finger_route (void *cls,
664 const struct GNUNET_PeerIdentity *peer,
665 const struct GNUNET_MessageHeader *message)
666{
667 const struct FingerRouteMessage *frm;
613 668
669 fsm = (const struct *) message;
670 /* FIXME: check the size of the message */
671
672 return GNUNET_OK;
673}
674
675/**
676 * Handle a `struct FingerRouteMessage`.
677 *
678 * @param cls closure (NULL)
679 * @param peer sender identity
680 * @param message the finger route message
681 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
682 */
683static int
684handle_dht_p2p_neighbour_find (void *cls,
685 const struct GNUNET_PeerIdentity *peer,
686 const struct GNUNET_MessageHeader *message)
687{
688 const struct FingerSetupMessage *fsm;
689
690 fsm = (const struct *) message;
691
692 return GNUNET_OK;
693}
614 694
615/** 695/**
616 * Initialize neighbours subsystem. 696 * Initialize neighbours subsystem.
@@ -623,6 +703,21 @@ GDS_NEIGHBOURS_init (void)
623 { &handle_dht_p2p_finger_setup, 703 { &handle_dht_p2p_finger_setup,
624 GNUNET_MESSAGE_TYPE_WDHT_FINGER_SETUP, 704 GNUNET_MESSAGE_TYPE_WDHT_FINGER_SETUP,
625 sizeof (struct FingerSetupMessage) }, 705 sizeof (struct FingerSetupMessage) },
706 { &handle_dht_p2p_finger_setup_response,
707 GNUNET_MESSAGE_TYPE_WDHT_FINGER_SETUP_RESPONSE,
708 sizeof (struct FingerSetupResponseMessage) },
709 { &handle_dht_p2p_finger_destroy,
710 GNUNET_MESSAGE_TYPE_WDHT_FINGER_DESTROY,
711 sizeof (struct FingerDestroyMessage) },
712 { &handle_dht_p2p_finger_route,
713 GNUNET_MESSAGE_TYPE_WDHT_FINGER_ROUTE,
714 0},
715 { &handle_dht_p2p_neighbour_find,
716 GNUNET_MESSAGE_TYPE_WDHT_NEIGHBOUR_FIND,
717 sizeof (struct FingerSetupMessage) },
718 { &handle_dht_p2p_neighbour_find,
719 GNUNET_MESSAGE_TYPE_WDHT_NEIGHBOUR_FOUND,
720 sizeof (struct FingerSetupMessage) },
626 {NULL, 0, 0} 721 {NULL, 0, 0}
627 }; 722 };
628 723