GNUnet  0.11.x
gnunet_testbed_ng_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2021 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
35 #ifndef GNUNET_TESTBED_NG_SERVICE_H
36 #define GNUNET_TESTBED_NG_SERVICE_H
37 
38 #include "gnunet_util_lib.h"
39 #include "gnunet_testing_ng_lib.h"
40 
41 struct TngState;
42 
44 {
48  const char *controller_label;
49 
54 
58  const char *hostname;
59 
63  const char *username;
64 
68  uint16_t port;
69 
76 
81 
86 
91 
96 
101 
106 };
107 
109 {
116  const char *trusted_ip;
117 
121  const char *hostname;
122 
126  const char *username;
127 
131  uint16_t port;
132 
139 
144 
149 
154 
158  uint64_t event_mask;
159 
164 
169 
174 
179 
184 };
185 
193 int
195  struct GNUNET_TESTBED_Controller **
196  controller);
197 
200  const char *host,
201  uint64_t event_mask);
202 
203 void
205 
206 void
208 
209 void
211 
221  char *local_m,
222  char *global_n);
223 
224 
234  char *local_m,
235  char *global_n,
236  char *plugin_name);
237 
238 
248  char *local_m,
249  char *global_n);
250 
251 
254  const char *helper_start_label,
255  char *local_m,
256  char *global_n);
257 
258 
259 int
262  struct GNUNET_HELPER_Handle ***helper);
263 
264 
265 int
266 GNUNET_TESTBED_get_trait_hosts (const struct
268  struct GNUNET_TESTBED_Host ***hosts);
269 
272  unsigned int *
274 
278 
282  write_message);
283 
284 #endif
void(* TESTBED_CMD_HELPER_write_cb)(struct GNUNET_MessageHeader *message, size_t msg_length)
struct GNUNET_TESTBED_Peer * peer
Peer to start.
struct GNUNET_TESTING_Interpreter * is
Interpreter state.
Handle to interact with a GNUnet testbed controller.
Definition: testbed_api.h:197
struct GNUNET_TESTING_Command GNUNET_TESTBED_cmd_controller(const char *label, const char *host, uint64_t event_mask)
int GNUNET_TESTBED_get_trait_controller(const struct GNUNET_TESTING_Command *cmd, struct GNUNET_TESTBED_Controller **controller)
Offer data from trait.
int peer_going_down
Flag indicating controller is going down.
int host_ready
Flag indicating if host create with controller is ready.
The handle to a helper process.
Definition: helper.c:78
const char * username
Username to use for the login; may be NULL.
const char * label
Label for the command.
struct GNUNET_SCHEDULER_Task * abort_task
Abort task identifier.
A command to be run by the interpreter.
void GNUNET_TESTBED_shutdown_service(struct TngState *ss)
Shutdown nicely.
const char * username
Username to use for the login; may be NULL.
uint16_t port
Port number to use for ssh; use 0 to let ssh decide.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_local_test_finished(const char *label, TESTBED_CMD_HELPER_write_cb write_message)
Create command.
struct GNUNET_TESTBED_Operation * operation
Handle to operation.
void GNUNET_TESTBED_shutdown_peer(struct PeerCmdState *ps)
Shutdown nicely.
Opaque handle to a host running experiments managed by the testing framework.
Handle for controller process.
uint16_t port
Port number to use for ssh; use 0 to let ssh decide.
struct GNUNET_TESTING_Interpreter * is
Interpreter state.
Opaque handle to an abstract operation to be executed by the testing framework.
struct GNUNET_TESTBED_HostRegistrationHandle * reg_handle
Handle for host registration.
struct GNUNET_CONFIGURATION_Handle * cfg
The configuration to use as a template while starting a controller on this host.
int controller_going_down
Flag indicating controller is going down.
Global state of the interpreter, used by a command to access information about other commands...
Definition: testing.h:34
const char * controller_label
The label of a controller command.
struct GNUNET_TESTBED_Host * host
The host to run peers and controllers on.
static void all_peers_started()
struct GNUNET_TESTBED_Host * host
The host to run peers and controllers on.
int GNUNET_TESTBED_get_trait_helper_handles(const struct GNUNET_TESTING_Command *cmd, struct GNUNET_HELPER_Handle ***helper)
Offer handles to testbed helper from trait.
int peer_ready
Flag indicating if peer is ready.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_block_until_all_peers_started(const char *label, unsigned int *all_peers_started)
Create command.
static int write_message(uint16_t message_type, const char *data, size_t data_length)
Write message to the master process.
uint64_t event_mask
Global event mask for all testbed events.
struct GNUNET_TESTBED_ControllerProc * cp
The controller process.
struct GNUNET_TESTING_Command GNUNET_TESTBED_cmd_stop_testbed(const char *label, const char *helper_start_label, char *local_m, char *global_n)
Create command.
struct GNUNET_TESTING_Command GNUNET_TESTBED_cmd_netjail_start(const char *label, char *local_m, char *global_n)
Create command.
struct GNUNET_SCHEDULER_Task * abort_task
Abort task identifier.
struct GNUNET_CONFIGURATION_Handle * cfg
The configuration to use as a template while starting a controller on this host.
int GNUNET_TESTBED_get_trait_hosts(const struct GNUNET_TESTING_Command *cmd, struct GNUNET_TESTBED_Host ***hosts)
uint64_t event_mask
A bit mask with set of events to call the controller for.
configuration data
struct GNUNET_TESTING_Command GNUNET_TESTBED_cmd_netjail_stop(const char *label, char *local_m, char *global_n)
Create command.
Entry in list of pending tasks.
Definition: scheduler.c:134
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_send_peer_ready(const char *label, TESTBED_CMD_HELPER_write_cb write_message)
Create command.
handle for host registration
struct GNUNET_TESTING_Command GNUNET_TESTBED_cmd_netjail_start_testbed(const char *label, char *local_m, char *global_n, char *plugin_name)
Create command.
A peer controlled by the testing framework.
void GNUNET_TESTBED_shutdown_controller(struct ControllerState *cs)
Shutdown nicely.
const char * hostname
Name of the host, use "NULL" for localhost.
const char * hostname
Name of the host, use "NULL" for localhost.
static char * plugin_name
Name of our plugin.
struct GNUNET_TESTBED_Controller * controller
The controller handle.
const char * trusted_ip
The ip address of the controller which will be set as TRUSTED HOST(all connections form this ip are p...