GNUnet  0.17.5
Data Structures | Macros | Functions | Variables
gnunet-service-zonemaster.c File Reference

publish records from namestore to GNUnet name system More...

#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_dnsparser_lib.h"
#include "gnunet_dht_service.h"
#include "gnunet_namestore_service.h"
#include "gnunet_statistics_service.h"
Include dependency graph for gnunet-service-zonemaster.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 DELTA_INTERVAL   100
 How often do we measure the delta between desired zone iteration speed and actual speed, and tell statistics service about it? More...
 
#define NS_BLOCK_SIZE   1000
 How many records do we fetch in one shot from the namestore? More...
 
#define DHT_QUEUE_LIMIT   2000
 How many pending DHT operations do we allow at most? More...
 
#define NAMESTORE_QUEUE_LIMIT   50
 How many events may the namestore give us before it has to wait for us to keep up? More...
 
#define INITIAL_ZONE_ITERATION_INTERVAL   GNUNET_TIME_UNIT_MILLISECONDS
 The initial interval in milliseconds btween puts in a zone iteration. More...
 
#define MAXIMUM_ZONE_ITERATION_INTERVAL
 The upper bound for the zone iteration interval (per record). More...
 
#define LATE_ITERATION_SPEEDUP_FACTOR   2
 The factor the current zone iteration interval is divided by for each additional new record. 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 publish_zone_namestore_next (void *cls)
 Method called periodically that triggers iteration over authoritative records. More...
 
static void publish_zone_dht_start (void *cls)
 Periodically iterate over our zone and store everything in dht. More...
 
static void calculate_put_interval ()
 Calculate target_iteration_velocity_per_record. More...
 
static void update_velocity (unsigned int cnt)
 Re-calculate our velocity and the desired velocity. More...
 
static void check_zone_namestore_next ()
 Check if the current zone iteration needs to be continued by calling publish_zone_namestore_next(), and if so with what delay. More...
 
static void dht_put_continuation (void *cls)
 Continuation called from DHT once the PUT operation 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, const struct GNUNET_TIME_Absolute expire, struct DhtPutActivity *ma)
 Store GNS records in the DHT. More...
 
static void zone_iteration_error (void *cls)
 We encountered an error in our zone iteration. More...
 
static void zone_iteration_finished (void *cls)
 Zone iteration is completed. More...
 
static void put_gns_record (void *cls, const struct GNUNET_IDENTITY_PrivateKey *key, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
 Function used to put all records successively into the DHT. 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", 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_ZoneIteratornamestore_iter
 Handle to iterate over our authoritative zone in namestore. More...
 
static struct DhtPutActivityit_head
 Head of iteration put activities; kept in a DLL. More...
 
static struct DhtPutActivityit_tail
 Tail of iteration put activities; kept in a DLL. More...
 
static unsigned int dht_queue_length
 Number of entries in the DHT queue it_head. More...
 
static unsigned long long num_public_records
 Useful for zone update for DHT put. More...
 
static unsigned long long last_num_public_records
 Last seen record count. More...
 
static unsigned long long put_cnt
 Number of successful put operations performed in the current measurement cycle (as measured in check_zone_namestore_next()). More...
 
static struct GNUNET_TIME_Relative target_iteration_velocity_per_record
 What is the frequency at which we currently would like to perform DHT puts (per record)? Calculated in update_velocity() from the zone_publish_time_window() and the total number of record sets we have (so far) observed in the zone. More...
 
static struct GNUNET_TIME_Relative min_relative_record_time
 Minimum relative expiration time of records seem during the current zone iteration. More...
 
static struct GNUNET_TIME_Relative last_min_relative_record_time
 Minimum relative expiration time of records seem during the last zone iteration. More...
 
static struct GNUNET_TIME_Relative zone_publish_time_window_default
 Default time window for zone iteration. More...
 
static struct GNUNET_TIME_Relative zone_publish_time_window
 Time window for zone iteration, adjusted based on relative record expiration times in our zone. More...
 
static struct GNUNET_TIME_Absolute last_put_100
 When did we last start measuring the DELTA_INTERVAL successful DHT puts? Used for velocity calculations. More...
 
static struct GNUNET_TIME_Relative sub_delta
 By how much should we try to increase our per-record iteration speed (over the desired speed calculated directly from the #put_interval)? Basically this value corresponds to the per-record CPU time overhead we have. More...
 
static struct GNUNET_SCHEDULER_Taskzone_publish_task
 zone publish task More...
 
static unsigned int ns_iteration_left
 How many more values are left for the current query before we need to explicitly ask the namestore for more? More...
 
static int first_zone_iteration
 GNUNET_YES if zone has never been published before More...
 
static int cache_keys
 Optimize block insertion by caching map of private keys to public keys in memory? More...
 

Detailed Description

publish records from namestore to GNUnet name system

Author
Christian Grothoff

Definition in file gnunet-service-zonemaster.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 33 of file gnunet-service-zonemaster.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 43 of file gnunet-service-zonemaster.c.

◆ DELTA_INTERVAL

#define DELTA_INTERVAL   100

How often do we measure the delta between desired zone iteration speed and actual speed, and tell statistics service about it?

Definition at line 50 of file gnunet-service-zonemaster.c.

◆ NS_BLOCK_SIZE

#define NS_BLOCK_SIZE   1000

How many records do we fetch in one shot from the namestore?

Definition at line 55 of file gnunet-service-zonemaster.c.

◆ DHT_QUEUE_LIMIT

#define DHT_QUEUE_LIMIT   2000

How many pending DHT operations do we allow at most?

Definition at line 60 of file gnunet-service-zonemaster.c.

◆ NAMESTORE_QUEUE_LIMIT

#define NAMESTORE_QUEUE_LIMIT   50

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

Definition at line 66 of file gnunet-service-zonemaster.c.

◆ INITIAL_ZONE_ITERATION_INTERVAL

#define INITIAL_ZONE_ITERATION_INTERVAL   GNUNET_TIME_UNIT_MILLISECONDS

The initial interval in milliseconds btween puts in a zone iteration.

Definition at line 72 of file gnunet-service-zonemaster.c.

◆ MAXIMUM_ZONE_ITERATION_INTERVAL

#define MAXIMUM_ZONE_ITERATION_INTERVAL
Value:
#define GNUNET_TIME_UNIT_MINUTES
One minute.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
Definition: time.c:483

The upper bound for the zone iteration interval (per record).

Definition at line 78 of file gnunet-service-zonemaster.c.

◆ LATE_ITERATION_SPEEDUP_FACTOR

#define LATE_ITERATION_SPEEDUP_FACTOR   2

The factor the current zone iteration interval is divided by for each additional new record.

Definition at line 85 of file gnunet-service-zonemaster.c.

◆ DHT_GNS_REPLICATION_LEVEL

#define DHT_GNS_REPLICATION_LEVEL   5

What replication level do we use for DHT PUT operations?

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

Function Documentation

◆ shutdown_task()

static void shutdown_task ( void *  cls)
static

Task run during shutdown.

Parameters
clsunused
tcunused

Definition at line 246 of file gnunet-service-zonemaster.c.

247 {
248  struct DhtPutActivity *ma;
249 
250  (void) cls;
252  "Shutting down!\n");
253  while (NULL != (ma = it_head))
254  {
258  it_tail,
259  ma);
261  GNUNET_free (ma);
262  }
263  if (NULL != statistics)
264  {
266  GNUNET_NO);
267  statistics = NULL;
268  }
269  if (NULL != zone_publish_task)
270  {
272  zone_publish_task = NULL;
273  }
274  if (NULL != namestore_iter)
275  {
277  namestore_iter = NULL;
278  }
279  if (NULL != namestore_handle)
280  {
282  namestore_handle = NULL;
283  }
284  if (NULL != dht_handle)
285  {
287  dht_handle = NULL;
288  }
289 }
static struct DhtPutActivity * it_head
Head of iteration put activities; kept in a DLL.
static struct GNUNET_NAMESTORE_Handle * namestore_handle
Our handle to the namestore service.
static unsigned int dht_queue_length
Number of entries in the DHT queue it_head.
static struct GNUNET_STATISTICS_Handle * statistics
Handle to the statistics service.
static struct GNUNET_DHT_Handle * dht_handle
Our handle to the DHT.
static struct GNUNET_SCHEDULER_Task * zone_publish_task
zone publish task
static struct GNUNET_NAMESTORE_ZoneIterator * namestore_iter
Handle to iterate over our authoritative zone in namestore.
static struct DhtPutActivity * it_tail
Tail of iteration put activities; kept in a DLL.
void GNUNET_DHT_put_cancel(struct GNUNET_DHT_PutHandle *ph)
Cancels a DHT PUT operation.
Definition: dht_api.c:1148
void GNUNET_DHT_disconnect(struct GNUNET_DHT_Handle *handle)
Shutdown connection with the DHT service.
Definition: dht_api.c:1062
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_log(kind,...)
@ GNUNET_NO
Definition: gnunet_common.h:98
@ 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_iteration_stop(struct GNUNET_NAMESTORE_ZoneIterator *it)
Stops iteration and releases the namestore handle for further calls.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:957
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, dht_queue_length, 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_iteration_stop(), GNUNET_NO, GNUNET_SCHEDULER_cancel(), GNUNET_STATISTICS_destroy(), it_head, it_tail, namestore_handle, namestore_iter, DhtPutActivity::ph, statistics, and zone_publish_task.

Referenced by run().

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

◆ publish_zone_namestore_next()

static void publish_zone_namestore_next ( void *  cls)
static

Method called periodically that triggers iteration over authoritative records.

Parameters
clsNULL

Definition at line 298 of file gnunet-service-zonemaster.c.

299 {
300  (void) cls;
301  zone_publish_task = NULL;
302  GNUNET_assert (NULL != namestore_iter);
306  NS_BLOCK_SIZE);
307 }
static unsigned int ns_iteration_left
How many more values are left for the current query before we need to explicitly ask the namestore fo...
#define NS_BLOCK_SIZE
How many records do we fetch in one shot from the namestore?
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
void GNUNET_NAMESTORE_zone_iterator_next(struct GNUNET_NAMESTORE_ZoneIterator *it, uint64_t limit)
Calls the record processor specified in GNUNET_NAMESTORE_zone_iteration_start for the next record.

References GNUNET_assert, GNUNET_NAMESTORE_zone_iterator_next(), namestore_iter, NS_BLOCK_SIZE, ns_iteration_left, and zone_publish_task.

Referenced by check_zone_namestore_next().

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

◆ publish_zone_dht_start()

static void publish_zone_dht_start ( void *  cls)
static

Periodically iterate over our zone and store everything in dht.

Periodically iterate over all zones and store everything in DHT.

Parameters
clsNULL

Definition at line 781 of file gnunet-service-zonemaster.c.

782 {
783  (void) cls;
784  zone_publish_task = NULL;
786  "Full zone iterations launched",
787  1,
788  GNUNET_NO);
790  "Starting DHT zone update!\n");
791  /* start counting again */
792  num_public_records = 0;
793  GNUNET_assert (NULL == namestore_iter);
794  ns_iteration_left = 1;
797  NULL, /* All zones */
799  NULL,
801  NULL,
803  NULL);
804  GNUNET_assert (NULL != namestore_iter);
805 }
static void zone_iteration_finished(void *cls)
Zone iteration is completed.
static unsigned long long num_public_records
Useful for zone update for DHT put.
static void zone_iteration_error(void *cls)
We encountered an error in our zone iteration.
static void put_gns_record(void *cls, const struct GNUNET_IDENTITY_PrivateKey *key, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Function used to put all records successively into the DHT.
struct GNUNET_NAMESTORE_ZoneIterator * GNUNET_NAMESTORE_zone_iteration_start(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *zone, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
Starts a new zone iteration (used to periodically PUT all of our records into our DHT).
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.

References GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NAMESTORE_zone_iteration_start(), GNUNET_NO, GNUNET_STATISTICS_update(), namestore_handle, namestore_iter, ns_iteration_left, num_public_records, put_gns_record(), statistics, zone_iteration_error(), zone_iteration_finished(), and zone_publish_task.

Referenced by run(), zone_iteration_error(), and zone_iteration_finished().

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

◆ calculate_put_interval()

static void calculate_put_interval ( )
static

Calculate target_iteration_velocity_per_record.

If no records are known (startup) or none present we can safely set the interval to the value for a single record

Definition at line 323 of file gnunet-service-zonemaster.c.

324 {
325  if (0 == num_public_records)
333  "No records in namestore database.\n");
334  }
335  else
336  {
348  }
353  "Minimum relative record expiration (in μs)",
355  GNUNET_NO);
357  "Zone publication time window (in μs)",
359  GNUNET_NO);
361  "Target zone iteration velocity (μs)",
363  GNUNET_NO);
364 }
#define PUBLISH_OPS_PER_EXPIRATION
How often should we (re)publish each record before it expires?
static struct GNUNET_TIME_Relative target_iteration_velocity_per_record
What is the frequency at which we currently would like to perform DHT puts (per record)?...
static unsigned long long last_num_public_records
Last seen record count.
static struct GNUNET_TIME_Relative zone_publish_time_window
Time window for zone iteration, adjusted based on relative record expiration times in our zone.
static struct GNUNET_TIME_Relative min_relative_record_time
Minimum relative expiration time of records seem during the current zone iteration.
static struct GNUNET_TIME_Relative zone_publish_time_window_default
Default time window for zone iteration.
static struct GNUNET_TIME_Relative last_min_relative_record_time
Minimum relative expiration time of records seem during the last zone iteration.
#define MAXIMUM_ZONE_ITERATION_INTERVAL
The upper bound for the zone iteration interval (per record).
@ GNUNET_ERROR_TYPE_BULK
void GNUNET_STATISTICS_set(struct GNUNET_STATISTICS_Handle *handle, const char *name, uint64_t value, int make_persistent)
Set statistic value for the peer.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_min(struct GNUNET_TIME_Relative t1, struct GNUNET_TIME_Relative t2)
Return the minimum of two relative time values.
Definition: time.c:342
struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Divide relative time by a given factor.
Definition: time.c:549
uint64_t rel_value_us
The actual value.

References GNUNET_ERROR_TYPE_BULK, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_set(), GNUNET_TIME_relative_divide(), GNUNET_TIME_relative_min(), last_min_relative_record_time, last_num_public_records, MAXIMUM_ZONE_ITERATION_INTERVAL, min_relative_record_time, num_public_records, PUBLISH_OPS_PER_EXPIRATION, GNUNET_TIME_Relative::rel_value_us, statistics, target_iteration_velocity_per_record, zone_publish_time_window, and zone_publish_time_window_default.

Referenced by update_velocity(), and zone_iteration_finished().

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

◆ update_velocity()

static void update_velocity ( unsigned int  cnt)
static

Re-calculate our velocity and the desired velocity.

We have succeeded in making DELTA_INTERVAL puts, so now calculate the new desired delay between puts.

Parameters
cnthow many records were processed since the last call?

Definition at line 375 of file gnunet-service-zonemaster.c.

376 {
378  unsigned long long pct = 0;
379 
380  if (0 == cnt)
381  return;
382  /* How fast were we really? */
384  delta.rel_value_us /= cnt;
386 
387  /* calculate expected frequency */
390  {
392  "Last record count was lower than current record count. Reducing interval.\n");
396  }
398  "Desired global zone iteration interval is %s/record!\n",
401  GNUNET_YES));
402 
403  /* Tell statistics actual vs. desired speed */
405  "Current zone iteration velocity (μs/record)",
407  GNUNET_NO);
408  /* update "sub_delta" based on difference, taking
409  previous sub_delta into account! */
411  {
412  /* We were too fast, reduce sub_delta! */
413  struct GNUNET_TIME_Relative corr;
414 
416  delta);
418  {
419  /* Reduce sub_delta by corr */
421  corr);
422  }
423  else
424  {
425  /* We're doing fine with waiting the full time, this
426  should theoretically only happen if we run at
427  infinite speed. */
429  }
430  }
433  {
434  /* We were too slow, increase sub_delta! */
435  struct GNUNET_TIME_Relative corr;
436 
440  corr);
441  if (sub_delta.rel_value_us >
443  {
444  /* CPU overload detected, we cannot go at desired speed,
445  as this would mean using a negative delay. */
446  /* compute how much faster we would want to be for
447  the desired velocity */
449  pct = UINT64_MAX; /* desired speed is infinity ... */
450  else
451  pct = (sub_delta.rel_value_us
455  }
456  }
458  "# size of the DHT queue (it)",
460  GNUNET_NO);
462  "% speed increase needed for target velocity",
463  pct,
464  GNUNET_NO);
466  "# records processed in current iteration",
468  GNUNET_NO);
469 }
static struct GNUNET_TIME_Relative sub_delta
By how much should we try to increase our per-record iteration speed (over the desired speed calculat...
static void calculate_put_interval()
Calculate target_iteration_velocity_per_record.
#define LATE_ITERATION_SPEEDUP_FACTOR
The factor the current zone iteration interval is divided by for each additional new record.
static int first_zone_iteration
GNUNET_YES if zone has never been published before
static struct GNUNET_TIME_Absolute last_put_100
When did we last start measuring the DELTA_INTERVAL successful DHT puts? Used for velocity calculatio...
@ GNUNET_YES
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_Relative GNUNET_TIME_relative_subtract(struct GNUNET_TIME_Relative a1, struct GNUNET_TIME_Relative a2)
Subtract relative timestamp from the other.
Definition: time.c:602
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
Definition: time.c:110
struct GNUNET_TIME_Relative GNUNET_TIME_relative_add(struct GNUNET_TIME_Relative a1, struct GNUNET_TIME_Relative a2)
Add relative times together.
Definition: time.c:584
#define GNUNET_TIME_UNIT_ZERO
Relative time zero.
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
static struct GNUNET_TIME_Relative delta
Definition: speedup.c:35
Time for relative time used by GNUnet, in microseconds.

References calculate_put_interval(), delta, dht_queue_length, first_zone_iteration, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_set(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_relative_add(), GNUNET_TIME_relative_subtract(), GNUNET_TIME_UNIT_ZERO, GNUNET_YES, last_num_public_records, last_put_100, LATE_ITERATION_SPEEDUP_FACTOR, num_public_records, GNUNET_TIME_Relative::rel_value_us, statistics, sub_delta, and target_iteration_velocity_per_record.

Referenced by check_zone_namestore_next(), and put_gns_record().

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

◆ check_zone_namestore_next()

static void check_zone_namestore_next ( )
static

Check if the current zone iteration needs to be continued by calling publish_zone_namestore_next(), and if so with what delay.

Definition at line 477 of file gnunet-service-zonemaster.c.

478 {
480 
481  if (0 != ns_iteration_left)
482  return; /* current NAMESTORE iteration not yet done */
484  put_cnt = 0;
486  sub_delta);
487  /* We delay *once* per #NS_BLOCK_SIZE, so we need to multiply the
488  per-record delay calculated so far with the #NS_BLOCK_SIZE */
490  "Current artificial NAMESTORE delay (μs/record)",
492  GNUNET_NO);
494  NS_BLOCK_SIZE);
495  /* make sure we do not overshoot because of the #NS_BLOCK_SIZE factor */
497  delay);
498  /* no delays on first iteration */
504  NULL);
505 }
static struct GNUNET_TIME_Relative delay
When should dkg communication start?
static unsigned long long put_cnt
Number of successful put operations performed in the current measurement cycle (as measured in check_...
static void publish_zone_namestore_next(void *cls)
Method called periodically that triggers iteration over authoritative records.
static void update_velocity(unsigned int cnt)
Re-calculate our velocity and the desired velocity.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition: scheduler.c:1254

References delay, first_zone_iteration, GNUNET_assert, GNUNET_NO, GNUNET_SCHEDULER_add_delayed(), GNUNET_STATISTICS_set(), GNUNET_TIME_relative_min(), GNUNET_TIME_relative_multiply(), GNUNET_TIME_relative_subtract(), GNUNET_TIME_UNIT_ZERO, GNUNET_YES, MAXIMUM_ZONE_ITERATION_INTERVAL, NS_BLOCK_SIZE, ns_iteration_left, publish_zone_namestore_next(), put_cnt, GNUNET_TIME_Relative::rel_value_us, statistics, sub_delta, target_iteration_velocity_per_record, update_velocity(), and zone_publish_task.

Referenced by put_gns_record().

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

◆ dht_put_continuation()

static void dht_put_continuation ( void *  cls)
static

Continuation called from DHT once the PUT operation is done.

Parameters
clsa struct DhtPutActivity

Definition at line 514 of file gnunet-service-zonemaster.c.

515 {
516  struct DhtPutActivity *ma = cls;
517 
519  "PUT complete\n");
522  it_tail,
523  ma);
524  GNUNET_free (ma);
525 }

References dht_queue_length, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, it_head, and it_tail.

Referenced by perform_dht_put().

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,
const 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 540 of file gnunet-service-zonemaster.c.

546 {
547  struct GNUNET_GNSRECORD_Block *block;
548  struct GNUNET_HashCode query;
549  size_t block_size;
550  struct GNUNET_DHT_PutHandle *ret;
551 
552  if (cache_keys)
554  expire,
555  label,
556  rd_public,
557  rd_public_count,
558  &block));
559  else
561  expire,
562  label,
563  rd_public,
564  rd_public_count,
565  &block));
566  if (NULL == block)
567  {
568  GNUNET_break (0);
569  return NULL; /* whoops */
570  }
571  block_size = GNUNET_GNSRECORD_block_get_size (block);
573  label,
574  &query);
576  "DHT put operations initiated",
577  1,
578  GNUNET_NO);
580  "Storing %u record(s) for label `%s' in DHT with expiration `%s' under key %s\n",
581  rd_public_count,
582  label,
584  GNUNET_h2s (&query));
587  &query,
591  block_size,
592  block,
593  expire,
595  ma);
596  GNUNET_free (block);
597  return ret;
598 }
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:101
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_continuation(void *cls)
Continuation called from DHT once the PUT operation is done.
@ 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:1090
@ 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.
@ GNUNET_OK
Definition: gnunet_common.h:99
#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).
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_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, num_public_records, ret, and statistics.

Referenced by put_gns_record().

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

◆ zone_iteration_error()

static void zone_iteration_error ( void *  cls)
static

We encountered an error in our zone iteration.

Parameters
clsNULL

Definition at line 607 of file gnunet-service-zonemaster.c.

608 {
609  (void) cls;
611  "Got disconnected from namestore database, retrying.\n");
612  namestore_iter = NULL;
613  /* We end up here on error/disconnect/shutdown, so potentially
614  while a zone publish task or a DHT put is still running; hence
615  we need to cancel those. */
616  if (NULL != zone_publish_task)
617  {
619  zone_publish_task = NULL;
620  }
622  NULL);
623 }
static void publish_zone_dht_start(void *cls)
Periodically iterate over our zone and store everything in dht.
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

References GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_cancel(), namestore_iter, publish_zone_dht_start(), and zone_publish_task.

Referenced by publish_zone_dht_start().

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

◆ zone_iteration_finished()

static void zone_iteration_finished ( void *  cls)
static

Zone iteration is completed.

Parameters
clsNULL

Definition at line 632 of file gnunet-service-zonemaster.c.

633 {
634  (void) cls;
635  /* we're done with one iteration, calculate when to do the next one */
636  namestore_iter = NULL;
641  /* reset for next iteration */
645  "Zone iteration finished. Adjusted zone iteration interval to %s\n",
648  GNUNET_YES));
650  "Target zone iteration velocity (μs)",
652  GNUNET_NO);
654  "Number of public records in DHT",
656  GNUNET_NO);
658  if (0 == last_num_public_records)
659  {
663  NULL);
664  }
665  else
666  {
668  NULL);
669  }
670 }
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".

References calculate_put_interval(), first_zone_iteration, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_add_now(), GNUNET_STATISTICS_set(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, last_min_relative_record_time, last_num_public_records, min_relative_record_time, namestore_iter, num_public_records, publish_zone_dht_start(), GNUNET_TIME_Relative::rel_value_us, statistics, target_iteration_velocity_per_record, and zone_publish_task.

Referenced by publish_zone_dht_start().

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

◆ put_gns_record()

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

Function used to put all records successively into the DHT.

Parameters
clsthe closure (NULL)
keythe private key of the authority (ours)
labelthe name of the records, NULL once the iteration is done
rd_countthe number of records in rd
rdthe record data

Definition at line 682 of file gnunet-service-zonemaster.c.

687 {
688  struct GNUNET_GNSRECORD_Data rd_public[rd_count];
689  unsigned int rd_public_count;
690  struct DhtPutActivity *ma;
692  char *emsg;
693 
694  (void) cls;
697  rd,
698  rd_count,
699  rd_public,
700  &rd_public_count,
701  &expire,
702  &emsg))
703  {
705  "Record set inconsistent, moving to next record set: %s\n",
706  emsg);
707  GNUNET_free (emsg);
709  return;
710  }
711  if (0 == rd_public_count)
712  {
714  "Record set empty, moving to next record set\n");
716  return;
717  }
718  for (unsigned int i = 0; i < rd_public_count; i++)
719  {
720  if (0 != (rd_public[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION))
721  {
722  /* GNUNET_GNSRECORD_block_create will convert to absolute time;
723  we just need to adjust our iteration frequency */
725  GNUNET_MIN (rd_public[i].expiration_time,
727  }
728  }
729 
730 
731  /* We got a set of records to publish */
733  "Starting DHT PUT\n");
734 
735  ma = GNUNET_new (struct DhtPutActivity);
737  ma->ph = perform_dht_put (key,
738  label,
739  rd_public,
740  rd_public_count,
741  expire,
742  ma);
743  put_cnt++;
744  if (0 == put_cnt % DELTA_INTERVAL)
747  if (NULL == ma->ph)
748  {
750  "Could not perform DHT PUT, is the DHT running?\n");
751  GNUNET_free (ma);
752  return;
753  }
756  it_tail,
757  ma);
759  {
760  ma = it_head;
762  it_tail,
763  ma);
767  "DHT PUT unconfirmed after %s, aborting PUT\n",
770  GNUNET_YES));
771  GNUNET_free (ma);
772  }
773 }
static void check_zone_namestore_next()
Check if the current zone iteration needs to be continued by calling publish_zone_namestore_next(),...
#define DHT_QUEUE_LIMIT
How many pending DHT operations do we allow at most?
#define DELTA_INTERVAL
How often do we measure the delta between desired zone iteration speed and actual speed,...
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, const struct GNUNET_TIME_Absolute expire, struct DhtPutActivity *ma)
Store GNS records in the DHT.
#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_GNSRECORD_RF_RELATIVE_EXPIRATION
This expiration time of the record is a relative time (not an absolute time).
#define GNUNET_MIN(a, b)
@ GNUNET_ERROR_TYPE_WARNING
#define GNUNET_new(type)
Allocate a struct or union of the given type.
struct GNUNET_TIME_Absolute start_date
When was this PUT initiated?
Time for absolute times used by GNUnet, in microseconds.

References check_zone_namestore_next(), DELTA_INTERVAL, dht_queue_length, DHT_QUEUE_LIMIT, expire, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CONTAINER_DLL_remove, GNUNET_DHT_put_cancel(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_GNSRECORD_convert_records_for_export(), GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION, GNUNET_log, GNUNET_MIN, GNUNET_new, GNUNET_OK, GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_get_duration(), GNUNET_YES, it_head, it_tail, key, min_relative_record_time, ns_iteration_left, perform_dht_put(), DhtPutActivity::ph, put_cnt, GNUNET_TIME_Relative::rel_value_us, DhtPutActivity::start_date, and update_velocity().

Referenced by publish_zone_dht_start().

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 816 of file gnunet-service-zonemaster.c.

819 {
820  unsigned long long max_parallel_bg_queries = 128;
821 
822  (void) cls;
823  (void) service;
824  last_put_100 = GNUNET_TIME_absolute_get (); /* first time! */
829  if (NULL == namestore_handle)
830  {
832  _ ("Failed to connect to the namestore!\n"));
834  return;
835  }
837  "namestore",
838  "CACHE_KEYS");
840  if (GNUNET_OK ==
842  "zonemaster",
843  "ZONE_PUBLISH_TIME_WINDOW",
845  {
847  "Time window for zone iteration: %s\n",
850  GNUNET_YES));
851  }
853  if (GNUNET_OK ==
855  "zonemaster",
856  "MAX_PARALLEL_BACKGROUND_QUERIES",
857  &max_parallel_bg_queries))
858  {
860  "Number of allowed parallel background queries: %llu\n",
861  max_parallel_bg_queries);
862  }
863  if (0 == max_parallel_bg_queries)
864  max_parallel_bg_queries = 1;
866  (unsigned int) max_parallel_bg_queries);
867  if (NULL == dht_handle)
868  {
870  _ ("Could not connect to DHT!\n"));
872  NULL);
873  return;
874  }
875 
876  /* Schedule periodic put for our records. */
878  statistics = GNUNET_STATISTICS_create ("zonemaster",
879  c);
881  "Target zone iteration velocity (μs)",
883  GNUNET_NO);
885  NULL);
887  NULL);
888 }
static struct GNUNET_SERVICE_Handle * service
Handle to our service instance.
static void shutdown_task(void *cls)
Task run during shutdown.
#define INITIAL_ZONE_ITERATION_INTERVAL
The initial interval in milliseconds btween puts in a zone iteration.
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".
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_time(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, struct GNUNET_TIME_Relative *time)
Get a configuration value that should be a relative time.
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:1039
#define GNUNET_DHT_DEFAULT_REPUBLISH_FREQUENCY
Default republication frequency for stored data in the DHT.
@ GNUNET_ERROR_TYPE_ERROR
struct GNUNET_NAMESTORE_Handle * GNUNET_NAMESTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the namestore service.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:533
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, first_zone_iteration, GNUNET_CONFIGURATION_get_value_number(), GNUNET_CONFIGURATION_get_value_time(), GNUNET_CONFIGURATION_get_value_yesno(), GNUNET_DHT_connect(), GNUNET_DHT_DEFAULT_REPUBLISH_FREQUENCY, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_NAMESTORE_connect(), GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_shutdown(), GNUNET_STATISTICS_create(), GNUNET_STATISTICS_set(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_absolute_get(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, INITIAL_ZONE_ITERATION_INTERVAL, last_put_100, min_relative_record_time, namestore_handle, publish_zone_dht_start(), GNUNET_TIME_Relative::rel_value_us, service, shutdown_task(), statistics, target_iteration_velocity_per_record, zone_publish_task, zone_publish_time_window, and zone_publish_time_window_default.

Here is the call graph for this function:

◆ GNUNET_SERVICE_MAIN()

GNUNET_SERVICE_MAIN ( "zonemaster"  ,
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

◆ dht_handle

struct GNUNET_DHT_Handle* dht_handle
static

Our handle to the DHT.

Definition at line 127 of file gnunet-service-zonemaster.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 132 of file gnunet-service-zonemaster.c.

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

◆ namestore_iter

struct GNUNET_NAMESTORE_ZoneIterator* namestore_iter
static

Handle to iterate over our authoritative zone in namestore.

Definition at line 137 of file gnunet-service-zonemaster.c.

Referenced by publish_zone_dht_start(), publish_zone_namestore_next(), shutdown_task(), zone_iteration_error(), and zone_iteration_finished().

◆ it_head

struct DhtPutActivity* it_head
static

Head of iteration put activities; kept in a DLL.

Definition at line 142 of file gnunet-service-zonemaster.c.

Referenced by dht_put_continuation(), put_gns_record(), and shutdown_task().

◆ it_tail

struct DhtPutActivity* it_tail
static

Tail of iteration put activities; kept in a DLL.

Definition at line 147 of file gnunet-service-zonemaster.c.

Referenced by dht_put_continuation(), put_gns_record(), and shutdown_task().

◆ dht_queue_length

unsigned int dht_queue_length
static

Number of entries in the DHT queue it_head.

Definition at line 152 of file gnunet-service-zonemaster.c.

Referenced by dht_put_continuation(), put_gns_record(), shutdown_task(), and update_velocity().

◆ num_public_records

unsigned long long num_public_records
static

Useful for zone update for DHT put.

Definition at line 157 of file gnunet-service-zonemaster.c.

Referenced by calculate_put_interval(), perform_dht_put(), publish_zone_dht_start(), update_velocity(), and zone_iteration_finished().

◆ last_num_public_records

unsigned long long last_num_public_records
static

Last seen record count.

Definition at line 162 of file gnunet-service-zonemaster.c.

Referenced by calculate_put_interval(), update_velocity(), and zone_iteration_finished().

◆ put_cnt

unsigned long long put_cnt
static

Number of successful put operations performed in the current measurement cycle (as measured in check_zone_namestore_next()).

Definition at line 168 of file gnunet-service-zonemaster.c.

Referenced by check_zone_namestore_next(), and put_gns_record().

◆ target_iteration_velocity_per_record

struct GNUNET_TIME_Relative target_iteration_velocity_per_record
static

What is the frequency at which we currently would like to perform DHT puts (per record)? Calculated in update_velocity() from the zone_publish_time_window() and the total number of record sets we have (so far) observed in the zone.

Definition at line 168 of file gnunet-service-zonemaster.c.

Referenced by calculate_put_interval(), check_zone_namestore_next(), run(), update_velocity(), and zone_iteration_finished().

◆ min_relative_record_time

struct GNUNET_TIME_Relative min_relative_record_time
static

Minimum relative expiration time of records seem during the current zone iteration.

Definition at line 168 of file gnunet-service-zonemaster.c.

Referenced by calculate_put_interval(), put_gns_record(), run(), and zone_iteration_finished().

◆ last_min_relative_record_time

struct GNUNET_TIME_Relative last_min_relative_record_time
static

Minimum relative expiration time of records seem during the last zone iteration.

Definition at line 168 of file gnunet-service-zonemaster.c.

Referenced by calculate_put_interval(), and zone_iteration_finished().

◆ zone_publish_time_window_default

struct GNUNET_TIME_Relative zone_publish_time_window_default
static

Default time window for zone iteration.

Definition at line 168 of file gnunet-service-zonemaster.c.

Referenced by calculate_put_interval(), and run().

◆ zone_publish_time_window

struct GNUNET_TIME_Relative zone_publish_time_window
static

Time window for zone iteration, adjusted based on relative record expiration times in our zone.

Definition at line 168 of file gnunet-service-zonemaster.c.

Referenced by calculate_put_interval(), and run().

◆ last_put_100

struct GNUNET_TIME_Absolute last_put_100
static

When did we last start measuring the DELTA_INTERVAL successful DHT puts? Used for velocity calculations.

Definition at line 168 of file gnunet-service-zonemaster.c.

Referenced by run(), and update_velocity().

◆ sub_delta

struct GNUNET_TIME_Relative sub_delta
static

By how much should we try to increase our per-record iteration speed (over the desired speed calculated directly from the #put_interval)? Basically this value corresponds to the per-record CPU time overhead we have.

Definition at line 168 of file gnunet-service-zonemaster.c.

Referenced by check_zone_namestore_next(), and update_velocity().

◆ zone_publish_task

struct GNUNET_SCHEDULER_Task* zone_publish_task
static

◆ ns_iteration_left

unsigned int ns_iteration_left
static

How many more values are left for the current query before we need to explicitly ask the namestore for more?

Definition at line 225 of file gnunet-service-zonemaster.c.

Referenced by check_zone_namestore_next(), publish_zone_dht_start(), publish_zone_namestore_next(), and put_gns_record().

◆ first_zone_iteration

int first_zone_iteration
static

GNUNET_YES if zone has never been published before

Definition at line 230 of file gnunet-service-zonemaster.c.

Referenced by check_zone_namestore_next(), run(), update_velocity(), and zone_iteration_finished().

◆ cache_keys

int cache_keys
static

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

Definition at line 236 of file gnunet-service-zonemaster.c.

Referenced by perform_dht_put(), and run().