aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/gnunet-service-testbed_oc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testbed/gnunet-service-testbed_oc.c')
-rw-r--r--src/testbed/gnunet-service-testbed_oc.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/testbed/gnunet-service-testbed_oc.c b/src/testbed/gnunet-service-testbed_oc.c
index b98f319a2..55f18d251 100644
--- a/src/testbed/gnunet-service-testbed_oc.c
+++ b/src/testbed/gnunet-service-testbed_oc.c
@@ -89,7 +89,7 @@ enum OverlayConnectContextType
89 * has to be made between local peers 89 * has to be made between local peers
90 */ 90 */
91 OCC_TYPE_LOCAL, 91 OCC_TYPE_LOCAL,
92 92
93 /** 93 /**
94 * Type to be used when the first peer is local and the other peer is on a slave 94 * Type to be used when the first peer is local and the other peer is on a slave
95 * controller started by us 95 * controller started by us
@@ -109,7 +109,7 @@ enum OverlayConnectContextType
109 * contexts 109 * contexts
110 */ 110 */
111struct LocalPeer2Context 111struct LocalPeer2Context
112{ 112{
113 /** 113 /**
114 * The handle for offering the HELLO of the first peer to the second 114 * The handle for offering the HELLO of the first peer to the second
115 * peer. 115 * peer.
@@ -128,20 +128,20 @@ struct LocalPeer2Context
128 * contexts 128 * contexts
129 */ 129 */
130struct RemotePeer2Context 130struct RemotePeer2Context
131{ 131{
132 /** 132 /**
133 * Controller of peer 2; If OCC_TYPE_REMOTE_LATERAL is the type of overlay 133 * Controller of peer 2; If OCC_TYPE_REMOTE_LATERAL is the type of overlay
134 * connection then this can be NULL until the connection to the controller is 134 * connection then this can be NULL until the connection to the controller is
135 * established 135 * established
136 */ 136 */
137 struct GNUNET_TESTBED_Controller *p2c; 137 struct GNUNET_TESTBED_Controller *p2c;
138 138
139 /** 139 /**
140 * Operation context for the suboperation we start to get the identity of the 140 * Operation context for the suboperation we start to get the identity of the
141 * second peer 141 * second peer
142 */ 142 */
143 struct OperationContext *opc; 143 struct OperationContext *opc;
144 144
145 /** 145 /**
146 * Notification handle acquire to connect to a remote controller. Only used 146 * Notification handle acquire to connect to a remote controller. Only used
147 * if the type of overlay connection is OCC_TYPE_REMOTE_LATERAL. 147 * if the type of overlay connection is OCC_TYPE_REMOTE_LATERAL.
@@ -152,7 +152,7 @@ struct RemotePeer2Context
152 * The neighbour handle. Only used if the type of overlay connection is 152 * The neighbour handle. Only used if the type of overlay connection is
153 * OCC_TYPE_REMOTE_LATERAL. 153 * OCC_TYPE_REMOTE_LATERAL.
154 */ 154 */
155 struct Neighbour *p2n; 155 struct Neighbour *p2n;
156}; 156};
157 157
158/** 158/**
@@ -364,7 +364,7 @@ static struct RemoteOverlayConnectCtx *roccq_tail;
364void 364void
365GST_cleanup_focc (struct ForwardedOverlayConnectContext *focc) 365GST_cleanup_focc (struct ForwardedOverlayConnectContext *focc)
366{ 366{
367 GNUNET_SERVER_client_drop (focc->client); 367 GNUNET_SERVER_client_drop (focc->client);
368 GNUNET_free_non_null (focc->orig_msg); 368 GNUNET_free_non_null (focc->orig_msg);
369 GNUNET_free (focc); 369 GNUNET_free (focc);
370} 370}
@@ -535,7 +535,7 @@ cleanup_occ (struct OverlayConnectContext *occ)
535 if (NULL != occ->cgh_p1th) 535 if (NULL != occ->cgh_p1th)
536 GST_cache_get_handle_done (occ->cgh_p1th); 536 GST_cache_get_handle_done (occ->cgh_p1th);
537 GNUNET_assert (NULL != GST_peer_list); 537 GNUNET_assert (NULL != GST_peer_list);
538 GNUNET_assert (occ->peer->reference_cnt > 0); 538 GNUNET_assert (occ->peer->reference_cnt > 0);
539 occ->peer->reference_cnt--; 539 occ->peer->reference_cnt--;
540 if (PEER_EXPIRED (occ->peer)) 540 if (PEER_EXPIRED (occ->peer))
541 GST_destroy_peer (occ->peer); 541 GST_destroy_peer (occ->peer);
@@ -776,7 +776,7 @@ occ_hello_sent_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
776 GNUNET_free_non_null (occ->emsg); 776 GNUNET_free_non_null (occ->emsg);
777 GNUNET_asprintf (&occ->emsg, 777 GNUNET_asprintf (&occ->emsg,
778 "0x%llx: Timeout during TRANSPORT_try_connect() " 778 "0x%llx: Timeout during TRANSPORT_try_connect() "
779 "at peer %4s", occ->op_id, 779 "at peer %4s", occ->op_id,
780 GNUNET_i2s(&occ->other_peer_identity)); 780 GNUNET_i2s(&occ->other_peer_identity));
781 lp2c->tcc.pid = &occ->peer_identity; 781 lp2c->tcc.pid = &occ->peer_identity;
782 lp2c->tcc.op_id = occ->op_id; 782 lp2c->tcc.op_id = occ->op_id;
@@ -798,10 +798,10 @@ send_hello_thru_rocc (struct OverlayConnectContext *occ)
798 char *other_peer_str; 798 char *other_peer_str;
799 uint16_t msize; 799 uint16_t msize;
800 uint16_t hello_size; 800 uint16_t hello_size;
801 801
802 GNUNET_assert (OCC_TYPE_LOCAL != occ->type); 802 GNUNET_assert (OCC_TYPE_LOCAL != occ->type);
803 GNUNET_assert (NULL != occ->hello); 803 GNUNET_assert (NULL != occ->hello);
804 other_peer_str = GNUNET_strdup (GNUNET_i2s (&occ->other_peer_identity)); 804 other_peer_str = GNUNET_strdup (GNUNET_i2s (&occ->other_peer_identity));
805 LOG_DEBUG ("0x%llx: Offering HELLO of %s (size: %u) to %s via Remote " 805 LOG_DEBUG ("0x%llx: Offering HELLO of %s (size: %u) to %s via Remote "
806 "Overlay Request\n", occ->op_id, 806 "Overlay Request\n", occ->op_id,
807 GNUNET_i2s (&occ->peer_identity), ntohs (occ->hello->size), 807 GNUNET_i2s (&occ->peer_identity), ntohs (occ->hello->size),
@@ -848,7 +848,7 @@ send_hello (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
848 return; 848 return;
849 } 849 }
850 lp2c = &occ->p2ctx.local; 850 lp2c = &occ->p2ctx.local;
851 other_peer_str = GNUNET_strdup (GNUNET_i2s (&occ->other_peer_identity)); 851 other_peer_str = GNUNET_strdup (GNUNET_i2s (&occ->other_peer_identity));
852 LOG_DEBUG ("0x%llx: Offering HELLO of %s to %s\n", occ->op_id, 852 LOG_DEBUG ("0x%llx: Offering HELLO of %s to %s\n", occ->op_id,
853 GNUNET_i2s (&occ->peer_identity), other_peer_str); 853 GNUNET_i2s (&occ->peer_identity), other_peer_str);
854 GNUNET_free (other_peer_str); 854 GNUNET_free (other_peer_str);
@@ -919,7 +919,7 @@ p2_transport_connect (struct OverlayConnectContext *occ)
919 GNUNET_assert (NULL == occ->cgh_p1th); 919 GNUNET_assert (NULL == occ->cgh_p1th);
920 if (OCC_TYPE_LOCAL == occ->type) 920 if (OCC_TYPE_LOCAL == occ->type)
921 { 921 {
922 GNUNET_assert (NULL != (peer2 = GST_peer_list[occ->other_peer_id])); 922 GNUNET_assert (NULL != (peer2 = GST_peer_list[occ->other_peer_id]));
923 occ->p2ctx.local.tcc.cgh_th = 923 occ->p2ctx.local.tcc.cgh_th =
924 GST_cache_get_handle_transport (occ->other_peer_id, 924 GST_cache_get_handle_transport (occ->other_peer_id,
925 peer2->details.local.cfg, 925 peer2->details.local.cfg,
@@ -1145,7 +1145,7 @@ static void
1145host_registration_comp (void *cls, const char *emsg) 1145host_registration_comp (void *cls, const char *emsg)
1146{ 1146{
1147 struct RegisteredHostContext *rhc = cls; 1147 struct RegisteredHostContext *rhc = cls;
1148 1148
1149 rhc->state = RHC_DONE; 1149 rhc->state = RHC_DONE;
1150 GST_process_next_focc (rhc); 1150 GST_process_next_focc (rhc);
1151} 1151}
@@ -1217,7 +1217,7 @@ register_host (struct Slave *slave, struct GNUNET_TESTBED_Host *host)
1217{ 1217{
1218 struct GNUNET_HashCode hash; 1218 struct GNUNET_HashCode hash;
1219 struct RegisteredHostContext *rhc; 1219 struct RegisteredHostContext *rhc;
1220 1220
1221 rhc = GNUNET_malloc (sizeof (struct RegisteredHostContext)); 1221 rhc = GNUNET_malloc (sizeof (struct RegisteredHostContext));
1222 rhc->reg_host = host; 1222 rhc->reg_host = host;
1223 rhc->host = GST_host_list[slave->host_id]; 1223 rhc->host = GST_host_list[slave->host_id];
@@ -1290,7 +1290,7 @@ forward_overlay_connect (const struct GNUNET_TESTBED_OverlayConnectMessage *msg,
1290 route_to_peer1_host = GST_find_dest_route 1290 route_to_peer1_host = GST_find_dest_route
1291 (peer->details.remote.remote_host_id); 1291 (peer->details.remote.remote_host_id);
1292 GNUNET_assert (NULL != route_to_peer1_host); 1292 GNUNET_assert (NULL != route_to_peer1_host);
1293 if ((NULL != route_to_peer2_host) && 1293 if ((NULL != route_to_peer2_host) &&
1294 (route_to_peer1_host->dest == route_to_peer2_host->dest)) 1294 (route_to_peer1_host->dest == route_to_peer2_host->dest))
1295 goto forward; 1295 goto forward;
1296 /* Peer2 is either with us OR peer1 and peer2 can be reached through 1296 /* Peer2 is either with us OR peer1 and peer2 can be reached through
@@ -1417,17 +1417,17 @@ GST_handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client,
1417 { 1417 {
1418 GNUNET_break (0); 1418 GNUNET_break (0);
1419 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 1419 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
1420 return; 1420 return;
1421 } 1421 }
1422 forward_overlay_connect (msg, client); 1422 forward_overlay_connect (msg, client);
1423 GNUNET_SERVER_receive_done (client, GNUNET_OK); 1423 GNUNET_SERVER_receive_done (client, GNUNET_OK);
1424 return; 1424 return;
1425 } 1425 }
1426 p2n = NULL; 1426 p2n = NULL;
1427 occ = GNUNET_malloc (sizeof (struct OverlayConnectContext)); 1427 occ = GNUNET_malloc (sizeof (struct OverlayConnectContext));
1428 occ->type = OCC_TYPE_LOCAL; 1428 occ->type = OCC_TYPE_LOCAL;
1429 if (!VALID_PEER_ID (p2)) /* May be peer2 is on a another controller */ 1429 if (!VALID_PEER_ID (p2)) /* May be peer2 is on a another controller */
1430 { 1430 {
1431 if (NULL == (p2n = GST_get_neighbour (peer2_host_id))) 1431 if (NULL == (p2n = GST_get_neighbour (peer2_host_id)))
1432 { 1432 {
1433 if (!VALID_HOST_ID (peer2_host_id)) 1433 if (!VALID_HOST_ID (peer2_host_id))
@@ -1455,7 +1455,7 @@ GST_handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client,
1455 occ->client = client; 1455 occ->client = client;
1456 occ->other_peer_id = p2; 1456 occ->other_peer_id = p2;
1457 GST_peer_list[p1]->reference_cnt++; 1457 GST_peer_list[p1]->reference_cnt++;
1458 occ->peer = GST_peer_list[p1]; 1458 occ->peer = GST_peer_list[p1];
1459 occ->op_id = operation_id; 1459 occ->op_id = operation_id;
1460 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == occ->timeout_task); 1460 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == occ->timeout_task);
1461 occ->timeout_task = 1461 occ->timeout_task =
@@ -1466,7 +1466,7 @@ GST_handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client,
1466 GNUNET_asprintf (&occ->emsg, 1466 GNUNET_asprintf (&occ->emsg,
1467 "0x%llx: Timeout while acquiring connection to peer %u's " 1467 "0x%llx: Timeout while acquiring connection to peer %u's "
1468 "host: %u\n", occ->op_id, occ->other_peer_id, peer2_host_id); 1468 "host: %u\n", occ->op_id, occ->other_peer_id, peer2_host_id);
1469 occ->p2ctx.remote.ncn = 1469 occ->p2ctx.remote.ncn =
1470 GST_neighbour_get_connection (p2n, &p2_controller_connect_cb, occ); 1470 GST_neighbour_get_connection (p2n, &p2_controller_connect_cb, occ);
1471 break; 1471 break;
1472 case OCC_TYPE_REMOTE_SLAVE: 1472 case OCC_TYPE_REMOTE_SLAVE: