GNUnet 0.28.1-dev.4-47-g3e168ca2d
 
Loading...
Searching...
No Matches
gnunet-service-cadet_hello.h File Reference

cadet service; dealing with hello messages More...

#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_hello_uri_lib.h"
#include "gnunet_pils_service.h"
Include dependency graph for gnunet-service-cadet_hello.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void GCH_init (const struct GNUNET_CONFIGURATION_Handle *c)
 Initialize the hello subsystem.
 
void GCH_shutdown (void)
 Shut down the hello subsystem.
 
struct GNUNET_MessageHeaderGCH_get_mine ()
 Get own hello message.
 

Detailed Description

cadet service; dealing with hello messages

Author
Bartlomiej Polot
Christian Grothoff

All functions in this file should use the prefix GCH (Gnunet Cadet Hello)

Definition in file gnunet-service-cadet_hello.h.

Function Documentation

◆ GCH_init()

void GCH_init ( const struct GNUNET_CONFIGURATION_Handle c)

Initialize the hello subsystem.

Parameters
cConfiguration.

Definition at line 189 of file gnunet-service-cadet_hello.c.

190{
196 "peerstore",
197 NULL,
199 &error_cb,
200 NULL,
201 &sync_cb,
202 NULL,
203 &got_hello,
204 NULL);
207 NULL);
208}
static struct GNUNET_PILS_Handle * pils
Handle to PILS.
Definition gnunet-pils.c:44
static void sync_cb(void *cls)
static void got_hello(void *cls, const struct GNUNET_PEERSTORE_Record *record, const char *err_msg)
Process each hello message received from peerinfo.
static struct GNUNET_PEERSTORE_Monitor * peerstore_notify
Our peerstore notification context.
static struct GNUNET_PEERSTORE_Handle * peerstore
Handle to the PEERSTORE service.
static void sign_hello_cb(void *cls, const struct GNUNET_HELLO_Parser *parser, const struct GNUNET_HashCode *hash)
static void error_cb(void *cls)
struct GNUNET_PILS_Handle * GNUNET_PILS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_PILS_PidChangeCallback pid_change_cb, void *cls)
Connect to the PILS service.
Definition pils_api.c:624
@ GNUNET_YES
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
struct GNUNET_PEERSTORE_Monitor * GNUNET_PEERSTORE_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg, int iterate_first, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_SCHEDULER_TaskCallback sync_cb, void *sync_cb_cls, GNUNET_PEERSTORE_Processor callback, void *callback_cls)
Request watching a given key The monitoring can be filtered to contain only records matching peer and...
struct GNUNET_PEERSTORE_Handle * GNUNET_PEERSTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the PEERSTORE service.
#define GNUNET_PEERSTORE_HELLO_KEY
Key used for storing HELLO in the peerstore.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GCH_shutdown()

void GCH_shutdown ( void  )

Shut down the hello subsystem.

Definition at line 215 of file gnunet-service-cadet_hello.c.

216{
217 struct PilsRequest *pr;
218
219 if (NULL != peerstore_notify)
220 {
222 peerstore_notify = NULL;
223 }
224 if (NULL != peerstore)
225 {
227 peerstore = NULL;
228 }
229 while (NULL != (pr = pils_requests_head))
230 {
233 pr);
234 if (NULL != pr->op)
236 if (NULL != pr->builder)
238 GNUNET_free (pr);
239 }
240 if (NULL != pils)
241 {
243 pils = NULL;
244 }
245 if (NULL != mine)
246 {
248 mine = NULL;
249 }
250}
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.
void GNUNET_PILS_disconnect(struct GNUNET_PILS_Handle *handle)
Disconnect from the PILS service.
Definition pils_api.c:647
void GNUNET_PILS_cancel(struct GNUNET_PILS_Operation *op)
Cancel request.
Definition pils_api.c:776
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
void GNUNET_HELLO_builder_free(struct GNUNET_HELLO_Builder *builder)
Release resources of a builder.
Definition hello-uri.c:398
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_PEERSTORE_monitor_stop(struct GNUNET_PEERSTORE_Monitor *zm)
Stop monitoring.
void GNUNET_PEERSTORE_disconnect(struct GNUNET_PEERSTORE_Handle *h)
Disconnect from the PEERSTORE service.
struct GNUNET_PILS_Operation * op
The pils operation.
struct GNUNET_HELLO_Builder * builder
Address builder.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GCH_get_mine()

struct GNUNET_MessageHeader * GCH_get_mine ( )

Get own hello message.

Returns
Own hello message.

Definition at line 259 of file gnunet-service-cadet_hello.c.

260{
261 return mine;
262}

References mine.

Referenced by announce_id().

Here is the caller graph for this function: