diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-09-26 12:24:41 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-09-26 12:24:41 +0000 |
commit | 535d51c21e7ed8b8e1f9bec144c54f177de6b2f5 (patch) | |
tree | a824b52be525a48289f2191c638f4d5c9d26d138 /src/mesh/mesh_tunnel_tree.h | |
parent | aa390e34b0b9e793e1c9f82a606ad0c10fcc84ca (diff) | |
download | gnunet-535d51c21e7ed8b8e1f9bec144c54f177de6b2f5.tar.gz gnunet-535d51c21e7ed8b8e1f9bec144c54f177de6b2f5.zip |
Added new api in the tree module to handle core or remote disconnections
Added reconnecting mechanism to find new paths in case of peer disconnection
Diffstat (limited to 'src/mesh/mesh_tunnel_tree.h')
-rw-r--r-- | src/mesh/mesh_tunnel_tree.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mesh/mesh_tunnel_tree.h b/src/mesh/mesh_tunnel_tree.h index 252929549..f187e7957 100644 --- a/src/mesh/mesh_tunnel_tree.h +++ b/src/mesh/mesh_tunnel_tree.h | |||
@@ -128,6 +128,16 @@ struct MeshTunnelTree | |||
128 | struct MeshTunnelTreeNode *me; | 128 | struct MeshTunnelTreeNode *me; |
129 | 129 | ||
130 | /** | 130 | /** |
131 | * DLL of disconneted nodes | ||
132 | */ | ||
133 | struct MeshTunnelTreeNode *disconnected_head; | ||
134 | |||
135 | /** | ||
136 | * DLL of disconneted nodes | ||
137 | */ | ||
138 | struct MeshTunnelTreeNode *disconnected_tail; | ||
139 | |||
140 | /** | ||
131 | * Cache of all peers and the first hop to them. | 141 | * Cache of all peers and the first hop to them. |
132 | * Indexed by PeerIdentity, contains a pointer to the PeerIdentity | 142 | * Indexed by PeerIdentity, contains a pointer to the PeerIdentity |
133 | * of 1st hop. | 143 | * of 1st hop. |
@@ -298,6 +308,24 @@ tree_add_path (struct MeshTunnelTree *t, | |||
298 | 308 | ||
299 | 309 | ||
300 | /** | 310 | /** |
311 | * Notifies a tree that a connection it might be using is broken. | ||
312 | * Marks all peers down the paths as disconnected and notifies the client. | ||
313 | * | ||
314 | * @param t Tree to use. | ||
315 | * @param p1 Short id of one of the peers (order unimportant) | ||
316 | * @param p2 Short id of one of the peers (order unimportant) | ||
317 | * @param cb Function to call for every peer that is marked as disconnected. | ||
318 | * | ||
319 | * @return Short ID of the first disconnected peer in the tree. | ||
320 | */ | ||
321 | GNUNET_PEER_Id | ||
322 | tree_notify_connection_broken (struct MeshTunnelTree *t, | ||
323 | GNUNET_PEER_Id p1, | ||
324 | GNUNET_PEER_Id p2, | ||
325 | MeshNodeDisconnectCB cb); | ||
326 | |||
327 | |||
328 | /** | ||
301 | * Print the tree on stderr | 329 | * Print the tree on stderr |
302 | * | 330 | * |
303 | * @param t The tree | 331 | * @param t The tree |