peer destroy with new operations handling
[oweals/gnunet.git] / src / testbed / testbed_api_services.c
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 testbed/testbed_api_services.c
23  * @brief convenience functions for accessing services
24  * @author Christian Grothoff
25  */
26 #include "platform.h"
27 #include "testbed_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 testbed_api_services.c */