2 This file is part of GNUnet.
3 Copyright (C) 2009-2018 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 * @author Christian Grothoff
25 * Provide addresses to transport for validation
27 * @defgroup transport TRANSPORT service
28 * Low-level communication with other peers
30 * @see [Documentation](https://gnunet.org/transport-service)
35 #ifndef GNUNET_TRANSPORT_ADDRESS_SERVICE_H
36 #define GNUNET_TRANSPORT_ADDRESS_SERVICE_H
41 #if 0 /* keep Emacsens' auto-indent happy */
46 #include "gnunet_util_lib.h"
47 #include "gnunet_nt_lib.h"
50 * Version number of the transport address API.
52 #define GNUNET_TRANSPORT_ADDRESS_VERSION 0x00000000
56 * Opaque handle to the transport service for communicators.
58 struct GNUNET_TRANSPORT_AddressHandle;
62 * Connect to the transport service.
64 * @param cfg configuration to use
65 * @return NULL on error
67 struct GNUNET_TRANSPORT_AddressHandle *
68 GNUNET_TRANSPORT_address_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
72 * Disconnect from the transport service.
74 * @param ch handle returned from connect
77 GNUNET_TRANSPORT_address_disconnect (struct GNUNET_TRANSPORT_AddressHandle *ch);
81 * The client has learned about a possible address for peer @a pid
82 * (i.e. via broadcast, multicast, DHT, ...). The transport service
83 * should consider validating it. Note that the plugin is NOT expected
84 * to have verified the signature, the transport service must decide
85 * whether to check the signature.
87 * While the notification is sent to @a ch asynchronously, this API
88 * does not return a handle as the delivery of addresses is simply
89 * unreliable, and if @a ch is down, the data provided will simply be
92 * @param ch communicator handle
93 * @param pid peer the address is for
94 * @param raw raw address data
95 * @param raw_size number of bytes in @a raw
98 GNUNET_TRANSPORT_address_try (struct GNUNET_TRANSPORT_AddressHandle *ch,
99 const struct GNUNET_PeerIdentity *pid,
101 const size_t raw_size);
104 #if 0 /* keep Emacsens' auto-indent happy */
111 /* ifndef GNUNET_TRANSPORT_ADDRESS_SERVICE_H */
114 /** @} */ /* end of group */
116 /* end of gnunet_transport_address_service.h */