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