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 
240 
245 
250 
255 
260 };
261 
262 
274 
283 
290 };
291 
292 
302 
307 
311  void *op_cls;
312 
316  union {
320  struct {
326 
331  } peer_start;
332 
336  struct {
340  struct GNUNET_TESTBED_Peer *peer;
341  } peer_stop;
342 
346  struct {
351 
356  } peer_connect;
357 
361  struct {
365  struct GNUNET_TESTBED_Peer *peer1;
366 
370  struct GNUNET_TESTBED_Peer *peer2;
371  } peer_disconnect;
372 
376  struct {
380  const char *emsg;
381 
386  void *generic;
388  } details;
389 };
390 
391 
399 typedef void
401  const struct GNUNET_TESTBED_EventInformation *event);
402 
403 
408 
409 
419 typedef void
421  const struct GNUNET_CONFIGURATION_Handle *cfg,
422  int status);
423 
424 
449 GNUNET_TESTBED_controller_start(const char *trusted_ip,
450  struct GNUNET_TESTBED_Host *host,
452  void *cls);
453 
454 
463 void
465 
466 
485  uint64_t event_mask,
487  void *cc_cls);
488 
489 
497 void
499 
500 
505 
506 
513 typedef void
515  const char *emsg);
516 
517 
535  struct GNUNET_TESTBED_Host *host,
537  void *cc_cls);
538 
539 
549 void
551  *handle);
552 
553 
562 typedef void
565  const char *emsg);
566 
567 
598  struct GNUNET_TESTBED_Controller *master,
599  struct GNUNET_TESTBED_Host *delegated_host,
600  struct GNUNET_TESTBED_Host *slave_host,
601  int is_subordinate);
602 
603 
621  struct GNUNET_TESTBED_Controller *master,
622  struct GNUNET_TESTBED_Host *slave_host);
623 
624 
634 typedef void
636  struct GNUNET_TESTBED_Peer *peer,
637  const char *emsg);
638 
639 
671  struct GNUNET_TESTBED_Host *host,
672  const struct GNUNET_CONFIGURATION_Handle *cfg,
674  void *cls);
675 
676 
684 typedef void
686  const char *emsg);
687 
688 
701  struct GNUNET_TESTBED_Peer *peer,
703  void *pcc_cls);
704 
705 
720  struct GNUNET_TESTBED_Peer *peer,
722  void *pcc_cls);
723 
724 
734 
738  union {
743 
748  } result;
749 };
750 
751 
762 typedef void
765  const struct GNUNET_TESTBED_PeerInformation *pinfo,
766  const char *emsg);
767 
768 
786  pit,
788  void *cb_cls);
789 
790 
801  const struct GNUNET_CONFIGURATION_Handle *cfg);
802 
803 
813 
814 
832  struct GNUNET_TESTBED_Peer *peer,
833  const char *service_name,
835  void *cb_cls,
836  unsigned int start);
837 
838 
856  void *op_cls,
858  void *cb_cls);
859 
860 
861 
870 
879 
885 };
886 
887 
902  struct GNUNET_TESTBED_Peer *p1,
903  struct GNUNET_TESTBED_Peer *p2,
905  va_list ap);
906 
907 
922  struct GNUNET_TESTBED_Peer *p1,
923  struct GNUNET_TESTBED_Peer *p2,
924  enum GNUNET_TESTBED_ConnectOption co, ...);
925 
926 
927 
938 
944 
950 
955 
960 
965 
971 
978 
990 
995 
1000 
1005 
1010 
1011  /* The following are not topologies but influence how the topology has to be
1012  setup. These options should follow the topology specific options (if
1013  required by the chosen topology). Note that these should be given before
1014  GNUNET_TESTBED_TOPOLOGY_OPTION_END */
1015 
1024 };
1025 
1026 
1038 struct GNUNET_TESTBED_Operation *
1040  unsigned int num_peers,
1041  struct GNUNET_TESTBED_Peer **peers,
1043  va_list ap);
1044 
1045 
1057 struct GNUNET_TESTBED_Operation *
1059  unsigned int num_peers,
1060  struct GNUNET_TESTBED_Peer **peers,
1062  ...);
1063 
1064 
1079 struct GNUNET_TESTBED_Operation *
1082  void *cb_cls,
1083  struct GNUNET_TESTBED_Peer *p1,
1084  struct GNUNET_TESTBED_Peer *p2);
1085 
1086 
1097  unsigned int nsuccess,
1098  unsigned int nfailures);
1099 
1100 
1121 struct GNUNET_TESTBED_Operation *
1123  unsigned int num_peers,
1124  struct GNUNET_TESTBED_Peer **peers,
1125  unsigned int *max_connections,
1127  comp_cb,
1128  void *comp_cb_cls,
1130  va_list va);
1131 
1132 
1153 struct GNUNET_TESTBED_Operation *
1155  unsigned int num_peers,
1156  struct GNUNET_TESTBED_Peer **peers,
1157  unsigned int *max_connections,
1159  comp_cb,
1160  void *comp_cb_cls,
1162  ...);
1163 
1164 
1175 void
1177  const char *filename);
1178 
1179 
1190 typedef void *
1191 (*GNUNET_TESTBED_ConnectAdapter)(void *cls,
1192  const struct GNUNET_CONFIGURATION_Handle *cfg);
1193 
1194 
1202 typedef void
1204  void *op_result);
1205 
1206 
1216 typedef void
1218  struct GNUNET_TESTBED_Operation *op,
1219  void *ca_result,
1220  const char *emsg);
1221 
1222 
1245 struct GNUNET_TESTBED_Operation *
1247  struct GNUNET_TESTBED_Peer *peer,
1248  const char *service_name,
1250  void *cb_cls,
1253  void *cada_cls);
1254 
1255 
1277 void
1279 
1280 
1292 typedef int
1294  const struct GNUNET_TESTBED_Peer *peer,
1295  const char *subsystem,
1296  const char *name,
1297  uint64_t value,
1298  int is_persistent);
1299 
1300 
1316 struct GNUNET_TESTBED_Operation *
1318  struct GNUNET_TESTBED_Peer **peers,
1319  const char *subsystem, const char *name,
1322  void *cls);
1323 
1324 
1333 uint32_t
1334 GNUNET_TESTBED_get_index(const struct GNUNET_TESTBED_Peer *peer);
1335 
1336 
1341 
1342 
1357 typedef void
1359  struct GNUNET_TESTBED_RunHandle *h,
1360  unsigned int num_peers,
1361  struct GNUNET_TESTBED_Peer **peers,
1362  unsigned int links_succeeded,
1363  unsigned int links_failed);
1364 
1365 
1399 void
1400 GNUNET_TESTBED_run(const char *host_filename,
1401  const struct GNUNET_CONFIGURATION_Handle *cfg,
1402  unsigned int num_peers,
1403  uint64_t event_mask,
1405  void *cc_cls,
1407  void *test_master_cls);
1408 
1409 
1448 int
1449 GNUNET_TESTBED_test_run(const char *testname,
1450  const char *cfg_filename,
1451  unsigned int num_peers,
1452  uint64_t event_mask,
1454  void *cc_cls,
1456  void *test_master_cls);
1457 
1458 
1468 
1469 
1473 struct GNUNET_TESTBED_Barrier;
1474 
1475 
1484 
1489 
1494 };
1495 
1496 
1512 typedef void
1514  const char *name,
1515  struct GNUNET_TESTBED_Barrier *barrier,
1517  const char *emsg);
1518 
1519 
1534 struct GNUNET_TESTBED_Barrier *
1536  const char *name,
1537  unsigned int quorum,
1539  void *cb_cls);
1540 
1541 
1547 void
1549 
1550 
1555 
1556 
1567 typedef void
1569  const char *name,
1570  int status);
1571 
1572 
1585 GNUNET_TESTBED_barrier_wait(const char *name,
1587  void *cls);
1588 
1589 
1596 void
1598 
1599 
1605 
1606 
1618 
1625 };
1626 
1627 
1640 
1641 
1651 void
1653  struct GNUNET_TESTBED_Peer *peer);
1654 
1655 
1667 void
1669  struct GNUNET_TESTBED_Peer *peer,
1670  uint32_t latency,
1671  uint32_t loss,
1672  uint32_t bandwidth);
1673 
1674 
1681 void
1683 
1684 
1693 void
1695 
1696 
1697 #if 0 /* keep Emacsens' auto-indent happy */
1698 {
1699 #endif
1700 
1701 
1702 #ifdef __cplusplus
1703 }
1704 #endif
1705 
1706 #endif
1707  /* 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:1713
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:2430
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:1951
Handle to interact with a GNUnet testbed controller.
Definition: testbed_api.h:191
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:1824
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:243
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:1928
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.
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:2451
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:2037
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:274
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.
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:1547
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:2275
static uint16_t port
Port number.
Definition: gnunet-bcd.c:81
configuration data
Definition: configuration.c:83
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:2314
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).