![]() |
GNUnet
0.11.x
|
ats service plugin management More...
#include "platform.h"
#include "gnunet_ats_plugin.h"
#include "gnunet-service-ats_connectivity.h"
#include "gnunet-service-ats_performance.h"
#include "gnunet-service-ats_preferences.h"
#include "gnunet-service-ats_plugins.h"
#include "gnunet-service-ats_reservations.h"
#include "gnunet-service-ats_scheduling.h"
#include "gnunet-service-ats_normalization.h"
Go to the source code of this file.
Functions | |
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... | |
static void | solver_info_cb (void *cls, enum GAS_Solver_Operation op, enum GAS_Solver_Status status, enum GAS_Solver_Additional_Information add) |
Solver information callback. More... | |
static void | bandwidth_changed_cb (void *cls, struct ATS_Address *address) |
Callback for solver to notify about assignment changes. More... | |
static unsigned long long | parse_quota (const char *quota_str, const char *direction, enum GNUNET_NetworkType network) |
Convert quota from text to numeric value. More... | |
static unsigned long long | load_quota (const struct GNUNET_CONFIGURATION_Handle *cfg, enum GNUNET_NetworkType type, const char *direction) |
Load quota value from the configuration cfg for the given network type and direction. More... | |
static unsigned int | load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg, unsigned long long *out_dest, unsigned long long *in_dest, int dest_length) |
Load quotas for networks from configuration. More... | |
int | GAS_plugin_init (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Initialize plugins subsystem. More... | |
void | GAS_plugin_done () |
Shutdown address subsystem. 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 () |
Stop instant solving, there are many state updates happening in bulk right now. More... | |
void | GAS_plugin_solver_unlock () |
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... | |
Variables | |
static struct GNUNET_ATS_SolverFunctions * | sf |
Solver handle. More... | |
static struct GNUNET_ATS_PluginEnvironment | env |
Solver environment. More... | |
static char * | plugin |
Solver plugin name as string. More... | |
ats service plugin management
Definition in file gnunet-service-ats_plugins.c.
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, and GNUNET_ATS_SolverFunctions::s_pref.
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 79 of file gnunet-service-ats_plugins.c.
References GNUNET_ATS_SolverFunctions::cls, and GNUNET_ATS_SolverFunctions::s_address_update_property.
Referenced by notify_change().
|
static |
Solver information callback.
cls | the closure |
op | the operation |
status | operation status |
add | additional information |
Definition at line 95 of file gnunet-service-ats_plugins.c.
References GAS_INFO_FULL, GAS_INFO_NONE, GAS_INFO_PROP_ALL, GAS_INFO_PROP_SINGLE, GAS_INFO_UPDATED, 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_SETUP_START, GAS_OP_SOLVE_SETUP_STOP, GAS_OP_SOLVE_START, GAS_OP_SOLVE_STOP, GAS_OP_SOLVE_UPDATE_NOTIFICATION_START, GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP, GAS_STAT_SUCCESS, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, and GNUNET_log.
Referenced by GAS_plugin_init().
|
static |
Callback for solver to notify about assignment changes.
cls | NULL |
address | the address with changes |
Definition at line 215 of file gnunet-service-ats_plugins.c.
References ATS_Address::active, ATS_Address::addr, ATS_Address::addr_len, ATS_Address::assigned_bw_in, ATS_Address::assigned_bw_out, GAS_performance_notify_all_clients(), GAS_reservations_set_bandwidth(), GAS_scheduling_transmit_address_suggestion(), GNUNET_BANDWIDTH_value_init(), GNUNET_BANDWIDTH_ZERO, GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, ATS_Address::last_notified_bw_in, ATS_Address::last_notified_bw_out, ATS_Address::local_address_info, ATS_Address::peer, ATS_Address::plugin, ATS_Address::properties, and ATS_Address::session_id.
Referenced by GAS_plugin_init().
|
static |
Convert quota from text to numeric value.
quota_str | the value found in the configuration |
direction | direction of the quota |
network | network the quota applies to |
Definition at line 298 of file gnunet-service-ats_plugins.c.
References _, GNUNET_ATS_DefaultBandwidth, GNUNET_ATS_MaxBandwidth, GNUNET_ATS_MaxBandwidthString, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_NO, GNUNET_NT_to_string(), GNUNET_OK, GNUNET_STRINGS_fancy_size_to_bytes(), GNUNET_YES, res, and ret.
Referenced by load_quota().
|
static |
Load quota value from the configuration cfg for the given network type and direction.
cfg | configuration to parse |
type | network type to parse for |
direction | traffic direction to parse for |
Definition at line 355 of file gnunet-service-ats_plugins.c.
References _, GNUNET_asprintf(), GNUNET_ATS_DefaultBandwidth, GNUNET_CONFIGURATION_get_value_string(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_NT_to_string(), GNUNET_OK, parse_quota(), and ret.
Referenced by load_quotas().
|
static |
Load quotas for networks from configuration.
cfg | configuration handle |
out_dest | where to write outbound quotas |
in_dest | where to write inbound quotas |
dest_length | length of inbound and outbound arrays |
Definition at line 403 of file gnunet-service-ats_plugins.c.
References GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NT_COUNT, GNUNET_NT_to_string(), and load_quota().
Referenced by GAS_plugin_init().
int GAS_plugin_init | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg | ) |
Initialize plugins subsystem.
Initialize address subsystem.
cfg | configuration to use |
Definition at line 436 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, solver_info_cb(), and GNUNET_ATS_PluginEnvironment::stats.
Referenced by run().
void GAS_plugin_done | ( | void | ) |
Shutdown address subsystem.
Definition at line 486 of file gnunet-service-ats_plugins.c.
References GNUNET_free, GNUNET_PLUGIN_unload(), and plugin.
Referenced by cleanup_task().
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 503 of file gnunet-service-ats_plugins.c.
References GNUNET_ATS_SolverFunctions::cls, ATS_Address::properties, GNUNET_ATS_SolverFunctions::s_add, and GNUNET_ATS_Properties::scope.
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 518 of file gnunet-service-ats_plugins.c.
References GNUNET_ATS_SolverFunctions::cls, and GNUNET_ATS_SolverFunctions::s_del.
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 536 of file gnunet-service-ats_plugins.c.
References GNUNET_ATS_SolverFunctions::cls, and GNUNET_ATS_SolverFunctions::s_feedback.
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 556 of file gnunet-service-ats_plugins.c.
References GNUNET_ATS_SolverFunctions::cls, and GNUNET_ATS_SolverFunctions::s_bulk_start.
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 566 of file gnunet-service-ats_plugins.c.
References GNUNET_ATS_SolverFunctions::cls, and GNUNET_ATS_SolverFunctions::s_bulk_stop.
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 579 of file gnunet-service-ats_plugins.c.
References GNUNET_ATS_SolverFunctions::cls, and GNUNET_ATS_SolverFunctions::s_get.
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 593 of file gnunet-service-ats_plugins.c.
References GNUNET_ATS_SolverFunctions::cls, and GNUNET_ATS_SolverFunctions::s_get_stop.
Referenced by free_matching_requests().
|
static |
Solver handle.
Definition at line 41 of file gnunet-service-ats_plugins.c.
Referenced by libgnunet_plugin_ats_proportional_done(), and libgnunet_plugin_ats_proportional_init().
|
static |
Solver environment.
Definition at line 46 of file gnunet-service-ats_plugins.c.
Referenced by GAS_plugin_init().
|
static |
Solver plugin name as string.
Definition at line 51 of file gnunet-service-ats_plugins.c.
Referenced by __attribute__(), ack_message_sent(), ack_proc(), add_plugin(), address_notification(), append_port(), broadcast_mst_cb(), client_connect(), client_delete_session(), client_receive_mst_cb(), client_run(), client_send_cb(), connect_notify(), create_macendpoint(), create_session(), delete_entries(), destroy_session_cb(), disconnect_and_free_it(), disconnect_notify(), do_transmit(), enqueue_fragment(), expi_proc(), expire_blocks(), expire_entries(), find_plugin(), fragmented_message_done(), free_macendpoint(), free_value(), GAS_plugin_done(), GAS_plugin_init(), get_session_delete_it(), GNUNET_BLOCK_context_destroy(), GNUNET_BLOCK_evaluate(), GNUNET_BLOCK_get_key(), GNUNET_BLOCK_group_create(), GNUNET_GNSRECORD_number_to_typename(), GNUNET_GNSRECORD_string_to_value(), GNUNET_GNSRECORD_typename_to_number(), GNUNET_GNSRECORD_value_to_string(), GNUNET_RECLAIM_attribute_number_to_typename(), GNUNET_RECLAIM_attribute_string_to_value(), GNUNET_RECLAIM_attribute_typename_to_number(), GNUNET_RECLAIM_attribute_value_to_string(), GNUNET_RECLAIM_credential_get_attributes(), GNUNET_RECLAIM_credential_get_expiration(), GNUNET_RECLAIM_credential_get_issuer(), GNUNET_RECLAIM_credential_get_presentation(), GNUNET_RECLAIM_credential_number_to_typename(), GNUNET_RECLAIM_credential_string_to_value(), GNUNET_RECLAIM_credential_typename_to_number(), GNUNET_RECLAIM_credential_value_to_string(), GNUNET_RECLAIM_presentation_get_attributes(), GNUNET_RECLAIM_presentation_get_expiration(), GNUNET_RECLAIM_presentation_get_issuer(), GNUNET_RECLAIM_presentation_number_to_typename(), GNUNET_RECLAIM_presentation_string_to_value(), GNUNET_RECLAIM_presentation_typename_to_number(), GNUNET_RECLAIM_presentation_value_to_string(), handle_helper_message(), handle_tcp_data(), handle_tcp_nat_probe(), handle_tcp_welcome(), heap_get_keys(), heap_plugin_del(), heap_plugin_estimate_size(), heap_plugin_get(), heap_plugin_get_closest(), heap_plugin_get_expiration(), heap_plugin_get_key(), heap_plugin_get_random(), heap_plugin_get_replication(), heap_plugin_get_zero_anonymity(), heap_plugin_put(), heap_plugin_remove_key(), http_client_plugin_get_network_for_address(), http_client_plugin_get_session(), http_client_plugin_peer_disconnect(), http_client_plugin_send(), http_client_plugin_session_disconnect(), http_client_plugin_setup_monitor(), iface_proc(), iterate_entries(), libgnunet_plugin_datacache_heap_done(), libgnunet_plugin_datacache_heap_init(), libgnunet_plugin_datacache_postgres_done(), libgnunet_plugin_datacache_postgres_init(), libgnunet_plugin_datacache_sqlite_done(), libgnunet_plugin_datacache_sqlite_init(), libgnunet_plugin_datacache_template_done(), libgnunet_plugin_datacache_template_init(), libgnunet_plugin_datastore_heap_done(), libgnunet_plugin_datastore_heap_init(), libgnunet_plugin_datastore_mysql_done(), libgnunet_plugin_datastore_mysql_init(), libgnunet_plugin_datastore_postgres_done(), libgnunet_plugin_datastore_postgres_init(), libgnunet_plugin_datastore_sqlite_done(), libgnunet_plugin_datastore_sqlite_init(), libgnunet_plugin_datastore_template_done(), libgnunet_plugin_datastore_template_init(), libgnunet_plugin_namecache_flat_done(), libgnunet_plugin_namecache_flat_init(), libgnunet_plugin_namecache_postgres_done(), libgnunet_plugin_namecache_postgres_init(), libgnunet_plugin_namecache_sqlite_done(), libgnunet_plugin_namecache_sqlite_init(), libgnunet_plugin_namestore_flat_done(), libgnunet_plugin_namestore_flat_init(), libgnunet_plugin_namestore_postgres_done(), libgnunet_plugin_namestore_postgres_init(), libgnunet_plugin_namestore_sqlite_done(), libgnunet_plugin_namestore_sqlite_init(), libgnunet_plugin_peerstore_flat_done(), libgnunet_plugin_peerstore_flat_init(), libgnunet_plugin_peerstore_sqlite_done(), libgnunet_plugin_peerstore_sqlite_init(), libgnunet_plugin_rest_config_done(), libgnunet_plugin_rest_config_init(), libgnunet_plugin_rest_copying_done(), libgnunet_plugin_rest_copying_init(), libgnunet_plugin_rest_gns_done(), libgnunet_plugin_rest_gns_init(), libgnunet_plugin_rest_identity_done(), libgnunet_plugin_rest_identity_init(), libgnunet_plugin_rest_namestore_done(), libgnunet_plugin_rest_namestore_init(), libgnunet_plugin_rest_openid_connect_done(), libgnunet_plugin_rest_openid_connect_init(), libgnunet_plugin_rest_peerinfo_done(), libgnunet_plugin_rest_peerinfo_init(), libgnunet_plugin_rest_reclaim_done(), libgnunet_plugin_rest_reclaim_init(), LIBGNUNET_PLUGIN_TRANSPORT_DONE(), libgnunet_plugin_transport_http_client_done(), libgnunet_plugin_transport_http_client_init(), libgnunet_plugin_transport_http_server_init(), LIBGNUNET_PLUGIN_TRANSPORT_INIT(), libgnunet_plugin_transport_tcp_done(), libgnunet_plugin_transport_tcp_init(), libgnunet_plugin_transport_udp_done(), libgnunet_plugin_transport_unix_done(), libgnunet_plugin_transport_unix_init(), mysql_plugin_drop(), mysql_plugin_estimate_size(), mysql_plugin_get_expiration(), mysql_plugin_get_key(), mysql_plugin_get_keys(), mysql_plugin_get_replication(), mysql_plugin_get_zero_anonymity(), mysql_plugin_put(), mysql_plugin_remove_key(), namecache_cache_block(), namecache_lookup_block(), namecache_postgres_cache_block(), namecache_postgres_lookup_block(), namecache_sqlite_cache_block(), namecache_sqlite_lookup_block(), namestore_flat_iterate_records(), namestore_flat_lookup_records(), namestore_flat_store_records(), namestore_flat_zone_to_name(), namestore_postgres_iterate_records(), namestore_postgres_lookup_records(), namestore_postgres_store_records(), namestore_postgres_zone_to_name(), namestore_sqlite_iterate_records(), namestore_sqlite_lookup_records(), namestore_sqlite_store_records(), namestore_sqlite_zone_to_name(), notify_send_probe(), peerstore_flat_delete_records(), peerstore_flat_expire_records(), peerstore_flat_iterate_records(), peerstore_flat_store_record(), peerstore_sqlite_delete_records(), peerstore_sqlite_expire_records(), peerstore_sqlite_iterate_records(), peerstore_sqlite_store_record(), postgres_plugin_del(), postgres_plugin_drop(), postgres_plugin_estimate_size(), postgres_plugin_get(), postgres_plugin_get_closest(), postgres_plugin_get_expiration(), postgres_plugin_get_key(), postgres_plugin_get_keys(), postgres_plugin_get_random(), postgres_plugin_get_replication(), postgres_plugin_get_zero_anonymity(), postgres_plugin_put(), postgres_plugin_remove_key(), process_data(), process_inbound_tokenized_messages(), process_result(), qc_fragment_sent(), qc_message_sent(), read_process_fragment(), repl_proc(), send_hello_beacon(), send_session_info_iter(), send_with_fragmentation(), server_lookup_connection(), server_wake_up(), session_disconnect_it(), session_timeout(), sqlite_plugin_del(), sqlite_plugin_drop(), sqlite_plugin_estimate_size(), sqlite_plugin_get(), sqlite_plugin_get_closest(), sqlite_plugin_get_expiration(), sqlite_plugin_get_key(), sqlite_plugin_get_keys(), sqlite_plugin_get_random(), sqlite_plugin_get_replication(), sqlite_plugin_get_zero_anonymity(), sqlite_plugin_put(), sqlite_plugin_remove_key(), tcp_nat_port_map_callback(), tcp_plugin_address_pretty_printer(), tcp_plugin_check_address(), tcp_plugin_disconnect(), tcp_plugin_disconnect_session(), tcp_plugin_get_network_for_address(), tcp_plugin_get_session(), tcp_plugin_send(), tcp_plugin_setup_monitor(), tcp_plugin_string_to_address(), try_connection_reversal(), udp_broadcast_receive(), udp_disconnect(), udp_disconnect_session(), udp_ipv4_broadcast_send(), udp_ipv6_broadcast_send(), udp_nat_port_map_callback(), udp_plugin_address_pretty_printer(), udp_plugin_check_address(), udp_plugin_create_session(), udp_plugin_get_network_for_address(), udp_plugin_get_session(), udp_plugin_lookup_session(), udp_plugin_select_v4(), udp_plugin_select_v6(), udp_plugin_send(), udp_plugin_setup_monitor(), udp_plugin_update_session_timeout(), udp_string_to_address(), unix_plugin_check_address(), unix_plugin_get_session(), unix_plugin_peer_disconnect(), unix_plugin_select_read(), unix_plugin_select_write(), unix_plugin_send(), unix_plugin_session_disconnect(), unix_plugin_setup_monitor(), unix_plugin_string_to_address(), unix_plugin_update_session_timeout(), unix_real_send(), unix_transport_server_start(), wlan_data_message_handler(), wlan_plugin_address_suggested(), wlan_plugin_disconnect_peer(), wlan_plugin_disconnect_session(), wlan_plugin_get_session(), wlan_plugin_send(), wlan_plugin_setup_monitor(), and wlan_plugin_string_to_address().