* @brief testcase for arm_api.c
*/
#include "platform.h"
-#include "gnunet_common.h"
+#include "gnunet_util_lib.h"
#include "gnunet_arm_service.h"
-#include "gnunet_client_lib.h"
-#include "gnunet_configuration_lib.h"
-#include "gnunet_getopt_lib.h"
-#include "gnunet_program_lib.h"
#include "gnunet_resolver_service.h"
#define LOG(...) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__)
static int phase = 0;
static void
-arm_stop_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_RequestStatus status, const char *servicename, enum GNUNET_ARM_Result result)
+arm_stop_cb (void *cls,
+ enum GNUNET_ARM_RequestStatus status,
+ const char *servicename,
+ enum GNUNET_ARM_Result result)
{
/* (6), a stop request should be sent to ARM successfully */
/* ARM should report that it is stopping */
GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK);
- GNUNET_break (result == GNUNET_ARM_RESULT_STOPPING);
+ GNUNET_break (result == GNUNET_ARM_RESULT_STOPPED);
GNUNET_break (phase == 6);
phase++;
LOG ("Sent 'STOP' request for arm to ARM %s\n", (status == GNUNET_ARM_REQUEST_SENT_OK) ? "successfully" : "unsuccessfully");
}
+
static void
-resolver_stop_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_RequestStatus status, const char *servicename, enum GNUNET_ARM_Result result)
+resolver_stop_cb (void *cls,
+ enum GNUNET_ARM_RequestStatus status,
+ const char *servicename, enum GNUNET_ARM_Result result)
{
/* (5), a stop request should be sent to ARM successfully.
* ARM should report that resolver is stopped.
#endif
}
+
static void
dns_notify (void *cls, const struct sockaddr *addr, socklen_t addrlen)
{
ok = 0;
}
+
static void
-resolver_start_cb (void *cls, struct GNUNET_ARM_Handle *h, enum GNUNET_ARM_RequestStatus status, const char *servicename, enum GNUNET_ARM_Result result)
+resolver_start_cb (void *cls,
+ enum GNUNET_ARM_RequestStatus status,
+ const char *servicename,
+ enum GNUNET_ARM_Result result)
{
/* (2), the start request for resolver should be sent successfully
* ARM should report that resolver service is starting.
GNUNET_RESOLVER_ip_get ("localhost", AF_INET, TIMEOUT, &dns_notify, NULL);
}
+
static void
trigger_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
static void
arm_conn (void *cls,
- struct GNUNET_ARM_Handle *arm,
int connected)
{
if (GNUNET_SYSERR == connected)
}
-static void
-srv_status (void *cls, const char *service, enum GNUNET_ARM_ServiceStatus status)
-{
- LOG ("Service %s is %u\n", service, status);
- switch (phase)
- {
- default:
- LOG ("Unexpectedly got status %u for service %s\n", status,
- service);
- GNUNET_break (0);
- ok = 2;
-#if START_ARM
- GNUNET_ARM_request_service_stop (arm, "arm", TIMEOUT, NULL, NULL);
-#endif
- }
-}
-
-
static void
arm_start_cb (void *cls,
- struct GNUNET_ARM_Handle *h,
enum GNUNET_ARM_RequestStatus status,
const char *servicename,
enum GNUNET_ARM_Result result)