gnunet-service-multicast.c
gnunet_service_multicast_LDADD = \
$(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/core/libgnunetcore.la \
$(top_builddir)/src/cadet/libgnunetcadet.la \
$(top_builddir)/src/statistics/libgnunetstatistics.la \
$(GN_LIBINTL)
test_multicast_LDADD = \
libgnunetmulticast.la \
$(top_builddir)/src/testing/libgnunettesting.la \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/core/libgnunetcore.la
+ $(top_builddir)/src/util/libgnunetutil.la
test_multicast_multipeer_SOURCE = \
test_multicast_multipeer.c
test_multicast_multipeer_LDADD = \
libgnunetmulticast.la \
$(top_builddir)/src/testbed/libgnunettestbed.la \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/core/libgnunetcore.la
+ $(top_builddir)/src/util/libgnunetutil.la
#include "gnunet_signatures.h"
#include "gnunet_applications.h"
#include "gnunet_statistics_service.h"
-#include "gnunet_core_service.h"
#include "gnunet_cadet_service.h"
#include "gnunet_multicast_service.h"
#include "multicast.h"
*/
static struct GNUNET_SERVER_Handle *server;
-/**
- * Core handle.
- * Only used during initialization.
- */
-static struct GNUNET_CORE_Handle *core;
-
/**
* CADET handle.
*/
static void
shutdown_task (void *cls)
{
- if (NULL != core)
- {
- GNUNET_CORE_disconnecT (core);
- core = NULL;
- }
if (NULL != cadet)
{
GNUNET_CADET_disconnect (cadet);
/**
- * Connected to core service.
+ * Service started.
+ *
+ * @param cls closure
+ * @param server the initialized server
+ * @param cfg configuration to use
*/
static void
-core_connected_cb (void *cls, const struct GNUNET_PeerIdentity *my_identity)
+run (void *cls,
+ struct GNUNET_SERVER_Handle *srv,
+ const struct GNUNET_CONFIGURATION_Handle *c)
{
- this_peer = *my_identity;
+ cfg = c;
+ server = srv;
+ GNUNET_SERVER_connect_notify (server, &client_notify_connect, NULL);
+ GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer);
stats = GNUNET_STATISTICS_create ("multicast", cfg);
origins = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_YES);
}
-/**
- * Service started.
- *
- * @param cls closure
- * @param server the initialized server
- * @param cfg configuration to use
- */
-static void
-run (void *cls,
- struct GNUNET_SERVER_Handle *srv,
- const struct GNUNET_CONFIGURATION_Handle *c)
-{
- cfg = c;
- server = srv;
- GNUNET_SERVER_connect_notify (server, &client_notify_connect, NULL);
- core = GNUNET_CORE_connecT (cfg, NULL, &core_connected_cb, NULL, NULL, NULL);
-}
-
-
/**
* The main function for the multicast service.
*
#include "gnunet_common.h"
#include "gnunet_util_lib.h"
#include "gnunet_testing_lib.h"
-#include "gnunet_core_service.h"
#include "gnunet_multicast_service.h"
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
static const struct GNUNET_CONFIGURATION_Handle *cfg;
-struct GNUNET_CORE_Handle *core;
struct GNUNET_PeerIdentity this_peer;
struct GNUNET_MULTICAST_Origin *origin;
static void
cleanup ()
{
- if (NULL != core)
- {
- GNUNET_CORE_disconnecT (core);
- core = NULL;
- }
if (NULL != member)
{
GNUNET_MULTICAST_member_part (member, NULL, NULL);
}
-static void
-core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity)
-{
- this_peer = *my_identity;
-
- // Test 1 starts here
- origin_start ();
-}
-
-
/**
* Main function of the test, run from scheduler.
*
cfg = c;
end_badly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
&end_badly, NULL);
- core = GNUNET_CORE_connecT (cfg, NULL,
- &core_connected, NULL, NULL, NULL);
+ GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer);
+
+ // Test 1 starts here
+ origin_start ();
}
#include "gnunet_common.h"
#include "gnunet_util_lib.h"
#include "gnunet_testbed_service.h"
-#include "gnunet_core_service.h"
#include "gnunet_multicast_service.h"
#define NUM_PEERS 2
libgnunetpsyc.la \
$(top_builddir)/src/psycutil/libgnunetpsycutil.la \
$(top_builddir)/src/testing/libgnunettesting.la \
- $(top_builddir)/src/core/libgnunetcore.la \
$(top_builddir)/src/util/libgnunetutil.la
EXTRA_DIST = \
#include "gnunet_testing_lib.h"
#include "gnunet_psyc_util_lib.h"
#include "gnunet_psyc_service.h"
-#include "gnunet_core_service.h"
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
static const struct GNUNET_CONFIGURATION_Handle *cfg;
-static struct GNUNET_CORE_Handle *core;
static struct GNUNET_PeerIdentity this_peer;
/**
static void
cleanup ()
{
- if (NULL != core)
- {
- GNUNET_CORE_disconnecT (core);
- core = NULL;
- }
if (NULL != slv)
{
GNUNET_PSYC_slave_part (slv, GNUNET_NO, &slave_parted, NULL);
}
-static void
-core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity)
-{
- this_peer = *my_identity;
-
-#if DEBUG_TEST_PSYC
- master_start ();
-#else
- /* Allow some time for the services to initialize. */
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
- &schedule_master_start, NULL);
-#endif
-
-}
-
/**
* Main function of the test, run from scheduler.
*
cfg = c;
end_badly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
+ GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer);
+
channel_key = GNUNET_CRYPTO_eddsa_key_create ();
slave_key = GNUNET_CRYPTO_ecdsa_key_create ();
GNUNET_CRYPTO_eddsa_key_get_public (channel_key, &channel_pub_key);
GNUNET_CRYPTO_ecdsa_key_get_public (slave_key, &slave_pub_key);
- core = GNUNET_CORE_connecT (cfg, NULL, &core_connected, NULL, NULL, NULL);
+#if DEBUG_TEST_PSYC
+ master_start ();
+#else
+ /* Allow some time for the services to initialize. */
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
+ &schedule_master_start, NULL);
+#endif
}
gnunet_social_LDADD = \
libgnunetsocial.la \
$(top_builddir)/src/psycutil/libgnunetpsycutil.la \
- $(top_builddir)/src/core/libgnunetcore.la \
$(top_builddir)/src/util/libgnunetutil.la
gnunet_service_social_SOURCES = \
$(top_builddir)/src/statistics/libgnunetstatistics.la \
$(top_builddir)/src/psycutil/libgnunetpsycutil.la \
$(top_builddir)/src/psyc/libgnunetpsyc.la \
- $(top_builddir)/src/core/libgnunetcore.la \
$(top_builddir)/src/identity/libgnunetidentity.la \
$(top_builddir)/src/gns/libgnunetgns.la \
$(top_builddir)/src/namestore/libgnunetnamestore.la \
$(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/util/libgnunetutil.la \
$(top_builddir)/src/psycutil/libgnunetpsycutil.la \
- $(top_builddir)/src/core/libgnunetcore.la \
$(top_builddir)/src/identity/libgnunetidentity.la
EXTRA_DIST = \
#include "gnunet_util_lib.h"
#include "gnunet_constants.h"
#include "gnunet_protocols.h"
-#include "gnunet_core_service.h"
#include "gnunet_identity_service.h"
#include "gnunet_namestore_service.h"
#include "gnunet_gns_service.h"
static const struct GNUNET_CONFIGURATION_Handle *cfg;
/* Handles to other services */
-static struct GNUNET_CORE_Handle *core;
static struct GNUNET_IDENTITY_Handle *id;
static struct GNUNET_GNS_Handle *gns;
static struct GNUNET_NAMESTORE_Handle *namestore;
GNUNET_SERVER_notification_context_destroy (nc);
nc = NULL;
}
- if (NULL != core)
- {
- GNUNET_CORE_disconnecT (core);
- core = NULL;
- }
if (NULL != id)
{
GNUNET_IDENTITY_disconnect (id);
}
-/**
- * Connected to core service.
- */
-static void
-core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity)
-{
- this_peer = *my_identity;
-}
-
-
/**
* Initialize the PSYC service.
*
const struct GNUNET_CONFIGURATION_Handle *c)
{
cfg = c;
+ GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer);
hosts = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_YES);
guests = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_YES);
apps_places = GNUNET_CONTAINER_multihashmap_create(1, GNUNET_NO);
places_apps = GNUNET_CONTAINER_multihashmap_create(1, GNUNET_NO);
- core = GNUNET_CORE_connecT (cfg, NULL, core_connected, NULL, NULL, NULL);
id = GNUNET_IDENTITY_connect (cfg, &identity_recv_ego, NULL);
gns = GNUNET_GNS_connect (cfg);
namestore = GNUNET_NAMESTORE_connect (cfg);
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_social_service.h"
-#include "gnunet_core_service.h"
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
const struct GNUNET_CONFIGURATION_Handle *cfg;
-struct GNUNET_CORE_Handle *core;
struct GNUNET_PeerIdentity peer, this_peer;
struct GNUNET_SOCIAL_App *app;
static void
app_connect (void *cls)
{
- GNUNET_CORE_disconnecT (core);
- core = NULL;
-
app = GNUNET_SOCIAL_app_connect (cfg, opt_app,
app_recv_ego,
app_recv_host,
}
-/* CORE */
-
-
-static void
-core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity)
-{
- this_peer = *my_identity;
- GNUNET_SCHEDULER_add_now (app_connect, NULL);
-}
-
-
-/* RUN */
-
-
/**
* Main function run by the scheduler.
*
const struct GNUNET_CONFIGURATION_Handle *c)
{
cfg = c;
+ GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer);
if (!opt_method)
opt_method = "message";
}
}
- core = GNUNET_CORE_connecT (cfg, NULL, &core_connected, NULL, NULL, NULL);
+ GNUNET_SCHEDULER_add_now (app_connect, NULL);
}
#include "gnunet_testing_lib.h"
#include "gnunet_psyc_util_lib.h"
#include "gnunet_social_service.h"
-#include "gnunet_core_service.h"
#include "gnunet_identity_service.h"
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
const struct GNUNET_CONFIGURATION_Handle *cfg;
-struct GNUNET_CORE_Handle *core;
struct GNUNET_PeerIdentity this_peer;
struct GNUNET_IDENTITY_Handle *id;
static void
cleanup ()
{
- if (NULL != core)
- {
- GNUNET_CORE_disconnecT (core);
- core = NULL;
- }
-
if (NULL != id)
{
GNUNET_IDENTITY_disconnect (id);
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Test #%u: App connected: %p\n", test, cls);
- if (NULL != core)
- {
- GNUNET_CORE_disconnecT (core);
- core = NULL;
- }
}
}
-static void
-core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity)
-{
- this_peer = *my_identity;
- id = GNUNET_IDENTITY_connect (cfg, &identity_ego_cb, NULL);
-
- test = TEST_HOST_CREATE;
- GNUNET_IDENTITY_create (id, host_name, &id_host_created, NULL);
-}
-
-
/**
* Main function of the test, run from scheduler.
*
end_badly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
&end_badly, NULL);
- core = GNUNET_CORE_connecT (cfg, NULL, &core_connected, NULL, NULL, NULL);
+ GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer);
+
+ id = GNUNET_IDENTITY_connect (cfg, &identity_ego_cb, NULL);
+
+ test = TEST_HOST_CREATE;
+ GNUNET_IDENTITY_create (id, host_name, &id_host_created, NULL);
}