GNUnet  0.17.6
gnunet-service-testbed_connectionpool.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2008--2015 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 
26 #include "gnunet_ats_service.h"
27 #include "gnunet_core_service.h"
29 
34 
35 
40 {
45 
50 
55 };
56 
57 
65 void
66 GST_connection_pool_init (unsigned int size);
67 
68 
72 void
74 
91  void *cls,
92  struct GNUNET_CORE_Handle *ch,
93  struct GNUNET_TRANSPORT_CoreHandle *th,
95  const struct GNUNET_PeerIdentity *peer_id,
96  const struct GNUNET_CONFIGURATION_Handle *cfg);
97 
98 
108  void *cls,
109  const struct GNUNET_PeerIdentity *target);
110 
111 
146  unsigned int peer_id,
147  const struct GNUNET_CONFIGURATION_Handle *cfg,
150  void *cb_cls,
151  const struct GNUNET_PeerIdentity *target,
153  void *connect_notify_cb_cls);
154 
155 
168 void
170 
171 
172 /* End of gnunet-service-testbed_connectionpool.h */
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static char * peer_id
Option –peer.
Definition: gnunet-cadet.c:42
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
static struct GNUNET_TRANSPORT_HelloGetHandle * gh
Pending GNUNET_TRANSPORT_hello_get() operation.
static struct GNUNET_MQ_Envelope * ac
Handle to current GNUNET_PEERINFO_add_peer() operation.
static struct GNUNET_SERVICE_Handle * service
Handle to our service instance.
struct GST_ConnectionPool_GetHandle * GST_connection_pool_get_handle(unsigned int peer_id, const struct GNUNET_CONFIGURATION_Handle *cfg, enum GST_ConnectionPool_Service service, GST_connection_pool_connection_ready_cb cb, void *cb_cls, const struct GNUNET_PeerIdentity *target, GST_connection_pool_peer_connect_notify connect_notify_cb, void *connect_notify_cb_cls)
Get a connection handle to service.
void GST_connection_pool_destroy(void)
Cleanup the connection pool.
void GST_connection_pool_get_handle_done(struct GST_ConnectionPool_GetHandle *gh)
Relinquish a GST_ConnectionPool_GetHandle object.
void(* GST_connection_pool_peer_connect_notify)(void *cls, const struct GNUNET_PeerIdentity *target)
Callback to notify when the target peer given to GST_connection_pool_get_handle() is connected.
void GST_connection_pool_init(unsigned int size)
Initialise the connection pool.
GST_ConnectionPool_Service
The type of service.
@ GST_CONNECTIONPOOL_SERVICE_TRANSPORT
Transport service.
@ GST_CONNECTIONPOOL_SERVICE_CORE
Core service.
@ GST_CONNECTIONPOOL_SERVICE_ATS_CONNECTIVITY
ATS service.
void(* GST_connection_pool_connection_ready_cb)(void *cls, struct GNUNET_CORE_Handle *ch, struct GNUNET_TRANSPORT_CoreHandle *th, struct GNUNET_ATS_ConnectivityHandle *ac, const struct GNUNET_PeerIdentity *peer_id, const struct GNUNET_CONFIGURATION_Handle *cfg)
Functions of this type are called when the needed handle is available for usage.
Automatic transport selection and outbound bandwidth determination.
Core service; the main API for encrypted P2P communications.
static unsigned int size
Size of the "table".
Definition: peer.c:67
Handle to the ATS subsystem for connectivity management.
Context for the core service connection.
Definition: core_api.c:78
The identity of the host (wraps the signing key of the peer).
Handle for the transport service (includes all of the state for the transport service).
The request handle for obtaining a pooled connection.
const struct GNUNET_PeerIdentity * target
The peer identity of the target peer.
void * cb_cls
The closure for the above callback.
GST_connection_pool_connection_ready_cb cb
The cache callback to call when a handle is available.
GST_connection_pool_peer_connect_notify connect_notify_cb
The callback to be called for serving notification that the target peer is connected.
void * connect_notify_cb_cls
The closure for the notify callback.