+/**
+ * Obtain a random element from the datacache.
+ *
+ * @param h handle to the datacache
+ * @param iter maybe NULL (to just count)
+ * @param iter_cls closure for @a iter
+ * @return the number of results found (zero or 1)
+ */
+unsigned int
+GNUNET_DATACACHE_get_random (struct GNUNET_DATACACHE_Handle *h,
+ GNUNET_DATACACHE_Iterator iter,
+ void *iter_cls)
+{
+ GNUNET_STATISTICS_update (h->stats,
+ gettext_noop ("# requests for random value received"),
+ 1,
+ GNUNET_NO);
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Processing request for random value\n");
+ return h->api->get_random (h->api->cls,
+ iter,
+ iter_cls);
+}
+
+
+/**
+ * Iterate over the results that are "close" to a particular key in
+ * the datacache. "close" is defined as numerically larger than @a
+ * key (when interpreted as a circular address space), with small
+ * distance.
+ *
+ * @param h handle to the datacache
+ * @param key area of the keyspace to look into
+ * @param num_results number of results that should be returned to @a iter
+ * @param iter maybe NULL (to just count)
+ * @param iter_cls closure for @a iter
+ * @return the number of results found
+ */
+unsigned int
+GNUNET_DATACACHE_get_closest (struct GNUNET_DATACACHE_Handle *h,
+ const struct GNUNET_HashCode *key,
+ unsigned int num_results,
+ GNUNET_DATACACHE_Iterator iter,
+ void *iter_cls)
+{
+ GNUNET_STATISTICS_update (h->stats,
+ gettext_noop ("# proximity search requests received"),
+ 1,
+ GNUNET_NO);
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Processing proximity search at `%s'\n",
+ GNUNET_h2s (key));
+ return h->api->get_closest (h->api->cls,
+ key,
+ num_results,
+ iter,
+ iter_cls);
+}
+