GNUnet 0.21.1
gnunet_peerstore_plugin.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet
3 Copyright (C) 2012, 2013 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_PEERSTORE_PLUGIN_H
35#define GNUNET_PEERSTORE_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
58 void *cls,
59 uint64_t seq,
60 const struct GNUNET_PEERSTORE_Record *record,
61 const char *emsg);
62
67{
71 void *cls;
72
90 (*store_record) (void *cls,
91 const char *sub_system,
92 const struct GNUNET_PeerIdentity *peer,
93 const char *key,
94 const void *value,
95 size_t size,
96 struct GNUNET_TIME_Absolute expiry,
99 void *cont_cls);
100
117 (*iterate_records) (void *cls,
118 const char *sub_system,
119 const struct GNUNET_PeerIdentity *peer,
120 const char *key,
121 uint64_t serial,
122 uint64_t limit,
124 void *iter_cls);
125
137 (*expire_records) (void *cls,
138 struct GNUNET_TIME_Absolute now,
140 void *cont_cls);
141};
142
143
144#if 0 /* keep Emacsens' auto-indent happy */
145{
146#endif
147#ifdef __cplusplus
148}
149#endif
150
151#endif
152 /* end of group */
154 /* end of group addition */
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
static void record(void *cls, size_t data_size, const void *data)
Process recorded audio data.
struct GNUNET_HashCode key
The key used in the DHT.
static char * value
Value of the record to add/remove.
API to the peerstore service.
void(* GNUNET_PEERSTORE_PluginProcessor)(void *cls, uint64_t seq, const struct GNUNET_PEERSTORE_Record *record, const char *emsg)
Function called by PEERSTORE for each matching record.
GNUNET_PEERSTORE_StoreOption
Options for storing values in PEERSTORE.
void(* GNUNET_PEERSTORE_Continuation)(void *cls, int success)
Continuation called with a status result.
static unsigned int size
Size of the "table".
Definition: peer.c:68
struct returned by the initialization function of the plugin
void * cls
Closure to pass to all plugin functions.
int(* iterate_records)(void *cls, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, uint64_t serial, uint64_t limit, GNUNET_PEERSTORE_PluginProcessor iter, void *iter_cls)
Iterate over the records given an optional peer id and/or key.
int(* store_record)(void *cls, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, const void *value, size_t size, struct GNUNET_TIME_Absolute expiry, enum GNUNET_PEERSTORE_StoreOption options, GNUNET_PEERSTORE_Continuation cont, void *cont_cls)
Store a record in the peerstore.
int(* expire_records)(void *cls, struct GNUNET_TIME_Absolute now, GNUNET_PEERSTORE_Continuation cont, void *cont_cls)
Delete expired records (expiry < now)
Single PEERSTORE record.
The identity of the host (wraps the signing key of the peer).
Time for absolute times used by GNUnet, in microseconds.