Don't pass NULL to destroy_route
[oweals/gnunet.git] / src / cadet / gnunet-service-cadet-new_peer.h
index c633f47e5d28e75d5512126b7416e1fbd73a92e9..e1d6fc33a5e3770d81e5a8132c180295c456c7e2 100644 (file)
@@ -59,6 +59,20 @@ GCP_get (const struct GNUNET_PeerIdentity *peer_id,
          int create);
 
 
+/**
+ * Calculate how desirable a path is for @a cp if
+ * @a cp is at offset @a off in the path.
+ *
+ * @param cp a peer reachable via a path
+ * @param off offset of @a cp in a path
+ * @return score how useful a path is to reach @a cp,
+ *         positive scores mean path is more desirable
+ */
+double
+GCP_get_desirability_of_path (struct CadetPeer *cp,
+                              unsigned int off);
+
+
 /**
  * Obtain the peer identity for a `struct CadetPeer`.
  *
@@ -90,6 +104,16 @@ unsigned int
 GCP_count_paths (const struct CadetPeer *cp);
 
 
+/**
+ * Drop all paths owned by this peer, and do not
+ * allow new ones to be added: We are shutting down.
+ *
+ * @param cp peer to drop paths to
+ */
+void
+GCP_drop_owned_paths (struct CadetPeer *cp);
+
+
 /**
  * Peer path iterator.
  *
@@ -123,14 +147,14 @@ GCP_iterate_paths (struct CadetPeer *cp,
  * Iterate over the paths to @a peer where
  * @a peer is at distance @a dist from us.
  *
- * @param peer Peer to get path info.
+ * @param cp Peer to get path info.
  * @param dist desired distance of @a peer to us on the path
  * @param callback Function to call for every path.
  * @param callback_cls Closure for @a callback.
  * @return Number of iterated paths.
  */
 unsigned int
-GCP_iterate_paths_at (struct CadetPeer *peer,
+GCP_iterate_paths_at (struct CadetPeer *cp,
                       unsigned int dist,
                       GCP_PathIterator callback,
                       void *callback_cls);
@@ -193,13 +217,15 @@ GCP_drop_tunnel (struct CadetPeer *cp,
  * @param cp peer to which the @a path leads to
  * @param path a path looking for an owner; may not be fully initialized yet!
  * @param off offset of @a cp in @a path
+ * @param force for attaching the path
  * @return NULL if this peer does not care to become a new owner,
  *         otherwise the node in the peer's path heap for the @a path.
  */
 struct GNUNET_CONTAINER_HeapNode *
 GCP_attach_path (struct CadetPeer *cp,
                  struct CadetPeerPath *path,
-                 unsigned int off);
+                 unsigned int off,
+                 int force);
 
 
 /**