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 
54 
59 
64 };
65 
66 
70 struct GNUNET_ATS_Session;
71 
80 
84  struct GNUNET_ATS_Properties prop;
85 
90 
95 };
96 
101 struct GNUNET_ATS_PreferenceHandle;
102 
108 
109 
120  void *cls;
121 
129  struct GNUNET_ATS_PreferenceHandle *
130  (*preference_add)(void *cls,
131  const struct GNUNET_ATS_Preference *pref);
132 
141  void
142  (*preference_del)(void *cls,
143  struct GNUNET_ATS_PreferenceHandle *ph,
144  const struct GNUNET_ATS_Preference *pref);
145 
155  struct GNUNET_ATS_SessionHandle *
156  (*session_add)(void *cls,
157  const struct GNUNET_ATS_SessionData *data,
158  const char *address);
159 
168  void
169  (*session_update)(void *cls,
171  const struct GNUNET_ATS_SessionData *data);
172 
180  void
181  (*session_del)(void *cls,
183  const struct GNUNET_ATS_SessionData *data);
184 };
185 
186 
196  const struct GNUNET_CONFIGURATION_Handle *cfg;
197 
202 
206  void *cls;
207 
216  void
217  (*suggest_cb) (void *cls,
218  const struct GNUNET_PeerIdentity *pid,
219  const char *address);
220 
231  void
232  (*allocate_cb) (void *cls,
233  struct GNUNET_ATS_Session *session,
234  const struct GNUNET_PeerIdentity *peer,
235  struct GNUNET_BANDWIDTH_Value32NBO bw_in,
236  struct GNUNET_BANDWIDTH_Value32NBO bw_out);
237 };
238 
239 
240 
241 #endif
242  /* 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:83
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.