GNUnet  0.17.6
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 
34 #ifndef GNUNET_NAMESTORE_PLUGIN_H
35 #define GNUNET_NAMESTORE_PLUGIN_H
36 
37 #include "gnunet_util_lib.h"
39 
40 #ifdef __cplusplus
41 extern "C"
42 {
43 #if 0 /* keep Emacsens' auto-indent happy */
44 }
45 #endif
46 #endif
47 
48 
60 typedef void
62  uint64_t serial,
63  const struct
64  GNUNET_IDENTITY_PrivateKey *private_key,
65  const char *label,
66  unsigned int rd_count,
67  const struct GNUNET_GNSRECORD_Data *rd);
68 
69 
74 {
78  void *cls;
79 
92  (*store_records) (void *cls,
93  const struct GNUNET_IDENTITY_PrivateKey *zone,
94  const char *label,
95  unsigned int rd_count,
96  const struct GNUNET_GNSRECORD_Data *rd);
97 
109  (*lookup_records) (void *cls,
110  const struct GNUNET_IDENTITY_PrivateKey *zone,
111  const char *label,
113  void *iter_cls);
114 
115 
131  (*iterate_records) (void *cls,
132  const struct GNUNET_IDENTITY_PrivateKey *zone,
133  uint64_t serial,
134  uint64_t limit,
136  void *iter_cls);
137 
138 
151  (*zone_to_name) (void *cls,
152  const struct GNUNET_IDENTITY_PrivateKey *zone,
153  const struct GNUNET_IDENTITY_PublicKey *value_zone,
155  void *iter_cls);
156 
167  (*transaction_begin) (void *cls, char **emsg);
168 
177  (*transaction_rollback) (void *cls, char **emsg);
178 
187  (*transaction_commit) (void *cls, char **emsg);
188 
202  (*edit_records) (void *cls,
203  const struct GNUNET_IDENTITY_PrivateKey *zone,
204  const char *label,
206  void *iter_cls);
207 
208 };
209 
210 
211 #if 0 /* keep Emacsens' auto-indent happy */
212 {
213 #endif
214 #ifdef __cplusplus
215 }
216 #endif
217 
218 #endif
219  /* end of group */
221  /* end of group addition */
static char * zone
Name of the zone being managed.
API that can be used to store naming information on a GNUnet node;.
GNUNET_GenericReturnValue
Named constants for return values.
Definition: gnunet_common.h:96
void(* GNUNET_NAMESTORE_RecordIterator)(void *cls, uint64_t serial, const struct GNUNET_IDENTITY_PrivateKey *private_key, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Function called for each matching record.
A private key for an identity as per LSD0001.
An identity key as per LSD0001.
struct returned by the initialization function of the plugin
int(* lookup_records)(void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
Lookup records in the datastore for which we are the authority.
int(* zone_to_name)(void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const struct GNUNET_IDENTITY_PublicKey *value_zone, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
Look for an existing PKEY delegation record for a given public key.
int(* iterate_records)(void *cls, const struct GNUNET_IDENTITY_PrivateKey *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.
enum GNUNET_GenericReturnValue(* transaction_begin)(void *cls, char **emsg)
Transaction-based API draft.
int(* store_records)(void *cls, const struct GNUNET_IDENTITY_PrivateKey *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.
enum GNUNET_GenericReturnValue(* transaction_commit)(void *cls, char **emsg)
Commit a transaction in the database.
void * cls
Closure to pass to all plugin functions.
enum GNUNET_GenericReturnValue(* transaction_rollback)(void *cls, char **emsg)
Abort and roll back a transaction in the database.
int(* edit_records)(void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
Edit records in the datastore for which we are the authority.