+offer_hello_done (void *cls)
+{
+ struct ConnectInfo *ci = cls;
+
+ ci->oh = NULL;
+}
+
+
+/**
+ * Function called for all entries in #all_desired_peers to clean up.
+ *
+ * @param cls NULL
+ * @param peer peer the entry is for
+ * @param value the value to remove
+ * @return #GNUNET_YES
+ */
+static int
+free_connect_info (void *cls,
+ const struct GNUNET_PeerIdentity *peer,
+ void *value)
+{
+ struct ConnectInfo *ci = value;
+
+ GNUNET_assert (GNUNET_YES ==
+ GNUNET_CONTAINER_multipeermap_remove (all_desired_peers,
+ peer,
+ ci));
+ if (NULL != ci->sh)
+ {
+ GNUNET_ATS_connectivity_suggest_cancel (ci->sh);
+ ci->sh = NULL;
+ }
+ if (NULL != ci->oh)
+ {
+ GNUNET_TRANSPORT_offer_hello_cancel (ci->oh);
+ ci->oh = NULL;
+ }
+ GNUNET_free (ci);
+ return GNUNET_YES;
+}
+
+
+/**
+ * Consider if we want to connect to a given peer, and if so
+ * let ATS know. If applicable, the HELLO is offered to the
+ * TRANSPORT service.
+ *
+ * @param pid peer to consider connectivity requirements for
+ * @param h a HELLO message, or NULL
+ */
+static void
+try_connect (const struct GNUNET_PeerIdentity *pid,
+ const struct GNUNET_MessageHeader *h)