aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-10-27 19:46:53 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-10-27 19:46:53 +0000
commit78eb3927110c2928aaf796efe7b362163455d92a (patch)
tree234071c432a17a7e68f4abd59819fb0328a9966a /src
parent86aeeca981ef8a12f4036b6c5f2cbb8837946c4a (diff)
downloadgnunet-78eb3927110c2928aaf796efe7b362163455d92a.tar.gz
gnunet-78eb3927110c2928aaf796efe7b362163455d92a.zip
Diffstat (limited to 'src')
-rw-r--r--src/transport/gnunet-service-transport_3way.c2
-rw-r--r--src/transport/gnunet-service-transport_neighbours.h54
-rw-r--r--src/transport/gnunet-service-transport_neighbours_3way.h7
3 files changed, 61 insertions, 2 deletions
diff --git a/src/transport/gnunet-service-transport_3way.c b/src/transport/gnunet-service-transport_3way.c
index a24d6c1b1..5d8b5ccd0 100644
--- a/src/transport/gnunet-service-transport_3way.c
+++ b/src/transport/gnunet-service-transport_3way.c
@@ -403,7 +403,7 @@ ats_request_address_change (void *cls, const struct GNUNET_PeerIdentity *peer,
403 return; 403 return;
404 } 404 }
405 /* will never return GNUNET_YES since connection is to be established */ 405 /* will never return GNUNET_YES since connection is to be established */
406 GST_neighbours_switch_to_address (peer, plugin_name, plugin_addr, 406 GST_neighbours_switch_to_address_3way (peer, plugin_name, plugin_addr,
407 plugin_addr_len, session, ats, ats_count, 407 plugin_addr_len, session, ats, ats_count,
408 bandwidth_in, bandwidth_out); 408 bandwidth_in, bandwidth_out);
409} 409}
diff --git a/src/transport/gnunet-service-transport_neighbours.h b/src/transport/gnunet-service-transport_neighbours.h
index 09384bafd..272f059dd 100644
--- a/src/transport/gnunet-service-transport_neighbours.h
+++ b/src/transport/gnunet-service-transport_neighbours.h
@@ -210,6 +210,14 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
210 const struct GNUNET_ATS_Information 210 const struct GNUNET_ATS_Information
211 *ats, uint32_t ats_count); 211 *ats, uint32_t ats_count);
212 212
213int
214GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer,
215 const char *plugin_name, const void *address,
216 size_t address_len, struct Session *session,
217 const struct GNUNET_ATS_Information
218 *ats, uint32_t ats_count,
219 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
220 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out);
213 221
214/** 222/**
215 * We received a 'SESSION_CONNECT' message from the other peer. 223 * We received a 'SESSION_CONNECT' message from the other peer.
@@ -223,7 +231,7 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
223 * @param address_len number of bytes in address 231 * @param address_len number of bytes in address
224 * @param session session to use (or NULL) 232 * @param session session to use (or NULL)
225 * @param ats performance data 233 * @param ats performance data
226 * @param ats_count number of entries in ats (excluding 0-termination) 234 * @param ats_count number of entries in ats
227 */ 235 */
228void 236void
229GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message, 237GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message,
@@ -235,6 +243,50 @@ GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message,
235 uint32_t ats_count); 243 uint32_t ats_count);
236 244
237/** 245/**
246 * We received a 'SESSION_CONNECT_ACK' message from the other peer.
247 *
248 * @param message possibly a 'struct SessionConnectMessage' (check format)
249 * @param peer identity of the peer to switch the address for
250 * @param plugin_name name of transport that delivered the PONG
251 * @param address address of the other peer, NULL if other peer
252 * connected to us
253 * @param address_len number of bytes in address
254 * @param session session to use (or NULL)
255 * @param ats performance data
256 * @param ats_count number of entries in ats
257 */
258void
259GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message,
260 const struct GNUNET_PeerIdentity *peer,
261 const char *plugin_name,
262 const char *sender_address, uint16_t sender_address_len,
263 struct Session *session,
264 const struct GNUNET_ATS_Information *ats,
265 uint32_t ats_count);
266
267/**
268 * We received a 'SESSION_ACK' message from the other peer.
269 *
270 * @param message possibly a 'struct SessionConnectMessage' (check format)
271 * @param peer identity of the peer to switch the address for
272 * @param plugin_name name of transport that delivered the PONG
273 * @param address address of the other peer, NULL if other peer
274 * connected to us
275 * @param address_len number of bytes in address
276 * @param session session to use (or NULL)
277 * @param ats performance data
278 * @param ats_count number of entries in ats
279 */
280void
281GST_neighbours_handle_ack (const struct GNUNET_MessageHeader *message,
282 const struct GNUNET_PeerIdentity *peer,
283 const char *plugin_name,
284 const char *sender_address, uint16_t sender_address_len,
285 struct Session *session,
286 const struct GNUNET_ATS_Information *ats,
287 uint32_t ats_count);
288
289/**
238 * We received a disconnect message from the given peer, 290 * We received a disconnect message from the given peer,
239 * validate and process. 291 * validate and process.
240 * 292 *
diff --git a/src/transport/gnunet-service-transport_neighbours_3way.h b/src/transport/gnunet-service-transport_neighbours_3way.h
index 88790449e..3868ef2cf 100644
--- a/src/transport/gnunet-service-transport_neighbours_3way.h
+++ b/src/transport/gnunet-service-transport_neighbours_3way.h
@@ -210,6 +210,13 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
210 const char *plugin_name, const void *address, 210 const char *plugin_name, const void *address,
211 size_t address_len, struct Session *session, 211 size_t address_len, struct Session *session,
212 const struct GNUNET_ATS_Information 212 const struct GNUNET_ATS_Information
213 *ats, uint32_t ats_count);
214
215int
216GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer,
217 const char *plugin_name, const void *address,
218 size_t address_len, struct Session *session,
219 const struct GNUNET_ATS_Information
213 *ats, uint32_t ats_count, 220 *ats, uint32_t ats_count,
214 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 221 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
215 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out); 222 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out);