GNUnet  0.11.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 {
53 
60  uint32_t goodput_out;
61 
68  uint32_t goodput_in;
69 
76  uint32_t utilization_out;
77 
84  uint32_t utilization_in;
85 
90  uint32_t distance;
91 
97  uint32_t mtu;
98 
103 
108 };
109 
110 
111 /* ******************************** Transport API ***************************** */
112 
116 struct GNUNET_ATS_TransportHandle;
117 
121 struct GNUNET_ATS_Session;
122 
123 
135 typedef void
137  struct GNUNET_ATS_Session *session,
139  bandwidth_out,
141  bandwidth_in);
142 
143 
152 typedef void
154  const struct GNUNET_PeerIdentity *pid,
155  const char *address);
156 
157 
168 struct GNUNET_ATS_TransportHandle *
171  void *alloc_cb_cls,
173  void *suggest_cb_cls);
174 
175 
181 void
182 GNUNET_ATS_transport_done (struct GNUNET_ATS_TransportHandle *ath);
183 
184 
188 struct GNUNET_ATS_SessionRecord;
189 
190 
205 struct GNUNET_ATS_SessionRecord *
206 GNUNET_ATS_session_add (struct GNUNET_ATS_TransportHandle *ath,
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
221 GNUNET_ATS_session_update (struct GNUNET_ATS_SessionRecord *ar,
222  const struct GNUNET_ATS_Properties *prop);
223 
224 
232 void
233 GNUNET_ATS_session_del (struct GNUNET_ATS_SessionRecord *ar);
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?
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
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.
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
Session handle for connections.
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 ...
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.
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.
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.