rehash_dht.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* GNU Guix --- Functional package management for GNU
  2. Copyright © 2020 Maxime Devos <maxime.devos@student.kuleuven.be>
  3. This file is part of GNU Guix.
  4. GNU Guix is free software; you can redistribute it and/or modify it
  5. under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or (at
  7. your option) any later version.
  8. GNU Guix is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. */
  14. #include <gnunet/gnunet_config.h>
  15. #include "rehash_dht.h"
  16. /* FIXME: bweh! */
  17. #define GNUNET_BLOCK_TYPE_REHASH GNUNET_BLOCK_TYPE_TEST
  18. struct GNUNET_DHT_PutHandle *
  19. GNUNET_REHASH_dht_put (struct GNUNET_DHT_Handle *handle,
  20. const struct GNUNET_HashCode *key,
  21. uint32_t desired_replication_level,
  22. enum GNUNET_DHT_RouteOption options,
  23. size_t size,
  24. const void *data,
  25. struct GNUNET_TIME_Absolute exp,
  26. GNUNET_SCHEDULER_TaskCallback cont,
  27. void *cont_cls)
  28. {
  29. return GNUNET_DHT_put (handle, key, desired_replication_level, options,
  30. GNUNET_BLOCK_TYPE_REHASH,
  31. size, data, exp, cont, cont_cls);
  32. }
  33. struct GNUNET_DHT_GetHandle *
  34. GNUNET_REHASH_DHT_get_start (struct GNUNET_DHT_Handle *handle,
  35. const struct GNUNET_HashCode *key,
  36. uint32_t desired_replication_level,
  37. enum GNUNET_DHT_RouteOption options,
  38. GNUNET_DHT_GetIterator iter,
  39. void *iter_cls)
  40. {
  41. return GNUNET_DHT_get_start (handle,
  42. GNUNET_BLOCK_TYPE_REHASH,
  43. key, desired_replication_level, options,
  44. NULL, 0, iter, iter_cls);
  45. }