[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: - moving cmds to other packages
From: |
gnunet |
Subject: |
[gnunet] branch master updated: - moving cmds to other packages |
Date: |
Fri, 23 Jul 2021 13:36:01 +0200 |
This is an automated email from the git hooks/post-receive script.
t3sserakt pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new c96fdfad6 - moving cmds to other packages
new ee1893503 Merge branch 'master' of ssh://gnunet.org/gnunet
c96fdfad6 is described below
commit c96fdfad67a3eed8ca61b9e228b81f3a85a3b2c5
Author: t3sserakt <t3ss@posteo.de>
AuthorDate: Fri Jul 23 13:31:34 2021 +0200
- moving cmds to other packages
---
src/include/gnunet_testing_ng_lib.h | 13 ++++----
src/include/gnunet_transport_application_service.h | 9 +++++
src/include/gnunet_transport_service.h | 14 ++++++++
src/testbed/gnunet-cmd.c | 2 +-
src/transport/Makefile.am | 5 +--
src/transport/plugin_cmd_simple_send.c | 38 +++++++++++++++-------
src/transport/transport_api_cmd_connecting_peers.c | 11 ++++---
src/transport/transport_api_cmd_start_peer.c | 23 ++++++-------
8 files changed, 77 insertions(+), 38 deletions(-)
diff --git a/src/include/gnunet_testing_ng_lib.h
b/src/include/gnunet_testing_ng_lib.h
index 994ce31f1..08bc63aae 100644
--- a/src/include/gnunet_testing_ng_lib.h
+++ b/src/include/gnunet_testing_ng_lib.h
@@ -29,7 +29,6 @@
#include "gnunet_util_lib.h"
#include "gnunet_testing_plugin.h"
-#include "gnunet_transport_application_service.h"
#include "gnunet_testing_lib.h"
@@ -833,12 +832,7 @@ int
GNUNET_TESTING_get_trait_what_am_i (const struct GNUNET_TESTING_Command *cmd,
char **what_am_i);
-int
-GNUNET_TESTING_get_trait_application_handle (const struct
- GNUNET_TESTING_Command *cmd,
- struct
- GNUNET_TRANSPORT_ApplicationHandle
- **ah);
+
int
GNUNET_TESTING_get_trait_peer_id (const struct
@@ -868,4 +862,9 @@ int
GNUNET_TESTING_get_trait_test_system (const struct
GNUNET_TESTING_Command *cmd,
struct GNUNET_TESTING_System
**test_system);
+
+struct GNUNET_TESTING_Command
+GNUNET_TESTING_cmd_system_create (const char *label,
+ const char *testdir);
+
#endif
diff --git a/src/include/gnunet_transport_application_service.h
b/src/include/gnunet_transport_application_service.h
index 35585d954..0562e2183 100644
--- a/src/include/gnunet_transport_application_service.h
+++ b/src/include/gnunet_transport_application_service.h
@@ -35,6 +35,8 @@
#include "gnunet_constants.h"
#include "gnunet_util_lib.h"
#include "gnunet_nt_lib.h"
+#include "gnunet_testing_lib.h"
+#include "gnunet_testing_ng_lib.h"
/**
* Handle to the TRANSPORT subsystem for making suggestions about
@@ -114,6 +116,13 @@ GNUNET_TRANSPORT_application_validate (
enum GNUNET_NetworkType nt,
const char *addr);
+int
+GNUNET_TRANSPORT_get_trait_application_handle (const struct
+ GNUNET_TESTING_Command *cmd,
+ struct
+
GNUNET_TRANSPORT_ApplicationHandle
+ **ah);
+
/** @} */ /* end of group */
#endif
diff --git a/src/include/gnunet_transport_service.h
b/src/include/gnunet_transport_service.h
index d190eff92..97dfda1ec 100644
--- a/src/include/gnunet_transport_service.h
+++ b/src/include/gnunet_transport_service.h
@@ -686,6 +686,20 @@ GNUNET_TRANSPORT_core_get_mq (struct
GNUNET_TRANSPORT_CoreHandle *handle,
const struct GNUNET_PeerIdentity *peer);
+struct GNUNET_TESTING_Command
+GNUNET_TRANSPORT_cmd_start_peer (const char *label,
+ const char *system_label,
+ char *m,
+ char *n,
+ struct GNUNET_MQ_MessageHandler *handlers,
+ const char *cfgname);
+
+struct GNUNET_TESTING_Command
+GNUNET_TRANSPORT_cmd_connect_peers (const char *label,
+ const char *peer1_label,
+ const char *peer2_label);
+
+
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
diff --git a/src/testbed/gnunet-cmd.c b/src/testbed/gnunet-cmd.c
index 7889750ba..f232bd805 100644
--- a/src/testbed/gnunet-cmd.c
+++ b/src/testbed/gnunet-cmd.c
@@ -90,7 +90,7 @@ run (void *cls)
strcat (node_ip, NODE_BASE_IP);
strcat (node_ip, plugin->n);
- plugin->api->start_testcase (NULL, router_ip, node_ip);
+ plugin->api->start_testcase (NULL, router_ip, node_ip, NULL, NULL);
}
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index 9f680ad3b..255a7973f 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -398,15 +398,16 @@ plugin_LTLIBRARIES = \
$(HTTPS_SERVER_PLUGIN_LA) \
$(WLAN_PLUGIN_LA) \
$(BT_PLUGIN_LA)
- # libgnunet_plugin_simple_send.la
+# libgnunet_plugin_cmd_simple_send.la
# libgnunet_plugin_cmd_simple_send_la_SOURCES = \
-# plugin_cmd_simple_send.c
+# plugin_cmd_simple_send.c
# libgnunet_plugin_cmd_simple_send_la_LIBADD = \
# $(top_builddir)/src/util/libgnunetutil.la \
# $(top_builddir)/src/testing/libgnunettesting.la \
# $(top_builddir)/src/statistics/libgnunetstatistics.la \
# $(top_builddir)/src/testbed/libgnunettestbed.la \
+# libgnunettransport.la \
# $(LTLIBINTL)
# libgnunet_plugin_cmd_simple_send_la_LDFLAGS = \
# $(GN_PLUGIN_LDFLAGS)
diff --git a/src/transport/plugin_cmd_simple_send.c
b/src/transport/plugin_cmd_simple_send.c
index ed3481c00..1fa2f1f03 100644
--- a/src/transport/plugin_cmd_simple_send.c
+++ b/src/transport/plugin_cmd_simple_send.c
@@ -26,8 +26,9 @@
#include "platform.h"
#include "gnunet_testing_ng_lib.h"
#include "gnunet_util_lib.h"
+#include "gnunet_transport_application_service.h"
+#include "gnunet_transport_service.h"
#include "gnunet_testbed_ng_service.h"
-
/**
* Generic logging shortcut
*/
@@ -35,6 +36,20 @@
#define BASE_DIR "testdir"
+struct GNUNET_MQ_MessageHandler *handlers;
+
+const char *cfgname;
+
+unsigned int are_all_peers_started;
+
+static void
+all_peers_started ()
+{
+ are_all_peers_started = GNUNET_YES;
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ "setting are_all_peers_started: %d\n",
+ are_all_peers_started);
+}
static void
start_testcase (TESTBED_CMD_HELPER_write_cb write_message, char *router_ip,
@@ -42,10 +57,9 @@ start_testcase (TESTBED_CMD_HELPER_write_cb write_message,
char *router_ip,
char *m,
char *n)
{
- struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get ();
char *testdir;
- testdir = GNUNET_malloc (strlen (basedir) + strlen (m) + strlen (n)
+ testdir = GNUNET_malloc (strlen (BASE_DIR) + strlen (m) + strlen (n)
+ 1);
strcpy (testdir, BASE_DIR);
@@ -55,19 +69,19 @@ start_testcase (TESTBED_CMD_HELPER_write_cb write_message,
char *router_ip,
struct GNUNET_TESTING_Command commands[] = {
GNUNET_TESTING_cmd_system_create ("system-create-1",
testdir),
- GNUNET_TESTING_cmd_start_peer ("start-peer-1",
- "system-create-1",
- m,
- n,
- struct GNUNET_MQ_MessageHandler *handlers,
- const char *cfgname),
+ /*GNUNET_TRANSPORT_cmd_start_peer ("start-peer-1",
+ "system-create-1",
+ m,
+ n,
+ handlers,
+ cfgname),*/
GNUNET_TESTING_cmd_send_peer_ready ("send-peer-ready-1",
write_message),
GNUNET_TESTING_cmd_block_until_all_peers_started ("block-1",
&are_all_peers_started),
- GNUNET_TESTING_cmd_connect_peers ("connect-peers-1",
- "start-peer-1",
- "this is useless"),
+ /*GNUNET_TRANSPORT_cmd_connect_peers ("connect-peers-1",
+ "start-peer-1",
+ "this is useless"),*/
/*GNUNET_TESTING_cmd_send_simple ("send-simple-1",
char *m,
char *n,
diff --git a/src/transport/transport_api_cmd_connecting_peers.c
b/src/transport/transport_api_cmd_connecting_peers.c
index 297b90864..06e2b8d61 100644
--- a/src/transport/transport_api_cmd_connecting_peers.c
+++ b/src/transport/transport_api_cmd_connecting_peers.c
@@ -28,6 +28,7 @@
#include "gnunet_testing_ng_lib.h"
#include "gnunet_transport_application_service.h"
#include "gnunet_hello_lib.h"
+#include "gnunet_transport_service.h"
/**
* Generic logging shortcut
@@ -59,8 +60,8 @@ connect_peers_run (void *cls,
enum GNUNET_NetworkType nt = 0;
peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (cps->peer1_label);
- GNUNET_TESTING_get_trait_application_handle (peer1_cmd,
- &ah);
+ GNUNET_TRANSPORT_get_trait_application_handle (peer1_cmd,
+ &ah);
GNUNET_TESTING_get_trait_hello (peer1_cmd,
&hello);
@@ -154,9 +155,9 @@ connect_peers_cleanup (void *cls,
* @return command.
*/
struct GNUNET_TESTING_Command
-GNUNET_TESTING_cmd_connect_peers (const char *label,
- const char *peer1_label,
- const char *peer2_label)
+GNUNET_TRANSPORT_cmd_connect_peers (const char *label,
+ const char *peer1_label,
+ const char *peer2_label)
{
struct ConnectPeersState *cps;
diff --git a/src/transport/transport_api_cmd_start_peer.c
b/src/transport/transport_api_cmd_start_peer.c
index 4077b7561..0ad9f99af 100644
--- a/src/transport/transport_api_cmd_start_peer.c
+++ b/src/transport/transport_api_cmd_start_peer.c
@@ -28,6 +28,7 @@
#include "gnunet_testing_ng_lib.h"
#include "gnunet_peerstore_service.h"
#include "gnunet_transport_core_service.h"
+#include "gnunet_transport_application_service.h"
/**
* Generic logging shortcut
@@ -483,11 +484,11 @@ GNUNET_TESTING_get_trait_connected_peers_map (const struct
int
-GNUNET_TESTING_get_trait_application_handle (const struct
- GNUNET_TESTING_Command *cmd,
- struct
- GNUNET_TRANSPORT_ApplicationHandle
- **ah)
+GNUNET_TRANSPORT_get_trait_application_handle (const struct
+ GNUNET_TESTING_Command *cmd,
+ struct
+
GNUNET_TRANSPORT_ApplicationHandle
+ **ah)
{
return cmd->traits (cmd->cls,
(const void **) ah,
@@ -515,12 +516,12 @@ GNUNET_TESTING_get_trait_peer_id (const struct
* @return command.
*/
struct GNUNET_TESTING_Command
-GNUNET_TESTING_cmd_start_peer (const char *label,
- const char *system_label,
- char *m,
- char *n,
- struct GNUNET_MQ_MessageHandler *handlers,
- const char *cfgname)
+GNUNET_TRANSPORT_cmd_start_peer (const char *label,
+ const char *system_label,
+ char *m,
+ char *n,
+ struct GNUNET_MQ_MessageHandler *handlers,
+ const char *cfgname)
{
struct StartPeerState *sps;
struct GNUNET_CONTAINER_MultiPeerMap *connected_peers_map =
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: - moving cmds to other packages,
gnunet <=