[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r24329 - gnunet/src/testbed
From: |
gnunet |
Subject: |
[GNUnet-SVN] r24329 - gnunet/src/testbed |
Date: |
Mon, 15 Oct 2012 22:24:46 +0200 |
Author: harsha
Date: 2012-10-15 22:24:46 +0200 (Mon, 15 Oct 2012)
New Revision: 24329
Modified:
gnunet/src/testbed/gnunet-service-testbed.c
Log:
peer to use slave handle
Modified: gnunet/src/testbed/gnunet-service-testbed.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed.c 2012-10-15 19:48:59 UTC (rev
24328)
+++ gnunet/src/testbed/gnunet-service-testbed.c 2012-10-15 20:24:46 UTC (rev
24329)
@@ -160,6 +160,39 @@
/**
+ * A DLL of host registrations to be made
+ */
+struct HostRegistration
+{
+ /**
+ * next registration in the DLL
+ */
+ struct HostRegistration *next;
+
+ /**
+ * previous registration in the DLL
+ */
+ struct HostRegistration *prev;
+
+ /**
+ * The callback to call after this registration's status is available
+ */
+ GNUNET_TESTBED_HostRegistrationCompletion cb;
+
+ /**
+ * The closure for the above callback
+ */
+ void *cb_cls;
+
+ /**
+ * The host that has to be registered
+ */
+ struct GNUNET_TESTBED_Host *host;
+
+};
+
+
+/**
* Structure representing a connected(directly-linked) controller
*/
struct Slave
@@ -186,9 +219,20 @@
struct LinkControllersContext *lcc;
/**
+ * Head of the host registration DLL
+ */
+ struct HostRegistration *hr_dll_head;
+
+ /**
+ * Tail of the host registration DLL
+ */
+ struct HostRegistration *hr_dll_tail;
+
+ /**
* The id of the host this controller is running on
*/
uint32_t host_id;
+
};
@@ -319,9 +363,9 @@
struct
{
/**
- * The controller this peer is started through
+ * The slave this peer is started through
*/
- struct GNUNET_TESTBED_Controller *controller;
+ struct Slave *slave;
/**
* The id of the remote host this peer is running on
@@ -2014,7 +2058,7 @@
peer = GNUNET_malloc (sizeof (struct Peer));
peer->is_remote = GNUNET_YES;
peer->id = peer_id;
- peer->details.remote.controller = slave_list[route->dest]->controller;
+ peer->details.remote.slave = slave_list[route->dest];
peer->details.remote.remote_host_id = host_id;
fo_ctxt = GNUNET_malloc (sizeof (struct ForwardedOperationContext));
GNUNET_SERVER_client_keep (client);
@@ -2070,8 +2114,8 @@
GNUNET_SERVER_client_keep (client);
fopc->client = client;
fopc->operation_id = GNUNET_ntohll (msg->operation_id);
- fopc->opc =
- GNUNET_TESTBED_forward_operation_msg_ (peer->details.remote.controller,
+ fopc->opc =
+ GNUNET_TESTBED_forward_operation_msg_
(peer->details.remote.slave->controller,
fopc->operation_id,
&msg->header,
&forwarded_operation_reply_relay,
fopc);
@@ -2125,7 +2169,7 @@
fopc->client = client;
fopc->operation_id = GNUNET_ntohll (msg->operation_id);
fopc->opc =
- GNUNET_TESTBED_forward_operation_msg_ (peer->details.remote.controller,
+ GNUNET_TESTBED_forward_operation_msg_
(peer->details.remote.slave->controller,
fopc->operation_id,
&msg->header,
&forwarded_operation_reply_relay,
fopc);
@@ -2189,7 +2233,7 @@
fopc->client = client;
fopc->operation_id = GNUNET_ntohll (msg->operation_id);
fopc->opc =
- GNUNET_TESTBED_forward_operation_msg_ (peer->details.remote.controller,
+ GNUNET_TESTBED_forward_operation_msg_
(peer->details.remote.slave->controller,
fopc->operation_id,
&msg->header,
&forwarded_operation_reply_relay,
fopc);
@@ -2259,7 +2303,7 @@
fopc->client = client;
fopc->operation_id = GNUNET_ntohll (msg->operation_id);
fopc->opc =
- GNUNET_TESTBED_forward_operation_msg_ (peer->details.remote.controller,
+ GNUNET_TESTBED_forward_operation_msg_
(peer->details.remote.slave->controller,
fopc->operation_id,
&msg->header,
&forwarded_operation_reply_relay,
fopc);
@@ -2799,7 +2843,7 @@
msize = sizeof (struct GNUNET_TESTBED_OverlayConnectMessage);
focc = GNUNET_malloc (sizeof (struct ForwardedOverlayConnectContext));
- focc->gateway = peer->details.remote.controller;
+ focc->gateway = peer->details.remote.slave->controller;
focc->gateway2 = (NULL == route_to_peer2_host) ? NULL :
slave_list[route_to_peer2_host->dest]->controller;
focc->peer1 = p1;
@@ -2818,7 +2862,7 @@
}
}
fopc->opc =
- GNUNET_TESTBED_forward_operation_msg_ (peer->details.remote.controller,
+ GNUNET_TESTBED_forward_operation_msg_
(peer->details.remote.slave->controller,
operation_id, message,
&forwarded_overlay_connect_listener,
fopc);
@@ -2872,7 +2916,7 @@
else
{
if (GNUNET_YES == peer_list[occ->other_peer_id]->is_remote)
- occ->peer2_controller =
peer_list[occ->other_peer_id]->details.remote.controller;
+ occ->peer2_controller =
peer_list[occ->other_peer_id]->details.remote.slave->controller;
}
/* Get the identity of the second peer */
if (NULL != occ->peer2_controller)
@@ -3053,7 +3097,7 @@
msg2 = GNUNET_malloc (msize);
(void) memcpy (msg2, message, msize);
- GNUNET_TESTBED_queue_message_ (peer->details.remote.controller, msg2);
+ GNUNET_TESTBED_queue_message_ (peer->details.remote.slave->controller,
msg2);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
return;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r24329 - gnunet/src/testbed,
gnunet <=