aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-04-14 20:45:25 +0000
committerChristian Grothoff <christian@grothoff.org>2013-04-14 20:45:25 +0000
commit08676aaa5b76a0723c8c60ee510aec3652e50774 (patch)
tree0c1ccb9bd806733aba38f76c79499cb0f3cec048 /src
parentce52e258a28a17f5c319549fda1b5fbb8f6169a7 (diff)
downloadgnunet-08676aaa5b76a0723c8c60ee510aec3652e50774.tar.gz
gnunet-08676aaa5b76a0723c8c60ee510aec3652e50774.zip
-remove unnecessary arguments from ARM callbacks
Diffstat (limited to 'src')
-rw-r--r--src/arm/arm_api.c34
-rw-r--r--src/arm/arm_monitor_api.c4
-rw-r--r--src/arm/gnunet-arm.c22
-rw-r--r--src/arm/test_arm_api.c20
-rw-r--r--src/arm/test_exponential_backoff.c8
-rw-r--r--src/arm/test_gnunet_service_arm.c4
-rw-r--r--src/include/gnunet_arm_service.h34
-rw-r--r--src/include/gnunet_peerinfo_service.h4
-rw-r--r--src/testbed/gnunet-service-testbed_peers.c2
-rw-r--r--src/testing/testing.c3
10 files changed, 75 insertions, 60 deletions
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c
index f221dac7b..3514a8f28 100644
--- a/src/arm/arm_api.c
+++ b/src/arm/arm_api.c
@@ -230,7 +230,7 @@ reconnect_arm_later (struct GNUNET_ARM_Handle *h)
230 */ 230 */
231 h->retry_backoff = GNUNET_TIME_STD_BACKOFF (h->retry_backoff); 231 h->retry_backoff = GNUNET_TIME_STD_BACKOFF (h->retry_backoff);
232 if (NULL != h->conn_status) 232 if (NULL != h->conn_status)
233 h->conn_status (h->conn_status_cls, h, GNUNET_NO); 233 h->conn_status (h->conn_status_cls, GNUNET_NO);
234} 234}
235 235
236/** 236/**
@@ -311,7 +311,7 @@ transmit_arm_message (void *cls, size_t size, void *buf)
311 311
312 end: 312 end:
313 if ((GNUNET_YES == notify_connection) && (NULL != h->conn_status)) 313 if ((GNUNET_YES == notify_connection) && (NULL != h->conn_status))
314 h->conn_status (h->conn_status_cls, h, GNUNET_YES); 314 h->conn_status (h->conn_status_cls, GNUNET_YES);
315 return msize; 315 return msize;
316} 316}
317 317
@@ -373,7 +373,7 @@ reconnect_arm (struct GNUNET_ARM_Handle *h)
373 LOG (GNUNET_ERROR_TYPE_DEBUG, 373 LOG (GNUNET_ERROR_TYPE_DEBUG,
374 "arm_api, GNUNET_CLIENT_connect returned NULL\n"); 374 "arm_api, GNUNET_CLIENT_connect returned NULL\n");
375 if (NULL != h->conn_status) 375 if (NULL != h->conn_status)
376 h->conn_status (h->conn_status_cls, h, GNUNET_SYSERR); 376 h->conn_status (h->conn_status_cls, GNUNET_SYSERR);
377 return GNUNET_SYSERR; 377 return GNUNET_SYSERR;
378 } 378 }
379 LOG (GNUNET_ERROR_TYPE_DEBUG, 379 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -443,7 +443,7 @@ GNUNET_ARM_disconnect_and_free (struct GNUNET_ARM_Handle *h)
443 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != cm->timeout_task_id); 443 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != cm->timeout_task_id);
444 GNUNET_SCHEDULER_cancel (cm->timeout_task_id); 444 GNUNET_SCHEDULER_cancel (cm->timeout_task_id);
445 if (NULL != cm->result_cont) 445 if (NULL != cm->result_cont)
446 cm->result_cont (cm->cont_cls, cm->h, GNUNET_ARM_REQUEST_DISCONNECTED, 446 cm->result_cont (cm->cont_cls, GNUNET_ARM_REQUEST_DISCONNECTED,
447 NULL, 0); 447 NULL, 0);
448 /* FIXME: What about list callback? */ 448 /* FIXME: What about list callback? */
449 GNUNET_free_non_null (cm->msg); 449 GNUNET_free_non_null (cm->msg);
@@ -492,9 +492,9 @@ control_message_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *t
492 cm->h->control_sent_tail, cm); 492 cm->h->control_sent_tail, cm);
493 } 493 }
494 if (NULL != cm->result_cont) 494 if (NULL != cm->result_cont)
495 cm->result_cont (cm->cont_cls, cm->h, GNUNET_ARM_REQUEST_TIMEOUT, NULL, 0); 495 cm->result_cont (cm->cont_cls, GNUNET_ARM_REQUEST_TIMEOUT, NULL, 0);
496 else if (NULL != cm->list_cont) 496 else if (NULL != cm->list_cont)
497 cm->list_cont (cm->cont_cls, cm->h, GNUNET_ARM_REQUEST_TIMEOUT, 0, NULL); 497 cm->list_cont (cm->cont_cls, GNUNET_ARM_REQUEST_TIMEOUT, 0, NULL);
498 GNUNET_free_non_null (cm->msg); 498 GNUNET_free_non_null (cm->msg);
499 GNUNET_free (cm); 499 GNUNET_free (cm);
500} 500}
@@ -535,7 +535,9 @@ arm_service_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
535 "gnunet-service-arm"); 535 "gnunet-service-arm");
536 /* arm is running! */ 536 /* arm is running! */
537 if (cm->result_cont) 537 if (cm->result_cont)
538 cm->result_cont (cm->cont_cls, cm->h, GNUNET_ARM_REQUEST_SENT_OK, "arm", GNUNET_ARM_RESULT_IS_STARTED_ALREADY); 538 cm->result_cont (cm->cont_cls,
539 GNUNET_ARM_REQUEST_SENT_OK, "arm",
540 GNUNET_ARM_RESULT_IS_STARTED_ALREADY);
539 } 541 }
540 if (GNUNET_NO == test_is_active) 542 if (GNUNET_NO == test_is_active)
541 { 543 {
@@ -566,7 +568,9 @@ arm_service_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
566 { 568 {
567 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING, "arm", "BINARY"); 569 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING, "arm", "BINARY");
568 if (cm->result_cont) 570 if (cm->result_cont)
569 cm->result_cont (cm->cont_cls, cm->h, GNUNET_ARM_REQUEST_SENT_OK, "arm", GNUNET_ARM_RESULT_IS_NOT_KNOWN); 571 cm->result_cont (cm->cont_cls,
572 GNUNET_ARM_REQUEST_SENT_OK, "arm",
573 GNUNET_ARM_RESULT_IS_NOT_KNOWN);
570 GNUNET_free (cm); 574 GNUNET_free (cm);
571 GNUNET_free (loprefix); 575 GNUNET_free (loprefix);
572 GNUNET_free (lopostfix); 576 GNUNET_free (lopostfix);
@@ -615,13 +619,13 @@ arm_service_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
615 if (NULL == proc) 619 if (NULL == proc)
616 { 620 {
617 if (cm->result_cont) 621 if (cm->result_cont)
618 cm->result_cont (cm->cont_cls, cm->h, GNUNET_ARM_REQUEST_SENT_OK, "arm", 622 cm->result_cont (cm->cont_cls, GNUNET_ARM_REQUEST_SENT_OK, "arm",
619 GNUNET_ARM_RESULT_START_FAILED); 623 GNUNET_ARM_RESULT_START_FAILED);
620 GNUNET_free (cm); 624 GNUNET_free (cm);
621 return; 625 return;
622 } 626 }
623 if (cm->result_cont) 627 if (cm->result_cont)
624 cm->result_cont (cm->cont_cls, cm->h, GNUNET_ARM_REQUEST_SENT_OK, "arm", 628 cm->result_cont (cm->cont_cls, GNUNET_ARM_REQUEST_SENT_OK, "arm",
625 GNUNET_ARM_RESULT_STARTING); 629 GNUNET_ARM_RESULT_STARTING);
626 GNUNET_OS_process_destroy (proc); 630 GNUNET_OS_process_destroy (proc);
627 h = cm->h; 631 h = cm->h;
@@ -655,7 +659,7 @@ change_service (struct GNUNET_ARM_Handle *h, const char *service_name,
655 { 659 {
656 GNUNET_break (0); 660 GNUNET_break (0);
657 if (cb != NULL) 661 if (cb != NULL)
658 cb (cb_cls, h, GNUNET_ARM_REQUEST_TOO_LONG, NULL, 0); 662 cb (cb_cls, GNUNET_ARM_REQUEST_TOO_LONG, NULL, 0);
659 return; 663 return;
660 } 664 }
661 LOG (GNUNET_ERROR_TYPE_DEBUG, "Requesting %s of service `%s'.\n", 665 LOG (GNUNET_ERROR_TYPE_DEBUG, "Requesting %s of service `%s'.\n",
@@ -718,7 +722,7 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h,
718 { 722 {
719 LOG (GNUNET_ERROR_TYPE_DEBUG, "ARM is already running\n"); 723 LOG (GNUNET_ERROR_TYPE_DEBUG, "ARM is already running\n");
720 if (NULL != cont) 724 if (NULL != cont)
721 cont (cont_cls, h, GNUNET_ARM_REQUEST_SENT_OK, "arm", GNUNET_ARM_RESULT_IS_STARTED_ALREADY); 725 cont (cont_cls, GNUNET_ARM_REQUEST_SENT_OK, "arm", GNUNET_ARM_RESULT_IS_STARTED_ALREADY);
722 } 726 }
723 else if (GNUNET_NO == h->service_test_is_active) 727 else if (GNUNET_NO == h->service_test_is_active)
724 { 728 {
@@ -760,7 +764,7 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h,
760 */ 764 */
761 LOG (GNUNET_ERROR_TYPE_DEBUG, "Service test is already in progress, we're busy\n"); 765 LOG (GNUNET_ERROR_TYPE_DEBUG, "Service test is already in progress, we're busy\n");
762 if (NULL != cont) 766 if (NULL != cont)
763 cont (cont_cls, h, GNUNET_ARM_REQUEST_BUSY, NULL, 0); 767 cont (cont_cls, GNUNET_ARM_REQUEST_BUSY, NULL, 0);
764 } 768 }
765 return; 769 return;
766 } 770 }
@@ -966,12 +970,12 @@ client_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
966 (const char *) &cm->msg[1], ntohs (msg->type)); 970 (const char *) &cm->msg[1], ntohs (msg->type));
967 result = (enum GNUNET_ARM_Result) ntohl (res->result); 971 result = (enum GNUNET_ARM_Result) ntohl (res->result);
968 if (NULL != cm->result_cont) 972 if (NULL != cm->result_cont)
969 cm->result_cont (cm->cont_cls, h, GNUNET_ARM_REQUEST_SENT_OK, 973 cm->result_cont (cm->cont_cls, GNUNET_ARM_REQUEST_SENT_OK,
970 (const char *) &cm->msg[1], result); 974 (const char *) &cm->msg[1], result);
971 break; 975 break;
972 case GNUNET_MESSAGE_TYPE_ARM_LIST_RESULT: 976 case GNUNET_MESSAGE_TYPE_ARM_LIST_RESULT:
973 if (NULL != cm->list_cont) 977 if (NULL != cm->list_cont)
974 cm->list_cont (cm->cont_cls, h, GNUNET_ARM_REQUEST_SENT_OK, rcount, 978 cm->list_cont (cm->cont_cls, GNUNET_ARM_REQUEST_SENT_OK, rcount,
975 list); 979 list);
976 GNUNET_free (list); 980 GNUNET_free (list);
977 break; 981 break;
diff --git a/src/arm/arm_monitor_api.c b/src/arm/arm_monitor_api.c
index 7fa53e732..0b8a0699c 100644
--- a/src/arm/arm_monitor_api.c
+++ b/src/arm/arm_monitor_api.c
@@ -221,7 +221,7 @@ reconnect_arm_monitor (struct GNUNET_ARM_MonitorHandle *h)
221 LOG (GNUNET_ERROR_TYPE_DEBUG, 221 LOG (GNUNET_ERROR_TYPE_DEBUG,
222 "arm_api, GNUNET_CLIENT_connect returned NULL\n"); 222 "arm_api, GNUNET_CLIENT_connect returned NULL\n");
223 if (NULL != h->service_status) 223 if (NULL != h->service_status)
224 h->service_status (h->cls, h, NULL, GNUNET_ARM_SERVICE_STOPPED); 224 h->service_status (h->cls, NULL, GNUNET_ARM_SERVICE_STOPPED);
225 return GNUNET_SYSERR; 225 return GNUNET_SYSERR;
226 } 226 }
227 LOG (GNUNET_ERROR_TYPE_DEBUG, 227 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -347,7 +347,7 @@ monitor_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
347 GNUNET_CLIENT_receive (h->monitor, &monitor_notify_handler, h, 347 GNUNET_CLIENT_receive (h->monitor, &monitor_notify_handler, h,
348 GNUNET_TIME_UNIT_FOREVER_REL); 348 GNUNET_TIME_UNIT_FOREVER_REL);
349 if (NULL != h->service_status) 349 if (NULL != h->service_status)
350 h->service_status (h->cls, h, (const char *) &res[1], status); 350 h->service_status (h->cls, (const char *) &res[1], status);
351 break; 351 break;
352 default: 352 default:
353 reconnect_arm_monitor_later (h); 353 reconnect_arm_monitor_later (h);
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c
index cfadbc87a..87d352dfb 100644
--- a/src/arm/gnunet-arm.c
+++ b/src/arm/gnunet-arm.c
@@ -258,12 +258,11 @@ static void action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *t
258 * Function called whenever we connect to or disconnect from ARM. 258 * Function called whenever we connect to or disconnect from ARM.
259 * 259 *
260 * @param cls closure 260 * @param cls closure
261 * @param arm handle to the ARM connection
262 * @param connected GNUNET_YES if connected, GNUNET_NO if disconnected, 261 * @param connected GNUNET_YES if connected, GNUNET_NO if disconnected,
263 * GNUNET_SYSERR on error. 262 * GNUNET_SYSERR on error.
264 */ 263 */
265static void 264static void
266conn_status (void *cls, struct GNUNET_ARM_Handle *arm, 265conn_status (void *cls,
267 int connected) 266 int connected)
268{ 267{
269 if (GNUNET_SYSERR == connected) 268 if (GNUNET_SYSERR == connected)
@@ -281,7 +280,7 @@ conn_status (void *cls, struct GNUNET_ARM_Handle *arm,
281 280
282 281
283static void 282static void
284term_callback (void *cls, struct GNUNET_ARM_Handle *arm, 283term_callback (void *cls,
285 enum GNUNET_ARM_RequestStatus rs, const char *service, 284 enum GNUNET_ARM_RequestStatus rs, const char *service,
286 enum GNUNET_ARM_Result result) 285 enum GNUNET_ARM_Result result)
287{ 286{
@@ -311,7 +310,7 @@ term_callback (void *cls, struct GNUNET_ARM_Handle *arm,
311} 310}
312 311
313static void 312static void
314end_callback (void *cls, struct GNUNET_ARM_Handle *arm, 313end_callback (void *cls,
315 enum GNUNET_ARM_RequestStatus rs, const char *service, 314 enum GNUNET_ARM_RequestStatus rs, const char *service,
316 enum GNUNET_ARM_Result result) 315 enum GNUNET_ARM_Result result)
317{ 316{
@@ -348,7 +347,7 @@ end_callback (void *cls, struct GNUNET_ARM_Handle *arm,
348} 347}
349 348
350static void 349static void
351start_callback (void *cls, struct GNUNET_ARM_Handle *arm, 350start_callback (void *cls,
352 enum GNUNET_ARM_RequestStatus rs, const char *service, 351 enum GNUNET_ARM_RequestStatus rs, const char *service,
353 enum GNUNET_ARM_Result result) 352 enum GNUNET_ARM_Result result)
354{ 353{
@@ -378,7 +377,7 @@ start_callback (void *cls, struct GNUNET_ARM_Handle *arm,
378 377
379 378
380static void 379static void
381init_callback (void *cls, struct GNUNET_ARM_Handle *arm, 380init_callback (void *cls,
382 enum GNUNET_ARM_RequestStatus rs, const char *service, 381 enum GNUNET_ARM_RequestStatus rs, const char *service,
383 enum GNUNET_ARM_Result result) 382 enum GNUNET_ARM_Result result)
384{ 383{
@@ -409,9 +408,9 @@ init_callback (void *cls, struct GNUNET_ARM_Handle *arm,
409 408
410 409
411static void 410static void
412list_callback (void *cls, struct GNUNET_ARM_Handle *arm, 411list_callback (void *cls,
413 enum GNUNET_ARM_RequestStatus rs, unsigned int count, 412 enum GNUNET_ARM_RequestStatus rs, unsigned int count,
414 const char *const*list) 413 const char *const*list)
415{ 414{
416 unsigned int i; 415 unsigned int i;
417 if (GNUNET_ARM_REQUEST_SENT_OK != rs) 416 if (GNUNET_ARM_REQUEST_SENT_OK != rs)
@@ -517,13 +516,12 @@ action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
517 * Function called when a service starts or stops. 516 * Function called when a service starts or stops.
518 * 517 *
519 * @param cls closure 518 * @param cls closure
520 * @param arm handle to the ARM connection
521 * @param service service name 519 * @param service service name
522 * @param status status of the service 520 * @param status status of the service
523 */ 521 */
524static void 522static void
525srv_status (void *cls, struct GNUNET_ARM_MonitorHandle *arm, 523srv_status (void *cls,
526 const char *service, enum GNUNET_ARM_ServiceStatus status) 524 const char *service, enum GNUNET_ARM_ServiceStatus status)
527{ 525{
528 const char *msg; 526 const char *msg;
529 switch (status) 527 switch (status)
diff --git a/src/arm/test_arm_api.c b/src/arm/test_arm_api.c
index 0b4baa3f8..eb769e2ac 100644
--- a/src/arm/test_arm_api.c
+++ b/src/arm/test_arm_api.c
@@ -47,7 +47,10 @@ static int ok = 1;
47static int phase = 0; 47static int phase = 0;
48 48
49static void 49static void
50arm_stop_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_RequestStatus status, const char *servicename, enum GNUNET_ARM_Result result) 50arm_stop_cb (void *cls,
51 enum GNUNET_ARM_RequestStatus status,
52 const char *servicename,
53 enum GNUNET_ARM_Result result)
51{ 54{
52 /* (6), a stop request should be sent to ARM successfully */ 55 /* (6), a stop request should be sent to ARM successfully */
53 /* ARM should report that it is stopping */ 56 /* ARM should report that it is stopping */
@@ -58,8 +61,11 @@ arm_stop_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_RequestStat
58 LOG ("Sent 'STOP' request for arm to ARM %s\n", (status == GNUNET_ARM_REQUEST_SENT_OK) ? "successfully" : "unsuccessfully"); 61 LOG ("Sent 'STOP' request for arm to ARM %s\n", (status == GNUNET_ARM_REQUEST_SENT_OK) ? "successfully" : "unsuccessfully");
59} 62}
60 63
64
61static void 65static void
62resolver_stop_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_RequestStatus status, const char *servicename, enum GNUNET_ARM_Result result) 66resolver_stop_cb (void *cls,
67 enum GNUNET_ARM_RequestStatus status,
68 const char *servicename, enum GNUNET_ARM_Result result)
63{ 69{
64 /* (5), a stop request should be sent to ARM successfully. 70 /* (5), a stop request should be sent to ARM successfully.
65 * ARM should report that resolver is stopped. 71 * ARM should report that resolver is stopped.
@@ -77,6 +83,7 @@ resolver_stop_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_Reques
77#endif 83#endif
78} 84}
79 85
86
80static void 87static void
81dns_notify (void *cls, const struct sockaddr *addr, socklen_t addrlen) 88dns_notify (void *cls, const struct sockaddr *addr, socklen_t addrlen)
82{ 89{
@@ -99,8 +106,12 @@ dns_notify (void *cls, const struct sockaddr *addr, socklen_t addrlen)
99 ok = 0; 106 ok = 0;
100} 107}
101 108
109
102static void 110static void
103resolver_start_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_RequestStatus status, const char *servicename, enum GNUNET_ARM_Result result) 111resolver_start_cb (void *cls,
112 enum GNUNET_ARM_RequestStatus status,
113 const char *servicename,
114 enum GNUNET_ARM_Result result)
104{ 115{
105 /* (2), the start request for resolver should be sent successfully 116 /* (2), the start request for resolver should be sent successfully
106 * ARM should report that resolver service is starting. 117 * ARM should report that resolver service is starting.
@@ -113,6 +124,7 @@ resolver_start_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_Reque
113 GNUNET_RESOLVER_ip_get ("localhost", AF_INET, TIMEOUT, &dns_notify, NULL); 124 GNUNET_RESOLVER_ip_get ("localhost", AF_INET, TIMEOUT, &dns_notify, NULL);
114} 125}
115 126
127
116static void 128static void
117trigger_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 129trigger_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
118{ 130{
@@ -122,7 +134,6 @@ trigger_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
122 134
123static void 135static void
124arm_conn (void *cls, 136arm_conn (void *cls,
125 struct GNUNET_ARM_Handle *arm,
126 int connected) 137 int connected)
127{ 138{
128 if (GNUNET_SYSERR == connected) 139 if (GNUNET_SYSERR == connected)
@@ -157,7 +168,6 @@ arm_conn (void *cls,
157 168
158static void 169static void
159arm_start_cb (void *cls, 170arm_start_cb (void *cls,
160 struct GNUNET_ARM_Handle *h,
161 enum GNUNET_ARM_RequestStatus status, 171 enum GNUNET_ARM_RequestStatus status,
162 const char *servicename, 172 const char *servicename,
163 enum GNUNET_ARM_Result result) 173 enum GNUNET_ARM_Result result)
diff --git a/src/arm/test_exponential_backoff.c b/src/arm/test_exponential_backoff.c
index 00402b29f..21d2c4f3e 100644
--- a/src/arm/test_exponential_backoff.c
+++ b/src/arm/test_exponential_backoff.c
@@ -284,7 +284,7 @@ trigger_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
284 284
285 285
286static void 286static void
287arm_stop_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_RequestStatus status, const char *servicename, enum GNUNET_ARM_Result result) 287arm_stop_cb (void *cls, enum GNUNET_ARM_RequestStatus status, const char *servicename, enum GNUNET_ARM_Result result)
288{ 288{
289 GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK); 289 GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK);
290 GNUNET_break (result == GNUNET_ARM_RESULT_STOPPING); 290 GNUNET_break (result == GNUNET_ARM_RESULT_STOPPING);
@@ -294,7 +294,7 @@ arm_stop_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_RequestStat
294 294
295 295
296static void 296static void
297srv_status (void *cls, struct GNUNET_ARM_MonitorHandle *mon, const char *service, enum GNUNET_ARM_ServiceStatus status) 297srv_status (void *cls, const char *service, enum GNUNET_ARM_ServiceStatus status)
298{ 298{
299 LOG ("Service %s is %u, phase %u\n", service, status, phase); 299 LOG ("Service %s is %u, phase %u\n", service, status, phase);
300 if (status == GNUNET_ARM_SERVICE_MONITORING_STARTED) 300 if (status == GNUNET_ARM_SERVICE_MONITORING_STARTED)
@@ -334,7 +334,7 @@ srv_status (void *cls, struct GNUNET_ARM_MonitorHandle *mon, const char *service
334 334
335 335
336static void 336static void
337arm_start_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_RequestStatus status, const char *servicename, enum GNUNET_ARM_Result result) 337arm_start_cb (void *cls, enum GNUNET_ARM_RequestStatus status, const char *servicename, enum GNUNET_ARM_Result result)
338{ 338{
339 GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK); 339 GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK);
340 GNUNET_break (result == GNUNET_ARM_RESULT_STARTING); 340 GNUNET_break (result == GNUNET_ARM_RESULT_STARTING);
@@ -366,7 +366,7 @@ task (void *cls, char *const *args, const char *cfgfile,
366 arm = GNUNET_ARM_connect (cfg, NULL, NULL); 366 arm = GNUNET_ARM_connect (cfg, NULL, NULL);
367 if (NULL != arm) 367 if (NULL != arm)
368 { 368 {
369 mon = GNUNET_ARM_monitor (cfg, srv_status, NULL); 369 mon = GNUNET_ARM_monitor (cfg, &srv_status, NULL);
370 if (NULL != mon) 370 if (NULL != mon)
371 { 371 {
372#if START_ARM 372#if START_ARM
diff --git a/src/arm/test_gnunet_service_arm.c b/src/arm/test_gnunet_service_arm.c
index 816bf4cfb..3bf7156a1 100644
--- a/src/arm/test_gnunet_service_arm.c
+++ b/src/arm/test_gnunet_service_arm.c
@@ -56,7 +56,6 @@ trigger_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
56 56
57static void 57static void
58arm_stop_cb (void *cls, 58arm_stop_cb (void *cls,
59 struct GNUNET_ARM_Handle *h,
60 enum GNUNET_ARM_RequestStatus status, 59 enum GNUNET_ARM_RequestStatus status,
61 const char *servicename, 60 const char *servicename,
62 enum GNUNET_ARM_Result result) 61 enum GNUNET_ARM_Result result)
@@ -70,7 +69,7 @@ arm_stop_cb (void *cls,
70 69
71 70
72static void 71static void
73service_list (void *cls, struct GNUNET_ARM_Handle *arm, 72service_list (void *cls,
74 enum GNUNET_ARM_RequestStatus rs, 73 enum GNUNET_ARM_RequestStatus rs,
75 unsigned int count, const char *const*list) 74 unsigned int count, const char *const*list)
76{ 75{
@@ -109,7 +108,6 @@ hostNameResolveCB (void *cls, const struct sockaddr *addr, socklen_t addrlen)
109 108
110static void 109static void
111arm_start_cb (void *cls, 110arm_start_cb (void *cls,
112 struct GNUNET_ARM_Handle *h,
113 enum GNUNET_ARM_RequestStatus status, 111 enum GNUNET_ARM_RequestStatus status,
114 const char *servicename, 112 const char *servicename,
115 enum GNUNET_ARM_Result result) 113 enum GNUNET_ARM_Result result)
diff --git a/src/include/gnunet_arm_service.h b/src/include/gnunet_arm_service.h
index f5fec6adb..44e47affc 100644
--- a/src/include/gnunet_arm_service.h
+++ b/src/include/gnunet_arm_service.h
@@ -181,11 +181,8 @@ struct GNUNET_ARM_Handle;
181 * @param cls closure 181 * @param cls closure
182 * @param connected GNUNET_YES if connected, GNUNET_NO if disconnected, 182 * @param connected GNUNET_YES if connected, GNUNET_NO if disconnected,
183 * GNUNET_SYSERR if there was an error. 183 * GNUNET_SYSERR if there was an error.
184 * @param error GNUNET_YES if we encountered a permanent error, and there
185 * will be no re-connection.
186 */ 184 */
187typedef void (*GNUNET_ARM_ConnectionStatusCallback) (void *cls, 185typedef void (*GNUNET_ARM_ConnectionStatusCallback) (void *cls,
188 struct GNUNET_ARM_Handle *arm,
189 int connected); 186 int connected);
190 187
191 188
@@ -196,12 +193,14 @@ typedef void (*GNUNET_ARM_ConnectionStatusCallback) (void *cls,
196 * 'rs' will indicate that, and 'service' and 'result' will be undefined. 193 * 'rs' will indicate that, and 'service' and 'result' will be undefined.
197 * 194 *
198 * @param cls closure 195 * @param cls closure
199 * @param arm handle to the arm connection
200 * @param rs status of the request 196 * @param rs status of the request
201 * @param service service name 197 * @param service service name
202 * @param result result of the operation 198 * @param result result of the operation
203 */ 199 */
204typedef void (*GNUNET_ARM_ResultCallback) (void *cls, struct GNUNET_ARM_Handle *arm, enum GNUNET_ARM_RequestStatus rs, const char *service, enum GNUNET_ARM_Result result); 200typedef void (*GNUNET_ARM_ResultCallback) (void *cls,
201 enum GNUNET_ARM_RequestStatus rs,
202 const char *service,
203 enum GNUNET_ARM_Result result);
205 204
206 205
207/** 206/**
@@ -211,12 +210,14 @@ typedef void (*GNUNET_ARM_ResultCallback) (void *cls, struct GNUNET_ARM_Handle *
211 * 'rs' will indicate that, and 'count' and 'list' will be undefined. 210 * 'rs' will indicate that, and 'count' and 'list' will be undefined.
212 * 211 *
213 * @param cls closure 212 * @param cls closure
214 * @param arm handle to the arm connection
215 * @param rs status of the request 213 * @param rs status of the request
216 * @param count number of strings in the list 214 * @param count number of strings in the list
217 * @param list list of running services 215 * @param list list of running services
218 */ 216 */
219typedef void (*GNUNET_ARM_ServiceListCallback) (void *cls, struct GNUNET_ARM_Handle *arm, enum GNUNET_ARM_RequestStatus rs, unsigned int count, const char *const*list); 217typedef void (*GNUNET_ARM_ServiceListCallback) (void *cls,
218 enum GNUNET_ARM_RequestStatus rs,
219 unsigned int count,
220 const char *const*list);
220 221
221 222
222/** 223/**
@@ -232,7 +233,8 @@ typedef void (*GNUNET_ARM_ServiceListCallback) (void *cls, struct GNUNET_ARM_Han
232 */ 233 */
233struct GNUNET_ARM_Handle * 234struct GNUNET_ARM_Handle *
234GNUNET_ARM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, 235GNUNET_ARM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
235 GNUNET_ARM_ConnectionStatusCallback conn_status, void *cls); 236 GNUNET_ARM_ConnectionStatusCallback conn_status,
237 void *cls);
236 238
237 239
238/** 240/**
@@ -254,8 +256,8 @@ GNUNET_ARM_disconnect_and_free (struct GNUNET_ARM_Handle *h);
254 */ 256 */
255void 257void
256GNUNET_ARM_request_service_list (struct GNUNET_ARM_Handle *h, 258GNUNET_ARM_request_service_list (struct GNUNET_ARM_Handle *h,
257 struct GNUNET_TIME_Relative timeout, 259 struct GNUNET_TIME_Relative timeout,
258 GNUNET_ARM_ServiceListCallback cont, void *cont_cls); 260 GNUNET_ARM_ServiceListCallback cont, void *cont_cls);
259 261
260 262
261/** 263/**
@@ -274,8 +276,9 @@ GNUNET_ARM_request_service_list (struct GNUNET_ARM_Handle *h,
274 */ 276 */
275void 277void
276GNUNET_ARM_request_service_stop (struct GNUNET_ARM_Handle *h, 278GNUNET_ARM_request_service_stop (struct GNUNET_ARM_Handle *h,
277 const char *service_name, struct GNUNET_TIME_Relative timeout, 279 const char *service_name,
278 GNUNET_ARM_ResultCallback cont, void *cont_cls); 280 struct GNUNET_TIME_Relative timeout,
281 GNUNET_ARM_ResultCallback cont, void *cont_cls);
279 282
280 283
281/** 284/**
@@ -309,7 +312,9 @@ struct GNUNET_ARM_MonitorHandle;
309 * @param service service name 312 * @param service service name
310 * @param status status of the service 313 * @param status status of the service
311 */ 314 */
312typedef void (*GNUNET_ARM_ServiceStatusCallback) (void *cls, struct GNUNET_ARM_MonitorHandle *arm, const char *service, enum GNUNET_ARM_ServiceStatus status); 315typedef void (*GNUNET_ARM_ServiceStatusCallback) (void *cls,
316 const char *service,
317 enum GNUNET_ARM_ServiceStatus status);
313 318
314 319
315/** 320/**
@@ -325,7 +330,8 @@ typedef void (*GNUNET_ARM_ServiceStatusCallback) (void *cls, struct GNUNET_ARM_M
325 */ 330 */
326struct GNUNET_ARM_MonitorHandle * 331struct GNUNET_ARM_MonitorHandle *
327GNUNET_ARM_monitor (const struct GNUNET_CONFIGURATION_Handle *cfg, 332GNUNET_ARM_monitor (const struct GNUNET_CONFIGURATION_Handle *cfg,
328 GNUNET_ARM_ServiceStatusCallback cont, void *cont_cls); 333 GNUNET_ARM_ServiceStatusCallback cont,
334 void *cont_cls);
329 335
330 336
331/** 337/**
diff --git a/src/include/gnunet_peerinfo_service.h b/src/include/gnunet_peerinfo_service.h
index 6aadba964..b428f49a4 100644
--- a/src/include/gnunet_peerinfo_service.h
+++ b/src/include/gnunet_peerinfo_service.h
@@ -163,7 +163,7 @@ struct GNUNET_PEERINFO_IteratorContext;
163 */ 163 */
164struct GNUNET_PEERINFO_IteratorContext * 164struct GNUNET_PEERINFO_IteratorContext *
165GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h, 165GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h,
166 int include_friend_only, 166 int include_friend_only,
167 const struct GNUNET_PeerIdentity *peer, 167 const struct GNUNET_PeerIdentity *peer,
168 struct GNUNET_TIME_Relative timeout, 168 struct GNUNET_TIME_Relative timeout,
169 GNUNET_PEERINFO_Processor callback, void *callback_cls); 169 GNUNET_PEERINFO_Processor callback, void *callback_cls);
@@ -203,7 +203,7 @@ struct GNUNET_PEERINFO_NotifyContext;
203 */ 203 */
204struct GNUNET_PEERINFO_NotifyContext * 204struct GNUNET_PEERINFO_NotifyContext *
205GNUNET_PEERINFO_notify (const struct GNUNET_CONFIGURATION_Handle *cfg, 205GNUNET_PEERINFO_notify (const struct GNUNET_CONFIGURATION_Handle *cfg,
206 int include_friend_only, 206 int include_friend_only,
207 GNUNET_PEERINFO_Processor callback, void *callback_cls); 207 GNUNET_PEERINFO_Processor callback, void *callback_cls);
208 208
209 209
diff --git a/src/testbed/gnunet-service-testbed_peers.c b/src/testbed/gnunet-service-testbed_peers.c
index 65cfe342c..00bfe479e 100644
--- a/src/testbed/gnunet-service-testbed_peers.c
+++ b/src/testbed/gnunet-service-testbed_peers.c
@@ -774,7 +774,7 @@ arm_ret_string (enum GNUNET_ARM_Result result)
774 * @param result result of the operation 774 * @param result result of the operation
775 */ 775 */
776static void 776static void
777service_manage_result_cb (void *cls, struct GNUNET_ARM_Handle *arm, 777service_manage_result_cb (void *cls,
778 enum GNUNET_ARM_RequestStatus rs, 778 enum GNUNET_ARM_RequestStatus rs,
779 const char *service, enum GNUNET_ARM_Result result) 779 const char *service, enum GNUNET_ARM_Result result)
780{ 780{
diff --git a/src/testing/testing.c b/src/testing/testing.c
index e75c2f1d2..909a28750 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -1207,12 +1207,11 @@ GNUNET_TESTING_peer_stop (struct GNUNET_TESTING_Peer *peer)
1207 * Function called whenever we connect to or disconnect from ARM. 1207 * Function called whenever we connect to or disconnect from ARM.
1208 * 1208 *
1209 * @param cls closure 1209 * @param cls closure
1210 * @param arm handle to the ARM connection
1211 * @param connected GNUNET_YES if connected, GNUNET_NO if disconnected, 1210 * @param connected GNUNET_YES if connected, GNUNET_NO if disconnected,
1212 * GNUNET_SYSERR on error. 1211 * GNUNET_SYSERR on error.
1213 */ 1212 */
1214static void 1213static void
1215disconn_status (void *cls, struct GNUNET_ARM_Handle *arm, 1214disconn_status (void *cls,
1216 int connected) 1215 int connected)
1217{ 1216{
1218 struct GNUNET_TESTING_Peer *peer = cls; 1217 struct GNUNET_TESTING_Peer *peer = cls;