/*
This file is part of GNUnet.
- (C) 2009 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2009 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier timeout_endbadly;
+static struct GNUNET_SCHEDULER_Task * timeout_endbadly;
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier timeout_wait;
+static struct GNUNET_SCHEDULER_Task * timeout_wait;
/**
* Library name
int c = 0;
ok = 0;
- if (GNUNET_SCHEDULER_NO_TASK != timeout_endbadly)
+ if (NULL != timeout_endbadly)
{
GNUNET_SCHEDULER_cancel (timeout_endbadly);
- timeout_endbadly = GNUNET_SCHEDULER_NO_TASK;
+ timeout_endbadly = NULL;
}
if (NULL != api)
GNUNET_PLUGIN_unload (libname, api);
struct AddressWrapper *w;
int c = 0;
- timeout_endbadly = GNUNET_SCHEDULER_NO_TASK;
- if (GNUNET_SCHEDULER_NO_TASK != timeout_wait)
+ timeout_endbadly = NULL;
+ if (NULL != timeout_wait)
{
GNUNET_SCHEDULER_cancel (timeout_wait);
- timeout_wait = GNUNET_SCHEDULER_NO_TASK;
+ timeout_wait = NULL;
}
if (pretty_printers_running > 0)
static void
wait_end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- timeout_wait = GNUNET_SCHEDULER_NO_TASK;
+ timeout_wait = NULL;
if (0 == addresses_reported)
GNUNET_log(GNUNET_ERROR_TYPE_WARNING,
"Plugin did not report any addresses, could not check address conversion functions\n");
static void
end_badly_now ()
{
- if (GNUNET_SCHEDULER_NO_TASK != timeout_wait)
+ if (NULL != timeout_wait)
{
GNUNET_SCHEDULER_cancel (timeout_wait);
- timeout_wait = GNUNET_SCHEDULER_NO_TASK;
+ timeout_wait = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != timeout_endbadly)
+ if (NULL != timeout_endbadly)
{
GNUNET_SCHEDULER_cancel (timeout_endbadly);
- timeout_endbadly = GNUNET_SCHEDULER_NO_TASK;
+ timeout_endbadly = NULL;
}
timeout_endbadly = GNUNET_SCHEDULER_add_now (&end_badly, NULL );
}
GNUNET_CONTAINER_DLL_insert(head, tail, w);
got_reply = GNUNET_NO;
GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Testing: address_to_string \n");
- w->addrstring = strdup (
+ w->addrstring = GNUNET_strdup (
api->address_to_string (api, w->address->address,
w->address->address_length));
if (NULL == w->addrstring)
end_badly_now ();
return;
}
- if (GNUNET_SCHEDULER_NO_TASK != timeout_wait)
+ if (NULL != timeout_wait)
{
GNUNET_SCHEDULER_cancel (timeout_wait);
- timeout_wait = GNUNET_SCHEDULER_NO_TASK;
+ timeout_wait = NULL;
}
timeout_wait = GNUNET_SCHEDULER_add_delayed (WAIT, &wait_end, NULL );
}
-static struct GNUNET_ATS_Information
-env_get_address_type (void *cls, const struct sockaddr *addr, size_t addrlen)
+static enum GNUNET_ATS_Network_Type
+env_get_address_type (void *cls,
+ const struct sockaddr *addr,
+ size_t addrlen)
{
- struct GNUNET_ATS_Information ats;
- ats.type = htonl (GNUNET_ATS_NETWORK_TYPE);
- ats.value = htonl (GNUNET_ATS_NET_LOOPBACK);
- return ats;
+ return GNUNET_ATS_NET_LOOPBACK;
}