diff options
Diffstat (limited to 'src/include/gnunet_mesh_service.h')
-rw-r--r-- | src/include/gnunet_mesh_service.h | 214 |
1 files changed, 107 insertions, 107 deletions
diff --git a/src/include/gnunet_mesh_service.h b/src/include/gnunet_mesh_service.h index e49b89556..e69c9eaa7 100644 --- a/src/include/gnunet_mesh_service.h +++ b/src/include/gnunet_mesh_service.h | |||
@@ -19,13 +19,13 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file include/gnunet_mesh_service.h | 22 | * @file include/gnunet_cadet_service.h |
23 | * @brief mesh service; establish channels to distant peers | 23 | * @brief cadet service; establish channels to distant peers |
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #ifndef GNUNET_MESH_SERVICE_H | 27 | #ifndef GNUNET_CADET_SERVICE_H |
28 | #define GNUNET_MESH_SERVICE_H | 28 | #define GNUNET_CADET_SERVICE_H |
29 | 29 | ||
30 | #ifdef __cplusplus | 30 | #ifdef __cplusplus |
31 | extern "C" | 31 | extern "C" |
@@ -39,66 +39,66 @@ extern "C" | |||
39 | #include "gnunet_transport_service.h" | 39 | #include "gnunet_transport_service.h" |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * Version number of GNUnet-mesh API. | 42 | * Version number of GNUnet-cadet API. |
43 | */ | 43 | */ |
44 | #define GNUNET_MESH_VERSION 0x00000003 | 44 | #define GNUNET_CADET_VERSION 0x00000003 |
45 | 45 | ||
46 | 46 | ||
47 | /** | 47 | /** |
48 | * Opaque handle to the service. | 48 | * Opaque handle to the service. |
49 | */ | 49 | */ |
50 | struct GNUNET_MESH_Handle; | 50 | struct GNUNET_CADET_Handle; |
51 | 51 | ||
52 | /** | 52 | /** |
53 | * Opaque handle to a channel. | 53 | * Opaque handle to a channel. |
54 | */ | 54 | */ |
55 | struct GNUNET_MESH_Channel; | 55 | struct GNUNET_CADET_Channel; |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * Hash to be used in Mesh communication. Only 256 bits needed, | 58 | * Hash to be used in Cadet communication. Only 256 bits needed, |
59 | * instead of the 512 from @c GNUNET_HashCode. | 59 | * instead of the 512 from @c GNUNET_HashCode. |
60 | * | 60 | * |
61 | */ | 61 | */ |
62 | struct GNUNET_MESH_Hash | 62 | struct GNUNET_CADET_Hash |
63 | { | 63 | { |
64 | unsigned char bits[256 / 8]; | 64 | unsigned char bits[256 / 8]; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | /** | 67 | /** |
68 | * Channel options. | 68 | * Channel options. |
69 | * Second line indicates filed in the MeshChannelInfo union carrying the answer. | 69 | * Second line indicates filed in the CadetChannelInfo union carrying the answer. |
70 | */ | 70 | */ |
71 | enum GNUNET_MESH_ChannelOption | 71 | enum GNUNET_CADET_ChannelOption |
72 | { | 72 | { |
73 | /** | 73 | /** |
74 | * Default options: unreliable, default buffering, not out of order. | 74 | * Default options: unreliable, default buffering, not out of order. |
75 | */ | 75 | */ |
76 | GNUNET_MESH_OPTION_DEFAULT = 0x0, | 76 | GNUNET_CADET_OPTION_DEFAULT = 0x0, |
77 | 77 | ||
78 | /** | 78 | /** |
79 | * Disable buffering on intermediate nodes (for minimum latency). | 79 | * Disable buffering on intermediate nodes (for minimum latency). |
80 | * Yes/No. | 80 | * Yes/No. |
81 | */ | 81 | */ |
82 | GNUNET_MESH_OPTION_NOBUFFER = 0x1, | 82 | GNUNET_CADET_OPTION_NOBUFFER = 0x1, |
83 | 83 | ||
84 | /** | 84 | /** |
85 | * Enable channel reliability, lost messages will be retransmitted. | 85 | * Enable channel reliability, lost messages will be retransmitted. |
86 | * Yes/No. | 86 | * Yes/No. |
87 | */ | 87 | */ |
88 | GNUNET_MESH_OPTION_RELIABLE = 0x2, | 88 | GNUNET_CADET_OPTION_RELIABLE = 0x2, |
89 | 89 | ||
90 | /** | 90 | /** |
91 | * Enable out of order delivery of messages. | 91 | * Enable out of order delivery of messages. |
92 | * Yes/No. | 92 | * Yes/No. |
93 | */ | 93 | */ |
94 | GNUNET_MESH_OPTION_OOORDER = 0x4, | 94 | GNUNET_CADET_OPTION_OOORDER = 0x4, |
95 | 95 | ||
96 | /** | 96 | /** |
97 | * Who is the peer at the other end of the channel. | 97 | * Who is the peer at the other end of the channel. |
98 | * Only for use in @c GNUNET_MESH_channel_get_info | 98 | * Only for use in @c GNUNET_CADET_channel_get_info |
99 | * struct GNUNET_PeerIdentity *peer | 99 | * struct GNUNET_PeerIdentity *peer |
100 | */ | 100 | */ |
101 | GNUNET_MESH_OPTION_PEER = 0x8 | 101 | GNUNET_CADET_OPTION_PEER = 0x8 |
102 | 102 | ||
103 | }; | 103 | }; |
104 | 104 | ||
@@ -107,19 +107,19 @@ enum GNUNET_MESH_ChannelOption | |||
107 | * Functions with this signature are called whenever a message is | 107 | * Functions with this signature are called whenever a message is |
108 | * received. | 108 | * received. |
109 | * | 109 | * |
110 | * Each time the function must call #GNUNET_MESH_receive_done on the channel | 110 | * Each time the function must call #GNUNET_CADET_receive_done on the channel |
111 | * in order to receive the next message. This doesn't need to be immediate: | 111 | * in order to receive the next message. This doesn't need to be immediate: |
112 | * can be delayed if some processing is done on the message. | 112 | * can be delayed if some processing is done on the message. |
113 | * | 113 | * |
114 | * @param cls Closure (set from #GNUNET_MESH_connect). | 114 | * @param cls Closure (set from #GNUNET_CADET_connect). |
115 | * @param channel Connection to the other end. | 115 | * @param channel Connection to the other end. |
116 | * @param channel_ctx Place to store local state associated with the channel. | 116 | * @param channel_ctx Place to store local state associated with the channel. |
117 | * @param message The actual message. | 117 | * @param message The actual message. |
118 | * @return #GNUNET_OK to keep the channel open, | 118 | * @return #GNUNET_OK to keep the channel open, |
119 | * #GNUNET_SYSERR to close it (signal serious error). | 119 | * #GNUNET_SYSERR to close it (signal serious error). |
120 | */ | 120 | */ |
121 | typedef int (*GNUNET_MESH_MessageCallback) (void *cls, | 121 | typedef int (*GNUNET_CADET_MessageCallback) (void *cls, |
122 | struct GNUNET_MESH_Channel *channel, | 122 | struct GNUNET_CADET_Channel *channel, |
123 | void **channel_ctx, | 123 | void **channel_ctx, |
124 | const struct GNUNET_MessageHeader *message); | 124 | const struct GNUNET_MessageHeader *message); |
125 | 125 | ||
@@ -128,12 +128,12 @@ typedef int (*GNUNET_MESH_MessageCallback) (void *cls, | |||
128 | * Message handler. Each struct specifies how to handle on particular | 128 | * Message handler. Each struct specifies how to handle on particular |
129 | * type of message received. | 129 | * type of message received. |
130 | */ | 130 | */ |
131 | struct GNUNET_MESH_MessageHandler | 131 | struct GNUNET_CADET_MessageHandler |
132 | { | 132 | { |
133 | /** | 133 | /** |
134 | * Function to call for messages of "type". | 134 | * Function to call for messages of "type". |
135 | */ | 135 | */ |
136 | GNUNET_MESH_MessageCallback callback; | 136 | GNUNET_CADET_MessageCallback callback; |
137 | 137 | ||
138 | /** | 138 | /** |
139 | * Type of the message this handler covers. | 139 | * Type of the message this handler covers. |
@@ -153,29 +153,29 @@ struct GNUNET_MESH_MessageHandler | |||
153 | * Method called whenever another peer has added us to a channel | 153 | * Method called whenever another peer has added us to a channel |
154 | * the other peer initiated. | 154 | * the other peer initiated. |
155 | * Only called (once) upon reception of data with a message type which was | 155 | * Only called (once) upon reception of data with a message type which was |
156 | * subscribed to in #GNUNET_MESH_connect. | 156 | * subscribed to in #GNUNET_CADET_connect. |
157 | * | 157 | * |
158 | * A call to #GNUNET_MESH_channel_destroy causes te channel to be ignored. In | 158 | * A call to #GNUNET_CADET_channel_destroy causes te channel to be ignored. In |
159 | * this case the handler MUST return NULL. | 159 | * this case the handler MUST return NULL. |
160 | * | 160 | * |
161 | * @param cls closure | 161 | * @param cls closure |
162 | * @param channel new handle to the channel | 162 | * @param channel new handle to the channel |
163 | * @param initiator peer that started the channel | 163 | * @param initiator peer that started the channel |
164 | * @param port Port this channel is for. | 164 | * @param port Port this channel is for. |
165 | * @param options MeshOption flag field, with all active option bits set to 1. | 165 | * @param options CadetOption flag field, with all active option bits set to 1. |
166 | * | 166 | * |
167 | * @return initial channel context for the channel | 167 | * @return initial channel context for the channel |
168 | * (can be NULL -- that's not an error) | 168 | * (can be NULL -- that's not an error) |
169 | */ | 169 | */ |
170 | typedef void *(GNUNET_MESH_InboundChannelNotificationHandler) (void *cls, | 170 | typedef void *(GNUNET_CADET_InboundChannelNotificationHandler) (void *cls, |
171 | struct | 171 | struct |
172 | GNUNET_MESH_Channel | 172 | GNUNET_CADET_Channel |
173 | * channel, | 173 | * channel, |
174 | const struct | 174 | const struct |
175 | GNUNET_PeerIdentity | 175 | GNUNET_PeerIdentity |
176 | * initiator, | 176 | * initiator, |
177 | uint32_t port, | 177 | uint32_t port, |
178 | enum GNUNET_MESH_ChannelOption | 178 | enum GNUNET_CADET_ChannelOption |
179 | options); | 179 | options); |
180 | 180 | ||
181 | 181 | ||
@@ -183,21 +183,21 @@ typedef void *(GNUNET_MESH_InboundChannelNotificationHandler) (void *cls, | |||
183 | * Function called whenever a channel is destroyed. Should clean up | 183 | * Function called whenever a channel is destroyed. Should clean up |
184 | * any associated state. | 184 | * any associated state. |
185 | * | 185 | * |
186 | * It must NOT call #GNUNET_MESH_channel_destroy on the channel. | 186 | * It must NOT call #GNUNET_CADET_channel_destroy on the channel. |
187 | * | 187 | * |
188 | * @param cls closure (set from #GNUNET_MESH_connect) | 188 | * @param cls closure (set from #GNUNET_CADET_connect) |
189 | * @param channel connection to the other end (henceforth invalid) | 189 | * @param channel connection to the other end (henceforth invalid) |
190 | * @param channel_ctx place where local state associated | 190 | * @param channel_ctx place where local state associated |
191 | * with the channel is stored | 191 | * with the channel is stored |
192 | */ | 192 | */ |
193 | typedef void (GNUNET_MESH_ChannelEndHandler) (void *cls, | 193 | typedef void (GNUNET_CADET_ChannelEndHandler) (void *cls, |
194 | const struct GNUNET_MESH_Channel * | 194 | const struct GNUNET_CADET_Channel * |
195 | channel, | 195 | channel, |
196 | void *channel_ctx); | 196 | void *channel_ctx); |
197 | 197 | ||
198 | 198 | ||
199 | /** | 199 | /** |
200 | * Connect to the mesh service. | 200 | * Connect to the cadet service. |
201 | * | 201 | * |
202 | * @param cfg Configuration to use. | 202 | * @param cfg Configuration to use. |
203 | * @param cls Closure for the various callbacks that follow (including | 203 | * @param cls Closure for the various callbacks that follow (including |
@@ -206,59 +206,59 @@ typedef void (GNUNET_MESH_ChannelEndHandler) (void *cls, | |||
206 | * Can be NULL if no inbound channels are desired. | 206 | * Can be NULL if no inbound channels are desired. |
207 | * See @a ports. | 207 | * See @a ports. |
208 | * @param cleaner Function called when a channel is destroyed by the remote peer. | 208 | * @param cleaner Function called when a channel is destroyed by the remote peer. |
209 | * It is NOT called if #GNUNET_MESH_channel_destroy is called on | 209 | * It is NOT called if #GNUNET_CADET_channel_destroy is called on |
210 | * the channel. | 210 | * the channel. |
211 | * @param handlers Callbacks for messages we care about, NULL-terminated. Each | 211 | * @param handlers Callbacks for messages we care about, NULL-terminated. Each |
212 | * one must call #GNUNET_MESH_receive_done on the channel to | 212 | * one must call #GNUNET_CADET_receive_done on the channel to |
213 | * receive the next message. Messages of a type that is not | 213 | * receive the next message. Messages of a type that is not |
214 | * in the handlers array are ignored if received. | 214 | * in the handlers array are ignored if received. |
215 | * @param ports NULL or 0-terminated array of port numbers for incoming channels. | 215 | * @param ports NULL or 0-terminated array of port numbers for incoming channels. |
216 | * See @a new_channel. | 216 | * See @a new_channel. |
217 | * | 217 | * |
218 | * @return handle to the mesh service NULL on error | 218 | * @return handle to the cadet service NULL on error |
219 | * (in this case, init is never called) | 219 | * (in this case, init is never called) |
220 | */ | 220 | */ |
221 | struct GNUNET_MESH_Handle * | 221 | struct GNUNET_CADET_Handle * |
222 | GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, | 222 | GNUNET_CADET_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, |
223 | GNUNET_MESH_InboundChannelNotificationHandler new_channel, | 223 | GNUNET_CADET_InboundChannelNotificationHandler new_channel, |
224 | GNUNET_MESH_ChannelEndHandler cleaner, | 224 | GNUNET_CADET_ChannelEndHandler cleaner, |
225 | const struct GNUNET_MESH_MessageHandler *handlers, | 225 | const struct GNUNET_CADET_MessageHandler *handlers, |
226 | const uint32_t *ports); | 226 | const uint32_t *ports); |
227 | 227 | ||
228 | 228 | ||
229 | /** | 229 | /** |
230 | * Disconnect from the mesh service. All channels will be destroyed. All channel | 230 | * Disconnect from the cadet service. All channels will be destroyed. All channel |
231 | * disconnect callbacks will be called on any still connected peers, notifying | 231 | * disconnect callbacks will be called on any still connected peers, notifying |
232 | * about their disconnection. The registered inbound channel cleaner will be | 232 | * about their disconnection. The registered inbound channel cleaner will be |
233 | * called should any inbound channels still exist. | 233 | * called should any inbound channels still exist. |
234 | * | 234 | * |
235 | * @param handle connection to mesh to disconnect | 235 | * @param handle connection to cadet to disconnect |
236 | */ | 236 | */ |
237 | void | 237 | void |
238 | GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); | 238 | GNUNET_CADET_disconnect (struct GNUNET_CADET_Handle *handle); |
239 | 239 | ||
240 | 240 | ||
241 | /** | 241 | /** |
242 | * Create a new channel towards a remote peer. | 242 | * Create a new channel towards a remote peer. |
243 | * | 243 | * |
244 | * If the destination port is not open by any peer or the destination peer | 244 | * If the destination port is not open by any peer or the destination peer |
245 | * does not accept the channel, #GNUNET_MESH_ChannelEndHandler will be called | 245 | * does not accept the channel, #GNUNET_CADET_ChannelEndHandler will be called |
246 | * for this channel. | 246 | * for this channel. |
247 | * | 247 | * |
248 | * @param h mesh handle | 248 | * @param h cadet handle |
249 | * @param channel_ctx client's channel context to associate with the channel | 249 | * @param channel_ctx client's channel context to associate with the channel |
250 | * @param peer peer identity the channel should go to | 250 | * @param peer peer identity the channel should go to |
251 | * @param port Port number. | 251 | * @param port Port number. |
252 | * @param options MeshOption flag field, with all desired option bits set to 1. | 252 | * @param options CadetOption flag field, with all desired option bits set to 1. |
253 | * | 253 | * |
254 | * @return handle to the channel | 254 | * @return handle to the channel |
255 | */ | 255 | */ |
256 | struct GNUNET_MESH_Channel * | 256 | struct GNUNET_CADET_Channel * |
257 | GNUNET_MESH_channel_create (struct GNUNET_MESH_Handle *h, | 257 | GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h, |
258 | void *channel_ctx, | 258 | void *channel_ctx, |
259 | const struct GNUNET_PeerIdentity *peer, | 259 | const struct GNUNET_PeerIdentity *peer, |
260 | uint32_t port, | 260 | uint32_t port, |
261 | enum GNUNET_MESH_ChannelOption options); | 261 | enum GNUNET_CADET_ChannelOption options); |
262 | 262 | ||
263 | 263 | ||
264 | /** | 264 | /** |
@@ -271,13 +271,13 @@ GNUNET_MESH_channel_create (struct GNUNET_MESH_Handle *h, | |||
271 | * @param channel Channel handle, becomes invalid after this call. | 271 | * @param channel Channel handle, becomes invalid after this call. |
272 | */ | 272 | */ |
273 | void | 273 | void |
274 | GNUNET_MESH_channel_destroy (struct GNUNET_MESH_Channel *channel); | 274 | GNUNET_CADET_channel_destroy (struct GNUNET_CADET_Channel *channel); |
275 | 275 | ||
276 | 276 | ||
277 | /** | 277 | /** |
278 | * Struct to retrieve info about a channel. | 278 | * Struct to retrieve info about a channel. |
279 | */ | 279 | */ |
280 | union GNUNET_MESH_ChannelInfo | 280 | union GNUNET_CADET_ChannelInfo |
281 | { | 281 | { |
282 | 282 | ||
283 | /** | 283 | /** |
@@ -296,23 +296,23 @@ union GNUNET_MESH_ChannelInfo | |||
296 | * Get information about a channel. | 296 | * Get information about a channel. |
297 | * | 297 | * |
298 | * @param channel Channel handle. | 298 | * @param channel Channel handle. |
299 | * @param option Query type GNUNET_MESH_OPTION_* | 299 | * @param option Query type GNUNET_CADET_OPTION_* |
300 | * @param ... dependant on option, currently not used | 300 | * @param ... dependant on option, currently not used |
301 | * @return Union with an answer to the query. | 301 | * @return Union with an answer to the query. |
302 | */ | 302 | */ |
303 | const union GNUNET_MESH_ChannelInfo * | 303 | const union GNUNET_CADET_ChannelInfo * |
304 | GNUNET_MESH_channel_get_info (struct GNUNET_MESH_Channel *channel, | 304 | GNUNET_CADET_channel_get_info (struct GNUNET_CADET_Channel *channel, |
305 | enum GNUNET_MESH_ChannelOption option, ...); | 305 | enum GNUNET_CADET_ChannelOption option, ...); |
306 | 306 | ||
307 | 307 | ||
308 | /** | 308 | /** |
309 | * Handle for a transmission request. | 309 | * Handle for a transmission request. |
310 | */ | 310 | */ |
311 | struct GNUNET_MESH_TransmitHandle; | 311 | struct GNUNET_CADET_TransmitHandle; |
312 | 312 | ||
313 | 313 | ||
314 | /** | 314 | /** |
315 | * Ask the mesh to call @a notify once it is ready to transmit the | 315 | * Ask the cadet to call @a notify once it is ready to transmit the |
316 | * given number of bytes to the specified channel. | 316 | * given number of bytes to the specified channel. |
317 | * Only one call can be active at any time, to issue another request, | 317 | * Only one call can be active at any time, to issue another request, |
318 | * wait for the callback or cancel the current request. | 318 | * wait for the callback or cancel the current request. |
@@ -330,8 +330,8 @@ struct GNUNET_MESH_TransmitHandle; | |||
330 | * NULL if we can not even queue the request (insufficient | 330 | * NULL if we can not even queue the request (insufficient |
331 | * memory); if NULL is returned, @a notify will NOT be called. | 331 | * memory); if NULL is returned, @a notify will NOT be called. |
332 | */ | 332 | */ |
333 | struct GNUNET_MESH_TransmitHandle * | 333 | struct GNUNET_CADET_TransmitHandle * |
334 | GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Channel *channel, | 334 | GNUNET_CADET_notify_transmit_ready (struct GNUNET_CADET_Channel *channel, |
335 | int cork, | 335 | int cork, |
336 | struct GNUNET_TIME_Relative maxdelay, | 336 | struct GNUNET_TIME_Relative maxdelay, |
337 | size_t notify_size, | 337 | size_t notify_size, |
@@ -345,7 +345,7 @@ GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Channel *channel, | |||
345 | * @param th handle that was returned by "notify_transmit_ready". | 345 | * @param th handle that was returned by "notify_transmit_ready". |
346 | */ | 346 | */ |
347 | void | 347 | void |
348 | GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle | 348 | GNUNET_CADET_notify_transmit_ready_cancel (struct GNUNET_CADET_TransmitHandle |
349 | *th); | 349 | *th); |
350 | 350 | ||
351 | 351 | ||
@@ -357,23 +357,23 @@ GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle | |||
357 | * @param channel Channel that will be allowed to call another handler. | 357 | * @param channel Channel that will be allowed to call another handler. |
358 | */ | 358 | */ |
359 | void | 359 | void |
360 | GNUNET_MESH_receive_done (struct GNUNET_MESH_Channel *channel); | 360 | GNUNET_CADET_receive_done (struct GNUNET_CADET_Channel *channel); |
361 | 361 | ||
362 | 362 | ||
363 | 363 | ||
364 | /******************************************************************************/ | 364 | /******************************************************************************/ |
365 | /******************** MONITORING /DEBUG API *************************/ | 365 | /******************** MONITORING /DEBUG API *************************/ |
366 | /******************************************************************************/ | 366 | /******************************************************************************/ |
367 | /* The following calls are not useful for normal MESH operation, but for */ | 367 | /* The following calls are not useful for normal CADET operation, but for */ |
368 | /* debug and monitoring of the mesh state. They can be safely ignored. */ | 368 | /* debug and monitoring of the cadet state. They can be safely ignored. */ |
369 | /* The API can change at any point without notice. */ | 369 | /* The API can change at any point without notice. */ |
370 | /* Please contact the developer if you consider any of this calls useful for */ | 370 | /* Please contact the developer if you consider any of this calls useful for */ |
371 | /* normal mesh applications. */ | 371 | /* normal cadet applications. */ |
372 | /******************************************************************************/ | 372 | /******************************************************************************/ |
373 | 373 | ||
374 | 374 | ||
375 | /** | 375 | /** |
376 | * Method called to retrieve information about a specific channel the mesh peer | 376 | * Method called to retrieve information about a specific channel the cadet peer |
377 | * is aware of, including all transit nodes. | 377 | * is aware of, including all transit nodes. |
378 | * | 378 | * |
379 | * @param cls Closure. | 379 | * @param cls Closure. |
@@ -384,7 +384,7 @@ GNUNET_MESH_receive_done (struct GNUNET_MESH_Channel *channel); | |||
384 | * @param dest_channel_number Local number for dest, if known. | 384 | * @param dest_channel_number Local number for dest, if known. |
385 | * @param public_channel_numbe Number for P2P, always known. | 385 | * @param public_channel_numbe Number for P2P, always known. |
386 | */ | 386 | */ |
387 | typedef void (*GNUNET_MESH_ChannelCB) (void *cls, | 387 | typedef void (*GNUNET_CADET_ChannelCB) (void *cls, |
388 | const struct GNUNET_PeerIdentity *root, | 388 | const struct GNUNET_PeerIdentity *root, |
389 | const struct GNUNET_PeerIdentity *dest, | 389 | const struct GNUNET_PeerIdentity *dest, |
390 | uint32_t port, | 390 | uint32_t port, |
@@ -393,7 +393,7 @@ typedef void (*GNUNET_MESH_ChannelCB) (void *cls, | |||
393 | uint32_t public_channel_number); | 393 | uint32_t public_channel_number); |
394 | 394 | ||
395 | /** | 395 | /** |
396 | * Method called to retrieve information about all peers in MESH, called | 396 | * Method called to retrieve information about all peers in CADET, called |
397 | * once per peer. | 397 | * once per peer. |
398 | * | 398 | * |
399 | * After last peer has been reported, an additional call with NULL is done. | 399 | * After last peer has been reported, an additional call with NULL is done. |
@@ -405,7 +405,7 @@ typedef void (*GNUNET_MESH_ChannelCB) (void *cls, | |||
405 | * @param best_path How long is the best path? | 405 | * @param best_path How long is the best path? |
406 | * (0 = unknown, 1 = ourselves, 2 = neighbor) | 406 | * (0 = unknown, 1 = ourselves, 2 = neighbor) |
407 | */ | 407 | */ |
408 | typedef void (*GNUNET_MESH_PeersCB) (void *cls, | 408 | typedef void (*GNUNET_CADET_PeersCB) (void *cls, |
409 | const struct GNUNET_PeerIdentity *peer, | 409 | const struct GNUNET_PeerIdentity *peer, |
410 | int tunnel, unsigned int n_paths, | 410 | int tunnel, unsigned int n_paths, |
411 | unsigned int best_path); | 411 | unsigned int best_path); |
@@ -423,7 +423,7 @@ typedef void (*GNUNET_MESH_PeersCB) (void *cls, | |||
423 | * Each path starts with the local peer. | 423 | * Each path starts with the local peer. |
424 | * Each path ends with the destination peer (given in @c peer). | 424 | * Each path ends with the destination peer (given in @c peer). |
425 | */ | 425 | */ |
426 | typedef void (*GNUNET_MESH_PeerCB) (void *cls, | 426 | typedef void (*GNUNET_CADET_PeerCB) (void *cls, |
427 | const struct GNUNET_PeerIdentity *peer, | 427 | const struct GNUNET_PeerIdentity *peer, |
428 | int tunnel, | 428 | int tunnel, |
429 | int neighbor, | 429 | int neighbor, |
@@ -432,7 +432,7 @@ typedef void (*GNUNET_MESH_PeerCB) (void *cls, | |||
432 | 432 | ||
433 | 433 | ||
434 | /** | 434 | /** |
435 | * Method called to retrieve information about all tunnels in MESH, called | 435 | * Method called to retrieve information about all tunnels in CADET, called |
436 | * once per tunnel. | 436 | * once per tunnel. |
437 | * | 437 | * |
438 | * After last tunnel has been reported, an additional call with NULL is done. | 438 | * After last tunnel has been reported, an additional call with NULL is done. |
@@ -444,7 +444,7 @@ typedef void (*GNUNET_MESH_PeerCB) (void *cls, | |||
444 | * @param estate Encryption state. | 444 | * @param estate Encryption state. |
445 | * @param cstate Connectivity state. | 445 | * @param cstate Connectivity state. |
446 | */ | 446 | */ |
447 | typedef void (*GNUNET_MESH_TunnelsCB) (void *cls, | 447 | typedef void (*GNUNET_CADET_TunnelsCB) (void *cls, |
448 | const struct GNUNET_PeerIdentity *peer, | 448 | const struct GNUNET_PeerIdentity *peer, |
449 | unsigned int channels, | 449 | unsigned int channels, |
450 | unsigned int connections, | 450 | unsigned int connections, |
@@ -454,7 +454,7 @@ typedef void (*GNUNET_MESH_TunnelsCB) (void *cls, | |||
454 | 454 | ||
455 | 455 | ||
456 | /** | 456 | /** |
457 | * Method called to retrieve information about a specific tunnel the mesh peer | 457 | * Method called to retrieve information about a specific tunnel the cadet peer |
458 | * has established, o`r is trying to establish. | 458 | * has established, o`r is trying to establish. |
459 | * | 459 | * |
460 | * @param cls Closure. | 460 | * @param cls Closure. |
@@ -466,51 +466,51 @@ typedef void (*GNUNET_MESH_TunnelsCB) (void *cls, | |||
466 | * @param estate Encryption state. | 466 | * @param estate Encryption state. |
467 | * @param cstate Connectivity state. | 467 | * @param cstate Connectivity state. |
468 | */ | 468 | */ |
469 | typedef void (*GNUNET_MESH_TunnelCB) (void *cls, | 469 | typedef void (*GNUNET_CADET_TunnelCB) (void *cls, |
470 | const struct GNUNET_PeerIdentity *peer, | 470 | const struct GNUNET_PeerIdentity *peer, |
471 | unsigned int n_channels, | 471 | unsigned int n_channels, |
472 | unsigned int n_connections, | 472 | unsigned int n_connections, |
473 | uint32_t *channels, | 473 | uint32_t *channels, |
474 | struct GNUNET_MESH_Hash *connections, | 474 | struct GNUNET_CADET_Hash *connections, |
475 | unsigned int estate, | 475 | unsigned int estate, |
476 | unsigned int cstate); | 476 | unsigned int cstate); |
477 | 477 | ||
478 | /** | 478 | /** |
479 | * Request information about a specific channel of the running mesh peer. | 479 | * Request information about a specific channel of the running cadet peer. |
480 | * | 480 | * |
481 | * WARNING: unstable API, likely to change in the future! | 481 | * WARNING: unstable API, likely to change in the future! |
482 | * | 482 | * |
483 | * @param h Handle to the mesh peer. | 483 | * @param h Handle to the cadet peer. |
484 | * @param peer ID of the other end of the channel. | 484 | * @param peer ID of the other end of the channel. |
485 | * @param channel_number Channel number. | 485 | * @param channel_number Channel number. |
486 | * @param callback Function to call with the requested data. | 486 | * @param callback Function to call with the requested data. |
487 | * @param callback_cls Closure for @c callback. | 487 | * @param callback_cls Closure for @c callback. |
488 | */ | 488 | */ |
489 | void | 489 | void |
490 | GNUNET_MESH_get_channel (struct GNUNET_MESH_Handle *h, | 490 | GNUNET_CADET_get_channel (struct GNUNET_CADET_Handle *h, |
491 | struct GNUNET_PeerIdentity *peer, | 491 | struct GNUNET_PeerIdentity *peer, |
492 | uint32_t channel_number, | 492 | uint32_t channel_number, |
493 | GNUNET_MESH_ChannelCB callback, | 493 | GNUNET_CADET_ChannelCB callback, |
494 | void *callback_cls); | 494 | void *callback_cls); |
495 | 495 | ||
496 | 496 | ||
497 | /** | 497 | /** |
498 | * Request information about peers known to the running mesh service. | 498 | * Request information about peers known to the running cadet service. |
499 | * The callback will be called for every peer known to the service. | 499 | * The callback will be called for every peer known to the service. |
500 | * Only one info request (of any kind) can be active at once. | 500 | * Only one info request (of any kind) can be active at once. |
501 | * | 501 | * |
502 | * | 502 | * |
503 | * WARNING: unstable API, likely to change in the future! | 503 | * WARNING: unstable API, likely to change in the future! |
504 | * | 504 | * |
505 | * @param h Handle to the mesh peer. | 505 | * @param h Handle to the cadet peer. |
506 | * @param callback Function to call with the requested data. | 506 | * @param callback Function to call with the requested data. |
507 | * @param callback_cls Closure for @c callback. | 507 | * @param callback_cls Closure for @c callback. |
508 | * | 508 | * |
509 | * @return #GNUNET_OK / #GNUNET_SYSERR | 509 | * @return #GNUNET_OK / #GNUNET_SYSERR |
510 | */ | 510 | */ |
511 | int | 511 | int |
512 | GNUNET_MESH_get_peers (struct GNUNET_MESH_Handle *h, | 512 | GNUNET_CADET_get_peers (struct GNUNET_CADET_Handle *h, |
513 | GNUNET_MESH_PeersCB callback, | 513 | GNUNET_CADET_PeersCB callback, |
514 | void *callback_cls); | 514 | void *callback_cls); |
515 | 515 | ||
516 | /** | 516 | /** |
@@ -518,22 +518,22 @@ GNUNET_MESH_get_peers (struct GNUNET_MESH_Handle *h, | |||
518 | * | 518 | * |
519 | * WARNING: unstable API, likely to change in the future! | 519 | * WARNING: unstable API, likely to change in the future! |
520 | * | 520 | * |
521 | * @param h Mesh handle. | 521 | * @param h Cadet handle. |
522 | * | 522 | * |
523 | * @return Closure given to GNUNET_MESH_get_peers. | 523 | * @return Closure given to GNUNET_CADET_get_peers. |
524 | */ | 524 | */ |
525 | void * | 525 | void * |
526 | GNUNET_MESH_get_peers_cancel (struct GNUNET_MESH_Handle *h); | 526 | GNUNET_CADET_get_peers_cancel (struct GNUNET_CADET_Handle *h); |
527 | 527 | ||
528 | 528 | ||
529 | /** | 529 | /** |
530 | * Request information about a peer known to the running mesh peer. | 530 | * Request information about a peer known to the running cadet peer. |
531 | * The callback will be called for the tunnel once. | 531 | * The callback will be called for the tunnel once. |
532 | * Only one info request (of any kind) can be active at once. | 532 | * Only one info request (of any kind) can be active at once. |
533 | * | 533 | * |
534 | * WARNING: unstable API, likely to change in the future! | 534 | * WARNING: unstable API, likely to change in the future! |
535 | * | 535 | * |
536 | * @param h Handle to the mesh peer. | 536 | * @param h Handle to the cadet peer. |
537 | * @param id Peer whose tunnel to examine. | 537 | * @param id Peer whose tunnel to examine. |
538 | * @param callback Function to call with the requested data. | 538 | * @param callback Function to call with the requested data. |
539 | * @param callback_cls Closure for @c callback. | 539 | * @param callback_cls Closure for @c callback. |
@@ -541,48 +541,48 @@ GNUNET_MESH_get_peers_cancel (struct GNUNET_MESH_Handle *h); | |||
541 | * @return #GNUNET_OK / #GNUNET_SYSERR | 541 | * @return #GNUNET_OK / #GNUNET_SYSERR |
542 | */ | 542 | */ |
543 | int | 543 | int |
544 | GNUNET_MESH_get_peer (struct GNUNET_MESH_Handle *h, | 544 | GNUNET_CADET_get_peer (struct GNUNET_CADET_Handle *h, |
545 | const struct GNUNET_PeerIdentity *id, | 545 | const struct GNUNET_PeerIdentity *id, |
546 | GNUNET_MESH_PeerCB callback, | 546 | GNUNET_CADET_PeerCB callback, |
547 | void *callback_cls); | 547 | void *callback_cls); |
548 | 548 | ||
549 | /** | 549 | /** |
550 | * Request information about tunnels of the running mesh peer. | 550 | * Request information about tunnels of the running cadet peer. |
551 | * The callback will be called for every tunnel of the service. | 551 | * The callback will be called for every tunnel of the service. |
552 | * Only one info request (of any kind) can be active at once. | 552 | * Only one info request (of any kind) can be active at once. |
553 | * | 553 | * |
554 | * WARNING: unstable API, likely to change in the future! | 554 | * WARNING: unstable API, likely to change in the future! |
555 | * | 555 | * |
556 | * @param h Handle to the mesh peer. | 556 | * @param h Handle to the cadet peer. |
557 | * @param callback Function to call with the requested data. | 557 | * @param callback Function to call with the requested data. |
558 | * @param callback_cls Closure for @c callback. | 558 | * @param callback_cls Closure for @c callback. |
559 | * | 559 | * |
560 | * @return #GNUNET_OK / #GNUNET_SYSERR | 560 | * @return #GNUNET_OK / #GNUNET_SYSERR |
561 | */ | 561 | */ |
562 | int | 562 | int |
563 | GNUNET_MESH_get_tunnels (struct GNUNET_MESH_Handle *h, | 563 | GNUNET_CADET_get_tunnels (struct GNUNET_CADET_Handle *h, |
564 | GNUNET_MESH_TunnelsCB callback, | 564 | GNUNET_CADET_TunnelsCB callback, |
565 | void *callback_cls); | 565 | void *callback_cls); |
566 | 566 | ||
567 | /** | 567 | /** |
568 | * Cancel a monitor request. The monitor callback will not be called. | 568 | * Cancel a monitor request. The monitor callback will not be called. |
569 | * | 569 | * |
570 | * @param h Mesh handle. | 570 | * @param h Cadet handle. |
571 | * | 571 | * |
572 | * @return Closure given to GNUNET_MESH_monitor, if any. | 572 | * @return Closure given to GNUNET_CADET_monitor, if any. |
573 | */ | 573 | */ |
574 | void * | 574 | void * |
575 | GNUNET_MESH_get_tunnels_cancel (struct GNUNET_MESH_Handle *h); | 575 | GNUNET_CADET_get_tunnels_cancel (struct GNUNET_CADET_Handle *h); |
576 | 576 | ||
577 | 577 | ||
578 | /** | 578 | /** |
579 | * Request information about a tunnel of the running mesh peer. | 579 | * Request information about a tunnel of the running cadet peer. |
580 | * The callback will be called for the tunnel once. | 580 | * The callback will be called for the tunnel once. |
581 | * Only one info request (of any kind) can be active at once. | 581 | * Only one info request (of any kind) can be active at once. |
582 | * | 582 | * |
583 | * WARNING: unstable API, likely to change in the future! | 583 | * WARNING: unstable API, likely to change in the future! |
584 | * | 584 | * |
585 | * @param h Handle to the mesh peer. | 585 | * @param h Handle to the cadet peer. |
586 | * @param id Peer whose tunnel to examine. | 586 | * @param id Peer whose tunnel to examine. |
587 | * @param callback Function to call with the requested data. | 587 | * @param callback Function to call with the requested data. |
588 | * @param callback_cls Closure for @c callback. | 588 | * @param callback_cls Closure for @c callback. |
@@ -590,13 +590,13 @@ GNUNET_MESH_get_tunnels_cancel (struct GNUNET_MESH_Handle *h); | |||
590 | * @return #GNUNET_OK / #GNUNET_SYSERR | 590 | * @return #GNUNET_OK / #GNUNET_SYSERR |
591 | */ | 591 | */ |
592 | int | 592 | int |
593 | GNUNET_MESH_get_tunnel (struct GNUNET_MESH_Handle *h, | 593 | GNUNET_CADET_get_tunnel (struct GNUNET_CADET_Handle *h, |
594 | const struct GNUNET_PeerIdentity *id, | 594 | const struct GNUNET_PeerIdentity *id, |
595 | GNUNET_MESH_TunnelCB callback, | 595 | GNUNET_CADET_TunnelCB callback, |
596 | void *callback_cls); | 596 | void *callback_cls); |
597 | 597 | ||
598 | /** | 598 | /** |
599 | * Create a message queue for a mesh channel. | 599 | * Create a message queue for a cadet channel. |
600 | * The message queue can only be used to transmit messages, | 600 | * The message queue can only be used to transmit messages, |
601 | * not to receive them. | 601 | * not to receive them. |
602 | * | 602 | * |
@@ -604,7 +604,7 @@ GNUNET_MESH_get_tunnel (struct GNUNET_MESH_Handle *h, | |||
604 | * @return a message queue to messages over the channel | 604 | * @return a message queue to messages over the channel |
605 | */ | 605 | */ |
606 | struct GNUNET_MQ_Handle * | 606 | struct GNUNET_MQ_Handle * |
607 | GNUNET_MESH_mq_create (struct GNUNET_MESH_Channel *channel); | 607 | GNUNET_CADET_mq_create (struct GNUNET_CADET_Channel *channel); |
608 | 608 | ||
609 | 609 | ||
610 | #if 0 /* keep Emacsens' auto-indent happy */ | 610 | #if 0 /* keep Emacsens' auto-indent happy */ |
@@ -614,6 +614,6 @@ GNUNET_MESH_mq_create (struct GNUNET_MESH_Channel *channel); | |||
614 | } | 614 | } |
615 | #endif | 615 | #endif |
616 | 616 | ||
617 | /* ifndef GNUNET_MESH_SERVICE_H */ | 617 | /* ifndef GNUNET_CADET_SERVICE_H */ |
618 | #endif | 618 | #endif |
619 | /* end of gnunet_mesh_service.h */ | 619 | /* end of gnunet_cadet_service.h */ |