extra_gnunet_protocols.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. #ifndef _REHASH_EXTRA_GNUNET_PROTOCOLS_H
  15. #define _REHASH_EXTRA_GNUNET_PROTOCOLS_H
  16. #include <gnunet/gnunet_protocols.h>
  17. #include "rehash_service.h"
  18. #include <gnunet/gnunet_block_lib.h>
  19. /* TODO: register a real block type */
  20. #define GNUNET_BLOCK_TYPE_REHASH GNUNET_BLOCK_TYPE_TEST
  21. /* TODO: register message types */
  22. #define _GNUNET_MESSAGE_TYPE_REHASH_START 48400
  23. /**
  24. * C->S: Client wants to search for hash->hash mappings.
  25. */
  26. #ifndef GNUNET_MESSAGE_TYPE_REHASH_CLIENT_GET
  27. #define GNUNET_MESSAGE_TYPE_REHASH_CLIENT_GET _GNUNET_MESSAGE_TYPE_REHASH_START
  28. #endif
  29. /**
  30. * S->C: Service returns result to client.
  31. */
  32. #ifndef GNUNET_MESSAGE_TYPE_REHASH_CLIENT_RESULT
  33. #define GNUNET_MESSAGE_TYPE_REHASH_CLIENT_RESULT (_GNUNET_MESSAGE_TYPE_REHASH_START + 1)
  34. #endif
  35. /**
  36. * C->S: Client wants to stop search for hash->hash mappings.
  37. */
  38. #ifndef GNUNET_MESSAGE_TYPE_REHASH_CLIENT_GET_STOP
  39. #define GNUNET_MESSAGE_TYPE_REHASH_CLIENT_GET_STOP (_GNUNET_MESSAGE_TYPE_REHASH_START + 2)
  40. #endif
  41. /**
  42. * C->S: Client wants to store hash->hash mapping.
  43. */
  44. #ifndef GNUNET_MESSAGE_TYPE_REHASH_CLIENT_PUT
  45. #define GNUNET_MESSAGE_TYPE_REHASH_CLIENT_PUT (_GNUNET_MESSAGE_TYPE_REHASH_START + 3)
  46. #endif
  47. /**
  48. * S->C: Service gives an update on a hash insertion
  49. */
  50. #ifndef GNUNET_MESSAGE_TYPE_REHASH_PUT_DONE
  51. #define GNUNET_MESSAGE_TYPE_REHASH_PUT_DONE (_GNUNET_MESSAGE_TYPE_REHASH_START + 4)
  52. #endif
  53. #endif