aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/mesh_tunnel_tree.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesh/mesh_tunnel_tree.h')
-rw-r--r--src/mesh/mesh_tunnel_tree.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/mesh/mesh_tunnel_tree.h b/src/mesh/mesh_tunnel_tree.h
index 6573a85bd..a929f7a6d 100644
--- a/src/mesh/mesh_tunnel_tree.h
+++ b/src/mesh/mesh_tunnel_tree.h
@@ -76,14 +76,24 @@ struct MeshTunnelTreeNode
76 struct MeshTunnelTreeNode *parent; 76 struct MeshTunnelTreeNode *parent;
77 77
78 /** 78 /**
79 * Array of children 79 * DLL of siblings
80 */ 80 */
81 struct MeshTunnelTreeNode *children; 81 struct MeshTunnelTreeNode *next;
82 82
83 /** 83 /**
84 * Number of children 84 * DLL of siblings
85 */ 85 */
86 unsigned int nchildren; 86 struct MeshTunnelTreeNode *prev;
87
88 /**
89 * DLL of children
90 */
91 struct MeshTunnelTreeNode *children_head;
92
93 /**
94 * DLL of children
95 */
96 struct MeshTunnelTreeNode *children_tail;
87 97
88 /** 98 /**
89 * Status of the peer in the tunnel 99 * Status of the peer in the tunnel
@@ -257,6 +267,19 @@ tree_add_path (struct MeshTunnelTree *t, const struct MeshPeerPath *p,
257 267
258 268
259/** 269/**
270 * Allocates and initializes a new node.
271 * Sets ID and parent of the new node and inserts it in the DLL of the parent
272 *
273 * @param parent Node that will be the parent from the new node, NULL for root
274 * @param id Short Id of the new node
275 *
276 * @return Newly allocated node
277 */
278struct MeshTunnelTreeNode *
279tree_node_new(struct MeshTunnelTreeNode *parent, GNUNET_PEER_Id id);
280
281
282/**
260 * Destroy the node and all children 283 * Destroy the node and all children
261 * 284 *
262 * @param n Parent node to be destroyed 285 * @param n Parent node to be destroyed