regex_ipc.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. This file is part of GNUnet
  3. Copyright (C) 2012, 2013 GNUnet e.V.
  4. GNUnet is free software: you can redistribute it and/or modify it
  5. under the terms of the GNU Affero General Public License as published
  6. by the Free Software Foundation, either version 3 of the License,
  7. or (at your option) any later version.
  8. GNUnet 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 GNU
  11. Affero General Public License for more details.
  12. You should have received a copy of the GNU Affero General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. SPDX-License-Identifier: AGPL3.0-or-later
  15. */
  16. /**
  17. * @file regex/regex_ipc.h
  18. * @brief regex IPC messages (not called 'regex.h' due to conflict with
  19. * system headers)
  20. * @author Christian Grothoff
  21. */
  22. #ifndef REGEX_IPC_H
  23. #define REGEX_IPC_H
  24. #include "gnunet_util_lib.h"
  25. /**
  26. * Request for regex service to announce capability.
  27. */
  28. struct AnnounceMessage
  29. {
  30. /**
  31. * Type is GNUNET_MESSAGE_TYPE_REGEX_ANNOUNCE
  32. */
  33. struct GNUNET_MessageHeader header;
  34. /**
  35. * How many characters can we squeeze per edge?
  36. */
  37. uint16_t compression;
  38. /**
  39. * Always zero.
  40. */
  41. uint16_t reserved;
  42. /**
  43. * Delay between repeated announcements.
  44. */
  45. struct GNUNET_TIME_RelativeNBO refresh_delay;
  46. /* followed by 0-terminated regex as string */
  47. };
  48. /**
  49. * Message to initiate regex search.
  50. */
  51. struct RegexSearchMessage
  52. {
  53. /**
  54. * Type is GNUNET_MESSAGE_TYPE_REGEX_SEARCH
  55. */
  56. struct GNUNET_MessageHeader header;
  57. /* followed by 0-terminated search string */
  58. };
  59. /**
  60. * Result from regex search.
  61. */
  62. struct ResultMessage
  63. {
  64. /**
  65. * Type is GNUNET_MESSAGE_TYPE_REGEX_RESULT
  66. */
  67. struct GNUNET_MessageHeader header;
  68. /**
  69. * Number of entries in the GET path.
  70. */
  71. uint16_t get_path_length;
  72. /**
  73. * Number of entries in the PUT path.
  74. */
  75. uint16_t put_path_length;
  76. /**
  77. * Identity of the peer that was found.
  78. */
  79. struct GNUNET_PeerIdentity id;
  80. /* followed by GET path and PUT path arrays */
  81. };
  82. /* end of regex_ipc.h */
  83. #endif