diff options
Diffstat (limited to 'src/testbed/testbed_api.c')
-rw-r--r-- | src/testbed/testbed_api.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index 1d99c7e3f..35956f852 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c | |||
@@ -859,6 +859,46 @@ handle_slave_config (struct GNUNET_TESTBED_Controller *c, | |||
859 | 859 | ||
860 | 860 | ||
861 | /** | 861 | /** |
862 | * Handler for GNUNET_MESSAGE_TYPE_TESTBED_NEEDCONTROLLERCONFIG message from | ||
863 | * controller (testbed service) | ||
864 | * | ||
865 | * @param c the controller handler | ||
866 | * @param msg message received | ||
867 | * @return GNUNET_YES if we can continue receiving from service; GNUNET_NO if | ||
868 | * not | ||
869 | */ | ||
870 | static int | ||
871 | handle_need_controller_config (struct GNUNET_TESTBED_Controller *c, | ||
872 | const struct GNUNET_TESTBED_NeedControllerConfig * msg) | ||
873 | { | ||
874 | struct OperationContext *opc; | ||
875 | struct OverlayConnectData *oc_data; | ||
876 | uint64_t op_id; | ||
877 | |||
878 | op_id = GNUNET_ntohll (msg->operation_id); | ||
879 | if (NULL == (opc = find_opc (c, op_id))) | ||
880 | { | ||
881 | LOG_DEBUG ("Operation not found\n"); | ||
882 | return GNUNET_YES; | ||
883 | } | ||
884 | if (OP_FORWARDED == opc->type) | ||
885 | { | ||
886 | handle_forwarded_operation_msg (c, opc, | ||
887 | (const struct GNUNET_MessageHeader *) msg); | ||
888 | return GNUNET_YES; | ||
889 | } | ||
890 | oc_data = opc->data; | ||
891 | /* FIXME: Should spawn operations to: | ||
892 | 1. Acquire configuration of peer2's controller, | ||
893 | 2. link peer1's controller to peer2's controller | ||
894 | 3. ask them to attempt overlay connect on peer1 and peer2 again */ | ||
895 | GNUNET_break (NULL == oc_data); | ||
896 | GNUNET_break (0); | ||
897 | return GNUNET_YES; | ||
898 | } | ||
899 | |||
900 | |||
901 | /** | ||
862 | * Handler for messages from controller (testbed service) | 902 | * Handler for messages from controller (testbed service) |
863 | * | 903 | * |
864 | * @param cls the controller handler | 904 | * @param cls the controller handler |
@@ -952,6 +992,14 @@ message_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
952 | handle_slave_config (c, (const struct | 992 | handle_slave_config (c, (const struct |
953 | GNUNET_TESTBED_SlaveConfiguration *) msg); | 993 | GNUNET_TESTBED_SlaveConfiguration *) msg); |
954 | break; | 994 | break; |
995 | case GNUNET_MESSAGE_TYPE_TESTBED_NEEDCONTROLLERCONFIG: | ||
996 | GNUNET_assert (msize == sizeof (struct | ||
997 | GNUNET_TESTBED_NeedControllerConfig)); | ||
998 | status = | ||
999 | handle_need_controller_config (c, (const struct | ||
1000 | GNUNET_TESTBED_NeedControllerConfig | ||
1001 | *) msg); | ||
1002 | break; | ||
955 | default: | 1003 | default: |
956 | GNUNET_assert (0); | 1004 | GNUNET_assert (0); |
957 | } | 1005 | } |