GNUnet  0.10.x
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 
38 #ifndef GNUNET_NAMESTORE_SERVICE_H
39 #define GNUNET_NAMESTORE_SERVICE_H
40 
41 #include "gnunet_util_lib.h"
42 #include "gnunet_block_lib.h"
43 #include "gnunet_gnsrecord_lib.h"
44 
45 #ifdef __cplusplus
46 extern "C"
47 {
48 #if 0 /* keep Emacsens' auto-indent happy */
49 }
50 #endif
51 #endif
52 
53 
58 
63 
68 
69 
78 
79 
87 void
89 
90 
101 typedef void
103  int32_t success,
104  const char *emsg);
105 
106 
129  const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
130  const char *label,
131  unsigned int rd_count,
132  const struct GNUNET_GNSRECORD_Data *rd,
134  void *cont_cls);
135 
136 
146 typedef void
148  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
149  const char *label,
150  unsigned int rd_count,
151  const struct GNUNET_GNSRECORD_Data *rd);
152 
153 
166  const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
167  const char *nick,
169  void *cont_cls);
170 
171 
188  const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
189  const char *label,
191  void *error_cb_cls,
193  void *rm_cls);
194 
195 
215  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
216  const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone,
218  void *error_cb_cls,
220  void *proc_cls);
221 
222 
231 void
233 
234 
262  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
264  void *error_cb_cls,
266  void *proc_cls,
268  void *finish_cb_cls);
269 
270 
279 void
281  uint64_t limit);
282 
283 
291 void
293 
294 
299 
300 
330  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
331  int iterate_first,
333  void *error_cb_cls,
335  void *monitor_cls,
337  void *sync_cb_cls);
338 
339 
361 void
363  uint64_t limit);
364 
365 
371 void
373 
374 
375 #if 0 /* keep Emacsens' auto-indent happy */
376 {
377 #endif
378 #ifdef __cplusplus
379 }
380 #endif
381 
382 #endif
383  /* end of group */
static struct GNUNET_DATASTORE_QueueEntry * qe
Current operation.
void(* GNUNET_NAMESTORE_ContinuationWithStatus)(void *cls, int32_t success, const char *emsg)
Continuation called to notify client about result of the operation.
static char * pkey
Public key of the zone to look in, in ASCII.
void * error_cb_cls
Closure for error_cb.
struct GNUNET_NAMESTORE_ZoneMonitor * GNUNET_NAMESTORE_zone_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_CRYPTO_EcdsaPrivateKey *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.
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
GNUNET_NAMESTORE_RecordMonitor proc
Function to call with the records we get back; or NULL.
Definition: namestore_api.c:84
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_lookup(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *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.
static void sync_cb(void *cls)
Function called once we are in sync in monitor mode.
struct GNUNET_NAMESTORE_ZoneIterator * GNUNET_NAMESTORE_zone_iteration_start(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *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)...
GNUNET_NAMESTORE_RecordMonitor proc
The continuation to call with the results.
void * proc_cls
Closure for proc.
void(* GNUNET_NAMESTORE_RecordMonitor)(void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *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_monitor_stop(struct GNUNET_NAMESTORE_ZoneMonitor *zm)
Stop monitoring a zone for changes.
static struct GNUNET_NAMESTORE_ZoneMonitor * zm
Monitor handle.
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...
Private ECC key encoded for transmission.
void * error_cb_cls
Closure for error_cb.
static void error_cb(GstBus *bus, GstMessage *msg, GNUNET_gstData *data)
Definition: gnunet_gst.c:311
void * proc_cls
Closure for proc.
Definition: namestore_api.c:89
void * error_cb_cls
Closure for error_cb.
Definition: namestore_api.c:99
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:94
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
void GNUNET_NAMESTORE_cancel(struct GNUNET_NAMESTORE_QueueEntry *qe)
Cancel a namestore operation.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_store(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *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.
static char * zone
Name of the zone we manage.
void GNUNET_NAMESTORE_disconnect(struct GNUNET_NAMESTORE_Handle *h)
Disconnect from the namestore service (and free associated resources).
Handle for a monitoring activity.
Handle for a zone iterator operation.
Connection to the NAMESTORE service.
int iterate_first
Do we first iterate over all existing records?
void GNUNET_NAMESTORE_zone_iteration_stop(struct GNUNET_NAMESTORE_ZoneIterator *it)
Stops iteration and releases the namestore handle for further calls.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:104
void * sync_cb_cls
Closure for sync_cb.
An QueueEntry used to store information for a pending NAMESTORE record operation. ...
Definition: namestore_api.c:53
struct GNUNET_NAMESTORE_Handle * GNUNET_NAMESTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the namestore service.
GNUNET_NAMESTORE_ContinuationWithStatus cont
Continuation to call.
Definition: namestore_api.c:74
void * finish_cb_cls
Closure for error_cb.
void * cont_cls
Closure for cont.
Definition: namestore_api.c:79
static int monitor
Monitor ARM activity.
Definition: gnunet-arm.c:59
configuration data
Definition: configuration.c:85
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_zone_to_name(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const struct GNUNET_CRYPTO_EcdsaPublicKey *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_set_nick(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const char *nick, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls)
Set the desired nick name for a zone.
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)...
void * monitor_cls
Closure for monitor.