aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-02-08 16:51:40 +0000
committerNathan S. Evans <evans@in.tum.de>2010-02-08 16:51:40 +0000
commitc7ed67bb39b321e0ab547b186b466aa6ef630ccf (patch)
tree3997cf9ab54d926516ee6c086339e99b9d5403f6 /src/include
parentcb01deba9af1ccd46b7d5bd0a9efc5a900ee0e64 (diff)
downloadgnunet-c7ed67bb39b321e0ab547b186b466aa6ef630ccf.tar.gz
gnunet-c7ed67bb39b321e0ab547b186b466aa6ef630ccf.zip
testing related changes
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_testing_lib.h41
1 files changed, 40 insertions, 1 deletions
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h
index 8de354853..4503e7b9b 100644
--- a/src/include/gnunet_testing_lib.h
+++ b/src/include/gnunet_testing_lib.h
@@ -70,6 +70,28 @@ typedef void (*GNUNET_TESTING_NotifyDaemonRunning)(void *cls,
70 70
71 71
72/** 72/**
73 * Prototype of a function that will be called whenever
74 * two daemons are connected by the testing library.
75 *
76 * @param cls closure
77 * @param first peer id for first daemon
78 * @param second peer id for the second daemon
79 * @param first_cfg config for the first daemon
80 * @param second_cfg config for the second daemon
81 * @param first_daemon handle for the first daemon
82 * @param second_daemon handle for the second daemon
83 * @param emsg error message (NULL on success)
84 */
85typedef void (*GNUNET_TESTING_NotifyConnection)(void *cls,
86 const struct GNUNET_PeerIdentity *first,
87 const struct GNUNET_PeerIdentity *second,
88 const struct GNUNET_CONFIGURATION_Handle *first_cfg,
89 const struct GNUNET_CONFIGURATION_Handle *second_cfg,
90 struct GNUNET_TESTING_Daemon *first_daemon,
91 struct GNUNET_TESTING_Daemon *second_daemon,
92 const char *emsg);
93
94/**
73 * Starts a GNUnet daemon. GNUnet must be installed on the target 95 * Starts a GNUnet daemon. GNUnet must be installed on the target
74 * system and available in the PATH. The machine must furthermore be 96 * system and available in the PATH. The machine must furthermore be
75 * reachable via "ssh" (unless the hostname is "NULL") without the 97 * reachable via "ssh" (unless the hostname is "NULL") without the
@@ -127,6 +149,13 @@ void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d,
127 GNUNET_TESTING_NotifyCompletion cb, 149 GNUNET_TESTING_NotifyCompletion cb,
128 void * cb_cls); 150 void * cb_cls);
129 151
152/*
153 * Get the short name of a running peer
154 *
155 * @param d the daemon handle
156 */
157char *
158GNUNET_TESTING_daemon_get_shortname(struct GNUNET_TESTING_Daemon *d);
130 159
131/** 160/**
132 * Establish a connection between two GNUnet daemons. 161 * Establish a connection between two GNUnet daemons.
@@ -141,7 +170,7 @@ void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d,
141void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, 170void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1,
142 struct GNUNET_TESTING_Daemon *d2, 171 struct GNUNET_TESTING_Daemon *d2,
143 struct GNUNET_TIME_Relative timeout, 172 struct GNUNET_TIME_Relative timeout,
144 GNUNET_TESTING_NotifyCompletion cb, 173 GNUNET_TESTING_NotifyConnection cb,
145 void *cb_cls); 174 void *cb_cls);
146 175
147 176
@@ -163,6 +192,8 @@ struct GNUNET_TESTING_PeerGroup;
163 * @param total number of daemons to start 192 * @param total number of daemons to start
164 * @param cb function to call on each daemon that was started 193 * @param cb function to call on each daemon that was started
165 * @param cb_cls closure for cb 194 * @param cb_cls closure for cb
195 * @param connect_callback function to call each time two hosts are connected
196 * @param connect_callback_cls closure for connect_callback
166 * @param hostnames space-separated list of hostnames to use, 197 * @param hostnames space-separated list of hostnames to use,
167 * NULL to use localhost only 198 * NULL to use localhost only
168 * @return NULL on error, otherwise handle to control peer group 199 * @return NULL on error, otherwise handle to control peer group
@@ -173,6 +204,8 @@ GNUNET_TESTING_daemons_start (struct GNUNET_SCHEDULER_Handle *sched,
173 unsigned int total, 204 unsigned int total,
174 GNUNET_TESTING_NotifyDaemonRunning cb, 205 GNUNET_TESTING_NotifyDaemonRunning cb,
175 void *cb_cls, 206 void *cb_cls,
207 GNUNET_TESTING_NotifyConnection connect_callback,
208 void *connect_callback_cls,
176 const char *hostnames); 209 const char *hostnames);
177 210
178 211
@@ -221,6 +254,12 @@ enum GNUNET_TESTING_Topology
221 */ 254 */
222 GNUNET_TESTING_TOPOLOGY_ERDOS_RENYI, 255 GNUNET_TESTING_TOPOLOGY_ERDOS_RENYI,
223 256
257 /*
258 * Certain percentage of peers are unable to communicate directly
259 * replicating NAT conditions
260 */
261 GNUNET_TESTING_TOPOLOGY_INTERNAT,
262
224 /** 263 /**
225 * All peers are disconnected. 264 * All peers are disconnected.
226 */ 265 */