spread knowledge about how to contact us (get HELLO from peerinfo), and remember HELLOs of other peers we have an interest in More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_statistics_service.h"
#include "gnunet_peerstore_service.h"
#include "cadet_protocol.h"
#include "gnunet-service-cadet.h"
#include "gnunet-service-cadet_dht.h"
#include "gnunet-service-cadet_hello.h"
#include "gnunet-service-cadet_peer.h"
Go to the source code of this file.
Data Structures | |
struct | PilsRequest |
DLL. More... | |
Macros | |
#define | LOG(level, ...) GNUNET_log_from (level, "cadet-hll", __VA_ARGS__) |
Functions | |
static void | sign_hello_cb (void *cls, const struct GNUNET_HELLO_Parser *parser, const struct GNUNET_HashCode *hash) |
static void | got_hello (void *cls, const struct GNUNET_PEERSTORE_Record *record, const char *err_msg) |
Process each hello message received from peerinfo. | |
static void | error_cb (void *cls) |
static void | sync_cb (void *cls) |
void | GCH_init (const struct GNUNET_CONFIGURATION_Handle *c) |
Initialize the hello subsystem. | |
void | GCH_shutdown () |
Shut down the hello subsystem. | |
struct GNUNET_MessageHeader * | GCH_get_mine () |
Get own hello message. | |
Variables | |
static struct PilsRequest * | pils_requests_head |
PILS Operation DLL. | |
static struct PilsRequest * | pils_requests_tail |
PILS Operation DLL. | |
static struct GNUNET_MessageHeader * | mine |
Hello message of local peer. | |
static struct GNUNET_PEERSTORE_Handle * | peerstore |
Handle to the PEERSTORE service. | |
static struct GNUNET_PILS_Handle * | pils |
Handle to the PILS service. | |
static struct GNUNET_PEERSTORE_Monitor * | peerstore_notify |
Our peerstore notification context. | |
spread knowledge about how to contact us (get HELLO from peerinfo), and remember HELLOs of other peers we have an interest in
Definition in file gnunet-service-cadet_hello.c.
#define LOG | ( | level, | |
... | |||
) | GNUNET_log_from (level, "cadet-hll", __VA_ARGS__) |
Definition at line 37 of file gnunet-service-cadet_hello.c.
|
static |
Definition at line 99 of file gnunet-service-cadet_hello.c.
References GCD_hello_update(), GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_h2s(), GNUNET_HELLO_parser_get_id(), GNUNET_HELLO_parser_to_dht_hello_msg(), LOG, mine, and my_full_id.
Referenced by GCH_init().
|
static |
Process each hello message received from peerinfo.
cls | Closure (unused). |
id | Identity of the peer. |
hello | Hello of the peer. |
err_msg | Error message. |
Definition at line 123 of file gnunet-service-cadet_hello.c.
References GCP_get(), GCP_set_hello(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_HELLO_get_expiration_time_from_msg(), GNUNET_i2s(), GNUNET_memcmp, GNUNET_PEERSTORE_monitor_next(), GNUNET_STRINGS_absolute_time_to_string(), GNUNET_YES, LOG, my_full_id, peerstore_notify, record(), and GNUNET_MessageHeader::size.
Referenced by GCH_init().
|
static |
Definition at line 160 of file gnunet-service-cadet_hello.c.
References GNUNET_ERROR_TYPE_WARNING, and GNUNET_log.
Referenced by GCH_init().
|
static |
Definition at line 168 of file gnunet-service-cadet_hello.c.
References GNUNET_ERROR_TYPE_WARNING, and GNUNET_log.
Referenced by GCH_init().
void GCH_init | ( | const struct GNUNET_CONFIGURATION_Handle * | c | ) |
Initialize the hello subsystem.
c | Configuration. |
Definition at line 181 of file gnunet-service-cadet_hello.c.
References error_cb(), GNUNET_assert, GNUNET_PEERSTORE_connect(), GNUNET_PEERSTORE_HELLO_KEY, GNUNET_PEERSTORE_monitor_start(), GNUNET_PILS_connect(), GNUNET_YES, got_hello(), peerstore, peerstore_notify, pils, sign_hello_cb(), and sync_cb().
Referenced by run().
void GCH_shutdown | ( | void | ) |
Shut down the hello subsystem.
Definition at line 207 of file gnunet-service-cadet_hello.c.
References PilsRequest::builder, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_HELLO_builder_free(), GNUNET_PEERSTORE_disconnect(), GNUNET_PEERSTORE_monitor_stop(), GNUNET_PILS_cancel(), GNUNET_PILS_disconnect(), mine, PilsRequest::op, peerstore, peerstore_notify, pils, pils_requests_head, and pils_requests_tail.
Referenced by shutdown_rest().
struct GNUNET_MessageHeader * GCH_get_mine | ( | ) |
Get own hello message.
Definition at line 251 of file gnunet-service-cadet_hello.c.
References mine.
Referenced by announce_id().
|
static |
PILS Operation DLL.
Definition at line 68 of file gnunet-service-cadet_hello.c.
Referenced by GCH_shutdown().
|
static |
PILS Operation DLL.
Definition at line 73 of file gnunet-service-cadet_hello.c.
Referenced by GCH_shutdown().
|
static |
Hello message of local peer.
Definition at line 79 of file gnunet-service-cadet_hello.c.
Referenced by GCH_get_mine(), GCH_shutdown(), and sign_hello_cb().
|
static |
Handle to the PEERSTORE service.
Definition at line 84 of file gnunet-service-cadet_hello.c.
Referenced by GCH_init(), and GCH_shutdown().
|
static |
Handle to the PILS service.
Definition at line 89 of file gnunet-service-cadet_hello.c.
Referenced by GCH_init(), and GCH_shutdown().
|
static |
Our peerstore notification context.
We use notification to instantly learn about new peers as they are discovered.
Definition at line 95 of file gnunet-service-cadet_hello.c.
Referenced by GCH_init(), GCH_shutdown(), and got_hello().