diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-05-05 15:49:25 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-05-05 15:49:25 +0000 |
commit | b042203d5a4f8729bbde84447841e8531010d1aa (patch) | |
tree | fb8cf28f5db734c2ae2a8d9580c9d4f83cdd5050 /src/testbed/testbed_api_services.c | |
parent | 16f0681acc44d732c1827492fc2b0331cdaea009 (diff) | |
download | gnunet-b042203d5a4f8729bbde84447841e8531010d1aa.tar.gz gnunet-b042203d5a4f8729bbde84447841e8531010d1aa.zip |
-renaming new testing code to testbed
Diffstat (limited to 'src/testbed/testbed_api_services.c')
-rw-r--r-- | src/testbed/testbed_api_services.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/testbed/testbed_api_services.c b/src/testbed/testbed_api_services.c new file mode 100644 index 000000000..524ec35e3 --- /dev/null +++ b/src/testbed/testbed_api_services.c | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | (C) 2008--2012 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | 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 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file testing/new_testing_api_services.c | ||
23 | * @brief convenience functions for accessing services | ||
24 | * @author Christian Grothoff | ||
25 | */ | ||
26 | #include "platform.h" | ||
27 | #include "new_testing_api_peers.h" | ||
28 | |||
29 | |||
30 | /** | ||
31 | * Connect to a service offered by the given peer. Will ensure that | ||
32 | * the request is queued to not overwhelm our ability to create and | ||
33 | * maintain connections with other systems. The actual service | ||
34 | * handle is then returned via the 'op_result' member in the event | ||
35 | * callback. The 'ca' callback is used to create the connection | ||
36 | * when the time is right; the 'da' callback will be used to | ||
37 | * destroy the connection (upon 'GNUNET_TESTBED_operation_done'). | ||
38 | * 'GNUNET_TESTBED_operation_cancel' can be used to abort this | ||
39 | * operation until the event callback has been called. | ||
40 | * | ||
41 | * @param op_cls closure to pass in operation event | ||
42 | * @param peer peer that runs the service | ||
43 | * @param service_name name of the service to connect to | ||
44 | * @param ca helper function to establish the connection | ||
45 | * @param da helper function to close the connection | ||
46 | * @param cada_cls closure for ca and da | ||
47 | * @return handle for the operation | ||
48 | */ | ||
49 | struct GNUNET_TESTBED_Operation * | ||
50 | GNUNET_TESTBED_service_connect (void *op_cls, | ||
51 | struct GNUNET_TESTBED_Peer *peer, | ||
52 | const char *service_name, | ||
53 | GNUNET_TESTBED_ConnectAdapter ca, | ||
54 | GNUNET_TESTBED_DisconnectAdapter da, | ||
55 | void *cada_cls) | ||
56 | { | ||
57 | GNUNET_break (0); | ||
58 | return NULL; | ||
59 | } | ||
60 | |||
61 | /* end of new_testing_api_services.c */ | ||