GNUnet 0.22.2
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
38#include "gnunet_util_lib.h"
40
41#ifdef __cplusplus
42extern "C"
43{
44#if 0 /* keep Emacsens' auto-indent happy */
45}
46#endif
47#endif
48
49
62typedef void
64 uint64_t serial,
65 const char *editor_hint,
66 const struct
67 GNUNET_CRYPTO_PrivateKey *private_key,
68 const char *label,
69 unsigned int rd_count,
70 const struct GNUNET_GNSRECORD_Data *rd);
71
72
77{
81 void *cls;
82
95 (*store_records)(void *cls,
96 const struct GNUNET_CRYPTO_PrivateKey *zone,
97 const char *label,
98 unsigned int rd_count,
99 const struct GNUNET_GNSRECORD_Data *rd);
100
112 (*lookup_records)(void *cls,
113 const struct GNUNET_CRYPTO_PrivateKey *zone,
114 const char *label,
116 void *iter_cls);
117
118
134 (*iterate_records)(void *cls,
135 const struct GNUNET_CRYPTO_PrivateKey *zone,
136 uint64_t serial,
137 uint64_t limit,
139 void *iter_cls);
140
141
154 (*zone_to_name)(void *cls,
155 const struct GNUNET_CRYPTO_PrivateKey *zone,
156 const struct GNUNET_CRYPTO_PublicKey *value_zone,
158 void *iter_cls);
159
176 (*edit_records)(void *cls,
177 const char *editor_hint,
178 const struct GNUNET_CRYPTO_PrivateKey *zone,
179 const char *label,
181 void *iter_cls);
182
199 (*clear_editor_hint)(void *cls,
200 const char *editor_hint,
201 const char *editor_hint_replacement,
202 const struct GNUNET_CRYPTO_PrivateKey *zone,
203 const char *label);
204
215 (*begin_tx)(void *cls);
216
225 (*commit_tx)(void *cls);
226
236 (*rollback_tx)(void *cls);
237
245 (*create_tables)(void *cls);
246
247
256 (*drop_tables)(void *cls);
257};
258
259
260#if 0 /* keep Emacsens' auto-indent happy */
261{
262#endif
263#ifdef __cplusplus
264}
265#endif
266
267#endif
268 /* end of group */
270 /* end of group addition */
static unsigned int rd_count
Number of records for currently parsed set.
static struct GNUNET_GNSRECORD_Data rd[50]
The record data under a single label.
API that can be used to store naming information on a GNUnet node;.
GNUNET_GenericReturnValue
Named constants for return values.
void(* GNUNET_NAMESTORE_RecordIterator)(void *cls, uint64_t serial, const char *editor_hint, const struct GNUNET_CRYPTO_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
enum GNUNET_GenericReturnValue(* clear_editor_hint)(void *cls, const char *editor_hint, const char *editor_hint_replacement, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label)
This clears the editor hint, unless it does not match the given editor hint, in which case this is a ...
enum GNUNET_GenericReturnValue(* zone_to_name)(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const struct GNUNET_CRYPTO_PublicKey *value_zone, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
Look for an existing PKEY delegation record for a given public key.
enum GNUNET_GenericReturnValue(* create_tables)(void *cls)
Setup the database.
enum GNUNET_GenericReturnValue(* edit_records)(void *cls, const char *editor_hint, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
Transaction-based API draft.
enum GNUNET_GenericReturnValue(* rollback_tx)(void *cls)
Tell plugin to rollback what we started with begin_tx This may be a NOP (and thus NOT roll anything b...
enum GNUNET_GenericReturnValue(* iterate_records)(void *cls, const struct GNUNET_CRYPTO_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(* lookup_records)(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
Lookup records in the datastore for which we are the authority.
enum GNUNET_GenericReturnValue(* begin_tx)(void *cls)
Tell plugin that a set of procedures are coming that are ideally handled within a single TX (BEGIN/CO...
enum GNUNET_GenericReturnValue(* commit_tx)(void *cls)
Tell plugin the we finished what we started with begin_tx.
enum GNUNET_GenericReturnValue(* drop_tables)(void *cls)
Drop existing tables.
void * cls
Closure to pass to all plugin functions.
enum GNUNET_GenericReturnValue(* store_records)(void *cls, const struct GNUNET_CRYPTO_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.