aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/gnunet-service-testbed_links.h
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-05-06 16:06:08 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-05-06 16:06:08 +0000
commitad25eef39dc8c15b85bd70c6585af95d7e687fd5 (patch)
tree152df39da268b913fd5a93467556ca9249e20416 /src/testbed/gnunet-service-testbed_links.h
parente2bb863887e78b5847fd86ef5a399a5d13d856d3 (diff)
- doc
Diffstat (limited to 'src/testbed/gnunet-service-testbed_links.h')
-rw-r--r--src/testbed/gnunet-service-testbed_links.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/testbed/gnunet-service-testbed_links.h b/src/testbed/gnunet-service-testbed_links.h
index 65741c21c0..9134ab545f 100644
--- a/src/testbed/gnunet-service-testbed_links.h
+++ b/src/testbed/gnunet-service-testbed_links.h
@@ -25,6 +25,10 @@
* @author Sree Harsha Totakura
*/
+
+/**
+ * A connected controller which is not our child
+ */
struct Neighbour;
@@ -92,36 +96,97 @@ extern struct Slave **GST_slave_list;
*/
extern unsigned int GST_slave_list_size;
+
+/**
+ * Cleans up the neighbour list
+ */
void
GST_neighbour_list_clean();
+
+/**
+ * Get a neighbour from the neighbour list
+ *
+ * @param id the index of the neighbour in the neighbour list
+ * @return the Neighbour; NULL if the given index in invalid (index greater than
+ * the list size or neighbour at that index is NULL)
+ */
struct Neighbour *
GST_get_neighbour (uint32_t id);
+
+/**
+ * Function to cleanup the neighbour connect contexts
+ */
void
GST_free_nccq ();
+
+/**
+ * Notification context to be used to notify when connection to the neighbour's
+ * controller is opened
+ */
struct NeighbourConnectNotification;
+
+/**
+ * The notification callback to call when we are connect to neighbour
+ *
+ * @param cls the closure given to GST_neighbour_get_connection()
+ * @param controller the controller handle to the neighbour
+ */
typedef void (*GST_NeigbourConnectNotifyCallback) (void *cls,
struct
GNUNET_TESTBED_Controller
*controller);
+
+/**
+ * Try to open a connection to the given neigbour. If the connection is open
+ * already, then it is re-used. If not, the request is queued in the operation
+ * queues responsible for bounding the total number of file descriptors. The
+ * actual connection will happen when the operation queue marks the
+ * corresponding operation as active.
+ *
+ * @param n the neighbour to open a connection to
+ * @param cb the notification callback to call when the connection is opened
+ * @param cb_cls the closure for the above callback
+ */
struct NeighbourConnectNotification *
GST_neighbour_get_connection (struct Neighbour *n,
GST_NeigbourConnectNotifyCallback cb,
void *cb_cls);
+
+/**
+ * Cancel the request for opening a connection to the neighbour
+ *
+ * @param h the notification handle
+ */
void
GST_neighbour_get_connection_cancel (struct NeighbourConnectNotification *h);
+
+/**
+ * Release the connection to the neighbour. The actual connection will be
+ * closed if connections to other neighbour are waiting (to maintain a bound on
+ * the total number of connections that are open).
+ *
+ * @param n the neighbour whose connection can be closed
+ */
void
GST_neighbour_release_connection (struct Neighbour *n);
+
+/**
+ * Function to create a neigbour and add it into the neighbour list
+ *
+ * @param host the host of the neighbour
+ */
struct Neighbour *
GST_create_neighbour (struct GNUNET_TESTBED_Host *host);
+
/**
* Message handler for GNUNET_MESSAGE_TYPE_TESTBED_LCONTROLLERS message
*