diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-09-24 17:59:18 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-09-24 17:59:18 +0200 |
commit | 6aa35f62a80056f31ccd97133a0764a0950e1566 (patch) | |
tree | 1a42157c50d6cd3d3332e6b4554a94222bc6adb9 /src/include/gnunet_arm_service.h | |
parent | 2e2790e1b4a563ef471be1b604c6ebee55f89203 (diff) | |
download | gnunet-6aa35f62a80056f31ccd97133a0764a0950e1566.tar.gz gnunet-6aa35f62a80056f31ccd97133a0764a0950e1566.zip |
implement extended status information for arm
Diffstat (limited to 'src/include/gnunet_arm_service.h')
-rw-r--r-- | src/include/gnunet_arm_service.h | 78 |
1 files changed, 72 insertions, 6 deletions
diff --git a/src/include/gnunet_arm_service.h b/src/include/gnunet_arm_service.h index faf89128f..9e79c26e7 100644 --- a/src/include/gnunet_arm_service.h +++ b/src/include/gnunet_arm_service.h | |||
@@ -70,7 +70,7 @@ enum GNUNET_ARM_RequestStatus { | |||
70 | /** | 70 | /** |
71 | * Statuses of services. | 71 | * Statuses of services. |
72 | */ | 72 | */ |
73 | enum GNUNET_ARM_ServiceStatus { | 73 | enum GNUNET_ARM_ServiceMonitorStatus { |
74 | /** | 74 | /** |
75 | * Dummy message. | 75 | * Dummy message. |
76 | */ | 76 | */ |
@@ -150,6 +150,72 @@ enum GNUNET_ARM_Result { | |||
150 | 150 | ||
151 | 151 | ||
152 | /** | 152 | /** |
153 | * Status of a service managed by ARM. | ||
154 | */ | ||
155 | enum GNUNET_ARM_ServiceStatus | ||
156 | { | ||
157 | /** | ||
158 | * Service is stopped. | ||
159 | */ | ||
160 | GNUNET_ARM_SERVICE_STATUS_STOPPED = 0, | ||
161 | |||
162 | /** | ||
163 | * Service has been started and is currently running. | ||
164 | */ | ||
165 | GNUNET_ARM_SERVICE_STATUS_STARTED = 1, | ||
166 | |||
167 | /** | ||
168 | * The service has previously failed, and | ||
169 | * will be restarted. | ||
170 | */ | ||
171 | GNUNET_ARM_SERVICE_STATUS_FAILED = 2, | ||
172 | |||
173 | /** | ||
174 | * The service was started, but then exited normally. | ||
175 | */ | ||
176 | GNUNET_ARM_SERVICE_STATUS_FINISHED = 3, | ||
177 | }; | ||
178 | |||
179 | |||
180 | /** | ||
181 | * Information about a service managed by ARM. | ||
182 | */ | ||
183 | struct GNUNET_ARM_ServiceInfo | ||
184 | { | ||
185 | /** | ||
186 | * The current status of the service. | ||
187 | */ | ||
188 | enum GNUNET_ARM_ServiceStatus status; | ||
189 | |||
190 | /** | ||
191 | * The name of the service. | ||
192 | */ | ||
193 | const char *name; | ||
194 | |||
195 | /** | ||
196 | * The binary used to execute the service. | ||
197 | */ | ||
198 | const char *binary; | ||
199 | |||
200 | /** | ||
201 | * Time when the sevice will be restarted, if applicable | ||
202 | * to the current status. | ||
203 | */ | ||
204 | struct GNUNET_TIME_Absolute restart_at; | ||
205 | |||
206 | /** | ||
207 | * Time when the sevice was first started, if applicable. | ||
208 | */ | ||
209 | struct GNUNET_TIME_Absolute last_started_at; | ||
210 | |||
211 | /** | ||
212 | * Last process exit status. | ||
213 | */ | ||
214 | int last_exit_status; | ||
215 | }; | ||
216 | |||
217 | |||
218 | /** | ||
153 | * Handle for interacting with ARM. | 219 | * Handle for interacting with ARM. |
154 | */ | 220 | */ |
155 | struct GNUNET_ARM_Handle; | 221 | struct GNUNET_ARM_Handle; |
@@ -197,13 +263,13 @@ typedef void | |||
197 | * @param cls closure | 263 | * @param cls closure |
198 | * @param rs status of the request | 264 | * @param rs status of the request |
199 | * @param count number of strings in the list | 265 | * @param count number of strings in the list |
200 | * @param list list of running services | 266 | * @param list list of services managed by arm |
201 | */ | 267 | */ |
202 | typedef void | 268 | typedef void |
203 | (*GNUNET_ARM_ServiceListCallback) (void *cls, | 269 | (*GNUNET_ARM_ServiceListCallback) (void *cls, |
204 | enum GNUNET_ARM_RequestStatus rs, | 270 | enum GNUNET_ARM_RequestStatus rs, |
205 | unsigned int count, | 271 | unsigned int count, |
206 | const char *const*list); | 272 | const struct GNUNET_ARM_ServiceInfo *list); |
207 | 273 | ||
208 | 274 | ||
209 | /** | 275 | /** |
@@ -309,9 +375,9 @@ struct GNUNET_ARM_MonitorHandle; | |||
309 | * @param status status of the service | 375 | * @param status status of the service |
310 | */ | 376 | */ |
311 | typedef void | 377 | typedef void |
312 | (*GNUNET_ARM_ServiceStatusCallback) (void *cls, | 378 | (*GNUNET_ARM_ServiceMonitorCallback) (void *cls, |
313 | const char *service, | 379 | const char *service, |
314 | enum GNUNET_ARM_ServiceStatus status); | 380 | enum GNUNET_ARM_ServiceMonitorStatus status); |
315 | 381 | ||
316 | 382 | ||
317 | /** | 383 | /** |
@@ -327,7 +393,7 @@ typedef void | |||
327 | */ | 393 | */ |
328 | struct GNUNET_ARM_MonitorHandle * | 394 | struct GNUNET_ARM_MonitorHandle * |
329 | GNUNET_ARM_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg, | 395 | GNUNET_ARM_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg, |
330 | GNUNET_ARM_ServiceStatusCallback cont, | 396 | GNUNET_ARM_ServiceMonitorCallback cont, |
331 | void *cont_cls); | 397 | void *cont_cls); |
332 | 398 | ||
333 | 399 | ||