aboutsummaryrefslogtreecommitdiff
path: root/src/multicast
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2016-09-23 14:26:55 +0000
committerGabor X Toth <*@tg-x.net>2016-09-23 14:26:55 +0000
commit451fd32170103921993d876d765a8755ce737a0b (patch)
treead41cd960f7f8b0f80d9967332ffc0a85e9cb0c1 /src/multicast
parent3e872864741aaa83be947b614eafb4fef2c74253 (diff)
downloadgnunet-451fd32170103921993d876d765a8755ce737a0b.tar.gz
gnunet-451fd32170103921993d876d765a8755ce737a0b.zip
multicast,psyc,social: remove core dependencny
Diffstat (limited to 'src/multicast')
-rw-r--r--src/multicast/Makefile.am7
-rw-r--r--src/multicast/gnunet-service-multicast.c46
-rw-r--r--src/multicast/test_multicast.c23
-rw-r--r--src/multicast/test_multicast_multipeer.c1
4 files changed, 18 insertions, 59 deletions
diff --git a/src/multicast/Makefile.am b/src/multicast/Makefile.am
index 64c0bfe1d..b1f422765 100644
--- a/src/multicast/Makefile.am
+++ b/src/multicast/Makefile.am
@@ -45,7 +45,6 @@ gnunet_service_multicast_SOURCES = \
45 gnunet-service-multicast.c 45 gnunet-service-multicast.c
46gnunet_service_multicast_LDADD = \ 46gnunet_service_multicast_LDADD = \
47 $(top_builddir)/src/util/libgnunetutil.la \ 47 $(top_builddir)/src/util/libgnunetutil.la \
48 $(top_builddir)/src/core/libgnunetcore.la \
49 $(top_builddir)/src/cadet/libgnunetcadet.la \ 48 $(top_builddir)/src/cadet/libgnunetcadet.la \
50 $(top_builddir)/src/statistics/libgnunetstatistics.la \ 49 $(top_builddir)/src/statistics/libgnunetstatistics.la \
51 $(GN_LIBINTL) 50 $(GN_LIBINTL)
@@ -65,13 +64,11 @@ test_multicast_SOURCES = \
65test_multicast_LDADD = \ 64test_multicast_LDADD = \
66 libgnunetmulticast.la \ 65 libgnunetmulticast.la \
67 $(top_builddir)/src/testing/libgnunettesting.la \ 66 $(top_builddir)/src/testing/libgnunettesting.la \
68 $(top_builddir)/src/util/libgnunetutil.la \ 67 $(top_builddir)/src/util/libgnunetutil.la
69 $(top_builddir)/src/core/libgnunetcore.la
70 68
71test_multicast_multipeer_SOURCE = \ 69test_multicast_multipeer_SOURCE = \
72 test_multicast_multipeer.c 70 test_multicast_multipeer.c
73test_multicast_multipeer_LDADD = \ 71test_multicast_multipeer_LDADD = \
74 libgnunetmulticast.la \ 72 libgnunetmulticast.la \
75 $(top_builddir)/src/testbed/libgnunettestbed.la \ 73 $(top_builddir)/src/testbed/libgnunettestbed.la \
76 $(top_builddir)/src/util/libgnunetutil.la \ 74 $(top_builddir)/src/util/libgnunetutil.la
77 $(top_builddir)/src/core/libgnunetcore.la
diff --git a/src/multicast/gnunet-service-multicast.c b/src/multicast/gnunet-service-multicast.c
index af530e27a..5f8b1cdb6 100644
--- a/src/multicast/gnunet-service-multicast.c
+++ b/src/multicast/gnunet-service-multicast.c
@@ -28,7 +28,6 @@
28#include "gnunet_signatures.h" 28#include "gnunet_signatures.h"
29#include "gnunet_applications.h" 29#include "gnunet_applications.h"
30#include "gnunet_statistics_service.h" 30#include "gnunet_statistics_service.h"
31#include "gnunet_core_service.h"
32#include "gnunet_cadet_service.h" 31#include "gnunet_cadet_service.h"
33#include "gnunet_multicast_service.h" 32#include "gnunet_multicast_service.h"
34#include "multicast.h" 33#include "multicast.h"
@@ -44,12 +43,6 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
44static struct GNUNET_SERVER_Handle *server; 43static struct GNUNET_SERVER_Handle *server;
45 44
46/** 45/**
47 * Core handle.
48 * Only used during initialization.
49 */
50static struct GNUNET_CORE_Handle *core;
51
52/**
53 * CADET handle. 46 * CADET handle.
54 */ 47 */
55static struct GNUNET_CADET_Handle *cadet; 48static struct GNUNET_CADET_Handle *cadet;
@@ -341,11 +334,6 @@ struct ReplayRequestKey
341static void 334static void
342shutdown_task (void *cls) 335shutdown_task (void *cls)
343{ 336{
344 if (NULL != core)
345 {
346 GNUNET_CORE_disconnecT (core);
347 core = NULL;
348 }
349 if (NULL != cadet) 337 if (NULL != cadet)
350 { 338 {
351 GNUNET_CADET_disconnect (cadet); 339 GNUNET_CADET_disconnect (cadet);
@@ -1846,12 +1834,21 @@ static const struct GNUNET_CADET_MessageHandler cadet_handlers[] = {
1846 1834
1847 1835
1848/** 1836/**
1849 * Connected to core service. 1837 * Service started.
1838 *
1839 * @param cls closure
1840 * @param server the initialized server
1841 * @param cfg configuration to use
1850 */ 1842 */
1851static void 1843static void
1852core_connected_cb (void *cls, const struct GNUNET_PeerIdentity *my_identity) 1844run (void *cls,
1845 struct GNUNET_SERVER_Handle *srv,
1846 const struct GNUNET_CONFIGURATION_Handle *c)
1853{ 1847{
1854 this_peer = *my_identity; 1848 cfg = c;
1849 server = srv;
1850 GNUNET_SERVER_connect_notify (server, &client_notify_connect, NULL);
1851 GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer);
1855 1852
1856 stats = GNUNET_STATISTICS_create ("multicast", cfg); 1853 stats = GNUNET_STATISTICS_create ("multicast", cfg);
1857 origins = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_YES); 1854 origins = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_YES);
@@ -1877,25 +1874,6 @@ core_connected_cb (void *cls, const struct GNUNET_PeerIdentity *my_identity)
1877 1874
1878 1875
1879/** 1876/**
1880 * Service started.
1881 *
1882 * @param cls closure
1883 * @param server the initialized server
1884 * @param cfg configuration to use
1885 */
1886static void
1887run (void *cls,
1888 struct GNUNET_SERVER_Handle *srv,
1889 const struct GNUNET_CONFIGURATION_Handle *c)
1890{
1891 cfg = c;
1892 server = srv;
1893 GNUNET_SERVER_connect_notify (server, &client_notify_connect, NULL);
1894 core = GNUNET_CORE_connecT (cfg, NULL, &core_connected_cb, NULL, NULL, NULL);
1895}
1896
1897
1898/**
1899 * The main function for the multicast service. 1877 * The main function for the multicast service.
1900 * 1878 *
1901 * @param argc number of arguments from the command line 1879 * @param argc number of arguments from the command line
diff --git a/src/multicast/test_multicast.c b/src/multicast/test_multicast.c
index 44c62f677..1e3a4922b 100644
--- a/src/multicast/test_multicast.c
+++ b/src/multicast/test_multicast.c
@@ -31,7 +31,6 @@
31#include "gnunet_common.h" 31#include "gnunet_common.h"
32#include "gnunet_util_lib.h" 32#include "gnunet_util_lib.h"
33#include "gnunet_testing_lib.h" 33#include "gnunet_testing_lib.h"
34#include "gnunet_core_service.h"
35#include "gnunet_multicast_service.h" 34#include "gnunet_multicast_service.h"
36 35
37#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) 36#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
@@ -48,7 +47,6 @@ static struct GNUNET_SCHEDULER_Task * end_badly_task;
48 47
49static const struct GNUNET_CONFIGURATION_Handle *cfg; 48static const struct GNUNET_CONFIGURATION_Handle *cfg;
50 49
51struct GNUNET_CORE_Handle *core;
52struct GNUNET_PeerIdentity this_peer; 50struct GNUNET_PeerIdentity this_peer;
53 51
54struct GNUNET_MULTICAST_Origin *origin; 52struct GNUNET_MULTICAST_Origin *origin;
@@ -110,11 +108,6 @@ member_join (int t);
110static void 108static void
111cleanup () 109cleanup ()
112{ 110{
113 if (NULL != core)
114 {
115 GNUNET_CORE_disconnecT (core);
116 core = NULL;
117 }
118 if (NULL != member) 111 if (NULL != member)
119 { 112 {
120 GNUNET_MULTICAST_member_part (member, NULL, NULL); 113 GNUNET_MULTICAST_member_part (member, NULL, NULL);
@@ -705,16 +698,6 @@ origin_start ()
705} 698}
706 699
707 700
708static void
709core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity)
710{
711 this_peer = *my_identity;
712
713 // Test 1 starts here
714 origin_start ();
715}
716
717
718/** 701/**
719 * Main function of the test, run from scheduler. 702 * Main function of the test, run from scheduler.
720 * 703 *
@@ -737,8 +720,10 @@ run (void *cls,
737 cfg = c; 720 cfg = c;
738 end_badly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, 721 end_badly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
739 &end_badly, NULL); 722 &end_badly, NULL);
740 core = GNUNET_CORE_connecT (cfg, NULL, 723 GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer);
741 &core_connected, NULL, NULL, NULL); 724
725 // Test 1 starts here
726 origin_start ();
742} 727}
743 728
744 729
diff --git a/src/multicast/test_multicast_multipeer.c b/src/multicast/test_multicast_multipeer.c
index 2e8b9818d..3edf0153e 100644
--- a/src/multicast/test_multicast_multipeer.c
+++ b/src/multicast/test_multicast_multipeer.c
@@ -31,7 +31,6 @@
31#include "gnunet_common.h" 31#include "gnunet_common.h"
32#include "gnunet_util_lib.h" 32#include "gnunet_util_lib.h"
33#include "gnunet_testbed_service.h" 33#include "gnunet_testbed_service.h"
34#include "gnunet_core_service.h"
35#include "gnunet_multicast_service.h" 34#include "gnunet_multicast_service.h"
36 35
37#define NUM_PEERS 2 36#define NUM_PEERS 2