GNUnet  0.11.x
gnunet_testbed_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2008--2013 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_SERVICE_H
36 #define GNUNET_TESTBED_SERVICE_H
37 
38 #include "gnunet_util_lib.h"
39 #include "gnunet_testing_lib.h"
40 
41 #ifdef __cplusplus
42 extern "C"
43 {
44 #if 0 /* keep Emacsens' auto-indent happy */
45 }
46 #endif
47 #endif
48 
49 
55 struct GNUNET_TESTBED_Host;
56 
61 struct GNUNET_TESTBED_Peer;
62 
67 
78 
79 
91 struct GNUNET_TESTBED_Host *
93  const char *username,
94  const struct GNUNET_CONFIGURATION_Handle *cfg,
95  uint16_t port);
96 
97 
113 struct GNUNET_TESTBED_Host *
115  const char *hostname,
116  const char *username,
117  const struct GNUNET_CONFIGURATION_Handle
118  *cfg,
119  uint16_t port);
120 
121 
134 unsigned int
136  const struct GNUNET_CONFIGURATION_Handle
137  *cfg,
138  struct GNUNET_TESTBED_Host ***hosts);
139 
140 
147 void
149 
150 
155 
156 
167 typedef void
169  const struct GNUNET_TESTBED_Host *host,
170  int status);
171 
172 
186  const struct GNUNET_CONFIGURATION_Handle
187  *config,
189  void *cb_cls);
190 
191 
197 void
200  *handle);
201 
208 const char *
210 
211 
217 {
222 
227 
232 
237 
242 };
243 
244 
249 {
257 
266 
273 };
274 
275 
281 {
286 
291 
295  void *op_cls;
296 
300  union
301  {
305  struct
306  {
312 
318 
322  struct
323  {
327  struct GNUNET_TESTBED_Peer *peer;
329 
333  struct
334  {
339 
345 
349  struct
350  {
354  struct GNUNET_TESTBED_Peer *peer1;
355 
359  struct GNUNET_TESTBED_Peer *peer2;
361 
365  struct
366  {
370  const char *emsg;
371 
376  void *generic;
379 };
380 
381 
389 typedef void
391  const struct
393 
394 
399 
400 
410 typedef void
412  const struct
414  int status);
415 
416 
441 GNUNET_TESTBED_controller_start (const char *trusted_ip,
442  struct GNUNET_TESTBED_Host *host,
444  void *cls);
445 
446 
455 void
457 
458 
477  uint64_t event_mask,
479  void *cc_cls);
480 
481 
489 void
491 
492 
497 
498 
505 typedef void
507  const char *emsg);
508 
509 
527  struct GNUNET_TESTBED_Host *host,
529  void *cc_cls);
530 
531 
541 void
543  *handle);
544 
545 
554 typedef void
556  struct GNUNET_TESTBED_Operation *
557  op,
558  const char *emsg);
559 
560 
590 GNUNET_TESTBED_controller_link (void *op_cls,
591  struct GNUNET_TESTBED_Controller *master,
592  struct GNUNET_TESTBED_Host *delegated_host,
593  struct GNUNET_TESTBED_Host *slave_host,
594  int is_subordinate);
595 
596 
613 GNUNET_TESTBED_get_slave_config (void *op_cls,
614  struct GNUNET_TESTBED_Controller *master,
615  struct GNUNET_TESTBED_Host *slave_host);
616 
617 
627 typedef void
629  struct GNUNET_TESTBED_Peer *peer,
630  const char *emsg);
631 
632 
664  struct GNUNET_TESTBED_Host *host,
665  const struct GNUNET_CONFIGURATION_Handle *cfg,
667  void *cls);
668 
669 
677 typedef void
679  const char *emsg);
680 
681 
693 GNUNET_TESTBED_peer_start (void *op_cls,
694  struct GNUNET_TESTBED_Peer *peer,
696  void *pcc_cls);
697 
698 
712 GNUNET_TESTBED_peer_stop (void *op_cls,
713  struct GNUNET_TESTBED_Peer *peer,
715  void *pcc_cls);
716 
717 
722 {
728 
732  union
733  {
738 
744 };
745 
746 
757 typedef void
758 (*GNUNET_TESTBED_PeerInfoCallback) (void *cb_cls,
760  const struct
762  const char *emsg);
763 
764 
782  pit,
784  void *cb_cls);
785 
786 
797  const struct
799 
800 
810 
811 
829  struct GNUNET_TESTBED_Peer *peer,
830  const char *service_name,
832  cb,
833  void *cb_cls,
834  unsigned int start);
835 
836 
854  void *op_cls,
856  void *cb_cls);
857 
858 
863 {
868 
877 
883 };
884 
885 
900  struct GNUNET_TESTBED_Peer *p1,
901  struct GNUNET_TESTBED_Peer *p2,
903  va_list ap);
904 
905 
920  struct GNUNET_TESTBED_Peer *p1,
921  struct GNUNET_TESTBED_Peer *p2,
923  ...);
924 
925 
931 {
937 
943 
949 
954 
959 
964 
970 
977 
989 
994 
999 
1004 
1009 
1010  /* The following are not topologies but influence how the topology has to be
1011  setup. These options should follow the topology specific options (if
1012  required by the chosen topology). Note that these should be given before
1013  GNUNET_TESTBED_TOPOLOGY_OPTION_END */
1014 
1023 };
1024 
1025 
1037 struct GNUNET_TESTBED_Operation *
1039  unsigned int num_peers,
1040  struct GNUNET_TESTBED_Peer **
1041  peers,
1042  enum
1044  topo,
1045  va_list ap);
1046 
1047 
1059 struct GNUNET_TESTBED_Operation *
1061  unsigned int num_peers,
1062  struct GNUNET_TESTBED_Peer **peers,
1064  topo,
1065  ...);
1066 
1067 
1082 struct GNUNET_TESTBED_Operation *
1083 GNUNET_TESTBED_overlay_connect (void *op_cls,
1085  void *cb_cls,
1086  struct GNUNET_TESTBED_Peer *p1,
1087  struct GNUNET_TESTBED_Peer *p2);
1088 
1089 
1100  unsigned int
1101  nsuccess,
1102  unsigned int
1103  nfailures);
1104 
1105 
1126 struct GNUNET_TESTBED_Operation *
1128  unsigned int num_peers,
1129  struct GNUNET_TESTBED_Peer **peers,
1130  unsigned int *max_connections,
1132  comp_cb,
1133  void *comp_cb_cls,
1135  topo,
1136  va_list va);
1137 
1138 
1159 struct GNUNET_TESTBED_Operation *
1161  unsigned int num_peers,
1162  struct GNUNET_TESTBED_Peer **peers,
1163  unsigned int *max_connections,
1165  comp_cb,
1166  void *comp_cb_cls,
1168  topo,
1169  ...);
1170 
1171 
1182 void
1185  controller,
1186  const char *filename);
1187 
1188 
1199 typedef void *
1200 (*GNUNET_TESTBED_ConnectAdapter)(void *cls,
1201  const struct GNUNET_CONFIGURATION_Handle *cfg);
1202 
1203 
1211 typedef void
1213  void *op_result);
1214 
1215 
1225 typedef void
1227  struct
1229  void *ca_result,
1230  const char *emsg);
1231 
1232 
1255 struct GNUNET_TESTBED_Operation *
1256 GNUNET_TESTBED_service_connect (void *op_cls,
1257  struct GNUNET_TESTBED_Peer *peer,
1258  const char *service_name,
1260  cb,
1261  void *cb_cls,
1264  void *cada_cls);
1265 
1266 
1288 void
1290 
1291 
1303 typedef int
1304 (*GNUNET_TESTBED_StatisticsIterator) (void *cls,
1305  const struct GNUNET_TESTBED_Peer *peer,
1306  const char *subsystem,
1307  const char *name,
1308  uint64_t value,
1309  int is_persistent);
1310 
1311 
1327 struct GNUNET_TESTBED_Operation *
1329  struct GNUNET_TESTBED_Peer **peers,
1330  const char *subsystem, const char *name,
1333  void *cls);
1334 
1335 
1344 uint32_t
1346 
1347 
1352 
1353 
1368 typedef void
1369 (*GNUNET_TESTBED_TestMaster)(void *cls,
1370  struct GNUNET_TESTBED_RunHandle *h,
1371  unsigned int num_peers,
1372  struct GNUNET_TESTBED_Peer **peers,
1373  unsigned int links_succeeded,
1374  unsigned int links_failed);
1375 
1376 
1410 void
1411 GNUNET_TESTBED_run (const char *host_filename,
1412  const struct GNUNET_CONFIGURATION_Handle *cfg,
1413  unsigned int num_peers,
1414  uint64_t event_mask,
1416  void *cc_cls,
1418  void *test_master_cls);
1419 
1420 
1459 int
1460 GNUNET_TESTBED_test_run (const char *testname,
1461  const char *cfg_filename,
1462  unsigned int num_peers,
1463  uint64_t event_mask,
1465  void *cc_cls,
1467  void *test_master_cls);
1468 
1469 
1479 
1480 
1484 struct GNUNET_TESTBED_Barrier;
1485 
1486 
1491 {
1496 
1501 
1506 };
1507 
1508 
1524 typedef void
1525 (*GNUNET_TESTBED_barrier_status_cb) (void *cls,
1526  const char *name,
1527  struct GNUNET_TESTBED_Barrier *barrier,
1529  const char *emsg);
1530 
1531 
1546 struct GNUNET_TESTBED_Barrier *
1548  const char *name,
1549  unsigned int quorum,
1551  void *cb_cls);
1552 
1553 
1559 void
1561 
1562 
1567 
1568 
1579 typedef void
1580 (*GNUNET_TESTBED_barrier_wait_cb) (void *cls,
1581  const char *name,
1582  int status);
1583 
1584 
1597 GNUNET_TESTBED_barrier_wait (const char *name,
1599  void *cls);
1600 
1601 
1608 void
1610 
1611 
1617 
1618 
1624 {
1631 
1638 };
1639 
1640 
1652  enum
1654  type);
1655 
1656 
1666 void
1669  model,
1670  struct GNUNET_TESTBED_Peer *peer);
1671 
1672 
1684 void
1687  model,
1688  struct GNUNET_TESTBED_Peer *peer,
1689  uint32_t latency,
1690  uint32_t loss,
1691  uint32_t bandwidth);
1692 
1693 
1700 void
1703 
1704 
1713 void
1716 
1717 
1718 #if 0 /* keep Emacsens' auto-indent happy */
1719 {
1720 #endif
1721 
1722 
1723 #ifdef __cplusplus
1724 }
1725 #endif
1726 
1727 #endif
1728  /* end of group */
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static int start
Set if we are to start default services (including ARM).
Definition: gnunet-arm.c:39
static char * cfg_filename
Name of the configuration file.
static uint16_t port
Port number.
Definition: gnunet-bcd.c:83
static struct CadetPeer * peers
Operation to get peer ids.
static void test_master(void *cls, struct GNUNET_TESTBED_RunHandle *h, unsigned int num_peers, struct GNUNET_TESTBED_Peer **started_peers, unsigned int links_succeeded, unsigned int links_failed)
Signature of a main function for a testcase.
static unsigned int num_peers
static unsigned long long max_connections
If there are at least this many connections, old ones will be removed.
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
static char * filename
static char * host_filename
Data file with the hosts for the testbed.
uint16_t status
See PRISM_STATUS_*-constants.
static char * value
Value of the record to add/remove.
static int result
Global testing status.
static char * hostname
Our hostname; we give this to all the peers we start.
static const struct GNUNET_CONFIGURATION_Handle * config
static char * subsystem
Set to subsystem that we're going to get stats for (or NULL for all).
uint64_t event_mask
Global event mask for all testbed events.
static char * service_name
Option -s: service name (hash to get service descriptor)
Definition: gnunet-vpn.c:51
void(* GNUNET_TESTBED_ControllerCallback)(void *cls, const struct GNUNET_TESTBED_EventInformation *event)
Signature of the event handler function called by the respective event controller.
struct GNUNET_TESTBED_Barrier * GNUNET_TESTBED_barrier_init(struct GNUNET_TESTBED_Controller *controller, const char *name, unsigned int quorum, GNUNET_TESTBED_barrier_status_cb cb, void *cb_cls)
Initialise a barrier and call the given callback when the required percentage of peers (quorum) reach...
Definition: testbed_api.c:2438
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_peer_stop(void *op_cls, struct GNUNET_TESTBED_Peer *peer, GNUNET_TESTBED_PeerChurnCallback pcc, void *pcc_cls)
Stop the given peer.
GNUNET_TESTBED_TopologyOption
Topologies and topology options supported for testbeds.
struct GNUNET_TESTBED_BarrierWaitHandle * GNUNET_TESTBED_barrier_wait(const char *name, GNUNET_TESTBED_barrier_wait_cb cb, void *cls)
Wait for a barrier to be crossed.
void(* GNUNET_TESTBED_DisconnectAdapter)(void *cls, void *op_result)
Adapter function called to destroy a connection to a service.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_peer_update_configuration(struct GNUNET_TESTBED_Peer *peer, const struct GNUNET_CONFIGURATION_Handle *cfg)
Change peer configuration.
void GNUNET_TESTBED_operation_done(struct GNUNET_TESTBED_Operation *operation)
This function is used to signal that the event information (struct GNUNET_TESTBED_EventInformation) f...
Definition: testbed_api.c:2045
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_underlay_configure_link_va(void *op_cls, struct GNUNET_TESTBED_Peer *p1, struct GNUNET_TESTBED_Peer *p2, enum GNUNET_TESTBED_ConnectOption co, va_list ap)
Manipulate the P2P underlay topology by configuring a link between two peers.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_peer_get_information(struct GNUNET_TESTBED_Peer *peer, enum GNUNET_TESTBED_PeerInformationType pit, GNUNET_TESTBED_PeerInfoCallback cb, void *cb_cls)
Request information about a peer.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_underlay_configure_topology(void *op_cls, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, enum GNUNET_TESTBED_TopologyOption topo,...)
Configure overall network topology to have a particular shape.
void(* GNUNET_TESTBED_TopologyCompletionCallback)(void *cls, unsigned int nsuccess, unsigned int nfailures)
Callbacks of this type are called when topology configuration is completed.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_get_slave_config(void *op_cls, struct GNUNET_TESTBED_Controller *master, struct GNUNET_TESTBED_Host *slave_host)
Function to acquire the configuration of a running slave controller.
Definition: testbed_api.c:1936
struct GNUNET_TESTBED_Host * GNUNET_TESTBED_host_create_with_id(uint32_t id, const char *hostname, const char *username, const struct GNUNET_CONFIGURATION_Handle *cfg, uint16_t port)
Create a host to run peers and controllers on.
int GNUNET_TESTBED_test_run(const char *testname, const char *cfg_filename, unsigned int num_peers, uint64_t event_mask, GNUNET_TESTBED_ControllerCallback cc, void *cc_cls, GNUNET_TESTBED_TestMaster test_master, void *test_master_cls)
Convenience method for running a "simple" test on the local system with a single call from 'main'.
void GNUNET_TESTBED_cancel_registration(struct GNUNET_TESTBED_HostRegistrationHandle *handle)
Cancel the pending registration.
void(* GNUNET_TESTBED_ServiceConnectCompletionCallback)(void *cls, struct GNUNET_TESTBED_Operation *op, void *ca_result, const char *emsg)
Callback to be called when a service connect operation is completed.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_peer_create(struct GNUNET_TESTBED_Controller *controller, struct GNUNET_TESTBED_Host *host, const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_TESTBED_PeerCreateCallback cb, void *cls)
Create the given peer at the specified host using the given controller.
void(* GNUNET_TESTBED_barrier_status_cb)(void *cls, const char *name, struct GNUNET_TESTBED_Barrier *barrier, enum GNUNET_TESTBED_BarrierStatus status, const char *emsg)
Functions of this type are to be given as callback argument to GNUNET_TESTBED_barrier_init().
void(* GNUNET_TESTBED_barrier_wait_cb)(void *cls, const char *name, int status)
Functions of this type are to be given as acallback argument to GNUNET_TESTBED_barrier_wait().
void(* GNUNET_TESTBED_PeerChurnCallback)(void *cls, const char *emsg)
Functions of this signature are called when a peer has been successfully started or stopped.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_peer_manage_service(void *op_cls, struct GNUNET_TESTBED_Peer *peer, const char *service_name, GNUNET_TESTBED_OperationCompletionCallback cb, void *cb_cls, unsigned int start)
Start or stop given service at a peer.
GNUNET_TESTBED_UnderlayLinkModelType
The type of GNUNET_TESTBED_UnderlayLinkModel.
struct GNUNET_TESTBED_HostHabitableCheckHandle * GNUNET_TESTBED_is_host_habitable(const struct GNUNET_TESTBED_Host *host, const struct GNUNET_CONFIGURATION_Handle *config, GNUNET_TESTBED_HostHabitableCallback cb, void *cb_cls)
Checks whether a host can be used to start testbed service.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_overlay_configure_topology(void *op_cls, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, unsigned int *max_connections, GNUNET_TESTBED_TopologyCompletionCallback comp_cb, void *comp_cb_cls, enum GNUNET_TESTBED_TopologyOption topo,...)
All peers must have been started before calling this function.
struct GNUNET_TESTBED_Controller * GNUNET_TESTBED_run_get_controller_handle(struct GNUNET_TESTBED_RunHandle *h)
Obtain handle to the master controller from a testbed run.
struct GNUNET_TESTBED_Host * GNUNET_TESTBED_host_create(const char *hostname, const char *username, const struct GNUNET_CONFIGURATION_Handle *cfg, uint16_t port)
Create a host to run peers and controllers on.
void GNUNET_TESTBED_is_host_habitable_cancel(struct GNUNET_TESTBED_HostHabitableCheckHandle *handle)
Function to cancel a request started using GNUNET_TESTBED_is_host_habitable()
void(* GNUNET_TESTBED_TestMaster)(void *cls, struct GNUNET_TESTBED_RunHandle *h, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, unsigned int links_succeeded, unsigned int links_failed)
Signature of a main function for a testcase.
GNUNET_TESTBED_PeerInformationType
Types of information that can be requested about a peer.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_overlay_connect(void *op_cls, GNUNET_TESTBED_OperationCompletionCallback cb, void *cb_cls, struct GNUNET_TESTBED_Peer *p1, struct GNUNET_TESTBED_Peer *p2)
Both peers must have been started before calling this function.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_overlay_configure_topology_va(void *op_cls, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, unsigned int *max_connections, GNUNET_TESTBED_TopologyCompletionCallback comp_cb, void *comp_cb_cls, enum GNUNET_TESTBED_TopologyOption topo, va_list va)
All peers must have been started before calling this function.
void GNUNET_TESTBED_run(const char *host_filename, const struct GNUNET_CONFIGURATION_Handle *cfg, unsigned int num_peers, uint64_t event_mask, GNUNET_TESTBED_ControllerCallback cc, void *cc_cls, GNUNET_TESTBED_TestMaster test_master, void *test_master_cls)
Convenience method for running a testbed with a single call.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_service_connect(void *op_cls, struct GNUNET_TESTBED_Peer *peer, const char *service_name, GNUNET_TESTBED_ServiceConnectCompletionCallback cb, void *cb_cls, GNUNET_TESTBED_ConnectAdapter ca, GNUNET_TESTBED_DisconnectAdapter da, void *cada_cls)
Connect to a service offered by the given peer.
void(* GNUNET_TESTBED_ControllerStatusCallback)(void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, int status)
Callback to signal successful startup of the controller process.
int(* GNUNET_TESTBED_StatisticsIterator)(void *cls, const struct GNUNET_TESTBED_Peer *peer, const char *subsystem, const char *name, uint64_t value, int is_persistent)
Callback function to process statistic values from all peers.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_get_statistics(unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, const char *subsystem, const char *name, GNUNET_TESTBED_StatisticsIterator proc, GNUNET_TESTBED_OperationCompletionCallback cont, void *cls)
Convenience method that iterates over all (running) peers and retrieves all statistics from each peer...
void(* GNUNET_TESTBED_OperationCompletionCallback)(void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg)
Callback to be called when an operation is completed.
void(* GNUNET_TESTBED_PeerCreateCallback)(void *cls, struct GNUNET_TESTBED_Peer *peer, const char *emsg)
Functions of this signature are called when a peer has been successfully created.
GNUNET_TESTBED_ConnectOption
Options for peer connections.
unsigned int GNUNET_TESTBED_hosts_load_from_file(const char *filename, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_TESTBED_Host ***hosts)
Load a set of hosts from a configuration file.
void(* GNUNET_TESTBED_HostHabitableCallback)(void *cls, const struct GNUNET_TESTBED_Host *host, int status)
Callbacks of this type are called by GNUNET_TESTBED_is_host_habitable to inform whether the given hos...
void(* GNUNET_TESTBED_HostRegistrationCompletion)(void *cls, const char *emsg)
Callback which will be called to after a host registration succeeded or failed.
void GNUNET_TESTBED_underlaylinkmodel_free(struct GNUNET_TESTBED_UnderlayLinkModel *model)
Free the resources of the model.
void GNUNET_TESTBED_barrier_wait_cancel(struct GNUNET_TESTBED_BarrierWaitHandle *h)
Cancel a barrier wait handle.
void GNUNET_TESTBED_underlaylinkmodel_set_link(struct GNUNET_TESTBED_UnderlayLinkModel *model, struct GNUNET_TESTBED_Peer *peer, uint32_t latency, uint32_t loss, uint32_t bandwidth)
Set the metrics for a link to the given peer in the underlay model.
void GNUNET_TESTBED_controller_stop(struct GNUNET_TESTBED_ControllerProc *cproc)
Stop the controller process (also will terminate all peers and controllers dependent on this controll...
void GNUNET_TESTBED_controller_disconnect(struct GNUNET_TESTBED_Controller *c)
Stop the given controller (also will terminate all peers and controllers dependent on this controller...
Definition: testbed_api.c:1721
struct GNUNET_TESTBED_UnderlayLinkModel * GNUNET_TESTBED_underlaylinkmodel_create(struct GNUNET_TESTBED_Peer *peer, enum GNUNET_TESTBED_UnderlayLinkModelType type)
Create a GNUNET_TESTBED_UnderlayLinkModel for the given peer.
void GNUNET_TESTBED_overlay_write_topology_to_file(struct GNUNET_TESTBED_Controller *controller, const char *filename)
Ask the testbed controller to write the current overlay topology to a file.
Definition: testbed_api.c:1959
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_underlay_configure_link(void *op_cls, struct GNUNET_TESTBED_Peer *p1, struct GNUNET_TESTBED_Peer *p2, enum GNUNET_TESTBED_ConnectOption co,...)
Manipulate the P2P underlay topology by configuring a link between two peers.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_shutdown_peers(struct GNUNET_TESTBED_Controller *c, void *op_cls, GNUNET_TESTBED_OperationCompletionCallback cb, void *cb_cls)
Stops and destroys all peers.
Definition: testbed_api.c:2283
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_controller_link(void *op_cls, struct GNUNET_TESTBED_Controller *master, struct GNUNET_TESTBED_Host *delegated_host, struct GNUNET_TESTBED_Host *slave_host, int is_subordinate)
Create a link from slave controller to delegated controller.
Definition: testbed_api.c:1832
uint32_t GNUNET_TESTBED_get_index(const struct GNUNET_TESTBED_Peer *peer)
Return the index of the peer inside of the total peer array, aka.
Definition: testbed_api.c:2322
void GNUNET_TESTBED_host_destroy(struct GNUNET_TESTBED_Host *host)
Destroy a host handle.
void(* GNUNET_TESTBED_PeerInfoCallback)(void *cb_cls, struct GNUNET_TESTBED_Operation *op, const struct GNUNET_TESTBED_PeerInformation *pinfo, const char *emsg)
Callback to be called when the requested peer information is available The peer information in the ca...
GNUNET_TESTBED_EventType
Enumeration with (at most 64) possible event types that can be monitored using the testbed framework.
void *(* GNUNET_TESTBED_ConnectAdapter)(void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg)
Adapter function called to establish a connection to a service.
struct GNUNET_TESTBED_Controller * GNUNET_TESTBED_controller_connect(struct GNUNET_TESTBED_Host *host, uint64_t event_mask, GNUNET_TESTBED_ControllerCallback cc, void *cc_cls)
Connect to a controller process.
Definition: testbed_api.c:1555
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_underlay_configure_topology_va(void *op_cls, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, enum GNUNET_TESTBED_TopologyOption topo, va_list ap)
Configure overall network topology to have a particular shape.
GNUNET_TESTBED_BarrierStatus
Status of a barrier.
const char * GNUNET_TESTBED_host_get_hostname(const struct GNUNET_TESTBED_Host *host)
Obtain the host's hostname.
void GNUNET_TESTBED_underlaylinkmodel_add_peer(struct GNUNET_TESTBED_UnderlayLinkModel *model, struct GNUNET_TESTBED_Peer *peer)
Add a peer to the given model.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_peer_start(void *op_cls, struct GNUNET_TESTBED_Peer *peer, GNUNET_TESTBED_PeerChurnCallback pcc, void *pcc_cls)
Start the given peer.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_peer_destroy(struct GNUNET_TESTBED_Peer *peer)
Destroy the given peer; the peer should have been stopped first (if it was started).
struct GNUNET_TESTBED_ControllerProc * GNUNET_TESTBED_controller_start(const char *trusted_ip, struct GNUNET_TESTBED_Host *host, GNUNET_TESTBED_ControllerStatusCallback cb, void *cls)
Starts a controller process at the given host.
void GNUNET_TESTBED_barrier_cancel(struct GNUNET_TESTBED_Barrier *barrier)
Cancel a barrier.
Definition: testbed_api.c:2459
void GNUNET_TESTBED_underlaylinkmodel_commit(struct GNUNET_TESTBED_UnderlayLinkModel *model)
Commit the model.
struct GNUNET_TESTBED_HostRegistrationHandle * GNUNET_TESTBED_register_host(struct GNUNET_TESTBED_Controller *controller, struct GNUNET_TESTBED_Host *host, GNUNET_TESTBED_HostRegistrationCompletion cc, void *cc_cls)
Register a host with the controller.
@ GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD
Small-world network (2d torus plus random links).
@ GNUNET_TESTBED_TOPOLOGY_FROM_FILE
Read a topology from a given file.
@ GNUNET_TESTBED_TOPOLOGY_NONE
All peers are disconnected.
@ GNUNET_TESTBED_TOPOLOGY_RING
Ring topology.
@ GNUNET_TESTBED_TOPOLOGY_CLIQUE
A clique (everyone connected to everyone else).
@ GNUNET_TESTBED_TOPOLOGY_SCALE_FREE
Scale free topology.
@ GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI
Random graph.
@ GNUNET_TESTBED_TOPOLOGY_INTERNAT
Certain percentage of peers are unable to communicate directly replicating NAT conditions.
@ GNUNET_TESTBED_TOPOLOGY_STAR
Star topology.
@ GNUNET_TESTBED_TOPOLOGY_RETRY_CNT
How many times should the failed overlay connect operations be retried before giving up.
@ GNUNET_TESTBED_TOPOLOGY_2D_TORUS
2-d torus.
@ GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING
Small-world network (ring plus random links).
@ GNUNET_TESTBED_TOPOLOGY_LINE
Straight line topology.
@ GNUNET_TESTBED_TOPOLOGY_OPTION_END
The options should always end with this.
@ GNUNET_TESTBED_UNDERLAYLINKMODELTYPE_WHITELIST
The model is based on black listing of peers to which underlay connections are not permitted.
@ GNUNET_TESTBED_UNDERLAYLINKMODELTYPE_BLACKLIST
The model is based on white listing of peers to which underlay connections are permitted.
@ GNUNET_TESTBED_PIT_CONFIGURATION
What configuration is the peer using? Returns a 'const struct GNUNET_CONFIGURATION_Handle *'.
@ GNUNET_TESTBED_PIT_IDENTITY
What is the identity of the peer? Returns a 'const struct GNUNET_PeerIdentity *'.
@ GNUNET_TESTBED_PIT_GENERIC
Special value (not valid for requesting information) that is used in the event struct if a 'generic' ...
@ GNUNET_TESTBED_CO_NONE
No option (not valid as an argument).
@ GNUNET_TESTBED_CO_ALLOW
Allow or disallow a connection between the specified peers.
@ GNUNET_TESTBED_ET_CONNECT
A connection between two peers was established.
@ GNUNET_TESTBED_ET_OPERATION_FINISHED
A requested testbed operation has been completed.
@ GNUNET_TESTBED_ET_PEER_START
A peer has been started.
@ GNUNET_TESTBED_ET_DISCONNECT
A connection between two peers was torn down.
@ GNUNET_TESTBED_ET_PEER_STOP
A peer has been stopped.
@ GNUNET_TESTBED_BARRIERSTATUS_CROSSED
Barrier is crossed.
@ GNUNET_TESTBED_BARRIERSTATUS_ERROR
Error status.
@ GNUNET_TESTBED_BARRIERSTATUS_INITIALISED
Barrier initialised successfully.
static int op_result(struct GNUNET_OP_Handle *h, uint64_t op_id, int64_t result_code, const void *data, uint16_t data_size, void **ctx, uint8_t cancel)
Remove an operation, and call its result callback (unless it was cancelled).
Definition: op.c:245
const char * name
The identity of the host (wraps the signing key of the peer).
Handle for barrier.
Definition: testbed_api.h:278
Handle for controller process.
Handle to interact with a GNUnet testbed controller.
Definition: testbed_api.h:194
Argument to GNUNET_TESTBED_ControllerCallback with details about the event.
enum GNUNET_TESTBED_EventType type
Type of the event.
struct GNUNET_TESTBED_EventInformation::@43::@44 peer_start
Details about peer start event.
struct GNUNET_TESTBED_Operation * op
Handle for the corresponding operation that generated this event.
const char * emsg
Error message for the operation, NULL on success.
struct GNUNET_TESTBED_Peer * peer2
Handle for one of the connected peers.
union GNUNET_TESTBED_EventInformation::@43 details
Details about the event.
struct GNUNET_TESTBED_EventInformation::@43::@48 operation_finished
Details about an operation finished event.
struct GNUNET_TESTBED_EventInformation::@43::@46 peer_connect
Details about connect event.
void * op_cls
Closure given while creating the above operation.
struct GNUNET_TESTBED_Host * host
Handle for the host where the peer was started.
struct GNUNET_TESTBED_EventInformation::@43::@45 peer_stop
Details about peer stop event.
struct GNUNET_TESTBED_Peer * peer
Handle for the peer that was started.
struct GNUNET_TESTBED_EventInformation::@43::@47 peer_disconnect
Details about disconnect event.
struct GNUNET_TESTBED_Peer * peer1
Handle for one of the connected peers.
The handle for whether a host is habitable or not.
const struct GNUNET_TESTBED_Host * host
The host to check.
GNUNET_TESTBED_HostHabitableCallback cb
The callback to call once we have the status.
handle for host registration
Opaque handle to a host running experiments managed by the testing framework.
const char * username
The username to be used for SSH login.
Opaque handle to an abstract operation to be executed by the testing framework.
Data returned from GNUNET_TESTBED_peer_get_information.
struct GNUNET_CONFIGURATION_Handle * cfg
The configuration of the peer.
struct GNUNET_PeerIdentity * id
The identity of the peer.
A peer controlled by the testing framework.
struct GNUNET_TESTBED_Controller * controller
Our controller context (not necessarily the controller that is responsible for starting/running the p...
struct GNUNET_TESTBED_Host * host
Which host does this peer run on?
Model for configuring underlay links of a peer.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.