GNUnet  0.11.x
testbed_api_topology.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 
27 #ifndef TESTBED_API_TOPOLOGY_H
28 #define TESTBED_API_TOPOLOGY_H
29 
40 unsigned int
41 GNUNET_TESTBED_2dtorus_calc_links (unsigned int num_peers, unsigned int *rows,
42  unsigned int **rows_len);
43 
44 
54 int
56  const char *topology_string);
57 
58 
66 char *
68 
69 
81 typedef int (*underlay_link_processor) (void *cls,
82  unsigned int A,
83  unsigned int B,
84  unsigned int bandwidth,
85  unsigned int latency,
86  unsigned int loss);
87 
88 
106 int
109  void *cls,
110  ...);
111 
112 #endif
113 /* end of testbed_api_topology.h */
GNUNET_TESTBED_TopologyOption
Topologies and topology options supported for testbeds.
enum GNUNET_TESTBED_TopologyOption topology
The topology to generate.
unsigned int GNUNET_TESTBED_2dtorus_calc_links(unsigned int num_peers, unsigned int *rows, unsigned int **rows_len)
Returns the number of links that are required to generate a 2d torus for the given number of peers...
int GNUNET_TESTBED_topology_get_(enum GNUNET_TESTBED_TopologyOption *topology, const char *topology_string)
Get a topology from a string input.
int GNUNET_TESTBED_underlay_construct_(int num_peers, underlay_link_processor proc, void *cls,...)
Function to construct an underlay topology.
static unsigned int num_peers
char * GNUNET_TESTBED_topology_to_str_(enum GNUNET_TESTBED_TopologyOption topology)
Returns the string corresponding to the given topology.
int(* underlay_link_processor)(void *cls, unsigned int A, unsigned int B, unsigned int bandwidth, unsigned int latency, unsigned int loss)
Functions of this type are called to process underlay link.