Merge branch 'master' of ssh://gnunet.org/gnunet
[oweals/gnunet.git] / src / ats / gnunet-service-ats_scheduling.h
1 /*
2      This file is part of GNUnet.
3      Copyright (C) 2011 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_scheduling.h
21  * @brief ats service, interaction with 'scheduling' API
22  * @author Matthias Wachs
23  * @author Christian Grothoff
24  */
25 #ifndef GNUNET_SERVICE_ATS_SCHEDULING_H
26 #define GNUNET_SERVICE_ATS_SCHEDULING_H
27
28 #include "gnunet_util_lib.h"
29
30
31 /**
32  * Register a new scheduling client.
33  *
34  * @param client handle of the new client
35  * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
36  */
37 int
38 GAS_scheduling_add_client (struct GNUNET_SERVICE_Client *client);
39
40
41 /**
42  * Unregister a client (which may have been a scheduling client,
43  * but this is not assured).
44  *
45  * @param client handle of the (now dead) client
46  */
47 void
48 GAS_scheduling_remove_client (struct GNUNET_SERVICE_Client *client);
49
50
51 /**
52  * Transmit the given address suggestion and bandwidth update to all scheduling
53  * clients.
54  *
55  * @param peer peer for which this is an address suggestion
56  * @param session_id session ID to use
57  * @param bandwidth_out assigned outbound bandwidth
58  * @param bandwidth_in assigned inbound bandwidth
59  */
60 void
61 GAS_scheduling_transmit_address_suggestion (const struct GNUNET_PeerIdentity *peer,
62                                             uint32_t session_id,
63                                             struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
64                                             struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in);
65
66
67 /**
68  * Handle 'address add' messages from clients.
69  *
70  * @param client client that sent the request
71  * @param m the request message
72  */
73 void
74 GAS_handle_address_add (const struct AddressAddMessage *m);
75
76
77 /**
78  * Handle 'address update' messages from clients.
79  *
80  * @param m the request message
81  */
82 void
83 GAS_handle_address_update (const struct AddressUpdateMessage *m);
84
85
86 /**
87  * Handle 'address destroyed' messages from clients.
88  *
89  * @param m the request message
90  */
91 void
92 GAS_handle_address_destroyed (const struct AddressDestroyedMessage *m);
93
94
95 #endif
96 /* end of gnunet-service-ats_scheduling.h */