aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/mesh_tunnel_tree.h
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-05-07 12:06:50 +0000
committerBart Polot <bart@net.in.tum.de>2014-05-07 12:06:50 +0000
commitbe4c79e4cd4a8f118c5577874f0c95e253359595 (patch)
tree7fd74fb0cf6921c4e35a43f2593396bb4805f154 /src/mesh/mesh_tunnel_tree.h
parent15ccd7a167bcce0dde4331092975a6401393610f (diff)
downloadgnunet-be4c79e4cd4a8f118c5577874f0c95e253359595.tar.gz
gnunet-be4c79e4cd4a8f118c5577874f0c95e253359595.zip
Rename mesh->cadet
Diffstat (limited to 'src/mesh/mesh_tunnel_tree.h')
-rw-r--r--src/mesh/mesh_tunnel_tree.h88
1 files changed, 44 insertions, 44 deletions
diff --git a/src/mesh/mesh_tunnel_tree.h b/src/mesh/mesh_tunnel_tree.h
index e5d65921d..779d330e7 100644
--- a/src/mesh/mesh_tunnel_tree.h
+++ b/src/mesh/mesh_tunnel_tree.h
@@ -19,12 +19,12 @@
19*/ 19*/
20 20
21/** 21/**
22 * @file mesh/mesh_tunnel_tree.h 22 * @file cadet/cadet_tunnel_tree.h
23 * @brief Tunnel tree handling functions 23 * @brief Tunnel tree handling functions
24 * @author Bartlomiej Polot 24 * @author Bartlomiej Polot
25 */ 25 */
26 26
27#include "mesh.h" 27#include "cadet.h"
28 28
29/******************************************************************************/ 29/******************************************************************************/
30/************************ DATA STRUCTURES ****************************/ 30/************************ DATA STRUCTURES ****************************/
@@ -33,14 +33,14 @@
33/** 33/**
34 * Information regarding a possible path to reach a single peer 34 * Information regarding a possible path to reach a single peer
35 */ 35 */
36struct MeshPeerPath 36struct CadetPeerPath
37{ 37{
38 38
39 /** 39 /**
40 * Linked list 40 * Linked list
41 */ 41 */
42 struct MeshPeerPath *next; 42 struct CadetPeerPath *next;
43 struct MeshPeerPath *prev; 43 struct CadetPeerPath *prev;
44 44
45 /** 45 /**
46 * List of all the peers that form the path from origin to target. 46 * List of all the peers that form the path from origin to target.
@@ -58,13 +58,13 @@ struct MeshPeerPath
58/** 58/**
59 * Node of path tree for a tunnel 59 * Node of path tree for a tunnel
60 */ 60 */
61struct MeshTunnelTreeNode; 61struct CadetTunnelTreeNode;
62 62
63 63
64/** 64/**
65 * Tree to reach all peers in the tunnel 65 * Tree to reach all peers in the tunnel
66 */ 66 */
67struct MeshTunnelTree; 67struct CadetTunnelTree;
68 68
69 69
70/******************************************************************************/ 70/******************************************************************************/
@@ -78,7 +78,7 @@ struct MeshTunnelTree;
78 * 78 *
79 * @return A newly allocated path with a peer array of the specified length. 79 * @return A newly allocated path with a peer array of the specified length.
80 */ 80 */
81struct MeshPeerPath * 81struct CadetPeerPath *
82path_new (unsigned int length); 82path_new (unsigned int length);
83 83
84 84
@@ -88,7 +88,7 @@ path_new (unsigned int length);
88 * @param path The path to invert. 88 * @param path The path to invert.
89 */ 89 */
90void 90void
91path_invert (struct MeshPeerPath *path); 91path_invert (struct CadetPeerPath *path);
92 92
93 93
94/** 94/**
@@ -96,8 +96,8 @@ path_invert (struct MeshPeerPath *path);
96 * 96 *
97 * @param path The path to duplicate. 97 * @param path The path to duplicate.
98 */ 98 */
99struct MeshPeerPath * 99struct CadetPeerPath *
100path_duplicate (struct MeshPeerPath *path); 100path_duplicate (struct CadetPeerPath *path);
101 101
102 102
103/** 103/**
@@ -109,7 +109,7 @@ path_duplicate (struct MeshPeerPath *path);
109 * UINT_MAX in case the peer is not in the path. 109 * UINT_MAX in case the peer is not in the path.
110 */ 110 */
111unsigned int 111unsigned int
112path_get_length (struct MeshPeerPath *path); 112path_get_length (struct CadetPeerPath *path);
113 113
114 114
115/** 115/**
@@ -120,7 +120,7 @@ path_get_length (struct MeshPeerPath *path);
120 * @return GNUNET_OK on success 120 * @return GNUNET_OK on success
121 */ 121 */
122int 122int
123path_destroy (struct MeshPeerPath *p); 123path_destroy (struct CadetPeerPath *p);
124 124
125 125
126/******************************************************************************/ 126/******************************************************************************/
@@ -131,7 +131,7 @@ path_destroy (struct MeshPeerPath *p);
131 * @param cls Closure. 131 * @param cls Closure.
132 * @param peer_id Short ID of the peer. 132 * @param peer_id Short ID of the peer.
133 */ 133 */
134typedef void (*MeshTreeCallback) (void *cls, GNUNET_PEER_Id peer_id); 134typedef void (*CadetTreeCallback) (void *cls, GNUNET_PEER_Id peer_id);
135 135
136 136
137/** 137/**
@@ -141,7 +141,7 @@ typedef void (*MeshTreeCallback) (void *cls, GNUNET_PEER_Id peer_id);
141 * @param peer_id Short ID of the peer. 141 * @param peer_id Short ID of the peer.
142 * @param peer_id Short ID of the parent of the peer. 142 * @param peer_id Short ID of the parent of the peer.
143 */ 143 */
144typedef void (*MeshWholeTreeCallback) (void *cls, 144typedef void (*CadetWholeTreeCallback) (void *cls,
145 GNUNET_PEER_Id peer_id, 145 GNUNET_PEER_Id peer_id,
146 GNUNET_PEER_Id parent_id); 146 GNUNET_PEER_Id parent_id);
147 147
@@ -152,7 +152,7 @@ typedef void (*MeshWholeTreeCallback) (void *cls,
152 * 152 *
153 * @return A newly allocated and initialized tunnel tree 153 * @return A newly allocated and initialized tunnel tree
154 */ 154 */
155struct MeshTunnelTree * 155struct CadetTunnelTree *
156tree_new (GNUNET_PEER_Id peer); 156tree_new (GNUNET_PEER_Id peer);
157 157
158 158
@@ -164,8 +164,8 @@ tree_new (GNUNET_PEER_Id peer);
164 * @param status New status to set. 164 * @param status New status to set.
165 */ 165 */
166void 166void
167tree_set_status (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer, 167tree_set_status (struct CadetTunnelTree *tree, GNUNET_PEER_Id peer,
168 enum MeshPeerState status); 168 enum CadetPeerState status);
169 169
170 170
171/** 171/**
@@ -176,8 +176,8 @@ tree_set_status (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer,
176 * 176 *
177 * @return Short peer id of local peer. 177 * @return Short peer id of local peer.
178 */ 178 */
179enum MeshPeerState 179enum CadetPeerState
180tree_get_status (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer); 180tree_get_status (struct CadetTunnelTree *tree, GNUNET_PEER_Id peer);
181 181
182 182
183/** 183/**
@@ -188,7 +188,7 @@ tree_get_status (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer);
188 * @return Short peer id of local peer. 188 * @return Short peer id of local peer.
189 */ 189 */
190GNUNET_PEER_Id 190GNUNET_PEER_Id
191tree_get_predecessor (struct MeshTunnelTree *tree); 191tree_get_predecessor (struct CadetTunnelTree *tree);
192 192
193 193
194/** 194/**
@@ -201,7 +201,7 @@ tree_get_predecessor (struct MeshTunnelTree *tree);
201 * NULL on error 201 * NULL on error
202 */ 202 */
203struct GNUNET_PeerIdentity * 203struct GNUNET_PeerIdentity *
204tree_get_first_hop (struct MeshTunnelTree *t, GNUNET_PEER_Id peer); 204tree_get_first_hop (struct CadetTunnelTree *t, GNUNET_PEER_Id peer);
205 205
206 206
207/** 207/**
@@ -212,8 +212,8 @@ tree_get_first_hop (struct MeshTunnelTree *t, GNUNET_PEER_Id peer);
212 * 212 *
213 * @return Pointer to the node of the peer. NULL if not found. 213 * @return Pointer to the node of the peer. NULL if not found.
214 */ 214 */
215struct MeshTunnelTreeNode * 215struct CadetTunnelTreeNode *
216tree_find_peer (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer_id); 216tree_find_peer (struct CadetTunnelTree *tree, GNUNET_PEER_Id peer_id);
217 217
218 218
219/** 219/**
@@ -224,8 +224,8 @@ tree_find_peer (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer_id);
224 * @param cb_cls Closure for @c cb. 224 * @param cb_cls Closure for @c cb.
225 */ 225 */
226void 226void
227tree_iterate_children (struct MeshTunnelTree *tree, 227tree_iterate_children (struct CadetTunnelTree *tree,
228 MeshTreeCallback cb, 228 CadetTreeCallback cb,
229 void *cb_cls); 229 void *cb_cls);
230 230
231 231
@@ -239,8 +239,8 @@ tree_iterate_children (struct MeshTunnelTree *tree,
239 * TODO: recursive implementation? (s/heap/stack/g) 239 * TODO: recursive implementation? (s/heap/stack/g)
240 */ 240 */
241void 241void
242tree_iterate_all (struct MeshTunnelTree *tree, 242tree_iterate_all (struct CadetTunnelTree *tree,
243 MeshWholeTreeCallback cb, 243 CadetWholeTreeCallback cb,
244 void *cb_cls); 244 void *cb_cls);
245 245
246/** 246/**
@@ -249,7 +249,7 @@ tree_iterate_all (struct MeshTunnelTree *tree,
249 * @param tree Tree to use. Must have "me" set. 249 * @param tree Tree to use. Must have "me" set.
250 */ 250 */
251unsigned int 251unsigned int
252tree_count_children (struct MeshTunnelTree *tree); 252tree_count_children (struct CadetTunnelTree *tree);
253 253
254 254
255/** 255/**
@@ -261,7 +261,7 @@ tree_count_children (struct MeshTunnelTree *tree);
261 * If not known, NULL to find out and pass on children. 261 * If not known, NULL to find out and pass on children.
262 */ 262 */
263void 263void
264tree_update_first_hops (struct MeshTunnelTree *tree, GNUNET_PEER_Id parent_id, 264tree_update_first_hops (struct CadetTunnelTree *tree, GNUNET_PEER_Id parent_id,
265 struct GNUNET_PeerIdentity *hop); 265 struct GNUNET_PeerIdentity *hop);
266 266
267/** 267/**
@@ -278,9 +278,9 @@ tree_update_first_hops (struct MeshTunnelTree *tree, GNUNET_PEER_Id parent_id,
278 * @return pointer to the pathless node. 278 * @return pointer to the pathless node.
279 * NULL when not found 279 * NULL when not found
280 */ 280 */
281struct MeshTunnelTreeNode * 281struct CadetTunnelTreeNode *
282tree_del_path (struct MeshTunnelTree *t, GNUNET_PEER_Id peer_id, 282tree_del_path (struct CadetTunnelTree *t, GNUNET_PEER_Id peer_id,
283 MeshTreeCallback cb, void *cbcls); 283 CadetTreeCallback cb, void *cbcls);
284 284
285 285
286/** 286/**
@@ -293,8 +293,8 @@ tree_del_path (struct MeshTunnelTree *t, GNUNET_PEER_Id peer_id,
293 * @return A newly allocated individual path to reach the destination peer. 293 * @return A newly allocated individual path to reach the destination peer.
294 * Path must be destroyed afterwards. 294 * Path must be destroyed afterwards.
295 */ 295 */
296struct MeshPeerPath * 296struct CadetPeerPath *
297tree_get_path_to_peer (struct MeshTunnelTree *t, GNUNET_PEER_Id peer); 297tree_get_path_to_peer (struct CadetTunnelTree *t, GNUNET_PEER_Id peer);
298 298
299 299
300/** 300/**
@@ -309,8 +309,8 @@ tree_get_path_to_peer (struct MeshTunnelTree *t, GNUNET_PEER_Id peer);
309 * GNUNET_SYSERR in case of error. 309 * GNUNET_SYSERR in case of error.
310 */ 310 */
311int 311int
312tree_add_path (struct MeshTunnelTree *t, const struct MeshPeerPath *p, 312tree_add_path (struct CadetTunnelTree *t, const struct CadetPeerPath *p,
313 MeshTreeCallback cb, void *cbcls); 313 CadetTreeCallback cb, void *cbcls);
314 314
315 315
316/** 316/**
@@ -326,8 +326,8 @@ tree_add_path (struct MeshTunnelTree *t, const struct MeshPeerPath *p,
326 * @return Short ID of the first disconnected peer in the tree. 326 * @return Short ID of the first disconnected peer in the tree.
327 */ 327 */
328GNUNET_PEER_Id 328GNUNET_PEER_Id
329tree_notify_connection_broken (struct MeshTunnelTree *t, GNUNET_PEER_Id p1, 329tree_notify_connection_broken (struct CadetTunnelTree *t, GNUNET_PEER_Id p1,
330 GNUNET_PEER_Id p2, MeshTreeCallback cb, 330 GNUNET_PEER_Id p2, CadetTreeCallback cb,
331 void *cbcls); 331 void *cbcls);
332 332
333 333
@@ -347,8 +347,8 @@ tree_notify_connection_broken (struct MeshTunnelTree *t, GNUNET_PEER_Id p1,
347 * @return GNUNET_YES if the tunnel still has nodes 347 * @return GNUNET_YES if the tunnel still has nodes
348 */ 348 */
349int 349int
350tree_del_peer (struct MeshTunnelTree *t, GNUNET_PEER_Id peer, 350tree_del_peer (struct CadetTunnelTree *t, GNUNET_PEER_Id peer,
351 MeshTreeCallback cb, void *cbcls); 351 CadetTreeCallback cb, void *cbcls);
352 352
353 353
354/** 354/**
@@ -361,7 +361,7 @@ tree_del_peer (struct MeshTunnelTree *t, GNUNET_PEER_Id peer,
361 * in the path 361 * in the path
362 */ 362 */
363unsigned int 363unsigned int
364tree_get_path_cost (struct MeshTunnelTree *t, struct MeshPeerPath *path); 364tree_get_path_cost (struct CadetTunnelTree *t, struct CadetPeerPath *path);
365 365
366 366
367/** 367/**
@@ -370,7 +370,7 @@ tree_get_path_cost (struct MeshTunnelTree *t, struct MeshPeerPath *path);
370 * @param t The tree 370 * @param t The tree
371 */ 371 */
372void 372void
373tree_debug (struct MeshTunnelTree *t); 373tree_debug (struct CadetTunnelTree *t);
374 374
375 375
376/** 376/**
@@ -379,4 +379,4 @@ tree_debug (struct MeshTunnelTree *t);
379 * @param t Tree to be destroyed 379 * @param t Tree to be destroyed
380 */ 380 */
381void 381void
382tree_destroy (struct MeshTunnelTree *t); 382tree_destroy (struct CadetTunnelTree *t);