GNUnet  0.11.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
61  GNUNET_CRYPTO_EcdsaPrivateKey *private_key,
62  const char *label,
63  unsigned int rd_count,
64  const struct GNUNET_GNSRECORD_Data *rd);
65 
66 
71 {
75  void *cls;
76 
88  int
89  (*store_records) (void *cls,
90  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
91  const char *label,
92  unsigned int rd_count,
93  const struct GNUNET_GNSRECORD_Data *rd);
94 
105  int
106  (*lookup_records) (void *cls,
107  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
108  const char *label,
110  void *iter_cls);
111 
112 
127  int
128  (*iterate_records) (void *cls,
129  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
130  uint64_t serial,
131  uint64_t limit,
133  void *iter_cls);
134 
135 
147  int
148  (*zone_to_name) (void *cls,
149  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
150  const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone,
152  void *iter_cls);
153 };
154 
155 
156 #if 0 /* keep Emacsens' auto-indent happy */
157 {
158 #endif
159 #ifdef __cplusplus
160 }
161 #endif
162 
163 #endif
164  /* 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.