GNUnet 0.21.1
gnunet_namestore_service.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet
3 Copyright (C) 2012, 2013, 2018 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
41#ifndef GNUNET_NAMESTORE_SERVICE_H
42#define GNUNET_NAMESTORE_SERVICE_H
43
44
45#include "gnunet_error_codes.h"
46#include "gnunet_util_lib.h"
48
49#ifdef __cplusplus
50extern "C"
51{
52#if 0 /* keep Emacsens' auto-indent happy */
53}
54#endif
55#endif
56
57
62
67
72
78{
82};
83
89{
90 const char *a_label;
91 unsigned int a_rd_count;
93};
94
95
104
105
113void
115
116
127typedef void
129 enum GNUNET_ErrorCode ec);
130
131
157 const struct GNUNET_CRYPTO_PrivateKey *pkey,
158 const char *label,
159 unsigned int rd_count,
160 const struct GNUNET_GNSRECORD_Data *rd,
162 void *cont_cls);
163
194 const struct GNUNET_CRYPTO_PrivateKey *pkey,
195 unsigned int rd_set_count,
196 const struct GNUNET_NAMESTORE_RecordInfo *record_info,
197 unsigned int *rds_sent,
199 void *cont_cls);
200
224 const struct GNUNET_CRYPTO_PrivateKey *pkey,
225 const char *label,
226 unsigned int rd_count,
227 const struct GNUNET_GNSRECORD_Data *rd,
228 int is_zonemaster,
230 void *cont_cls);
231
232
242typedef void
244 const struct
246 const char *label,
247 unsigned int rd_count,
248 const struct GNUNET_GNSRECORD_Data *rd);
259typedef void
261 enum GNUNET_ErrorCode ec,
262 unsigned int rd_count,
263 const struct
265 const char *editor_hint);
266
279typedef void
281 const struct
283 const char *label,
284 unsigned int rd_count,
285 const struct GNUNET_GNSRECORD_Data *rd,
286 struct GNUNET_TIME_Absolute expiry);
287
288
305 const struct
307 const char *label,
309 void *error_cb_cls,
311 void *rm_cls);
312
330 const struct
332 const char *label,
334 void *error_cb_cls,
336 void *rm_cls,
338
339
359 const struct GNUNET_CRYPTO_PrivateKey *zone,
360 const struct
361 GNUNET_CRYPTO_PublicKey *value_zone,
363 void *error_cb_cls,
365 void *proc_cls);
366
367
376void
378
379
410 const struct
413 void *error_cb_cls,
415 void *proc_cls,
417 void *finish_cb_cls);
418
447 const struct
450 void *error_cb_cls,
452 void *proc_cls,
454 void *finish_cb_cls,
456
457
466void
468 uint64_t limit);
469
470
478void
480
481
486
487
520 const struct GNUNET_CONFIGURATION_Handle *cfg,
521 const struct GNUNET_CRYPTO_PrivateKey *zone,
522 int iterate_first,
524 void *error_cb_cls,
526 void *monitor_cls,
528 void *sync_cb_cls);
529
560 const struct GNUNET_CONFIGURATION_Handle *cfg,
561 const struct GNUNET_CRYPTO_PrivateKey *zone,
562 int iterate_first,
564 void *error_cb_cls,
566 void *monitor_cls,
568 void *sync_cb_cls,
570
571
593void
595 uint64_t limit);
596
597
603void
605
606
631 const struct
633 const char *label,
634 const char *editor_hint,
636 edit_cb,
637 void *edit_cb_cls);
638
660 const struct
662 const char *label,
663 const char *editor_hint,
664 const char *editor_hint_replacement,
667 void *finished_cls);
668
669#if 0 /* keep Emacsens' auto-indent happy */
670{
671#endif
672#ifdef __cplusplus
673}
674#endif
675
676#endif
677 /* end of group */
679 /* end of group addition */
static void error_cb(void *cls)
Function called if lookup fails.
Definition: gnunet-abd.c:479
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static int monitor
Monitor ARM activity.
Definition: gnunet-arm.c:64
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:109
static void finished_cb(enum GNUNET_GenericReturnValue rv)
static struct GNUNET_DATASTORE_QueueEntry * qe
Current operation.
static char * pkey
Public key of the zone to look in, in ASCII.
static unsigned int rd_count
Number of records for currently parsed set.
static struct GNUNET_GNSRECORD_Data rd[50]
The record data under a single label.
static void sync_cb(void *cls)
Function called once we are in sync in monitor mode.
static struct GNUNET_NAMESTORE_ZoneMonitor * zm
Monitor handle.
static struct GNUNET_CONTAINER_BloomFilter * filter
Bloomfilter to quickly tell if we don't have the content.
API that can be used to manipulate GNS record data.
GNUNET_GNSRECORD_Filter
Filter for GNUNET_GNSRECORD_normalize_record_set().
void(* GNUNET_NAMESTORE_ContinuationWithStatus)(void *cls, enum GNUNET_ErrorCode ec)
Continuation called to notify client about result of the operation.
struct GNUNET_NAMESTORE_ZoneIterator * GNUNET_NAMESTORE_zone_iteration_start2(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *zone, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordSetMonitor proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls, enum GNUNET_GNSRECORD_Filter filter)
Starts a new zone iteration (used to periodically PUT all of our records into our DHT).
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_lookup(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const char *label, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor rm, void *rm_cls)
Lookup an item in the namestore.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_record_set_store(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls)
Store an item in the namestore.
void GNUNET_NAMESTORE_disconnect(struct GNUNET_NAMESTORE_Handle *h)
Disconnect from the namestore service (and free associated resources).
void(* GNUNET_NAMESTORE_RecordMonitor)(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Process a record that was stored in the namestore.
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.
void GNUNET_NAMESTORE_cancel(struct GNUNET_NAMESTORE_QueueEntry *qe)
Cancel a namestore operation.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_lookup2(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const char *label, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor rm, void *rm_cls, enum GNUNET_GNSRECORD_Filter filter)
Lookup an item in the namestore with GNSRECORD filter.
void GNUNET_NAMESTORE_zone_monitor_stop(struct GNUNET_NAMESTORE_ZoneMonitor *zm)
Stop monitoring a zone for changes.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_zone_to_name(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *zone, const struct GNUNET_CRYPTO_PublicKey *value_zone, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor proc, void *proc_cls)
Look for an existing PKEY delegation record for a given public key.
struct GNUNET_NAMESTORE_ZoneMonitor * GNUNET_NAMESTORE_zone_monitor_start2(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_CRYPTO_PrivateKey *zone, int iterate_first, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordSetMonitor monitor, void *monitor_cls, GNUNET_SCHEDULER_TaskCallback sync_cb, void *sync_cb_cls, enum GNUNET_GNSRECORD_Filter filter)
Begin monitoring a zone for changes.
GNUNET_NAMESTORE_TxControl
Transaction control types.
struct GNUNET_NAMESTORE_ZoneIterator * GNUNET_NAMESTORE_zone_iteration_start(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_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)
void(* GNUNET_NAMESTORE_RecordSetMonitor)(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd, struct GNUNET_TIME_Absolute expiry)
Process a record set that was stored in the namestore.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_record_set_edit_cancel(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const char *label, const char *editor_hint, const char *editor_hint_replacement, GNUNET_NAMESTORE_ContinuationWithStatus finished_cb, void *finished_cls)
If the current advisory lock is set to the provided editor hint, this API cancels the editing of a re...
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_store(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, unsigned int rd_set_count, const struct GNUNET_NAMESTORE_RecordInfo *record_info, unsigned int *rds_sent, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls)
Store one or more record sets in the namestore.
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).
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_record_set_edit_begin(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const char *label, const char *editor_hint, GNUNET_NAMESTORE_EditRecordSetBeginCallback edit_cb, void *edit_cb_cls)
New API draft.
void(* GNUNET_NAMESTORE_EditRecordSetBeginCallback)(void *cls, enum GNUNET_ErrorCode ec, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd, const char *editor_hint)
Process a record that was stored in the namestore.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_record_set_store_(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd, int is_zonemaster, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls)
Store an item in the namestore.
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_CRYPTO_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)
void GNUNET_NAMESTORE_zone_iteration_stop(struct GNUNET_NAMESTORE_ZoneIterator *it)
Stops iteration and releases the namestore handle for further calls.
@ GNUNET_NAMESTORE_TX_COMMIT
@ GNUNET_NAMESTORE_TX_ROLLBACK
@ GNUNET_NAMESTORE_TX_BEGIN
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
GNUNET_ErrorCode
Taler error codes.
A private key for an identity as per LSD0001.
An identity key as per LSD0001.
Connection to the NAMESTORE service.
An QueueEntry used to store information for a pending NAMESTORE record operation.
Definition: namestore_api.c:49
void * error_cb_cls
Closure for error_cb.
GNUNET_NAMESTORE_RecordMonitor proc
Function to call with the records we get back; or NULL.
Definition: namestore_api.c:78
GNUNET_NAMESTORE_ContinuationWithStatus cont
Continuation to call.
Definition: namestore_api.c:68
void * cont_cls
Closure for cont.
Definition: namestore_api.c:73
void * proc_cls
Closure for proc.
Definition: namestore_api.c:93
A struct for record bulk import.
struct GNUNET_GNSRECORD_Data * a_rd
Handle for a zone iterator operation.
void * finish_cb_cls
Closure for error_cb.
void * error_cb_cls
Closure for error_cb.
struct GNUNET_CRYPTO_PrivateKey zone
Private key of the zone.
void * proc_cls
Closure for proc.
GNUNET_NAMESTORE_RecordMonitor proc
The continuation to call with the results.
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Handle for a monitoring activity.
void * monitor_cls
Closure for monitor.
void * sync_cb_cls
Closure for sync_cb.
void * error_cb_cls
Closure for error_cb.
struct GNUNET_CRYPTO_PrivateKey zone
Monitored zone.
int iterate_first
Do we first iterate over all existing records?
Time for absolute times used by GNUnet, in microseconds.