GNUnet  0.20.0
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_lib.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. More...
 
void GCH_shutdown (void)
 Shut down the hello subsystem. More...
 
const struct GNUNET_HELLO_MessageGCH_get_mine (void)
 Get own hello message. More...
 

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 103 of file gnunet-service-cadet_hello.c.

104 {
105  GNUNET_assert (NULL == nc);
108  GNUNET_NO,
109  &got_hello,
110  NULL);
111 }
static void got_hello(void *cls, const struct GNUNET_PeerIdentity *id, const struct GNUNET_HELLO_Message *hello, const char *err_msg)
Process each hello message received from peerinfo.
static struct GNUNET_PEERINFO_Handle * peerinfo
Handle to peerinfo service.
static struct GNUNET_PEERINFO_NotifyContext * nc
Iterator context.
@ GNUNET_NO
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
struct GNUNET_PEERINFO_NotifyContext * GNUNET_PEERINFO_notify(const struct GNUNET_CONFIGURATION_Handle *cfg, int include_friend_only, GNUNET_PEERINFO_Processor callback, void *callback_cls)
Call a method whenever our known information about peers changes.
struct GNUNET_PEERINFO_Handle * GNUNET_PEERINFO_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the peerinfo service.
Definition: peerinfo_api.c:123

References GNUNET_assert, GNUNET_NO, GNUNET_PEERINFO_connect(), GNUNET_PEERINFO_notify(), got_hello(), nc, and peerinfo.

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 118 of file gnunet-service-cadet_hello.c.

119 {
120  if (NULL != nc)
121  {
123  nc = NULL;
124  }
125  if (NULL != peerinfo)
126  {
128  peerinfo = NULL;
129  }
130  if (NULL != mine)
131  {
132  GNUNET_free (mine);
133  mine = NULL;
134  }
135 }
static struct GNUNET_HELLO_Message * mine
Hello message of local peer.
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_PEERINFO_notify_cancel(struct GNUNET_PEERINFO_NotifyContext *nc)
Stop notifying about changes.
void GNUNET_PEERINFO_disconnect(struct GNUNET_PEERINFO_Handle *h)
Disconnect from the peerinfo service.
Definition: peerinfo_api.c:149

References GNUNET_free, GNUNET_PEERINFO_disconnect(), GNUNET_PEERINFO_notify_cancel(), mine, nc, and peerinfo.

Referenced by shutdown_rest().

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

◆ GCH_get_mine()

const struct GNUNET_HELLO_Message* GCH_get_mine ( void  )

Get own hello message.

Returns
Own hello message.

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

145 {
146  return mine;
147 }

References mine.

Referenced by announce_id().

Here is the caller graph for this function: