From: Bart Polot Date: Tue, 4 Feb 2014 12:36:30 +0000 (+0000) Subject: - add hello messages to peers X-Git-Tag: initial-import-from-subversion-38251~4812 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d8ec84381eb2a365ef40af64d8c88f039ddd1095;p=oweals%2Fgnunet.git - add hello messages to peers --- diff --git a/src/mesh/gnunet-service-mesh_peer.c b/src/mesh/gnunet-service-mesh_peer.c index c02de9edc..e073b3355 100644 --- a/src/mesh/gnunet-service-mesh_peer.c +++ b/src/mesh/gnunet-service-mesh_peer.c @@ -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. * diff --git a/src/mesh/gnunet-service-mesh_peer.h b/src/mesh/gnunet-service-mesh_peer.h index 0a6237c6a..d5c189d53 100644 --- a/src/mesh/gnunet-service-mesh_peer.h +++ b/src/mesh/gnunet-service-mesh_peer.h @@ -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. *