/*
This file is part of GNUnet.
- (C) 2008--2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2008--2013 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
/**
* The timeout task
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* The id of the operation which created this context
/**
* Task id for the task to call notifications from the notification list
*/
- GNUNET_SCHEDULER_TaskIdentifier notify_task;
+ struct GNUNET_SCHEDULER_Task * notify_task;
/**
* How many references are present currently to this neighbour's connection
/**
* Task to be run upon timeout
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* The notification handle associated with the neighbour's connection request
/**
* The lcf_task handle
*/
-static GNUNET_SCHEDULER_TaskIdentifier lcf_proc_task_id;
+static struct GNUNET_SCHEDULER_Task * lcf_proc_task_id;
/**
* The size of the route list
* The Link Controller forwarding task
*
* @param cls the LCFContext
- * @param tc the Task context from scheduler
*/
static void
-lcf_proc_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+lcf_proc_task (void *cls);
/**
{
struct LCFContext *lcf = cls;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id);
+ GNUNET_assert (NULL == lcf_proc_task_id);
switch (lcf->state)
{
case INIT:
* The Link Controller forwarding task
*
* @param cls the LCFContext
- * @param tc the Task context from scheduler
*/
static void
-lcf_proc_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+lcf_proc_task (void *cls);
/**
* Task to free resources when forwarded link controllers has been timedout
*
* @param cls the LCFContext
- * @param tc the task context from scheduler
*/
static void
-lcf_forwarded_operation_timeout (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+lcf_forwarded_operation_timeout (void *cls)
{
struct LCFContext *lcf = cls;
- lcf->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ lcf->timeout_task = NULL;
// GST_forwarded_operation_timeout (lcf->fopc, tc);
LOG (GNUNET_ERROR_TYPE_WARNING,
"A forwarded controller link operation has timed out\n");
send_controller_link_response (lcf->client, lcf->operation_id, NULL,
"A forwarded controller link operation has "
"timed out\n");
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id);
+ GNUNET_assert (NULL == lcf_proc_task_id);
lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf);
}
* The Link Controller forwarding task
*
* @param cls the LCFContext
- * @param tc the Task context from scheduler
*/
static void
-lcf_proc_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+lcf_proc_task (void *cls)
{
struct LCFContext *lcf = cls;
struct LCFContextQueue *lcfq;
- lcf_proc_task_id = GNUNET_SCHEDULER_NO_TASK;
+ lcf_proc_task_id = NULL;
switch (lcf->state)
{
case INIT:
GNUNET_TESTBED_operation_done (lcf->op);
lcf->op = NULL;
GNUNET_assert (FINISHED == lcf->state);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != lcf->timeout_task);
+ GNUNET_assert (NULL != lcf->timeout_task);
GNUNET_SCHEDULER_cancel (lcf->timeout_task);
if (NULL == event->details.operation_finished.emsg)
send_controller_link_response (lcf->client, lcf->operation_id,
send_controller_link_response (lcf->client, lcf->operation_id,
NULL,
event->details.operation_finished.emsg);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id);
+ GNUNET_assert (NULL == lcf_proc_task_id);
lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf);
return;
}
* neighbour
*
* @param cls the neighbour
- * @param tc scheduler task context
*/
static void
-neighbour_connect_notify_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+neighbour_connect_notify_task (void *cls)
{
struct Neighbour *n = cls;
struct NeighbourConnectNotification *h;
GNUNET_assert (NULL != (h = n->nl_head));
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != n->notify_task);
- n->notify_task = GNUNET_SCHEDULER_NO_TASK;
+ GNUNET_assert (NULL != n->notify_task);
+ n->notify_task = NULL;
GNUNET_assert (NULL != n->controller);
GNUNET_CONTAINER_DLL_remove (n->nl_head, n->nl_tail, h);
trigger_notifications (n);
return;
if (NULL == n->controller)
return;
- if (GNUNET_SCHEDULER_NO_TASK != n->notify_task)
+ if (NULL != n->notify_task)
return;
if (1 == n->inactive)
{
struct Neighbour *n = cls;
GNUNET_assert (0 == n->reference_cnt);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == n->notify_task);
+ GNUNET_assert (NULL == n->notify_task);
GNUNET_assert (NULL == n->nl_head);
if (NULL != n->controller)
{
GNUNET_free (h);
if (GNUNET_NO == cleanup_task)
return;
- if (GNUNET_SCHEDULER_NO_TASK == n->notify_task)
+ if (NULL == n->notify_task)
return;
GNUNET_assert (0 < n->reference_cnt);
n->reference_cnt--;
GNUNET_SCHEDULER_cancel (n->notify_task);
- n->notify_task = GNUNET_SCHEDULER_NO_TASK;
+ n->notify_task = NULL;
if (NULL == n->nl_head)
{
if ( (0 == n->reference_cnt) && (0 == n->inactive) )
{
if (NULL != ncc->nh)
GST_neighbour_get_connection_cancel (ncc->nh);
- if (GNUNET_SCHEDULER_NO_TASK != ncc->timeout_task)
+ if (NULL != ncc->timeout_task)
GNUNET_SCHEDULER_cancel (ncc->timeout_task);
GNUNET_SERVER_client_drop (ncc->client);
GNUNET_CONTAINER_DLL_remove (ncc_head, ncc_tail, ncc);
* Task to be run upon timeout while attempting to connect to the neighbour
*
* @param cls the NeighbourConnectCtxt created in GST_handle_link_controllers()
- * @param tc the scheduler task context
*/
static void
-timeout_neighbour_connect (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+timeout_neighbour_connect (void *cls)
{
struct NeighbourConnectCtxt *ncc = cls;
- ncc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ ncc->timeout_task = NULL;
send_controller_link_response (ncc->client, ncc->op_id, NULL,
"Could not connect to delegated controller");
cleanup_ncc (ncc);
struct NeighbourConnectCtxt *ncc = cls;
GNUNET_SCHEDULER_cancel (ncc->timeout_task);
- ncc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ ncc->timeout_task = NULL;
ncc->nh = NULL;
GST_neighbour_release_connection (ncc->n);
send_controller_link_response (ncc->client, ncc->op_id, NULL, NULL);
lcfq->lcf->client = client;
if (NULL == lcfq_head)
{
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id);
+ GNUNET_assert (NULL == lcf_proc_task_id);
GNUNET_CONTAINER_DLL_insert_tail (lcfq_head, lcfq_tail, lcfq);
lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcfq->lcf);
}
if (NULL != lcfq_head)
{
- if (GNUNET_SCHEDULER_NO_TASK != lcf_proc_task_id)
+ if (NULL != lcf_proc_task_id)
{
GNUNET_SCHEDULER_cancel (lcf_proc_task_id);
- lcf_proc_task_id = GNUNET_SCHEDULER_NO_TASK;
+ lcf_proc_task_id = NULL;
}
}
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id);
+ GNUNET_assert (NULL == lcf_proc_task_id);
for (lcfq = lcfq_head; NULL != lcfq; lcfq = lcfq_head)
{
lcf = lcfq->lcf;
GNUNET_SERVER_client_drop (lcf->client);
if (NULL != lcf->op)
GNUNET_TESTBED_operation_done (lcf->op);
- if (GNUNET_SCHEDULER_NO_TASK != lcf->timeout_task)
+ if (NULL != lcf->timeout_task)
GNUNET_SCHEDULER_cancel (lcf->timeout_task);
GNUNET_free (lcf);
GNUNET_CONTAINER_DLL_remove (lcfq_head, lcfq_tail, lcfq);