glitch in the license text detected by hyazinthe, thank you!
[oweals/gnunet.git] / src / arm / arm.h
1 /*
2      This file is part of GNUnet.
3      Copyright (C) 2009 GNUnet e.V.
4
5      GNUnet is free software: you can redistribute it and/or modify it
6      under the terms of the GNU Affero General Public License as published
7      by the Free Software Foundation, either version 3 of the License,
8      or (at your option) any later version.
9
10      GNUnet is distributed in the hope that it will be useful, but
11      WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13      Affero General Public License for more details.
14 */
15
16 /**
17  * @author Christian Grothoff
18  * @file arm/arm.h
19  */
20 #ifndef ARM_H
21 #define ARM_H
22
23 #include "gnunet_common.h"
24
25 /**
26  * This option will turn on the DEBUG loglevel for
27  * all processes controlled by this ARM!
28  */
29 #define DEBUG_ARM GNUNET_EXTRA_LOGGING
30
31 GNUNET_NETWORK_STRUCT_BEGIN
32
33 /**
34  * Status update from ARM to client.
35  */
36 struct GNUNET_ARM_StatusMessage
37 {
38
39   /**
40    * Reply to client, of type is #GNUNET_MESSAGE_TYPE_ARM_STATUS.
41    */
42   struct GNUNET_MessageHeader header;
43
44   /**
45    * Status from the 'enum GNUNET_ARM_ServiceStatus'
46    */
47   uint32_t status;
48
49   /* followed by a 0-terminated service name */
50 };
51
52 struct GNUNET_ARM_Message
53 {
54   /**
55    * Reply to client, type is #GNUNET_MESSAGE_TYPE_ARM_RESULT or
56    * #GNUNET_MESSAGE_TYPE_ARM_LIST_RESULT.
57    * OR
58    * Request from client, type is #GNUNET_MESSAGE_TYPE_ARM_START or
59    * #GNUNET_MESSAGE_TYPE_ARM_STOP.
60    */
61   struct GNUNET_MessageHeader header;
62
63   /**
64    * For alignment.
65    */
66   uint32_t reserved;
67
68   /**
69    * ID of a request that is being replied to.
70    * OR
71    * ID of a request that is being sent.
72    */
73   uint64_t request_id;
74
75   /* For requests - followed by a 0-terminated service name */
76 };
77
78
79 /**
80  * Reply from ARM to client.
81  */
82 struct GNUNET_ARM_ResultMessage
83 {
84
85   /**
86    * Reply to client, of type is #GNUNET_MESSAGE_TYPE_ARM_RESULT, with an ID.
87    */
88   struct GNUNET_ARM_Message arm_msg;
89
90   /**
91    * Result from the `enum GNUNET_ARM_Result`
92    */
93   uint32_t result;
94 };
95
96 /**
97  * Reply from ARM to client for the
98  * #GNUNET_MESSAGE_TYPE_ARM_LIST request followed by count
99  * '\0' terminated strings. header->size contains the
100  * total size (including all strings).
101  */
102 struct GNUNET_ARM_ListResultMessage
103 {
104   /**
105    * Reply to client, of type is #GNUNET_MESSAGE_TYPE_ARM_LIST_RESULT,
106    * with an ID.
107    */
108   struct GNUNET_ARM_Message arm_msg;
109
110   /**
111    * Number of '\0' terminated strings that follow
112    * this message.
113    */
114   uint16_t count;
115 };
116
117 GNUNET_NETWORK_STRUCT_END
118
119 #endif