gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r37989 - in gnunet/src: multicast psyc social


From: gnunet
Subject: [GNUnet-SVN] r37989 - in gnunet/src: multicast psyc social
Date: Fri, 23 Sep 2016 16:26:56 +0200

Author: tg
Date: 2016-09-23 16:26:55 +0200 (Fri, 23 Sep 2016)
New Revision: 37989

Modified:
   gnunet/src/multicast/Makefile.am
   gnunet/src/multicast/gnunet-service-multicast.c
   gnunet/src/multicast/test_multicast.c
   gnunet/src/multicast/test_multicast_multipeer.c
   gnunet/src/psyc/Makefile.am
   gnunet/src/psyc/test_psyc.c
   gnunet/src/social/Makefile.am
   gnunet/src/social/gnunet-service-social.c
   gnunet/src/social/gnunet-social.c
   gnunet/src/social/test_social.c
Log:
multicast,psyc,social: remove core dependencny

Modified: gnunet/src/multicast/Makefile.am
===================================================================
--- gnunet/src/multicast/Makefile.am    2016-09-23 14:19:36 UTC (rev 37988)
+++ gnunet/src/multicast/Makefile.am    2016-09-23 14:26:55 UTC (rev 37989)
@@ -45,7 +45,6 @@
  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)
@@ -65,8 +64,7 @@
 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
@@ -73,5 +71,4 @@
 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

Modified: gnunet/src/multicast/gnunet-service-multicast.c
===================================================================
--- gnunet/src/multicast/gnunet-service-multicast.c     2016-09-23 14:19:36 UTC 
(rev 37988)
+++ gnunet/src/multicast/gnunet-service-multicast.c     2016-09-23 14:26:55 UTC 
(rev 37989)
@@ -28,7 +28,6 @@
 #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"
@@ -44,12 +43,6 @@
 static struct GNUNET_SERVER_Handle *server;
 
 /**
- * Core handle.
- * Only used during initialization.
- */
-static struct GNUNET_CORE_Handle *core;
-
-/**
  * CADET handle.
  */
 static struct GNUNET_CADET_Handle *cadet;
@@ -341,11 +334,6 @@
 static void
 shutdown_task (void *cls)
 {
-  if (NULL != core)
-  {
-    GNUNET_CORE_disconnecT (core);
-    core = NULL;
-  }
   if (NULL != cadet)
   {
     GNUNET_CADET_disconnect (cadet);
@@ -1846,12 +1834,21 @@
 
 
 /**
- * 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);
@@ -1877,25 +1874,6 @@
 
 
 /**
- * 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.
  *
  * @param argc number of arguments from the command line

Modified: gnunet/src/multicast/test_multicast.c
===================================================================
--- gnunet/src/multicast/test_multicast.c       2016-09-23 14:19:36 UTC (rev 
37988)
+++ gnunet/src/multicast/test_multicast.c       2016-09-23 14:26:55 UTC (rev 
37989)
@@ -31,7 +31,6 @@
 #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)
@@ -48,7 +47,6 @@
 
 static const struct GNUNET_CONFIGURATION_Handle *cfg;
 
-struct GNUNET_CORE_Handle *core;
 struct GNUNET_PeerIdentity this_peer;
 
 struct GNUNET_MULTICAST_Origin *origin;
@@ -110,11 +108,6 @@
 static void
 cleanup ()
 {
-  if (NULL != core)
-  {
-    GNUNET_CORE_disconnecT (core);
-    core = NULL;
-  }
   if (NULL != member)
   {
     GNUNET_MULTICAST_member_part (member, NULL, NULL);
@@ -705,16 +698,6 @@
 }
 
 
-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.
  *
@@ -737,8 +720,10 @@
   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 ();
 }
 
 

Modified: gnunet/src/multicast/test_multicast_multipeer.c
===================================================================
--- gnunet/src/multicast/test_multicast_multipeer.c     2016-09-23 14:19:36 UTC 
(rev 37988)
+++ gnunet/src/multicast/test_multicast_multipeer.c     2016-09-23 14:26:55 UTC 
(rev 37989)
@@ -31,7 +31,6 @@
 #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

Modified: gnunet/src/psyc/Makefile.am
===================================================================
--- gnunet/src/psyc/Makefile.am 2016-09-23 14:19:36 UTC (rev 37988)
+++ gnunet/src/psyc/Makefile.am 2016-09-23 14:26:55 UTC (rev 37989)
@@ -63,7 +63,6 @@
   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 = \

Modified: gnunet/src/psyc/test_psyc.c
===================================================================
--- gnunet/src/psyc/test_psyc.c 2016-09-23 14:19:36 UTC (rev 37988)
+++ gnunet/src/psyc/test_psyc.c 2016-09-23 14:26:55 UTC (rev 37989)
@@ -34,7 +34,6 @@
 #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)
 
@@ -45,7 +44,6 @@
 
 static const struct GNUNET_CONFIGURATION_Handle *cfg;
 
-static struct GNUNET_CORE_Handle *core;
 static struct GNUNET_PeerIdentity this_peer;
 
 /**
@@ -143,11 +141,6 @@
 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);
@@ -951,21 +944,6 @@
 }
 
 
-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.
  *
@@ -986,6 +964,8 @@
   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 ();
 
@@ -992,7 +972,13 @@
   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
 }
 
 

Modified: gnunet/src/social/Makefile.am
===================================================================
--- gnunet/src/social/Makefile.am       2016-09-23 14:19:36 UTC (rev 37988)
+++ gnunet/src/social/Makefile.am       2016-09-23 14:26:55 UTC (rev 37989)
@@ -41,7 +41,6 @@
 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 = \
@@ -51,7 +50,6 @@
   $(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 \
@@ -75,7 +73,6 @@
   $(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 = \

Modified: gnunet/src/social/gnunet-service-social.c
===================================================================
--- gnunet/src/social/gnunet-service-social.c   2016-09-23 14:19:36 UTC (rev 
37988)
+++ gnunet/src/social/gnunet-service-social.c   2016-09-23 14:26:55 UTC (rev 
37989)
@@ -31,7 +31,6 @@
 #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"
@@ -48,7 +47,6 @@
 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;
@@ -454,11 +452,6 @@
     GNUNET_SERVER_notification_context_destroy (nc);
     nc = NULL;
   }
-  if (NULL != core)
-  {
-    GNUNET_CORE_disconnecT (core);
-    core = NULL;
-  }
   if (NULL != id)
   {
     GNUNET_IDENTITY_disconnect (id);
@@ -3468,16 +3461,6 @@
 
 
 /**
- * Connected to core service.
- */
-static void
-core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity)
-{
-  this_peer = *my_identity;
-}
-
-
-/**
  * Initialize the PSYC service.
  *
  * @param cls Closure.
@@ -3489,6 +3472,7 @@
      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);
@@ -3500,7 +3484,6 @@
   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);

Modified: gnunet/src/social/gnunet-social.c
===================================================================
--- gnunet/src/social/gnunet-social.c   2016-09-23 14:19:36 UTC (rev 37988)
+++ gnunet/src/social/gnunet-social.c   2016-09-23 14:26:55 UTC (rev 37989)
@@ -29,7 +29,6 @@
 #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)
 
@@ -139,7 +138,6 @@
 
 const struct GNUNET_CONFIGURATION_Handle *cfg;
 
-struct GNUNET_CORE_Handle *core;
 struct GNUNET_PeerIdentity peer, this_peer;
 
 struct GNUNET_SOCIAL_App *app;
@@ -1086,9 +1084,6 @@
 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,
@@ -1098,20 +1093,6 @@
 }
 
 
-/* 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.
  *
@@ -1125,6 +1106,7 @@
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
   cfg = c;
+  GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer);
 
   if (!opt_method)
     opt_method = "message";
@@ -1181,7 +1163,7 @@
     }
   }
 
-  core = GNUNET_CORE_connecT (cfg, NULL, &core_connected, NULL, NULL, NULL);
+  GNUNET_SCHEDULER_add_now (app_connect, NULL);
 }
 
 

Modified: gnunet/src/social/test_social.c
===================================================================
--- gnunet/src/social/test_social.c     2016-09-23 14:19:36 UTC (rev 37988)
+++ gnunet/src/social/test_social.c     2016-09-23 14:26:55 UTC (rev 37989)
@@ -32,7 +32,6 @@
 #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)
@@ -54,7 +53,6 @@
 
 const struct GNUNET_CONFIGURATION_Handle *cfg;
 
-struct GNUNET_CORE_Handle *core;
 struct GNUNET_PeerIdentity this_peer;
 
 struct GNUNET_IDENTITY_Handle *id;
@@ -185,12 +183,6 @@
 static void
 cleanup ()
 {
-  if (NULL != core)
-  {
-    GNUNET_CORE_disconnecT (core);
-    core = NULL;
-  }
-
   if (NULL != id)
   {
     GNUNET_IDENTITY_disconnect (id);
@@ -406,11 +398,6 @@
 {
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Test #%u: App connected: %p\n", test, cls);
-  if (NULL != core)
-  {
-    GNUNET_CORE_disconnecT (core);
-    core = NULL;
-  }
 }
 
 
@@ -1314,17 +1301,6 @@
 }
 
 
-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.
  *
@@ -1346,7 +1322,12 @@
   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);
 }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]