gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 01/03: DHTU: Startin moving into dht again as compiled-in plugi


From: gnunet
Subject: [gnunet] 01/03: DHTU: Startin moving into dht again as compiled-in plugins
Date: Fri, 23 Feb 2024 19:05:17 +0100

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

commit 34119af6252ef848e5eb954aaea6e92b707737d6
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Fri Feb 23 18:30:39 2024 +0100

    DHTU: Startin moving into dht again as compiled-in plugins
---
 src/service/dht/gnunet-service-dht.c           | 16 +++++++++++-----
 src/service/{dhtu => dht}/plugin_dhtu_gnunet.c |  7 ++++---
 src/service/{dhtu => dht}/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,
   u->env.connect_cb = &GDS_u_connect;
   u->env.disconnect_cb = &GDS_u_disconnect;
   u->env.receive_cb = &GDS_u_receive;
-  GNUNET_asprintf (&libname,
-                   "libgnunet_plugin_dhtu_%s",
-                   section);
-  u->dhtu = GNUNET_PLUGIN_load (libname,
-                                &u->env);
+
+  /** NOTE: This is not pretty, but it allows us to avoid
+      dynamically loading plugins **/
+  if (0 == strcmp (section, "gnunet"))
+  {
+    u->dhtu = DHTU_gnunet_init (cfg);
+  }
+  else if (0 == strcmp (section, "ip"))
+  {
+    u->dhtu = DHTU_ip_init (cfg);
+  }
   if (NULL == u->dhtu)
   {
     GNUNET_free (libname);
diff --git a/src/service/dhtu/plugin_dhtu_gnunet.c 
b/src/service/dht/plugin_dhtu_gnunet.c
similarity index 99%
rename from src/service/dhtu/plugin_dhtu_gnunet.c
rename to 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 @@
 #include "gnunet_hello_uri_lib.h"
 #include "gnunet_peerstore_service.h"
 #include "gnunet_nse_service.h"
+#include "plugin_dhtu_gnunet.h"
 
 /**
  * Opaque handle that the underlay offers for our address to be used when
@@ -546,7 +547,7 @@ nse_cb (void *cls,
  * @return NULL
  */
 void *
-libgnunet_plugin_dhtu_gnunet_done (void *cls)
+DHTU_gnunet_done (void *cls)
 {
   struct GNUNET_DHTU_PluginFunctions *api = cls;
   struct Plugin *plugin = api->cls;
@@ -580,7 +581,7 @@ libgnunet_plugin_dhtu_gnunet_done (void *cls)
  * @return the plugin's API
  */
 void *
-libgnunet_plugin_dhtu_gnunet_init (void *cls)
+DHTU_gnunet_init (void *cls)
 {
   struct GNUNET_DHTU_PluginEnvironment *env = cls;
   struct GNUNET_DHTU_PluginFunctions *api;
@@ -620,7 +621,7 @@ libgnunet_plugin_dhtu_gnunet_init (void *cls)
   {
     GNUNET_break (0);
     GNUNET_free (api);
-    libgnunet_plugin_dhtu_gnunet_done (plugin);
+    DHTU_gnunet_done (plugin);
     return NULL;
   }
   // GPI_plugins_load (env->cfg);
diff --git a/src/service/dhtu/plugin_dhtu_ip.c 
b/src/service/dht/plugin_dhtu_ip.c
similarity index 100%
rename from src/service/dhtu/plugin_dhtu_ip.c
rename to src/service/dht/plugin_dhtu_ip.c

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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