GNUnet  0.10.x
gnunet_ats_plugin_new.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2009-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  */
20 
37 #ifndef PLUGIN_ATS_H
38 #define PLUGIN_ATS_H
39 
40 #include "gnunet_util_lib.h"
44 
45 
50 
55 
60 
65 };
66 
67 
71 struct GNUNET_ATS_Session;
72 
77 
82 
86  struct GNUNET_ATS_Properties prop;
87 
92 
97 
98 };
99 
104 struct GNUNET_ATS_PreferenceHandle;
105 
111 
112 
120 {
121 
125  void *cls;
126 
134  struct GNUNET_ATS_PreferenceHandle *
135  (*preference_add)(void *cls,
136  const struct GNUNET_ATS_Preference *pref);
137 
146  void
147  (*preference_del)(void *cls,
148  struct GNUNET_ATS_PreferenceHandle *ph,
149  const struct GNUNET_ATS_Preference *pref);
150 
160  struct GNUNET_ATS_SessionHandle *
161  (*session_add)(void *cls,
162  const struct GNUNET_ATS_SessionData *data,
163  const char *address);
164 
173  void
174  (*session_update)(void *cls,
176  const struct GNUNET_ATS_SessionData *data);
177 
185  void
186  (*session_del)(void *cls,
188  const struct GNUNET_ATS_SessionData *data);
189 
190 };
191 
192 
199 {
203  const struct GNUNET_CONFIGURATION_Handle *cfg;
204 
209 
213  void *cls;
214 
223  void
224  (*suggest_cb) (void *cls,
225  const struct GNUNET_PeerIdentity *pid,
226  const char *address);
227 
238  void
239  (*allocate_cb) (void *cls,
240  struct GNUNET_ATS_Session *session,
241  const struct GNUNET_PeerIdentity *peer,
242  struct GNUNET_BANDWIDTH_Value32NBO bw_in,
243  struct GNUNET_BANDWIDTH_Value32NBO bw_out);
244 
245 };
246 
247 
248 
249 #endif
250  /* end of group */
static struct GNUNET_STATISTICS_Handle * stats
Handle for statistics.
static void allocate_cb(void *cls, struct GNUNET_ATS_Session *session, const struct GNUNET_PeerIdentity *peer, struct GNUNET_BANDWIDTH_Value32NBO bw_in, struct GNUNET_BANDWIDTH_Value32NBO bw_out)
Function called by the solver to tell the transpor to allocate bandwidth for the specified session...
struct GNUNET_ATS_Session * session
Handle to the session that has the given properties.
enum GNUNET_MQ_PreferenceKind pk
What type of performance preference does the client have?
Internal representation of a session by the plugin.
static struct GNUNET_ATS_PerformanceHandle * ph
ATS performance handle used.
Definition: gnunet-ats.c:116
Handle for the service.
ATS performance characteristics for an address.
GNUNET_MQ_PreferenceKind
Enum defining all known preference categories.
Information about ongoing sessions of the transport client.
static struct SolverHandle * sh
Preference being expressed by an application client.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:104
struct GNUNET_BANDWIDTH_Value32NBO bw
How much bandwidth in bytes/second does the application expect?
int inbound_only
Is the session inbound only?
Plugin-relevant information about a session.
32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
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.
The identity of the host (wraps the signing key of the peer).
configuration data
Definition: configuration.c:85
struct GNUNET_PeerIdentity peer
Peer to get address suggestions for.
The ATS plugin will pass a pointer to a struct of this type as to the initialization function of the ...
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
Bandwidth allocation API for applications to interact with.
uint32_t data
The data value.
static char * address
GNS address for this phone.
Bandwidth allocation API for the transport service.