rehash_dht.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* rehash --- a decentralised hash<->hash store
  2. Copyright © 2020 Maxime Devos <maxime.devos@student.kuleuven.be>
  3. This file is part of rehash.
  4. rehash 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. rehash 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 rehash. If not, see <http://www.gnu.org/licenses/>. */
  14. #include <gnunet/gnunet_config.h>
  15. #include "rehash_dht.h"
  16. #include "extra_gnunet_protocols.h"
  17. struct GNUNET_DHT_PutHandle *
  18. REHASH_dht_put (struct GNUNET_DHT_Handle *handle,
  19. const struct GNUNET_HashCode *key,
  20. uint32_t desired_replication_level,
  21. enum GNUNET_DHT_RouteOption options,
  22. size_t size,
  23. const void *data,
  24. struct GNUNET_TIME_Absolute exp,
  25. GNUNET_SCHEDULER_TaskCallback cont,
  26. void *cont_cls)
  27. {
  28. return GNUNET_DHT_put (handle, key, desired_replication_level, options,
  29. GNUNET_BLOCK_TYPE_REHASH,
  30. size, data, exp, cont, cont_cls);
  31. }
  32. struct GNUNET_DHT_GetHandle *
  33. REHASH_dht_get_start (struct GNUNET_DHT_Handle *handle,
  34. const struct GNUNET_HashCode *key,
  35. uint32_t desired_replication_level,
  36. enum GNUNET_DHT_RouteOption options,
  37. GNUNET_DHT_GetIterator iter,
  38. void *iter_cls)
  39. {
  40. return GNUNET_DHT_get_start (handle,
  41. GNUNET_BLOCK_TYPE_REHASH,
  42. key, desired_replication_level, options,
  43. NULL, 0, iter, iter_cls);
  44. }