summaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_validation.h
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-01-15 17:18:11 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-01-15 17:18:11 +0000
commit2368c95a00afc72a8f03ab67bca1ff41328eecdf (patch)
tree3bcbc29808d7e91c85ca60ac5c998374b458862e /src/transport/gnunet-service-transport_validation.h
parentb0144a11f14f33ab010fd7cf8c61bdd361f20fd3 (diff)
transport validation monitoring API (not yet complete) + CLI
+ fix for crash in transport/plugin_transport_udp.c
Diffstat (limited to 'src/transport/gnunet-service-transport_validation.h')
-rw-r--r--src/transport/gnunet-service-transport_validation.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/transport/gnunet-service-transport_validation.h b/src/transport/gnunet-service-transport_validation.h
index e07afc409..d117faca5 100644
--- a/src/transport/gnunet-service-transport_validation.h
+++ b/src/transport/gnunet-service-transport_validation.h
@@ -31,6 +31,26 @@
#include "gnunet_util_lib.h"
#include "gnunet_hello_lib.h"
+/**
+ * Function called for each address (or address status change) that
+ * the validation module is aware of (for the given target).
+ *
+ * @param cls closure
+ * @param public_key public key for the peer, never NULL
+ * @param valid_until is ZERO if we never validated the address,
+ * otherwise a time up to when we consider it (or was) valid
+ * @param validation_block is FOREVER if the address is for an unsupported plugin (from PEERINFO)
+ * is ZERO if the address is considered valid (no validation needed)
+ * otherwise a time in the future if we're currently denying re-validation
+ * @param address the address
+ */
+typedef void (*GST_ValidationChangedCallback) (void *cls,
+ const struct GNUNET_PeerIdentity *peer,
+ const struct GNUNET_HELLO_Address *address,
+ struct GNUNET_TIME_Absolute last_validation,
+ struct GNUNET_TIME_Absolute valid_until,
+ struct GNUNET_TIME_Absolute next_validation,
+ enum GNUNET_TRANSPORT_ValidationState state);
/**
* Start the validation subsystem.
@@ -38,7 +58,7 @@
* @param max_fds maximum number of fds to use
*/
void
-GST_validation_start (unsigned int max_fds);
+GST_validation_start (GST_ValidationChangedCallback cb, void *cb_cls, unsigned int max_fds);
/**
@@ -79,6 +99,14 @@ GST_validation_get_address_latency (const struct GNUNET_PeerIdentity *sender,
const struct GNUNET_HELLO_Address *address,
struct Session *session);
+/**
+ * Iterate over all iteration entries
+ *
+ * @param cb function to call
+ * @param cb_cls closure for cb
+ */
+void
+GST_validation_iterate (GST_ValidationChangedCallback cb, void *cb_cls);
/**
* We've received a PING. If appropriate, generate a PONG.