- verboser log, faster start
[oweals/gnunet.git] / src / testbed / gnunet-service-testbed.h
index d4adf252634d1668434564eefd1102059b05eef0..1d465318cca11dc3229ced3733ab3914074373de 100644 (file)
  */
 #define LIST_GROW_STEP 10
 
-/**
- * Default timeout for operations which may take some time
- */
-#define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 15)
-
 
 /**
  * A routing entry
@@ -610,6 +605,11 @@ extern struct Slave **GST_slave_list;
  */
 extern struct OperationQueue *GST_opq_openfds;
 
+/**
+ * Timeout for operations which may take some time
+ */
+const extern struct GNUNET_TIME_Relative GST_timeout;
+
 /**
  * The size of the peer list
  */
@@ -803,17 +803,24 @@ GST_cache_add_hello (const unsigned int peer_id,
 
 
 /**
- * Callback from cache with needed handles set
+ * Functions of this type are called when the needed handle is available for
+ * usage. These functions are to be registered with either of the functions
+ * GST_cache_get_handle_transport() or GST_cache_get_handle_core(). The
+ * corresponding handles will be set and if they are not, then it signals an
+ * error while opening the handles.
  *
- * @param cls the closure passed to GST_cache_get_handle_transport()
+ * @param cls the closure passed to GST_cache_get_handle_transport() or
+ *          GST_cache_get_handle_core()
  * @param ch the handle to CORE. Can be NULL if it is not requested
  * @param th the handle to TRANSPORT. Can be NULL if it is not requested
  * @param peer_id the identity of the peer. Will be NULL if ch is NULL. In other
  *          cases, its value being NULL means that CORE connection has failed.
  */
-typedef void (*GST_cache_callback) (void *cls, struct GNUNET_CORE_Handle *ch, 
-                                    struct GNUNET_TRANSPORT_Handle *th,
-                                    const struct GNUNET_PeerIdentity *peer_id);
+typedef void (*GST_cache_handle_ready_cb) (void *cls,
+                                           struct GNUNET_CORE_Handle * ch,
+                                           struct GNUNET_TRANSPORT_Handle * th,
+                                           const struct GNUNET_PeerIdentity *
+                                           peer_id);
 
 
 /**
@@ -829,7 +836,8 @@ typedef void (*GST_cache_callback) (void *cls, struct GNUNET_CORE_Handle *ch,
  *          valid until GST_cache_get_handle_done() is called.
  */
 typedef void (*GST_cache_peer_connect_notify) (void *cls,
-                                               const struct GNUNET_PeerIdentity *target);
+                                               const struct GNUNET_PeerIdentity
+                                               * target);
 
 
 /**
@@ -855,8 +863,7 @@ typedef void (*GST_cache_peer_connect_notify) (void *cls,
 struct GSTCacheGetHandle *
 GST_cache_get_handle_transport (unsigned int peer_id,
                                 const struct GNUNET_CONFIGURATION_Handle *cfg,
-                                GST_cache_callback cb,
-                                void *cb_cls,
+                                GST_cache_handle_ready_cb cb, void *cb_cls,
                                 const struct GNUNET_PeerIdentity *target,
                                 GST_cache_peer_connect_notify connect_notify_cb,
                                 void *connect_notify_cb_cls);
@@ -886,8 +893,7 @@ GST_cache_get_handle_transport (unsigned int peer_id,
 struct GSTCacheGetHandle *
 GST_cache_get_handle_core (unsigned int peer_id,
                            const struct GNUNET_CONFIGURATION_Handle *cfg,
-                           GST_cache_callback cb,
-                           void *cb_cls,
+                           GST_cache_handle_ready_cb cb, void *cb_cls,
                            const struct GNUNET_PeerIdentity *target,
                            GST_cache_peer_connect_notify connect_notify_cb,
                            void *connect_notify_cb_cls);