GNUnet  0.19.2
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 
38 #ifndef GNUNET_TESTBED_SERVICE_H
39 #define GNUNET_TESTBED_SERVICE_H
40 
41 
42 #include "gnunet_util_lib.h"
43 #include "gnunet_testing_lib.h"
44 
45 #ifdef __cplusplus
46 extern "C"
47 {
48 #if 0 /* keep Emacsens' auto-indent happy */
49 }
50 #endif
51 #endif
52 
53 
59 struct GNUNET_TESTBED_Host;
60 
65 struct GNUNET_TESTBED_Peer;
66 
71 
82 
83 
95 struct GNUNET_TESTBED_Host *
97  const char *username,
98  const struct GNUNET_CONFIGURATION_Handle *cfg,
99  uint16_t port);
100 
101 
117 struct GNUNET_TESTBED_Host *
119  const char *hostname,
120  const char *username,
121  const struct GNUNET_CONFIGURATION_Handle
122  *cfg,
123  uint16_t port);
124 
125 
138 unsigned int
140  const struct GNUNET_CONFIGURATION_Handle
141  *cfg,
142  struct GNUNET_TESTBED_Host ***hosts);
143 
144 
151 void
153 
154 
159 
160 
171 typedef void
173  const struct GNUNET_TESTBED_Host *host,
174  int status);
175 
176 
190  const struct GNUNET_CONFIGURATION_Handle
191  *config,
193  void *cb_cls);
194 
195 
201 void
204  *handle);
205 
212 const char *
214 
215 
221 {
226 
231 
236 
241 
246 };
247 
248 
253 {
261 
270 
277 };
278 
279 
285 {
290 
295 
299  void *op_cls;
300 
304  union
305  {
309  struct
310  {
316 
322 
326  struct
327  {
331  struct GNUNET_TESTBED_Peer *peer;
333 
337  struct
338  {
343 
349 
353  struct
354  {
358  struct GNUNET_TESTBED_Peer *peer1;
359 
363  struct GNUNET_TESTBED_Peer *peer2;
365 
369  struct
370  {
374  const char *emsg;
375 
380  void *generic;
383 };
384 
385 
393 typedef void
395  const struct
397 
398 
403 
404 
414 typedef void
416  const struct
418  int status);
419 
420 
445 GNUNET_TESTBED_controller_start (const char *trusted_ip,
446  struct GNUNET_TESTBED_Host *host,
448  void *cls);
449 
450 
459 void
461 
462 
481  uint64_t event_mask,
483  void *cc_cls);
484 
485 
493 void
495 
496 
501 
502 
509 typedef void
511  const char *emsg);
512 
513 
531  struct GNUNET_TESTBED_Host *host,
533  void *cc_cls);
534 
535 
545 void
547  *handle);
548 
549 
558 typedef void
560  struct GNUNET_TESTBED_Operation *
561  op,
562  const char *emsg);
563 
564 
594 GNUNET_TESTBED_controller_link (void *op_cls,
595  struct GNUNET_TESTBED_Controller *master,
596  struct GNUNET_TESTBED_Host *delegated_host,
597  struct GNUNET_TESTBED_Host *slave_host,
598  int is_subordinate);
599 
600 
617 GNUNET_TESTBED_get_slave_config (void *op_cls,
618  struct GNUNET_TESTBED_Controller *master,
619  struct GNUNET_TESTBED_Host *slave_host);
620 
621 
631 typedef void
633  struct GNUNET_TESTBED_Peer *peer,
634  const char *emsg);
635 
636 
668  struct GNUNET_TESTBED_Host *host,
669  const struct GNUNET_CONFIGURATION_Handle *cfg,
671  void *cls);
672 
673 
681 typedef void
683  const char *emsg);
684 
685 
697 GNUNET_TESTBED_peer_start (void *op_cls,
698  struct GNUNET_TESTBED_Peer *peer,
700  void *pcc_cls);
701 
702 
716 GNUNET_TESTBED_peer_stop (void *op_cls,
717  struct GNUNET_TESTBED_Peer *peer,
719  void *pcc_cls);
720 
721 
726 {
732 
736  union
737  {
742 
748 };
749 
750 
761 typedef void
762 (*GNUNET_TESTBED_PeerInfoCallback) (void *cb_cls,
764  const struct
766  const char *emsg);
767 
768 
786  pit,
788  void *cb_cls);
789 
790 
801  const struct
803 
804 
814 
815 
833  struct GNUNET_TESTBED_Peer *peer,
834  const char *service_name,
836  cb,
837  void *cb_cls,
838  unsigned int start);
839 
840 
858  void *op_cls,
860  void *cb_cls);
861 
862 
867 {
872 
881 
887 };
888 
889 
904  struct GNUNET_TESTBED_Peer *p1,
905  struct GNUNET_TESTBED_Peer *p2,
907  va_list ap);
908 
909 
924  struct GNUNET_TESTBED_Peer *p1,
925  struct GNUNET_TESTBED_Peer *p2,
927  ...);
928 
929 
935 {
941 
947 
953 
958 
963 
968 
974 
981 
993 
998 
1003 
1008 
1013 
1014  /* The following are not topologies but influence how the topology has to be
1015  setup. These options should follow the topology specific options (if
1016  required by the chosen topology). Note that these should be given before
1017  GNUNET_TESTBED_TOPOLOGY_OPTION_END */
1018 
1027 };
1028 
1029 
1041 struct GNUNET_TESTBED_Operation *
1043  unsigned int num_peers,
1044  struct GNUNET_TESTBED_Peer **
1045  peers,
1046  enum
1048  topo,
1049  va_list ap);
1050 
1051 
1063 struct GNUNET_TESTBED_Operation *
1065  unsigned int num_peers,
1066  struct GNUNET_TESTBED_Peer **peers,
1068  topo,
1069  ...);
1070 
1071 
1086 struct GNUNET_TESTBED_Operation *
1087 GNUNET_TESTBED_overlay_connect (void *op_cls,
1089  void *cb_cls,
1090  struct GNUNET_TESTBED_Peer *p1,
1091  struct GNUNET_TESTBED_Peer *p2);
1092 
1093 
1104  unsigned int
1105  nsuccess,
1106  unsigned int
1107  nfailures);
1108 
1109 
1130 struct GNUNET_TESTBED_Operation *
1132  unsigned int num_peers,
1133  struct GNUNET_TESTBED_Peer **peers,
1134  unsigned int *max_connections,
1136  comp_cb,
1137  void *comp_cb_cls,
1139  topo,
1140  va_list va);
1141 
1142 
1163 struct GNUNET_TESTBED_Operation *
1165  unsigned int num_peers,
1166  struct GNUNET_TESTBED_Peer **peers,
1167  unsigned int *max_connections,
1169  comp_cb,
1170  void *comp_cb_cls,
1172  topo,
1173  ...);
1174 
1175 
1186 void
1189  controller,
1190  const char *filename);
1191 
1192 
1203 typedef void *
1204 (*GNUNET_TESTBED_ConnectAdapter)(void *cls,
1205  const struct GNUNET_CONFIGURATION_Handle *cfg);
1206 
1207 
1215 typedef void
1217  void *op_result);
1218 
1219 
1229 typedef void
1231  struct
1233  void *ca_result,
1234  const char *emsg);
1235 
1236 
1259 struct GNUNET_TESTBED_Operation *
1260 GNUNET_TESTBED_service_connect (void *op_cls,
1261  struct GNUNET_TESTBED_Peer *peer,
1262  const char *service_name,
1264  cb,
1265  void *cb_cls,
1268  void *cada_cls);
1269 
1270 
1292 void
1294 
1295 
1307 typedef int
1308 (*GNUNET_TESTBED_StatisticsIterator) (void *cls,
1309  const struct GNUNET_TESTBED_Peer *peer,
1310  const char *subsystem,
1311  const char *name,
1312  uint64_t value,
1313  int is_persistent);
1314 
1315 
1331 struct GNUNET_TESTBED_Operation *
1333  struct GNUNET_TESTBED_Peer **peers,
1334  const char *subsystem, const char *name,
1337  void *cls);
1338 
1339 
1348 uint32_t
1350 
1351 
1356 
1357 
1372 typedef void
1373 (*GNUNET_TESTBED_TestMaster)(void *cls,
1374  struct GNUNET_TESTBED_RunHandle *h,
1375  unsigned int num_peers,
1376  struct GNUNET_TESTBED_Peer **peers,
1377  unsigned int links_succeeded,
1378  unsigned int links_failed);
1379 
1380 
1414 void
1415 GNUNET_TESTBED_run (const char *host_filename,
1416  const struct GNUNET_CONFIGURATION_Handle *cfg,
1417  unsigned int num_peers,
1418  uint64_t event_mask,
1420  void *cc_cls,
1422  void *test_master_cls);
1423 
1424 
1463 int
1464 GNUNET_TESTBED_test_run (const char *testname,
1465  const char *cfg_filename,
1466  unsigned int num_peers,
1467  uint64_t event_mask,
1469  void *cc_cls,
1471  void *test_master_cls);
1472 
1473 
1483 
1484 
1488 struct GNUNET_TESTBED_Barrier;
1489 
1490 
1495 {
1500 
1505 
1510 };
1511 
1512 
1528 typedef void
1529 (*GNUNET_TESTBED_barrier_status_cb) (void *cls,
1530  const char *name,
1531  struct GNUNET_TESTBED_Barrier *barrier,
1533  const char *emsg);
1534 
1535 
1550 struct GNUNET_TESTBED_Barrier *
1552  const char *name,
1553  unsigned int quorum,
1555  void *cb_cls);
1556 
1557 
1563 void
1565 
1566 
1571 
1572 
1583 typedef void
1584 (*GNUNET_TESTBED_barrier_wait_cb) (void *cls,
1585  const char *name,
1586  int status);
1587 
1588 
1601 GNUNET_TESTBED_barrier_wait (const char *name,
1603  void *cls);
1604 
1605 
1612 void
1614 
1615 
1621 
1622 
1628 {
1635 
1642 };
1643 
1644 
1656  enum
1658  type);
1659 
1660 
1670 void
1673  model,
1674  struct GNUNET_TESTBED_Peer *peer);
1675 
1676 
1688 void
1691  model,
1692  struct GNUNET_TESTBED_Peer *peer,
1693  uint32_t latency,
1694  uint32_t loss,
1695  uint32_t bandwidth);
1696 
1697 
1704 void
1707 
1708 
1717 void
1720 
1721 
1722 #if 0 /* keep Emacsens' auto-indent happy */
1723 {
1724 #endif
1725 
1726 
1727 #ifdef __cplusplus
1728 }
1729 #endif
1730 
1731 #endif
1732  /* end of group */
1734  /* end of group addition */
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:147
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:50
Convenience API for writing testcases for GNUnet.
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:2391
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:2021
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:1921
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:1935
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:2252
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:2291
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:2412
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:246
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.