more docu
[oweals/gnunet.git] / src / include / gnunet_transport_service.h
index dee8e71187161013ce75ef7fb4eac62259c83eee..2c6cc2461f3203be0671ce26fae1b9dc94778dc8 100644 (file)
@@ -285,6 +285,9 @@ typedef void (*GNUNET_TRANSPORT_AddressToStringCallback) (void *cls,
 /**
  * Function to call with information about a peer
  *
+ * The #GNUNET_TRANSPORT_monitor_peers_cancel call MUST not be called from
+ * within this function!
+ *
  * @param cls closure
  * @param peer peer this update is about,
  *      NULL if this is the final last callback for a iteration operation
@@ -580,13 +583,30 @@ GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle
 /**
  * Cancel request for address conversion.
  *
- * @param alc handle for the request to cancel
+ * @param pic the context handle
  */
 void
 GNUNET_TRANSPORT_address_to_string_cancel (struct
                                            GNUNET_TRANSPORT_AddressToStringContext
                                            *pic);
 
+/**
+ * Convert a transport state to a human readable string.
+ *
+ * @param state the state
+ */
+const char *
+GNUNET_TRANSPORT_p2s (enum GNUNET_TRANSPORT_PeerState state);
+
+
+/**
+ * Check if a state is defined as connected
+ *
+ * @param state the state value
+ * @return GNUNET_YES or GNUNET_NO
+ */
+int
+GNUNET_TRANSPORT_is_connected (enum GNUNET_TRANSPORT_PeerState state);
 
 /**
  * Return information about a specific peer or all peers currently known to
@@ -609,8 +629,8 @@ GNUNET_TRANSPORT_address_to_string_cancel (struct
  * @param one_shot GNUNET_YES to return the current state and then end (with NULL+NULL),
  *                 GNUNET_NO to monitor peers continuously
  * @param timeout how long is the lookup allowed to take at most
- * @param peer_address_callback function to call with the results
- * @param peer_address_callback_cls closure for peer_address_callback
+ * @param peer_callback function to call with the results
+ * @param peer_callback_cls closure for peer_address_callback
  */
 struct GNUNET_TRANSPORT_PeerMonitoringContext *
 GNUNET_TRANSPORT_monitor_peers (const struct