projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
changes
[oweals/gnunet.git]
/
src
/
ats
/
gnunet-service-ats_addresses.c
diff --git
a/src/ats/gnunet-service-ats_addresses.c
b/src/ats/gnunet-service-ats_addresses.c
index d77d0d6a418dcafe748658121ddb7e576b426cd1..49d6d0b593f71cb95783b7c87481179dc3e3e99a 100644
(file)
--- 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
};
MODE_MLP
};
-
+/**
+ * Handle for ATS address component
+ */
struct GAS_Addresses_Handle
{
struct GAS_Addresses_Handle
{
+ /**
+ * A multihashmap to store all addresses
+ */
struct GNUNET_CONTAINER_MultiHashMap *addresses;
struct GNUNET_CONTAINER_MultiHashMap *addresses;
+ /**
+ * Configure WAN quota in
+ */
unsigned long long wan_quota_in;
unsigned long long wan_quota_in;
+ /**
+ * Configure WAN quota out
+ */
unsigned long long wan_quota_out;
unsigned long long wan_quota_out;
+ /**
+ * Number of active addresses
+ */
unsigned int active_addr_count;
unsigned int active_addr_count;
+ /**
+ * Is ATS addresses running
+ */
int running;
int running;
-
+ /**
+ * Configured ATS solver
+ */
int ats_mode;
int ats_mode;
- /* Solver handle */
+
+ /**
+ * Solver handle
+ */
void *solver;
/* Solver functions */
void *solver;
/* Solver functions */
+
+ /**
+ * Initialize solver
+ */
GAS_solver_init s_init;
GAS_solver_init s_init;
+
+ /**
+ * Update address in solver
+ */
GAS_solver_address_update s_update;
GAS_solver_address_update s_update;
+
+ /**
+ * Get address from solver
+ */
GAS_solver_get_preferred_address s_get;
GAS_solver_get_preferred_address s_get;
+
+ /**
+ * Delete address in solver
+ */
GAS_solver_address_delete s_del;
GAS_solver_address_delete s_del;
+
+ /**
+ * Change preference for quality in solver
+ */
GAS_solver_address_change_preference s_pref;
GAS_solver_address_change_preference s_pref;
+
+ /**
+ * Shutdown solver
+ */
GAS_solver_done s_done;
};
GAS_solver_done s_done;
};
+
+/**
+ * Temporary handle
+ */
struct GAS_Addresses_Handle *handle;
struct GAS_Addresses_Handle *handle;
+
static unsigned int
assemble_ats_information (struct ATS_Address *aa, struct GNUNET_ATS_Information **dest)
{
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)
{
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;
}
&compare_address_session_it, &cac);
return cac.exact_address;
}
-
+#endif
void
GAS_addresses_add (const struct GNUNET_PeerIdentity *peer,
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,
void
GAS_addresses_change_preference (const struct GNUNET_PeerIdentity *peer,
enum GNUNET_ATS_PreferenceKind kind,