GNUnet  0.11.x
gnunet-service-dht_hello.h File Reference

GNUnet DHT integration with peerinfo. More...

#include "gnunet_util_lib.h"
#include "gnunet_hello_lib.h"
Include dependency graph for gnunet-service-dht_hello.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


const struct GNUNET_HELLO_MessageGDS_HELLO_get (const struct GNUNET_PeerIdentity *peer)
 Obtain a peer's HELLO if available. More...
void GDS_HELLO_init (void)
 Initialize HELLO subsystem. More...
void GDS_HELLO_done (void)
 Shutdown HELLO subsystem. More...

Detailed Description

GNUnet DHT integration with peerinfo.

Christian Grothoff

Definition in file gnunet-service-dht_hello.h.

Function Documentation

◆ GDS_HELLO_get()

const struct GNUNET_HELLO_Message* GDS_HELLO_get ( const struct GNUNET_PeerIdentity peer)

Obtain a peer's HELLO if available.

peerpeer to look for a HELLO from
HELLO for the given peer

Definition at line 53 of file gnunet-service-dht_hello.c.

54 {
55  if (NULL == peer_to_hello)
56  return NULL;
58 }
static struct GNUNET_CONTAINER_MultiPeerMap * peer_to_hello
Hash map of peers to HELLOs.
void * GNUNET_CONTAINER_multipeermap_get(const struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key)
Given a key find a value in the map matching the key.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.

References GNUNET_CONTAINER_multipeermap_get(), peer, and peer_to_hello.

Referenced by handle_find_peer().

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

◆ GDS_HELLO_init()

void GDS_HELLO_init ( void  )

Initialize HELLO subsystem.

Definition at line 103 of file gnunet-service-dht_hello.c.

104 {
107  &process_hello,
108  NULL);
110  GNUNET_NO);
111 }
const struct GNUNET_CONFIGURATION_Handle * GDS_cfg
Configuration we use.
static struct GNUNET_PEERINFO_NotifyContext * pnc
Handle for peerinfo notifications.
static void process_hello(void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Message *hello, const char *err_msg)
Function called for each HELLO known to PEERINFO.
Definition: gnunet_common.h:94
struct GNUNET_CONTAINER_MultiPeerMap * GNUNET_CONTAINER_multipeermap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
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.

References GDS_cfg, GNUNET_CONTAINER_multipeermap_create(), GNUNET_NO, GNUNET_PEERINFO_notify(), peer_to_hello, pnc, and process_hello().

Referenced by run().

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

◆ GDS_HELLO_done()

void GDS_HELLO_done ( void  )

Shutdown HELLO subsystem.

Definition at line 131 of file gnunet-service-dht_hello.c.

132 {
133  if (NULL != pnc)
134  {
136  pnc = NULL;
137  }
138  if (NULL != peer_to_hello)
139  {
141  &free_hello,
142  NULL);
144  }
145 }
static int free_hello(void *cls, const struct GNUNET_PeerIdentity *key, void *hello)
Free memory occopied by the HELLO.
void GNUNET_CONTAINER_multipeermap_destroy(struct GNUNET_CONTAINER_MultiPeerMap *map)
Destroy a hash map.
int GNUNET_CONTAINER_multipeermap_iterate(struct GNUNET_CONTAINER_MultiPeerMap *map, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map.
void GNUNET_PEERINFO_notify_cancel(struct GNUNET_PEERINFO_NotifyContext *nc)
Stop notifying about changes.

References free_hello(), GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_PEERINFO_notify_cancel(), peer_to_hello, and pnc.

Referenced by shutdown_task().

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