GNUnet 0.22.2
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, 2022 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"
34
35
42void
44
45
52typedef void
53(*GDS_DATACACHE_GetCallback)(void *cls,
54 const struct GNUNET_DATACACHE_Block *bd);
55
56
72 const void *xquery,
73 size_t xquery_size,
74 struct GNUNET_BLOCK_Group *bg,
76 void *gc_cls);
77
78
95 const void *xquery,
96 size_t xquery_size,
97 struct GNUNET_BLOCK_Group *bg,
99 void *cb_cls);
100
101
105void
106GDS_DATACACHE_init (void);
107
108
112void
113GDS_DATACACHE_done (void);
114
115#endif
struct GNUNET_HashCode key
The key used in the DHT.
static uint32_t type
Type string converted to DNS type value.
enum GNUNET_BLOCK_ReplyEvaluationResult GDS_DATACACHE_get_closest(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 cb, void *cb_cls)
Handle a request for data close to a key that we have received from another peer.
enum GNUNET_BLOCK_ReplyEvaluationResult 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've received from another peer.
void GDS_DATACACHE_handle_put(const struct GNUNET_DATACACHE_Block *bd)
Handle a datum we've received from another peer.
void(* GDS_DATACACHE_GetCallback)(void *cls, const struct GNUNET_DATACACHE_Block *bd)
Handle a result for a GET operation.
void GDS_DATACACHE_done(void)
Shutdown datacache subsystem.
void GDS_DATACACHE_init(void)
Initialize datacache subsystem.
Library for data block manipulation.
API to the DHT service.
GNUNET_BLOCK_ReplyEvaluationResult
Possible ways for how a block may relate to a query.
GNUNET_BLOCK_Type
WARNING: This header is generated! In order to add DHT block types, you must register them in GANA,...
Block group data.
Information about a block stored in the datacache.
A 512-bit hashcode.