paragraph for gnunet devs that don't know how to use the web
[oweals/gnunet.git] / src / ats / gnunet-service-ats_performance.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 /**
20  * @file ats/gnunet-service-ats_performance.h
21  * @brief ats service, interaction with 'performance' API
22  * @author Matthias Wachs
23  * @author Christian Grothoff
24  */
25 #ifndef GNUNET_SERVICE_ATS_PERFORMANCE_H
26 #define GNUNET_SERVICE_ATS_PERFORMANCE_H
27
28 #include "gnunet_util_lib.h"
29 #include "gnunet_ats_service.h"
30 #include "ats.h"
31
32
33 /**
34  * Transmit the given performance information to all performance
35  * clients.
36  *
37  * @param peer peer for which this is an address suggestion
38  * @param plugin_name 0-termintated string specifying the transport plugin
39  * @param plugin_addr binary address for the plugin to use
40  * @param plugin_addr_len number of bytes in @a plugin_addr
41  * @param active #GNUNET_YES if this address is actively used
42  *        to maintain a connection to a peer;
43  *        #GNUNET_NO if the address is not actively used;
44  *        #GNUNET_SYSERR if this address is no longer available for ATS
45  * @param prop performance data for the address
46  * @param local_address_info information about the local flags for the address
47  * @param bandwidth_out assigned outbound bandwidth
48  * @param bandwidth_in assigned inbound bandwidth
49  */
50 void
51 GAS_performance_notify_all_clients (const struct GNUNET_PeerIdentity *peer,
52                                     const char *plugin_name,
53                                     const void *plugin_addr,
54                                     size_t plugin_addr_len,
55                                     int active,
56                                     const struct GNUNET_ATS_Properties *prop,
57                                     enum GNUNET_HELLO_AddressInfo local_address_info,
58                                     struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
59                                     struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in);
60
61
62 /**
63  * Register a new performance client.
64  *
65  * @param client handle of the new client
66  * @param flag flag specifying the type of the client
67  */
68 void
69 GAS_performance_add_client (struct GNUNET_SERVICE_Client *client,
70                             enum StartFlag flag);
71
72
73 /**
74  * Initialize performance subsystem.
75  *
76  * @param server handle to our server
77  * @param addresses the address handle to use
78  */
79 void
80 GAS_performance_init (void);
81
82
83 /**
84  * Shutdown performance subsystem.
85  */
86 void
87 GAS_performance_done (void);
88
89
90 #endif
91 /* end of gnunet-service-ats_performance.h */