aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-26 04:14:43 +0200
committerChristian Grothoff <christian@grothoff.org>2017-03-26 04:14:43 +0200
commit7978b76868ba81efaa4b65b47a54ee55cd092382 (patch)
tree7248f8a1c07364ba66435fe31d915e50df138d4c /src/cadet/gnunet-service-cadet.h
parent9cfc671375ef346c3ff40fbcdd7c2c090972072a (diff)
downloadgnunet-7978b76868ba81efaa4b65b47a54ee55cd092382.tar.gz
gnunet-7978b76868ba81efaa4b65b47a54ee55cd092382.zip
implement #4973
Diffstat (limited to 'src/cadet/gnunet-service-cadet.h')
-rw-r--r--src/cadet/gnunet-service-cadet.h34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/cadet/gnunet-service-cadet.h b/src/cadet/gnunet-service-cadet.h
index 2f2d7baf3..162867823 100644
--- a/src/cadet/gnunet-service-cadet.h
+++ b/src/cadet/gnunet-service-cadet.h
@@ -29,7 +29,6 @@
29#define GNUNET_SERVICE_CADET_H 29#define GNUNET_SERVICE_CADET_H
30 30
31#include "gnunet_util_lib.h" 31#include "gnunet_util_lib.h"
32#define NEW_CADET 1
33#include "cadet_protocol.h" 32#include "cadet_protocol.h"
34 33
35/** 34/**
@@ -146,6 +145,30 @@ struct CadetTConnection
146 145
147 146
148/** 147/**
148 * Port opened by a client.
149 */
150struct OpenPort
151{
152
153 /**
154 * Client that opened the port.
155 */
156 struct CadetClient *c;
157
158 /**
159 * Port number.
160 */
161 struct GNUNET_HashCode port;
162
163 /**
164 * Port hashed with our PID (matches incoming OPEN messages).
165 */
166 struct GNUNET_HashCode h_port;
167
168};
169
170
171/**
149 * Active path through the network (used by a tunnel). There may 172 * Active path through the network (used by a tunnel). There may
150 * be at most one connection per path. 173 * be at most one connection per path.
151 */ 174 */
@@ -193,7 +216,8 @@ extern struct GNUNET_PeerIdentity my_full_id;
193extern struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key; 216extern struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
194 217
195/** 218/**
196 * All ports clients of this peer have opened. 219 * All ports clients of this peer have opened. Maps from
220 * a hashed port to a `struct OpenPort`.
197 */ 221 */
198extern struct GNUNET_CONTAINER_MultiHashMap *open_ports; 222extern struct GNUNET_CONTAINER_MultiHashMap *open_ports;
199 223
@@ -206,7 +230,7 @@ extern struct GNUNET_CONTAINER_MultiShortmap *connections;
206/** 230/**
207 * Map from ports to channels where the ports were closed at the 231 * Map from ports to channels where the ports were closed at the
208 * time we got the inbound connection. 232 * time we got the inbound connection.
209 * Indexed by port, contains `struct CadetChannel`. 233 * Indexed by h_port, contains `struct CadetChannel`.
210 */ 234 */
211extern struct GNUNET_CONTAINER_MultiHashMap *loose_channels; 235extern struct GNUNET_CONTAINER_MultiHashMap *loose_channels;
212 236
@@ -268,11 +292,11 @@ GSC_handle_remote_channel_destroy (struct CadetClient *c,
268 * A client that created a loose channel that was not bound to a port 292 * A client that created a loose channel that was not bound to a port
269 * disconnected, drop it from the #loose_channels list. 293 * disconnected, drop it from the #loose_channels list.
270 * 294 *
271 * @param port the port the channel was trying to bind to 295 * @param h_port the hashed port the channel was trying to bind to
272 * @param ch the channel that was lost 296 * @param ch the channel that was lost
273 */ 297 */
274void 298void
275GSC_drop_loose_channel (const struct GNUNET_HashCode *port, 299GSC_drop_loose_channel (const struct GNUNET_HashCode *h_port,
276 struct CadetChannel *ch); 300 struct CadetChannel *ch);
277 301
278 302