GNUnet  0.10.x
gnunet-service-dht_datacache.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2009, 2010, 2011 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 
27 #ifndef GNUNET_SERVICE_DHT_DATACACHE_H
28 #define GNUNET_SERVICE_DHT_DATACACHE_H
29 
30 #include "gnunet_util_lib.h"
31 #include "gnunet_block_lib.h"
32 #include "gnunet_dht_service.h"
33 
46 void
48  const struct GNUNET_HashCode *key,
49  unsigned int put_path_length,
50  const struct GNUNET_PeerIdentity *put_path,
52  size_t data_size,
53  const void *data);
54 
55 
70 typedef void
73  struct GNUNET_TIME_Absolute expiration_time,
74  const struct GNUNET_HashCode *key,
75  unsigned int put_path_length,
76  const struct GNUNET_PeerIdentity *put_path,
77  unsigned int get_path_length,
78  const struct GNUNET_PeerIdentity *get_path,
79  const void *data,
80  size_t data_size);
81 
82 
97  enum GNUNET_BLOCK_Type type,
98  const void *xquery,
99  size_t xquery_size,
100  struct GNUNET_BLOCK_Group *bg,
102  void *gc_cls);
103 
104 
113 int
115 
116 
130 typedef void
133  const struct GNUNET_HashCode *key,
134  enum GNUNET_BLOCK_Type type,
135  unsigned int put_path_length,
136  const struct GNUNET_PeerIdentity *put_path,
138  const void *data,
139  size_t data_size);
140 
141 
150 void
153  void *cb_cls);
154 
155 
159 void
160 GDS_DATACACHE_init(void);
161 
162 
166 void
167 GDS_DATACACHE_done(void);
168 
169 #endif
static char * expiration
Credential TTL.
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
GNUNET_BLOCK_Type
Blocks in the datastore and the datacache must have a unique type.
void GDS_DATACACHE_get_successors(const struct GNUNET_HashCode *key, GDS_DATACACHE_SuccessorCallback cb, void *cb_cls)
Handle a request for data close to a key that we have received from another peer. ...
void(* GDS_DATACACHE_GetCallback)(void *cls, enum GNUNET_BLOCK_Type type, struct GNUNET_TIME_Absolute expiration_time, const struct GNUNET_HashCode *key, unsigned int put_path_length, const struct GNUNET_PeerIdentity *put_path, unsigned int get_path_length, const struct GNUNET_PeerIdentity *get_path, const void *data, size_t data_size)
Handle a result for a GET operation.
void(* GDS_DATACACHE_SuccessorCallback)(void *cls, enum GNUNET_DHT_RouteOption options, const struct GNUNET_HashCode *key, enum GNUNET_BLOCK_Type type, unsigned int put_path_length, const struct GNUNET_PeerIdentity *put_path, struct GNUNET_TIME_Absolute expiration, const void *data, size_t data_size)
Send the get result to requesting client.
enum GNUNET_BLOCK_EvaluationResult GDS_DATACACHE_handle_get(const struct GNUNET_HashCode *key, enum GNUNET_BLOCK_Type type, const void *xquery, size_t xquery_size, struct GNUNET_BLOCK_Group *bg, GDS_DATACACHE_GetCallback gc, void *gc_cls)
Handle a GET request we&#39;ve received from another peer.
void GDS_DATACACHE_done(void)
Shutdown datacache subsystem.
A 512-bit hashcode.
GNUNET_DHT_RouteOption
Options for routing.
struct GNUNET_HashCode key
The key used in the DHT.
GNUNET_BLOCK_EvaluationResult
Possible ways for how a block may relate to a query.
The identity of the host (wraps the signing key of the peer).
void GDS_DATACACHE_init(void)
Initialize datacache subsystem.
int GDS_DATACACHE_get_random_key(struct GNUNET_HashCode *key)
Obtain a random key from the datacache.
Block group data.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
Time for absolute times used by GNUnet, in microseconds.
void GDS_DATACACHE_handle_put(struct GNUNET_TIME_Absolute expiration, const struct GNUNET_HashCode *key, unsigned int put_path_length, const struct GNUNET_PeerIdentity *put_path, enum GNUNET_BLOCK_Type type, size_t data_size, const void *data)
Handle a datum we&#39;ve received from another peer.
uint32_t data
The data value.
static size_t data_size
Number of bytes in data.