aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/testbed_api_topology.h
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2014-01-06 16:37:21 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2014-01-06 16:37:21 +0000
commit57cba940bf568f0337bfc1a8cffb8542a78e8b1e (patch)
treeb49ba4518fffd16997d7163aa578cf04e41fdaae /src/testbed/testbed_api_topology.h
parentf15d774da10fa73be8c43982b438f55e576a6936 (diff)
downloadgnunet-57cba940bf568f0337bfc1a8cffb8542a78e8b1e.tar.gz
gnunet-57cba940bf568f0337bfc1a8cffb8542a78e8b1e.zip
- underlay topology generation
Diffstat (limited to 'src/testbed/testbed_api_topology.h')
-rw-r--r--src/testbed/testbed_api_topology.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/testbed/testbed_api_topology.h b/src/testbed/testbed_api_topology.h
index 4603cd66a..d4f4673e3 100644
--- a/src/testbed/testbed_api_topology.h
+++ b/src/testbed/testbed_api_topology.h
@@ -66,5 +66,48 @@ GNUNET_TESTBED_topology_get_ (enum GNUNET_TESTBED_TopologyOption *topology,
66char * 66char *
67GNUNET_TESTBED_topology_to_str_ (enum GNUNET_TESTBED_TopologyOption topology); 67GNUNET_TESTBED_topology_to_str_ (enum GNUNET_TESTBED_TopologyOption topology);
68 68
69
70/**
71 * Functions of this type are called to process underlay link
72 *
73 * @param cls closure
74 * @param A offset of first peer
75 * @param B offset of second peer
76 * @param bandwidth the bandwidth of the link in bytes per second
77 * @param latency the latency of link in milliseconds
78 * @param loss the percentage of messages dropped on the link
79 * @return GNUNET_OK to continue processing; GNUNET_SYSERR to abort
80 */
81typedef 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
89/**
90 * Function to construct an underlay topology
91 *
92 * @param num_peers the number of peers for which the topology should be
93 * generated
94 * @param proc the underlay link processor callback. Will be called for each
95 * underlay link generated unless a previous call to this callback
96 * returned GNUNET_SYSERR. Cannot be NULL.
97 * @param cls closure for proc
98 * @param ... variable arguments denoting the topology and its parameters. They
99 * should start with the type of topology to generate followed by their
100 * options. These arguments should *always* end with
101 * GNUNET_TESTBED_TOPOLOGY_OPTION_END option
102 * @return GNUNET_OK if underlay link generation is successful; GNUNET_SYSERR
103 * upon error in generating the underlay or if any calls to the
104 * underlay link processor returned GNUNET_SYSERR
105 */
106int
107GNUNET_TESTBED_underlay_construct_ (int num_peers,
108 underlay_link_processor proc,
109 void *cls,
110 ...);
111
69#endif 112#endif
70/* end of testbed_api_topology.h */ 113/* end of testbed_api_topology.h */