GNUnet  0.11.x
Functions
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.

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

Referenced by run().

104 {
105  GNUNET_assert (NULL == nc);
108  GNUNET_NO,
109  &got_hello,
110  NULL);
111 }
struct GNUNET_PEERINFO_Handle * GNUNET_PEERINFO_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the peerinfo service.
Definition: peerinfo_api.c:130
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.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_NO
Definition: gnunet_common.h:78
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.
static struct GNUNET_PEERINFO_NotifyContext * nc
Iterator context.
static struct GNUNET_PEERINFO_Handle * peerinfo
Handle to peerinfo service.
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.

References GNUNET_free, GNUNET_PEERINFO_disconnect(), and GNUNET_PEERINFO_notify_cancel().

Referenced by shutdown_rest().

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.
void GNUNET_PEERINFO_notify_cancel(struct GNUNET_PEERINFO_NotifyContext *nc)
Stop notifying about changes.
static struct GNUNET_PEERINFO_NotifyContext * nc
Iterator context.
void GNUNET_PEERINFO_disconnect(struct GNUNET_PEERINFO_Handle *h)
Disconnect from the peerinfo service.
Definition: peerinfo_api.c:156
static struct GNUNET_PEERINFO_Handle * peerinfo
Handle to peerinfo service.
#define GNUNET_free(ptr)
Wrapper around free.
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.

References mine.

Referenced by announce_id().

145 {
146  return mine;
147 }
static struct GNUNET_HELLO_Message * mine
Hello message of local peer.
Here is the caller graph for this function: