GNUnet  0.11.x
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-service-cadet.h"
32 
44 void
45 GCPP_try_path_from_dht (const struct GNUNET_PeerIdentity *get_path,
46  unsigned int get_path_length,
47  const struct GNUNET_PeerIdentity *put_path,
48  unsigned int put_path_length);
49 
50 
58 struct CadetPeerPath *
59 GCPP_get_path_from_route (unsigned int path_length,
60  const struct GNUNET_PeerIdentity *pids);
61 
62 
70 unsigned int
71 GCPP_get_length (struct CadetPeerPath *path);
72 
73 
84 struct CadetConnection *
86  struct CadetPeer *destination,
87  unsigned int off);
88 
89 
98 void
100  unsigned int off,
101  struct CadetConnection *cc);
102 
103 
112 void
114  unsigned int off,
115  struct CadetConnection *cc);
116 
117 
125 unsigned int
127  struct CadetPeer *cp);
128 
129 
145 
146 
155 void
157 
158 
166 struct CadetPeer *
168  unsigned int off);
169 
170 
177 const char *
178 GCPP_2s (struct CadetPeerPath *p);
179 
180 
181 #endif
Peer description.
GNUNET_CONTAINER_HeapCostType GCPP_get_desirability(const struct CadetPeerPath *path)
Return how much we like keeping the path.
const char * GCPP_2s(struct CadetPeerPath *p)
Convert a path to a human-readable string.
Low-level connection to a destination.
struct CadetPeerPath * path
Path we are using to our destination.
struct CadetPeer * destination
To which peer does this connection go?
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&#39;s offset off...
void GCPP_release(struct CadetPeerPath *path)
The given peer cp used to own this path.
struct CadetPeer * GCPP_get_peer_at_offset(struct CadetPeerPath *path, unsigned int off)
Obtain the peer at offset off in path.
static struct GNUNET_OS_Process * p
Helper process we started.
Definition: gnunet-qr.c:59
void GCPP_try_path_from_dht(const struct GNUNET_PeerIdentity *get_path, unsigned int get_path_length, const struct GNUNET_PeerIdentity *put_path, unsigned int put_path_length)
Create a peer path based on the result of a DHT lookup.
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...
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.
uint64_t GNUNET_CONTAINER_HeapCostType
Cost by which elements in a heap can be ordered.
The identity of the host (wraps the signing key of the peer).
unsigned int GCPP_find_peer(struct CadetPeerPath *path, struct CadetPeer *cp)
Find peer&#39;s offset on 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&#39;s offset off.
unsigned int GCPP_get_length(struct CadetPeerPath *path)
Return the length of the path.
Information regarding a possible path to reach a peer.
unsigned int off
Offset of our destination in path.
Information we track per peer.