diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-07-09 07:18:53 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-07-09 07:18:53 +0000 |
commit | a13d301ba2910e6df6c93eb4a15106a0323e46cc (patch) | |
tree | acf9f3c3189d65fff3a4a08f2bb33fe3be0b2153 /src/include/gnunet_namestore_service.h | |
parent | cdb6307117f72f42da7889debc4b4e903e4ca953 (diff) | |
download | gnunet-a13d301ba2910e6df6c93eb4a15106a0323e46cc.tar.gz gnunet-a13d301ba2910e6df6c93eb4a15106a0323e46cc.zip |
add '-m' option to gnunet-namestore, extend namestore monitor API with notification about being in sync
Diffstat (limited to 'src/include/gnunet_namestore_service.h')
-rw-r--r-- | src/include/gnunet_namestore_service.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/include/gnunet_namestore_service.h b/src/include/gnunet_namestore_service.h index 3966c3db2..70dbb5bb2 100644 --- a/src/include/gnunet_namestore_service.h +++ b/src/include/gnunet_namestore_service.h | |||
@@ -484,21 +484,37 @@ typedef void (*GNUNET_NAMESTORE_RecordMonitor)(void *cls, | |||
484 | 484 | ||
485 | 485 | ||
486 | /** | 486 | /** |
487 | * Function called once the monitor has caught up with the current | ||
488 | * state of the database. Will be called AGAIN after each disconnect | ||
489 | * (record monitor called with 'NULL' for zone_key) once we're again | ||
490 | * in sync. | ||
491 | * | ||
492 | * @param cls closure | ||
493 | */ | ||
494 | typedef void (*GNUNET_NAMESTORE_RecordsSynchronizedCallback)(void *cls); | ||
495 | |||
496 | |||
497 | /** | ||
487 | * Begin monitoring a zone for changes. Will first call the 'monitor' function | 498 | * Begin monitoring a zone for changes. Will first call the 'monitor' function |
488 | * on all existing records in the selected zone(s) and then call it whenever | 499 | * on all existing records in the selected zone(s), then calls 'sync_cb', |
489 | * a record changes. | 500 | * and then calls the 'monitor' whenever a record changes. If the namestore |
501 | * disconnects, the 'monitor' function is called with a disconnect event; if | ||
502 | * the connection is re-established, the process begins from the start (all | ||
503 | * existing records, sync, then updates). | ||
490 | * | 504 | * |
491 | * @param cfg configuration to use to connect to namestore | 505 | * @param cfg configuration to use to connect to namestore |
492 | * @param zone zone to monitor, NULL for all zones | 506 | * @param zone zone to monitor, NULL for all zones |
493 | * @param monitor function to call on zone changes | 507 | * @param monitor function to call on zone changes |
494 | * @param monitor_cls closure for 'monitor' | 508 | * @param sync_cb function called when we're in sync with the namestore |
509 | * @param cls closure for 'monitor' and 'sync_cb' | ||
495 | * @return handle to stop monitoring | 510 | * @return handle to stop monitoring |
496 | */ | 511 | */ |
497 | struct GNUNET_NAMESTORE_ZoneMonitor * | 512 | struct GNUNET_NAMESTORE_ZoneMonitor * |
498 | GNUNET_NAMESTORE_zone_monitor_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | 513 | GNUNET_NAMESTORE_zone_monitor_start (const struct GNUNET_CONFIGURATION_Handle *cfg, |
499 | const struct GNUNET_CRYPTO_ShortHashCode *zone, | 514 | const struct GNUNET_CRYPTO_ShortHashCode *zone, |
500 | GNUNET_NAMESTORE_RecordMonitor monitor, | 515 | GNUNET_NAMESTORE_RecordMonitor monitor, |
501 | void *monitor_cls); | 516 | GNUNET_NAMESTORE_RecordsSynchronizedCallback sync_cb, |
517 | void *cls); | ||
502 | 518 | ||
503 | 519 | ||
504 | /** | 520 | /** |