GNUnet  0.10.x
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 
38 #ifndef GNUNET_NAMECACHE_SERVICE_H
39 #define GNUNET_NAMECACHE_SERVICE_H
40 
41 #include "gnunet_util_lib.h"
42 #include "gnunet_block_lib.h"
44 
45 #ifdef __cplusplus
46 extern "C"
47 {
48 #if 0 /* keep Emacsens' auto-indent happy */
49 }
50 #endif
51 #endif
52 
53 
58 
63 
67 #define GNUNET_NAMECACHE_MAX_VALUE_SIZE (63 * 1024)
68 
69 
78 
79 
87 void
89 
90 
101 typedef void
103  int32_t success,
104  const char *emsg);
105 
106 
107 
120  const struct GNUNET_GNSRECORD_Block *block,
122  void *cont_cls);
123 
124 
131 typedef void
133  const struct GNUNET_GNSRECORD_Block *block);
134 
135 
150  const struct GNUNET_HashCode *derived_hash,
152  void *proc_cls);
153 
154 
163 void
165 
166 
167 #if 0 /* keep Emacsens' auto-indent happy */
168 {
169 #endif
170 #ifdef __cplusplus
171 }
172 #endif
173 
174 #endif
175  /* end of group */
struct GNUNET_NAMECACHE_Handle * GNUNET_NAMECACHE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the namecache service.
static struct GNUNET_DATASTORE_QueueEntry * qe
Current operation.
void(* GNUNET_NAMECACHE_BlockProcessor)(void *cls, const struct GNUNET_GNSRECORD_Block *block)
Process a record that was stored in the namecache.
Information we have in an encrypted block with record data (i.e.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:94
void * cont_cls
Closure for cont.
Definition: namecache_api.c:71
void GNUNET_NAMECACHE_cancel(struct GNUNET_NAMECACHE_QueueEntry *qe)
Cancel a namecache operation.
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.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:104
void(* GNUNET_NAMECACHE_ContinuationWithStatus)(void *cls, int32_t success, const char *emsg)
Continuation called to notify client about result of the operation.
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.
configuration data
Definition: configuration.c:83
Connection to the NAMECACHE service.
Definition: namecache_api.c:93
void GNUNET_NAMECACHE_disconnect(struct GNUNET_NAMECACHE_Handle *h)
Disconnect from the namecache service (and free associated resources).
An QueueEntry used to store information for a pending NAMECACHE record operation. ...
Definition: namecache_api.c:47
GNUNET_NAMECACHE_ContinuationWithStatus cont
Continuation to call.
Definition: namecache_api.c:66