diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-03-26 04:14:43 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-03-26 04:14:43 +0200 |
commit | 7978b76868ba81efaa4b65b47a54ee55cd092382 (patch) | |
tree | 7248f8a1c07364ba66435fe31d915e50df138d4c /src/cadet/gnunet-service-cadet_channel.h | |
parent | 9cfc671375ef346c3ff40fbcdd7c2c090972072a (diff) | |
download | gnunet-7978b76868ba81efaa4b65b47a54ee55cd092382.tar.gz gnunet-7978b76868ba81efaa4b65b47a54ee55cd092382.zip |
implement #4973
Diffstat (limited to 'src/cadet/gnunet-service-cadet_channel.h')
-rw-r--r-- | src/cadet/gnunet-service-cadet_channel.h | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/cadet/gnunet-service-cadet_channel.h b/src/cadet/gnunet-service-cadet_channel.h index a3ef9a06d..16517c457 100644 --- a/src/cadet/gnunet-service-cadet_channel.h +++ b/src/cadet/gnunet-service-cadet_channel.h | |||
@@ -1,4 +1,3 @@ | |||
1 | |||
2 | /* | 1 | /* |
3 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
4 | Copyright (C) 2001-2017 GNUnet e.V. | 3 | Copyright (C) 2001-2017 GNUnet e.V. |
@@ -45,6 +44,21 @@ struct CadetChannel; | |||
45 | 44 | ||
46 | 45 | ||
47 | /** | 46 | /** |
47 | * Hash the @a port and @a initiator and @a listener to | ||
48 | * calculate the "challenge" @a h_port we send to the other | ||
49 | * peer on #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN. | ||
50 | * | ||
51 | * @param[out] h_port set to the hash of @a port, @a initiator and @a listener | ||
52 | * @param port cadet port, as seen by CADET clients | ||
53 | * @param listener peer that is listining on @a port | ||
54 | */ | ||
55 | void | ||
56 | GCCH_hash_port (struct GNUNET_HashCode *h_port, | ||
57 | const struct GNUNET_HashCode *port, | ||
58 | const struct GNUNET_PeerIdentity *listener); | ||
59 | |||
60 | |||
61 | /** | ||
48 | * Get the static string for identification of the channel. | 62 | * Get the static string for identification of the channel. |
49 | * | 63 | * |
50 | * @param ch Channel. | 64 | * @param ch Channel. |
@@ -101,11 +115,13 @@ GCCH_channel_local_new (struct CadetClient *owner, | |||
101 | * request and establish the link with the client. | 115 | * request and establish the link with the client. |
102 | * | 116 | * |
103 | * @param ch open incoming channel | 117 | * @param ch open incoming channel |
104 | * @param c client listening on the respective port | 118 | * @param c client listening on the respective @a port |
119 | * @param port port number @a c is listening on | ||
105 | */ | 120 | */ |
106 | void | 121 | void |
107 | GCCH_bind (struct CadetChannel *ch, | 122 | GCCH_bind (struct CadetChannel *ch, |
108 | struct CadetClient *c); | 123 | struct CadetClient *c, |
124 | const struct GNUNET_HashCode *port); | ||
109 | 125 | ||
110 | 126 | ||
111 | /** | 127 | /** |
@@ -142,14 +158,14 @@ GCCH_tunnel_up (struct CadetChannel *ch); | |||
142 | * @param t tunnel to the remote peer | 158 | * @param t tunnel to the remote peer |
143 | * @param chid identifier of this channel in the tunnel | 159 | * @param chid identifier of this channel in the tunnel |
144 | * @param origin peer to who initiated the channel | 160 | * @param origin peer to who initiated the channel |
145 | * @param port desired local port | 161 | * @param h_port hash of desired local port |
146 | * @param options options for the channel | 162 | * @param options options for the channel |
147 | * @return handle to the new channel | 163 | * @return handle to the new channel |
148 | */ | 164 | */ |
149 | struct CadetChannel * | 165 | struct CadetChannel * |
150 | GCCH_channel_incoming_new (struct CadetTunnel *t, | 166 | GCCH_channel_incoming_new (struct CadetTunnel *t, |
151 | struct GNUNET_CADET_ChannelTunnelNumber chid, | 167 | struct GNUNET_CADET_ChannelTunnelNumber chid, |
152 | const struct GNUNET_HashCode *port, | 168 | const struct GNUNET_HashCode *h_port, |
153 | uint32_t options); | 169 | uint32_t options); |
154 | 170 | ||
155 | 171 | ||
@@ -201,10 +217,12 @@ GCCH_handle_channel_plaintext_data_ack (struct CadetChannel *ch, | |||
201 | * @param ch channel to destroy | 217 | * @param ch channel to destroy |
202 | * @param cti identifier of the connection that delivered the message, | 218 | * @param cti identifier of the connection that delivered the message, |
203 | * NULL if the ACK was inferred because we got payload or are on loopback | 219 | * NULL if the ACK was inferred because we got payload or are on loopback |
220 | * @param port port number (needed to verify receiver knows the port) | ||
204 | */ | 221 | */ |
205 | void | 222 | void |
206 | GCCH_handle_channel_open_ack (struct CadetChannel *ch, | 223 | GCCH_handle_channel_open_ack (struct CadetChannel *ch, |
207 | const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti); | 224 | const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti, |
225 | const struct GNUNET_HashCode *port); | ||
208 | 226 | ||
209 | 227 | ||
210 | /** | 228 | /** |