GNUnet  0.10.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 
98 
114 struct GNUNET_TESTBED_Host *
116  const char *hostname,
117  const char *username,
118  const struct GNUNET_CONFIGURATION_Handle
119  *cfg,
120  uint16_t port);
121 
122 
135 unsigned int
137  const struct GNUNET_CONFIGURATION_Handle
138  *cfg,
139  struct GNUNET_TESTBED_Host ***hosts);
140 
141 
154 unsigned int
157  struct GNUNET_TESTBED_Host
158  ***hosts);
159 
166 void
168 
169 
174 
175 
186 typedef void
188  const struct GNUNET_TESTBED_Host *host,
189  int status);
190 
191 
205  const struct GNUNET_CONFIGURATION_Handle
206  *config,
208  void *cb_cls);
209 
210 
216 void
219  *handle);
220 
227 const char *
229 
230 
236 {
241 
246 
251 
256 
261 
262 };
263 
264 
269 {
270 
278 
287 
294 
295 };
296 
297 
303 {
304 
309 
314 
318  void *op_cls;
319 
323  union
324  {
325 
329  struct
330  {
336 
341 
342  } peer_start;
343 
347  struct
348  {
349 
353  struct GNUNET_TESTBED_Peer *peer;
354 
355  } peer_stop;
356 
360  struct
361  {
366 
371 
372  } peer_connect;
373 
377  struct
378  {
382  struct GNUNET_TESTBED_Peer *peer1;
383 
387  struct GNUNET_TESTBED_Peer *peer2;
388 
389  } peer_disconnect;
390 
394  struct
395  {
399  const char *emsg;
400 
405  void *generic;
406 
408 
409  } details;
410 
411 };
412 
413 
421 typedef void
423  const struct GNUNET_TESTBED_EventInformation *event);
424 
425 
430 
431 
441 typedef void
443  const struct GNUNET_CONFIGURATION_Handle *cfg,
444  int status);
445 
446 
471 GNUNET_TESTBED_controller_start (const char *trusted_ip,
472  struct GNUNET_TESTBED_Host *host,
474  void *cls);
475 
476 
485 void
487 
488 
507  uint64_t event_mask,
509  void *cc_cls);
510 
511 
519 void
521 
522 
527 
528 
535 typedef void
537  const char *emsg);
538 
539 
557  struct GNUNET_TESTBED_Host *host,
559  void *cc_cls);
560 
561 
571 void
573  *handle);
574 
575 
584 typedef void
587  const char *emsg);
588 
589 
620  struct GNUNET_TESTBED_Controller *master,
621  struct GNUNET_TESTBED_Host *delegated_host,
622  struct GNUNET_TESTBED_Host *slave_host,
623  int is_subordinate);
624 
625 
643  struct GNUNET_TESTBED_Controller *master,
644  struct GNUNET_TESTBED_Host *slave_host);
645 
646 
656 typedef void
658  struct GNUNET_TESTBED_Peer *peer,
659  const char *emsg);
660 
661 
693  struct GNUNET_TESTBED_Host *host,
694  const struct GNUNET_CONFIGURATION_Handle *cfg,
696  void *cls);
697 
698 
706 typedef void
708  const char *emsg);
709 
710 
723  struct GNUNET_TESTBED_Peer *peer,
725  void *pcc_cls);
726 
727 
742  struct GNUNET_TESTBED_Peer *peer,
744  void *pcc_cls);
745 
746 
751 {
757 
761  union
762  {
767 
772  } result;
773 };
774 
775 
786 typedef void
789  const struct GNUNET_TESTBED_PeerInformation *pinfo,
790  const char *emsg);
791 
792 
810  pit,
812  void *cb_cls);
813 
814 
825  const struct GNUNET_CONFIGURATION_Handle *cfg);
826 
827 
837 
838 
856  struct GNUNET_TESTBED_Peer *peer,
857  const char *service_name,
859  void *cb_cls,
860  unsigned int start);
861 
862 
880  void *op_cls,
882  void *cb_cls);
883 
884 
885 
890 {
895 
904 
911 };
912 
913 
928  struct GNUNET_TESTBED_Peer *p1,
929  struct GNUNET_TESTBED_Peer *p2,
931  va_list ap);
932 
933 
948  struct GNUNET_TESTBED_Peer *p1,
949  struct GNUNET_TESTBED_Peer *p2,
950  enum GNUNET_TESTBED_ConnectOption co, ...);
951 
952 
953 
959 {
965 
971 
977 
982 
987 
992 
998 
1005 
1017 
1022 
1027 
1032 
1037 
1038  /* The following are not topologies but influence how the topology has to be
1039  setup. These options should follow the topology specific options (if
1040  required by the chosen topology). Note that these should be given before
1041  GNUNET_TESTBED_TOPOLOGY_OPTION_END */
1042 
1051 };
1052 
1053 
1065 struct GNUNET_TESTBED_Operation *
1067  unsigned int num_peers,
1068  struct GNUNET_TESTBED_Peer **peers,
1070  va_list ap);
1071 
1072 
1084 struct GNUNET_TESTBED_Operation *
1086  unsigned int num_peers,
1087  struct GNUNET_TESTBED_Peer **peers,
1089  ...);
1090 
1091 
1106 struct GNUNET_TESTBED_Operation *
1109  void *cb_cls,
1110  struct GNUNET_TESTBED_Peer *p1,
1111  struct GNUNET_TESTBED_Peer *p2);
1112 
1113 
1124  unsigned int nsuccess,
1125  unsigned int nfailures);
1126 
1127 
1148 struct GNUNET_TESTBED_Operation *
1150  unsigned int num_peers,
1151  struct GNUNET_TESTBED_Peer **peers,
1152  unsigned int *max_connections,
1154  comp_cb,
1155  void *comp_cb_cls,
1157  va_list va);
1158 
1159 
1180 struct GNUNET_TESTBED_Operation *
1182  unsigned int num_peers,
1183  struct GNUNET_TESTBED_Peer **peers,
1184  unsigned int *max_connections,
1186  comp_cb,
1187  void *comp_cb_cls,
1189  ...);
1190 
1191 
1202 void
1204  const char *filename);
1205 
1206 
1217 typedef void *
1218 (*GNUNET_TESTBED_ConnectAdapter)(void *cls,
1219  const struct GNUNET_CONFIGURATION_Handle *cfg);
1220 
1221 
1229 typedef void
1231  void *op_result);
1232 
1233 
1243 typedef void
1245  struct GNUNET_TESTBED_Operation *op,
1246  void *ca_result,
1247  const char *emsg );
1248 
1249 
1272 struct GNUNET_TESTBED_Operation *
1274  struct GNUNET_TESTBED_Peer *peer,
1275  const char *service_name,
1277  void *cb_cls,
1280  void *cada_cls);
1281 
1282 
1304 void
1306 
1307 
1319 typedef int
1321  const struct GNUNET_TESTBED_Peer *peer,
1322  const char *subsystem,
1323  const char *name,
1324  uint64_t value,
1325  int is_persistent);
1326 
1327 
1343 struct GNUNET_TESTBED_Operation *
1345  struct GNUNET_TESTBED_Peer **peers,
1346  const char *subsystem, const char *name,
1349  void *cls);
1350 
1351 
1360 uint32_t
1361 GNUNET_TESTBED_get_index (const struct GNUNET_TESTBED_Peer *peer);
1362 
1363 
1368 
1369 
1384 typedef void
1386  struct GNUNET_TESTBED_RunHandle *h,
1387  unsigned int num_peers,
1388  struct GNUNET_TESTBED_Peer **peers,
1389  unsigned int links_succeeded,
1390  unsigned int links_failed);
1391 
1392 
1426 void
1427 GNUNET_TESTBED_run (const char *host_filename,
1428  const struct GNUNET_CONFIGURATION_Handle *cfg,
1429  unsigned int num_peers,
1430  uint64_t event_mask,
1432  void *cc_cls,
1434  void *test_master_cls);
1435 
1436 
1475 int
1476 GNUNET_TESTBED_test_run (const char *testname,
1477  const char *cfg_filename,
1478  unsigned int num_peers,
1479  uint64_t event_mask,
1481  void *cc_cls,
1483  void *test_master_cls);
1484 
1485 
1495 
1496 
1500 struct GNUNET_TESTBED_Barrier;
1501 
1502 
1507 {
1512 
1517 
1522 
1523 };
1524 
1525 
1541 typedef void
1543  const char *name,
1544  struct GNUNET_TESTBED_Barrier *barrier,
1546  const char *emsg);
1547 
1548 
1563 struct GNUNET_TESTBED_Barrier *
1565  const char *name,
1566  unsigned int quorum,
1568  void *cb_cls);
1569 
1570 
1576 void
1578 
1579 
1584 
1585 
1596 typedef void
1598  const char *name,
1599  int status);
1600 
1601 
1614 GNUNET_TESTBED_barrier_wait (const char *name,
1616  void *cls);
1617 
1618 
1625 void
1627 
1628 
1634 
1635 
1641 {
1648 
1655 };
1656 
1657 
1670 
1671 
1681 void
1683  struct GNUNET_TESTBED_Peer *peer);
1684 
1685 
1697 void
1699  struct GNUNET_TESTBED_Peer *peer,
1700  uint32_t latency,
1701  uint32_t loss,
1702  uint32_t bandwidth);
1703 
1704 
1711 void
1713 
1714 
1723 void
1725 
1726 
1727 #if 0 /* keep Emacsens' auto-indent happy */
1728 {
1729 #endif
1730 
1731 
1732 #ifdef __cplusplus
1733 }
1734 #endif
1735 
1736 #endif
1737  /* end of group */
struct GNUNET_TESTBED_Peer * peer2
Handle for one of the connected peers.
void GNUNET_TESTBED_cancel_registration(struct GNUNET_TESTBED_HostRegistrationHandle *handle)
Cancel the pending registration.
static char * cfg_filename
Name of the configuration file.
A clique (everyone connected to everyone else).
void GNUNET_TESTBED_underlaylinkmodel_add_peer(struct GNUNET_TESTBED_UnderlayLinkModel *model, struct GNUNET_TESTBED_Peer *peer)
Add a peer to the given model.
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_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...
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.
void GNUNET_TESTBED_barrier_wait_cancel(struct GNUNET_TESTBED_BarrierWaitHandle *h)
Cancel a barrier wait handle.
static char * subsystem
Set to subsystem that we&#39;re going to get stats for (or NULL for all).
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:1723
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.
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.
GNUNET_TESTBED_PeerInformationType
Types of information that can be requested about a peer.
GNUNET_TESTBED_TopologyOption
Topologies and topology options supported for testbeds.
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:2443
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:1960
Handle to interact with a GNUnet testbed controller.
Definition: testbed_api.h:194
struct GNUNET_TESTBED_Host * host
Handle for the host where the peer was started.
struct GNUNET_TESTBED_EventInformation::@58::@61 peer_connect
Details about connect event.
void GNUNET_TESTBED_is_host_habitable_cancel(struct GNUNET_TESTBED_HostHabitableCheckHandle *handle)
Function to cancel a request started using GNUNET_TESTBED_is_host_habitable()
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.
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.
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.
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_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().
static unsigned long long max_connections
If there are at least this many connections, old ones will be removed.
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 &#39;main&#39;...
static int start
Set if we are to start default services (including ARM).
Definition: gnunet-arm.c:39
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:1833
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:244
struct GNUNET_TESTBED_EventInformation::@58::@62 peer_disconnect
Details about disconnect event.
All peers are disconnected.
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...
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.
Argument to GNUNET_TESTBED_ControllerCallback with details about the event.
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_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.
enum GNUNET_TESTBED_EventType type
Type of the event.
void(* GNUNET_TESTBED_HostRegistrationCompletion)(void *cls, const char *emsg)
Callback which will be called to after a host registration succeeded or failed.
const char * emsg
Error message for the operation, NULL on success.
Opaque handle to a host running experiments managed by the testing framework.
Handle for controller process.
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.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:94
Opaque handle to an abstract operation to be executed by the testing framework.
GNUNET_TESTBED_BarrierStatus
Status of a barrier.
GNUNET_TESTBED_HostHabitableCallback cb
The callback to call once we have the status.
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.
void(* GNUNET_TESTBED_ControllerStatusCallback)(void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, int status)
Callback to signal successfull startup of the controller process.
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. ...
struct GNUNET_PeerIdentity * id
The identity of the peer.
Read a topology from a given file.
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.
static char * value
Value of the record to add/remove.
Certain percentage of peers are unable to communicate directly replicating NAT conditions.
Special value (not valid for requesting information) that is used in the event struct if a &#39;generic&#39; ...
How many times should the failed overlay connect operations be retried before giving up...
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_underlaylinkmodel_free(struct GNUNET_TESTBED_UnderlayLinkModel *model)
Free the resources of the model.
The handle for whether a host is habitable or not.
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.
The model is based on black listing of peers to which underlay connections are not permitted...
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...
static char * service_name
Option -s: service name (hash to get service descriptor)
Definition: gnunet-vpn.c:51
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:1938
A requested testbed operation has been completed.
uint16_t status
See PRISM_STATUS_*-constants.
static char * filename
static const struct GNUNET_CONFIGURATION_Handle * config
What configuration is the peer using? Returns a &#39;const struct GNUNET_CONFIGURATION_Handle *&#39;...
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
static int result
Global testing status.
struct GNUNET_TESTBED_Controller * controller
Our controller context (not necessarily the controller that is responsible for starting/running the p...
void(* GNUNET_TESTBED_DisconnectAdapter)(void *cls, void *op_result)
Adapter function called to destroy a connection to a service.
void GNUNET_TESTBED_barrier_cancel(struct GNUNET_TESTBED_Barrier *barrier)
Cancel a barrier.
Definition: testbed_api.c:2459
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:2046
struct GNUNET_TESTBED_EventInformation::@58::@59 peer_start
Details about peer start event.
GNUNET_TESTBED_UnderlayLinkModelType
The type of GNUNET_TESTBED_UnderlayLinkModel.
Handle for barrier.
Definition: testbed_api.h:279
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.
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.
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_CONFIGURATION_Handle * cfg
The configuration of the peer.
A connection between two peers was torn down.
struct GNUNET_TESTBED_EventInformation::@58::@63 operation_finished
Details about an operation finished event.
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.
The options should always end with this.
GNUNET_TESTBED_ConnectOption
Options for peer connections.
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.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:104
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_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.
uint64_t event_mask
Global event mask for all testbed events.
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.
const char * username
The username to be used for SSH login.
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_host_destroy(struct GNUNET_TESTBED_Host *host)
Destroy a host handle.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_peer_update_configuration(struct GNUNET_TESTBED_Peer *peer, const struct GNUNET_CONFIGURATION_Handle *cfg)
Change peer configuration.
GUID host
struct GNUNET_TESTBED_Peer * peer
Handle for the peer that was started.
const char * name
union GNUNET_TESTBED_EventInformation::@58 details
Details about the event.
Small-world network (2d torus plus random links).
No option (not valid as an argument).
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:1558
void * op_cls
Closure given while creating the above operation.
A connection between two peers was established.
static unsigned int num_peers
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.
GNUNET_TESTBED_EventType
Enumeration with (at most 64) possible event types that can be monitored using the testbed framework...
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).
static char * host_filename
Data file with the hosts for the testbed.
void(* GNUNET_TESTBED_OperationCompletionCallback)(void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg)
Callback to be called when an operation is completed.
The identity of the host (wraps the signing key of the peer).
const char * GNUNET_TESTBED_host_get_hostname(const struct GNUNET_TESTBED_Host *host)
Obtain the host&#39;s hostname.
What is the identity of the peer? Returns a &#39;const struct GNUNET_PeerIdentity *&#39;. ...
static char * hostname
Our hostname; we give this to all the peers we start.
Allow or disallow a connection between the specified 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:2288
static uint16_t port
Port number.
Definition: gnunet-bcd.c:79
configuration data
Definition: configuration.c:85
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.
unsigned int GNUNET_TESTBED_hosts_load_from_loadleveler(const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_TESTBED_Host ***hosts)
Loads the set of host allocated by the LoadLeveler Job Scheduler.
The model is based on white listing of peers to which underlay connections are permitted.
static struct CadetPeer * peers
Operation to get peer ids.
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:2326
void(* GNUNET_TESTBED_barrier_wait_cb)(void *cls, const char *name, int status)
Functions of this type are to be given as acallback argumetn to GNUNET_TESTBED_barrier_wait().
struct GNUNET_TESTBED_EventInformation::@58::@60 peer_stop
Details about peer stop event.
Barrier initialised successfully.
handle for host registration
struct GNUNET_TESTBED_Peer * peer1
Handle for one of the connected peers.
void GNUNET_TESTBED_underlaylinkmodel_commit(struct GNUNET_TESTBED_UnderlayLinkModel *model)
Commit the model.
Model for configuring underlay links of a peer.
A peer controlled by the testing framework.
A peer has been 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.
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.
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.
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_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.
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.
Data returned from GNUNET_TESTBED_peer_get_information.
struct GNUNET_TESTBED_Operation * op
Handle for the corresponding operation that generated this event.
Small-world network (ring plus random links).