diff options
Diffstat (limited to 'src/testbed/gnunet-service-testbed_links.c')
-rw-r--r-- | src/testbed/gnunet-service-testbed_links.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/testbed/gnunet-service-testbed_links.c b/src/testbed/gnunet-service-testbed_links.c index 85a4538ef..79166d438 100644 --- a/src/testbed/gnunet-service-testbed_links.c +++ b/src/testbed/gnunet-service-testbed_links.c | |||
@@ -98,7 +98,7 @@ struct LCFContext | |||
98 | * The id of the operation which created this context | 98 | * The id of the operation which created this context |
99 | */ | 99 | */ |
100 | uint64_t operation_id; | 100 | uint64_t operation_id; |
101 | 101 | ||
102 | /** | 102 | /** |
103 | * should the slave controller start the delegated controller? | 103 | * should the slave controller start the delegated controller? |
104 | */ | 104 | */ |
@@ -186,7 +186,7 @@ struct Neighbour | |||
186 | * The controller handle | 186 | * The controller handle |
187 | */ | 187 | */ |
188 | struct GNUNET_TESTBED_Controller *controller; | 188 | struct GNUNET_TESTBED_Controller *controller; |
189 | 189 | ||
190 | /** | 190 | /** |
191 | * Operation handle for opening a lateral connection to another controller. | 191 | * Operation handle for opening a lateral connection to another controller. |
192 | * Will be NULL if the slave controller is started by this controller | 192 | * Will be NULL if the slave controller is started by this controller |
@@ -217,11 +217,11 @@ struct Neighbour | |||
217 | * Is the conn_op inactivated? | 217 | * Is the conn_op inactivated? |
218 | */ | 218 | */ |
219 | unsigned int inactive; | 219 | unsigned int inactive; |
220 | 220 | ||
221 | /** | 221 | /** |
222 | * The id of the host this controller is running on | 222 | * The id of the host this controller is running on |
223 | */ | 223 | */ |
224 | uint32_t host_id; | 224 | uint32_t host_id; |
225 | }; | 225 | }; |
226 | 226 | ||
227 | 227 | ||
@@ -256,7 +256,7 @@ struct NeighbourConnectCtxt | |||
256 | * The neighbour to whom connection should be made | 256 | * The neighbour to whom connection should be made |
257 | */ | 257 | */ |
258 | struct Neighbour *n; | 258 | struct Neighbour *n; |
259 | 259 | ||
260 | /** | 260 | /** |
261 | * The client requesting the connection | 261 | * The client requesting the connection |
262 | */ | 262 | */ |
@@ -379,7 +379,7 @@ void | |||
379 | GST_route_list_clear () | 379 | GST_route_list_clear () |
380 | { | 380 | { |
381 | unsigned int id; | 381 | unsigned int id; |
382 | 382 | ||
383 | for (id = 0; id < route_list_size; id++) | 383 | for (id = 0; id < route_list_size; id++) |
384 | if (NULL != route_list[id]) | 384 | if (NULL != route_list[id]) |
385 | GNUNET_free (route_list[id]); | 385 | GNUNET_free (route_list[id]); |
@@ -437,7 +437,7 @@ kill_slave (struct Slave *slave) | |||
437 | } | 437 | } |
438 | if (NULL != slave->rhandle) | 438 | if (NULL != slave->rhandle) |
439 | GNUNET_TESTBED_cancel_registration (slave->rhandle); | 439 | GNUNET_TESTBED_cancel_registration (slave->rhandle); |
440 | GNUNET_assert (GNUNET_SYSERR != | 440 | GNUNET_assert (GNUNET_SYSERR != |
441 | GNUNET_CONTAINER_multihashmap_iterate (slave->reghost_map, | 441 | GNUNET_CONTAINER_multihashmap_iterate (slave->reghost_map, |
442 | reghost_free_iterator, | 442 | reghost_free_iterator, |
443 | slave)); | 443 | slave)); |
@@ -545,7 +545,7 @@ send_controller_link_response (struct GNUNET_SERVER_Client *client, | |||
545 | struct GNUNET_TESTBED_ControllerLinkResponse *msg; | 545 | struct GNUNET_TESTBED_ControllerLinkResponse *msg; |
546 | char *xconfig; | 546 | char *xconfig; |
547 | size_t config_size; | 547 | size_t config_size; |
548 | size_t xconfig_size; | 548 | size_t xconfig_size; |
549 | uint16_t msize; | 549 | uint16_t msize; |
550 | 550 | ||
551 | GNUNET_assert ((NULL == cfg) || (NULL == emsg)); | 551 | GNUNET_assert ((NULL == cfg) || (NULL == emsg)); |
@@ -757,7 +757,7 @@ slave_event_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event) | |||
757 | GNUNET_SCHEDULER_cancel (lcf->timeout_task); | 757 | GNUNET_SCHEDULER_cancel (lcf->timeout_task); |
758 | if (NULL == event->details.operation_finished.emsg) | 758 | if (NULL == event->details.operation_finished.emsg) |
759 | send_controller_link_response (lcf->client, lcf->operation_id, | 759 | send_controller_link_response (lcf->client, lcf->operation_id, |
760 | GNUNET_TESTBED_host_get_cfg_ | 760 | GNUNET_TESTBED_host_get_cfg_ |
761 | (GST_host_list[lcf->delegated_host_id]), | 761 | (GST_host_list[lcf->delegated_host_id]), |
762 | NULL); | 762 | NULL); |
763 | else | 763 | else |
@@ -855,17 +855,17 @@ trigger_notifications (struct Neighbour *n); | |||
855 | * @param tc scheduler task context | 855 | * @param tc scheduler task context |
856 | */ | 856 | */ |
857 | static void | 857 | static void |
858 | neighbour_connect_notify_task (void *cls, | 858 | neighbour_connect_notify_task (void *cls, |
859 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 859 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
860 | { | 860 | { |
861 | struct Neighbour *n = cls; | 861 | struct Neighbour *n = cls; |
862 | struct NeighbourConnectNotification *h; | 862 | struct NeighbourConnectNotification *h; |
863 | 863 | ||
864 | GNUNET_assert (NULL != (h = n->nl_head)); | 864 | GNUNET_assert (NULL != (h = n->nl_head)); |
865 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != n->notify_task); | 865 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != n->notify_task); |
866 | n->notify_task = GNUNET_SCHEDULER_NO_TASK; | 866 | n->notify_task = GNUNET_SCHEDULER_NO_TASK; |
867 | GNUNET_assert (NULL != n->controller); | 867 | GNUNET_assert (NULL != n->controller); |
868 | GNUNET_CONTAINER_DLL_remove (n->nl_head, n->nl_tail, h); | 868 | GNUNET_CONTAINER_DLL_remove (n->nl_head, n->nl_tail, h); |
869 | trigger_notifications (n); | 869 | trigger_notifications (n); |
870 | h->cb (h->cb_cls, n->controller); | 870 | h->cb (h->cb_cls, n->controller); |
871 | GNUNET_free (h); | 871 | GNUNET_free (h); |
@@ -889,7 +889,7 @@ trigger_notifications (struct Neighbour *n) | |||
889 | if (NULL == n->controller) | 889 | if (NULL == n->controller) |
890 | return; | 890 | return; |
891 | if (GNUNET_SCHEDULER_NO_TASK != n->notify_task) | 891 | if (GNUNET_SCHEDULER_NO_TASK != n->notify_task) |
892 | return; | 892 | return; |
893 | if (1 == n->inactive) | 893 | if (1 == n->inactive) |
894 | { | 894 | { |
895 | GNUNET_assert (0 == n->reference_cnt); | 895 | GNUNET_assert (0 == n->reference_cnt); |
@@ -897,7 +897,7 @@ trigger_notifications (struct Neighbour *n) | |||
897 | n->inactive = 0; | 897 | n->inactive = 0; |
898 | } | 898 | } |
899 | n->reference_cnt++; | 899 | n->reference_cnt++; |
900 | n->notify_task = | 900 | n->notify_task = |
901 | GNUNET_SCHEDULER_add_now (&neighbour_connect_notify_task, n); | 901 | GNUNET_SCHEDULER_add_now (&neighbour_connect_notify_task, n); |
902 | } | 902 | } |
903 | 903 | ||
@@ -913,7 +913,7 @@ static void | |||
913 | opstart_neighbour_conn (void *cls) | 913 | opstart_neighbour_conn (void *cls) |
914 | { | 914 | { |
915 | struct Neighbour *n = cls; | 915 | struct Neighbour *n = cls; |
916 | 916 | ||
917 | GNUNET_assert (NULL != n->conn_op); | 917 | GNUNET_assert (NULL != n->conn_op); |
918 | GNUNET_assert (NULL == n->controller); | 918 | GNUNET_assert (NULL == n->controller); |
919 | LOG_DEBUG ("Opening connection to controller on host %u\n", n->host_id); | 919 | LOG_DEBUG ("Opening connection to controller on host %u\n", n->host_id); |
@@ -999,7 +999,7 @@ GST_neighbour_get_connection_cancel (struct NeighbourConnectNotification *h) | |||
999 | { | 999 | { |
1000 | struct Neighbour *n; | 1000 | struct Neighbour *n; |
1001 | int cleanup_task; | 1001 | int cleanup_task; |
1002 | 1002 | ||
1003 | n = h->n; | 1003 | n = h->n; |
1004 | cleanup_task = (h == n->nl_head) ? GNUNET_YES : GNUNET_NO; | 1004 | cleanup_task = (h == n->nl_head) ? GNUNET_YES : GNUNET_NO; |
1005 | GNUNET_CONTAINER_DLL_remove (n->nl_head, n->nl_tail, h); | 1005 | GNUNET_CONTAINER_DLL_remove (n->nl_head, n->nl_tail, h); |
@@ -1121,7 +1121,7 @@ GST_free_nccq () | |||
1121 | * @param tc the scheduler task context | 1121 | * @param tc the scheduler task context |
1122 | */ | 1122 | */ |
1123 | static void | 1123 | static void |
1124 | timeout_neighbour_connect (void *cls, | 1124 | timeout_neighbour_connect (void *cls, |
1125 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 1125 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
1126 | { | 1126 | { |
1127 | struct NeighbourConnectCtxt *ncc = cls; | 1127 | struct NeighbourConnectCtxt *ncc = cls; |
@@ -1233,7 +1233,7 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
1233 | struct Slave *slave; | 1233 | struct Slave *slave; |
1234 | struct LinkControllersContext *lcc; | 1234 | struct LinkControllersContext *lcc; |
1235 | 1235 | ||
1236 | 1236 | ||
1237 | if (1 != msg->is_subordinate) | 1237 | if (1 != msg->is_subordinate) |
1238 | { | 1238 | { |
1239 | struct Neighbour *n; | 1239 | struct Neighbour *n; |
@@ -1253,12 +1253,12 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
1253 | ncc->n = n; | 1253 | ncc->n = n; |
1254 | ncc->op_id = op_id; | 1254 | ncc->op_id = op_id; |
1255 | ncc->client = client; | 1255 | ncc->client = client; |
1256 | GNUNET_SERVER_client_keep (client); | 1256 | GNUNET_SERVER_client_keep (client); |
1257 | ncc->nh = GST_neighbour_get_connection (n, neighbour_connect_cb, ncc); | 1257 | ncc->nh = GST_neighbour_get_connection (n, neighbour_connect_cb, ncc); |
1258 | ncc->timeout_task = GNUNET_SCHEDULER_add_delayed (GST_timeout, | 1258 | ncc->timeout_task = GNUNET_SCHEDULER_add_delayed (GST_timeout, |
1259 | &timeout_neighbour_connect, | 1259 | &timeout_neighbour_connect, |
1260 | ncc); | 1260 | ncc); |
1261 | GNUNET_CONTAINER_DLL_insert_tail (ncc_head, ncc_tail, ncc); | 1261 | GNUNET_CONTAINER_DLL_insert_tail (ncc_head, ncc_tail, ncc); |
1262 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1262 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
1263 | return; | 1263 | return; |
1264 | } | 1264 | } |
@@ -1351,7 +1351,7 @@ GST_free_lcfq () | |||
1351 | { | 1351 | { |
1352 | struct LCFContextQueue *lcfq; | 1352 | struct LCFContextQueue *lcfq; |
1353 | struct LCFContext *lcf; | 1353 | struct LCFContext *lcf; |
1354 | 1354 | ||
1355 | if (NULL != lcfq_head) | 1355 | if (NULL != lcfq_head) |
1356 | { | 1356 | { |
1357 | if (GNUNET_SCHEDULER_NO_TASK != lcf_proc_task_id) | 1357 | if (GNUNET_SCHEDULER_NO_TASK != lcf_proc_task_id) |