GNUnet 0.21.1
gnunet_namecache_service.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet
3 Copyright (C) 2012, 2013, 2016 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
41#ifndef GNUNET_NAMECACHE_SERVICE_H
42#define GNUNET_NAMECACHE_SERVICE_H
43
44
45#include "gnunet_util_lib.h"
46#include "gnunet_block_lib.h"
48
49#ifdef __cplusplus
50extern "C"
51{
52#if 0 /* keep Emacsens' auto-indent happy */
53}
54#endif
55#endif
56
57
62
67
71#define GNUNET_NAMECACHE_MAX_VALUE_SIZE (63 * 1024)
72
73
82
83
91void
93
94
105typedef void
107 int32_t success,
108 const char *emsg);
109
110
123 const struct GNUNET_GNSRECORD_Block *block,
125 void *cont_cls);
126
127
134typedef void
136 const struct GNUNET_GNSRECORD_Block *block);
137
138
153 const struct GNUNET_HashCode *derived_hash,
155 void *proc_cls);
156
157
166void
168
169
170#if 0 /* keep Emacsens' auto-indent happy */
171{
172#endif
173#ifdef __cplusplus
174}
175#endif
176
177#endif
178 /* end of group */
180 /* end of group addition */
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:109
static struct GNUNET_DATASTORE_QueueEntry * qe
Current operation.
Library for data block manipulation.
API that can be used to store naming information on a GNUnet node;.
struct GNUNET_NAMECACHE_Handle * GNUNET_NAMECACHE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the namecache service.
void(* GNUNET_NAMECACHE_ContinuationWithStatus)(void *cls, int32_t success, const char *emsg)
Continuation called to notify client about result of the operation.
void GNUNET_NAMECACHE_disconnect(struct GNUNET_NAMECACHE_Handle *h)
Disconnect from the namecache service (and free associated resources).
void GNUNET_NAMECACHE_cancel(struct GNUNET_NAMECACHE_QueueEntry *qe)
Cancel a namecache operation.
void(* GNUNET_NAMECACHE_BlockProcessor)(void *cls, const struct GNUNET_GNSRECORD_Block *block)
Process a record that was stored in the namecache.
struct GNUNET_NAMECACHE_QueueEntry * GNUNET_NAMECACHE_lookup_block(struct GNUNET_NAMECACHE_Handle *h, const struct GNUNET_HashCode *derived_hash, GNUNET_NAMECACHE_BlockProcessor proc, void *proc_cls)
Get a result for a particular key from the namecache.
struct GNUNET_NAMECACHE_QueueEntry * GNUNET_NAMECACHE_block_cache(struct GNUNET_NAMECACHE_Handle *h, const struct GNUNET_GNSRECORD_Block *block, GNUNET_NAMECACHE_ContinuationWithStatus cont, void *cont_cls)
Store an item in the namecache.
A 512-bit hashcode.
Connection to the NAMECACHE service.
Definition: namecache_api.c:93
An QueueEntry used to store information for a pending NAMECACHE record operation.
Definition: namecache_api.c:46
void * cont_cls
Closure for cont.
Definition: namecache_api.c:70
GNUNET_NAMECACHE_ContinuationWithStatus cont
Continuation to call.
Definition: namecache_api.c:65