aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-service-mesh_peer.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/gnunet-service-mesh_peer.h
parent15ccd7a167bcce0dde4331092975a6401393610f (diff)
downloadgnunet-be4c79e4cd4a8f118c5577874f0c95e253359595.tar.gz
gnunet-be4c79e4cd4a8f118c5577874f0c95e253359595.zip
Rename mesh->cadet
Diffstat (limited to 'src/mesh/gnunet-service-mesh_peer.h')
-rw-r--r--src/mesh/gnunet-service-mesh_peer.h94
1 files changed, 47 insertions, 47 deletions
diff --git a/src/mesh/gnunet-service-mesh_peer.h b/src/mesh/gnunet-service-mesh_peer.h
index 57f5212b0..9f1146e9f 100644
--- a/src/mesh/gnunet-service-mesh_peer.h
+++ b/src/mesh/gnunet-service-mesh_peer.h
@@ -19,15 +19,15 @@
19*/ 19*/
20 20
21/** 21/**
22 * @file mesh/gnunet-service-mesh_peer.h 22 * @file cadet/gnunet-service-cadet_peer.h
23 * @brief mesh service; dealing with remote peers 23 * @brief cadet service; dealing with remote peers
24 * @author Bartlomiej Polot 24 * @author Bartlomiej Polot
25 * 25 *
26 * All functions in this file should use the prefix GMP (Gnunet Mesh Peer) 26 * All functions in this file should use the prefix GMP (Gnunet Cadet Peer)
27 */ 27 */
28 28
29#ifndef GNUNET_SERVICE_MESH_PEER_H 29#ifndef GNUNET_SERVICE_CADET_PEER_H
30#define GNUNET_SERVICE_MESH_PEER_H 30#define GNUNET_SERVICE_CADET_PEER_H
31 31
32#ifdef __cplusplus 32#ifdef __cplusplus
33extern "C" 33extern "C"
@@ -43,14 +43,14 @@ extern "C"
43/** 43/**
44 * Struct containing all information regarding a given peer 44 * Struct containing all information regarding a given peer
45 */ 45 */
46struct MeshPeer; 46struct CadetPeer;
47 47
48/** 48/**
49 * Struct containing info about a queued transmission to this peer 49 * Struct containing info about a queued transmission to this peer
50 */ 50 */
51struct MeshPeerQueue; 51struct CadetPeerQueue;
52 52
53#include "gnunet-service-mesh_connection.h" 53#include "gnunet-service-cadet_connection.h"
54 54
55/** 55/**
56 * Callback called when a queued message is sent. 56 * Callback called when a queued message is sent.
@@ -65,7 +65,7 @@ struct MeshPeerQueue;
65 * @param wait Time spent waiting for core (only the time for THIS message) 65 * @param wait Time spent waiting for core (only the time for THIS message)
66 */ 66 */
67typedef void (*GMP_sent) (void *cls, 67typedef void (*GMP_sent) (void *cls,
68 struct MeshConnection *c, int sent, 68 struct CadetConnection *c, int sent,
69 uint16_t type, uint32_t pid, int fwd, size_t size, 69 uint16_t type, uint32_t pid, int fwd, size_t size,
70 struct GNUNET_TIME_Relative wait); 70 struct GNUNET_TIME_Relative wait);
71 71
@@ -89,26 +89,26 @@ GMP_shutdown (void);
89 89
90 90
91/** 91/**
92 * Retrieve the MeshPeer stucture associated with the peer, create one 92 * Retrieve the CadetPeer stucture associated with the peer, create one
93 * and insert it in the appropriate structures if the peer is not known yet. 93 * and insert it in the appropriate structures if the peer is not known yet.
94 * 94 *
95 * @param peer_id Full identity of the peer. 95 * @param peer_id Full identity of the peer.
96 * 96 *
97 * @return Existing or newly created peer structure. 97 * @return Existing or newly created peer structure.
98 */ 98 */
99struct MeshPeer * 99struct CadetPeer *
100GMP_get (const struct GNUNET_PeerIdentity *peer_id); 100GMP_get (const struct GNUNET_PeerIdentity *peer_id);
101 101
102 102
103/** 103/**
104 * Retrieve the MeshPeer stucture associated with the peer, create one 104 * Retrieve the CadetPeer stucture associated with the peer, create one
105 * and insert it in the appropriate structures if the peer is not known yet. 105 * and insert it in the appropriate structures if the peer is not known yet.
106 * 106 *
107 * @param peer Short identity of the peer. 107 * @param peer Short identity of the peer.
108 * 108 *
109 * @return Existing or newly created peer structure. 109 * @return Existing or newly created peer structure.
110 */ 110 */
111struct MeshPeer * 111struct CadetPeer *
112GMP_get_short (const GNUNET_PEER_Id peer); 112GMP_get_short (const GNUNET_PEER_Id peer);
113 113
114/** 114/**
@@ -119,7 +119,7 @@ GMP_get_short (const GNUNET_PEER_Id peer);
119 * @param peer Peer to connect to. 119 * @param peer Peer to connect to.
120 */ 120 */
121void 121void
122GMP_connect (struct MeshPeer *peer); 122GMP_connect (struct CadetPeer *peer);
123 123
124/** 124/**
125 * Free a transmission that was already queued with all resources 125 * Free a transmission that was already queued with all resources
@@ -131,7 +131,7 @@ GMP_connect (struct MeshPeer *peer);
131 * @param pid PID, if relevant (was sent and was a payload message). 131 * @param pid PID, if relevant (was sent and was a payload message).
132 */ 132 */
133void 133void
134GMP_queue_destroy (struct MeshPeerQueue *queue, int clear_cls, 134GMP_queue_destroy (struct CadetPeerQueue *queue, int clear_cls,
135 int sent, uint32_t pid); 135 int sent, uint32_t pid);
136 136
137/** 137/**
@@ -150,10 +150,10 @@ GMP_queue_destroy (struct MeshPeerQueue *queue, int clear_cls,
150 * @return Handle to cancel the message before it is sent. Once cont is called 150 * @return Handle to cancel the message before it is sent. Once cont is called
151 * message has been sent and therefore the handle is no longer valid. 151 * message has been sent and therefore the handle is no longer valid.
152 */ 152 */
153struct MeshPeerQueue * 153struct CadetPeerQueue *
154GMP_queue_add (struct MeshPeer *peer, void *cls, uint16_t type, 154GMP_queue_add (struct CadetPeer *peer, void *cls, uint16_t type,
155 uint16_t payload_type, uint32_t payload_id, 155 uint16_t payload_type, uint32_t payload_id,
156 size_t size, struct MeshConnection *c, int fwd, 156 size_t size, struct CadetConnection *c, int fwd,
157 GMP_sent cont, void *cont_cls); 157 GMP_sent cont, void *cont_cls);
158 158
159/** 159/**
@@ -164,7 +164,7 @@ GMP_queue_add (struct MeshPeer *peer, void *cls, uint16_t type,
164 * the sent continuation call. 164 * the sent continuation call.
165 */ 165 */
166void 166void
167GMP_queue_cancel (struct MeshPeer *peer, struct MeshConnection *c); 167GMP_queue_cancel (struct CadetPeer *peer, struct CadetConnection *c);
168 168
169/** 169/**
170 * Get the first message for a connection and unqueue it. 170 * Get the first message for a connection and unqueue it.
@@ -175,10 +175,10 @@ GMP_queue_cancel (struct MeshPeer *peer, struct MeshConnection *c);
175 * @return First message for this connection. 175 * @return First message for this connection.
176 */ 176 */
177struct GNUNET_MessageHeader * 177struct GNUNET_MessageHeader *
178GMP_connection_pop (struct MeshPeer *peer, struct MeshConnection *c); 178GMP_connection_pop (struct CadetPeer *peer, struct CadetConnection *c);
179 179
180void 180void
181GMP_queue_unlock (struct MeshPeer *peer, struct MeshConnection *c); 181GMP_queue_unlock (struct CadetPeer *peer, struct CadetConnection *c);
182 182
183/** 183/**
184 * Set tunnel. 184 * Set tunnel.
@@ -187,7 +187,7 @@ GMP_queue_unlock (struct MeshPeer *peer, struct MeshConnection *c);
187 * @param t Tunnel. 187 * @param t Tunnel.
188 */ 188 */
189void 189void
190GMP_set_tunnel (struct MeshPeer *peer, struct MeshTunnel3 *t); 190GMP_set_tunnel (struct CadetPeer *peer, struct CadetTunnel3 *t);
191 191
192/** 192/**
193 * Check whether there is a direct (core level) connection to peer. 193 * Check whether there is a direct (core level) connection to peer.
@@ -197,7 +197,7 @@ GMP_set_tunnel (struct MeshPeer *peer, struct MeshTunnel3 *t);
197 * @return #GNUNET_YES if there is a direct connection. 197 * @return #GNUNET_YES if there is a direct connection.
198 */ 198 */
199int 199int
200GMP_is_neighbor (const struct MeshPeer *peer); 200GMP_is_neighbor (const struct CadetPeer *peer);
201 201
202/** 202/**
203 * Create and initialize a new tunnel towards a peer, in case it has none. 203 * Create and initialize a new tunnel towards a peer, in case it has none.
@@ -207,7 +207,7 @@ GMP_is_neighbor (const struct MeshPeer *peer);
207 * @param peer Peer towards which to create the tunnel. 207 * @param peer Peer towards which to create the tunnel.
208 */ 208 */
209void 209void
210GMP_add_tunnel (struct MeshPeer *peer); 210GMP_add_tunnel (struct CadetPeer *peer);
211 211
212/** 212/**
213 * Add a connection to a neighboring peer. 213 * Add a connection to a neighboring peer.
@@ -222,7 +222,7 @@ GMP_add_tunnel (struct MeshPeer *peer);
222 * @return GNUNET_OK on success. 222 * @return GNUNET_OK on success.
223 */ 223 */
224int 224int
225GMP_add_connection (struct MeshPeer *peer, struct MeshConnection *c); 225GMP_add_connection (struct CadetPeer *peer, struct CadetConnection *c);
226 226
227/** 227/**
228 * Add the path to the peer and update the path used to reach it in case this 228 * Add the path to the peer and update the path used to reach it in case this
@@ -236,8 +236,8 @@ GMP_add_connection (struct MeshPeer *peer, struct MeshConnection *c);
236 * @return path if path was taken, pointer to existing duplicate if exists 236 * @return path if path was taken, pointer to existing duplicate if exists
237 * NULL on error. 237 * NULL on error.
238 */ 238 */
239struct MeshPeerPath * 239struct CadetPeerPath *
240GMP_add_path (struct MeshPeer *peer, struct MeshPeerPath *p, int trusted); 240GMP_add_path (struct CadetPeer *peer, struct CadetPeerPath *p, int trusted);
241 241
242/** 242/**
243 * Add the path to the origin peer and update the path used to reach it in case 243 * Add the path to the origin peer and update the path used to reach it in case
@@ -253,9 +253,9 @@ GMP_add_path (struct MeshPeer *peer, struct MeshPeerPath *p, int trusted);
253 * @return path if path was taken, pointer to existing duplicate if exists 253 * @return path if path was taken, pointer to existing duplicate if exists
254 * NULL on error. 254 * NULL on error.
255 */ 255 */
256struct MeshPeerPath * 256struct CadetPeerPath *
257GMP_add_path_to_origin (struct MeshPeer *peer, 257GMP_add_path_to_origin (struct CadetPeer *peer,
258 struct MeshPeerPath *path, 258 struct CadetPeerPath *path,
259 int trusted); 259 int trusted);
260 260
261/** 261/**
@@ -265,7 +265,7 @@ GMP_add_path_to_origin (struct MeshPeer *peer,
265 * @param confirmed Whether we know if the path works or not. 265 * @param confirmed Whether we know if the path works or not.
266 */ 266 */
267void 267void
268GMP_add_path_to_all (const struct MeshPeerPath *p, int confirmed); 268GMP_add_path_to_all (const struct CadetPeerPath *p, int confirmed);
269 269
270/** 270/**
271 * Remove any path to the peer that has the extact same peers as the one given. 271 * Remove any path to the peer that has the extact same peers as the one given.
@@ -274,7 +274,7 @@ GMP_add_path_to_all (const struct MeshPeerPath *p, int confirmed);
274 * @param path Path to remove. Is always destroyed . 274 * @param path Path to remove. Is always destroyed .
275 */ 275 */
276void 276void
277GMP_remove_path (struct MeshPeer *peer, struct MeshPeerPath *path); 277GMP_remove_path (struct CadetPeer *peer, struct CadetPeerPath *path);
278 278
279/** 279/**
280 * Remove a connection from a neighboring peer. 280 * Remove a connection from a neighboring peer.
@@ -285,7 +285,7 @@ GMP_remove_path (struct MeshPeer *peer, struct MeshPeerPath *path);
285 * @return GNUNET_OK on success. 285 * @return GNUNET_OK on success.
286 */ 286 */
287int 287int
288GMP_remove_connection (struct MeshPeer *peer, const struct MeshConnection *c); 288GMP_remove_connection (struct CadetPeer *peer, const struct CadetConnection *c);
289 289
290/** 290/**
291 * Start the DHT search for new paths towards the peer: we don't have 291 * Start the DHT search for new paths towards the peer: we don't have
@@ -294,7 +294,7 @@ GMP_remove_connection (struct MeshPeer *peer, const struct MeshConnection *c);
294 * @param peer Destination peer. 294 * @param peer Destination peer.
295 */ 295 */
296void 296void
297GMP_start_search (struct MeshPeer *peer); 297GMP_start_search (struct CadetPeer *peer);
298 298
299/** 299/**
300 * Stop the DHT search for new paths towards the peer: we already have 300 * Stop the DHT search for new paths towards the peer: we already have
@@ -303,7 +303,7 @@ GMP_start_search (struct MeshPeer *peer);
303 * @param peer Destination peer. 303 * @param peer Destination peer.
304 */ 304 */
305void 305void
306GMP_stop_search (struct MeshPeer *peer); 306GMP_stop_search (struct CadetPeer *peer);
307 307
308/** 308/**
309 * Get the Full ID of a peer. 309 * Get the Full ID of a peer.
@@ -313,7 +313,7 @@ GMP_stop_search (struct MeshPeer *peer);
313 * @return Full ID of peer. 313 * @return Full ID of peer.
314 */ 314 */
315const struct GNUNET_PeerIdentity * 315const struct GNUNET_PeerIdentity *
316GMP_get_id (const struct MeshPeer *peer); 316GMP_get_id (const struct CadetPeer *peer);
317 317
318/** 318/**
319 * Get the Short ID of a peer. 319 * Get the Short ID of a peer.
@@ -323,7 +323,7 @@ GMP_get_id (const struct MeshPeer *peer);
323 * @return Short ID of peer. 323 * @return Short ID of peer.
324 */ 324 */
325GNUNET_PEER_Id 325GNUNET_PEER_Id
326GMP_get_short_id (const struct MeshPeer *peer); 326GMP_get_short_id (const struct CadetPeer *peer);
327 327
328/** 328/**
329 * Get the tunnel towards a peer. 329 * Get the tunnel towards a peer.
@@ -332,8 +332,8 @@ GMP_get_short_id (const struct MeshPeer *peer);
332 * 332 *
333 * @return Tunnel towards peer. 333 * @return Tunnel towards peer.
334 */ 334 */
335struct MeshTunnel3 * 335struct CadetTunnel3 *
336GMP_get_tunnel (const struct MeshPeer *peer); 336GMP_get_tunnel (const struct CadetPeer *peer);
337 337
338/** 338/**
339 * Set the hello message. 339 * Set the hello message.
@@ -342,7 +342,7 @@ GMP_get_tunnel (const struct MeshPeer *peer);
342 * @param hello Hello message. 342 * @param hello Hello message.
343 */ 343 */
344void 344void
345GMP_set_hello (struct MeshPeer *peer, const struct GNUNET_HELLO_Message *hello); 345GMP_set_hello (struct CadetPeer *peer, const struct GNUNET_HELLO_Message *hello);
346 346
347/** 347/**
348 * Get the hello message. 348 * Get the hello message.
@@ -352,7 +352,7 @@ GMP_set_hello (struct MeshPeer *peer, const struct GNUNET_HELLO_Message *hello);
352 * @return Hello message. 352 * @return Hello message.
353 */ 353 */
354struct GNUNET_HELLO_Message * 354struct GNUNET_HELLO_Message *
355GMP_get_hello (struct MeshPeer *peer); 355GMP_get_hello (struct CadetPeer *peer);
356 356
357 357
358/** 358/**
@@ -361,7 +361,7 @@ GMP_get_hello (struct MeshPeer *peer);
361 * @param peer Peer to whom to connect. 361 * @param peer Peer to whom to connect.
362 */ 362 */
363void 363void
364GMP_try_connect (struct MeshPeer *peer); 364GMP_try_connect (struct CadetPeer *peer);
365 365
366/** 366/**
367 * Notify a peer that a link between two other peers is broken. If any path 367 * Notify a peer that a link between two other peers is broken. If any path
@@ -372,7 +372,7 @@ GMP_try_connect (struct MeshPeer *peer);
372 * @param peer2 Peer whose link is broken. 372 * @param peer2 Peer whose link is broken.
373 */ 373 */
374void 374void
375GMP_notify_broken_link (struct MeshPeer *peer, 375GMP_notify_broken_link (struct CadetPeer *peer,
376 struct GNUNET_PeerIdentity *peer1, 376 struct GNUNET_PeerIdentity *peer1,
377 struct GNUNET_PeerIdentity *peer2); 377 struct GNUNET_PeerIdentity *peer2);
378 378
@@ -384,7 +384,7 @@ GMP_notify_broken_link (struct MeshPeer *peer,
384 * @return Number of known paths. 384 * @return Number of known paths.
385 */ 385 */
386unsigned int 386unsigned int
387GMP_count_paths (const struct MeshPeer *peer); 387GMP_count_paths (const struct CadetPeer *peer);
388 388
389/** 389/**
390 * Iterate all known peers. 390 * Iterate all known peers.
@@ -403,7 +403,7 @@ GMP_iterate_all (GNUNET_CONTAINER_PeerMapIterator iter, void *cls);
403 * @return Static string for it's ID. 403 * @return Static string for it's ID.
404 */ 404 */
405const char * 405const char *
406GMP_2s (const struct MeshPeer *peer); 406GMP_2s (const struct CadetPeer *peer);
407 407
408 408
409#if 0 /* keep Emacsens' auto-indent happy */ 409#if 0 /* keep Emacsens' auto-indent happy */
@@ -413,6 +413,6 @@ GMP_2s (const struct MeshPeer *peer);
413} 413}
414#endif 414#endif
415 415
416/* ifndef GNUNET_MESH_SERVICE_PEER_H */ 416/* ifndef GNUNET_CADET_SERVICE_PEER_H */
417#endif 417#endif
418/* end of gnunet-mesh-service_peer.h */ 418/* end of gnunet-cadet-service_peer.h */