diff options
author | Gabor X Toth <*@tg-x.net> | 2016-09-23 14:26:55 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2016-09-23 14:26:55 +0000 |
commit | 451fd32170103921993d876d765a8755ce737a0b (patch) | |
tree | ad41cd960f7f8b0f80d9967332ffc0a85e9cb0c1 /src/multicast | |
parent | 3e872864741aaa83be947b614eafb4fef2c74253 (diff) | |
download | gnunet-451fd32170103921993d876d765a8755ce737a0b.tar.gz gnunet-451fd32170103921993d876d765a8755ce737a0b.zip |
multicast,psyc,social: remove core dependencny
Diffstat (limited to 'src/multicast')
-rw-r--r-- | src/multicast/Makefile.am | 7 | ||||
-rw-r--r-- | src/multicast/gnunet-service-multicast.c | 46 | ||||
-rw-r--r-- | src/multicast/test_multicast.c | 23 | ||||
-rw-r--r-- | src/multicast/test_multicast_multipeer.c | 1 |
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 |
46 | gnunet_service_multicast_LDADD = \ | 46 | gnunet_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 = \ | |||
65 | test_multicast_LDADD = \ | 64 | test_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 | ||
71 | test_multicast_multipeer_SOURCE = \ | 69 | test_multicast_multipeer_SOURCE = \ |
72 | test_multicast_multipeer.c | 70 | test_multicast_multipeer.c |
73 | test_multicast_multipeer_LDADD = \ | 71 | test_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; | |||
44 | static struct GNUNET_SERVER_Handle *server; | 43 | static struct GNUNET_SERVER_Handle *server; |
45 | 44 | ||
46 | /** | 45 | /** |
47 | * Core handle. | ||
48 | * Only used during initialization. | ||
49 | */ | ||
50 | static struct GNUNET_CORE_Handle *core; | ||
51 | |||
52 | /** | ||
53 | * CADET handle. | 46 | * CADET handle. |
54 | */ | 47 | */ |
55 | static struct GNUNET_CADET_Handle *cadet; | 48 | static struct GNUNET_CADET_Handle *cadet; |
@@ -341,11 +334,6 @@ struct ReplayRequestKey | |||
341 | static void | 334 | static void |
342 | shutdown_task (void *cls) | 335 | shutdown_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 | */ |
1851 | static void | 1843 | static void |
1852 | core_connected_cb (void *cls, const struct GNUNET_PeerIdentity *my_identity) | 1844 | run (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 | */ | ||
1886 | static void | ||
1887 | run (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 | ||
49 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | 48 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
50 | 49 | ||
51 | struct GNUNET_CORE_Handle *core; | ||
52 | struct GNUNET_PeerIdentity this_peer; | 50 | struct GNUNET_PeerIdentity this_peer; |
53 | 51 | ||
54 | struct GNUNET_MULTICAST_Origin *origin; | 52 | struct GNUNET_MULTICAST_Origin *origin; |
@@ -110,11 +108,6 @@ member_join (int t); | |||
110 | static void | 108 | static void |
111 | cleanup () | 109 | cleanup () |
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 | ||
708 | static void | ||
709 | core_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 |