GNUnet 0.22.0
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,
40 struct GNUNET_TIME_Absolute block_expiration_time,
41 const uint8_t *block_data,
42 size_t block_data_len,
43 const struct GNUNET_DHT_PathElement *put_path_in,
44 unsigned int put_path_len_in,
45 unsigned int *put_path_len_out,
46 const struct GNUNET_PeerIdentity *trunc_origin);
47
48
61void
62GDS_helper_sign_path (const void *data,
63 size_t data_size,
64 const struct GNUNET_CRYPTO_EddsaPrivateKey *sk,
65 struct GNUNET_TIME_Absolute exp_time,
66 const struct GNUNET_PeerIdentity *pred,
67 const struct GNUNET_PeerIdentity *succ,
69
70void
72 size_t msize,
73 const struct GNUNET_CRYPTO_EddsaPrivateKey *sk,
74 const struct GNUNET_PeerIdentity *target,
75 const struct GNUNET_HashCode *target_hash,
76 const struct GNUNET_CONTAINER_BloomFilter *bf,
77 const struct GNUNET_HashCode *block_key,
80 struct GNUNET_TIME_Absolute block_expiration_time,
81 const uint8_t *block_data,
82 size_t block_data_len,
83 const struct GNUNET_DHT_PathElement *put_path,
84 unsigned int put_path_len,
85 size_t hop_count,
86 uint32_t desired_replication_level,
87 const struct GNUNET_PeerIdentity *trunc_peer);
88
89#endif
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:172
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)
Definition: dht_helper.c:36
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:145
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