manage preferences expressed by clients More...
#include "gnunet_util_lib.h"
#include "gnunet_ats_service.h"
#include "gnunet-service-ats.h"
#include "gnunet_statistics_service.h"
#include "ats.h"
Go to the source code of this file.
Macros | |
#define | DEFAULT_ABS_PREFERENCE 0.0 |
Default preference value we assume if we know nothing. More... | |
#define | DEFAULT_REL_PREFERENCE 0.0 |
Default relative preference value we assume if we know nothing. More... | |
Functions | |
void | GAS_handle_preference_change (struct GNUNET_SERVICE_Client *client, const struct ChangePreferenceMessage *msg) |
Handle 'preference change' messages from clients. More... | |
void | GAS_preference_init (void) |
Initialize preferences subsystem. More... | |
void | GAS_preference_done (void) |
Shutdown preferences subsystem. More... | |
const double * | GAS_preference_get_by_peer (void *cls, const struct GNUNET_PeerIdentity *id) |
Get the normalized preference values for a specific peer. More... | |
void | GAS_preference_client_disconnect (struct GNUNET_SERVICE_Client *client) |
A performance client disconnected. More... | |
manage preferences expressed by clients
Definition in file gnunet-service-ats_preferences.h.
#define DEFAULT_ABS_PREFERENCE 0.0 |
Default preference value we assume if we know nothing.
Definition at line 38 of file gnunet-service-ats_preferences.h.
#define DEFAULT_REL_PREFERENCE 0.0 |
Default relative preference value we assume if we know nothing.
Definition at line 43 of file gnunet-service-ats_preferences.h.
void GAS_handle_preference_change | ( | struct GNUNET_SERVICE_Client * | client, |
const struct ChangePreferenceMessage * | msg | ||
) |
Handle 'preference change' messages from clients.
client | the client that sent the request |
msg | the request message |
Definition at line 650 of file gnunet-service-ats_preferences.c.
References GAS_plugin_solver_lock(), GAS_plugin_solver_unlock(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_update(), GSA_stats, msg, pi, PreferenceInformation::preference_kind, PreferenceInformation::preference_value, and update_preference().
Referenced by handle_preference_change().
void GAS_preference_init | ( | void | ) |
Initialize preferences subsystem.
Definition at line 680 of file gnunet-service-ats_preferences.c.
References DEFAULT_REL_PREFERENCE, defvalues, PeerRelative::f_rel, GNUNET_ATS_PREFERENCE_END, GNUNET_CONTAINER_multipeermap_create(), GNUNET_NO, and preference_peers.
Referenced by run().
void GAS_preference_done | ( | void | ) |
Shutdown preferences subsystem.
Definition at line 695 of file gnunet-service-ats_preferences.c.
References aging_task, free_peer(), free_preference(), GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_free, GNUNET_SCHEDULER_cancel(), pc, pc_head, pc_tail, and preference_peers.
Referenced by cleanup_task(), and run().
const double* GAS_preference_get_by_peer | ( | void * | cls, |
const struct GNUNET_PeerIdentity * | id | ||
) |
Get the normalized preference values for a specific peer.
cls | ignored |
id | the peer |
enum GNUNET_ATS_PreferenceKind
, never NULLGet the normalized preference values for a specific peer.
cls | ignored |
id | the peer |
Definition at line 735 of file gnunet-service-ats_preferences.c.
References defvalues, PeerRelative::f_rel, GNUNET_CONTAINER_multipeermap_get(), preference_peers, and rp.
Referenced by GAS_plugin_init(), and get_preferences_cb().
void GAS_preference_client_disconnect | ( | struct GNUNET_SERVICE_Client * | client | ) |
A performance client disconnected.
client | the disconnecting client |
Definition at line 751 of file gnunet-service-ats_preferences.c.
References PreferenceClient::client, free_preference(), GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_free, PreferenceClient::next, pc_head, pc_tail, and PreferenceClient::peer2pref.
Referenced by client_disconnect_cb().