GNUnet  0.11.x
transport-testing2.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2019 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 
27 #include "platform.h"
28 #include "gnunet_util_lib.h"
30 #include "transport.h"
31 
32 
37 
38 
43 
44 
49 
59 (*GNUNET_TRANSPORT_TESTING_BackchannelCallback)(void *cls,
60  struct GNUNET_MessageHeader *msg,
61  struct GNUNET_PeerIdentity *pid);
62 
63 
73 typedef void
75  struct
77  *tc_h,
78  enum
80  cc,
81  char *address_prefix);
82 
83 
94 typedef void
96  struct
98  *tc_h,
99  const char *address,
100  struct GNUNET_TIME_Relative
101  expiration,
102  uint32_t aid,
103  enum GNUNET_NetworkType nt);
104 
105 
113 typedef void
115  struct
117  *tc_h,
118  int will_try);
119 
120 
128 typedef void
130  struct
132  *tc_h,
133  struct
135  *tc_queue);
136 
137 
145 typedef void
147  struct
149  *tc_h,
150  const char*payload,
151  size_t payload_len);
152 
153 
171  const char *service_name,
172  const char *binary_name,
173  const char *cfg_filename,
181  void *cb_cls);
182 
183 
191 void
194  *tc_h,
195  const struct
197  *peer_id,
198  const char *address);
199 
200 
213  *tc_queue,
214  const void *payload,
215  size_t payload_size);
GNUNET_TRANSPORT_CommunicatorCharacteristics
What characteristics does this communicator have?
static char * cfg_filename
Name of the configuration file.
void(* GNUNET_TRANSPORT_TESTING_IncomingMessageCallback)(void *cls, struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, const char *payload, size_t payload_len)
Handle an incoming message.
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
void(* GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback)(void *cls, struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, int will_try)
Get informed about the success of a queue request.
common internal definitions for transport service
void(* GNUNET_TRANSPORT_TESTING_AddQueueCallback)(void *cls, struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *tc_queue)
Handle opening of queue.
static char * peer_id
Option –peer.
Definition: gnunet-cadet.c:42
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorTransmission * GNUNET_TRANSPORT_TESTING_transport_communicator_send(struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *tc_queue, const void *payload, size_t payload_size)
Instruct communicator to send data.
GNUNET_NetworkType
Types of networks (with separate quotas) we support.
Definition: gnunet_nt_lib.h:35
GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback communicator_available_cb
Callback called when a new communicator connects.
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *(* GNUNET_TRANSPORT_TESTING_BackchannelCallback)(void *cls, struct GNUNET_MessageHeader *msg, struct GNUNET_PeerIdentity *pid)
Function signature for callbacks that are called when new backchannel message arrived.
static char * service_name
Option -s: service name (hash to get service descriptor)
Definition: gnunet-vpn.c:51
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle * GNUNET_TRANSPORT_TESTING_transport_communicator_service_start(const char *service_name, const char *binary_name, const char *cfg_filename, GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback communicator_available_cb, GNUNET_TRANSPORT_TESTING_AddAddressCallback add_address_cb, GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback queue_create_reply_cb, GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb, GNUNET_TRANSPORT_TESTING_IncomingMessageCallback incoming_message_cb, GNUNET_TRANSPORT_TESTING_BackchannelCallback bc_cb, void *cb_cls)
Start communicator part of transport service and communicator.
GNUNET_TRANSPORT_TESTING_AddAddressCallback add_address_cb
Callback called when a new communicator connects.
static char * expiration
Credential TTL.
Definition: gnunet-abd.c:96
static struct GNUNET_NAT_AUTO_Test * nt
Handle to a NAT test operation.
void(* GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback)(void *cls, struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, enum GNUNET_TRANSPORT_CommunicatorCharacteristics cc, char *address_prefix)
Function signature for callbacks that are called when new communicators become available.
static unsigned long long payload
How much data are we currently storing in the database?
The identity of the host (wraps the signing key of the peer).
Header for all communications.
void(* GNUNET_TRANSPORT_TESTING_AddAddressCallback)(void *cls, struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, const char *address, struct GNUNET_TIME_Relative expiration, uint32_t aid, enum GNUNET_NetworkType nt)
Receive information about the address of a communicator.
GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb
Callback called when a new communicator connects.
GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback queue_create_reply_cb
Callback called when a new communicator connects.
GNUNET_TRANSPORT_TESTING_BackchannelCallback bc_cb
Backchannel callback.
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
static char * address
GNS address for this phone.
void GNUNET_TRANSPORT_TESTING_transport_communicator_open_queue(struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, const struct GNUNET_PeerIdentity *peer_id, const char *address)
Instruct communicator to open a queue.
Time for relative time used by GNUnet, in microseconds.
Queue of a communicator and some context.
Bandwidth allocation API for the transport service.