GNUnet  0.16.x
Data Structures | Macros | Functions | Variables
gnunet-service-zonemaster-monitor.c File Reference

monitor namestore changes and publish them immediately to GNUnet name system More...

#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_dht_service.h"
#include "gnunet_namestore_service.h"
#include "gnunet_statistics_service.h"
Include dependency graph for gnunet-service-zonemaster-monitor.c:

Go to the source code of this file.

Data Structures

struct  DhtPutActivity
 Handle for DHT PUT activity triggered from the namestore monitor. More...
 

Macros

#define LOG_STRERROR_FILE(kind, syscall, filename)
 
#define PUBLISH_OPS_PER_EXPIRATION   4
 How often should we (re)publish each record before it expires? More...
 
#define DHT_QUEUE_LIMIT   2000
 How many pending DHT operations do we allow at most? More...
 
#define NAMESTORE_QUEUE_LIMIT   5
 How many events may the namestore give us before it has to wait for us to keep up? More...
 
#define DHT_GNS_REPLICATION_LEVEL   5
 What replication level do we use for DHT PUT operations? More...
 

Functions

static void shutdown_task (void *cls)
 Task run during shutdown. More...
 
static void dht_put_monitor_continuation (void *cls)
 Continuation called from DHT once the PUT operation triggered by a monitor is done. More...
 
static struct GNUNET_DHT_PutHandleperform_dht_put (const struct GNUNET_IDENTITY_PrivateKey *key, const char *label, const struct GNUNET_GNSRECORD_Data *rd_public, unsigned int rd_public_count, struct GNUNET_TIME_Absolute expire, struct DhtPutActivity *ma)
 Store GNS records in the DHT. More...
 
static void handle_monitor_event (void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
 Process a record that was stored in the namestore (invoked by the monitor). More...
 
static void handle_monitor_error (void *cls)
 The zone monitor encountered an IPC error trying to to get in sync. More...
 
static void run (void *cls, const struct GNUNET_CONFIGURATION_Handle *c, struct GNUNET_SERVICE_Handle *service)
 Perform zonemaster duties: watch namestore, publish records. More...
 
 GNUNET_SERVICE_MAIN ("zonemaster-monitor", GNUNET_SERVICE_OPTION_NONE, &run, NULL, NULL, NULL, GNUNET_MQ_handler_end())
 Define "main" method using service macro. More...
 

Variables

static struct GNUNET_STATISTICS_Handlestatistics
 Handle to the statistics service. More...
 
static struct GNUNET_DHT_Handledht_handle
 Our handle to the DHT. More...
 
static struct GNUNET_NAMESTORE_Handlenamestore_handle
 Our handle to the namestore service. More...
 
static struct GNUNET_NAMESTORE_ZoneMonitorzmon
 Handle to monitor namestore changes to instant propagation. More...
 
static struct DhtPutActivityma_head
 Head of monitor activities; kept in a DLL. More...
 
static struct DhtPutActivityma_tail
 Tail of monitor activities; kept in a DLL. More...
 
static unsigned int ma_queue_length
 Number of entries in the DHT queue ma_head. More...
 
static int cache_keys
 Optimize block insertion by caching map of private keys to public keys in memory? More...
 

Detailed Description

monitor namestore changes and publish them immediately to GNUnet name system

Author
Christian Grothoff

Definition in file gnunet-service-zonemaster-monitor.c.

Macro Definition Documentation

◆ LOG_STRERROR_FILE

#define LOG_STRERROR_FILE (   kind,
  syscall,
  filename 
)
Value:
syscall, \
static char * filename
#define GNUNET_log_from_strerror_file(level, component, cmd, filename)
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the mess...

Definition at line 32 of file gnunet-service-zonemaster-monitor.c.

◆ PUBLISH_OPS_PER_EXPIRATION

#define PUBLISH_OPS_PER_EXPIRATION   4

How often should we (re)publish each record before it expires?

Definition at line 42 of file gnunet-service-zonemaster-monitor.c.

◆ DHT_QUEUE_LIMIT

#define DHT_QUEUE_LIMIT   2000

How many pending DHT operations do we allow at most?

Definition at line 47 of file gnunet-service-zonemaster-monitor.c.

◆ NAMESTORE_QUEUE_LIMIT

#define NAMESTORE_QUEUE_LIMIT   5

How many events may the namestore give us before it has to wait for us to keep up?

Definition at line 53 of file gnunet-service-zonemaster-monitor.c.

◆ DHT_GNS_REPLICATION_LEVEL

#define DHT_GNS_REPLICATION_LEVEL   5

What replication level do we use for DHT PUT operations?

Definition at line 58 of file gnunet-service-zonemaster-monitor.c.

Function Documentation

◆ shutdown_task()

static void shutdown_task ( void *  cls)
static

Task run during shutdown.

Parameters
clsunused
tcunused

Definition at line 136 of file gnunet-service-zonemaster-monitor.c.

137 {
138  struct DhtPutActivity *ma;
139 
140  (void) cls;
142  "Shutting down!\n");
143  while (NULL != (ma = ma_head))
144  {
146  ma_queue_length--;
148  ma_tail,
149  ma);
150  GNUNET_free (ma);
151  }
152  if (NULL != statistics)
153  {
155  GNUNET_NO);
156  statistics = NULL;
157  }
158  if (NULL != zmon)
159  {
161  zmon = NULL;
162  }
163  if (NULL != namestore_handle)
164  {
166  namestore_handle = NULL;
167  }
168  if (NULL != dht_handle)
169  {
171  dht_handle = NULL;
172  }
173 }
static struct GNUNET_NAMESTORE_Handle * namestore_handle
Our handle to the namestore service.
static struct GNUNET_STATISTICS_Handle * statistics
Handle to the statistics service.
static struct GNUNET_DHT_Handle * dht_handle
Our handle to the DHT.
static unsigned int ma_queue_length
Number of entries in the DHT queue ma_head.
static struct DhtPutActivity * ma_tail
Tail of monitor activities; kept in a DLL.
static struct DhtPutActivity * ma_head
Head of monitor activities; kept in a DLL.
static struct GNUNET_NAMESTORE_ZoneMonitor * zmon
Handle to monitor namestore changes to instant propagation.
#define GNUNET_log(kind,...)
@ GNUNET_NO
Definition: gnunet_common.h:94
void GNUNET_DHT_put_cancel(struct GNUNET_DHT_PutHandle *ph)
Cancels a DHT PUT operation.
Definition: dht_api.c:1098
void GNUNET_DHT_disconnect(struct GNUNET_DHT_Handle *handle)
Shutdown connection with the DHT service.
Definition: dht_api.c:1012
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_NAMESTORE_disconnect(struct GNUNET_NAMESTORE_Handle *h)
Disconnect from the namestore service (and free associated resources).
void GNUNET_NAMESTORE_zone_monitor_stop(struct GNUNET_NAMESTORE_ZoneMonitor *zm)
Stop monitoring a zone for changes.
void GNUNET_STATISTICS_destroy(struct GNUNET_STATISTICS_Handle *h, int sync_first)
Destroy a handle (free all state associated with it).
Handle for DHT PUT activity triggered from the namestore monitor.
struct GNUNET_DHT_PutHandle * ph
Handle for the DHT PUT operation.

References dht_handle, GNUNET_CONTAINER_DLL_remove, GNUNET_DHT_disconnect(), GNUNET_DHT_put_cancel(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_NAMESTORE_disconnect(), GNUNET_NAMESTORE_zone_monitor_stop(), GNUNET_NO, GNUNET_STATISTICS_destroy(), ma_head, ma_queue_length, ma_tail, namestore_handle, DhtPutActivity::ph, statistics, and zmon.

Referenced by run().

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

◆ dht_put_monitor_continuation()

static void dht_put_monitor_continuation ( void *  cls)
static

Continuation called from DHT once the PUT operation triggered by a monitor is done.

Parameters
clsa struct DhtPutActivity

Definition at line 183 of file gnunet-service-zonemaster-monitor.c.

184 {
185  struct DhtPutActivity *ma = cls;
186 
188  1);
189  ma_queue_length--;
191  ma_tail,
192  ma);
193  GNUNET_free (ma);
194 }
void GNUNET_NAMESTORE_zone_monitor_next(struct GNUNET_NAMESTORE_ZoneMonitor *zm, uint64_t limit)
Calls the monitor processor specified in GNUNET_NAMESTORE_zone_monitor_start for the next record(s).

References GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_NAMESTORE_zone_monitor_next(), ma_head, ma_queue_length, ma_tail, and zmon.

Referenced by perform_dht_put().

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

◆ perform_dht_put()

static struct GNUNET_DHT_PutHandle* perform_dht_put ( const struct GNUNET_IDENTITY_PrivateKey key,
const char *  label,
const struct GNUNET_GNSRECORD_Data rd_public,
unsigned int  rd_public_count,
struct GNUNET_TIME_Absolute  expire,
struct DhtPutActivity ma 
)
static

Store GNS records in the DHT.

Parameters
keykey of the zone
labellabel to store under
rd_publicpublic record data
rd_public_countnumber of records in rd_public
mahandle for the PUT operation
Returns
DHT PUT handle, NULL on error

Definition at line 208 of file gnunet-service-zonemaster-monitor.c.

214 {
215  struct GNUNET_GNSRECORD_Block *block;
216  struct GNUNET_HashCode query;
217  size_t block_size;
218  struct GNUNET_DHT_PutHandle *ret;
219 
220  if (cache_keys)
222  expire,
223  label,
224  rd_public,
225  rd_public_count,
226  &block));
227  else
229  expire,
230  label,
231  rd_public,
232  rd_public_count,
233  &block));
234  if (NULL == block)
235  {
236  GNUNET_break (0);
237  return NULL; /* whoops */
238  }
239  block_size = GNUNET_GNSRECORD_block_get_size (block);
241  label,
242  &query);
244  "DHT put operations initiated",
245  1,
246  GNUNET_NO);
248  "Storing %u record(s) for label `%s' in DHT with expiration `%s' under key %s\n",
249  rd_public_count,
250  label,
252  GNUNET_h2s (&query));
254  &query,
258  block_size,
259  block,
260  expire,
262  ma);
263  GNUNET_free (block);
264  return ret;
265 }
static int ret
Return value of the commandline.
Definition: gnunet-abd.c:81
struct GNUNET_HashCode key
The key used in the DHT.
static char * expire
DID Document expiration Date Attribut String.
Definition: gnunet-did.c:99
static int cache_keys
Optimize block insertion by caching map of private keys to public keys in memory?
#define DHT_GNS_REPLICATION_LEVEL
What replication level do we use for DHT PUT operations?
static void dht_put_monitor_continuation(void *cls)
Continuation called from DHT once the PUT operation triggered by a monitor is done.
@ GNUNET_OK
Definition: gnunet_common.h:95
@ GNUNET_BLOCK_TYPE_GNS_NAMERECORD
Block for storing GNS record data.
struct GNUNET_DHT_PutHandle * GNUNET_DHT_put(struct GNUNET_DHT_Handle *handle, const struct GNUNET_HashCode *key, uint32_t desired_replication_level, enum GNUNET_DHT_RouteOption options, enum GNUNET_BLOCK_Type type, size_t size, const void *data, struct GNUNET_TIME_Absolute exp, GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls)
Perform a PUT operation storing data in the DHT.
Definition: dht_api.c:1040
@ GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE
Each peer along the way should process the request (otherwise only peers locally closest to the key w...
void GNUNET_GNSRECORD_query_from_private_key(const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, struct GNUNET_HashCode *query)
Calculate the DHT query for a given label in a given zone.
enum GNUNET_GenericReturnValue GNUNET_GNSRECORD_block_create2(const struct GNUNET_IDENTITY_PrivateKey *pkey, struct GNUNET_TIME_Absolute expire, const char *label, const struct GNUNET_GNSRECORD_Data *rd, unsigned int rd_count, struct GNUNET_GNSRECORD_Block **result)
Sign name and records, cache derived public key (also keeps the private key in static memory,...
enum GNUNET_GenericReturnValue GNUNET_GNSRECORD_block_create(const struct GNUNET_IDENTITY_PrivateKey *key, struct GNUNET_TIME_Absolute expire, const char *label, const struct GNUNET_GNSRECORD_Data *rd, unsigned int rd_count, struct GNUNET_GNSRECORD_Block **result)
Sign name and records.
size_t GNUNET_GNSRECORD_block_get_size(const struct GNUNET_GNSRECORD_Block *block)
Returns the length of this block in bytes.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
const char * GNUNET_STRINGS_absolute_time_to_string(struct GNUNET_TIME_Absolute t)
Like asctime, except for GNUnet time.
Definition: strings.c:617
Handle to a PUT request.
Definition: dht_api.c:45
A 512-bit hashcode.

References cache_keys, DHT_GNS_REPLICATION_LEVEL, dht_handle, dht_put_monitor_continuation(), expire, GNUNET_assert, GNUNET_BLOCK_TYPE_GNS_NAMERECORD, GNUNET_break, GNUNET_DHT_put(), GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_GNSRECORD_block_create(), GNUNET_GNSRECORD_block_create2(), GNUNET_GNSRECORD_block_get_size(), GNUNET_GNSRECORD_query_from_private_key(), GNUNET_h2s(), GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_STATISTICS_update(), GNUNET_STRINGS_absolute_time_to_string(), key, ret, and statistics.

Referenced by handle_monitor_event().

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

◆ handle_monitor_event()

static void handle_monitor_event ( void *  cls,
const struct GNUNET_IDENTITY_PrivateKey zone,
const char *  label,
unsigned int  rd_count,
const struct GNUNET_GNSRECORD_Data rd 
)
static

Process a record that was stored in the namestore (invoked by the monitor).

Parameters
clsclosure, NULL
zoneprivate key of the zone; NULL on disconnect
labellabel of the records; NULL on disconnect
rd_countnumber of entries in rd array, 0 if label was deleted
rdarray of records with data to store

Definition at line 278 of file gnunet-service-zonemaster-monitor.c.

283 {
284  struct GNUNET_GNSRECORD_Data rd_public[rd_count];
285  unsigned int rd_public_count;
286  struct DhtPutActivity *ma;
288  char *emsg;
289 
290  (void) cls;
292  "Namestore monitor events received",
293  1,
294  GNUNET_NO);
296  "Received %u records for label `%s' via namestore monitor\n",
297  rd_count,
298  label);
299  /* filter out records that are not public, and convert to
300  absolute expiration time. */
302  rd,
303  rd_count,
304  rd_public,
305  &rd_public_count,
306  &expire,
307  &emsg))
308  {
310  "Zonemaster-monitor failed: %s\n", emsg);
311  GNUNET_free (emsg);
313  1);
314  return; /* nothing to do */
315  }
316  if (0 == rd_public_count)
317  {
319  1);
320  return; /* nothing to do */
321  }
322  ma = GNUNET_new (struct DhtPutActivity);
324  ma->ph = perform_dht_put (zone,
325  label,
326  rd_public,
327  rd_public_count,
328  expire,
329  ma);
330  if (NULL == ma->ph)
331  {
332  /* PUT failed, do not remember operation */
333  GNUNET_free (ma);
335  1);
336  return;
337  }
339  ma_tail,
340  ma);
341  ma_queue_length++;
343  {
344  ma = ma_head;
346  ma_tail,
347  ma);
349  ma_queue_length--;
351  "DHT PUT unconfirmed after %s, aborting PUT\n",
354  GNUNET_YES));
355  GNUNET_free (ma);
356  }
357 }
static char * zone
Name of the zone being managed.
static struct GNUNET_DHT_PutHandle * perform_dht_put(const struct GNUNET_IDENTITY_PrivateKey *key, const char *label, const struct GNUNET_GNSRECORD_Data *rd_public, unsigned int rd_public_count, struct GNUNET_TIME_Absolute expire, struct DhtPutActivity *ma)
Store GNS records in the DHT.
#define DHT_QUEUE_LIMIT
How many pending DHT operations do we allow at most?
@ GNUNET_YES
Definition: gnunet_common.h:97
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
enum GNUNET_GenericReturnValue GNUNET_GNSRECORD_convert_records_for_export(const char *label, const struct GNUNET_GNSRECORD_Data *rd, unsigned int rd_count, struct GNUNET_GNSRECORD_Data *rd_public, unsigned int *rd_count_public, struct GNUNET_TIME_Absolute *expiry, char **emsg)
Convert namestore records from the internal format to that suitable for publication (removes private ...
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
#define GNUNET_new(type)
Allocate a struct or union of the given type.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence)
Get the duration of an operation as the difference of the current time and the given start time "henc...
Definition: time.c:435
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
Definition: time.c:110
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
Definition: strings.c:570
struct GNUNET_TIME_Absolute start_date
When was this PUT initiated?
Time for absolute times used by GNUnet, in microseconds.

References DHT_QUEUE_LIMIT, expire, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CONTAINER_DLL_remove, GNUNET_DHT_put_cancel(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_GNSRECORD_convert_records_for_export(), GNUNET_log, GNUNET_NAMESTORE_zone_monitor_next(), GNUNET_new, GNUNET_NO, GNUNET_OK, GNUNET_STATISTICS_update(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_get_duration(), GNUNET_YES, ma_head, ma_queue_length, ma_tail, perform_dht_put(), DhtPutActivity::ph, DhtPutActivity::start_date, statistics, zmon, and zone.

Referenced by run().

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

◆ handle_monitor_error()

static void handle_monitor_error ( void *  cls)
static

The zone monitor encountered an IPC error trying to to get in sync.

Restart from the beginning.

Parameters
clsNULL

Definition at line 367 of file gnunet-service-zonemaster-monitor.c.

368 {
369  (void) cls;
371  "Namestore monitor errors encountered",
372  1,
373  GNUNET_NO);
374 }

References GNUNET_NO, GNUNET_STATISTICS_update(), and statistics.

Referenced by run().

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

◆ run()

static void run ( void *  cls,
const struct GNUNET_CONFIGURATION_Handle c,
struct GNUNET_SERVICE_Handle service 
)
static

Perform zonemaster duties: watch namestore, publish records.

Parameters
clsclosure
serverthe initialized server
cconfiguration to use

Definition at line 385 of file gnunet-service-zonemaster-monitor.c.

388 {
389  unsigned long long max_parallel_bg_queries = 128;
390 
391  (void) cls;
392  (void) service;
394  if (NULL == namestore_handle)
395  {
397  _ ("Failed to connect to the namestore!\n"));
399  return;
400  }
402  "namestore",
403  "CACHE_KEYS");
404  if (GNUNET_OK ==
406  "zonemaster",
407  "MAX_PARALLEL_BACKGROUND_QUERIES",
408  &max_parallel_bg_queries))
409  {
411  "Number of allowed parallel background queries: %llu\n",
412  max_parallel_bg_queries);
413  }
414  if (0 == max_parallel_bg_queries)
415  max_parallel_bg_queries = 1;
417  (unsigned int) max_parallel_bg_queries);
418  if (NULL == dht_handle)
419  {
421  _ ("Could not connect to DHT!\n"));
423  NULL);
424  return;
425  }
426 
427  /* Schedule periodic put for our records. */
428  statistics = GNUNET_STATISTICS_create ("zonemaster-mon",
429  c);
431  NULL,
432  GNUNET_NO,
434  NULL,
436  NULL,
437  NULL /* sync_cb */,
438  NULL);
441  GNUNET_break (NULL != zmon);
443  NULL);
444 }
static struct GNUNET_SERVICE_Handle * service
Handle to our service instance.
static void handle_monitor_event(void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Process a record that was stored in the namestore (invoked by the monitor).
static void handle_monitor_error(void *cls)
The zone monitor encountered an IPC error trying to to get in sync.
static void shutdown_task(void *cls)
Task run during shutdown.
#define NAMESTORE_QUEUE_LIMIT
How many events may the namestore give us before it has to wait for us to keep up?
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_number(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *number)
Get a configuration value that should be a number.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_yesno(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option)
Get a configuration value that should be in a set of "YES" or "NO".
struct GNUNET_DHT_Handle * GNUNET_DHT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, unsigned int ht_len)
Initialize the connection with the DHT service.
Definition: dht_api.c:989
struct GNUNET_NAMESTORE_Handle * GNUNET_NAMESTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the namestore service.
struct GNUNET_NAMESTORE_ZoneMonitor * GNUNET_NAMESTORE_zone_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_IDENTITY_PrivateKey *zone, int iterate_first, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor monitor, void *monitor_cls, GNUNET_SCHEDULER_TaskCallback sync_cb, void *sync_cb_cls)
Begin monitoring a zone for changes.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:533
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
Definition: scheduler.c:1281
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received,...
Definition: scheduler.c:1316
struct GNUNET_STATISTICS_Handle * GNUNET_STATISTICS_create(const char *subsystem, const struct GNUNET_CONFIGURATION_Handle *cfg)
Get handle for the statistics service.
#define _(String)
GNU gettext support macro.
Definition: platform.h:177

References _, cache_keys, dht_handle, GNUNET_break, GNUNET_CONFIGURATION_get_value_number(), GNUNET_CONFIGURATION_get_value_yesno(), GNUNET_DHT_connect(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_NAMESTORE_connect(), GNUNET_NAMESTORE_zone_monitor_next(), GNUNET_NAMESTORE_zone_monitor_start(), GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_shutdown(), GNUNET_STATISTICS_create(), handle_monitor_error(), handle_monitor_event(), namestore_handle, NAMESTORE_QUEUE_LIMIT, service, shutdown_task(), statistics, and zmon.

Here is the call graph for this function:

◆ GNUNET_SERVICE_MAIN()

GNUNET_SERVICE_MAIN ( "zonemaster-monitor ,
GNUNET_SERVICE_OPTION_NONE  ,
run,
NULL  ,
NULL  ,
NULL  ,
GNUNET_MQ_handler_end()   
)

Define "main" method using service macro.

Variable Documentation

◆ statistics

struct GNUNET_STATISTICS_Handle* statistics
static

Handle to the statistics service.

Definition at line 90 of file gnunet-service-zonemaster-monitor.c.

Referenced by handle_monitor_error(), handle_monitor_event(), perform_dht_put(), run(), and shutdown_task().

◆ dht_handle

struct GNUNET_DHT_Handle* dht_handle
static

Our handle to the DHT.

Definition at line 95 of file gnunet-service-zonemaster-monitor.c.

Referenced by perform_dht_put(), run(), and shutdown_task().

◆ namestore_handle

struct GNUNET_NAMESTORE_Handle* namestore_handle
static

Our handle to the namestore service.

Definition at line 100 of file gnunet-service-zonemaster-monitor.c.

Referenced by run(), and shutdown_task().

◆ zmon

struct GNUNET_NAMESTORE_ZoneMonitor* zmon
static

Handle to monitor namestore changes to instant propagation.

Definition at line 105 of file gnunet-service-zonemaster-monitor.c.

Referenced by dht_put_monitor_continuation(), handle_monitor_event(), run(), and shutdown_task().

◆ ma_head

struct DhtPutActivity* ma_head
static

Head of monitor activities; kept in a DLL.

Definition at line 110 of file gnunet-service-zonemaster-monitor.c.

Referenced by dht_put_monitor_continuation(), handle_monitor_event(), and shutdown_task().

◆ ma_tail

struct DhtPutActivity* ma_tail
static

Tail of monitor activities; kept in a DLL.

Definition at line 115 of file gnunet-service-zonemaster-monitor.c.

Referenced by dht_put_monitor_continuation(), handle_monitor_event(), and shutdown_task().

◆ ma_queue_length

unsigned int ma_queue_length
static

Number of entries in the DHT queue ma_head.

Definition at line 120 of file gnunet-service-zonemaster-monitor.c.

Referenced by dht_put_monitor_continuation(), handle_monitor_event(), and shutdown_task().

◆ cache_keys

int cache_keys
static

Optimize block insertion by caching map of private keys to public keys in memory?

Definition at line 126 of file gnunet-service-zonemaster-monitor.c.

Referenced by perform_dht_put(), and run().