summaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_validation.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-07 15:09:25 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-07 15:09:25 +0000
commit1e672718b471fe766ac72aa96781552d1678986b (patch)
tree75ecf350d399aeebb0cdc88b91865cd8cd12c885 /src/transport/gnunet-service-transport_validation.h
parent20379063dd3ee6f3b7091a3d89e572886b295264 (diff)
PING regularly, track latency, towards fixing 1793, 1879
Diffstat (limited to 'src/transport/gnunet-service-transport_validation.h')
-rw-r--r--src/transport/gnunet-service-transport_validation.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/transport/gnunet-service-transport_validation.h b/src/transport/gnunet-service-transport_validation.h
index 06370161c..0e3c5e96d 100644
--- a/src/transport/gnunet-service-transport_validation.h
+++ b/src/transport/gnunet-service-transport_validation.h
@@ -46,6 +46,52 @@ GST_validation_stop (void);
/**
+ * Update if we are using an address for a connection actively right now.
+ * Based on this, the validation module will measure latency for the
+ * address more or less often.
+ *
+ * @param sender peer sending the PING
+ * @param hdr the PING
+ * @param plugin_name name of plugin that received the PING
+ * @param session session we got the PING from
+ * @param sender_address address of the sender as known to the plugin, NULL
+ * if we did not initiate the connection
+ * @param sender_address_len number of bytes in sender_address
+ * @param in_use GNUNET_YES if we are now using the address for a connection,
+ * GNUNET_NO if we are no longer using the address for a connection
+ */
+void
+GST_validation_set_address_use (const struct GNUNET_PeerIdentity *sender,
+ const struct GNUNET_MessageHeader *hdr,
+ const char *plugin_name, struct Session *session,
+ const void *sender_address,
+ size_t sender_address_len,
+ int in_use);
+
+
+/**
+ * Query validation about the latest observed latency on a given
+ * address.
+ *
+ * @param sender peer sending the PING
+ * @param hdr the PING
+ * @param plugin_name name of plugin that received the PING
+ * @param session session we got the PING from
+ * @param sender_address address of the sender as known to the plugin, NULL
+ * if we did not initiate the connection
+ * @param sender_address_len number of bytes in sender_address
+ * @return observed latency of the address, FOREVER if the address was
+ * never successfully validated
+ */
+struct GNUNET_TIME_Relative
+GST_validation_get_address_latency (const struct GNUNET_PeerIdentity *sender,
+ const struct GNUNET_MessageHeader *hdr,
+ const char *plugin_name, struct Session *session,
+ const void *sender_address,
+ size_t sender_address_len);
+
+
+/**
* We've received a PING. If appropriate, generate a PONG.
*
* @param sender peer sending the PING