diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-04-08 09:31:53 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-04-08 09:31:53 +0000 |
commit | 6f3ff8ff3db35d2a5c02e8cc88a912e9e0106d7c (patch) | |
tree | f6937fbccd377d56489da30d1bfdb24cc82a3b92 /src/testbed/gnunet-service-testbed.h | |
parent | f2257ba6dd452dddb4a425689a1c137433b5f578 (diff) | |
download | gnunet-6f3ff8ff3db35d2a5c02e8cc88a912e9e0106d7c.tar.gz gnunet-6f3ff8ff3db35d2a5c02e8cc88a912e9e0106d7c.zip |
- restructure
Diffstat (limited to 'src/testbed/gnunet-service-testbed.h')
-rw-r--r-- | src/testbed/gnunet-service-testbed.h | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/src/testbed/gnunet-service-testbed.h b/src/testbed/gnunet-service-testbed.h index 700bbfcd8..aa3ab0b83 100644 --- a/src/testbed/gnunet-service-testbed.h +++ b/src/testbed/gnunet-service-testbed.h | |||
@@ -600,6 +600,25 @@ struct LCFContextQueue | |||
600 | 600 | ||
601 | 601 | ||
602 | /** | 602 | /** |
603 | * Context data for GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS handler | ||
604 | */ | ||
605 | struct HandlerContext_ShutdownPeers | ||
606 | { | ||
607 | /** | ||
608 | * The number of slave we expect to hear from since we forwarded the | ||
609 | * GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS message to them | ||
610 | */ | ||
611 | unsigned int nslaves; | ||
612 | |||
613 | /** | ||
614 | * Did we observe a timeout with respect to this operation at any of the | ||
615 | * slaves | ||
616 | */ | ||
617 | int timeout; | ||
618 | }; | ||
619 | |||
620 | |||
621 | /** | ||
603 | * Our configuration | 622 | * Our configuration |
604 | */ | 623 | */ |
605 | struct GNUNET_CONFIGURATION_Handle *our_config; | 624 | struct GNUNET_CONFIGURATION_Handle *our_config; |
@@ -666,6 +685,30 @@ extern char *GST_stats_dir; | |||
666 | 685 | ||
667 | 686 | ||
668 | /** | 687 | /** |
688 | * Similar to GNUNET_array_grow(); however instead of calling GNUNET_array_grow() | ||
689 | * several times we call it only once. The array is also made to grow in steps | ||
690 | * of LIST_GROW_STEP. | ||
691 | * | ||
692 | * @param ptr the array pointer to grow | ||
693 | * @param size the size of array | ||
694 | * @param accommodate_size the size which the array has to accommdate; after | ||
695 | * this call the array will be big enough to accommdate sizes upto | ||
696 | * accommodate_size | ||
697 | */ | ||
698 | #define GST_array_grow_large_enough(ptr, size, accommodate_size) \ | ||
699 | do \ | ||
700 | { \ | ||
701 | unsigned int growth_size; \ | ||
702 | GNUNET_assert (size <= accommodate_size); \ | ||
703 | growth_size = size; \ | ||
704 | while (growth_size <= accommodate_size) \ | ||
705 | growth_size += LIST_GROW_STEP; \ | ||
706 | GNUNET_array_grow (ptr, size, growth_size); \ | ||
707 | GNUNET_assert (size > accommodate_size); \ | ||
708 | } while (0) | ||
709 | |||
710 | |||
711 | /** | ||
669 | * Queues a message in send queue for sending to the service | 712 | * Queues a message in send queue for sending to the service |
670 | * | 713 | * |
671 | * @param client the client to whom the queued message has to be sent | 714 | * @param client the client to whom the queued message has to be sent |
@@ -686,6 +729,13 @@ GST_destroy_peer (struct Peer *peer); | |||
686 | 729 | ||
687 | 730 | ||
688 | /** | 731 | /** |
732 | * Stops and destroys all peers | ||
733 | */ | ||
734 | void | ||
735 | GST_destroy_peers (); | ||
736 | |||
737 | |||
738 | /** | ||
689 | * Finds the route with directly connected host as destination through which | 739 | * Finds the route with directly connected host as destination through which |
690 | * the destination host can be reached | 740 | * the destination host can be reached |
691 | * | 741 | * |
@@ -747,6 +797,13 @@ GST_forwarded_operation_timeout (void *cls, | |||
747 | 797 | ||
748 | 798 | ||
749 | /** | 799 | /** |
800 | * Clears the forwarded operations queue | ||
801 | */ | ||
802 | void | ||
803 | GST_clear_fopcq (); | ||
804 | |||
805 | |||
806 | /** | ||
750 | * Send operation failure message to client | 807 | * Send operation failure message to client |
751 | * | 808 | * |
752 | * @param client the client to which the failure message has to be sent to | 809 | * @param client the client to which the failure message has to be sent to |
@@ -759,6 +816,17 @@ GST_send_operation_fail_msg (struct GNUNET_SERVER_Client *client, | |||
759 | 816 | ||
760 | 817 | ||
761 | /** | 818 | /** |
819 | * Function to send generic operation success message to given client | ||
820 | * | ||
821 | * @param client the client to send the message to | ||
822 | * @param operation_id the id of the operation which was successful | ||
823 | */ | ||
824 | void | ||
825 | GST_send_operation_success_msg (struct GNUNET_SERVER_Client *client, | ||
826 | uint64_t operation_id); | ||
827 | |||
828 | |||
829 | /** | ||
762 | * Handler for GNUNET_MESSAGE_TYPE_TESTBED_REQUESTCONNECT messages | 830 | * Handler for GNUNET_MESSAGE_TYPE_TESTBED_REQUESTCONNECT messages |
763 | * | 831 | * |
764 | * @param cls NULL | 832 | * @param cls NULL |
@@ -772,6 +840,97 @@ GST_handle_remote_overlay_connect (void *cls, | |||
772 | 840 | ||
773 | 841 | ||
774 | /** | 842 | /** |
843 | * Handler for GNUNET_MESSAGE_TYPE_TESTBED_CREATEPEER messages | ||
844 | * | ||
845 | * @param cls NULL | ||
846 | * @param client identification of the client | ||
847 | * @param message the actual message | ||
848 | */ | ||
849 | void | ||
850 | GST_handle_peer_create (void *cls, struct GNUNET_SERVER_Client *client, | ||
851 | const struct GNUNET_MessageHeader *message); | ||
852 | |||
853 | |||
854 | /** | ||
855 | * Message handler for GNUNET_MESSAGE_TYPE_TESTBED_DESTROYPEER messages | ||
856 | * | ||
857 | * @param cls NULL | ||
858 | * @param client identification of the client | ||
859 | * @param message the actual message | ||
860 | */ | ||
861 | void | ||
862 | GST_handle_peer_destroy (void *cls, struct GNUNET_SERVER_Client *client, | ||
863 | const struct GNUNET_MessageHeader *message); | ||
864 | |||
865 | |||
866 | /** | ||
867 | * Message handler for GNUNET_MESSAGE_TYPE_TESTBED_DESTROYPEER messages | ||
868 | * | ||
869 | * @param cls NULL | ||
870 | * @param client identification of the client | ||
871 | * @param message the actual message | ||
872 | */ | ||
873 | void | ||
874 | GST_handle_peer_start (void *cls, struct GNUNET_SERVER_Client *client, | ||
875 | const struct GNUNET_MessageHeader *message); | ||
876 | |||
877 | |||
878 | /** | ||
879 | * Message handler for GNUNET_MESSAGE_TYPE_TESTBED_DESTROYPEER messages | ||
880 | * | ||
881 | * @param cls NULL | ||
882 | * @param client identification of the client | ||
883 | * @param message the actual message | ||
884 | */ | ||
885 | void | ||
886 | GST_handle_peer_stop (void *cls, struct GNUNET_SERVER_Client *client, | ||
887 | const struct GNUNET_MessageHeader *message); | ||
888 | |||
889 | |||
890 | /** | ||
891 | * Handler for GNUNET_MESSAGE_TYPE_TESTBED_GETPEERCONFIG messages | ||
892 | * | ||
893 | * @param cls NULL | ||
894 | * @param client identification of the client | ||
895 | * @param message the actual message | ||
896 | */ | ||
897 | void | ||
898 | GST_handle_peer_get_config (void *cls, struct GNUNET_SERVER_Client *client, | ||
899 | const struct GNUNET_MessageHeader *message); | ||
900 | |||
901 | |||
902 | /** | ||
903 | * Handler for GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS messages | ||
904 | * | ||
905 | * @param cls NULL | ||
906 | * @param client identification of the client | ||
907 | * @param message the actual message | ||
908 | */ | ||
909 | void | ||
910 | GST_handle_shutdown_peers (void *cls, struct GNUNET_SERVER_Client *client, | ||
911 | const struct GNUNET_MessageHeader *message); | ||
912 | |||
913 | |||
914 | /** | ||
915 | * Handler for GNUNET_TESTBED_ManagePeerServiceMessage message | ||
916 | * | ||
917 | * @param cls NULL | ||
918 | * @param client identification of client | ||
919 | * @param message the actual message | ||
920 | */ | ||
921 | void | ||
922 | GST_handle_manage_peer_service (void *cls, struct GNUNET_SERVER_Client *client, | ||
923 | const struct GNUNET_MessageHeader *message); | ||
924 | |||
925 | |||
926 | /** | ||
927 | * Frees the ManageServiceContext queue | ||
928 | */ | ||
929 | void | ||
930 | GST_free_mctxq (); | ||
931 | |||
932 | |||
933 | /** | ||
775 | * Processes a forwarded overlay connect context in the queue of the given RegisteredHostContext | 934 | * Processes a forwarded overlay connect context in the queue of the given RegisteredHostContext |
776 | * | 935 | * |
777 | * @param rhc the RegisteredHostContext | 936 | * @param rhc the RegisteredHostContext |