+static int
+mlp_get_preferred_address_it (void *cls, const GNUNET_HashCode * key, void *value)
+{
+
+ struct ATS_Address **aa = (struct ATS_Address **)cls;
+ struct ATS_Address *addr = value;
+ struct MLP_information *mlpi = addr->mlp_information;
+ if (mlpi->n == GNUNET_YES)
+ {
+ *aa = addr;
+ return GNUNET_NO;
+ }
+ return GNUNET_YES;
+}
+
+
+/**
+ * Get the preferred address for a specific peer
+ *
+ * @param mlp the MLP Handle
+ * @param peer the peer
+ * @return suggested address
+ */
+struct ATS_Address *
+GAS_mlp_get_preferred_address (struct GAS_MLP_Handle *mlp,
+ struct GNUNET_CONTAINER_MultiHashMap * addresses,
+ const struct GNUNET_PeerIdentity *peer)
+{
+ struct ATS_Address * aa = NULL;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Getting preferred address for `%s'\n", GNUNET_i2s (peer));
+ GNUNET_CONTAINER_multihashmap_get_multiple(addresses, &peer->hashPubKey, mlp_get_preferred_address_it, &aa);
+ return aa;
+}
+
+