- cancel SYNACK retry task when forced to SYNACK by an incoming SYN
[oweals/gnunet.git] / src / mesh / mesh_path.h
index a3d2457d28b1ba02b34d9e816378f15f8deeea2a..8b8e20a1ebd4a0dbd65cc14bef0e835923d0e0cd 100644 (file)
@@ -64,7 +64,13 @@ struct MeshPeerPath
     /**
      * Path's score, how reliable is the path.
      */
-  int score;
+//   int score;
+
+  /**
+   * Task to delete the path.
+   * We tried it, it didn't work, don't try again in a while.
+   */
+  GNUNET_SCHEDULER_TaskIdentifier path_delete;
 
 };
 
@@ -112,6 +118,27 @@ path_duplicate (const struct MeshPeerPath *path);
 unsigned int
 path_get_length (struct MeshPeerPath *path);
 
+/**
+ * Mark path as invalid: keep it aroud for a while to avoid trying it in a loop.
+ *
+ * DHT_get sometimes returns bad cached results, for instance, on a locally
+ * cached result where the PUT followed a path that is no longer current.
+ *
+ * @param p Path to invalidate.
+ */
+void
+path_invalidate (struct MeshPeerPath *p);
+
+/**
+ * Test if a path is valid (or at least not known to be invalid).
+ *
+ * @param path Path to test.
+ *
+ * @return #GNUNET_YES If the path is valid or unknown,
+ *         #GNUNET_NO If the path is known to be invalid.
+ */
+int
+path_is_valid (const struct MeshPeerPath *path);
 
 /**
  * Destroy the path and free any allocated resources linked to it
@@ -123,6 +150,19 @@ path_get_length (struct MeshPeerPath *path);
 int
 path_destroy (struct MeshPeerPath *p);
 
+/**
+ * Path -> allocated one line string. Caller must free.
+ *
+ * @param p Path.
+ */
+char *
+path_2s (struct MeshPeerPath *p);
+
+/**
+ * Print info about the path for debug.
+ *
+ * @param p Path to debug.
+ */
 void
 path_debug (struct MeshPeerPath *p);
 
@@ -135,4 +175,4 @@ path_debug (struct MeshPeerPath *p);
 
 
 /* ifndef MESH_PATH_H */
-#endif
\ No newline at end of file
+#endif