diff options
Diffstat (limited to 'src/mesh/mesh_tunnel_tree.h')
-rw-r--r-- | src/mesh/mesh_tunnel_tree.h | 49 |
1 files changed, 17 insertions, 32 deletions
diff --git a/src/mesh/mesh_tunnel_tree.h b/src/mesh/mesh_tunnel_tree.h index e946259da..094a617cb 100644 --- a/src/mesh/mesh_tunnel_tree.h +++ b/src/mesh/mesh_tunnel_tree.h | |||
@@ -110,8 +110,7 @@ path_duplicate (struct MeshPeerPath *path); | |||
110 | * NULL on error | 110 | * NULL on error |
111 | */ | 111 | */ |
112 | struct GNUNET_PeerIdentity * | 112 | struct GNUNET_PeerIdentity * |
113 | path_get_first_hop (struct MeshTunnelTree *t, | 113 | path_get_first_hop (struct MeshTunnelTree *t, GNUNET_PEER_Id peer); |
114 | GNUNET_PEER_Id peer); | ||
115 | 114 | ||
116 | 115 | ||
117 | /** | 116 | /** |
@@ -136,8 +135,7 @@ path_get_length (struct MeshPeerPath *p); | |||
136 | * in the path | 135 | * in the path |
137 | */ | 136 | */ |
138 | unsigned int | 137 | unsigned int |
139 | path_get_cost (struct MeshTunnelTree *t, | 138 | path_get_cost (struct MeshTunnelTree *t, struct MeshPeerPath *path); |
140 | struct MeshPeerPath *path); | ||
141 | 139 | ||
142 | 140 | ||
143 | /** | 141 | /** |
@@ -159,8 +157,7 @@ path_destroy (struct MeshPeerPath *p); | |||
159 | * @param cls Closure. | 157 | * @param cls Closure. |
160 | * @param peer_id short ID of peer that is no longer reachable. | 158 | * @param peer_id short ID of peer that is no longer reachable. |
161 | */ | 159 | */ |
162 | typedef void (*MeshTreeCallback) (void *cls, | 160 | typedef void (*MeshTreeCallback) (void *cls, GNUNET_PEER_Id peer_id); |
163 | GNUNET_PEER_Id peer_id); | ||
164 | 161 | ||
165 | 162 | ||
166 | /** | 163 | /** |
@@ -202,8 +199,7 @@ tree_get_me (struct MeshTunnelTree *tree); | |||
202 | * @param peer A short peer id of local peer. | 199 | * @param peer A short peer id of local peer. |
203 | */ | 200 | */ |
204 | void | 201 | void |
205 | tree_set_status (struct MeshTunnelTree *tree, | 202 | tree_set_status (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer, |
206 | GNUNET_PEER_Id peer, | ||
207 | enum MeshPeerState status); | 203 | enum MeshPeerState status); |
208 | 204 | ||
209 | 205 | ||
@@ -243,14 +239,13 @@ tree_find_peer (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer_id); | |||
243 | 239 | ||
244 | /** | 240 | /** |
245 | * Iterate over all children of the local node. | 241 | * Iterate over all children of the local node. |
246 | * | 242 | * |
247 | * @param tree Tree to use. Must have "me" set. | 243 | * @param tree Tree to use. Must have "me" set. |
248 | * @param cb Callback to call over each child. | 244 | * @param cb Callback to call over each child. |
249 | * @param cls Closure. | 245 | * @param cls Closure. |
250 | */ | 246 | */ |
251 | void | 247 | void |
252 | tree_iterate_children (struct MeshTunnelTree *tree, | 248 | tree_iterate_children (struct MeshTunnelTree *tree, MeshTreeCallback cb, |
253 | MeshTreeCallback cb, | ||
254 | void *cls); | 249 | void *cls); |
255 | 250 | ||
256 | 251 | ||
@@ -263,8 +258,7 @@ tree_iterate_children (struct MeshTunnelTree *tree, | |||
263 | * If not known, NULL to find out and pass on children. | 258 | * If not known, NULL to find out and pass on children. |
264 | */ | 259 | */ |
265 | void | 260 | void |
266 | tree_update_first_hops (struct MeshTunnelTree *tree, | 261 | tree_update_first_hops (struct MeshTunnelTree *tree, GNUNET_PEER_Id parent_id, |
267 | GNUNET_PEER_Id parent_id, | ||
268 | struct GNUNET_PeerIdentity *hop); | 262 | struct GNUNET_PeerIdentity *hop); |
269 | 263 | ||
270 | /** | 264 | /** |
@@ -282,10 +276,8 @@ tree_update_first_hops (struct MeshTunnelTree *tree, | |||
282 | * NULL when not found | 276 | * NULL when not found |
283 | */ | 277 | */ |
284 | struct MeshTunnelTreeNode * | 278 | struct MeshTunnelTreeNode * |
285 | tree_del_path (struct MeshTunnelTree *t, | 279 | tree_del_path (struct MeshTunnelTree *t, GNUNET_PEER_Id peer, |
286 | GNUNET_PEER_Id peer, | 280 | MeshTreeCallback cb, void *cbcls); |
287 | MeshTreeCallback cb, | ||
288 | void *cbcls); | ||
289 | 281 | ||
290 | 282 | ||
291 | /** | 283 | /** |
@@ -299,8 +291,7 @@ tree_del_path (struct MeshTunnelTree *t, | |||
299 | * Path must be destroyed afterwards. | 291 | * Path must be destroyed afterwards. |
300 | */ | 292 | */ |
301 | struct MeshPeerPath * | 293 | struct MeshPeerPath * |
302 | tree_get_path_to_peer(struct MeshTunnelTree *t, | 294 | tree_get_path_to_peer (struct MeshTunnelTree *t, GNUNET_PEER_Id peer); |
303 | GNUNET_PEER_Id peer); | ||
304 | 295 | ||
305 | 296 | ||
306 | /** | 297 | /** |
@@ -315,10 +306,8 @@ tree_get_path_to_peer(struct MeshTunnelTree *t, | |||
315 | * GNUNET_SYSERR in case of error. | 306 | * GNUNET_SYSERR in case of error. |
316 | */ | 307 | */ |
317 | int | 308 | int |
318 | tree_add_path (struct MeshTunnelTree *t, | 309 | tree_add_path (struct MeshTunnelTree *t, const struct MeshPeerPath *p, |
319 | const struct MeshPeerPath *p, | 310 | MeshTreeCallback cb, void *cbcls); |
320 | MeshTreeCallback cb, | ||
321 | void *cbcls); | ||
322 | 311 | ||
323 | 312 | ||
324 | /** | 313 | /** |
@@ -334,10 +323,8 @@ tree_add_path (struct MeshTunnelTree *t, | |||
334 | * @return Short ID of the first disconnected peer in the tree. | 323 | * @return Short ID of the first disconnected peer in the tree. |
335 | */ | 324 | */ |
336 | GNUNET_PEER_Id | 325 | GNUNET_PEER_Id |
337 | tree_notify_connection_broken (struct MeshTunnelTree *t, | 326 | tree_notify_connection_broken (struct MeshTunnelTree *t, GNUNET_PEER_Id p1, |
338 | GNUNET_PEER_Id p1, | 327 | GNUNET_PEER_Id p2, MeshTreeCallback cb, |
339 | GNUNET_PEER_Id p2, | ||
340 | MeshTreeCallback cb, | ||
341 | void *cbcls); | 328 | void *cbcls); |
342 | 329 | ||
343 | 330 | ||
@@ -355,10 +342,8 @@ tree_notify_connection_broken (struct MeshTunnelTree *t, | |||
355 | * @return GNUNET_YES if the tunnel still has nodes | 342 | * @return GNUNET_YES if the tunnel still has nodes |
356 | */ | 343 | */ |
357 | int | 344 | int |
358 | tree_del_peer (struct MeshTunnelTree *t, | 345 | tree_del_peer (struct MeshTunnelTree *t, GNUNET_PEER_Id peer, |
359 | GNUNET_PEER_Id peer, | 346 | MeshTreeCallback cb, void *cbcls); |
360 | MeshTreeCallback cb, | ||
361 | void *cbcls); | ||
362 | 347 | ||
363 | /** | 348 | /** |
364 | * Print the tree on stderr | 349 | * Print the tree on stderr |
@@ -366,7 +351,7 @@ tree_del_peer (struct MeshTunnelTree *t, | |||
366 | * @param t The tree | 351 | * @param t The tree |
367 | */ | 352 | */ |
368 | void | 353 | void |
369 | tree_debug(struct MeshTunnelTree *t); | 354 | tree_debug (struct MeshTunnelTree *t); |
370 | 355 | ||
371 | 356 | ||
372 | /** | 357 | /** |