GNUnet  0.11.x
gnunet_ats_plugin.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2009-2015 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_ats_service.h"
42 
46 struct ATS_Address;
47 
58 typedef void
60  const struct GNUNET_PeerIdentity *peer,
61  enum GNUNET_ATS_PreferenceKind kind,
62  double pref_rel);
63 
64 
75 typedef void
77  struct GNUNET_SERVICE_Client *
78  application,
79  const struct
81  const struct GNUNET_TIME_Relative
82  scope,
83  enum GNUNET_ATS_PreferenceKind kind,
84  double score);
85 
92 typedef void
93 (*GAS_solver_bulk_start) (void *solver);
94 
95 
102 typedef void
103 (*GAS_solver_bulk_stop) (void *solver);
104 
105 
113 typedef void
114 (*GAS_solver_address_add) (void *solver,
115  struct ATS_Address *address,
116  uint32_t network);
117 
118 
125 typedef void
126 (*GAS_solver_address_delete) (void *solver,
127  struct ATS_Address *address);
128 
129 
136 typedef void
138  struct ATS_Address *address);
139 
140 
147 typedef void
149  const struct GNUNET_PeerIdentity *peer);
150 
151 
158 typedef void
160  const struct
162 
163 
171 {
175  void *cls;
176 
183 
188 
197 
205 
212 
217 
222 
233 
241 };
242 
243 
255 {
260 
265 
270 
275 
281 
287 
293 
299 
305 
311 };
312 
313 
318 {
323 
328 };
329 
330 
335 {
340 
346 
352 
357 
362 };
363 
364 
372 typedef void
375  enum GAS_Solver_Status stat,
377 
378 
384 typedef void
386  struct ATS_Address *address);
387 
388 
398 typedef const double *
399 (*GAS_get_preferences) (void *cls,
400  const struct GNUNET_PeerIdentity *id);
401 
402 
412 typedef unsigned int
414  const struct GNUNET_PeerIdentity *id);
415 
416 
423 {
428 
433 
437  void *cls;
438 
443 
448 
453 
458 
464 
469  unsigned int network_count;
470 
475  unsigned long long out_quota[GNUNET_NT_COUNT];
476 
481  unsigned long long in_quota[GNUNET_NT_COUNT];
482 };
483 
484 #endif
485  /* end of group */
void(* GAS_solver_bulk_start)(void *solver)
Notify the solver about a bulk operation changing possibly a lot of values Solver will not resolve un...
void(* GAS_bandwidth_changed_cb)(void *cls, struct ATS_Address *address)
Callback to call from solver when bandwidth for address has changed.
GAS_solver_stop_get_preferred_address s_get_stop
Tell solver stop notifying ATS about changes for this peers.
void(* GAS_solver_address_delete)(void *solver, struct ATS_Address *address)
Delete an address or just the session from the solver.
Solving of the LP problem was started MLP solver only.
After the problem was finished, start notifications about changes to addresses.
const double *(* GAS_get_preferences)(void *cls, const struct GNUNET_PeerIdentity *id)
Callback to call from solver to obtain application preference values for a peer.
GAS_solver_address_add s_add
Add a new address for a peer to the solver.
void(* GAS_solver_address_feedback_preference)(void *solver, struct GNUNET_SERVICE_Client *application, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_TIME_Relative scope, enum GNUNET_ATS_PreferenceKind kind, double score)
Give feedback about the current assignment.
The proportional solver had to recalculate for a single network.
void(* GAS_solver_information_callback)(void *cls, enum GAS_Solver_Operation op, enum GAS_Solver_Status stat, enum GAS_Solver_Additional_Information)
Callback to call with additional information Used for measurement.
The setup of the problem as a preparation to solve it was started.
void(* GAS_solver_get_preferred_address)(void *solver, const struct GNUNET_PeerIdentity *peer)
Get the prefered address for a peer from solver.
GAS_get_preferences get_preferences
ATS addresses function to obtain preference values.
void(* GAS_solver_address_add)(void *solver, struct ATS_Address *address, uint32_t network)
Add a single address within a network to the solver.
GAS_Solver_Status
Status of a GAS_Solver_Operation operation.
The proportional solver had to recalculate for all networks.
No more specific information.
GAS_solver_address_feedback_preference s_feedback
Give feedback about the current assignment.
GAS_solver_address_property_changed s_address_update_property
Update the properties of an address in the solver.
static struct GNUNET_IDENTITY_Handle * id
Handle to identity service.
A full solution process is performed Quite specific to the MLP solver.
Solving of the LP problem is done MLP solver only.
Handle for the service.
struct GNUNET_STATISTICS_Handle * stats
Statistics handle to be used by the solver.
GAS_Solver_Operation
Operation codes for solver information callback.
Handle to a client that is connected to a service.
Definition: service.c:250
Solving of the MLP problem is done MLP solver only.
void(* GAS_solver_stop_get_preferred_address)(void *solver, const struct GNUNET_PeerIdentity *peer)
Stop getting the prefered address for a peer from solver.
A solution iteration has been started.
static enum GNUNET_NetworkType scope
Which network scope do we belong to?
GAS_Solver_Additional_Information
Status of the operation.
GAS_solver_address_delete s_del
Delete an address in the solver.
Solving of the MLP problem was started MLP solver only.
void(* GAS_solver_bulk_stop)(void *solver)
Mark a bulk operation as done Solver will resolve if values have changed.
Internal representation of the hash map.
void * cls
Closure to pass to all solver functions in this struct.
GAS_solver_address_change_preference s_pref
Change relative preference for quality in solver.
Address with additional information.
void(* GAS_solver_address_change_preference)(void *solver, const struct GNUNET_PeerIdentity *peer, enum GNUNET_ATS_PreferenceKind kind, double pref_rel)
Change the preference for a peer.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
unsigned int(* GAS_get_connectivity)(void *cls, const struct GNUNET_PeerIdentity *id)
Callback to call from solver to obtain application connectivity preferences for a peer...
void * cls
Closure to pass to all callbacks in this struct.
GAS_solver_get_preferred_address s_get
Tell solver to notify ATS if the address to use changes for a specific peer using the bandwidth chang...
A solution iteration has been finished.
GAS_solver_bulk_start s_bulk_start
Start a bulk operation.
The identity of the host (wraps the signing key of the peer).
configuration data
Definition: configuration.c:85
void(* GAS_solver_address_property_changed)(void *solver, struct ATS_Address *address)
Transport properties for this address have changed.
Automatic transport selection and outbound bandwidth determination.
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration handle to be used by the solver.
GAS_solver_information_callback info_cb
Callback for solver to call with status information, can be NULL.
The setup of the problem as a preparation to solve is finished.
An existing solution was reused Quite specific to the MLP solver.
GNUNET_ATS_PreferenceKind
Enum defining all known preference categories.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
struct GNUNET_CONTAINER_MultiPeerMap * addresses
Hashmap containing all addresses available.
The ATS plugin will pass a pointer to a struct of this type as to the initialization function of the ...
GAS_solver_bulk_stop s_bulk_stop
Bulk operation done.
static char * address
GNS address for this phone.
GAS_bandwidth_changed_cb bandwidth_changed_cb
ATS addresses callback to be notified about bandwidth assignment changes.
After the problem was finished, notifications about changes to addresses are done.
#define GNUNET_NT_COUNT
unsigned int network_count
Number of networks available, size of the out_quota and in_quota arrays.
GAS_get_connectivity get_connectivity
ATS addresses function to obtain preference values.
Time for relative time used by GNUnet, in microseconds.