GNUnet  0.11.x
gnunet-service-cadet_tunnels.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_TUNNELS_H
28 #define GNUNET_SERVICE_CADET_TUNNELS_H
29 
30 #include "gnunet-service-cadet.h"
31 #include "cadet_protocol.h"
32 
33 
37 #define DESIRED_CONNECTIONS_PER_TUNNEL 3
38 
39 
44 {
50 
55 
60 
65 
76 
81 };
82 
83 
91 const char *
92 GCT_2s (const struct CadetTunnel *t);
93 
94 
102 struct CadetTunnel *
104 
105 
111 void
113 
114 
124 int
126  const struct
128  struct CadetPeerPath *path);
129 
130 
137 void
139 
140 
147 struct CadetPeer *
149 
150 
159 void
161  struct CadetPeerPath *p,
162  unsigned int off);
163 
164 
173 GCT_add_channel (struct CadetTunnel *t,
174  struct CadetChannel *ch);
175 
176 
184 void
186  struct CadetChannel *ch,
188 
189 
196 void
199 
200 
209 typedef void
210 (*GCT_SendContinuation)(void *cls,
211  const struct
213 
214 
225 struct CadetTunnelQueueEntry *
226 GCT_send (struct CadetTunnel *t,
227  const struct GNUNET_MessageHeader *message,
229  void *cont_cls);
230 
231 
241 void
243 
244 
251 unsigned int
252 GCT_count_channels (struct CadetTunnel *t);
253 
254 
261 unsigned int
262 GCT_count_any_connections (const struct CadetTunnel *t);
263 
264 
271 typedef void
273  struct CadetTConnection *ct);
274 
275 
283 void
286  void *iter_cls);
287 
288 
295 typedef void
296 (*GCT_ChannelIterator) (void *cls,
297  struct CadetChannel *ch);
298 
299 
307 void
309  GCT_ChannelIterator iter,
310  void *iter_cls);
311 
312 
321 GCT_get_estate (struct CadetTunnel *t);
322 
323 
330 void
331 GCT_handle_kx (struct CadetTConnection *ct,
333 
334 
341 void
343  const struct
345 
346 
353 void
356 
357 
364 void
365 GCT_debug (const struct CadetTunnel *t,
366  enum GNUNET_ErrorType level);
367 
368 
369 #endif
struct CadetPeer * GCT_get_destination(struct CadetTunnel *t)
Return the peer to which this tunnel goes.
Axolotl-encrypted tunnel message with application payload.
struct GNUNET_CADET_ChannelTunnelNumber GCT_add_channel(struct CadetTunnel *t, struct CadetChannel *ch)
Add a channel to a tunnel.
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
Peer description.
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
enum CadetTunnelEState GCT_get_estate(struct CadetTunnel *t)
Get the encryption state of a tunnel.
void GCT_handle_encrypted(struct CadetTConnection *ct, const struct GNUNET_CADET_TunnelEncryptedMessage *msg)
Handle encrypted message.
void(* GCT_SendContinuation)(void *cls, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid)
Function called when a transmission requested using GCT_send is done.
void GCT_send_channel_destroy(struct CadetTunnel *t, struct GNUNET_CADET_ChannelTunnelNumber ctn)
Send a DESTROY message via the tunnel.
int GCT_add_inbound_connection(struct CadetTunnel *t, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, struct CadetPeerPath *path)
Add a connection to the tunnel.
KX received and we sent KX_AUTH back, but we got no traffic yet, so we&#39;re waiting for either KX_AUTH ...
void GCT_send_cancel(struct CadetTunnelQueueEntry *q)
Cancel a previously sent message while it&#39;s in the queue.
GNUNET_ErrorType
Types of errors.
KX message sent, waiting for other peer&#39;s KX_AUTH.
static struct GNUNET_SCHEDULER_Task * t
Main task.
struct CadetTunnelQueueEntry * GCT_send(struct CadetTunnel *t, const struct GNUNET_MessageHeader *message, GCT_SendContinuation cont, void *cont_cls)
Sends an already built message on a tunnel, encrypting it and choosing the best connection if not pro...
void GCT_iterate_connections(struct CadetTunnel *t, GCT_ConnectionIterator iter, void *iter_cls)
Iterate over all connections of a tunnel.
struct CadetTunnel * GCT_create_tunnel(struct CadetPeer *destination)
Create a tunnel to destionation.
void GCT_consider_path(struct CadetTunnel *t, struct CadetPeerPath *p, unsigned int off)
Consider using the path p for the tunnel t.
void GCT_destroy_tunnel_now(struct CadetTunnel *t)
Destroys the tunnel t now, without delay.
void(* GCT_ConnectionIterator)(void *cls, struct CadetTConnection *ct)
Iterator over connections.
static struct GNUNET_OS_Process * p
Helper process we started.
Definition: gnunet-qr.c:59
const char * GCT_2s(const struct CadetTunnel *t)
Get the static string for the peer this tunnel is directed.
CadetTunnelEState
All the encryption states a tunnel can be in.
Struct containing all information regarding a channel to a remote client.
Message for a Key eXchange for a tunnel, with authentication.
void GCT_debug(const struct CadetTunnel *t, enum GNUNET_ErrorType level)
Log all possible info about the tunnel state.
unsigned int GCT_count_channels(struct CadetTunnel *t)
Return the number of channels using a tunnel.
static struct GNUNET_REVOCATION_Query * q
Handle for revocation query.
struct GNUNET_CADET_ChannelTunnelNumber ctn
Number identifying this channel in its tunnel.
Struct containing all information regarding a tunnel to a peer.
Struct used to save messages in a non-ready tunnel to send once connected.
Handshake completed: session key available.
void * cont_cls
Closure for cont.
P2P messages used by CADET.
void GCT_handle_kx(struct CadetTConnection *ct, const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg)
Handle KX message.
void GCT_remove_channel(struct CadetTunnel *t, struct CadetChannel *ch, struct GNUNET_CADET_ChannelTunnelNumber ctn)
Remove a channel from a tunnel.
Entry in list of connections used by tunnel, with metadata.
KX message sent and received, trying to send back KX_AUTH.
struct CadetPeer * destination
Destination of the tunnel.
Hash uniquely identifying a connection below a tunnel.
Message for a Key eXchange for a tunnel.
Number identifying a CADET channel within a tunnel.
void GCT_connection_lost(struct CadetTConnection *ct)
We lost a connection, remove it from our list and clean up the connection object itself.
unsigned int GCT_count_any_connections(const struct CadetTunnel *t)
Return the number of connections available for a tunnel.
Uninitialized status, we need to send KX.
KX message received, trying to send back KX_AUTH.
void GCT_iterate_channels(struct CadetTunnel *t, GCT_ChannelIterator iter, void *iter_cls)
Iterate over all channels of a tunnel.
Header for all communications.
void GCT_handle_kx_auth(struct CadetTConnection *ct, const struct GNUNET_CADET_TunnelKeyExchangeAuthMessage *msg)
Handle KX_AUTH message.
void(* GCT_ChannelIterator)(void *cls, struct CadetChannel *ch)
Iterator over channels.
GCT_SendContinuation cont
Continuation to call once sent (on the channel layer).
Information regarding a possible path to reach a peer.
Information we track per peer.