aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-service-mesh_tunnel.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-01-30 02:11:20 +0000
committerBart Polot <bart@net.in.tum.de>2014-01-30 02:11:20 +0000
commitff21154a0805872ee6dbedb82d2fd64e1a7ed1ac (patch)
tree5370668a8eda5dcc92abbcaa39a2bbbe8de348e3 /src/mesh/gnunet-service-mesh_tunnel.c
parent100eeaebcba97bcea73ff4a29e4a55d068a46e15 (diff)
downloadgnunet-ff21154a0805872ee6dbedb82d2fd64e1a7ed1ac.tar.gz
gnunet-ff21154a0805872ee6dbedb82d2fd64e1a7ed1ac.zip
- document tunnel internal API
- change iterator parameter order
Diffstat (limited to 'src/mesh/gnunet-service-mesh_tunnel.c')
-rw-r--r--src/mesh/gnunet-service-mesh_tunnel.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c
index 30d3408e9..e5ca08828 100644
--- a/src/mesh/gnunet-service-mesh_tunnel.c
+++ b/src/mesh/gnunet-service-mesh_tunnel.c
@@ -2631,7 +2631,7 @@ GMT_2s (const struct MeshTunnel3 *t)
2631 2631
2632 2632
2633/** 2633/**
2634 * Log all possible info about the tunnel state. 2634 * Log all possible info about the tunnel state to stderr.
2635 * 2635 *
2636 * @param t Tunnel to debug. 2636 * @param t Tunnel to debug.
2637 */ 2637 */
@@ -2671,18 +2671,38 @@ GMT_debug (const struct MeshTunnel3 *t)
2671} 2671}
2672 2672
2673 2673
2674/**
2675 * Iterate all tunnels.
2676 *
2677 * @param iter Iterator.
2678 * @param cls Closure for @c iter.
2679 */
2674void 2680void
2675GMT_iterate_all (void *cls, GNUNET_CONTAINER_PeerMapIterator iter) 2681GMT_iterate_all (GNUNET_CONTAINER_PeerMapIterator iter, void *cls)
2676{ 2682{
2677 GNUNET_CONTAINER_multipeermap_iterate (tunnels, iter, cls); 2683 GNUNET_CONTAINER_multipeermap_iterate (tunnels, iter, cls);
2678} 2684}
2679 2685
2686
2687/**
2688 * Count all tunnels.
2689 *
2690 * @return Number of tunnels to remote peers kept by this peer.
2691 */
2680unsigned int 2692unsigned int
2681GMT_count_all (void) 2693GMT_count_all (void)
2682{ 2694{
2683 return GNUNET_CONTAINER_multipeermap_size (tunnels); 2695 return GNUNET_CONTAINER_multipeermap_size (tunnels);
2684} 2696}
2685 2697
2698
2699/**
2700 * Iterate all connections of a tunnel.
2701 *
2702 * @param t Tunnel whose connections to iterate.
2703 * @param iter Iterator.
2704 * @param cls Closure for @c iter.
2705 */
2686void 2706void
2687GMT_iterate_connections (struct MeshTunnel3 *t, GMT_conn_iter iter, void *cls) 2707GMT_iterate_connections (struct MeshTunnel3 *t, GMT_conn_iter iter, void *cls)
2688{ 2708{
@@ -2692,6 +2712,14 @@ GMT_iterate_connections (struct MeshTunnel3 *t, GMT_conn_iter iter, void *cls)
2692 iter (cls, ct->c); 2712 iter (cls, ct->c);
2693} 2713}
2694 2714
2715
2716/**
2717 * Iterate all channels of a tunnel.
2718 *
2719 * @param t Tunnel whose channels to iterate.
2720 * @param iter Iterator.
2721 * @param cls Closure for @c iter.
2722 */
2695void 2723void
2696GMT_iterate_channels (struct MeshTunnel3 *t, GMT_chan_iter iter, void *cls) 2724GMT_iterate_channels (struct MeshTunnel3 *t, GMT_chan_iter iter, void *cls)
2697{ 2725{