GNUnet  0.11.x
Data Structures | Typedefs | Enumerations
ATS service plugin API

Plugin API for the ATS service. More...

Data Structures

struct  GNUNET_ATS_SolverFunctions
 Solver functions. More...
 
struct  GNUNET_ATS_PluginEnvironment
 The ATS plugin will pass a pointer to a struct of this type as to the initialization function of the ATS plugins. More...
 

Typedefs

typedef 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. More...
 
typedef 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. More...
 
typedef void(* GAS_solver_bulk_start) (void *solver)
 Notify the solver about a bulk operation changing possibly a lot of values Solver will not resolve until all bulk operations are marked as done. More...
 
typedef void(* GAS_solver_bulk_stop) (void *solver)
 Mark a bulk operation as done Solver will resolve if values have changed. More...
 
typedef void(* GAS_solver_address_add) (void *solver, struct ATS_Address *address, uint32_t network)
 Add a single address within a network to the solver. More...
 
typedef void(* GAS_solver_address_delete) (void *solver, struct ATS_Address *address)
 Delete an address or just the session from the solver. More...
 
typedef void(* GAS_solver_address_property_changed) (void *solver, struct ATS_Address *address)
 Transport properties for this address have changed. More...
 
typedef void(* GAS_solver_get_preferred_address) (void *solver, const struct GNUNET_PeerIdentity *peer)
 Get the prefered address for a peer from solver. More...
 
typedef void(* GAS_solver_stop_get_preferred_address) (void *solver, const struct GNUNET_PeerIdentity *peer)
 Stop getting the prefered address for a peer from solver. More...
 
typedef 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. More...
 
typedef void(* GAS_bandwidth_changed_cb) (void *cls, struct ATS_Address *address)
 Callback to call from solver when bandwidth for address has changed. More...
 
typedef 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. More...
 
typedef 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. More...
 

Enumerations

enum  GAS_Solver_Operation {
  GAS_OP_SOLVE_START, GAS_OP_SOLVE_STOP, GAS_OP_SOLVE_SETUP_START, GAS_OP_SOLVE_SETUP_STOP,
  GAS_OP_SOLVE_MLP_LP_START, GAS_OP_SOLVE_MLP_LP_STOP, GAS_OP_SOLVE_MLP_MLP_START, GAS_OP_SOLVE_MLP_MLP_STOP,
  GAS_OP_SOLVE_UPDATE_NOTIFICATION_START, GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP
}
 Operation codes for solver information callback. More...
 
enum  GAS_Solver_Status { GAS_STAT_SUCCESS, GAS_STAT_FAIL }
 Status of a GAS_Solver_Operation operation. More...
 
enum  GAS_Solver_Additional_Information {
  GAS_INFO_NONE, GAS_INFO_FULL, GAS_INFO_UPDATED, GAS_INFO_PROP_SINGLE,
  GAS_INFO_PROP_ALL
}
 Status of the operation. More...
 

Detailed Description

Plugin API for the ATS service.

Specifies the struct that is given to the plugin's entry method and the other struct that must be returned. Note that the destructors of ATS plugins will be given the value returned by the constructor and is expected to return a NULL pointer.

Typedef Documentation

◆ GAS_solver_address_change_preference

typedef 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.

Parameters
handlethe solver handle
clientthe client sending this request
peerthe peer id
kindthe preference kind to change
scorethe new preference score
pref_relthe normalized preference value for this kind over all clients

Definition at line 59 of file gnunet_ats_plugin.h.

◆ GAS_solver_address_feedback_preference

typedef 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.

Parameters
handlethe solver handle
applicationthe application sending this request
peerthe peer id
scopethe time interval for this feedback: [now - scope .. now]
kindthe preference kind for this feedback
scorethe feedback score

Definition at line 76 of file gnunet_ats_plugin.h.

◆ GAS_solver_bulk_start

typedef void(* GAS_solver_bulk_start) (void *solver)

Notify the solver about a bulk operation changing possibly a lot of values Solver will not resolve until all bulk operations are marked as done.

Parameters
solverthe solver

Definition at line 93 of file gnunet_ats_plugin.h.

◆ GAS_solver_bulk_stop

typedef void(* GAS_solver_bulk_stop) (void *solver)

Mark a bulk operation as done Solver will resolve if values have changed.

Parameters
solverthe solver

Definition at line 103 of file gnunet_ats_plugin.h.

◆ GAS_solver_address_add

typedef void(* GAS_solver_address_add) (void *solver, struct ATS_Address *address, uint32_t network)

Add a single address within a network to the solver.

Parameters
solverthe solver Handle
addressthe address to add
networknetwork type of this address

Definition at line 114 of file gnunet_ats_plugin.h.

◆ GAS_solver_address_delete

typedef void(* GAS_solver_address_delete) (void *solver, struct ATS_Address *address)

Delete an address or just the session from the solver.

Parameters
solverthe solver Handle
addressthe address to delete

Definition at line 126 of file gnunet_ats_plugin.h.

◆ GAS_solver_address_property_changed

typedef void(* GAS_solver_address_property_changed) (void *solver, struct ATS_Address *address)

Transport properties for this address have changed.

Parameters
solversolver handle
addressthe address

Definition at line 137 of file gnunet_ats_plugin.h.

◆ GAS_solver_get_preferred_address

typedef void(* GAS_solver_get_preferred_address) (void *solver, const struct GNUNET_PeerIdentity *peer)

Get the prefered address for a peer from solver.

Parameters
solverthe solver to use
peerthe peer

Definition at line 148 of file gnunet_ats_plugin.h.

◆ GAS_solver_stop_get_preferred_address

typedef void(* GAS_solver_stop_get_preferred_address) (void *solver, const struct GNUNET_PeerIdentity *peer)

Stop getting the prefered address for a peer from solver.

Parameters
solverthe solver to use
peerthe peer

Definition at line 159 of file gnunet_ats_plugin.h.

◆ GAS_solver_information_callback

typedef 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.

Parameters
clsthe closure
opthe operation

Definition at line 373 of file gnunet_ats_plugin.h.

◆ GAS_bandwidth_changed_cb

typedef void(* GAS_bandwidth_changed_cb) (void *cls, struct ATS_Address *address)

Callback to call from solver when bandwidth for address has changed.

Parameters
addressthe with changed bandwidth assigned

Definition at line 385 of file gnunet_ats_plugin.h.

◆ GAS_get_preferences

typedef 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.

Parameters
clsthe cls
idthe peer id
Returns
carry of double values containing the preferences with GNUNET_ATS_PreferenceCount elements

Definition at line 399 of file gnunet_ats_plugin.h.

◆ GAS_get_connectivity

typedef 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.

Parameters
clsthe cls
idthe peer id
Returns
0 if connectivity is not desired, non-null if address suggestions are requested

Definition at line 413 of file gnunet_ats_plugin.h.

Enumeration Type Documentation

◆ GAS_Solver_Operation

Operation codes for solver information callback.

Order of calls is expected to be: GAS_OP_SOLVE_START GAS_OP_SOLVE_STOP GAS_OP_SOLVE_UPDATE_NOTIFICATION_START GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP

Enumerator
GAS_OP_SOLVE_START 

A solution iteration has been started.

GAS_OP_SOLVE_STOP 

A solution iteration has been finished.

GAS_OP_SOLVE_SETUP_START 

The setup of the problem as a preparation to solve it was started.

GAS_OP_SOLVE_SETUP_STOP 

The setup of the problem as a preparation to solve is finished.

GAS_OP_SOLVE_MLP_LP_START 

Solving of the LP problem was started MLP solver only.

GAS_OP_SOLVE_MLP_LP_STOP 

Solving of the LP problem is done MLP solver only.

GAS_OP_SOLVE_MLP_MLP_START 

Solving of the MLP problem was started MLP solver only.

GAS_OP_SOLVE_MLP_MLP_STOP 

Solving of the MLP problem is done MLP solver only.

GAS_OP_SOLVE_UPDATE_NOTIFICATION_START 

After the problem was finished, start notifications about changes to addresses.

GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP 

After the problem was finished, notifications about changes to addresses are done.

Definition at line 254 of file gnunet_ats_plugin.h.

255 {
260 
265 
270 
275 
281 
287 
293 
299 
305 
311 };
Solving of the LP problem was started MLP solver only.
After the problem was finished, start notifications about changes to addresses.
The setup of the problem as a preparation to solve it was started.
Solving of the LP problem is done MLP solver only.
Solving of the MLP problem is done MLP solver only.
A solution iteration has been started.
Solving of the MLP problem was started MLP solver only.
A solution iteration has been finished.
The setup of the problem as a preparation to solve is finished.
After the problem was finished, notifications about changes to addresses are done.

◆ GAS_Solver_Status

Status of a GAS_Solver_Operation operation.

Enumerator
GAS_STAT_SUCCESS 

Success.

GAS_STAT_FAIL 

Failure.

Definition at line 317 of file gnunet_ats_plugin.h.

318 {
323 
328 };

◆ GAS_Solver_Additional_Information

Status of the operation.

Enumerator
GAS_INFO_NONE 

No more specific information.

GAS_INFO_FULL 

A full solution process is performed Quite specific to the MLP solver.

GAS_INFO_UPDATED 

An existing solution was reused Quite specific to the MLP solver.

GAS_INFO_PROP_SINGLE 

The proportional solver had to recalculate for a single network.

GAS_INFO_PROP_ALL 

The proportional solver had to recalculate for all networks.

Definition at line 334 of file gnunet_ats_plugin.h.

335 {
340 
346 
352 
357 
362 };
The proportional solver had to recalculate for a single network.
The proportional solver had to recalculate for all networks.
No more specific information.
A full solution process is performed Quite specific to the MLP solver.
An existing solution was reused Quite specific to the MLP solver.