GNUnet  0.17.6
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 #include "gnunet_util_lib.h"
45 #include "gnunet_block_lib.h"
46 #include "gnunet_gnsrecord_lib.h"
48 
49 #ifdef __cplusplus
50 extern "C"
51 {
52 #if 0 /* keep Emacsens' auto-indent happy */
53 }
54 #endif
55 #endif
56 
57 
62 
67 
72 
78 {
82 };
83 
92 
93 
101 void
103 
104 
115 typedef void
117  int32_t success,
118  const char *emsg);
119 
120 
143  const struct GNUNET_IDENTITY_PrivateKey *pkey,
144  const char *label,
145  unsigned int rd_count,
146  const struct GNUNET_GNSRECORD_Data *rd,
148  void *cont_cls);
149 
173  const struct GNUNET_IDENTITY_PrivateKey *pkey,
174  const char *label,
175  unsigned int rd_count,
176  const struct GNUNET_GNSRECORD_Data *rd,
177  int is_zonemaster,
179  void *cont_cls);
180 
181 
182 
183 
193 typedef void
194 (*GNUNET_NAMESTORE_RecordMonitor) (void *cls,
195  const struct
197  const char *label,
198  unsigned int rd_count,
199  const struct GNUNET_GNSRECORD_Data *rd);
200 
213 typedef void
215  const struct
217  const char *label,
218  unsigned int rd_count,
219  const struct GNUNET_GNSRECORD_Data *rd,
220  struct GNUNET_TIME_Absolute expiry);
221 
222 
239  const struct
241  const char *label,
243  void *error_cb_cls,
245  void *rm_cls);
246 
247 
267  const struct GNUNET_IDENTITY_PrivateKey *zone,
268  const struct
269  GNUNET_IDENTITY_PublicKey *value_zone,
271  void *error_cb_cls,
273  void *proc_cls);
274 
275 
284 void
286 
287 
318  const struct
321  void *error_cb_cls,
323  void *proc_cls,
325  void *finish_cb_cls);
326 
354  const struct
357  void *error_cb_cls,
359  void *proc_cls,
361  void *finish_cb_cls,
363 
364 
365 
374 void
376  uint64_t limit);
377 
378 
386 void
388 
389 
394 
395 
428  const struct GNUNET_CONFIGURATION_Handle *cfg,
429  const struct GNUNET_IDENTITY_PrivateKey *zone,
430  int iterate_first,
432  void *error_cb_cls,
434  void *monitor_cls,
436  void *sync_cb_cls);
437 
468  const struct GNUNET_CONFIGURATION_Handle *cfg,
469  const struct GNUNET_IDENTITY_PrivateKey *zone,
470  int iterate_first,
472  void *error_cb_cls,
474  void *monitor_cls,
476  void *sync_cb_cls,
478 
479 
501 void
503  uint64_t limit);
504 
505 
511 void
513 
514 
530  cont,
531  void *cont_cls);
532 
545  cont,
546  void *cont_cls);
559  cont,
560  void *cont_cls);
561 
564  struct GNUNET_NAMESTORE_Handle *h,
565  const struct GNUNET_IDENTITY_PrivateKey *pkey,
566  const char *label,
568  void *error_cb_cls,
570  void *rm_cls);
571 
572 #if 0 /* keep Emacsens' auto-indent happy */
573 {
574 #endif
575 #ifdef __cplusplus
576 }
577 #endif
578 
579 #endif
580  /* end of group */
582  /* end of group addition */
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
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_DATASTORE_QueueEntry * qe
Current operation.
static char * pkey
Public key of the zone to look in, in ASCII.
static char * zone
Name of the zone being managed.
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.
Library for data block manipulation.
API that can be used to manipulate GNS record data.
Identity service; implements identity management for GNUnet.
GNUNET_GNSRECORD_Filter
Filter for GNUNET_GNSRECORD_normalize_record_set().
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_transaction_rollback(struct GNUNET_NAMESTORE_Handle *h, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls)
Begin rollback all actions in a transaction.
void GNUNET_NAMESTORE_disconnect(struct GNUNET_NAMESTORE_Handle *h)
Disconnect from the namestore service (and free associated resources).
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)
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_lookup(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_IDENTITY_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_transaction_begin(struct GNUNET_NAMESTORE_Handle *h, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls)
New API draft.
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.
void(* GNUNET_NAMESTORE_RecordSetMonitor)(void *cls, const struct GNUNET_IDENTITY_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.
void GNUNET_NAMESTORE_zone_monitor_stop(struct GNUNET_NAMESTORE_ZoneMonitor *zm)
Stop monitoring a zone for changes.
void(* GNUNET_NAMESTORE_ContinuationWithStatus)(void *cls, int32_t success, const char *emsg)
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_IDENTITY_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).
GNUNET_NAMESTORE_TxControl
Transaction control types.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_store(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_IDENTITY_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.
struct GNUNET_NAMESTORE_ZoneMonitor * GNUNET_NAMESTORE_zone_monitor_start2(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_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.
void(* GNUNET_NAMESTORE_RecordMonitor)(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.
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)
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_transaction_commit(struct GNUNET_NAMESTORE_Handle *h, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls)
Commit a namestore transaction.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_store_(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_IDENTITY_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_QueueEntry * GNUNET_NAMESTORE_zone_to_name(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *zone, const struct GNUNET_IDENTITY_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_QueueEntry * GNUNET_NAMESTORE_records_edit(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *pkey, const char *label, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor rm, void *rm_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.
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:54
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:83
GNUNET_NAMESTORE_ContinuationWithStatus cont
Continuation to call.
Definition: namestore_api.c:73
void * cont_cls
Closure for cont.
Definition: namestore_api.c:78
void * proc_cls
Closure for proc.
Definition: namestore_api.c:93
Handle for a zone iterator operation.
void * finish_cb_cls
Closure for error_cb.
void * error_cb_cls
Closure for error_cb.
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.
int iterate_first
Do we first iterate over all existing records?
Time for absolute times used by GNUnet, in microseconds.