aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_dht.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-05-14 16:50:28 +0000
committerBart Polot <bart@net.in.tum.de>2014-05-14 16:50:28 +0000
commit9aaa554470dbff968c6cab7a2850a15318c1f15b (patch)
tree2375634ba53d0dd0bd7bbc674bb3b1eb28f42742 /src/cadet/gnunet-service-cadet_dht.c
parenta8a95437e8782ef509fb64e1975a8c1ddd08eee0 (diff)
downloadgnunet-9aaa554470dbff968c6cab7a2850a15318c1f15b.tar.gz
gnunet-9aaa554470dbff968c6cab7a2850a15318c1f15b.zip
- change GM (Gnunet Mesh) function prefixes for GC (Gnunet Cadet)
Diffstat (limited to 'src/cadet/gnunet-service-cadet_dht.c')
-rw-r--r--src/cadet/gnunet-service-cadet_dht.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/cadet/gnunet-service-cadet_dht.c b/src/cadet/gnunet-service-cadet_dht.c
index b187e3cd9..7d31603df 100644
--- a/src/cadet/gnunet-service-cadet_dht.c
+++ b/src/cadet/gnunet-service-cadet_dht.c
@@ -40,13 +40,13 @@
40/** 40/**
41 * Handle for DHT searches. 41 * Handle for DHT searches.
42 */ 42 */
43struct GMD_search_handle 43struct GCD_search_handle
44{ 44{
45 /** DHT_GET handle. */ 45 /** DHT_GET handle. */
46 struct GNUNET_DHT_GetHandle *dhtget; 46 struct GNUNET_DHT_GetHandle *dhtget;
47 47
48 /** Provided callback to call when a path is found. */ 48 /** Provided callback to call when a path is found. */
49 GMD_search_callback callback; 49 GCD_search_callback callback;
50 50
51 /** Provided closure. */ 51 /** Provided closure. */
52 void *cls; 52 void *cls;
@@ -219,7 +219,7 @@ dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp,
219 unsigned int put_path_length, enum GNUNET_BLOCK_Type type, 219 unsigned int put_path_length, enum GNUNET_BLOCK_Type type,
220 size_t size, const void *data) 220 size_t size, const void *data)
221{ 221{
222 struct GMD_search_handle *h = cls; 222 struct GCD_search_handle *h = cls;
223 struct GNUNET_HELLO_Message *hello; 223 struct GNUNET_HELLO_Message *hello;
224 struct CadetPeerPath *p; 224 struct CadetPeerPath *p;
225 struct CadetPeer *peer; 225 struct CadetPeer *peer;
@@ -230,13 +230,13 @@ dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp,
230 s = path_2s (p); 230 s = path_2s (p);
231 LOG (GNUNET_ERROR_TYPE_INFO, "Got path from DHT: %s\n", s); 231 LOG (GNUNET_ERROR_TYPE_INFO, "Got path from DHT: %s\n", s);
232 GNUNET_free_non_null (s); 232 GNUNET_free_non_null (s);
233 peer = GMP_get_short (p->peers[p->length - 1]); 233 peer = GCP_get_short (p->peers[p->length - 1]);
234 LOG (GNUNET_ERROR_TYPE_DEBUG, "Got HELLO for %s\n", GMP_2s (peer)); 234 LOG (GNUNET_ERROR_TYPE_DEBUG, "Got HELLO for %s\n", GCP_2s (peer));
235 h->callback (h->cls, p); 235 h->callback (h->cls, p);
236 path_destroy (p); 236 path_destroy (p);
237 hello = (struct GNUNET_HELLO_Message *) data; 237 hello = (struct GNUNET_HELLO_Message *) data;
238 GMP_set_hello (peer, hello); 238 GCP_set_hello (peer, hello);
239 GMP_try_connect (peer); 239 GCP_try_connect (peer);
240 return; 240 return;
241} 241}
242 242
@@ -267,7 +267,7 @@ announce_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
267 * - Set data expiration in function of X 267 * - Set data expiration in function of X
268 * - Adapt X to churn 268 * - Adapt X to churn
269 */ 269 */
270 hello = GMH_get_mine (); 270 hello = GCH_get_mine ();
271 if (NULL == hello || (size = GNUNET_HELLO_size (hello)) == 0) 271 if (NULL == hello || (size = GNUNET_HELLO_size (hello)) == 0)
272 { 272 {
273 /* Peerinfo gave us no hello yet, try again in a second. */ 273 /* Peerinfo gave us no hello yet, try again in a second. */
@@ -304,7 +304,7 @@ announce_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
304 * 304 *
305 * @param cls Closure (unused) 305 * @param cls Closure (unused)
306 * @param key Current peer ID. 306 * @param key Current peer ID.
307 * @param value Value in the hash map (GMD_search_handle). 307 * @param value Value in the hash map (GCD_search_handle).
308 * 308 *
309 * @return #GNUNET_YES, we should continue to iterate, 309 * @return #GNUNET_YES, we should continue to iterate,
310 */ 310 */
@@ -313,9 +313,9 @@ stop_get (void *cls,
313 uint32_t key, 313 uint32_t key,
314 void *value) 314 void *value)
315{ 315{
316 struct GMD_search_handle *h = value; 316 struct GCD_search_handle *h = value;
317 317
318 GMD_search_stop (h); 318 GCD_search_stop (h);
319 return GNUNET_YES; 319 return GNUNET_YES;
320} 320}
321 321
@@ -330,7 +330,7 @@ stop_get (void *cls,
330 * @param c Configuration. 330 * @param c Configuration.
331 */ 331 */
332void 332void
333GMD_init (const struct GNUNET_CONFIGURATION_Handle *c) 333GCD_init (const struct GNUNET_CONFIGURATION_Handle *c)
334{ 334{
335 LOG (GNUNET_ERROR_TYPE_DEBUG, "init\n"); 335 LOG (GNUNET_ERROR_TYPE_DEBUG, "init\n");
336 if (GNUNET_OK != 336 if (GNUNET_OK !=
@@ -367,7 +367,7 @@ GMD_init (const struct GNUNET_CONFIGURATION_Handle *c)
367 * Shut down the DHT subsystem. 367 * Shut down the DHT subsystem.
368 */ 368 */
369void 369void
370GMD_shutdown (void) 370GCD_shutdown (void)
371{ 371{
372 GNUNET_CONTAINER_multihashmap32_iterate (get_requests, &stop_get, NULL); 372 GNUNET_CONTAINER_multihashmap32_iterate (get_requests, &stop_get, NULL);
373 GNUNET_CONTAINER_multihashmap32_destroy (get_requests); 373 GNUNET_CONTAINER_multihashmap32_destroy (get_requests);
@@ -383,18 +383,18 @@ GMD_shutdown (void)
383 } 383 }
384} 384}
385 385
386struct GMD_search_handle * 386struct GCD_search_handle *
387GMD_search (const struct GNUNET_PeerIdentity *peer_id, 387GCD_search (const struct GNUNET_PeerIdentity *peer_id,
388 GMD_search_callback callback, void *cls) 388 GCD_search_callback callback, void *cls)
389{ 389{
390 struct GNUNET_HashCode phash; 390 struct GNUNET_HashCode phash;
391 struct GMD_search_handle *h; 391 struct GCD_search_handle *h;
392 392
393 LOG (GNUNET_ERROR_TYPE_DEBUG, 393 LOG (GNUNET_ERROR_TYPE_DEBUG,
394 " Starting DHT GET for peer %s\n", GNUNET_i2s (peer_id)); 394 " Starting DHT GET for peer %s\n", GNUNET_i2s (peer_id));
395 memset (&phash, 0, sizeof (phash)); 395 memset (&phash, 0, sizeof (phash));
396 memcpy (&phash, peer_id, sizeof (*peer_id)); 396 memcpy (&phash, peer_id, sizeof (*peer_id));
397 h = GNUNET_new (struct GMD_search_handle); 397 h = GNUNET_new (struct GCD_search_handle);
398 h->peer_id = GNUNET_PEER_intern (peer_id); 398 h->peer_id = GNUNET_PEER_intern (peer_id);
399 h->callback = callback; 399 h->callback = callback;
400 h->cls = cls; 400 h->cls = cls;
@@ -413,7 +413,7 @@ GMD_search (const struct GNUNET_PeerIdentity *peer_id,
413} 413}
414 414
415void 415void
416GMD_search_stop (struct GMD_search_handle *h) 416GCD_search_stop (struct GCD_search_handle *h)
417{ 417{
418 GNUNET_break (GNUNET_OK == 418 GNUNET_break (GNUNET_OK ==
419 GNUNET_CONTAINER_multihashmap32_remove (get_requests, 419 GNUNET_CONTAINER_multihashmap32_remove (get_requests,