regex_ipc.h 2.2 KB

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