2 This file is part of GNUnet.
3 Copyright (C) 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 * @file transport/transport-testing2.h
23 * @brief functions related to testing-tng
24 * @author Christian Grothoff
25 * @author Julius Bünger
28 #include "gnunet_util_lib.h"
29 #include "gnunet_ats_transport_service.h"
30 #include "transport.h"
33 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle;
36 * @brief Function signature for callbacks that are called when new communicators become available
42 (*GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback)(void *cls,
43 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h,
44 enum GNUNET_TRANSPORT_CommunicatorCharacteristics cc,
45 char *address_prefix);
49 (*GNUNET_TRANSPORT_TESTING_AddAddressCallback)(void *cls,
50 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h,
52 struct GNUNET_TIME_Relative expiration,
54 enum GNUNET_NetworkType nt);
58 (*GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback)(void *cls,
59 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h,
64 (*GNUNET_TRANSPORT_TESTING_AddQueueCallback)(void *cls,
65 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h);
69 * @brief Start communicator part of transport service and communicator
71 * @param service_name Name of the service
72 * @param cfg Configuration handle
73 * @param communicator_available Callback that is called when a new
74 * communicator becomes available
75 * @param cb_cls Closure to @p communicator_available
77 * @return Handle to the communicator duo
79 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *
80 GNUNET_TRANSPORT_TESTING_transport_communicator_service_start
81 (const char *service_name,
82 const char *cfg_filename,
83 GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback communicator_available_cb,
84 GNUNET_TRANSPORT_TESTING_AddAddressCallback add_address_cb,
85 GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback queue_create_reply_cb,
86 GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb,
90 GNUNET_TRANSPORT_TESTING_transport_communicator_open_queue
91 (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h,
92 const struct GNUNET_PeerIdentity *peer_id,
95 //struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorTransmission *
96 //GNUNET_TRANSPORT_TESTING_transport_communicator_send
97 // (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *tcq,
98 // const struct GNUNET_MessageHeader *hdr,
99 // GNUNET_TRANSPORT_TESTING_SuccessStatus cb, void *cb_cls);