GNUnet  0.10.x
testbed_api_testbed.c
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 
28 #include "platform.h"
29 #include "gnunet_util_lib.h"
30 #include "gnunet_testbed_service.h"
31 #include "testbed_api.h"
32 #include "testbed_api_peers.h"
33 #include "testbed_api_hosts.h"
34 #include "testbed_api_topology.h"
35 
39 #define LOG(kind, ...) \
40  GNUNET_log_from(kind, "testbed-api-testbed", __VA_ARGS__)
41 
45 #define DEBUG(...) \
46  LOG(GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__)
47 
51 #define DEFAULT_SETUP_TIMEOUT 300
52 
53 
57 #define TESTBED_CONFIG_SECTION "testbed"
58 
63 #define SCALE_FREE_CAP "SCALE_FREE_TOPOLOGY_CAP"
64 
69 #define SCALE_FREE_M "SCALE_FREE_TOPOLOGY_M"
70 
79 
84 
88  void *cls;
89 };
90 
91 
95 enum State {
99  RC_INIT = 0,
100 
105 
110 
117 
118  /* /\** */
119  /* * Peers are stopped */
120  /* *\/ */
121  /* RC_PEERS_STOPPED, */
122 
123  /* /\** */
124  /* * Peers are destroyed */
125  /* *\/ */
126  /* RC_PEERS_DESTROYED */
127 
132 };
133 
134 
143 
148 
152  unsigned int index;
153 };
154 
155 
164 
171 
176 
181 
186 
190  void *cc_cls;
191 
195  char *trusted_ip;
196 
201 
206 
211 
216 
221 
226 
232 
236  char *topo_file;
237 
242 
246  struct GNUNET_TIME_Absolute pstart_time;
247 
252 
257 
262 
266  uint64_t event_mask;
267 
271  enum State state;
272 
277 
281  int shutdown;
282 
286  unsigned int num_hosts;
287 
292  unsigned int reg_hosts;
293 
298  unsigned int peer_count;
299 
303  unsigned int num_peers;
304 
308  unsigned int num_oc;
309 
313  unsigned int random_links;
314 
318  unsigned int links_succeeded;
319 
323  unsigned int links_failed;
324 };
325 
326 
333 static uint32_t
334 rcop_key(void *rcop)
335 {
336  return *((uint32_t *)&rcop);
337 }
338 
339 
343 struct SearchContext {
348 
353 };
354 
355 
364 static int
365 search_iterator(void *cls, uint32_t key, void *value)
366 {
367  struct RunContextOperation *rcop = value;
368  struct SearchContext *sc = cls;
369 
370  GNUNET_assert(NULL != rcop);
371  if (sc->query == rcop->op)
372  {
373  GNUNET_assert(NULL == sc->result);
374  sc->result = rcop;
375  return GNUNET_NO;
376  }
377  return GNUNET_YES;
378 }
379 
380 
389 static struct RunContextOperation *
391 {
392  struct SearchContext sc;
393 
394  sc.query = op;
395  sc.result = NULL;
396  if (GNUNET_SYSERR ==
398  rcop_key(op),
400  &sc))
401  {
402  GNUNET_assert(NULL != sc.result);
403  return sc.result;
404  }
405  return NULL;
406 }
407 
408 
415 static void
417 {
420  rcop_key(rcop->op), rcop,
422 }
423 
424 
432 static void
434 {
437  rcop_key(rcop->op),
438  rcop));
439 }
440 
446 static void
448 {
449  unsigned int hid;
450 
451  GNUNET_assert(NULL == rc->register_hosts_task);
452  GNUNET_assert(NULL == rc->reg_handle);
453  GNUNET_assert(NULL == rc->peers);
454  GNUNET_assert(NULL == rc->hclist);
458  if (NULL != rc->c)
460  if (NULL != rc->cproc)
462  if (NULL != rc->h)
464  for (hid = 0; hid < rc->num_hosts; hid++)
467  if (NULL != rc->cfg)
471  GNUNET_free(rc);
472 }
473 
474 
483 static int
484 rcop_cleanup_iterator(void *cls, uint32_t key, void *value)
485 {
486  struct GNUNET_TESTBED_RunHandle *rc = cls;
487  struct RunContextOperation *rcop = value;
488 
489  GNUNET_assert(rc == rcop->rc);
490  remove_rcop(rc, rcop);
492  GNUNET_free(rcop);
493  return GNUNET_YES;
494 }
495 
496 
502 static void
504 {
505  struct CompatibilityCheckContext *hc;
506  unsigned int nhost;
507 
508  if (NULL != rc->hclist)
509  {
510  for (nhost = 0; nhost < rc->num_hosts; nhost++)
511  {
512  hc = &rc->hclist[nhost];
513  if (NULL != hc->h)
515  }
516  GNUNET_free(rc->hclist);
517  rc->hclist = NULL;
518  }
519  /* Stop register hosts task if it is running */
520  if (NULL != rc->register_hosts_task)
521  {
523  rc->register_hosts_task = NULL;
524  }
525  if (NULL != rc->timeout_task)
526  {
528  rc->timeout_task = NULL;
529  }
530  if (NULL != rc->reg_handle)
531  {
533  rc->reg_handle = NULL;
534  }
535  if (NULL != rc->topology_operation)
536  {
538  rc->topology_operation = NULL;
539  }
540  /* cancel any exiting operations */
544  rc));
545 }
546 
547 
553 static void
555 {
557  rc->interrupt_task = NULL;
558 }
559 
560 
567 static void
569 {
570  struct GNUNET_TESTBED_RunHandle *rc = cls;
571  struct RunContextOperation *rcop;
572 
573  if ((NULL == rc->cproc)
574  || (NULL == rc->c)
575  || (GNUNET_YES == rc->shutdown))
576  {
577  if (NULL != rc->peers)
578  {
579  GNUNET_free(rc->peers);
580  rc->peers = NULL;
581  }
582  goto cleanup_;
583  }
584  if (NULL == rc->peers)
585  goto cleanup_;
586  rc->shutdown = GNUNET_YES;
587  rcop = GNUNET_new(struct RunContextOperation);
588  rcop->rc = rc;
589  rcop->op = GNUNET_TESTBED_shutdown_peers(rc->c, rcop, NULL, NULL);
590  GNUNET_assert(NULL != rcop->op);
591  DEBUG("Shutting down peers\n");
593  insert_rcop(rc, rcop);
594  return;
595 
596 cleanup_:
597  rc->state = RC_PEERS_SHUTDOWN;
599  cleanup(rc);
600 }
601 
602 
608 static void
610 {
611  struct GNUNET_TESTBED_RunHandle *rc = cls;
612  struct GNUNET_TESTBED_Controller *c = rc->c;
613  unsigned int size;
614 
615  /* reschedule */
618  if ((GNUNET_NO == rc->shutdown) &&
619  (NULL != c) &&
620  (NULL != c->opc_map) &&
621  (0 != (size = GNUNET_CONTAINER_multihashmap32_size(c->opc_map))))
622  {
624  "Shutdown postponed as there are %u operations currently active\n",
625  size);
627  c->opcq_empty_cls = rc;
628  return;
629  }
630  wait_op_completion(rc);
631 }
632 
633 
641 static const char *
643 {
644  struct GNUNET_TIME_Relative ptime;
645 
648 }
649 
650 
656 static void
658 {
659  struct GNUNET_TESTBED_RunHandle *rc = cls;
660  struct RunContextOperation *rcop;
661  unsigned int peer;
662 
663  DEBUG("Starting Peers\n");
665  for (peer = 0; peer < rc->num_peers; peer++)
666  {
667  rcop = GNUNET_new(struct RunContextOperation);
668  rcop->rc = rc;
669  rcop->op = GNUNET_TESTBED_peer_start(NULL, rc->peers[peer], NULL, NULL);
670  GNUNET_assert(NULL != rcop->op);
671  rcop->cls = rc->peers[peer];
672  insert_rcop(rc, rcop);
673  }
674  rc->peer_count = 0;
675 }
676 
677 
687 static void
688 peer_create_cb(void *cls, struct GNUNET_TESTBED_Peer *peer, const char *emsg)
689 {
690  struct RunContextOperation *rcop = cls;
692 
693  GNUNET_assert(NULL != rcop);
694  GNUNET_assert(NULL != (rc = rcop->rc));
695  remove_rcop(rc, rcop);
697  GNUNET_free(rcop);
698  if (NULL == peer)
699  {
700  if (NULL != emsg)
701  LOG(GNUNET_ERROR_TYPE_ERROR, "Error while creating a peer: %s\n",
702  emsg);
704  return;
705  }
706  rc->peers[rc->peer_count] = peer;
707  rc->peer_count++;
708  if (rc->peer_count < rc->num_peers)
709  return;
710  DEBUG("%u peers created in %s\n", rc->num_peers, prof_time(rc));
711  rc->state = RC_PEERS_CREATED;
713 }
714 
715 
721 static void
723 {
725  rc->timeout_task = NULL;
726  if (NULL != rc->test_master)
727  rc->test_master(rc->test_master_cls, rc, rc->num_peers, rc->peers,
728  rc->links_succeeded, rc->links_failed);
729 }
730 
731 
741 static void
742 topology_completion_callback(void *cls, unsigned int nsuccess,
743  unsigned int nfailures)
744 {
745  struct GNUNET_TESTBED_RunHandle *rc = cls;
746 
747  DEBUG("Overlay topology generated in %s\n", prof_time(rc));
749  rc->topology_operation = NULL;
750  rc->links_succeeded = nsuccess;
751  rc->links_failed = nfailures;
752  rc->state = RC_READY;
753  call_master(rc);
754 }
755 
756 
762 static void
764 {
765  struct RunContextOperation *rcop;
766  unsigned int peer;
767 
768  DEBUG("Creating peers\n");
770  rc->peers =
771  GNUNET_malloc(sizeof(struct GNUNET_TESTBED_Peer *) * rc->num_peers);
772  GNUNET_assert(NULL != rc->c);
773  rc->peer_count = 0;
774  for (peer = 0; peer < rc->num_peers; peer++)
775  {
776  rcop = GNUNET_new(struct RunContextOperation);
777  rcop->rc = rc;
778  rcop->op =
780  (0 ==
781  rc->num_hosts) ? rc->h : rc->hosts[peer %
782  rc->num_hosts],
783  rc->cfg, &peer_create_cb, rcop);
784  GNUNET_assert(NULL != rcop->op);
785  insert_rcop(rc, rcop);
786  }
787 }
788 
789 
797 static void
798 event_cb(void *cls, const struct GNUNET_TESTBED_EventInformation *event)
799 {
800  struct GNUNET_TESTBED_RunHandle *rc = cls;
801  struct RunContextOperation *rcop;
802 
803  if (RC_INIT == rc->state)
804  {
805  switch (event->type)
806  {
808  rcop = event->op_cls;
809  if (NULL != event->details.operation_finished.emsg)
810  {
811  LOG(GNUNET_ERROR_TYPE_ERROR, _("Linking controllers failed. Exiting"));
813  }
814  else
815  rc->reg_hosts++;
816  GNUNET_assert(event->op == rcop->op);
817  remove_rcop(rc, rcop);
819  GNUNET_free(rcop);
820  if (rc->reg_hosts == rc->num_hosts)
821  {
822  rc->state = RC_LINKED;
823  create_peers(rc);
824  }
825  return;
826 
827  default:
828  GNUNET_break(0);
830  return;
831  }
832  }
834  goto call_cc;
835  if (NULL == (rcop = search_rcop(rc, event->op)))
836  goto call_cc;
837  remove_rcop(rc, rcop);
839  GNUNET_free(rcop);
840  if ((GNUNET_NO == rc->shutdown)
841  && (NULL != event->details.operation_finished.emsg))
842  {
843  LOG(GNUNET_ERROR_TYPE_ERROR, "A operation has failed with error: %s\n",
844  event->details.operation_finished.emsg);
846  return;
847  }
849  switch (rc->state)
850  {
851  case RC_LINKED:
852  case RC_PEERS_CREATED:
853  case RC_READY:
854  rc->state = RC_PEERS_SHUTDOWN;
856  rc->peers = NULL;
857  DEBUG("Peers shut down in %s\n", prof_time(rc));
859  break;
860 
861  default:
862  GNUNET_assert(0);
863  }
864  return;
865 
866 call_cc:
867  if ((0 != (rc->event_mask & (1LL << event->type))) && (NULL != rc->cc))
868  rc->cc(rc->cc_cls, event);
869  if (GNUNET_TESTBED_ET_PEER_START != event->type)
870  return;
871  if (NULL == (rcop = search_rcop(rc, event->op))) /* Not our operation */
872  return;
873  remove_rcop(rc, rcop);
875  GNUNET_free(rcop);
876  rc->peer_count++;
877  if (rc->peer_count < rc->num_peers)
878  return;
879  DEBUG("%u peers started in %s\n", rc->num_peers, prof_time(rc));
881  {
882  switch (rc->topology)
883  {
885  GNUNET_assert(0);
886 
890  rc->topology_operation =
892  rc->peers, &rc->num_oc,
894  rc,
895  rc->topology,
896  rc->random_links,
898  break;
899 
901  GNUNET_assert(NULL != rc->topo_file);
902  rc->topology_operation =
904  rc->peers, &rc->num_oc,
906  rc,
907  rc->topology,
908  rc->topo_file,
910  break;
911 
913  {
914  unsigned long long number;
915  unsigned int cap;
919  &number));
920  cap = (unsigned int)number;
923  SCALE_FREE_M,
924  &number));
925  rc->topology_operation =
927  rc->peers, &rc->num_oc,
929  rc,
930  rc->topology,
931  cap, /* uint16_t */
932  (unsigned int)number, /* uint8_t */
934  }
935  break;
936 
937  default:
938  rc->topology_operation =
940  rc->peers, &rc->num_oc,
942  rc,
943  rc->topology,
945  }
946  if (NULL == rc->topology_operation)
948  "Not generating a topology. Check number of peers\n");
949  else
950  {
951  DEBUG("Creating overlay topology\n");
953  return;
954  }
955  }
956  rc->state = RC_READY;
957  call_master(rc);
958 }
959 
960 
966 static void
967 register_hosts(void *cls);
968 
969 
976 static void
977 host_registration_completion(void *cls, const char *emsg)
978 {
979  struct GNUNET_TESTBED_RunHandle *rc = cls;
980 
981  rc->reg_handle = NULL;
982  if (NULL != emsg)
983  {
985  _("Host registration failed for a host. Error: %s\n"), emsg);
987  return;
988  }
990  rc);
991 }
992 
993 
999 static void
1001 {
1002  struct GNUNET_TESTBED_RunHandle *rc = cls;
1003  struct RunContextOperation *rcop;
1004  unsigned int slave;
1005 
1006  rc->register_hosts_task = NULL;
1007  if (rc->reg_hosts == rc->num_hosts)
1008  {
1009  DEBUG("All hosts successfully registered\n");
1010  /* Start slaves */
1011  for (slave = 0; slave < rc->num_hosts; slave++)
1012  {
1013  rcop = GNUNET_new(struct RunContextOperation);
1014  rcop->rc = rc;
1015  rcop->op =
1016  GNUNET_TESTBED_controller_link(rcop, rc->c, rc->hosts[slave],
1017  rc->h, GNUNET_YES);
1018  GNUNET_assert(NULL != rcop->op);
1019  insert_rcop(rc, rcop);
1020  }
1021  rc->reg_hosts = 0;
1022  return;
1023  }
1024  rc->reg_handle =
1027  rc->reg_hosts++;
1028 }
1029 
1030 
1040 static void
1042  int status)
1043 {
1044  struct GNUNET_TESTBED_RunHandle *rc = cls;
1045  uint64_t event_mask;
1046 
1047  if (status != GNUNET_OK)
1048  {
1049  rc->cproc = NULL;
1051  _("Controller crash detected. Shutting down.\n"));
1053  return;
1054  }
1056  rc->cfg = GNUNET_CONFIGURATION_dup(cfg);
1057  event_mask = rc->event_mask;
1058  event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED);
1059  event_mask |= (1LL << GNUNET_TESTBED_ET_PEER_START);
1061  event_mask |= GNUNET_TESTBED_ET_CONNECT;
1062  rc->c =
1063  GNUNET_TESTBED_controller_connect(rc->h, event_mask, &event_cb, rc);
1064  if (0 < rc->num_hosts)
1065  {
1066  rc->reg_hosts = 0;
1068  return;
1069  }
1070  rc->state = RC_LINKED;
1071  create_peers(rc);
1072 }
1073 
1074 
1087 static int
1088 netint_proc(void *cls, const char *name, int isDefault,
1089  const struct sockaddr *addr, const struct sockaddr *broadcast_addr,
1090  const struct sockaddr *netmask, socklen_t addrlen)
1091 {
1092  struct GNUNET_TESTBED_RunHandle *rc = cls;
1093  char hostip[NI_MAXHOST];
1094  char *buf;
1095 
1096  if (sizeof(struct sockaddr_in) != addrlen)
1097  return GNUNET_OK; /* Only consider IPv4 for now */
1098  if (0 !=
1099  getnameinfo(addr, addrlen, hostip, NI_MAXHOST, NULL, 0, NI_NUMERICHOST))
1101  if (NULL == rc->trusted_ip)
1102  {
1103  rc->trusted_ip = GNUNET_strdup(hostip);
1104  return GNUNET_YES;
1105  }
1106  (void)GNUNET_asprintf(&buf, "%s; %s", rc->trusted_ip, hostip);
1107  GNUNET_free(rc->trusted_ip);
1108  rc->trusted_ip = buf;
1109  return GNUNET_YES;
1110 }
1111 
1112 
1123 static void
1124 host_habitable_cb(void *cls, const struct GNUNET_TESTBED_Host *host,
1125  int status)
1126 {
1127  struct CompatibilityCheckContext *hc = cls;
1128  struct GNUNET_TESTBED_RunHandle *rc;
1129  struct GNUNET_TESTBED_Host **old_hosts;
1130  unsigned int nhost;
1131 
1132  GNUNET_assert(NULL != (rc = hc->rc));
1133  nhost = hc->index;
1134  GNUNET_assert(nhost <= rc->num_hosts);
1135  GNUNET_assert(host == rc->hosts[nhost]);
1136  hc->h = NULL;
1137  if (GNUNET_NO == status)
1138  {
1139  if ((NULL != host) && (NULL != GNUNET_TESTBED_host_get_hostname(host)))
1140  LOG(GNUNET_ERROR_TYPE_ERROR, _("Host %s cannot start testbed\n"),
1142  else
1144  _("Testbed cannot be started on localhost\n"));
1146  return;
1147  }
1148  rc->reg_hosts++;
1149  if (rc->reg_hosts < rc->num_hosts)
1150  return;
1151  GNUNET_free(rc->hclist);
1152  rc->hclist = NULL;
1153  rc->h = rc->hosts[0];
1154  rc->num_hosts--;
1155  if (0 < rc->num_hosts)
1156  {
1157  old_hosts = rc->hosts;
1158  rc->hosts =
1159  GNUNET_malloc(sizeof(struct GNUNET_TESTBED_Host *) * rc->num_hosts);
1160  GNUNET_memcpy(rc->hosts, &old_hosts[1],
1161  (sizeof(struct GNUNET_TESTBED_Host *) * rc->num_hosts));
1162  GNUNET_free(old_hosts);
1163  }
1164  else
1165  {
1166  GNUNET_free(rc->hosts);
1167  rc->hosts = NULL;
1168  }
1170  for (nhost = 0; nhost < rc->num_hosts; nhost++)
1171  GNUNET_TESTBED_host_resolve_(rc->hosts[nhost]);
1173  if (NULL == rc->trusted_ip)
1174  rc->trusted_ip = GNUNET_strdup("127.0.0.1");
1175  rc->cproc =
1177  &controller_status_cb, rc);
1178  GNUNET_free(rc->trusted_ip);
1179  rc->trusted_ip = NULL;
1180  if (NULL == rc->cproc)
1181  {
1182  LOG(GNUNET_ERROR_TYPE_ERROR, _("Cannot start the master controller"));
1184  }
1185 }
1186 
1187 
1193 static void
1195 {
1196  struct GNUNET_TESTBED_RunHandle *rc = cls;
1197 
1198  rc->timeout_task = NULL;
1200  _("Shutting down testbed due to timeout while setup.\n"));
1202  if (NULL != rc->test_master)
1203  rc->test_master(rc->test_master_cls, rc, 0, NULL, 0, 0);
1204  rc->test_master = NULL;
1205 }
1206 
1207 
1235 void
1237  const struct GNUNET_CONFIGURATION_Handle *cfg,
1238  unsigned int num_peers, uint64_t event_mask,
1241  void *test_master_cls)
1242 {
1243  struct GNUNET_TESTBED_RunHandle *rc;
1244  char *topology;
1245  struct CompatibilityCheckContext *hc;
1246  struct GNUNET_TIME_Relative timeout;
1247  unsigned long long number;
1248  unsigned int hid;
1249  unsigned int nhost;
1250 
1251  GNUNET_assert(num_peers > 0);
1252  rc = GNUNET_new(struct GNUNET_TESTBED_RunHandle);
1253  rc->cfg = GNUNET_CONFIGURATION_dup(cfg);
1254 #if ENABLE_SUPERMUC
1256  &rc->hosts);
1257  if (0 == rc->num_hosts)
1258  {
1260  _("No hosts loaded from LoadLeveler. Need at least one host\n"));
1261  goto error_cleanup;
1262  }
1263 #else
1264  if (NULL != host_filename)
1265  {
1266  rc->num_hosts =
1267  GNUNET_TESTBED_hosts_load_from_file(host_filename, rc->cfg,
1268  &rc->hosts);
1269  if (0 == rc->num_hosts)
1270  {
1272  _("No hosts loaded. Need at least one host\n"));
1273  goto error_cleanup;
1274  }
1275  }
1276  else
1277  rc->h = GNUNET_TESTBED_host_create(NULL, NULL, rc->cfg, 0);
1278 #endif
1279  rc->num_peers = num_peers;
1280  rc->event_mask = event_mask;
1281  rc->cc = cc;
1282  rc->cc_cls = cc_cls;
1283  rc->test_master = test_master;
1284  rc->test_master_cls = test_master_cls;
1285  rc->state = RC_INIT;
1287  if (GNUNET_OK ==
1289  "OVERLAY_TOPOLOGY", &topology))
1290  {
1291  if (GNUNET_NO == GNUNET_TESTBED_topology_get_(&rc->topology, topology))
1292  {
1294  "OVERLAY_TOPLOGY",
1295  _
1296  ("Specified topology must be supported by testbed"));
1297  }
1298  GNUNET_free(topology);
1299  }
1300  switch (rc->topology)
1301  {
1305  if (GNUNET_OK !=
1307  "OVERLAY_RANDOM_LINKS",
1308  &number))
1309  {
1310  /* OVERLAY option RANDOM & SMALL_WORLD_RING requires OVERLAY_RANDOM_LINKS
1311  * option to be set to the number of random links to be established */
1313  "OVERLAY_RANDOM_LINKS");
1314  goto error_cleanup;
1315  }
1316  if (number > UINT32_MAX)
1317  {
1318  GNUNET_break(0); /* Too big number */
1319  goto error_cleanup;
1320  }
1321  rc->random_links = (unsigned int)number;
1322  break;
1323 
1325  if (GNUNET_OK !=
1327  "OVERLAY_TOPOLOGY_FILE",
1328  &rc->topo_file))
1329  {
1331  "OVERLAY_TOPOLOGY_FILE");
1332  goto error_cleanup;
1333  }
1334  goto warn_ignore;
1335 
1337  if (GNUNET_OK !=
1339  SCALE_FREE_CAP, &number))
1340  {
1342  SCALE_FREE_CAP);
1343  goto error_cleanup;
1344  }
1345  if (UINT16_MAX < number)
1346  {
1348  _("Maximum number of edges a peer can have in a scale free topology"
1349  " cannot be more than %u. Given `%s = %llu'"), UINT16_MAX,
1350  SCALE_FREE_CAP, number);
1351  goto error_cleanup;
1352  }
1353  if (GNUNET_OK !=
1355  SCALE_FREE_M, &number))
1356  {
1358  SCALE_FREE_M);
1359  goto error_cleanup;
1360  }
1361  if (UINT8_MAX < number)
1362  {
1364  _("The number of edges that can established when adding a new node"
1365  " to scale free topology cannot be more than %u. Given `%s = %llu'"),
1366  UINT8_MAX, SCALE_FREE_M, number);
1367  goto error_cleanup;
1368  }
1369  goto warn_ignore;
1370 
1372  /* not allowed! */
1373  GNUNET_assert(0);
1374 
1375  default:
1376 warn_ignore:
1377  /* Warn if OVERLAY_RANDOM_LINKS is present that it will be ignored */
1378  if (GNUNET_YES ==
1380  "OVERLAY_RANDOM_LINKS"))
1382  "Ignoring value of `OVERLAY_RANDOM_LINKS' in given configuration\n");
1383  break;
1384  }
1385  if (0 != rc->num_hosts)
1386  {
1387  rc->hclist = GNUNET_malloc(sizeof(struct CompatibilityCheckContext)
1388  * rc->num_hosts);
1389  for (nhost = 0; nhost < rc->num_hosts; nhost++)
1390  {
1391  hc = &rc->hclist[nhost];
1392  hc->index = nhost;
1393  hc->rc = rc;
1394  hc->h = GNUNET_TESTBED_is_host_habitable(rc->hosts[nhost], rc->cfg,
1395  &host_habitable_cb, hc);
1396  if (NULL == hc->h)
1397  {
1398  GNUNET_break(0);
1399  for (nhost = 0; nhost < rc->num_hosts; nhost++)
1400  {
1401  hc = &rc->hclist[nhost];
1402  if (NULL != hc->h)
1404  }
1405  GNUNET_free(rc->hclist);
1406  rc->hclist = NULL;
1407  goto error_cleanup;
1408  }
1409  }
1410  }
1411  else
1412  rc->cproc =
1413  GNUNET_TESTBED_controller_start("127.0.0.1", rc->h,
1414  &controller_status_cb, rc);
1416  "SETUP_TIMEOUT",
1417  &timeout))
1418  {
1421  }
1423  rc->timeout_task =
1425  GNUNET_assert(NULL == rc->interrupt_task);
1426  rc->interrupt_task =
1428  rc);
1429  return;
1430 
1431 error_cleanup:
1432  if (NULL != rc->h)
1434  if (NULL != rc->hosts)
1435  {
1436  for (hid = 0; hid < rc->num_hosts; hid++)
1437  if (NULL != rc->hosts[hid])
1439  GNUNET_free(rc->hosts);
1440  }
1441  if (NULL != rc->cfg)
1443  GNUNET_free(rc);
1444 }
1445 
1446 
1456 {
1457  return h->c;
1458 }
1459 
1460 
1461 /* end of testbed_api_testbed.c */
static void start_peers_task(void *cls)
Task for starting peers.
void GNUNET_TESTBED_cancel_registration(struct GNUNET_TESTBED_HostRegistrationHandle *handle)
Cancel the pending registration.
Context information for the operation we start.
unsigned int index
Index of the host in the run context&#39;s hosts array.
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
enum State state
State of this context.
int GNUNET_CONFIGURATION_get_value_time(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, struct GNUNET_TIME_Relative *time)
Get a configuration value that should be a relative time.
unsigned int links_succeeded
the number of overlay link connection attempts that succeeded
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.
static void timeout_task(void *cls)
Task run upon timeout while setting up the testbed.
int GNUNET_CONFIGURATION_get_value_number(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *number)
Get a configuration value that should be a number.
GNUNET_TESTBED_TopologyOption
Topologies and topology options supported for testbeds.
struct GNUNET_SCHEDULER_Task * timeout_task
Task to be run of a timeout.
Handle to interact with a GNUnet testbed controller.
Definition: testbed_api.h:191
void * cc_cls
The pointer to the controller callback.
void GNUNET_TESTBED_is_host_habitable_cancel(struct GNUNET_TESTBED_HostHabitableCheckHandle *handle)
Function to cancel a request started using GNUNET_TESTBED_is_host_habitable()
unsigned int links_failed
the number of overlay link connection attempts that failed
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_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received, or when GNUNET_SCHEDULER_shutdown() is being invoked.
Definition: scheduler.c:1284
static void event_cb(void *cls, const struct GNUNET_TESTBED_EventInformation *event)
Signature of the event handler function called by the respective event controller.
TESTBED_opcq_empty_cb opcq_empty_cb
If this callback is not NULL, schedule it as a task when opc_map gets empty.
Definition: testbed_api.h:231
int GNUNET_CONTAINER_multihashmap32_iterate(struct GNUNET_CONTAINER_MultiHashMap32 *map, GNUNET_CONTAINER_MulitHashMapIterator32Callback it, void *it_cls)
Iterate over all entries in the map.
struct GNUNET_TESTBED_Operation * op
The testbed operation handle.
struct GNUNET_CONTAINER_MultiHashMap32 * rcop_map
A hashmap for operations started by us.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
struct GNUNET_TESTBED_HostRegistrationHandle * reg_handle
Host registration handle.
struct GNUNET_TESTBED_RunHandle * rc
Context information for GNUNET_TESTBED_run()
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 void wait_op_completion(void *cls)
This callback will be called when all the operations are completed (done/cancelled) ...
#define GNUNET_TIME_UNIT_SECONDS
One second.
All peers are disconnected.
unsigned int num_oc
Expected overlay connects.
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...
static void insert_rcop(struct GNUNET_TESTBED_RunHandle *rc, struct RunContextOperation *rcop)
Insert an RunContextOperation into the rcop_map of the given RunContext.
struct GNUNET_TESTBED_ControllerProc * cproc
The handle to the controller process.
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.
static struct RunContextOperation * search_rcop(struct GNUNET_TESTBED_RunHandle *rc, struct GNUNET_TESTBED_Operation *op)
Initiate a search for the given operation in the rcop_map.
char * trusted_ip
The trusted IP string.
Context for host compability checks.
Argument to GNUNET_TESTBED_ControllerCallback with details about the event.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define TESTBED_CONFIG_SECTION
Configuration section for testbed.
struct GNUNET_TESTBED_Controller * c
The controller handle.
void(* GNUNET_TESTBED_ControllerCallback)(void *cls, const struct GNUNET_TESTBED_EventInformation *event)
Signature of the event handler function called by the respective event controller.
unsigned int num_peers
number of peers to start
#define GNUNET_NO
Definition: gnunet_common.h:78
#define DEFAULT_SETUP_TIMEOUT
The default setup timeout in seconds.
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
enum GNUNET_TESTBED_EventType type
Type of the event.
enum GNUNET_TESTBED_TopologyOption topology
The topology to generate.
#define GNUNET_free_non_null(ptr)
Free the memory pointed to by ptr if ptr is not NULL.
static void interrupt(void *cls)
Task run upon interrupts (SIGINT, SIGTERM) and upon scheduler shutdown.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
void GNUNET_OS_network_interfaces_list(GNUNET_OS_NetworkInterfaceProcessor proc, void *proc_cls)
Enumerate all network interfaces.
Definition: os_network.c:388
int GNUNET_CONTAINER_multihashmap32_get_multiple(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, GNUNET_CONTAINER_MulitHashMapIterator32Callback it, void *it_cls)
Iterate over all entries in the map that match a particular key.
void GNUNET_log_config_invalid(enum GNUNET_ErrorType kind, const char *section, const char *option, const char *required)
Log error message about invalid configuration option value.
The testbed run is ready and the master callback can be called now.
Opaque handle to a host running experiments managed by the testing framework.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:517
struct GNUNET_TIME_Absolute pstart_time
Profiling start time.
Handle for controller process.
struct GNUNET_SCHEDULER_Task * interrupt_task
Task run upon shutdown interrupts.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
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.
int GNUNET_CONTAINER_multihashmap32_put(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
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.
#define _(String)
GNU gettext support macro.
Definition: platform.h:181
struct GNUNET_TESTBED_Host * h
Handle to the host on which the controller runs.
static uint32_t rcop_key(void *rcop)
Return a 32-bit key from a pointer.
Read a topology from a given file.
#define SCALE_FREE_M
Option string for the number of edges to be established when adding a new node to the scale free netw...
#define GNUNET_log_strerror(level, cmd)
Log an error message at log-level &#39;level&#39; that indicates a failure of the command &#39;cmd&#39; with the mess...
int GNUNET_asprintf(char **buf, const char *format,...)
Like asprintf, just portable.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition: scheduler.c:1237
static int search_iterator(void *cls, uint32_t key, void *value)
Iterator for searching over the elements matching a given query.
enum State state
current state of profiling
struct GNUNET_TESTBED_HostHabitableCheckHandle * h
Handle for the compability check.
int GNUNET_CONTAINER_multihashmap32_remove(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, const void *value)
Remove the given key-value pair from the map.
#define LOG(kind,...)
Generic loggins shorthand.
void GNUNET_log_config_missing(enum GNUNET_ErrorType kind, const char *section, const char *option)
Log error message about missing configuration option.
static char * value
Value of the record to add/remove.
char * topo_file
The file containing topology data.
struct CompatibilityCheckContext * hclist
Array of compatibility check contexts.
struct GNUNET_TESTBED_Operation * topology_operation
The topology generation operation.
static void create_peers(struct GNUNET_TESTBED_RunHandle *rc)
Function to create peers.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
Definition: scheduler.c:1264
void GNUNET_TESTBED_host_resolve_(struct GNUNET_TESTBED_Host *host)
Resolves the hostname of the host to an ip address.
The handle for whether a host is habitable or not.
int GNUNET_CONFIGURATION_have_value(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option)
Test if we have a value for a particular option.
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.
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
Definition: strings.c:686
A requested testbed operation has been completed.
void GNUNET_CONFIGURATION_destroy(struct GNUNET_CONFIGURATION_Handle *cfg)
Destroy configuration object.
unsigned int GNUNET_CONTAINER_multihashmap32_size(const struct GNUNET_CONTAINER_MultiHashMap32 *map)
Get the number of key-value pairs in the map.
uint16_t status
See PRISM_STATUS_*-constants.
static char buf[2048]
struct GNUNET_CONTAINER_MultiHashMap32 * opc_map
The map of active operation contexts.
Definition: testbed_api.h:226
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
Definition: time.c:440
struct GNUNET_TESTBED_RunHandle * rc
The run context.
unsigned int reg_hosts
Number of registered hosts.
static void call_master(struct GNUNET_TESTBED_RunHandle *rc)
call test master callback
Internal representation of the hash map.
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
#define DEBUG(...)
Debug logging shortcut.
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_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
Definition: time.c:118
struct GNUNET_TESTBED_EventInformation::@58::@63 operation_finished
Details about an operation finished event.
struct GNUNET_CONTAINER_MultiHashMap32 * GNUNET_CONTAINER_multihashmap32_create(unsigned int len)
Create a 32-bit key multi hash map.
The options should always end with this.
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.
void GNUNET_CONTAINER_multihashmap32_destroy(struct GNUNET_CONTAINER_MultiHashMap32 *map)
Destroy a 32-bit key hash map.
int GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be a string.
static void peer_create_cb(void *cls, struct GNUNET_TESTBED_Peer *peer, const char *emsg)
Functions of this signature are called when a peer has been successfully created. ...
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:104
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.
Controllers on given hosts started and linked.
void GNUNET_TESTBED_host_destroy(struct GNUNET_TESTBED_Host *host)
Destroy a host handle.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
struct GNUNET_HashCode key
The key used in the DHT.
#define GNUNET_SYSERR
Definition: gnunet_common.h:76
static unsigned int size
Size of the "table".
Definition: peer.c:66
struct RunContextOperation * result
The Run context operation which has the operation being queried.
const char * name
static void topology_completion_callback(void *cls, unsigned int nsuccess, unsigned int nfailures)
Callbacks of this type are called when topology configuration is completed.
static int netint_proc(void *cls, const char *name, int isDefault, const struct sockaddr *addr, const struct sockaddr *broadcast_addr, const struct sockaddr *netmask, socklen_t addrlen)
Callback function invoked for each interface found.
union GNUNET_TESTBED_EventInformation::@58 details
Details about the event.
Small-world network (2d torus plus random links).
static struct GNUNET_FS_SearchContext * sc
Definition: gnunet-search.c:37
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
State
Available states during profiling.
Peers are created.
A connection between two peers was established.
static unsigned int num_peers
Initial state.
struct GNUNET_TESTBED_Operation * query
The operation pointer to look for.
static void host_registration_completion(void *cls, const char *emsg)
Callback which will be called to after a host registration succeeded or failed.
static void cancel_interrupt_task(struct GNUNET_TESTBED_RunHandle *rc)
Cancels the scheduled interrupt task.
static char * host_filename
Data file with the hosts for the testbed.
internal API to access the &#39;peers&#39; subsystem
struct GNUNET_CONFIGURATION_Handle * GNUNET_CONFIGURATION_dup(const struct GNUNET_CONFIGURATION_Handle *cfg)
Duplicate an existing configuration object.
Interface for functions internally exported from testbed_api.c.
Allow multiple values with the same key.
void * opcq_empty_cls
Closure for the above task.
Definition: testbed_api.h:236
void * test_master_cls
The closure for the TestMaster callback.
unsigned int peer_count
Current peer count for an operation; Set this to 0 and increment for each successful operation on a p...
const char * GNUNET_TESTBED_host_get_hostname(const struct GNUNET_TESTBED_Host *host)
Obtain the host&#39;s hostname.
Context information to be used while searching for operation contexts.
Definition: testbed_api.c:220
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
GNUNET_TESTBED_ControllerCallback cc
The callback to use as controller callback.
static void rc_cleanup_operations(struct GNUNET_TESTBED_RunHandle *rc)
Cancels operations and tasks which are assigned to the given run context.
configuration data
Definition: configuration.c:83
unsigned int random_links
Number of random links to established.
enum GNUNET_TESTBED_TopologyOption topology
The topology which has to be achieved with the peers started in this context.
static void remove_rcop(struct GNUNET_TESTBED_RunHandle *rc, struct RunContextOperation *rcop)
Remove a RunContextOperation from the rcop_map of the given RunContext.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence)
Get the duration of an operation as the difference of the current time and the given start time "henc...
Definition: time.c:373
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.
static void cleanup(struct GNUNET_TESTBED_RunHandle *rc)
Assuming all peers have been destroyed cleanup run handle.
#define GNUNET_log(kind,...)
Entry in list of pending tasks.
Definition: scheduler.c:131
unsigned int num_hosts
Number of hosts in the given host file.
int GNUNET_CONFIGURATION_get_value_filename(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be the name of a file or directory.
int shutdown
Have we already shutdown.
struct GNUNET_TESTBED_Peer ** peers
Array of peers which we create.
handle for host registration
struct GNUNET_CONFIGURATION_Handle * cfg
The configuration of the controller.
struct GNUNET_TESTBED_Host ** hosts
An array of hosts loaded from the hostkeys file.
Time for absolute times used by GNUnet, in microseconds.
#define GNUNET_YES
Definition: gnunet_common.h:77
internal API to access the &#39;hosts&#39; subsystem
struct GNUNET_SCHEDULER_Task * register_hosts_task
Host registration task.
A peer controlled by the testing framework.
static void controller_status_cb(void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, int status)
Callback to signal successfull startup of the controller process.
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.
static int rcop_cleanup_iterator(void *cls, uint32_t key, void *value)
Iterator for cleaning up elements from rcop_map.
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.
static const char * prof_time(struct GNUNET_TESTBED_RunHandle *rc)
Function to return the string representation of the duration between current time and `pstart_time&#39; i...
header for intra library exported functions
static void register_hosts(void *cls)
Task to register all hosts available in the global host list.
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.
#define GNUNET_malloc(size)
Wrapper around malloc.
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.
static void host_habitable_cb(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...
#define GNUNET_free(ptr)
Wrapper around free.
int GNUNET_TESTBED_topology_get_(enum GNUNET_TESTBED_TopologyOption *topology, const char *topology_string)
Get a topology from a string input.
uint64_t event_mask
The event mask for the controller.
Time for relative time used by GNUnet, in microseconds.
GNUNET_TESTBED_TestMaster test_master
TestMaster callback to call when testbed initialization is done.
All peers shutdown (stopped and destroyed)
struct GNUNET_TESTBED_Operation * op
Handle for the corresponding operation that generated this event.
Small-world network (ring plus random links).
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:956
#define SCALE_FREE_CAP
Option string for the maximum number of edges a peer is permitted to have while generating scale free...