aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-01-16 14:01:23 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-19 12:41:01 +0100
commit8ca9b2754d10419c9d8c041549d5747ec482b83a (patch)
tree5b6f8b46a419c58780ba09a9e9b6d38ef5647a98 /src/include
parenta98b548418bd0dcb8882ef913bcc2fbb516e0f2c (diff)
downloadgnunet-8ca9b2754d10419c9d8c041549d5747ec482b83a.tar.gz
gnunet-8ca9b2754d10419c9d8c041549d5747ec482b83a.zip
-DHT: add gnunet-dht-hello for bootstrapping
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_dht_service.h57
-rw-r--r--src/include/gnunet_protocols.h15
2 files changed, 70 insertions, 2 deletions
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h
index abe5a03e4..e0f9f6fc3 100644
--- a/src/include/gnunet_dht_service.h
+++ b/src/include/gnunet_dht_service.h
@@ -512,6 +512,63 @@ GNUNET_DHT_verify_path (const struct GNUNET_HashCode *key,
512 const struct GNUNET_PeerIdentity *me); 512 const struct GNUNET_PeerIdentity *me);
513 513
514 514
515/**
516 * Handle to get a HELLO URL from the DHT for manual bootstrapping.
517 */
518struct GNUNET_DHT_HelloGetHandle;
519
520
521/**
522 * Signature called with the result of a HELLO GET operation.
523 *
524 * @param cls closure
525 * @param hello_url the resulting HELLO URL, NULL on error
526 */
527typedef void
528(*GNUNET_DHT_HelloGetCallback)(void *cls,
529 const char *hello_url);
530
531
532/**
533 * Obtain HELLO URL of the DHT identified by @a dht_handle.
534 *
535 * @param dht_handle DHT to query
536 * @param cb function to call with the result
537 * @param cb_cls closure for @a cb
538 * @return NULL on failure
539 */
540struct GNUNET_DHT_HelloGetHandle *
541GNUNET_DHT_hello_get (struct GNUNET_DHT_Handle *dht_handle,
542 GNUNET_DHT_HelloGetCallback cb,
543 void *cb_cls);
544
545
546/**
547 * Cancel hello get operation.
548 *
549 * @param[in] hgh operation to cancel.
550 */
551void
552GNUNET_DHT_hello_get_cancel (struct GNUNET_DHT_HelloGetHandle *hgh);
553
554
555/**
556 * Offer HELLO URL of the DHT identified by @a dht_handle.
557 * Callback may be invoked once, only way to cancel is to
558 * disconnect @a dht_handle.
559 *
560 * @param dht_handle DHT to query
561 * @param url URL with a HELLO to offer to the DHT
562 * @param cb function called when done
563 * @param cb_cls closure for @a cb
564 */
565void
566GNUNET_DHT_hello_offer (struct GNUNET_DHT_Handle *dht_handle,
567 const char *url,
568 GNUNET_SCHEDULER_TaskCallback cb,
569 void *cb_cls);
570
571
515#if 0 /* keep Emacsens' auto-indent happy */ 572#if 0 /* keep Emacsens' auto-indent happy */
516{ 573{
517#endif 574#endif
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index cddacc8a6..f2892e125 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -665,9 +665,20 @@ extern "C" {
665#define GNUNET_MESSAGE_TYPE_DHT_P2P_HELLO 157 665#define GNUNET_MESSAGE_TYPE_DHT_P2P_HELLO 157
666 666
667/** 667/**
668 * DHT wants to use CORE to transmit data. 668 * Encapsulation of DHT messages in CORE service.
669 */ 669 */
670#define GNUNET_MESSAGE_TYPE_DHT_CORE 143 670#define GNUNET_MESSAGE_TYPE_DHT_CORE 158
671
672/**
673 * HELLO URL send between client and service (in
674 * either direction).
675 */
676#define GNUNET_MESSAGE_TYPE_DHT_CLIENT_HELLO_URL 159
677
678/**
679 * Client requests DHT service's HELLO URL.
680 */
681#define GNUNET_MESSAGE_TYPE_DHT_CLIENT_HELLO_GET 161
671 682
672 683
673/******************************************************************************* 684/*******************************************************************************