arm.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. This file is part of GNUnet.
  3. Copyright (C) 2009 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. * @author Christian Grothoff
  18. * @file arm/arm.h
  19. */
  20. #ifndef ARM_H
  21. #define ARM_H
  22. #include "gnunet_common.h"
  23. /**
  24. * This option will turn on the DEBUG loglevel for
  25. * all processes controlled by this ARM!
  26. */
  27. #define DEBUG_ARM GNUNET_EXTRA_LOGGING
  28. GNUNET_NETWORK_STRUCT_BEGIN
  29. /**
  30. * Status update from ARM to client.
  31. */
  32. struct GNUNET_ARM_StatusMessage {
  33. /**
  34. * Reply to client, of type is #GNUNET_MESSAGE_TYPE_ARM_STATUS.
  35. */
  36. struct GNUNET_MessageHeader header;
  37. /**
  38. * Status from the 'enum GNUNET_ARM_ServiceStatus'
  39. */
  40. uint32_t status;
  41. /* followed by a 0-terminated service name */
  42. };
  43. struct GNUNET_ARM_Message {
  44. /**
  45. * Reply to client, type is #GNUNET_MESSAGE_TYPE_ARM_RESULT or
  46. * #GNUNET_MESSAGE_TYPE_ARM_LIST_RESULT.
  47. * OR
  48. * Request from client, type is #GNUNET_MESSAGE_TYPE_ARM_START or
  49. * #GNUNET_MESSAGE_TYPE_ARM_STOP.
  50. */
  51. struct GNUNET_MessageHeader header;
  52. /**
  53. * For alignment.
  54. */
  55. uint32_t reserved;
  56. /**
  57. * ID of a request that is being replied to.
  58. * OR
  59. * ID of a request that is being sent.
  60. */
  61. uint64_t request_id;
  62. /* For requests - followed by a 0-terminated service name */
  63. };
  64. /**
  65. * Reply from ARM to client.
  66. */
  67. struct GNUNET_ARM_ResultMessage {
  68. /**
  69. * Reply to client, of type is #GNUNET_MESSAGE_TYPE_ARM_RESULT, with an ID.
  70. */
  71. struct GNUNET_ARM_Message arm_msg;
  72. /**
  73. * Result from the `enum GNUNET_ARM_Result`
  74. */
  75. uint32_t result;
  76. };
  77. /**
  78. * Reply from ARM to client for the
  79. * #GNUNET_MESSAGE_TYPE_ARM_LIST request followed by count
  80. * '\0' terminated strings. header->size contains the
  81. * total size (including all strings).
  82. */
  83. struct GNUNET_ARM_ListResultMessage {
  84. /**
  85. * Reply to client, of type is #GNUNET_MESSAGE_TYPE_ARM_LIST_RESULT,
  86. * with an ID.
  87. */
  88. struct GNUNET_ARM_Message arm_msg;
  89. /**
  90. * Number of '\0' terminated strings that follow
  91. * this message.
  92. */
  93. uint16_t count;
  94. };
  95. GNUNET_NETWORK_STRUCT_END
  96. #endif