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 
75 {
80 
85 
89  void *cls;
90 
91 };
92 
93 
97 enum State
98 {
102  RC_INIT = 0,
103 
108 
113 
120 
121  /* /\** */
122  /* * Peers are stopped */
123  /* *\/ */
124  /* RC_PEERS_STOPPED, */
125 
126  /* /\** */
127  /* * Peers are destroyed */
128  /* *\/ */
129  /* RC_PEERS_DESTROYED */
130 
135 };
136 
137 
142 {
147 
152 
156  unsigned int index;
157 };
158 
159 
164 {
169 
176 
181 
186 
191 
195  void *cc_cls;
196 
200  char *trusted_ip;
201 
206 
211 
216 
221 
226 
231 
237 
241  char *topo_file;
242 
247 
251  struct GNUNET_TIME_Absolute pstart_time;
252 
257 
262 
267 
271  uint64_t event_mask;
272 
276  enum State state;
277 
282 
286  int shutdown;
287 
291  unsigned int num_hosts;
292 
297  unsigned int reg_hosts;
298 
303  unsigned int peer_count;
304 
308  unsigned int num_peers;
309 
313  unsigned int num_oc;
314 
318  unsigned int random_links;
319 
323  unsigned int links_succeeded;
324 
328  unsigned int links_failed;
329 
330 };
331 
332 
339 static uint32_t
340 rcop_key (void *rcop)
341 {
342  return * ((uint32_t *) &rcop);
343 }
344 
345 
349 struct SearchContext
350 {
355 
360 };
361 
362 
371 static int
372 search_iterator (void *cls, uint32_t key, void *value)
373 {
374  struct RunContextOperation *rcop = value;
375  struct SearchContext *sc = cls;
376 
377  GNUNET_assert (NULL != rcop);
378  if (sc->query == rcop->op)
379  {
380  GNUNET_assert (NULL == sc->result);
381  sc->result = rcop;
382  return GNUNET_NO;
383  }
384  return GNUNET_YES;
385 }
386 
387 
396 static struct RunContextOperation *
398 {
399  struct SearchContext sc;
400 
401  sc.query = op;
402  sc.result = NULL;
403  if (GNUNET_SYSERR ==
405  rcop_key (op),
407  &sc))
408  {
409  GNUNET_assert (NULL != sc.result);
410  return sc.result;
411  }
412  return NULL;
413 }
414 
415 
422 static void
424 {
427  rcop_key (rcop->op), rcop,
429 }
430 
431 
439 static void
441 {
444  rcop_key (rcop->op),
445  rcop));
446 }
447 
453 static void
455 {
456  unsigned int hid;
457 
458  GNUNET_assert (NULL == rc->register_hosts_task);
459  GNUNET_assert (NULL == rc->reg_handle);
460  GNUNET_assert (NULL == rc->peers);
461  GNUNET_assert (NULL == rc->hclist);
465  if (NULL != rc->c)
467  if (NULL != rc->cproc)
469  if (NULL != rc->h)
471  for (hid = 0; hid < rc->num_hosts; hid++)
474  if (NULL != rc->cfg)
478  GNUNET_free (rc);
479 }
480 
481 
490 static int
491 rcop_cleanup_iterator (void *cls, uint32_t key, void *value)
492 {
493  struct GNUNET_TESTBED_RunHandle *rc = cls;
494  struct RunContextOperation *rcop = value;
495 
496  GNUNET_assert (rc == rcop->rc);
497  remove_rcop (rc, rcop);
499  GNUNET_free (rcop);
500  return GNUNET_YES;
501 }
502 
503 
509 static void
511 {
512  struct CompatibilityCheckContext *hc;
513  unsigned int nhost;
514 
515  if (NULL != rc->hclist)
516  {
517  for (nhost = 0; nhost < rc->num_hosts; nhost++)
518  {
519  hc = &rc->hclist[nhost];
520  if (NULL != hc->h)
522  }
523  GNUNET_free (rc->hclist);
524  rc->hclist = NULL;
525  }
526  /* Stop register hosts task if it is running */
527  if (NULL != rc->register_hosts_task)
528  {
530  rc->register_hosts_task = NULL;
531  }
532  if (NULL != rc->timeout_task)
533  {
535  rc->timeout_task = NULL;
536  }
537  if (NULL != rc->reg_handle)
538  {
540  rc->reg_handle = NULL;
541  }
542  if (NULL != rc->topology_operation)
543  {
545  rc->topology_operation = NULL;
546  }
547  /* cancel any exiting operations */
551  rc));
552 }
553 
554 
560 static void
562 {
564  rc->interrupt_task = NULL;
565 }
566 
567 
574 static void
576 {
577  struct GNUNET_TESTBED_RunHandle *rc = cls;
578  struct RunContextOperation *rcop;
579 
580  if ( (NULL == rc->cproc)
581  || (NULL == rc->c)
582  || (GNUNET_YES == rc->shutdown) )
583  {
584  if (NULL != rc->peers)
585  {
586  GNUNET_free (rc->peers);
587  rc->peers = NULL;
588  }
589  goto cleanup_;
590  }
591  if (NULL == rc->peers)
592  goto cleanup_;
593  rc->shutdown = GNUNET_YES;
594  rcop = GNUNET_new (struct RunContextOperation);
595  rcop->rc = rc;
596  rcop->op = GNUNET_TESTBED_shutdown_peers (rc->c, rcop, NULL, NULL);
597  GNUNET_assert (NULL != rcop->op);
598  DEBUG ("Shutting down peers\n");
600  insert_rcop (rc, rcop);
601  return;
602 
603  cleanup_:
604  rc->state = RC_PEERS_SHUTDOWN;
606  cleanup (rc);
607 }
608 
609 
615 static void
616 interrupt (void *cls)
617 {
618  struct GNUNET_TESTBED_RunHandle *rc = cls;
619  struct GNUNET_TESTBED_Controller *c = rc->c;
620  unsigned int size;
621 
622  /* reschedule */
625  if ( (GNUNET_NO == rc->shutdown) &&
626  (NULL != c) &&
627  (NULL != c->opc_map) &&
628  (0 != (size = GNUNET_CONTAINER_multihashmap32_size (c->opc_map))))
629  {
631  "Shutdown postponed as there are %u operations currently active\n",
632  size);
634  c->opcq_empty_cls = rc;
635  return;
636  }
637  wait_op_completion (rc);
638 }
639 
640 
648 static const char *
650 {
651  struct GNUNET_TIME_Relative ptime;
652 
655 }
656 
657 
663 static void
665 {
666  struct GNUNET_TESTBED_RunHandle *rc = cls;
667  struct RunContextOperation *rcop;
668  unsigned int peer;
669 
670  DEBUG ("Starting Peers\n");
672  for (peer = 0; peer < rc->num_peers; peer++)
673  {
674  rcop = GNUNET_new (struct RunContextOperation);
675  rcop->rc = rc;
676  rcop->op = GNUNET_TESTBED_peer_start (NULL, rc->peers[peer], NULL, NULL);
677  GNUNET_assert (NULL != rcop->op);
678  rcop->cls = rc->peers[peer];
679  insert_rcop (rc, rcop);
680  }
681  rc->peer_count = 0;
682 }
683 
684 
694 static void
695 peer_create_cb (void *cls, struct GNUNET_TESTBED_Peer *peer, const char *emsg)
696 {
697  struct RunContextOperation *rcop = cls;
699 
700  GNUNET_assert (NULL != rcop);
701  GNUNET_assert (NULL != (rc = rcop->rc));
702  remove_rcop (rc, rcop);
704  GNUNET_free (rcop);
705  if (NULL == peer)
706  {
707  if (NULL != emsg)
708  LOG (GNUNET_ERROR_TYPE_ERROR, "Error while creating a peer: %s\n",
709  emsg);
711  return;
712  }
713  rc->peers[rc->peer_count] = peer;
714  rc->peer_count++;
715  if (rc->peer_count < rc->num_peers)
716  return;
717  DEBUG ("%u peers created in %s\n", rc->num_peers, prof_time (rc));
718  rc->state = RC_PEERS_CREATED;
720 }
721 
722 
728 static void
730 {
732  rc->timeout_task = NULL;
733  if (NULL != rc->test_master)
734  rc->test_master (rc->test_master_cls, rc, rc->num_peers, rc->peers,
735  rc->links_succeeded, rc->links_failed);
736 }
737 
738 
748 static void
749 topology_completion_callback (void *cls, unsigned int nsuccess,
750  unsigned int nfailures)
751 {
752  struct GNUNET_TESTBED_RunHandle *rc = cls;
753 
754  DEBUG ("Overlay topology generated in %s\n", prof_time (rc));
756  rc->topology_operation = NULL;
757  rc->links_succeeded = nsuccess;
758  rc->links_failed = nfailures;
759  rc->state = RC_READY;
760  call_master (rc);
761 }
762 
763 
769 static void
771 {
772  struct RunContextOperation *rcop;
773  unsigned int peer;
774 
775  DEBUG ("Creating peers\n");
777  rc->peers =
778  GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Peer *) * rc->num_peers);
779  GNUNET_assert (NULL != rc->c);
780  rc->peer_count = 0;
781  for (peer = 0; peer < rc->num_peers; peer++)
782  {
783  rcop = GNUNET_new (struct RunContextOperation);
784  rcop->rc = rc;
785  rcop->op =
787  (0 ==
788  rc->num_hosts) ? rc->h : rc->hosts[peer %
789  rc->num_hosts],
790  rc->cfg, &peer_create_cb, rcop);
791  GNUNET_assert (NULL != rcop->op);
792  insert_rcop (rc, rcop);
793  }
794 }
795 
796 
804 static void
805 event_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
806 {
807  struct GNUNET_TESTBED_RunHandle *rc = cls;
808  struct RunContextOperation *rcop;
809 
810  if (RC_INIT == rc->state)
811  {
812  switch (event->type)
813  {
815  rcop = event->op_cls;
816  if (NULL != event->details.operation_finished.emsg)
817  {
818  LOG (GNUNET_ERROR_TYPE_ERROR, _("Linking controllers failed. Exiting"));
820  }
821  else
822  rc->reg_hosts++;
823  GNUNET_assert (event->op == rcop->op);
824  remove_rcop (rc, rcop);
826  GNUNET_free (rcop);
827  if (rc->reg_hosts == rc->num_hosts)
828  {
829  rc->state = RC_LINKED;
830  create_peers (rc);
831  }
832  return;
833  default:
834  GNUNET_break (0);
836  return;
837  }
838  }
840  goto call_cc;
841  if (NULL == (rcop = search_rcop (rc, event->op)))
842  goto call_cc;
843  remove_rcop (rc, rcop);
845  GNUNET_free (rcop);
846  if ( (GNUNET_NO == rc->shutdown)
847  && (NULL != event->details.operation_finished.emsg) )
848  {
849  LOG (GNUNET_ERROR_TYPE_ERROR, "A operation has failed with error: %s\n",
850  event->details.operation_finished.emsg);
852  return;
853  }
855  switch (rc->state)
856  {
857  case RC_LINKED:
858  case RC_PEERS_CREATED:
859  case RC_READY:
860  rc->state = RC_PEERS_SHUTDOWN;
862  rc->peers = NULL;
863  DEBUG ("Peers shut down in %s\n", prof_time (rc));
865  break;
866  default:
867  GNUNET_assert (0);
868  }
869  return;
870 
871 call_cc:
872  if ((0 != (rc->event_mask & (1LL << event->type))) && (NULL != rc->cc))
873  rc->cc (rc->cc_cls, event);
874  if (GNUNET_TESTBED_ET_PEER_START != event->type)
875  return;
876  if (NULL == (rcop = search_rcop (rc, event->op))) /* Not our operation */
877  return;
878  remove_rcop (rc, rcop);
880  GNUNET_free (rcop);
881  rc->peer_count++;
882  if (rc->peer_count < rc->num_peers)
883  return;
884  DEBUG ("%u peers started in %s\n", rc->num_peers, prof_time (rc));
886  {
887  switch (rc->topology)
888  {
890  GNUNET_assert (0);
894  rc->topology_operation =
896  rc->peers, &rc->num_oc,
898  rc,
899  rc->topology,
900  rc->random_links,
902  break;
904  GNUNET_assert (NULL != rc->topo_file);
905  rc->topology_operation =
907  rc->peers, &rc->num_oc,
909  rc,
910  rc->topology,
911  rc->topo_file,
913  break;
915  {
916  unsigned long long number;
917  unsigned int cap;
921  &number));
922  cap = (unsigned int) number;
925  SCALE_FREE_M,
926  &number));
927  rc->topology_operation =
929  rc->peers, &rc->num_oc,
931  rc,
932  rc->topology,
933  cap, /* uint16_t */
934  (unsigned int) number, /* uint8_t */
936  }
937  break;
938  default:
939  rc->topology_operation =
941  rc->peers, &rc->num_oc,
943  rc,
944  rc->topology,
946  }
947  if (NULL == rc->topology_operation)
949  "Not generating a topology. Check number of peers\n");
950  else
951  {
952  DEBUG ("Creating overlay topology\n");
954  return;
955  }
956  }
957  rc->state = RC_READY;
958  call_master (rc);
959 }
960 
961 
967 static void
968 register_hosts (void *cls);
969 
970 
977 static void
978 host_registration_completion (void *cls, const char *emsg)
979 {
980  struct GNUNET_TESTBED_RunHandle *rc = cls;
981 
982  rc->reg_handle = NULL;
983  if (NULL != emsg)
984  {
986  _("Host registration failed for a host. Error: %s\n"), emsg);
988  return;
989  }
991  rc);
992 }
993 
994 
1000 static void
1002 {
1003  struct GNUNET_TESTBED_RunHandle *rc = cls;
1004  struct RunContextOperation *rcop;
1005  unsigned int slave;
1006 
1007  rc->register_hosts_task = NULL;
1008  if (rc->reg_hosts == rc->num_hosts)
1009  {
1010  DEBUG ("All hosts successfully registered\n");
1011  /* Start slaves */
1012  for (slave = 0; slave < rc->num_hosts; slave++)
1013  {
1014  rcop = GNUNET_new (struct RunContextOperation);
1015  rcop->rc = rc;
1016  rcop->op =
1017  GNUNET_TESTBED_controller_link (rcop, rc->c, rc->hosts[slave],
1018  rc->h, GNUNET_YES);
1019  GNUNET_assert (NULL != rcop->op);
1020  insert_rcop (rc, rcop);
1021  }
1022  rc->reg_hosts = 0;
1023  return;
1024  }
1025  rc->reg_handle =
1028  rc->reg_hosts++;
1029 }
1030 
1031 
1041 static void
1043  int status)
1044 {
1045  struct GNUNET_TESTBED_RunHandle *rc = cls;
1046  uint64_t event_mask;
1047 
1048  if (status != GNUNET_OK)
1049  {
1050  rc->cproc = NULL;
1052  _("Controller crash detected. Shutting down.\n"));
1054  return;
1055  }
1057  rc->cfg = GNUNET_CONFIGURATION_dup (cfg);
1058  event_mask = rc->event_mask;
1059  event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED);
1060  event_mask |= (1LL << GNUNET_TESTBED_ET_PEER_START);
1062  event_mask |= GNUNET_TESTBED_ET_CONNECT;
1063  rc->c =
1064  GNUNET_TESTBED_controller_connect (rc->h, event_mask, &event_cb, rc);
1065  if (0 < rc->num_hosts)
1066  {
1067  rc->reg_hosts = 0;
1069  return;
1070  }
1071  rc->state = RC_LINKED;
1072  create_peers (rc);
1073 }
1074 
1075 
1088 static int
1089 netint_proc (void *cls, const char *name, int isDefault,
1090  const struct sockaddr *addr, const struct sockaddr *broadcast_addr,
1091  const struct sockaddr *netmask, socklen_t addrlen)
1092 {
1093  struct GNUNET_TESTBED_RunHandle *rc = cls;
1094  char hostip[NI_MAXHOST];
1095  char *buf;
1096 
1097  if (sizeof (struct sockaddr_in) != addrlen)
1098  return GNUNET_OK; /* Only consider IPv4 for now */
1099  if (0 !=
1100  getnameinfo (addr, addrlen, hostip, NI_MAXHOST, NULL, 0, NI_NUMERICHOST))
1102  if (NULL == rc->trusted_ip)
1103  {
1104  rc->trusted_ip = GNUNET_strdup (hostip);
1105  return GNUNET_YES;
1106  }
1107  (void) GNUNET_asprintf (&buf, "%s; %s", rc->trusted_ip, hostip);
1108  GNUNET_free (rc->trusted_ip);
1109  rc->trusted_ip = buf;
1110  return GNUNET_YES;
1111 }
1112 
1113 
1124 static void
1126  int status)
1127 {
1128  struct CompatibilityCheckContext *hc = cls;
1129  struct GNUNET_TESTBED_RunHandle *rc;
1130  struct GNUNET_TESTBED_Host **old_hosts;
1131  unsigned int nhost;
1132 
1133  GNUNET_assert (NULL != (rc = hc->rc));
1134  nhost = hc->index;
1135  GNUNET_assert (nhost <= rc->num_hosts);
1136  GNUNET_assert (host == rc->hosts[nhost]);
1137  hc->h = NULL;
1138  if (GNUNET_NO == status)
1139  {
1140  if ((NULL != host) && (NULL != GNUNET_TESTBED_host_get_hostname (host)))
1141  LOG (GNUNET_ERROR_TYPE_ERROR, _("Host %s cannot start testbed\n"),
1143  else
1145  _("Testbed cannot be started on localhost\n"));
1147  return;
1148  }
1149  rc->reg_hosts++;
1150  if (rc->reg_hosts < rc->num_hosts)
1151  return;
1152  GNUNET_free (rc->hclist);
1153  rc->hclist = NULL;
1154  rc->h = rc->hosts[0];
1155  rc->num_hosts--;
1156  if (0 < rc->num_hosts)
1157  {
1158  old_hosts = rc->hosts;
1159  rc->hosts =
1160  GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Host *) * rc->num_hosts);
1161  GNUNET_memcpy (rc->hosts, &old_hosts[1],
1162  (sizeof (struct GNUNET_TESTBED_Host *) * rc->num_hosts));
1163  GNUNET_free (old_hosts);
1164  }
1165  else
1166  {
1167  GNUNET_free (rc->hosts);
1168  rc->hosts = NULL;
1169  }
1171  for (nhost = 0; nhost < rc->num_hosts; nhost++)
1172  GNUNET_TESTBED_host_resolve_ (rc->hosts[nhost]);
1174  if (NULL == rc->trusted_ip)
1175  rc->trusted_ip = GNUNET_strdup ("127.0.0.1");
1176  rc->cproc =
1178  &controller_status_cb, rc);
1179  GNUNET_free (rc->trusted_ip);
1180  rc->trusted_ip = NULL;
1181  if (NULL == rc->cproc)
1182  {
1183  LOG (GNUNET_ERROR_TYPE_ERROR, _("Cannot start the master controller"));
1185  }
1186 }
1187 
1188 
1194 static void
1196 {
1197  struct GNUNET_TESTBED_RunHandle *rc = cls;
1198 
1199  rc->timeout_task = NULL;
1201  _("Shutting down testbed due to timeout while setup.\n"));
1203  if (NULL != rc->test_master)
1204  rc->test_master (rc->test_master_cls, rc, 0, NULL, 0, 0);
1205  rc->test_master = NULL;
1206 }
1207 
1208 
1236 void
1238  const struct GNUNET_CONFIGURATION_Handle *cfg,
1239  unsigned int num_peers, uint64_t event_mask,
1242  void *test_master_cls)
1243 {
1244  struct GNUNET_TESTBED_RunHandle *rc;
1245  char *topology;
1246  struct CompatibilityCheckContext *hc;
1247  struct GNUNET_TIME_Relative timeout;
1248  unsigned long long number;
1249  unsigned int hid;
1250  unsigned int nhost;
1251 
1252  GNUNET_assert (num_peers > 0);
1253  rc = GNUNET_new (struct GNUNET_TESTBED_RunHandle);
1254  rc->cfg = GNUNET_CONFIGURATION_dup (cfg);
1255 #if ENABLE_SUPERMUC
1257  &rc->hosts);
1258  if (0 == rc->num_hosts)
1259  {
1261  _("No hosts loaded from LoadLeveler. Need at least one host\n"));
1262  goto error_cleanup;
1263  }
1264 #else
1265  if (NULL != host_filename)
1266  {
1267  rc->num_hosts =
1268  GNUNET_TESTBED_hosts_load_from_file (host_filename, rc->cfg,
1269  &rc->hosts);
1270  if (0 == rc->num_hosts)
1271  {
1273  _("No hosts loaded. Need at least one host\n"));
1274  goto error_cleanup;
1275  }
1276  }
1277  else
1278  rc->h = GNUNET_TESTBED_host_create (NULL, NULL, rc->cfg, 0);
1279 #endif
1280  rc->num_peers = num_peers;
1281  rc->event_mask = event_mask;
1282  rc->cc = cc;
1283  rc->cc_cls = cc_cls;
1284  rc->test_master = test_master;
1285  rc->test_master_cls = test_master_cls;
1286  rc->state = RC_INIT;
1288  if (GNUNET_OK ==
1290  "OVERLAY_TOPOLOGY", &topology))
1291  {
1292  if (GNUNET_NO == GNUNET_TESTBED_topology_get_ (&rc->topology, topology))
1293  {
1295  "OVERLAY_TOPLOGY",
1296  _
1297  ("Specified topology must be supported by testbed"));
1298  }
1299  GNUNET_free (topology);
1300  }
1301  switch (rc->topology)
1302  {
1306  if (GNUNET_OK !=
1308  "OVERLAY_RANDOM_LINKS",
1309  &number))
1310  {
1311  /* OVERLAY option RANDOM & SMALL_WORLD_RING requires OVERLAY_RANDOM_LINKS
1312  * option to be set to the number of random links to be established */
1314  "OVERLAY_RANDOM_LINKS");
1315  goto error_cleanup;
1316  }
1317  if (number > UINT32_MAX)
1318  {
1319  GNUNET_break (0); /* Too big number */
1320  goto error_cleanup;
1321  }
1322  rc->random_links = (unsigned int) number;
1323  break;
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;
1336  if (GNUNET_OK !=
1338  SCALE_FREE_CAP, &number))
1339  {
1341  SCALE_FREE_CAP);
1342  goto error_cleanup;
1343  }
1344  if (UINT16_MAX < number)
1345  {
1347  _("Maximum number of edges a peer can have in a scale free topology"
1348  " cannot be more than %u. Given `%s = %llu'"), UINT16_MAX,
1349  SCALE_FREE_CAP, number);
1350  goto error_cleanup;
1351  }
1352  if (GNUNET_OK !=
1354  SCALE_FREE_M, &number))
1355  {
1357  SCALE_FREE_M);
1358  goto error_cleanup;
1359  }
1360  if (UINT8_MAX < number)
1361  {
1363  _("The number of edges that can established when adding a new node"
1364  " to scale free topology cannot be more than %u. Given `%s = %llu'"),
1365  UINT8_MAX, SCALE_FREE_M, number);
1366  goto error_cleanup;
1367  }
1368  goto warn_ignore;
1370  /* not allowed! */
1371  GNUNET_assert (0);
1372  default:
1373  warn_ignore:
1374  /* Warn if OVERLAY_RANDOM_LINKS is present that it will be ignored */
1375  if (GNUNET_YES ==
1377  "OVERLAY_RANDOM_LINKS"))
1379  "Ignoring value of `OVERLAY_RANDOM_LINKS' in given configuration\n");
1380  break;
1381  }
1382  if (0 != rc->num_hosts)
1383  {
1384  rc->hclist = GNUNET_malloc (sizeof (struct CompatibilityCheckContext)
1385  * rc->num_hosts);
1386  for (nhost = 0; nhost < rc->num_hosts; nhost++)
1387  {
1388  hc = &rc->hclist[nhost];
1389  hc->index = nhost;
1390  hc->rc = rc;
1391  hc->h = GNUNET_TESTBED_is_host_habitable (rc->hosts[nhost], rc->cfg,
1392  &host_habitable_cb, hc);
1393  if (NULL == hc->h)
1394  {
1395  GNUNET_break (0);
1396  for (nhost = 0; nhost < rc->num_hosts; nhost++)
1397  {
1398  hc = &rc->hclist[nhost];
1399  if (NULL != hc->h)
1401  }
1402  GNUNET_free (rc->hclist);
1403  rc->hclist = NULL;
1404  goto error_cleanup;
1405  }
1406  }
1407  }
1408  else
1409  rc->cproc =
1410  GNUNET_TESTBED_controller_start ("127.0.0.1", rc->h,
1411  &controller_status_cb, rc);
1413  "SETUP_TIMEOUT",
1414  &timeout))
1415  {
1418  }
1420  rc->timeout_task =
1422  GNUNET_assert (NULL == rc->interrupt_task);
1423  rc->interrupt_task =
1425  rc);
1426  return;
1427 
1428 error_cleanup:
1429  if (NULL != rc->h)
1431  if (NULL != rc->hosts)
1432  {
1433  for (hid = 0; hid < rc->num_hosts; hid++)
1434  if (NULL != rc->hosts[hid])
1436  GNUNET_free (rc->hosts);
1437  }
1438  if (NULL != rc->cfg)
1440  GNUNET_free (rc);
1441 }
1442 
1443 
1453 {
1454  return h->c;
1455 }
1456 
1457 
1458 /* 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:1723
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:194
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:1293
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:235
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:1833
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 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:81
#define DEFAULT_SETUP_TIMEOUT
The default setup timeout in seconds.
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
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
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:524
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:208
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:1246
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.
#define GNUNET_memcpy(dst, src, n)
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:1273
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:727
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:230
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:439
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:2046
#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:79
static unsigned int size
Size of the "table".
Definition: peer.c:67
GUID host
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:1558
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
int GNUNET_CONTAINER_multihashmap32_iterate(struct GNUNET_CONTAINER_MultiHashMap32 *map, GNUNET_CONTAINER_HashMapIterator32 it, void *it_cls)
Iterate over all entries in the map.
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:240
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:233
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
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:85
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:134
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:80
int GNUNET_CONTAINER_multihashmap32_get_multiple(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, GNUNET_CONTAINER_HashMapIterator32 it, void *it_cls)
Iterate over all entries in the map that match a particular key.
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:965
#define SCALE_FREE_CAP
Option string for the maximum number of edges a peer is permitted to have while generating scale free...