GNUnet  0.10.x
gnunet-service-cadet.h
Go to the documentation of this file.
1 
2 /*
3  This file is part of GNUnet.
4  Copyright (C) 2001-2017 GNUnet e.V.
5 
6  GNUnet is free software: you can redistribute it and/or modify it
7  under the terms of the GNU Affero General Public License as published
8  by the Free Software Foundation, either version 3 of the License,
9  or (at your option) any later version.
10 
11  GNUnet is distributed in the hope that it will be useful, but
12  WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Affero General Public License for more details.
15 
16  You should have received a copy of the GNU Affero General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19  SPDX-License-Identifier: AGPL3.0-or-later
20 */
21 
28 #ifndef GNUNET_SERVICE_CADET_H
29 #define GNUNET_SERVICE_CADET_H
30 
31 #include "gnunet_util_lib.h"
32 #include "cadet_protocol.h"
33 
37 struct CadetClient;
38 
43 struct CadetPeer;
44 
49 struct CadetTunnel;
50 
55 
62 struct CadetPeerPath;
63 
68 {
73 
78 
82  struct CadetPeer *peer;
83 
88 
93 
101  int score;
102 
103 };
104 
109 {
114 
119 
124 
128  struct CadetTunnel *t;
129 
133  struct GNUNET_TIME_Absolute created;
134 
138  uint32_t throughput;
139 
143  int is_ready;
144 };
145 
146 
150 struct OpenPort
151 {
152 
156  struct CadetClient *c;
157 
162 
166  struct GNUNET_HashCode h_port;
167 
168 };
169 
170 
175 struct CadetConnection;
176 
185 struct CadetRoute;
186 
191 struct CadetChannel;
192 
196 extern const struct GNUNET_CONFIGURATION_Handle *cfg;
197 
201 extern struct GNUNET_STATISTICS_Handle *stats;
202 
207 
211 extern struct GNUNET_PeerIdentity my_full_id;
212 
217 
223 
229 
236 
240 extern struct GNUNET_CONTAINER_MultiPeerMap *peers;
241 
245 extern unsigned long long ratchet_messages;
246 
250 extern struct GNUNET_TIME_Relative ratchet_time;
251 
256 
260 extern int shutting_down;
261 
265 extern unsigned long long drop_percent;
266 
267 
274 void
276  struct GNUNET_MQ_Envelope *env);
277 
278 
286 void
289  struct CadetChannel *ch);
290 
298 void
299 GSC_drop_loose_channel (const struct GNUNET_HashCode *h_port,
300  struct CadetChannel *ch);
301 
302 
315 GSC_bind (struct CadetClient *c,
316  struct CadetChannel *ch,
317  struct CadetPeer *dest,
318  const struct GNUNET_HashCode *port,
319  uint32_t options);
320 
321 
328 const char *
329 GSC_2s (struct CadetClient *c);
330 
331 
332 #endif
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
Peer description.
unsigned long long drop_percent
Set to non-zero values to create random drops to test retransmissions.
Low-level connection to a destination.
struct GNUNET_TIME_Relative ratchet_time
How long until we trigger a ratched advance due to time.
int is_ready
Is the connection currently ready for transmission?
struct CadetPeer * peer
The peer at this offset of the path.
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
void GSC_handle_remote_channel_destroy(struct CadetClient *c, struct GNUNET_CADET_ClientChannelNumber ccn, struct CadetChannel *ch)
A channel was destroyed by the other peer.
struct CadetConnection * cc
Connection using this path, or NULL for none.
struct CadetPeer * dest
Destinaton to ping.
Entry in a peer path.
struct GNUNET_PeerIdentity my_full_id
Local peer own ID.
void GSC_send_to_client(struct CadetClient *c, struct GNUNET_MQ_Envelope *env)
Send a message to a client.
struct GNUNET_CONTAINER_MultiHashMap * loose_channels
Map from ports to channels where the ports were closed at the time we got the inbound connection...
Handle for the service.
unsigned long long ratchet_messages
How many messages are needed to trigger an AXOLOTL ratchet advance.
Internal representation of the hash map.
struct GNUNET_CONTAINER_MultiPeerMap * peers
Map from PIDs to struct CadetPeer entries.
struct CadetTunnel * t
Tunnel this connection belongs to.
struct GNUNET_CONTAINER_MultiHashMap * open_ports
All ports clients of this peer have opened.
uint32_t throughput
Connection throughput, to keep fastest connection alive.
struct GNUNET_ATS_ConnectivityHandle * ats_ch
Handle to communicate with ATS.
Struct containing all information regarding a channel to a remote client.
struct CadetPeerPath * path
Path this entry belongs to.
Description of a segment of a struct CadetConnection at the intermediate peers.
const struct GNUNET_CONFIGURATION_Handle * cfg
Handle to our configuration.
Definition: ats-testing.c:51
Number uniquely identifying a channel of a client.
Definition: cadet.h:102
Internal representation of the hash map.
A 512-bit hashcode.
struct CadetPeerPathEntry * prev
DLL of paths where the same peer is at the same offset.
int shutting_down
Signal that shutdown is happening: prevent recovery measures.
struct CadetConnection * cc
Connection handle.
int score
Path&#39;s historic score up to this point.
Struct containing all information regarding a tunnel to a peer.
struct GNUNET_TIME_Relative keepalive_period
How frequently do we send KEEPALIVE messages on idle connections?
Struct containing information about a client of the service.
Internal representation of the hash map.
Struct used to save messages in a non-ready tunnel to send once connected.
struct GNUNET_CONTAINER_MultiShortmap * connections
Map from struct GNUNET_CADET_ConnectionTunnelIdentifier hash codes to struct CadetConnection objects...
void GSC_drop_loose_channel(const struct GNUNET_HashCode *h_port, struct CadetChannel *ch)
A client that created a loose channel that was not bound to a port disconnected, drop it from the loo...
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
const char * GSC_2s(struct CadetClient *c)
Return identifier for a client as a string.
P2P messages used by CADET.
Private ECC key encoded for transmission.
Entry in list of connections used by tunnel, with metadata.
The identity of the host (wraps the signing key of the peer).
static uint16_t port
Port number.
Definition: gnunet-bcd.c:79
configuration data
Definition: configuration.c:85
struct CadetTConnection * prev
Prev in DLL.
struct GNUNET_CRYPTO_EddsaPrivateKey * my_private_key
Own private key.
struct GNUNET_STATISTICS_Handle * stats
Handle to the statistics service.
Time for absolute times used by GNUnet, in microseconds.
struct CadetTConnection * next
Next in DLL.
Information regarding a possible path to reach a peer.
Handle to the ATS subsystem for connectivity management.
struct CadetClient * c
Client that opened the port.
Port opened by a client.
struct CadetPeerPathEntry * next
DLL of paths where the same peer is at the same offset.
struct GNUNET_CADET_ClientChannelNumber GSC_bind(struct CadetClient *c, struct CadetChannel *ch, struct CadetPeer *dest, const struct GNUNET_HashCode *port, uint32_t options)
Bind incoming channel to this client, and notify client about incoming connection.
Time for relative time used by GNUnet, in microseconds.