Merge branch 'master' of ssh://gnunet.org/gnunet
[oweals/gnunet.git] / src / ats / gnunet-service-ats_connectivity.h
1 /*
2      This file is part of GNUnet.
3      Copyright (C) 2011-2015 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 /**
19  * @file ats/gnunet-service-ats_connectivity.h
20  * @brief ats service, interaction with 'connecivity' API
21  * @author Matthias Wachs
22  * @author Christian Grothoff
23  */
24 #ifndef GNUNET_SERVICE_ATS_CONNECTIVITY_H
25 #define GNUNET_SERVICE_ATS_CONNECTIVITY_H
26
27 #include "ats.h"
28
29
30 /**
31  * Is the given peer in the list of peers for which we
32  * have an address request?
33  *
34  * @param cls unused, NULL
35  * @param peer peer to query for
36  * @return #GNUNET_YES if so, #GNUNET_NO if not
37  */
38 unsigned int
39 GAS_connectivity_has_peer (void *cls,
40                            const struct GNUNET_PeerIdentity *peer);
41
42
43 /**
44  * Handle 'request address' messages from clients.
45  *
46  * @param client client that sent the request
47  * @param msg the request message
48  */
49 void
50 GAS_handle_request_address (struct GNUNET_SERVICE_Client *client,
51                             const struct RequestAddressMessage *msg);
52
53
54 /**
55  * Cancel 'request address' messages from clients.
56  *
57  * @param client client that sent the request
58  * @param msg the request message
59  */
60 void
61 GAS_handle_request_address_cancel (struct GNUNET_SERVICE_Client *client,
62                                    const struct RequestAddressMessage *msg);
63
64
65 /**
66  * Unregister a client (which may have been a connectivity client,
67  * but this is not assured).
68  *
69  * @param client handle of the (now dead) client
70  */
71 void
72 GAS_connectivity_remove_client (struct GNUNET_SERVICE_Client *client);
73
74
75 /**
76  * Initialize connectivity subsystem.
77  */
78 void
79 GAS_connectivity_init (void);
80
81
82 /**
83  * Shutdown connectivity subsystem.
84  */
85 void
86 GAS_connectivity_done (void);
87
88
89 #endif
90 /* end of gnunet-service-ats_connectivity.h */