GNUnet  0.10.x
gnunet-service-cadet_tunnels.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_TUNNELS_H
29 #define GNUNET_SERVICE_CADET_TUNNELS_H
30 
31 #include "gnunet-service-cadet.h"
32 #include "cadet_protocol.h"
33 
34 
38 #define DESIRED_CONNECTIONS_PER_TUNNEL 3
39 
40 
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 GNUNET_CADET_ConnectionTunnelIdentifier *cid,
127  struct CadetPeerPath *path);
128 
129 
136 void
138 
139 
146 struct CadetPeer *
148 
149 
158 void
160  struct CadetPeerPath *p,
161  unsigned int off);
162 
163 
173  struct CadetChannel *ch);
174 
175 
183 void
185  struct CadetChannel *ch,
187 
188 
195 void
198 
199 
208 typedef void
209 (*GCT_SendContinuation)(void *cls,
210  const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid);
211 
212 
223 struct CadetTunnelQueueEntry *
224 GCT_send(struct CadetTunnel *t,
225  const struct GNUNET_MessageHeader *message,
227  void *cont_cls);
228 
229 
239 void
241 
242 
249 unsigned int
251 
252 
259 unsigned int
260 GCT_count_any_connections(const struct CadetTunnel *t);
261 
262 
269 typedef void
271  struct CadetTConnection *ct);
272 
273 
281 void
284  void *iter_cls);
285 
286 
293 typedef void
294 (*GCT_ChannelIterator) (void *cls,
295  struct CadetChannel *ch);
296 
297 
305 void
307  GCT_ChannelIterator iter,
308  void *iter_cls);
309 
310 
319 GCT_get_estate(struct CadetTunnel *t);
320 
321 
328 void
331 
332 
339 void
342 
343 
350 void
353 
354 
361 void
362 GCT_debug(const struct CadetTunnel *t,
363  enum GNUNET_ErrorType level);
364 
365 
366 #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.