GNUnet 0.22.1
dht_helper.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2024 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
21#ifndef GDS_DHT_HELPER_H
22#define GDS_DHT_HELPER_H
23
29#include "dht.h"
30#include "gnunet_common.h"
31#include "gnunet_dht_service.h"
32#include "gnunet_time_lib.h"
33#include "gnunet_util_lib.h"
34
36GDS_helper_put_message_get_size (size_t *msize_out,
37 const struct GNUNET_PeerIdentity *my_identity,
38 enum GNUNET_DHT_RouteOption ro_in,
39 enum GNUNET_DHT_RouteOption *ro_out,
41 block_expiration_time,
42 const uint8_t *block_data,
43 size_t block_data_len,
44 const struct GNUNET_DHT_PathElement *
45 put_path_in,
46 unsigned int put_path_len_in,
47 unsigned int *put_path_len_out,
48 const struct GNUNET_PeerIdentity *trunc_origin,
49 struct GNUNET_PeerIdentity *trunc_peer_out,
50 bool *truncated);
51
52
65void
66GDS_helper_sign_path (const void *data,
67 size_t data_size,
68 const struct GNUNET_CRYPTO_EddsaPrivateKey *sk,
69 struct GNUNET_TIME_Absolute exp_time,
70 const struct GNUNET_PeerIdentity *pred,
71 const struct GNUNET_PeerIdentity *succ,
73
74void
76 size_t msize,
77 const struct GNUNET_CRYPTO_EddsaPrivateKey *sk,
78 const struct GNUNET_PeerIdentity *target,
79 const struct GNUNET_HashCode *target_hash,
80 const struct GNUNET_CONTAINER_BloomFilter *bf,
81 const struct GNUNET_HashCode *block_key,
84 struct GNUNET_TIME_Absolute block_expiration_time,
85 const uint8_t *block_data,
86 size_t block_data_len,
87 const struct GNUNET_DHT_PathElement *put_path,
88 unsigned int put_path_len,
89 size_t hop_count,
90 uint32_t desired_replication_level,
91 const struct GNUNET_PeerIdentity *trunc_peer);
92
93#endif
enum GNUNET_GenericReturnValue GDS_helper_put_message_get_size(size_t *msize_out, const struct GNUNET_PeerIdentity *my_identity, enum GNUNET_DHT_RouteOption ro_in, enum GNUNET_DHT_RouteOption *ro_out, struct GNUNET_TIME_Absolute block_expiration_time, const uint8_t *block_data, size_t block_data_len, const struct GNUNET_DHT_PathElement *put_path_in, unsigned int put_path_len_in, unsigned int *put_path_len_out, const struct GNUNET_PeerIdentity *trunc_origin, struct GNUNET_PeerIdentity *trunc_peer_out, bool *truncated)
Definition: dht_helper.c:36
void GDS_helper_make_put_message(struct PeerPutMessage *ppm, size_t msize, const struct GNUNET_CRYPTO_EddsaPrivateKey *sk, const struct GNUNET_PeerIdentity *target, const struct GNUNET_HashCode *target_hash, const struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_HashCode *block_key, enum GNUNET_DHT_RouteOption ro, enum GNUNET_BLOCK_Type block_type, struct GNUNET_TIME_Absolute block_expiration_time, const uint8_t *block_data, size_t block_data_len, const struct GNUNET_DHT_PathElement *put_path, unsigned int put_path_len, size_t hop_count, uint32_t desired_replication_level, const struct GNUNET_PeerIdentity *trunc_peer)
Definition: dht_helper.c:178
void GDS_helper_sign_path(const void *data, size_t data_size, const struct GNUNET_CRYPTO_EddsaPrivateKey *sk, struct GNUNET_TIME_Absolute exp_time, const struct GNUNET_PeerIdentity *pred, const struct GNUNET_PeerIdentity *succ, struct GNUNET_CRYPTO_EddsaSignature *sig)
Sign that we are routing a message from pred to succ.
Definition: dht_helper.c:151
struct GNUNET_PeerIdentity my_identity
Our peer identity.
static unsigned int block_type
The type of the query.
static char * data
The data to insert into the dht.
static size_t data_size
Number of bytes in data.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
API to the DHT service.
Functions related to time.
GNUNET_DHT_RouteOption
Options for routing.
GNUNET_GenericReturnValue
Named constants for return values.
GNUNET_BLOCK_Type
WARNING: This header is generated! In order to add DHT block types, you must register them in GANA,...
Private ECC key encoded for transmission.
an ECC signature using EdDSA.
A (signed) path tracking a block's flow through the DHT is represented by an array of path elements,...
A 512-bit hashcode.
The identity of the host (wraps the signing key of the peer).
Time for absolute times used by GNUnet, in microseconds.
P2P PUT message.
Definition: dht.h:429