GNUnet  0.20.0
ATS service plugin API

Plugin API for the ATS service. More...

Collaboration diagram for ATS service plugin API:

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 preferred 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 preferred 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 62 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 79 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 96 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 106 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 117 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 129 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 140 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 preferred address for a peer from solver.

Parameters
solverthe solver to use
peerthe peer

Definition at line 151 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 preferred address for a peer from solver.

Parameters
solverthe solver to use
peerthe peer

Definition at line 162 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 376 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 388 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 402 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 416 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 258 of file gnunet_ats_plugin.h.

259 {
264 
269 
274 
279 
285 
291 
297 
303 
309 
315 };
@ GAS_OP_SOLVE_UPDATE_NOTIFICATION_START
After the problem was finished, start notifications about changes to addresses.
@ GAS_OP_SOLVE_MLP_LP_STOP
Solving of the LP problem is done MLP solver only.
@ GAS_OP_SOLVE_START
A solution iteration has been started.
@ GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP
After the problem was finished, notifications about changes to addresses are done.
@ GAS_OP_SOLVE_MLP_LP_START
Solving of the LP problem was started MLP solver only.
@ GAS_OP_SOLVE_SETUP_STOP
The setup of the problem as a preparation to solve is finished.
@ GAS_OP_SOLVE_MLP_MLP_STOP
Solving of the MLP problem is done MLP solver only.
@ GAS_OP_SOLVE_SETUP_START
The setup of the problem as a preparation to solve it was started.
@ GAS_OP_SOLVE_MLP_MLP_START
Solving of the MLP problem was started MLP solver only.
@ GAS_OP_SOLVE_STOP
A solution iteration has been finished.

◆ GAS_Solver_Status

Status of a GAS_Solver_Operation operation.

Enumerator
GAS_STAT_SUCCESS 

Success.

GAS_STAT_FAIL 

Failure.

Definition at line 321 of file gnunet_ats_plugin.h.

322 {
327 
332 };
@ GAS_STAT_SUCCESS
Success.
@ GAS_STAT_FAIL
Failure.

◆ 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 338 of file gnunet_ats_plugin.h.

339 {
344 
350 
356 
361 
366 };
@ GAS_INFO_PROP_ALL
The proportional solver had to recalculate for all networks.
@ GAS_INFO_PROP_SINGLE
The proportional solver had to recalculate for a single network.
@ GAS_INFO_UPDATED
An existing solution was reused Quite specific to the MLP solver.
@ GAS_INFO_NONE
No more specific information.
@ GAS_INFO_FULL
A full solution process is performed Quite specific to the MLP solver.