arm.h 2.7 KB

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