GNUnet  0.17.6
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 #include "gnunet_util_lib.h"
45 #include "gnunet_block_lib.h"
47 
48 #ifdef __cplusplus
49 extern "C"
50 {
51 #if 0 /* keep Emacsens' auto-indent happy */
52 }
53 #endif
54 #endif
55 
56 
61 
66 
70 #define GNUNET_NAMECACHE_MAX_VALUE_SIZE (63 * 1024)
71 
72 
81 
82 
90 void
92 
93 
104 typedef void
106  int32_t success,
107  const char *emsg);
108 
109 
122  const struct GNUNET_GNSRECORD_Block *block,
124  void *cont_cls);
125 
126 
133 typedef void
134 (*GNUNET_NAMECACHE_BlockProcessor) (void *cls,
135  const struct GNUNET_GNSRECORD_Block *block);
136 
137 
152  const struct GNUNET_HashCode *derived_hash,
154  void *proc_cls);
155 
156 
165 void
167 
168 
169 #if 0 /* keep Emacsens' auto-indent happy */
170 {
171 #endif
172 #ifdef __cplusplus
173 }
174 #endif
175 
176 #endif
177  /* end of group */
179  /* end of group addition */
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
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;.
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_Handle * GNUNET_NAMECACHE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the namecache service.
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:95
An QueueEntry used to store information for a pending NAMECACHE record operation.
Definition: namecache_api.c:48
void * cont_cls
Closure for cont.
Definition: namecache_api.c:72
GNUNET_NAMECACHE_ContinuationWithStatus cont
Continuation to call.
Definition: namecache_api.c:67