diff options
Diffstat (limited to 'src/fs/gnunet-service-fs_mesh_server.c')
-rw-r--r-- | src/fs/gnunet-service-fs_mesh_server.c | 180 |
1 files changed, 90 insertions, 90 deletions
diff --git a/src/fs/gnunet-service-fs_mesh_server.c b/src/fs/gnunet-service-fs_mesh_server.c index e157c40e6..77add757d 100644 --- a/src/fs/gnunet-service-fs_mesh_server.c +++ b/src/fs/gnunet-service-fs_mesh_server.c | |||
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file fs/gnunet-service-fs_mesh_server.c | 22 | * @file fs/gnunet-service-fs_cadet_server.c |
23 | * @brief non-anonymous file-transfer | 23 | * @brief non-anonymous file-transfer |
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | * | 25 | * |
@@ -30,12 +30,12 @@ | |||
30 | #include "platform.h" | 30 | #include "platform.h" |
31 | #include "gnunet_constants.h" | 31 | #include "gnunet_constants.h" |
32 | #include "gnunet_util_lib.h" | 32 | #include "gnunet_util_lib.h" |
33 | #include "gnunet_mesh_service.h" | 33 | #include "gnunet_cadet_service.h" |
34 | #include "gnunet_protocols.h" | 34 | #include "gnunet_protocols.h" |
35 | #include "gnunet_applications.h" | 35 | #include "gnunet_applications.h" |
36 | #include "gnunet-service-fs.h" | 36 | #include "gnunet-service-fs.h" |
37 | #include "gnunet-service-fs_indexing.h" | 37 | #include "gnunet-service-fs_indexing.h" |
38 | #include "gnunet-service-fs_mesh.h" | 38 | #include "gnunet-service-fs_cadet.h" |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * After how long do we termiante idle connections? | 41 | * After how long do we termiante idle connections? |
@@ -44,7 +44,7 @@ | |||
44 | 44 | ||
45 | 45 | ||
46 | /** | 46 | /** |
47 | * A message in the queue to be written to the mesh. | 47 | * A message in the queue to be written to the cadet. |
48 | */ | 48 | */ |
49 | struct WriteQueueItem | 49 | struct WriteQueueItem |
50 | { | 50 | { |
@@ -66,29 +66,29 @@ struct WriteQueueItem | |||
66 | 66 | ||
67 | 67 | ||
68 | /** | 68 | /** |
69 | * Information we keep around for each active meshing client. | 69 | * Information we keep around for each active cadeting client. |
70 | */ | 70 | */ |
71 | struct MeshClient | 71 | struct CadetClient |
72 | { | 72 | { |
73 | /** | 73 | /** |
74 | * DLL | 74 | * DLL |
75 | */ | 75 | */ |
76 | struct MeshClient *next; | 76 | struct CadetClient *next; |
77 | 77 | ||
78 | /** | 78 | /** |
79 | * DLL | 79 | * DLL |
80 | */ | 80 | */ |
81 | struct MeshClient *prev; | 81 | struct CadetClient *prev; |
82 | 82 | ||
83 | /** | 83 | /** |
84 | * Channel for communication. | 84 | * Channel for communication. |
85 | */ | 85 | */ |
86 | struct GNUNET_MESH_Channel *channel; | 86 | struct GNUNET_CADET_Channel *channel; |
87 | 87 | ||
88 | /** | 88 | /** |
89 | * Handle for active write operation, or NULL. | 89 | * Handle for active write operation, or NULL. |
90 | */ | 90 | */ |
91 | struct GNUNET_MESH_TransmitHandle *wh; | 91 | struct GNUNET_CADET_TransmitHandle *wh; |
92 | 92 | ||
93 | /** | 93 | /** |
94 | * Head of write queue. | 94 | * Head of write queue. |
@@ -126,65 +126,65 @@ struct MeshClient | |||
126 | /** | 126 | /** |
127 | * Listen channel for incoming requests. | 127 | * Listen channel for incoming requests. |
128 | */ | 128 | */ |
129 | static struct GNUNET_MESH_Handle *listen_channel; | 129 | static struct GNUNET_CADET_Handle *listen_channel; |
130 | 130 | ||
131 | /** | 131 | /** |
132 | * Head of DLL of mesh clients. | 132 | * Head of DLL of cadet clients. |
133 | */ | 133 | */ |
134 | static struct MeshClient *sc_head; | 134 | static struct CadetClient *sc_head; |
135 | 135 | ||
136 | /** | 136 | /** |
137 | * Tail of DLL of mesh clients. | 137 | * Tail of DLL of cadet clients. |
138 | */ | 138 | */ |
139 | static struct MeshClient *sc_tail; | 139 | static struct CadetClient *sc_tail; |
140 | 140 | ||
141 | /** | 141 | /** |
142 | * Number of active mesh clients in the 'sc_*'-DLL. | 142 | * Number of active cadet clients in the 'sc_*'-DLL. |
143 | */ | 143 | */ |
144 | static unsigned int sc_count; | 144 | static unsigned int sc_count; |
145 | 145 | ||
146 | /** | 146 | /** |
147 | * Maximum allowed number of mesh clients. | 147 | * Maximum allowed number of cadet clients. |
148 | */ | 148 | */ |
149 | static unsigned long long sc_count_max; | 149 | static unsigned long long sc_count_max; |
150 | 150 | ||
151 | 151 | ||
152 | 152 | ||
153 | /** | 153 | /** |
154 | * Task run to asynchronously terminate the mesh due to timeout. | 154 | * Task run to asynchronously terminate the cadet due to timeout. |
155 | * | 155 | * |
156 | * @param cls the 'struct MeshClient' | 156 | * @param cls the 'struct CadetClient' |
157 | * @param tc scheduler context | 157 | * @param tc scheduler context |
158 | */ | 158 | */ |
159 | static void | 159 | static void |
160 | timeout_mesh_task (void *cls, | 160 | timeout_cadet_task (void *cls, |
161 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 161 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
162 | { | 162 | { |
163 | struct MeshClient *sc = cls; | 163 | struct CadetClient *sc = cls; |
164 | struct GNUNET_MESH_Channel *tun; | 164 | struct GNUNET_CADET_Channel *tun; |
165 | 165 | ||
166 | sc->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 166 | sc->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
167 | tun = sc->channel; | 167 | tun = sc->channel; |
168 | sc->channel = NULL; | 168 | sc->channel = NULL; |
169 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 169 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
170 | "Timeout for inactive mesh client %p\n", | 170 | "Timeout for inactive cadet client %p\n", |
171 | sc); | 171 | sc); |
172 | GNUNET_MESH_channel_destroy (tun); | 172 | GNUNET_CADET_channel_destroy (tun); |
173 | } | 173 | } |
174 | 174 | ||
175 | 175 | ||
176 | /** | 176 | /** |
177 | * Reset the timeout for the mesh client (due to activity). | 177 | * Reset the timeout for the cadet client (due to activity). |
178 | * | 178 | * |
179 | * @param sc client handle to reset timeout for | 179 | * @param sc client handle to reset timeout for |
180 | */ | 180 | */ |
181 | static void | 181 | static void |
182 | refresh_timeout_task (struct MeshClient *sc) | 182 | refresh_timeout_task (struct CadetClient *sc) |
183 | { | 183 | { |
184 | if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task) | 184 | if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task) |
185 | GNUNET_SCHEDULER_cancel (sc->timeout_task); | 185 | GNUNET_SCHEDULER_cancel (sc->timeout_task); |
186 | sc->timeout_task = GNUNET_SCHEDULER_add_delayed (IDLE_TIMEOUT, | 186 | sc->timeout_task = GNUNET_SCHEDULER_add_delayed (IDLE_TIMEOUT, |
187 | &timeout_mesh_task, | 187 | &timeout_cadet_task, |
188 | sc); | 188 | sc); |
189 | } | 189 | } |
190 | 190 | ||
@@ -195,13 +195,13 @@ refresh_timeout_task (struct MeshClient *sc) | |||
195 | * @param sc client to continue reading requests from | 195 | * @param sc client to continue reading requests from |
196 | */ | 196 | */ |
197 | static void | 197 | static void |
198 | continue_reading (struct MeshClient *sc) | 198 | continue_reading (struct CadetClient *sc) |
199 | { | 199 | { |
200 | refresh_timeout_task (sc); | 200 | refresh_timeout_task (sc); |
201 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 201 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
202 | "Finished processing mesh request from client %p, ready to receive the next one\n", | 202 | "Finished processing cadet request from client %p, ready to receive the next one\n", |
203 | sc); | 203 | sc); |
204 | GNUNET_MESH_receive_done (sc->channel); | 204 | GNUNET_CADET_receive_done (sc->channel); |
205 | } | 205 | } |
206 | 206 | ||
207 | 207 | ||
@@ -211,13 +211,13 @@ continue_reading (struct MeshClient *sc) | |||
211 | * @param sc where to process the write queue | 211 | * @param sc where to process the write queue |
212 | */ | 212 | */ |
213 | static void | 213 | static void |
214 | continue_writing (struct MeshClient *sc); | 214 | continue_writing (struct CadetClient *sc); |
215 | 215 | ||
216 | 216 | ||
217 | /** | 217 | /** |
218 | * Send a reply now, mesh is ready. | 218 | * Send a reply now, cadet is ready. |
219 | * | 219 | * |
220 | * @param cls closure with the `struct MeshClient` which sent the query | 220 | * @param cls closure with the `struct CadetClient` which sent the query |
221 | * @param size number of bytes available in @a buf | 221 | * @param size number of bytes available in @a buf |
222 | * @param buf where to write the message | 222 | * @param buf where to write the message |
223 | * @return number of bytes written to @a buf | 223 | * @return number of bytes written to @a buf |
@@ -227,8 +227,8 @@ write_continuation (void *cls, | |||
227 | size_t size, | 227 | size_t size, |
228 | void *buf) | 228 | void *buf) |
229 | { | 229 | { |
230 | struct MeshClient *sc = cls; | 230 | struct CadetClient *sc = cls; |
231 | struct GNUNET_MESH_Channel *tun; | 231 | struct GNUNET_CADET_Channel *tun; |
232 | struct WriteQueueItem *wqi; | 232 | struct WriteQueueItem *wqi; |
233 | size_t ret; | 233 | size_t ret; |
234 | 234 | ||
@@ -243,21 +243,21 @@ write_continuation (void *cls, | |||
243 | (size < wqi->msize) ) | 243 | (size < wqi->msize) ) |
244 | { | 244 | { |
245 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 245 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
246 | "Transmission of reply failed, terminating mesh\n"); | 246 | "Transmission of reply failed, terminating cadet\n"); |
247 | tun = sc->channel; | 247 | tun = sc->channel; |
248 | sc->channel = NULL; | 248 | sc->channel = NULL; |
249 | GNUNET_MESH_channel_destroy (tun); | 249 | GNUNET_CADET_channel_destroy (tun); |
250 | return 0; | 250 | return 0; |
251 | } | 251 | } |
252 | GNUNET_CONTAINER_DLL_remove (sc->wqi_head, | 252 | GNUNET_CONTAINER_DLL_remove (sc->wqi_head, |
253 | sc->wqi_tail, | 253 | sc->wqi_tail, |
254 | wqi); | 254 | wqi); |
255 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 255 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
256 | "Transmitted %u byte reply via mesh to %p\n", | 256 | "Transmitted %u byte reply via cadet to %p\n", |
257 | (unsigned int) size, | 257 | (unsigned int) size, |
258 | sc); | 258 | sc); |
259 | GNUNET_STATISTICS_update (GSF_stats, | 259 | GNUNET_STATISTICS_update (GSF_stats, |
260 | gettext_noop ("# Blocks transferred via mesh"), 1, | 260 | gettext_noop ("# Blocks transferred via cadet"), 1, |
261 | GNUNET_NO); | 261 | GNUNET_NO); |
262 | memcpy (buf, &wqi[1], ret = wqi->msize); | 262 | memcpy (buf, &wqi[1], ret = wqi->msize); |
263 | GNUNET_free (wqi); | 263 | GNUNET_free (wqi); |
@@ -272,10 +272,10 @@ write_continuation (void *cls, | |||
272 | * @param sc where to process the write queue | 272 | * @param sc where to process the write queue |
273 | */ | 273 | */ |
274 | static void | 274 | static void |
275 | continue_writing (struct MeshClient *sc) | 275 | continue_writing (struct CadetClient *sc) |
276 | { | 276 | { |
277 | struct WriteQueueItem *wqi; | 277 | struct WriteQueueItem *wqi; |
278 | struct GNUNET_MESH_Channel *tun; | 278 | struct GNUNET_CADET_Channel *tun; |
279 | 279 | ||
280 | if (NULL != sc->wh) | 280 | if (NULL != sc->wh) |
281 | { | 281 | { |
@@ -290,7 +290,7 @@ continue_writing (struct MeshClient *sc) | |||
290 | continue_reading (sc); | 290 | continue_reading (sc); |
291 | return; | 291 | return; |
292 | } | 292 | } |
293 | sc->wh = GNUNET_MESH_notify_transmit_ready (sc->channel, GNUNET_NO, | 293 | sc->wh = GNUNET_CADET_notify_transmit_ready (sc->channel, GNUNET_NO, |
294 | GNUNET_TIME_UNIT_FOREVER_REL, | 294 | GNUNET_TIME_UNIT_FOREVER_REL, |
295 | wqi->msize, | 295 | wqi->msize, |
296 | &write_continuation, | 296 | &write_continuation, |
@@ -298,10 +298,10 @@ continue_writing (struct MeshClient *sc) | |||
298 | if (NULL == sc->wh) | 298 | if (NULL == sc->wh) |
299 | { | 299 | { |
300 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 300 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
301 | "Write failed; terminating mesh\n"); | 301 | "Write failed; terminating cadet\n"); |
302 | tun = sc->channel; | 302 | tun = sc->channel; |
303 | sc->channel = NULL; | 303 | sc->channel = NULL; |
304 | GNUNET_MESH_channel_destroy (tun); | 304 | GNUNET_CADET_channel_destroy (tun); |
305 | return; | 305 | return; |
306 | } | 306 | } |
307 | } | 307 | } |
@@ -310,7 +310,7 @@ continue_writing (struct MeshClient *sc) | |||
310 | /** | 310 | /** |
311 | * Process a datum that was stored in the datastore. | 311 | * Process a datum that was stored in the datastore. |
312 | * | 312 | * |
313 | * @param cls closure with the `struct MeshClient` which sent the query | 313 | * @param cls closure with the `struct CadetClient` which sent the query |
314 | * @param key key for the content | 314 | * @param key key for the content |
315 | * @param size number of bytes in @a data | 315 | * @param size number of bytes in @a data |
316 | * @param data content stored | 316 | * @param data content stored |
@@ -331,10 +331,10 @@ handle_datastore_reply (void *cls, | |||
331 | struct GNUNET_TIME_Absolute expiration, | 331 | struct GNUNET_TIME_Absolute expiration, |
332 | uint64_t uid) | 332 | uint64_t uid) |
333 | { | 333 | { |
334 | struct MeshClient *sc = cls; | 334 | struct CadetClient *sc = cls; |
335 | size_t msize = size + sizeof (struct MeshReplyMessage); | 335 | size_t msize = size + sizeof (struct CadetReplyMessage); |
336 | struct WriteQueueItem *wqi; | 336 | struct WriteQueueItem *wqi; |
337 | struct MeshReplyMessage *srm; | 337 | struct CadetReplyMessage *srm; |
338 | 338 | ||
339 | sc->qe = NULL; | 339 | sc->qe = NULL; |
340 | if (NULL == data) | 340 | if (NULL == data) |
@@ -349,7 +349,7 @@ handle_datastore_reply (void *cls, | |||
349 | "Have no answer for query `%s'\n", | 349 | "Have no answer for query `%s'\n", |
350 | GNUNET_h2s (key)); | 350 | GNUNET_h2s (key)); |
351 | GNUNET_STATISTICS_update (GSF_stats, | 351 | GNUNET_STATISTICS_update (GSF_stats, |
352 | gettext_noop ("# queries received via mesh not answered"), 1, | 352 | gettext_noop ("# queries received via cadet not answered"), 1, |
353 | GNUNET_NO); | 353 | GNUNET_NO); |
354 | continue_writing (sc); | 354 | continue_writing (sc); |
355 | return; | 355 | return; |
@@ -381,16 +381,16 @@ handle_datastore_reply (void *cls, | |||
381 | } | 381 | } |
382 | GNUNET_break (GNUNET_BLOCK_TYPE_ANY != type); | 382 | GNUNET_break (GNUNET_BLOCK_TYPE_ANY != type); |
383 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 383 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
384 | "Starting transmission of %u byte reply of type %d for query `%s' via mesh to %p\n", | 384 | "Starting transmission of %u byte reply of type %d for query `%s' via cadet to %p\n", |
385 | (unsigned int) size, | 385 | (unsigned int) size, |
386 | (unsigned int) type, | 386 | (unsigned int) type, |
387 | GNUNET_h2s (key), | 387 | GNUNET_h2s (key), |
388 | sc); | 388 | sc); |
389 | wqi = GNUNET_malloc (sizeof (struct WriteQueueItem) + msize); | 389 | wqi = GNUNET_malloc (sizeof (struct WriteQueueItem) + msize); |
390 | wqi->msize = msize; | 390 | wqi->msize = msize; |
391 | srm = (struct MeshReplyMessage *) &wqi[1]; | 391 | srm = (struct CadetReplyMessage *) &wqi[1]; |
392 | srm->header.size = htons ((uint16_t) msize); | 392 | srm->header.size = htons ((uint16_t) msize); |
393 | srm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_MESH_REPLY); | 393 | srm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_CADET_REPLY); |
394 | srm->type = htonl (type); | 394 | srm->type = htonl (type); |
395 | srm->expiration = GNUNET_TIME_absolute_hton (expiration); | 395 | srm->expiration = GNUNET_TIME_absolute_hton (expiration); |
396 | memcpy (&srm[1], data, size); | 396 | memcpy (&srm[1], data, size); |
@@ -408,7 +408,7 @@ handle_datastore_reply (void *cls, | |||
408 | * | 408 | * |
409 | * Do not call #GNUNET_SERVER_mst_destroy in callback | 409 | * Do not call #GNUNET_SERVER_mst_destroy in callback |
410 | * | 410 | * |
411 | * @param cls closure with the 'struct MeshClient' | 411 | * @param cls closure with the 'struct CadetClient' |
412 | * @param channel channel handle | 412 | * @param channel channel handle |
413 | * @param channel_ctx channel context | 413 | * @param channel_ctx channel context |
414 | * @param message the actual message | 414 | * @param message the actual message |
@@ -416,20 +416,20 @@ handle_datastore_reply (void *cls, | |||
416 | */ | 416 | */ |
417 | static int | 417 | static int |
418 | request_cb (void *cls, | 418 | request_cb (void *cls, |
419 | struct GNUNET_MESH_Channel *channel, | 419 | struct GNUNET_CADET_Channel *channel, |
420 | void **channel_ctx, | 420 | void **channel_ctx, |
421 | const struct GNUNET_MessageHeader *message) | 421 | const struct GNUNET_MessageHeader *message) |
422 | { | 422 | { |
423 | struct MeshClient *sc = *channel_ctx; | 423 | struct CadetClient *sc = *channel_ctx; |
424 | const struct MeshQueryMessage *sqm; | 424 | const struct CadetQueryMessage *sqm; |
425 | 425 | ||
426 | sqm = (const struct MeshQueryMessage *) message; | 426 | sqm = (const struct CadetQueryMessage *) message; |
427 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 427 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
428 | "Received query for `%s' via mesh from client %p\n", | 428 | "Received query for `%s' via cadet from client %p\n", |
429 | GNUNET_h2s (&sqm->query), | 429 | GNUNET_h2s (&sqm->query), |
430 | sc); | 430 | sc); |
431 | GNUNET_STATISTICS_update (GSF_stats, | 431 | GNUNET_STATISTICS_update (GSF_stats, |
432 | gettext_noop ("# queries received via mesh"), 1, | 432 | gettext_noop ("# queries received via cadet"), 1, |
433 | GNUNET_NO); | 433 | GNUNET_NO); |
434 | refresh_timeout_task (sc); | 434 | refresh_timeout_task (sc); |
435 | sc->qe = GNUNET_DATASTORE_get_key (GSF_dsh, | 435 | sc->qe = GNUNET_DATASTORE_get_key (GSF_dsh, |
@@ -451,37 +451,37 @@ request_cb (void *cls, | |||
451 | 451 | ||
452 | 452 | ||
453 | /** | 453 | /** |
454 | * Functions of this type are called upon new mesh connection from other peers. | 454 | * Functions of this type are called upon new cadet connection from other peers. |
455 | * | 455 | * |
456 | * @param cls the closure from GNUNET_MESH_connect | 456 | * @param cls the closure from GNUNET_CADET_connect |
457 | * @param channel the channel representing the mesh | 457 | * @param channel the channel representing the cadet |
458 | * @param initiator the identity of the peer who wants to establish a mesh | 458 | * @param initiator the identity of the peer who wants to establish a cadet |
459 | * with us; NULL on binding error | 459 | * with us; NULL on binding error |
460 | * @param port mesh port used for the incoming connection | 460 | * @param port cadet port used for the incoming connection |
461 | * @param options channel option flags | 461 | * @param options channel option flags |
462 | * @return initial channel context (our 'struct MeshClient') | 462 | * @return initial channel context (our 'struct CadetClient') |
463 | */ | 463 | */ |
464 | static void * | 464 | static void * |
465 | accept_cb (void *cls, | 465 | accept_cb (void *cls, |
466 | struct GNUNET_MESH_Channel *channel, | 466 | struct GNUNET_CADET_Channel *channel, |
467 | const struct GNUNET_PeerIdentity *initiator, | 467 | const struct GNUNET_PeerIdentity *initiator, |
468 | uint32_t port, enum GNUNET_MESH_ChannelOption options) | 468 | uint32_t port, enum GNUNET_CADET_ChannelOption options) |
469 | { | 469 | { |
470 | struct MeshClient *sc; | 470 | struct CadetClient *sc; |
471 | 471 | ||
472 | GNUNET_assert (NULL != channel); | 472 | GNUNET_assert (NULL != channel); |
473 | if (sc_count >= sc_count_max) | 473 | if (sc_count >= sc_count_max) |
474 | { | 474 | { |
475 | GNUNET_STATISTICS_update (GSF_stats, | 475 | GNUNET_STATISTICS_update (GSF_stats, |
476 | gettext_noop ("# mesh client connections rejected"), 1, | 476 | gettext_noop ("# cadet client connections rejected"), 1, |
477 | GNUNET_NO); | 477 | GNUNET_NO); |
478 | GNUNET_MESH_channel_destroy (channel); | 478 | GNUNET_CADET_channel_destroy (channel); |
479 | return NULL; | 479 | return NULL; |
480 | } | 480 | } |
481 | GNUNET_STATISTICS_update (GSF_stats, | 481 | GNUNET_STATISTICS_update (GSF_stats, |
482 | gettext_noop ("# mesh connections active"), 1, | 482 | gettext_noop ("# cadet connections active"), 1, |
483 | GNUNET_NO); | 483 | GNUNET_NO); |
484 | sc = GNUNET_new (struct MeshClient); | 484 | sc = GNUNET_new (struct CadetClient); |
485 | sc->channel = channel; | 485 | sc->channel = channel; |
486 | GNUNET_CONTAINER_DLL_insert (sc_head, | 486 | GNUNET_CONTAINER_DLL_insert (sc_head, |
487 | sc_tail, | 487 | sc_tail, |
@@ -489,7 +489,7 @@ accept_cb (void *cls, | |||
489 | sc_count++; | 489 | sc_count++; |
490 | refresh_timeout_task (sc); | 490 | refresh_timeout_task (sc); |
491 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 491 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
492 | "Accepting inbound mesh connection from `%s' as client %p\n", | 492 | "Accepting inbound cadet connection from `%s' as client %p\n", |
493 | GNUNET_i2s (initiator), | 493 | GNUNET_i2s (initiator), |
494 | sc); | 494 | sc); |
495 | return sc; | 495 | return sc; |
@@ -497,36 +497,36 @@ accept_cb (void *cls, | |||
497 | 497 | ||
498 | 498 | ||
499 | /** | 499 | /** |
500 | * Function called by mesh when a client disconnects. | 500 | * Function called by cadet when a client disconnects. |
501 | * Cleans up our 'struct MeshClient' of that channel. | 501 | * Cleans up our 'struct CadetClient' of that channel. |
502 | * | 502 | * |
503 | * @param cls NULL | 503 | * @param cls NULL |
504 | * @param channel channel of the disconnecting client | 504 | * @param channel channel of the disconnecting client |
505 | * @param channel_ctx our 'struct MeshClient' | 505 | * @param channel_ctx our 'struct CadetClient' |
506 | */ | 506 | */ |
507 | static void | 507 | static void |
508 | cleaner_cb (void *cls, | 508 | cleaner_cb (void *cls, |
509 | const struct GNUNET_MESH_Channel *channel, | 509 | const struct GNUNET_CADET_Channel *channel, |
510 | void *channel_ctx) | 510 | void *channel_ctx) |
511 | { | 511 | { |
512 | struct MeshClient *sc = channel_ctx; | 512 | struct CadetClient *sc = channel_ctx; |
513 | struct WriteQueueItem *wqi; | 513 | struct WriteQueueItem *wqi; |
514 | 514 | ||
515 | if (NULL == sc) | 515 | if (NULL == sc) |
516 | return; | 516 | return; |
517 | sc->channel = NULL; | 517 | sc->channel = NULL; |
518 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 518 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
519 | "Terminating mesh connection with client %p\n", | 519 | "Terminating cadet connection with client %p\n", |
520 | sc); | 520 | sc); |
521 | GNUNET_STATISTICS_update (GSF_stats, | 521 | GNUNET_STATISTICS_update (GSF_stats, |
522 | gettext_noop ("# mesh connections active"), -1, | 522 | gettext_noop ("# cadet connections active"), -1, |
523 | GNUNET_NO); | 523 | GNUNET_NO); |
524 | if (GNUNET_SCHEDULER_NO_TASK != sc->terminate_task) | 524 | if (GNUNET_SCHEDULER_NO_TASK != sc->terminate_task) |
525 | GNUNET_SCHEDULER_cancel (sc->terminate_task); | 525 | GNUNET_SCHEDULER_cancel (sc->terminate_task); |
526 | if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task) | 526 | if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task) |
527 | GNUNET_SCHEDULER_cancel (sc->timeout_task); | 527 | GNUNET_SCHEDULER_cancel (sc->timeout_task); |
528 | if (NULL != sc->wh) | 528 | if (NULL != sc->wh) |
529 | GNUNET_MESH_notify_transmit_ready_cancel (sc->wh); | 529 | GNUNET_CADET_notify_transmit_ready_cancel (sc->wh); |
530 | if (NULL != sc->qe) | 530 | if (NULL != sc->qe) |
531 | GNUNET_DATASTORE_cancel (sc->qe); | 531 | GNUNET_DATASTORE_cancel (sc->qe); |
532 | while (NULL != (wqi = sc->wqi_head)) | 532 | while (NULL != (wqi = sc->wqi_head)) |
@@ -548,10 +548,10 @@ cleaner_cb (void *cls, | |||
548 | * Initialize subsystem for non-anonymous file-sharing. | 548 | * Initialize subsystem for non-anonymous file-sharing. |
549 | */ | 549 | */ |
550 | void | 550 | void |
551 | GSF_mesh_start_server () | 551 | GSF_cadet_start_server () |
552 | { | 552 | { |
553 | static const struct GNUNET_MESH_MessageHandler handlers[] = { | 553 | static const struct GNUNET_CADET_MessageHandler handlers[] = { |
554 | { &request_cb, GNUNET_MESSAGE_TYPE_FS_MESH_QUERY, sizeof (struct MeshQueryMessage)}, | 554 | { &request_cb, GNUNET_MESSAGE_TYPE_FS_CADET_QUERY, sizeof (struct CadetQueryMessage)}, |
555 | { NULL, 0, 0 } | 555 | { NULL, 0, 0 } |
556 | }; | 556 | }; |
557 | static const uint32_t ports[] = { | 557 | static const uint32_t ports[] = { |
@@ -562,13 +562,13 @@ GSF_mesh_start_server () | |||
562 | if (GNUNET_YES != | 562 | if (GNUNET_YES != |
563 | GNUNET_CONFIGURATION_get_value_number (GSF_cfg, | 563 | GNUNET_CONFIGURATION_get_value_number (GSF_cfg, |
564 | "fs", | 564 | "fs", |
565 | "MAX_MESH_CLIENTS", | 565 | "MAX_CADET_CLIENTS", |
566 | &sc_count_max)) | 566 | &sc_count_max)) |
567 | return; | 567 | return; |
568 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 568 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
569 | "Initializing mesh FS server with a limit of %llu connections\n", | 569 | "Initializing cadet FS server with a limit of %llu connections\n", |
570 | sc_count_max); | 570 | sc_count_max); |
571 | listen_channel = GNUNET_MESH_connect (GSF_cfg, | 571 | listen_channel = GNUNET_CADET_connect (GSF_cfg, |
572 | NULL, | 572 | NULL, |
573 | &accept_cb, | 573 | &accept_cb, |
574 | &cleaner_cb, | 574 | &cleaner_cb, |
@@ -581,15 +581,15 @@ GSF_mesh_start_server () | |||
581 | * Shutdown subsystem for non-anonymous file-sharing. | 581 | * Shutdown subsystem for non-anonymous file-sharing. |
582 | */ | 582 | */ |
583 | void | 583 | void |
584 | GSF_mesh_stop_server () | 584 | GSF_cadet_stop_server () |
585 | { | 585 | { |
586 | if (NULL != listen_channel) | 586 | if (NULL != listen_channel) |
587 | { | 587 | { |
588 | GNUNET_MESH_disconnect (listen_channel); | 588 | GNUNET_CADET_disconnect (listen_channel); |
589 | listen_channel = NULL; | 589 | listen_channel = NULL; |
590 | } | 590 | } |
591 | GNUNET_assert (NULL == sc_head); | 591 | GNUNET_assert (NULL == sc_head); |
592 | GNUNET_assert (0 == sc_count); | 592 | GNUNET_assert (0 == sc_count); |
593 | } | 593 | } |
594 | 594 | ||
595 | /* end of gnunet-service-fs_mesh.c */ | 595 | /* end of gnunet-service-fs_cadet.c */ |