dns.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. This file is part of GNUnet
  3. Copyright (C) 2012 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 dns/dns.h
  18. * @brief IPC messages between DNS API and DNS service
  19. * @author Christian Grothoff
  20. */
  21. #ifndef DNS_H
  22. #define DNS_H
  23. GNUNET_NETWORK_STRUCT_BEGIN
  24. /**
  25. * Message from client to DNS service to register itself.
  26. */
  27. struct GNUNET_DNS_Register
  28. {
  29. /**
  30. * Header of type #GNUNET_MESSAGE_TYPE_DNS_CLIENT_INIT
  31. */
  32. struct GNUNET_MessageHeader header;
  33. /**
  34. * NBO encoding of `enum GNUNET_DNS_Flags` for the client.
  35. */
  36. uint32_t flags GNUNET_PACKED;
  37. };
  38. /**
  39. * Message from DNS service to client: please handle a request.
  40. */
  41. struct GNUNET_DNS_Request
  42. {
  43. /**
  44. * Header of type #GNUNET_MESSAGE_TYPE_DNS_CLIENT_REQUEST
  45. */
  46. struct GNUNET_MessageHeader header;
  47. /**
  48. * Always zero.
  49. */
  50. uint32_t reserved GNUNET_PACKED;
  51. /**
  52. * Unique request ID.
  53. */
  54. uint64_t request_id GNUNET_PACKED;
  55. /* followed by original DNS request (without UDP header) */
  56. };
  57. /**
  58. * Message from client to DNS service: here is my reply.
  59. */
  60. struct GNUNET_DNS_Response
  61. {
  62. /**
  63. * Header of type #GNUNET_MESSAGE_TYPE_DNS_CLIENT_RESPONSE
  64. */
  65. struct GNUNET_MessageHeader header;
  66. /**
  67. * Zero to drop, 1 for no change (no payload), 2 for update (message has payload).
  68. */
  69. uint32_t drop_flag GNUNET_PACKED;
  70. /**
  71. * Unique request ID.
  72. */
  73. uint64_t request_id GNUNET_PACKED;
  74. /* followed by original DNS request (without UDP header) */
  75. };
  76. GNUNET_NETWORK_STRUCT_END
  77. #endif