- add hello messages to peers
authorBart Polot <bart@net.in.tum.de>
Tue, 4 Feb 2014 12:36:30 +0000 (12:36 +0000)
committerBart Polot <bart@net.in.tum.de>
Tue, 4 Feb 2014 12:36:30 +0000 (12:36 +0000)
src/mesh/gnunet-service-mesh_peer.c
src/mesh/gnunet-service-mesh_peer.h

index c02de9edc4c9868f3d668ec030d458c71fb649d7..e073b3355ec72a0f27e85788b1eef4b92af4f191 100644 (file)
@@ -159,6 +159,11 @@ struct MeshPeer
    * How many messages are in the queue to this peer.
    */
   unsigned int queue_n;
+
+  /**
+   * Hello message.
+   */
+  const struct GNUNET_HELLO_Message* hello;
 };
 
 
@@ -1439,19 +1444,6 @@ GMP_connect (struct MeshPeer *peer)
 }
 
 
-/**
- * Set tunnel.
- *
- * @param peer Peer.
- * @param t Tunnel.
- */
-void
-GMP_set_tunnel (struct MeshPeer *peer, struct MeshTunnel3 *t)
-{
-  peer->tunnel = t;
-}
-
-
 /**
  * Chech whether there is a direct (core level)  connection to peer.
  *
@@ -1814,6 +1806,19 @@ GMP_get_short_id (const struct MeshPeer *peer)
 }
 
 
+/**
+ * Set tunnel.
+ *
+ * @param peer Peer.
+ * @param t Tunnel.
+ */
+void
+GMP_set_tunnel (struct MeshPeer *peer, struct MeshTunnel3 *t)
+{
+  peer->tunnel = t;
+}
+
+
 /**
  * Get the tunnel towards a peer.
  *
@@ -1828,6 +1833,33 @@ GMP_get_tunnel (const struct MeshPeer *peer)
 }
 
 
+/**
+ * Set the hello message.
+ *
+ * @param peer Peer whose message to set.
+ * @param hello Hello message.
+ */
+void
+GMP_set_hello (struct MeshPeer *peer, const struct GNUNET_HELLO_Message *hello)
+{
+  peer->hello = hello;
+}
+
+
+/**
+ * Get the hello message.
+ *
+ * @param peer Peer whose message to get.
+ *
+ * @return Hello message.
+ */
+const struct GNUNET_HELLO_Message *
+GMP_get_hello (struct MeshPeer *peer)
+{
+  return peer->hello;
+}
+
+
 /**
  * Count the number of known paths toward the peer.
  *
index 0a6237c6a82691234eaa3c23725a806eea79e99a..d5c189d534c1fc782ea0bd9960d9c198b94a5b7e 100644 (file)
@@ -318,6 +318,25 @@ GMP_get_short_id (const struct MeshPeer *peer);
 struct MeshTunnel3 *
 GMP_get_tunnel (const struct MeshPeer *peer);
 
+/**
+ * Set the hello message.
+ *
+ * @param peer Peer whose message to set.
+ * @param hello Hello message.
+ */
+void
+GMP_set_hello (struct MeshPeer *peer, const struct GNUNET_HELLO_Message *hello);
+
+/**
+ * Get the hello message.
+ *
+ * @param peer Peer whose message to get.
+ *
+ * @return Hello message.
+ */
+const struct GNUNET_HELLO_Message *
+GMP_get_hello (struct MeshPeer *peer);
+
 /**
  * Count the number of known paths toward the peer.
  *