GNUnet  0.10.x
gnunet_namestore_plugin.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 
31 #ifndef GNUNET_NAMESTORE_PLUGIN_H
32 #define GNUNET_NAMESTORE_PLUGIN_H
33 
34 #include "gnunet_util_lib.h"
36 
37 #ifdef __cplusplus
38 extern "C"
39 {
40 #if 0 /* keep Emacsens' auto-indent happy */
41 }
42 #endif
43 #endif
44 
45 
57 typedef void
59  uint64_t serial,
60  const struct GNUNET_CRYPTO_EcdsaPrivateKey *private_key,
61  const char *label,
62  unsigned int rd_count,
63  const struct GNUNET_GNSRECORD_Data *rd);
64 
65 
73  void *cls;
74 
86  int
87  (*store_records) (void *cls,
88  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
89  const char *label,
90  unsigned int rd_count,
91  const struct GNUNET_GNSRECORD_Data *rd);
92 
103  int
104  (*lookup_records) (void *cls,
105  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
106  const char *label,
108  void *iter_cls);
109 
110 
125  int
126  (*iterate_records) (void *cls,
127  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
128  uint64_t serial,
129  uint64_t limit,
131  void *iter_cls);
132 
133 
145  int
146  (*zone_to_name) (void *cls,
147  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
148  const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone,
150  void *iter_cls);
151 };
152 
153 
154 #if 0 /* keep Emacsens' auto-indent happy */
155 {
156 #endif
157 #ifdef __cplusplus
158 }
159 #endif
160 
161 #endif
162  /* end of group */
int(* zone_to_name)(void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
Look for an existing PKEY delegation record for a given public key.
Private ECC key encoded for transmission.
void(* GNUNET_NAMESTORE_RecordIterator)(void *cls, uint64_t serial, const struct GNUNET_CRYPTO_EcdsaPrivateKey *private_key, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Function called for each matching record.
static char * zone
Name of the zone we manage.
void * cls
Closure to pass to all plugin functions.
int(* lookup_records)(void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
Lookup records in the datastore for which we are the authority.
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
int(* store_records)(void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Store a record in the datastore for which we are the authority.
struct returned by the initialization function of the plugin
int(* iterate_records)(void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, uint64_t serial, uint64_t limit, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
Iterate over the results for a particular zone in the datastore.