- doc
[oweals/gnunet.git] / src / mesh / mesh.h
index a12c0ccb911101b696f6796a6dae2b84ac8c5f7d..02bf96ee619fff2e226ff02092839189d4a60b85 100644 (file)
@@ -208,7 +208,7 @@ struct GNUNET_MESH_LocalInfoPeer
   /**
    * Do we have a tunnel toward this peer?
    */
-  uint16_t tunnel GNUNET_PACKED;
+  int16_t tunnel GNUNET_PACKED;
 
   /**
    * ID of the destination of the tunnel (can be local peer).
@@ -310,6 +310,24 @@ uint32_t
 GM_min_pid (uint32_t a, uint32_t b);
 
 
+/**
+ * Convert a 256 bit MeshHash into a 512 HashCode to use in GNUNET_h2s,
+ * multihashmap, and other HashCode-based functions.
+ *
+ * @param id A 256 bit hash to expand.
+ *
+ * @return A HashCode containing the original 256 bit hash right-padded with 0.
+ */
+const struct GNUNET_HashCode *
+GM_h2hc (const struct GNUNET_MeshHash *id);
+
+/**
+ * Get a string from a Mesh Hash (256 bits).
+ * WARNING: Not reentrant (based on GNUNET_h2s).
+ */
+const char *
+GM_h2s (const struct GNUNET_MeshHash *id);
+
 /**
  * Convert a message type into a string to help debug
  * Generated with: