aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2024-02-23 18:30:39 +0100
committerMartin Schanzenbach <schanzen@gnunet.org>2024-02-23 18:32:08 +0100
commit34119af6252ef848e5eb954aaea6e92b707737d6 (patch)
tree0cd5cb14ff387cec44ae287de4663b1d4421de13 /src
parent7cba908122425b8584eb927c5c58be8e32790dae (diff)
downloadgnunet-34119af6252ef848e5eb954aaea6e92b707737d6.tar.gz
gnunet-34119af6252ef848e5eb954aaea6e92b707737d6.zip
DHTU: Startin moving into dht again as compiled-in plugins
Diffstat (limited to 'src')
-rw-r--r--src/service/dht/gnunet-service-dht.c16
-rw-r--r--src/service/dht/plugin_dhtu_gnunet.c (renamed from src/service/dhtu/plugin_dhtu_gnunet.c)7
-rw-r--r--src/service/dht/plugin_dhtu_ip.c (renamed from src/service/dhtu/plugin_dhtu_ip.c)0
3 files changed, 15 insertions, 8 deletions
diff --git a/src/service/dht/gnunet-service-dht.c b/src/service/dht/gnunet-service-dht.c
index fcf83b0bc..4fd68e70c 100644
--- a/src/service/dht/gnunet-service-dht.c
+++ b/src/service/dht/gnunet-service-dht.c
@@ -453,11 +453,17 @@ load_underlay (void *cls,
453 u->env.connect_cb = &GDS_u_connect; 453 u->env.connect_cb = &GDS_u_connect;
454 u->env.disconnect_cb = &GDS_u_disconnect; 454 u->env.disconnect_cb = &GDS_u_disconnect;
455 u->env.receive_cb = &GDS_u_receive; 455 u->env.receive_cb = &GDS_u_receive;
456 GNUNET_asprintf (&libname, 456
457 "libgnunet_plugin_dhtu_%s", 457 /** NOTE: This is not pretty, but it allows us to avoid
458 section); 458 dynamically loading plugins **/
459 u->dhtu = GNUNET_PLUGIN_load (libname, 459 if (0 == strcmp (section, "gnunet"))
460 &u->env); 460 {
461 u->dhtu = DHTU_gnunet_init (cfg);
462 }
463 else if (0 == strcmp (section, "ip"))
464 {
465 u->dhtu = DHTU_ip_init (cfg);
466 }
461 if (NULL == u->dhtu) 467 if (NULL == u->dhtu)
462 { 468 {
463 GNUNET_free (libname); 469 GNUNET_free (libname);
diff --git a/src/service/dhtu/plugin_dhtu_gnunet.c b/src/service/dht/plugin_dhtu_gnunet.c
index 826c33527..1314f789a 100644
--- a/src/service/dhtu/plugin_dhtu_gnunet.c
+++ b/src/service/dht/plugin_dhtu_gnunet.c
@@ -31,6 +31,7 @@
31#include "gnunet_hello_uri_lib.h" 31#include "gnunet_hello_uri_lib.h"
32#include "gnunet_peerstore_service.h" 32#include "gnunet_peerstore_service.h"
33#include "gnunet_nse_service.h" 33#include "gnunet_nse_service.h"
34#include "plugin_dhtu_gnunet.h"
34 35
35/** 36/**
36 * Opaque handle that the underlay offers for our address to be used when 37 * Opaque handle that the underlay offers for our address to be used when
@@ -546,7 +547,7 @@ nse_cb (void *cls,
546 * @return NULL 547 * @return NULL
547 */ 548 */
548void * 549void *
549libgnunet_plugin_dhtu_gnunet_done (void *cls) 550DHTU_gnunet_done (void *cls)
550{ 551{
551 struct GNUNET_DHTU_PluginFunctions *api = cls; 552 struct GNUNET_DHTU_PluginFunctions *api = cls;
552 struct Plugin *plugin = api->cls; 553 struct Plugin *plugin = api->cls;
@@ -580,7 +581,7 @@ libgnunet_plugin_dhtu_gnunet_done (void *cls)
580 * @return the plugin's API 581 * @return the plugin's API
581 */ 582 */
582void * 583void *
583libgnunet_plugin_dhtu_gnunet_init (void *cls) 584DHTU_gnunet_init (void *cls)
584{ 585{
585 struct GNUNET_DHTU_PluginEnvironment *env = cls; 586 struct GNUNET_DHTU_PluginEnvironment *env = cls;
586 struct GNUNET_DHTU_PluginFunctions *api; 587 struct GNUNET_DHTU_PluginFunctions *api;
@@ -620,7 +621,7 @@ libgnunet_plugin_dhtu_gnunet_init (void *cls)
620 { 621 {
621 GNUNET_break (0); 622 GNUNET_break (0);
622 GNUNET_free (api); 623 GNUNET_free (api);
623 libgnunet_plugin_dhtu_gnunet_done (plugin); 624 DHTU_gnunet_done (plugin);
624 return NULL; 625 return NULL;
625 } 626 }
626 // GPI_plugins_load (env->cfg); 627 // GPI_plugins_load (env->cfg);
diff --git a/src/service/dhtu/plugin_dhtu_ip.c b/src/service/dht/plugin_dhtu_ip.c
index 06d0f0f60..06d0f0f60 100644
--- a/src/service/dhtu/plugin_dhtu_ip.c
+++ b/src/service/dht/plugin_dhtu_ip.c