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