GNUnet  0.10.x
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 #include "gnunet_constants.h"
38 #include "gnunet_util_lib.h"
39 #include "gnunet_nt_lib.h"
41 
42 
47 {
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 
104 
109 
110 };
111 
112 
113 /* ******************************** Transport API ***************************** */
114 
119 
123 struct GNUNET_ATS_Session;
124 
125 
137 typedef void
139  struct GNUNET_ATS_Session *session,
140  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
141  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in);
142 
143 
152 typedef void
154  const struct GNUNET_PeerIdentity *pid,
155  const char *address);
156 
157 
171  void *alloc_cb_cls,
173  void *suggest_cb_cls);
174 
175 
181 void
183 
184 
189 
190 
207  const struct GNUNET_PeerIdentity *pid,
208  const char *address,
209  struct GNUNET_ATS_Session *session,
210  const struct GNUNET_ATS_Properties *prop);
211 
212 
220 void
222  const struct GNUNET_ATS_Properties *prop);
223 
224 
232 void
234 
235 
236 #endif
237  /* end of group */
239 
240 /* end of file gnunet-service-transport_ats.h */
GNUNET_TRANSPORT_CommunicatorCharacteristics
What characteristics does this communicator have?
void * alloc_cb_cls
Closure for alloc_cb.
uint32_t goodput_out
Confirmed successful payload on this connection from this peer to the other peer. ...
uint32_t utilization_in
Actual traffic on this connection from the other peer to this peer.
GNUNET_ATS_AllocationCallback alloc_cb
Callback to invoke on allocations.
enum GNUNET_TRANSPORT_CommunicatorCharacteristics cc
What characteristics does this communicator have?
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.
uint32_t distance
Distance on network layer (required for distance-vector routing) in hops.
ATS performance characteristics for an address.
GNUNET_NetworkType
Types of networks (with separate quotas) we support.
Definition: gnunet_nt_lib.h:35
Information we track per session, incoming or outgoing.
void * suggest_cb_cls
Closure for suggest_cb.
Information about ongoing sessions of the transport client.
struct GNUNET_ATS_TransportHandle * ath
Transport handle this session record belongs to.
struct GNUNET_TIME_Relative delay
Delay.
uint32_t goodput_in
Confirmed useful payload on this connection to this peer from the other peer.
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 ...
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:104
uint32_t mtu
MTU of the network layer, UINT32_MAX for no MTU (stream).
32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
enum GNUNET_NetworkType nt
Which network scope does the respective address belong to?
void GNUNET_ATS_transport_done(struct GNUNET_ATS_TransportHandle *ath)
Client is done with ATS transport, release resources.
static void suggest_cb(void *cls, const struct GNUNET_PeerIdentity *pid, const char *address)
Function called by the solver to prompt the transport to try out a new address.
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...
The identity of the host (wraps the signing key of the peer).
configuration data
Definition: configuration.c:85
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.
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.
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
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...
static char * address
GNS address for this phone.
Handle to the ATS subsystem for bandwidth/transport transport information.
Time for relative time used by GNUnet, in microseconds.
uint32_t utilization_out
Actual traffic on this connection from this peer to the other peer.