aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2011-11-24 14:44:07 +0000
committerBart Polot <bart@net.in.tum.de>2011-11-24 14:44:07 +0000
commit4649d3d4a4190e27a42d571c7d7ee7e17792dc51 (patch)
treed3352c245933f4d1477890d90c59a4e2be01762e /src/mesh
parent13a6d7c63e51d5a98b05a308786b08dd59709afb (diff)
downloadgnunet-4649d3d4a4190e27a42d571c7d7ee7e17792dc51.tar.gz
gnunet-4649d3d4a4190e27a42d571c7d7ee7e17792dc51.zip
- Updated doxygen
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/gnunet-service-mesh.c11
-rw-r--r--src/mesh/mesh_api.c8
-rw-r--r--src/mesh/mesh_tunnel_tree.c44
-rw-r--r--src/mesh/mesh_tunnel_tree.h32
4 files changed, 55 insertions, 40 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c
index 79096447c..ff58bf824 100644
--- a/src/mesh/gnunet-service-mesh.c
+++ b/src/mesh/gnunet-service-mesh.c
@@ -769,6 +769,7 @@ tunnel_notify_connection_broken (struct MeshTunnel *t, GNUNET_PEER_Id p1,
769 * Send the message to all clients that have subscribed to its type 769 * Send the message to all clients that have subscribed to its type
770 * 770 *
771 * @param msg Pointer to the message itself 771 * @param msg Pointer to the message itself
772 * @param payload Pointer to the payload of the message.
772 * @return number of clients this message was sent to 773 * @return number of clients this message was sent to
773 */ 774 */
774static unsigned int 775static unsigned int
@@ -2178,7 +2179,7 @@ tunnel_destroy (struct MeshTunnel *t)
2178 * The tunnel itself is also destoyed if results in a remote empty tunnel. 2179 * The tunnel itself is also destoyed if results in a remote empty tunnel.
2179 * 2180 *
2180 * @param t Tunnel from which to remove the path. 2181 * @param t Tunnel from which to remove the path.
2181 * @param p Peer which should be removed. 2182 * @param peer Short id of the peer which should be removed.
2182 */ 2183 */
2183static void 2184static void
2184tunnel_delete_peer (struct MeshTunnel *t, GNUNET_PEER_Id peer) 2185tunnel_delete_peer (struct MeshTunnel *t, GNUNET_PEER_Id peer)
@@ -3260,6 +3261,10 @@ path_refresh (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
3260 * @param cls closure 3261 * @param cls closure
3261 * @param exp when will this value expire 3262 * @param exp when will this value expire
3262 * @param key key of the result 3263 * @param key key of the result
3264 * @param get_path path of the get request
3265 * @param get_path_length lenght of get_path
3266 * @param put_path path of the put request
3267 * @param put_path_length length of the put_path
3263 * @param type type of the result 3268 * @param type type of the result
3264 * @param size number of bytes in data 3269 * @param size number of bytes in data
3265 * @param data pointer to the result data 3270 * @param data pointer to the result data
@@ -3305,6 +3310,10 @@ dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp,
3305 * @param cls closure 3310 * @param cls closure
3306 * @param exp when will this value expire 3311 * @param exp when will this value expire
3307 * @param key key of the result 3312 * @param key key of the result
3313 * @param get_path path of the get request
3314 * @param get_path_length lenght of get_path
3315 * @param put_path path of the put request
3316 * @param put_path_length length of the put_path
3308 * @param type type of the result 3317 * @param type type of the result
3309 * @param size number of bytes in data 3318 * @param size number of bytes in data
3310 * @param data pointer to the result data 3319 * @param data pointer to the result data
diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c
index fe6f0916e..101510d40 100644
--- a/src/mesh/mesh_api.c
+++ b/src/mesh/mesh_api.c
@@ -368,8 +368,10 @@ create_tunnel (struct GNUNET_MESH_Handle *h, MESH_TunnelNumber tid)
368 * - Cancels all outgoing traffic for that tunnel, calling respective notifys 368 * - Cancels all outgoing traffic for that tunnel, calling respective notifys
369 * - Calls cleaner if tunnel was inbound 369 * - Calls cleaner if tunnel was inbound
370 * - Frees all memory used 370 * - Frees all memory used
371 * @param tid ID of the wanted tunnel 371 *
372 * @return handle to the required tunnel or NULL if not found 372 * @param t Pointer to the tunnel.
373 *
374 * @return Handle to the required tunnel or NULL if not found.
373 */ 375 */
374static void 376static void
375destroy_tunnel (struct GNUNET_MESH_Tunnel *t) 377destroy_tunnel (struct GNUNET_MESH_Tunnel *t)
@@ -1304,7 +1306,7 @@ GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h, void *tunnel_ctx,
1304/** 1306/**
1305 * Destroy an existing tunnel. 1307 * Destroy an existing tunnel.
1306 * 1308 *
1307 * @param tun tunnel handle 1309 * @param tunnel tunnel handle
1308 */ 1310 */
1309void 1311void
1310GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tunnel) 1312GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tunnel)
diff --git a/src/mesh/mesh_tunnel_tree.c b/src/mesh/mesh_tunnel_tree.c
index ee12e82c8..a51d0ed2f 100644
--- a/src/mesh/mesh_tunnel_tree.c
+++ b/src/mesh/mesh_tunnel_tree.c
@@ -110,7 +110,7 @@ struct MeshTunnelTree
110/** 110/**
111 * Create a new path 111 * Create a new path
112 * 112 *
113 * @param lenght How many hops will the path have. 113 * @param length How many hops will the path have.
114 * 114 *
115 * @return A newly allocated path with a peer array of the specified length. 115 * @return A newly allocated path with a peer array of the specified length.
116 */ 116 */
@@ -132,7 +132,7 @@ path_new (unsigned int length)
132/** 132/**
133 * Invert the path 133 * Invert the path
134 * 134 *
135 * @param p the path to invert 135 * @param path the path to invert
136 */ 136 */
137void 137void
138path_invert (struct MeshPeerPath *path) 138path_invert (struct MeshPeerPath *path)
@@ -152,7 +152,7 @@ path_invert (struct MeshPeerPath *path)
152/** 152/**
153 * Duplicate a path, incrementing short peer's rc. 153 * Duplicate a path, incrementing short peer's rc.
154 * 154 *
155 * @param p The path to duplicate. 155 * @param path The path to duplicate.
156 */ 156 */
157struct MeshPeerPath * 157struct MeshPeerPath *
158path_duplicate (struct MeshPeerPath *path) 158path_duplicate (struct MeshPeerPath *path)
@@ -172,7 +172,7 @@ path_duplicate (struct MeshPeerPath *path)
172 * Recusively update the info about what is the first hop to reach the node 172 * Recusively update the info about what is the first hop to reach the node
173 * 173 *
174 * @param tree Tree this nodes belongs to. 174 * @param tree Tree this nodes belongs to.
175 * @param parent_id Short ID from node form which to start updating. 175 * @param parent The node form which to start updating.
176 * @param hop If known, ID of the first hop. 176 * @param hop If known, ID of the first hop.
177 * If not known, NULL to find out and pass on children. 177 * If not known, NULL to find out and pass on children.
178 */ 178 */
@@ -183,12 +183,12 @@ tree_node_update_first_hops (struct MeshTunnelTree *tree,
183 183
184 184
185/** 185/**
186 * Get the length of a path 186 * Get the length of a path.
187 * 187 *
188 * @param path The path to measure, with the local peer at any point of it 188 * @param path The path to measure, with the local peer at any point of it.
189 * 189 *
190 * @return Number of hops to reach destination 190 * @return Number of hops to reach destination.
191 * UINT_MAX in case the peer is not in the path 191 * UINT_MAX in case the peer is not in the path.
192 */ 192 */
193unsigned int 193unsigned int
194path_get_length (struct MeshPeerPath *path) 194path_get_length (struct MeshPeerPath *path)
@@ -249,7 +249,7 @@ tree_node_new (struct MeshTunnelTreeNode *parent, GNUNET_PEER_Id peer)
249 * Recursively find the given peer. 249 * Recursively find the given peer.
250 * 250 *
251 * @param parent Node where to start looking. 251 * @param parent Node where to start looking.
252 * @param peer Peer to find. 252 * @param peer_id Short ID of the peer to find.
253 * 253 *
254 * @return Pointer to the node of the peer. NULL if not found. 254 * @return Pointer to the node of the peer. NULL if not found.
255 */ 255 */
@@ -371,7 +371,7 @@ tree_node_debug (struct MeshTunnelTreeNode *n, uint16_t level)
371/** 371/**
372 * Destroys and frees the node and all children 372 * Destroys and frees the node and all children
373 * 373 *
374 * @param n Parent node to be destroyed 374 * @param parent Parent node to be destroyed
375 */ 375 */
376static void 376static void
377tree_node_destroy (struct MeshTunnelTreeNode *parent) 377tree_node_destroy (struct MeshTunnelTreeNode *parent)
@@ -404,12 +404,11 @@ tree_node_destroy (struct MeshTunnelTreeNode *parent)
404 404
405 405
406/** 406/**
407 * Create a new tunnel tree associated to a tunnel 407 * Create a new tree.
408 * 408 *
409 * @param t Tunnel this tree will represent 409 * @param peer A short peer id of the root of the tree.
410 * @param peer A short peer id of the root of the tree
411 * 410 *
412 * @return A newly allocated and initialized tunnel tree 411 * @return A newly allocated and initialized tunnel tree.
413 */ 412 */
414struct MeshTunnelTree * 413struct MeshTunnelTree *
415tree_new (GNUNET_PEER_Id peer) 414tree_new (GNUNET_PEER_Id peer)
@@ -434,7 +433,8 @@ tree_new (GNUNET_PEER_Id peer)
434 * Set the status of a node. 433 * Set the status of a node.
435 * 434 *
436 * @param tree Tree. 435 * @param tree Tree.
437 * @param peer A short peer id of local peer. 436 * @param peer A short peer id of the node.
437 * @param status New status to set.
438 */ 438 */
439void 439void
440tree_set_status (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer, 440tree_set_status (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer,
@@ -452,9 +452,10 @@ tree_set_status (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer,
452/** 452/**
453 * Get the status of a node. 453 * Get the status of a node.
454 * 454 *
455 * @param tree Tree whose local id we want to now. 455 * @param tree Tree whose node's status we want to now.
456 * @param peer A short peer id of the node.
456 * 457 *
457 * @return Short peer id of local peer. 458 * @return Status of the peer.
458 */ 459 */
459enum MeshPeerState 460enum MeshPeerState
460tree_get_status (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer) 461tree_get_status (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer)
@@ -529,7 +530,7 @@ tree_get_first_hop (struct MeshTunnelTree *t, GNUNET_PEER_Id peer)
529 * Find the given peer in the tree. 530 * Find the given peer in the tree.
530 * 531 *
531 * @param tree Tree where to look for the peer. 532 * @param tree Tree where to look for the peer.
532 * @param peer Peer to find. 533 * @param peer_id Short ID of the peer to find.
533 * 534 *
534 * @return Pointer to the node of the peer. NULL if not found. 535 * @return Pointer to the node of the peer. NULL if not found.
535 */ 536 */
@@ -546,6 +547,7 @@ tree_find_peer (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer_id)
546 * @param tree Tree this node belongs to 547 * @param tree Tree this node belongs to
547 * @param parent Node to be clean, potentially with children 548 * @param parent Node to be clean, potentially with children
548 * @param cb Callback to use to notify about disconnected peers. 549 * @param cb Callback to use to notify about disconnected peers.
550 * @param cbcls Closure for cb.
549 */ 551 */
550static void 552static void
551tree_mark_peers_disconnected (struct MeshTunnelTree *tree, 553tree_mark_peers_disconnected (struct MeshTunnelTree *tree,
@@ -623,7 +625,7 @@ tree_update_first_hops (struct MeshTunnelTree *tree, GNUNET_PEER_Id parent_id,
623 * a new path to it or destroy it explicitly, taking care of it's child nodes. 625 * a new path to it or destroy it explicitly, taking care of it's child nodes.
624 * 626 *
625 * @param t Tunnel tree where to delete the path from. 627 * @param t Tunnel tree where to delete the path from.
626 * @param peer Destination peer whose path we want to remove. 628 * @param peer_id Short ID of the destination peer whose path we want to remove.
627 * @param cb Callback to use to notify about disconnected peers. 629 * @param cb Callback to use to notify about disconnected peers.
628 * @param cbcls Closure for cb. 630 * @param cbcls Closure for cb.
629 * 631 *
@@ -694,8 +696,8 @@ tree_del_path (struct MeshTunnelTree *t, GNUNET_PEER_Id peer_id,
694 * Return a newly allocated individual path to reach a peer from the local peer, 696 * Return a newly allocated individual path to reach a peer from the local peer,
695 * according to the path tree of some tunnel. 697 * according to the path tree of some tunnel.
696 * 698 *
697 * @param t Tunnel from which to read the path tree 699 * @param t Tunnel from which to read the path tree.
698 * @param peer_info Destination peer to whom we want a path 700 * @param peer Short ID of the destination peer to whom we want a path.
699 * 701 *
700 * @return A newly allocated individual path to reach the destination peer. 702 * @return A newly allocated individual path to reach the destination peer.
701 * Path must be destroyed afterwards. 703 * Path must be destroyed afterwards.
diff --git a/src/mesh/mesh_tunnel_tree.h b/src/mesh/mesh_tunnel_tree.h
index dd31661ac..615a5a8d0 100644
--- a/src/mesh/mesh_tunnel_tree.h
+++ b/src/mesh/mesh_tunnel_tree.h
@@ -19,7 +19,7 @@
19*/ 19*/
20 20
21/** 21/**
22 * @file mesh/mesh_tree_tree.h 22 * @file mesh/mesh_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 */
@@ -72,9 +72,9 @@ struct MeshTunnelTree;
72/******************************************************************************/ 72/******************************************************************************/
73 73
74/** 74/**
75 * Create a new path 75 * Create a new path.
76 * 76 *
77 * @param lenght How many hops will the path have. 77 * @param length How many hops will the path have.
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 */
@@ -83,33 +83,33 @@ path_new (unsigned int length);
83 83
84 84
85/** 85/**
86 * Invert the path 86 * Invert the path.
87 * 87 *
88 * @param p the path to invert 88 * @param path The path to invert.
89 */ 89 */
90void 90void
91path_invert (struct MeshPeerPath *p); 91path_invert (struct MeshPeerPath *path);
92 92
93 93
94/** 94/**
95 * Duplicate a path, incrementing short peer's rc. 95 * Duplicate a path, incrementing short peer's rc.
96 * 96 *
97 * @param p The path to duplicate. 97 * @param path The path to duplicate.
98 */ 98 */
99struct MeshPeerPath * 99struct MeshPeerPath *
100path_duplicate (struct MeshPeerPath *path); 100path_duplicate (struct MeshPeerPath *path);
101 101
102 102
103/** 103/**
104 * Get the length of a path 104 * Get the length of a path.
105 * 105 *
106 * @param p The path to measure, with the local peer at any point of it 106 * @param path The path to measure, with the local peer at any point of it.
107 * 107 *
108 * @return Number of hops to reach destination 108 * @return Number of hops to reach destination.
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 *p); 112path_get_length (struct MeshPeerPath *path);
113 113
114 114
115/** 115/**
@@ -149,7 +149,8 @@ tree_new (GNUNET_PEER_Id peer);
149 * Set the status of a node. 149 * Set the status of a node.
150 * 150 *
151 * @param tree Tree. 151 * @param tree Tree.
152 * @param peer A short peer id of local peer. 152 * @param peer A short peer id of the node.
153 * @param status New status to set.
153 */ 154 */
154void 155void
155tree_set_status (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer, 156tree_set_status (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer,
@@ -160,6 +161,7 @@ tree_set_status (struct MeshTunnelTree *tree, GNUNET_PEER_Id peer,
160 * Get the status of a node. 161 * Get the status of a node.
161 * 162 *
162 * @param tree Tree whose local id we want to now. 163 * @param tree Tree whose local id we want to now.
164 * @param peer A short peer id of the node.
163 * 165 *
164 * @return Short peer id of local peer. 166 * @return Short peer id of local peer.
165 */ 167 */
@@ -233,7 +235,7 @@ tree_update_first_hops (struct MeshTunnelTree *tree, GNUNET_PEER_Id parent_id,
233 * a new path to it or destroy it explicitly, taking care of it's child nodes. 235 * a new path to it or destroy it explicitly, taking care of it's child nodes.
234 * 236 *
235 * @param t Tunnel tree where to delete the path from. 237 * @param t Tunnel tree where to delete the path from.
236 * @param peer Destination peer whose path we want to remove. 238 * @param peer_id Short ID of the destination peer whose path we want to remove.
237 * @param cb Callback to use to notify about which peers are going to be 239 * @param cb Callback to use to notify about which peers are going to be
238 * disconnected. 240 * disconnected.
239 * @param cbcls Closure for cb. 241 * @param cbcls Closure for cb.
@@ -242,7 +244,7 @@ tree_update_first_hops (struct MeshTunnelTree *tree, GNUNET_PEER_Id parent_id,
242 * NULL when not found 244 * NULL when not found
243 */ 245 */
244struct MeshTunnelTreeNode * 246struct MeshTunnelTreeNode *
245tree_del_path (struct MeshTunnelTree *t, GNUNET_PEER_Id peer, 247tree_del_path (struct MeshTunnelTree *t, GNUNET_PEER_Id peer_id,
246 MeshTreeCallback cb, void *cbcls); 248 MeshTreeCallback cb, void *cbcls);
247 249
248 250