/*
This file is part of GNUnet.
- (C) 2011-2015 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2011-2015 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
* Client that made the request.
*/
struct GNUNET_SERVER_Client *client;
+
+ /* TODO: allow client to express a 'strength' for this request */
};
static struct GNUNET_CONTAINER_MultiPeerMap *connection_requests;
+/**
+ * Is the given peer in the list of peers for which we
+ * have an address request?
+ *
+ * @param cls unused, NULL
+ * @param peer peer to query for
+ * @return #GNUNET_YES if so, #GNUNET_NO if not
+ */
+unsigned int
+GAS_connectivity_has_peer (void *cls,
+ const struct GNUNET_PeerIdentity *peer)
+{
+ if (NULL == connection_requests)
+ return 0;
+ /* TODO: return sum of 'strength's of connectivity requests */
+ return GNUNET_CONTAINER_multipeermap_contains (connection_requests,
+ peer);
+}
+
+
/**
* Handle 'request address' messages from clients.
*
&free_request,
NULL);
GNUNET_CONTAINER_multipeermap_destroy (connection_requests);
+ connection_requests = NULL;
}