From d83640d04d57f6388b37d19a814eb6770ea4c485 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Tue, 8 Oct 2013 10:30:26 +0000 Subject: - move all core/PeerIdentity interacting code to _peer, remove GNUNET_PeerIdentity from _connection --- src/mesh/gnunet-service-mesh_connection.h | 34 +++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'src/mesh/gnunet-service-mesh_connection.h') diff --git a/src/mesh/gnunet-service-mesh_connection.h b/src/mesh/gnunet-service-mesh_connection.h index 4e423e7ee..8395010fd 100644 --- a/src/mesh/gnunet-service-mesh_connection.h +++ b/src/mesh/gnunet-service-mesh_connection.h @@ -109,20 +109,17 @@ void GMC_change_state (struct MeshConnection* c, enum MeshConnectionState state); /** - * Iterator to notify all connections of a broken link. Mark connections + * Notify other peers on a connection of a broken link. Mark connections * to destroy after all traffic has been sent. * - * @param cls Closure (peer disconnected). - * @param key Current key code (tid). - * @param value Value in the hash map (connection). - * - * @return GNUNET_YES if we should continue to iterate, - * GNUNET_NO if not. + * @param c Connection on which there has been a disconnection. + * @param peer Peer that disconnected. + * @param my_full_id My ID (to send to other peers). */ -int -GMC_notify_broken (void *cls, - const struct GNUNET_HashCode *key, - void *value); +void +GMC_notify_broken (struct MeshConnection *c, + struct MeshPeer *peer, + struct GNUNET_PeerIdentity *my_full_id); /** * @brief Queue and pass message to core when possible. @@ -192,6 +189,21 @@ GMC_is_origin (struct MeshConnection *c, int fwd); int GMC_is_terminal (struct MeshConnection *c, int fwd); +/** + * Sends an already built message on a connection, properly registering + * all used resources. + * + * @param message Message to send. Function makes a copy of it. + * If message is not hop-by-hop, decrements TTL of copy. + * @param c Connection on which this message is transmitted. + * @param ch Channel on which this message is transmitted, or NULL. + * @param fwd Is this a fwd message? + */ +void +GMC_send_prebuilt_message (const struct GNUNET_MessageHeader *message, + struct MeshConnection *c, + struct MeshChannel *ch, + int fwd); #if 0 /* keep Emacsens' auto-indent happy */ -- cgit v1.2.3