gns.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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 gns/gns.h
  19. * @brief IPC messages between GNS API and GNS service
  20. * @author Martin Schanzenbach
  21. */
  22. #ifndef GNS_H
  23. #define GNS_H
  24. #include "gnunet_gns_service.h"
  25. /**
  26. * Name of the GNS TLD.
  27. */
  28. #define GNUNET_GNS_TLD "gnu"
  29. /**
  30. * Name of the zone key TLD.
  31. */
  32. #define GNUNET_GNS_TLD_ZKEY "zkey"
  33. /**
  34. * TLD name used to indicate relative names.
  35. */
  36. #define GNUNET_GNS_TLD_PLUS "+"
  37. GNUNET_NETWORK_STRUCT_BEGIN
  38. /**
  39. * Message from client to GNS service to lookup records.
  40. */
  41. struct GNUNET_GNS_ClientLookupMessage
  42. {
  43. /**
  44. * Header of type #GNUNET_MESSAGE_TYPE_GNS_LOOKUP
  45. */
  46. struct GNUNET_MessageHeader header;
  47. /**
  48. * Unique identifier for this request (for key collisions).
  49. */
  50. uint32_t id GNUNET_PACKED;
  51. /**
  52. * Zone that is to be used for lookup
  53. */
  54. struct GNUNET_CRYPTO_EcdsaPublicKey zone;
  55. /**
  56. * Local options for where to look for results
  57. * (an `enum GNUNET_GNS_LocalOptions` in NBO).
  58. */
  59. int16_t options GNUNET_PACKED;
  60. /**
  61. * Is a shorten key attached?
  62. */
  63. int16_t have_key GNUNET_PACKED;
  64. /**
  65. * the type of record to look up
  66. */
  67. int32_t type GNUNET_PACKED;
  68. /**
  69. * The key for shorten, if @e have_key is set
  70. */
  71. struct GNUNET_CRYPTO_EcdsaPrivateKey shorten_key;
  72. /* Followed by the zero-terminated name to look up */
  73. };
  74. /**
  75. * Message from GNS service to client: new results.
  76. */
  77. struct GNUNET_GNS_ClientLookupResultMessage
  78. {
  79. /**
  80. * Header of type #GNUNET_MESSAGE_TYPE_GNS_LOOKUP_RESULT
  81. */
  82. struct GNUNET_MessageHeader header;
  83. /**
  84. * Unique identifier for this request (for key collisions).
  85. */
  86. uint32_t id GNUNET_PACKED;
  87. /**
  88. * The number of records contained in response
  89. */
  90. uint32_t rd_count GNUNET_PACKED;
  91. /* followed by rd_count GNUNET_GNSRECORD_Data structs*/
  92. };
  93. GNUNET_NETWORK_STRUCT_END
  94. #endif