3 This file is part of GNUnet.
4 Copyright (C) 2001-2017 GNUnet e.V.
6 GNUnet is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published
8 by the Free Software Foundation; either version 3, or (at your
9 option) any later version.
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 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNUnet; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
23 * @file cadet/gnunet-service-cadet-new.h
24 * @brief Information we track per peer.
25 * @author Bartlomiej Polot
26 * @author Christian Grothoff
28 #ifndef GNUNET_SERVICE_CADET_H
29 #define GNUNET_SERVICE_CADET_H
32 * A client to the CADET service.
37 * A peer in the GNUnet network.
42 * Tunnel from us to another peer.
47 * Entry in the message queue of a `struct CadetTunnel`
49 struct CadetTunnelQueueEntry;
52 * A path of peer in the GNUnet network.
57 * Active path through the network (used by a tunnel).
59 struct CadetConnection;
62 * Logical end-to-end conenction between clients.
67 * Handle to the statistics service.
69 extern struct GNUNET_STATISTICS_Handle *stats;
72 * Handle to communicate with ATS.
74 extern struct GNUNET_ATS_ConnectivityHandle *ats_ch;
79 extern struct GNUNET_PeerIdentity my_full_id;
84 extern struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
87 * All ports clients of this peer have opened.
89 extern struct GNUNET_CONTAINER_MultiHashMap *open_ports;
92 * Map from ports to channels where the ports were closed at the
93 * time we got the inbound connection.
94 * Indexed by port, contains `struct CadetChannel`.
96 extern struct GNUNET_CONTAINER_MultiHashMap *loose_channels;
99 * Map from PIDs to `struct CadetPeer` entries.
101 extern struct GNUNET_CONTAINER_MultiPeerMap *peers;
105 * Send a message to a client.
107 * @param c client to get the message
108 * @param env envelope with the message
111 GSC_send_to_client (struct CadetClient *c,
112 struct GNUNET_MQ_Envelope *env);
116 * Bind incoming channel to this client, and notify client
117 * about incoming connection.
119 * @param c client to bind to
120 * @param ch channel to be bound
121 * @param dest peer that establishes the connection
122 * @param port port number
123 * @param options options
124 * @return local channel number assigned to the new client
126 struct GNUNET_CADET_ClientChannelNumber
127 GSC_bind (struct CadetClient *c,
128 struct CadetChannel *ch,
129 struct CadetPeer *dest,
130 const struct GNUNET_HashCode *port,
135 * Return identifier for a client as a string.
137 * @param c client to identify
138 * @return string for debugging
141 GSC_2s (struct CadetClient *c);