X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fats%2Fgnunet-service-ats_addresses.c;h=49d6d0b593f71cb95783b7c87481179dc3e3e99a;hb=64e4ca7129e49dcc11a6db834107dda7ca1f9cf9;hp=d77d0d6a418dcafe748658121ddb7e576b426cd1;hpb=7915776be62e6875681c2123fd85820dd1e90bdf;p=oweals%2Fgnunet.git diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index d77d0d6a4..49d6d0b59 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c @@ -62,35 +62,86 @@ enum ATS_Mode MODE_MLP }; - +/** + * Handle for ATS address component + */ struct GAS_Addresses_Handle { + /** + * A multihashmap to store all addresses + */ struct GNUNET_CONTAINER_MultiHashMap *addresses; + /** + * Configure WAN quota in + */ unsigned long long wan_quota_in; + /** + * Configure WAN quota out + */ unsigned long long wan_quota_out; + /** + * Number of active addresses + */ unsigned int active_addr_count; + /** + * Is ATS addresses running + */ int running; - + /** + * Configured ATS solver + */ int ats_mode; - /* Solver handle */ + + /** + * Solver handle + */ void *solver; /* Solver functions */ + + /** + * Initialize solver + */ GAS_solver_init s_init; + + /** + * Update address in solver + */ GAS_solver_address_update s_update; + + /** + * Get address from solver + */ GAS_solver_get_preferred_address s_get; + + /** + * Delete address in solver + */ GAS_solver_address_delete s_del; + + /** + * Change preference for quality in solver + */ GAS_solver_address_change_preference s_pref; + + /** + * Shutdown solver + */ GAS_solver_done s_done; }; + +/** + * Temporary handle + */ struct GAS_Addresses_Handle *handle; + static unsigned int assemble_ats_information (struct ATS_Address *aa, struct GNUNET_ATS_Information **dest) { @@ -410,6 +461,7 @@ lookup_address (const struct GNUNET_PeerIdentity *peer, } +#if 0 static int compare_address_session_it (void *cls, const struct GNUNET_HashCode * key, void *value) { @@ -449,7 +501,7 @@ find_exact_address (const struct GNUNET_PeerIdentity *peer, &compare_address_session_it, &cac); return cac.exact_address; } - +#endif void GAS_addresses_add (const struct GNUNET_PeerIdentity *peer, @@ -946,9 +998,6 @@ GAS_addresses_handle_backoff_reset (const struct GNUNET_PeerIdentity *peer) } - -// FIXME: this function should likely end up in the LP-subsystem and -// not with 'addresses' in the future... void GAS_addresses_change_preference (const struct GNUNET_PeerIdentity *peer, enum GNUNET_ATS_PreferenceKind kind,