GNUnet  0.11.x
dht_test_lib.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2012 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  */
25 #ifndef DHT_TEST_LIB_H
26 #define DHT_TEST_LIB_H
27 
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #if 0 /* keep Emacsens' auto-indent happy */
32 }
33 #endif
34 #endif
35 
36 #include "gnunet_testbed_service.h"
37 #include "gnunet_dht_service.h"
38 
43 
44 
54 typedef void (*GNUNET_DHT_TEST_AppMain) (void *cls,
56  unsigned int num_peers,
57  struct GNUNET_TESTBED_Peer **peers,
58  struct GNUNET_DHT_Handle **dhts);
59 
60 
71 void
72 GNUNET_DHT_TEST_run (const char *testname,
73  const char *cfgname,
74  unsigned int num_peers,
76  void *tmain_cls);
77 
78 
84 void
86 
87 #if 0 /* keep Emacsens' auto-indent happy */
88 {
89 #endif
90 #ifdef __cplusplus
91 }
92 #endif
93 
94 /* ifndef DHT_TEST_LIB_H */
95 #endif
void GNUNET_DHT_TEST_run(const char *testname, const char *cfgname, unsigned int num_peers, GNUNET_DHT_TEST_AppMain tmain, void *tmain_cls)
Run a test using the given name, configuration file and number of peers.
Definition: dht_test_lib.c:193
void GNUNET_DHT_TEST_cleanup(struct GNUNET_DHT_TEST_Context *ctx)
Clean up the testbed.
Definition: dht_test_lib.c:147
Test context for a DHT Test.
Definition: dht_test_lib.c:31
static struct GNUNET_DNSSTUB_Context * ctx
Context for DNS resolution.
Connection to the DHT service.
Definition: dht_api.c:201
void(* GNUNET_DHT_TEST_AppMain)(void *cls, struct GNUNET_DHT_TEST_Context *ctx, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, struct GNUNET_DHT_Handle **dhts)
Main function of a DHT test.
Definition: dht_test_lib.h:54
static void tmain(void *cls, struct GNUNET_CADET_TEST_Context *ctx, unsigned int num_peers, struct GNUNET_TESTBED_Peer **testbed_peers, struct GNUNET_CADET_Handle **cadetes)
test main: start test when all peers are connected
static unsigned int num_peers
static struct CadetPeer * peers
Operation to get peer ids.
A peer controlled by the testing framework.