GNUnet  0.20.0
gnunet_ats_transport_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2010-2015, 2018 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  */
34 #ifndef GNUNET_ATS_TRANSPORT_SERVICE_H
35 #define GNUNET_ATS_TRANSPORT_SERVICE_H
36 
37 
38 #include "gnunet_constants.h"
39 #include "gnunet_util_lib.h"
40 #include "gnunet_nt_lib.h"
42 
43 
48 {
54 
61  uint32_t goodput_out;
62 
69  uint32_t goodput_in;
70 
77  uint32_t utilization_out;
78 
85  uint32_t utilization_in;
86 
91  uint32_t distance;
92 
98  uint32_t mtu;
99 
103  enum GNUNET_NetworkType nt;
104 
109 };
110 
111 
112 /* ******************************** Transport API ***************************** */
113 
117 struct GNUNET_ATS_TransportHandle;
118 
122 struct GNUNET_ATS_Session;
123 
124 
136 typedef void
137 (*GNUNET_ATS_AllocationCallback) (void *cls,
138  struct GNUNET_ATS_Session *session,
140  bandwidth_out,
142  bandwidth_in);
143 
144 
153 typedef void
154 (*GNUNET_ATS_SuggestionCallback) (void *cls,
155  const struct GNUNET_PeerIdentity *pid,
156  const char *address);
157 
158 
169 struct GNUNET_ATS_TransportHandle *
172  void *alloc_cb_cls,
174  void *suggest_cb_cls);
175 
176 
182 void
183 GNUNET_ATS_transport_done (struct GNUNET_ATS_TransportHandle *ath);
184 
185 
189 struct GNUNET_ATS_SessionRecord;
190 
191 
206 struct GNUNET_ATS_SessionRecord *
207 GNUNET_ATS_session_add (struct GNUNET_ATS_TransportHandle *ath,
208  const struct GNUNET_PeerIdentity *pid,
209  const char *address,
210  struct GNUNET_ATS_Session *session,
211  const struct GNUNET_ATS_Properties *prop);
212 
213 
221 void
222 GNUNET_ATS_session_update (struct GNUNET_ATS_SessionRecord *ar,
223  const struct GNUNET_ATS_Properties *prop);
224 
225 
233 void
234 GNUNET_ATS_session_del (struct GNUNET_ATS_SessionRecord *ar);
235 
236 
237 #endif
238  /* end of group */
240 
241 /* end of file gnunet-service-transport_ats.h */
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static char * address
GNS address for this phone.
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
API of the transport service towards the communicator processes.
GNUNET_TRANSPORT_CommunicatorCharacteristics
What characteristics does this communicator have?
void GNUNET_ATS_session_update(struct GNUNET_ATS_SessionRecord *ar, const struct GNUNET_ATS_Properties *prop)
We have updated performance statistics for a given session.
void GNUNET_ATS_session_del(struct GNUNET_ATS_SessionRecord *ar)
A session was destroyed, ATS should now schedule and allocate under the assumption that this ar is no...
void GNUNET_ATS_transport_done(struct GNUNET_ATS_TransportHandle *ath)
Client is done with ATS transport, release resources.
void(* GNUNET_ATS_SuggestionCallback)(void *cls, const struct GNUNET_PeerIdentity *pid, const char *address)
Signature of a function called by ATS suggesting transport to try connecting with a particular addres...
struct GNUNET_ATS_TransportHandle * GNUNET_ATS_transport_init(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_ATS_AllocationCallback alloc_cb, void *alloc_cb_cls, GNUNET_ATS_SuggestionCallback suggest_cb, void *suggest_cb_cls)
Initialize the ATS transport subsystem.
void(* GNUNET_ATS_AllocationCallback)(void *cls, struct GNUNET_ATS_Session *session, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in)
Signature of a function called by ATS with the current bandwidth allocation to be used as determined ...
struct GNUNET_ATS_SessionRecord * GNUNET_ATS_session_add(struct GNUNET_ATS_TransportHandle *ath, const struct GNUNET_PeerIdentity *pid, const char *address, struct GNUNET_ATS_Session *session, const struct GNUNET_ATS_Properties *prop)
We have a new session ATS should know.
GNUNET_NetworkType
Types of networks (with separate quotas) we support.
Definition: gnunet_nt_lib.h:39
ATS performance characteristics for an address.
uint32_t goodput_in
Confirmed useful payload on this connection to this peer from the other peer.
uint32_t utilization_in
Actual traffic on this connection from the other peer to this peer.
enum GNUNET_NetworkType nt
Which network scope does the respective address belong to?
uint32_t mtu
MTU of the network layer, UINT32_MAX for no MTU (stream).
uint32_t distance
Distance on network layer (required for distance-vector routing) in hops.
struct GNUNET_TIME_Relative delay
Delay.
enum GNUNET_TRANSPORT_CommunicatorCharacteristics cc
What characteristics does this communicator have?
uint32_t utilization_out
Actual traffic on this connection from this peer to the other peer.
uint32_t goodput_out
Confirmed successful payload on this connection from this peer to the other peer.
Session handle for connections.
32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
The identity of the host (wraps the signing key of the peer).
Time for relative time used by GNUnet, in microseconds.