ats service plugin management More...
#include "gnunet-service-ats_addresses.h"
Go to the source code of this file.
Functions | |
int | GAS_plugin_init (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Initialize address subsystem. More... | |
void | GAS_plugin_done (void) |
Shutdown address subsystem. More... | |
void | GAS_plugin_notify_preference_changed (const struct GNUNET_PeerIdentity *peer, enum GNUNET_ATS_PreferenceKind kind, double pref_rel) |
The preference changed for a peer, update solver. More... | |
void | GAS_plugin_notify_property_changed (struct ATS_Address *address) |
The relative value for a property changed. More... | |
void | GAS_plugin_new_address (struct ATS_Address *new_address) |
Tell the solver that the given address can now be used for talking to the respective peer. More... | |
void | GAS_plugin_delete_address (struct ATS_Address *address) |
Tell the solver that the given address is no longer valid can cannot be used any longer. More... | |
void | GAS_plugin_notify_feedback (struct GNUNET_SERVICE_Client *application, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_TIME_Relative scope, enum GNUNET_ATS_PreferenceKind kind, float score_abs) |
Tell the solver that the given client has expressed its appreciation for the past performance of a given connection. More... | |
void | GAS_plugin_solver_lock (void) |
Stop instant solving, there are many state updates happening in bulk right now. More... | |
void | GAS_plugin_solver_unlock (void) |
Resume instant solving, we are done with the bulk state updates. More... | |
void | GAS_plugin_request_connect_start (const struct GNUNET_PeerIdentity *pid) |
Notify the plugin that a request to connect to a particular peer was given to us. More... | |
void | GAS_plugin_request_connect_stop (const struct GNUNET_PeerIdentity *pid) |
Notify the plugin that a request to connect to a particular peer was dropped. More... | |
ats service plugin management
Definition in file gnunet-service-ats_plugins.h.
int GAS_plugin_init | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg | ) |
Initialize address subsystem.
The addresses subsystem manages the addresses known and current performance information. It has a solver component responsible for the resource allocation. It tells the solver about changes and receives updates when the solver changes the resource allocation.
cfg | configuration to use |
Definition at line 424 of file gnunet-service-ats_plugins.c.
References _, GNUNET_ATS_PluginEnvironment::addresses, bandwidth_changed_cb(), GNUNET_ATS_PluginEnvironment::bandwidth_changed_cb, cfg, GNUNET_ATS_PluginEnvironment::cfg, GNUNET_ATS_PluginEnvironment::cls, env, GAS_connectivity_has_peer(), GAS_preference_get_by_peer(), GNUNET_ATS_PluginEnvironment::get_connectivity, GNUNET_ATS_PluginEnvironment::get_preferences, GNUNET_asprintf(), GNUNET_CONFIGURATION_get_value_string(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_NT_COUNT, GNUNET_OK, GNUNET_PLUGIN_load(), GNUNET_strdup, GNUNET_SYSERR, GSA_addresses, GSA_stats, GNUNET_ATS_PluginEnvironment::in_quota, GNUNET_ATS_PluginEnvironment::info_cb, load_quotas(), GNUNET_ATS_PluginEnvironment::network_count, GNUNET_ATS_PluginEnvironment::out_quota, plugin, sf, solver_info_cb(), and GNUNET_ATS_PluginEnvironment::stats.
Referenced by run().
void GAS_plugin_done | ( | void | ) |
Shutdown address subsystem.
Definition at line 474 of file gnunet-service-ats_plugins.c.
References GNUNET_free, GNUNET_PLUGIN_unload(), plugin, and sf.
Referenced by cleanup_task().
void GAS_plugin_notify_preference_changed | ( | const struct GNUNET_PeerIdentity * | peer, |
enum GNUNET_ATS_PreferenceKind | kind, | ||
double | pref_rel | ||
) |
The preference changed for a peer, update solver.
peer | the peer |
kind | the ATS kind |
pref_rel | the new relative preference value |
Definition at line 62 of file gnunet-service-ats_plugins.c.
References GNUNET_ATS_SolverFunctions::cls, peer, GNUNET_ATS_SolverFunctions::s_pref, and sf.
Referenced by update_relative_values_for_peer().
void GAS_plugin_notify_property_changed | ( | struct ATS_Address * | address | ) |
The relative value for a property changed.
address | The peer for which a property changed. |
Definition at line 74 of file gnunet-service-ats_plugins.c.
References address, GNUNET_ATS_SolverFunctions::cls, GNUNET_ATS_SolverFunctions::s_address_update_property, and sf.
Referenced by notify_change().
void GAS_plugin_new_address | ( | struct ATS_Address * | new_address | ) |
Tell the solver that the given address can now be used for talking to the respective peer.
new_address | the new address |
Definition at line 485 of file gnunet-service-ats_plugins.c.
References GNUNET_ATS_SolverFunctions::cls, ATS_Address::properties, GNUNET_ATS_SolverFunctions::s_add, GNUNET_ATS_Properties::scope, and sf.
Referenced by GAS_addresses_add().
void GAS_plugin_delete_address | ( | struct ATS_Address * | address | ) |
Tell the solver that the given address is no longer valid can cannot be used any longer.
address | address that was deleted |
Definition at line 500 of file gnunet-service-ats_plugins.c.
References address, GNUNET_ATS_SolverFunctions::cls, GNUNET_ATS_SolverFunctions::s_del, and sf.
Referenced by free_address().
void GAS_plugin_notify_feedback | ( | struct GNUNET_SERVICE_Client * | application, |
const struct GNUNET_PeerIdentity * | peer, | ||
const struct GNUNET_TIME_Relative | scope, | ||
enum GNUNET_ATS_PreferenceKind | kind, | ||
float | score_abs | ||
) |
Tell the solver that the given client has expressed its appreciation for the past performance of a given connection.
application | client providing the feedback |
peer | peer the feedback is about |
scope | timeframe the feedback applies to |
kind | performance property the feedback relates to |
score_abs | degree of the appreciation |
Definition at line 518 of file gnunet-service-ats_plugins.c.
References GNUNET_ATS_SolverFunctions::cls, peer, GNUNET_ATS_SolverFunctions::s_feedback, scope, and sf.
Referenced by handle_feedback().
void GAS_plugin_solver_lock | ( | void | ) |
Stop instant solving, there are many state updates happening in bulk right now.
Definition at line 538 of file gnunet-service-ats_plugins.c.
References GNUNET_ATS_SolverFunctions::cls, GNUNET_ATS_SolverFunctions::s_bulk_start, and sf.
Referenced by GAS_addresses_add(), GAS_addresses_destroy_all(), GAS_addresses_done(), GAS_connectivity_done(), GAS_handle_preference_change(), GAS_normalization_update_property(), and preference_aging().
void GAS_plugin_solver_unlock | ( | void | ) |
Resume instant solving, we are done with the bulk state updates.
Definition at line 548 of file gnunet-service-ats_plugins.c.
References GNUNET_ATS_SolverFunctions::cls, GNUNET_ATS_SolverFunctions::s_bulk_stop, and sf.
Referenced by GAS_addresses_add(), GAS_addresses_destroy_all(), GAS_addresses_done(), GAS_connectivity_done(), GAS_handle_preference_change(), GAS_normalization_update_property(), and preference_aging().
void GAS_plugin_request_connect_start | ( | const struct GNUNET_PeerIdentity * | pid | ) |
Notify the plugin that a request to connect to a particular peer was given to us.
pid | identity of peer we now care about |
Definition at line 561 of file gnunet-service-ats_plugins.c.
References GNUNET_ATS_SolverFunctions::cls, pid, GNUNET_ATS_SolverFunctions::s_get, and sf.
Referenced by GAS_handle_request_address().
void GAS_plugin_request_connect_stop | ( | const struct GNUNET_PeerIdentity * | pid | ) |
Notify the plugin that a request to connect to a particular peer was dropped.
pid | identity of peer we care now less about |
Definition at line 575 of file gnunet-service-ats_plugins.c.
References GNUNET_ATS_SolverFunctions::cls, pid, GNUNET_ATS_SolverFunctions::s_get_stop, and sf.
Referenced by free_matching_requests().