GNUnet 0.22.2
gnunet-service-cadet_paths.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2001-2017 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_CADET_PATHS_H
28#define GNUNET_SERVICE_CADET_PATHS_H
29
30#include "gnunet_util_lib.h"
31#include "gnunet_dht_service.h"
33
45void
47 unsigned int get_path_length,
48 const struct GNUNET_DHT_PathElement *put_path,
49 unsigned int put_path_length);
50
51
60struct CadetPeerPath *
61GCPP_get_path_from_route (unsigned int path_length,
62 const struct GNUNET_PeerIdentity *pids);
63
64
72unsigned int
73GCPP_get_length (struct CadetPeerPath *path);
74
75
86struct CadetConnection *
88 struct CadetPeer *destination,
89 unsigned int off);
90
91
100void
102 unsigned int off,
103 struct CadetConnection *cc);
104
105
114void
116 unsigned int off,
117 struct CadetConnection *cc);
118
119
127unsigned int
129 struct CadetPeer *cp);
130
131
147
148
157void
159
160
168struct CadetPeer *
170 unsigned int off);
171
172
179const char *
180GCPP_2s (struct CadetPeerPath *p);
181
182
183#endif
Information we track per peer.
void GCPP_try_path_from_dht(const struct GNUNET_DHT_PathElement *get_path, unsigned int get_path_length, const struct GNUNET_DHT_PathElement *put_path, unsigned int put_path_length)
Create a peer path based on the result of a DHT lookup.
const char * GCPP_2s(struct CadetPeerPath *p)
Convert a path to a human-readable string.
unsigned int GCPP_get_length(struct CadetPeerPath *path)
Return the length of the path.
struct CadetConnection * GCPP_get_connection(struct CadetPeerPath *path, struct CadetPeer *destination, unsigned int off)
Return connection to destination using path, or return NULL if no such connection exists.
GNUNET_CONTAINER_HeapCostType GCPP_get_desirability(const struct CadetPeerPath *path)
Return how much we like keeping the path.
void GCPP_del_connection(struct CadetPeerPath *path, unsigned int off, struct CadetConnection *cc)
Notify path that it is no longer used for connection cc which ended at the path's offset off.
void GCPP_release(struct CadetPeerPath *path)
The given peer cp used to own this path.
void GCPP_add_connection(struct CadetPeerPath *path, unsigned int off, struct CadetConnection *cc)
Notify path that it is used for connection cc which ends at the path's offset off.
struct CadetPeer * GCPP_get_peer_at_offset(struct CadetPeerPath *path, unsigned int off)
Obtain the peer at offset off in path.
struct CadetPeerPath * GCPP_get_path_from_route(unsigned int path_length, const struct GNUNET_PeerIdentity *pids)
We got an incoming connection, obtain the corresponding path.
unsigned int GCPP_find_peer(struct CadetPeerPath *path, struct CadetPeer *cp)
Find peer's offset on path.
static struct GNUNET_OS_Process * p
Helper process we started.
Definition: gnunet-uri.c:38
API to the DHT service.
uint64_t GNUNET_CONTAINER_HeapCostType
Cost by which elements in a heap can be ordered.
Low-level connection to a destination.
struct CadetPeerPath * path
Path we are using to our destination.
unsigned int off
Offset of our destination in path.
struct CadetPeer * destination
To which peer does this connection go?
Information regarding a possible path to reach a peer.
Struct containing all information regarding a given peer.
A (signed) path tracking a block's flow through the DHT is represented by an array of path elements,...
The identity of the host (wraps the signing key of the peer).