aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/testbed_api_topology.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/testbed/testbed_api_topology.h')
-rw-r--r--src/testbed/testbed_api_topology.h115
1 files changed, 0 insertions, 115 deletions
diff --git a/src/testbed/testbed_api_topology.h b/src/testbed/testbed_api_topology.h
deleted file mode 100644
index ffa32dfa5..000000000
--- a/src/testbed/testbed_api_topology.h
+++ /dev/null
@@ -1,115 +0,0 @@
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
21/**
22 * @file testbed/testbed_api_topology.h
23 * @brief header for intra library exported functions
24 * @author Sree Harsha Totakura <sreeharsha@totakura.in>
25 */
26
27#ifndef TESTBED_API_TOPOLOGY_H
28#define TESTBED_API_TOPOLOGY_H
29
30/**
31 * Returns the number of links that are required to generate a 2d torus for the
32 * given number of peers. Also returns the arrangement (number of rows and the
33 * length of each row)
34 *
35 * @param num_peers number of peers
36 * @param rows number of rows in the 2d torus. Can be NULL.
37 * @param rows_len the length of each row. This array will be allocated
38 * fresh. The caller should free it. Can be NULL.
39 * @return the number of links that are required to generate a 2d torus for the
40 * given number of peers
41 */
42unsigned int
43GNUNET_TESTBED_2dtorus_calc_links (unsigned int num_peers, unsigned int *rows,
44 unsigned int **rows_len);
45
46
47/**
48 * Get a topology from a string input.
49 *
50 * @param topology where to write the retrieved topology
51 * @param topology_string The string to attempt to
52 * get a configuration value from
53 * @return #GNUNET_YES if topology string matched a
54 * known topology, #GNUNET_NO if not
55 */
56int
57GNUNET_TESTBED_topology_get_ (enum GNUNET_TESTBED_TopologyOption *topology,
58 const char *topology_string);
59
60
61/**
62 * Returns the string corresponding to the given topology
63 *
64 * @param topology the topology
65 * @return the string (freshly allocated) of given topology; NULL if topology cannot be
66 * expressed as a string
67 */
68char *
69GNUNET_TESTBED_topology_to_str_ (enum GNUNET_TESTBED_TopologyOption topology);
70
71
72/**
73 * Functions of this type are called to process underlay link
74 *
75 * @param cls closure
76 * @param A offset of first peer
77 * @param B offset of second peer
78 * @param bandwidth the bandwidth of the link in bytes per second
79 * @param latency the latency of link in milliseconds
80 * @param loss the percentage of messages dropped on the link
81 * @return GNUNET_OK to continue processing; GNUNET_SYSERR to abort
82 */
83typedef int (*underlay_link_processor) (void *cls,
84 unsigned int A,
85 unsigned int B,
86 unsigned int bandwidth,
87 unsigned int latency,
88 unsigned int loss);
89
90
91/**
92 * Function to construct an underlay topology
93 *
94 * @param num_peers the number of peers for which the topology should be
95 * generated
96 * @param proc the underlay link processor callback. Will be called for each
97 * underlay link generated unless a previous call to this callback
98 * returned GNUNET_SYSERR. Cannot be NULL.
99 * @param cls closure for proc
100 * @param ... variable arguments denoting the topology and its parameters. They
101 * should start with the type of topology to generate followed by their
102 * options. These arguments should *always* end with
103 * GNUNET_TESTBED_TOPOLOGY_OPTION_END option
104 * @return GNUNET_OK if underlay link generation is successful; GNUNET_SYSERR
105 * upon error in generating the underlay or if any calls to the
106 * underlay link processor returned GNUNET_SYSERR
107 */
108int
109GNUNET_TESTBED_underlay_construct_ (int num_peers,
110 underlay_link_processor proc,
111 void *cls,
112 ...);
113
114#endif
115/* end of testbed_api_topology.h */