/*
This file is part of GNUnet.
- (C) 2001-2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2001-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.
*/
/**
* Task run during shutdown.
*
* @param cls unused
- * @param tc unused
*/
static void
-shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_task (void *cls)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutting down\n");
shutting_down = GNUNET_YES;
GML_shutdown ();
- GMH_shutdown ();
- GMC_shutdown ();
- GMT_shutdown ();
- GMD_shutdown ();
- GMP_shutdown ();
+ GCH_shutdown ();
+ GCC_shutdown ();
+ GCT_shutdown ();
+ GCD_shutdown ();
+ GCP_shutdown ();
GNUNET_STATISTICS_destroy (stats, GNUNET_NO);
stats = NULL;
stats = GNUNET_STATISTICS_create ("cadet", c);
/* Scheduled the task to clean up when shutdown is called */
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
- NULL);
+ GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+ NULL);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "reading key\n");
my_private_key = GNUNET_CRYPTO_eddsa_key_create_from_configuration (c);
GNUNET_assert (NULL != my_private_key);
GNUNET_CRYPTO_eddsa_key_get_public (my_private_key, &my_full_id.public_key);
myid = GNUNET_PEER_intern (&my_full_id);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "STARTING SERVICE (CADET) for peer [%s]\n",
+ "STARTING SERVICE (cadet) for peer [%s]\n",
GNUNET_i2s (&my_full_id));
GML_init (server); /* Local clients */
- GMH_init (c); /* Hellos */
- GMC_init (c); /* Connections */
- GMP_init (c); /* Peers */
- GMD_init (c); /* DHT */
- GMT_init (c, my_private_key); /* Tunnels */
+ GCH_init (c); /* Hellos */
+ GCC_init (c); /* Connections */
+ GCP_init (c); /* Peers */
+ GCD_init (c); /* DHT */
+ GCT_init (c, my_private_key); /* Tunnels */
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Cadet service running\n");
}
int
main (int argc, char *const *argv)
{
- int ret;
int r;
shutting_down = GNUNET_NO;
r = GNUNET_SERVICE_run (argc, argv, "cadet", GNUNET_SERVICE_OPTION_NONE, &run,
NULL);
GNUNET_free (my_private_key);
- ret = (GNUNET_OK == r) ? 0 : 1;
- return ret;
+ if (GNUNET_OK != r)
+ {
+ FPRINTF (stderr, "GNUNET_SERVICE_run for CADET has failed!\n");
+ return 1;
+ }
+
+ return 0;
}