2 This file is part of GNUnet.
3 Copyright (C) 2010-2015, 2018, 2019 GNUnet e.V.
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.
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.
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/>.
18 SPDX-License-Identifier: AGPL3.0-or-later
22 * Bandwidth allocation API for applications to interact with
24 * @author Christian Grothoff
25 * @author Matthias Wachs
27 * @defgroup TRANSPORT service
28 * Bandwidth allocation
32 #ifndef GNUNET_TRANSPORT_APPLICATION_SERVICE_H
33 #define GNUNET_TRANSPORT_APPLICATION_SERVICE_H
35 #include "gnunet_constants.h"
36 #include "gnunet_util_lib.h"
37 #include "gnunet_nt_lib.h"
40 * Handle to the TRANSPORT subsystem for making suggestions about
41 * connections the peer would like to have.
43 struct GNUNET_TRANSPORT_ApplicationHandle;
47 * Initialize the TRANSPORT application client handle.
49 * @param cfg configuration to use
50 * @return ats application handle, NULL on error
52 struct GNUNET_TRANSPORT_ApplicationHandle *
53 GNUNET_TRANSPORT_application_init (const struct GNUNET_CONFIGURATION_Handle *cfg);
57 * Shutdown TRANSPORT application client.
59 * @param ch handle to destroy
62 GNUNET_TRANSPORT_application_done (struct GNUNET_TRANSPORT_ApplicationHandle *ch);
66 * An application (or a communicator) has received a HELLO (or other address
67 * data of another peer) and wants TRANSPORT to validate that the address is
68 * correct. The result is NOT returned, in fact TRANSPORT may do nothing
69 * (i.e. if it has too many active validations or recently tried this one
70 * already). If the @a addr validates, TRANSPORT will persist the address
74 * @param peer identity of the peer we have an address for
75 * @param expiration when does @a addr expire; used by TRANSPORT to know when
76 * to definitively give up attempting to validate
77 * @param nt network type of @a addr (as claimed by the other peer);
78 * used by TRANSPORT to avoid trying @a addr's that really cannot work
79 * due to network type missmatches
80 * @param addr address to validate
83 GNUNET_TRANSPORT_application_validate (struct GNUNET_TRANSPORT_ApplicationHandle *ch,
84 const struct GNUNET_PeerIdentity *peer,
85 struct GNUNET_TIME_Absolute expiration,
86 enum GNUNET_NetworkType nt,
89 /** @} */ /* end of group */
92 /* end of file gnunet_ats_application_service.h */