GNUnet  0.10.x
gnunet-service-cadet_connection.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 
31 #ifndef GNUNET_SERVICE_CADET_CONNECTION_H
32 #define GNUNET_SERVICE_CADET_CONNECTION_H
33 
34 #include "gnunet_util_lib.h"
35 #include "gnunet-service-cadet.h"
37 #include "cadet_protocol.h"
38 
39 
47 typedef void
48 (*GCC_ReadyCallback)(void *cls,
49  int is_ready);
50 
51 
60 void
62 
63 
71 void
73 
74 
81 struct CadetConnection *
83 
84 
98 struct CadetConnection *
100  struct CadetPeerPath *path,
101  unsigned int off,
103  struct CadetTConnection *ct,
105  void *ready_cb_cls);
106 
107 
122 struct CadetConnection *
124  struct CadetPeerPath *path,
126  struct CadetTConnection *ct,
129  void *ready_cb_cls);
130 
131 
144 void
145 GCC_transmit (struct CadetConnection *cc,
146  struct GNUNET_MQ_Envelope *env);
147 
148 
154 void
156 
157 
165 void
167 
168 
175 void
176 GCC_handle_kx (struct CadetConnection *cc,
178 
179 
186 void
189 
190 
195 {
196 
202 
208 
214 
219  unsigned long long num_acked_transmissions;
220 
228  unsigned long long num_successes;
229 
230 };
231 
232 
239 const struct CadetConnectionMetrics *
240 GCC_get_metrics (struct CadetConnection *cc);
241 
242 
249 void
252 
253 
260 void
262 
263 
272 void
274 
275 
284 void
286  struct GNUNET_TIME_Relative latency);
287 
288 
295 struct CadetTConnection *
296 GCC_get_ct (struct CadetConnection *cc);
297 
298 
306 struct CadetPeerPath *
307 GCC_get_path (struct CadetConnection *cc,
308  unsigned int *off);
309 
310 
318 GCC_get_id (struct CadetConnection *cc);
319 
320 
326 const char *
327 GCC_2s (const struct CadetConnection *cc);
328 
329 
336 void
337 GCC_debug (struct CadetConnection *cc,
338  enum GNUNET_ErrorType level);
339 
340 
341 #endif
Axolotl-encrypted tunnel message with application payload.
void GCC_destroy_without_core(struct CadetConnection *cc)
Destroy a connection, called when the CORE layer is already done (i.e.
Peer description.
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
Low-level connection to a destination.
void GCC_ack_observed(const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid)
We observed an ACK for a message that was originally sent via the connection identified by cti...
const char * GCC_2s(const struct CadetConnection *cc)
Get a (static) string for a connection.
void GCC_latency_observed(const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti, struct GNUNET_TIME_Relative latency)
We observed some the given latency on the connection identified by cti.
void GCC_destroy_without_tunnel(struct CadetConnection *cc)
Destroy a connection, called if the tunnel association with the connection was already broken...
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
unsigned long long num_successes
Number of packets that were sent via this connection did actually receive an ACK? (Note: ACKs may be ...
struct GNUNET_TIME_Absolute last_use
When was this connection last used? (by us sending or receiving a PAYLOAD message on it) ...
void GCC_handle_encrypted(struct CadetConnection *cc, const struct GNUNET_CADET_TunnelEncryptedMessage *msg)
Handle encrypted message.
const struct CadetConnectionMetrics * GCC_get_metrics(struct CadetConnection *cc)
Obtain performance metrics from cc.
struct CadetPeerPath * path
Path we are using to our destination.
struct GNUNET_CADET_ConnectionTunnelIdentifier cid
ID of the connection.
void GCC_handle_connection_create_ack(struct CadetConnection *cc)
A CREATE_ACK was received for this connection, process it.
struct CadetPeer * destination
To which peer does this connection go?
void GCC_ack_expected(const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid)
We sent a message for which we expect to receive an ACK via the connection identified by cti...
GNUNET_ErrorType
Types of errors.
GCC_ReadyCallback ready_cb
Function to call once we are ready to transmit.
Performance metrics for a connection.
Information we track per peer.
void GCC_handle_kx_auth(struct CadetConnection *cc, const struct GNUNET_CADET_TunnelKeyExchangeAuthMessage *msg)
Handle KX_AUTH message.
Message for a Key eXchange for a tunnel, with authentication.
struct CadetConnection * GCC_lookup(const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid)
Lookup a connection by its identifier.
struct GNUNET_TIME_Relative aged_latency
Our current best estimate of the latency, based on a weighted average of at least latency_datapoints ...
struct CadetTConnection * ct
Which tunnel is using this connection?
struct CadetConnection * cc
Connection handle.
const struct GNUNET_CADET_ConnectionTunnelIdentifier * GCC_get_id(struct CadetConnection *cc)
Obtain unique ID for the connection.
void GCC_handle_kx(struct CadetConnection *cc, const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg)
Handle KX message.
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
void GCC_transmit(struct CadetConnection *cc, struct GNUNET_MQ_Envelope *env)
Transmit message msg via connection cc.
P2P messages used by CADET.
void(* GCC_ReadyCallback)(void *cls, int is_ready)
Function called to notify tunnel about change in our readyness.
void GCC_debug(struct CadetConnection *cc, enum GNUNET_ErrorType level)
Log connection info.
struct CadetPeerPath * GCC_get_path(struct CadetConnection *cc, unsigned int *off)
Obtain the path used by this connection.
struct CadetConnection * GCC_create_inbound(struct CadetPeer *destination, struct CadetPeerPath *path, enum GNUNET_CADET_ChannelOption options, struct CadetTConnection *ct, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, GCC_ReadyCallback ready_cb, void *ready_cb_cls)
Create a connection to destination via path and notify cb whenever we are ready for more data...
Entry in list of connections used by tunnel, with metadata.
struct CadetConnection * GCC_create(struct CadetPeer *destination, struct CadetPeerPath *path, unsigned int off, enum GNUNET_CADET_ChannelOption options, struct CadetTConnection *ct, GCC_ReadyCallback ready_cb, void *ready_cb_cls)
Create a connection to destination via path and notify cb whenever we are ready for more data...
void * ready_cb_cls
Closure for ready_cb.
Hash uniquely identifying a connection below a tunnel.
struct CadetTConnection * GCC_get_ct(struct CadetConnection *cc)
Return the tunnel associated with this connection.
Message for a Key eXchange for a tunnel.
unsigned long long num_acked_transmissions
How many packets that ought to generate an ACK did we send via this connection?
Time for absolute times used by GNUnet, in microseconds.
struct GNUNET_TIME_Absolute age
When was this connection first established? (by us sending or receiving the CREATE_ACK for the first ...
Information regarding a possible path to reach a peer.
GNUNET_CADET_ChannelOption
Channel options.
Time for relative time used by GNUnet, in microseconds.
unsigned int off
Offset of our destination in path.
void GCC_handle_duplicate_create(struct CadetConnection *cc)
We got a GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE for a connection that we already have...
Information we track per peer.