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.
Macros | |
#define | LOG(level, ...) GNUNET_log_from (level, "cadet-hll", __VA_ARGS__) |
Functions | |
static void | got_hello (void *cls, const struct GNUNET_PEERSTORE_Record *record, const char *err_msg) |
Process each hello message received from peerinfo. More... | |
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. More... | |
void | GCH_shutdown () |
Shut down the hello subsystem. More... | |
const struct GNUNET_MessageHeader * | GCH_get_mine (void) |
Get own hello message. More... | |
Variables | |
static struct GNUNET_MessageHeader * | mine |
Hello message of local peer. More... | |
static struct GNUNET_PEERSTORE_Handle * | peerstore |
Handle to the PEERSTORE service. More... | |
static struct GNUNET_PEERSTORE_Monitor * | peerstore_notify |
Our peerstore notification context. More... | |
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 |
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 65 of file gnunet-service-cadet_hello.c.
References builder, GCD_hello_update(), GCP_get(), GCP_set_hello(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_HELLO_builder_free(), GNUNET_HELLO_builder_from_parser(), GNUNET_HELLO_builder_to_dht_hello_msg(), GNUNET_HELLO_get_expiration_time_from_msg(), GNUNET_HELLO_parser_free(), GNUNET_HELLO_parser_from_msg(), GNUNET_i2s(), GNUNET_memcmp, GNUNET_PEERSTORE_monitor_next(), GNUNET_STRINGS_absolute_time_to_string(), GNUNET_TIME_UNIT_ZERO, GNUNET_YES, LOG, mine, my_full_id, my_private_key, consensus-simulation::parser, peerstore_notify, record(), and GNUNET_MessageHeader::size.
Referenced by GCH_init().
|
static |
Definition at line 111 of file gnunet-service-cadet_hello.c.
References GNUNET_ERROR_TYPE_WARNING, and GNUNET_log.
Referenced by GCH_init().
|
static |
Definition at line 119 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 132 of file gnunet-service-cadet_hello.c.
References error_cb(), GNUNET_assert, GNUNET_PEERSTORE_connect(), GNUNET_PEERSTORE_HELLO_KEY, GNUNET_PEERSTORE_monitor_start(), GNUNET_YES, got_hello(), peerstore, peerstore_notify, and sync_cb().
Referenced by run().
void GCH_shutdown | ( | void | ) |
Shut down the hello subsystem.
Definition at line 155 of file gnunet-service-cadet_hello.c.
References GNUNET_free, GNUNET_PEERSTORE_disconnect(), GNUNET_PEERSTORE_monitor_stop(), mine, peerstore, and peerstore_notify.
Referenced by shutdown_rest().
const struct GNUNET_MessageHeader * GCH_get_mine | ( | void | ) |
Get own hello message.
Definition at line 181 of file gnunet-service-cadet_hello.c.
References builder, GNUNET_HELLO_builder_free(), GNUNET_HELLO_builder_new(), GNUNET_HELLO_builder_to_dht_hello_msg(), GNUNET_TIME_UNIT_ZERO, mine, my_full_id, and my_private_key.
Referenced by announce_id().
|
static |
Hello message of local peer.
Definition at line 42 of file gnunet-service-cadet_hello.c.
Referenced by GCH_get_mine(), GCH_shutdown(), and got_hello().
|
static |
Handle to the PEERSTORE service.
Definition at line 47 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 53 of file gnunet-service-cadet_hello.c.
Referenced by GCH_init(), GCH_shutdown(), and got_hello().