aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_transport_service.h
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-08-28 13:31:48 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-08-28 13:31:48 +0000
commit56dd92a399fdebc4d2771b9f3e7790026831867b (patch)
tree164c8891d887cae79c8ed720d4321daaa196a4f7 /src/include/gnunet_transport_service.h
parent55e4ea7e6853ee2c29ae0152b517bf5c39c7dbc4 (diff)
downloadgnunet-56dd92a399fdebc4d2771b9f3e7790026831867b.tar.gz
gnunet-56dd92a399fdebc4d2771b9f3e7790026831867b.zip
using tcp terminology for 3 way handshake: syn/syn_ack/ack
renaming all functions, states, messages ...
Diffstat (limited to 'src/include/gnunet_transport_service.h')
-rw-r--r--src/include/gnunet_transport_service.h57
1 files changed, 28 insertions, 29 deletions
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h
index a7550f2c4..e7ee35d3c 100644
--- a/src/include/gnunet_transport_service.h
+++ b/src/include/gnunet_transport_service.h
@@ -493,37 +493,37 @@ GNUNET_TRANSPORT_address_to_string_cancel (struct GNUNET_TRANSPORT_AddressToStri
493/** 493/**
494 * Possible state of a neighbour. Initially, we are #GNUNET_TRANSPORT_PS_NOT_CONNECTED. 494 * Possible state of a neighbour. Initially, we are #GNUNET_TRANSPORT_PS_NOT_CONNECTED.
495 * 495 *
496 * Then, there are two main paths. If we receive a CONNECT message, we give 496 * Then, there are two main paths. If we receive a SYN message, we give
497 * the inbound address to ATS. After the check we ask ATS for a suggestion 497 * the inbound address to ATS. After the check we ask ATS for a suggestion
498 * (#GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS). If ATS makes a suggestion, we 498 * (#GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS). If ATS makes a suggestion, we
499 * send our CONNECT_ACK and go to #GNUNET_TRANSPORT_PS_CONNECT_RECV_ACK. 499 * send our SYN_ACK and go to #GNUNET_TRANSPORT_PS_CONNECT_RECV_ACK.
500 * If we receive a SESSION_ACK, we go to #GNUNET_TRANSPORT_PS_CONNECTED 500 * If we receive a ACK, we go to #GNUNET_TRANSPORT_PS_CONNECTED
501 * (and notify everyone about the new connection). If the operation times out, 501 * (and notify everyone about the new connection). If the operation times out,
502 * we go to #GNUNET_TRANSPORT_PS_DISCONNECT. 502 * we go to #GNUNET_TRANSPORT_PS_DISCONNECT.
503 * 503 *
504 * The other case is where we transmit a CONNECT message first. We 504 * The other case is where we transmit a SYN message first. We
505 * start with #GNUNET_TRANSPORT_PS_INIT_ATS. If we get an address, we send 505 * start with #GNUNET_TRANSPORT_PS_INIT_ATS. If we get an address, we send
506 * the CONNECT message and go to state #GNUNET_TRANSPORT_PS_CONNECT_SENT. 506 * the SYN message and go to state #GNUNET_TRANSPORT_PS_CONNECT_SENT.
507 * Once we receive a CONNECT_ACK, we go to #GNUNET_TRANSPORT_PS_CONNECTED 507 * Once we receive a SYN_ACK, we go to #GNUNET_TRANSPORT_PS_CONNECTED
508 * (and notify everyone about the new connection and send 508 * (and notify everyone about the new connection and send
509 * back a SESSION_ACK). If the operation times out, we go to 509 * back a ACK). If the operation times out, we go to
510 * #GNUNET_TRANSPORT_PS_DISCONNECT. 510 * #GNUNET_TRANSPORT_PS_DISCONNECT.
511 * 511 *
512 * If the session is in trouble (i.e. transport-level disconnect or 512 * If the session is in trouble (i.e. transport-level disconnect or
513 * timeout), we go to #GNUNET_TRANSPORT_PS_RECONNECT_ATS where we ask ATS for a new 513 * timeout), we go to #GNUNET_TRANSPORT_PS_RECONNECT_ATS where we ask ATS for a new
514 * address (we don't notify anyone about the disconnect yet). Once we 514 * address (we don't notify anyone about the disconnect yet). Once we
515 * have a new address, we enter #GNUNET_TRANSPORT_PS_RECONNECT_SENT and send a 515 * have a new address, we enter #GNUNET_TRANSPORT_PS_RECONNECT_SENT and send a
516 * CONNECT message. If we receive a 516 * SYN message. If we receive a
517 * CONNECT_ACK, we go to #GNUNET_TRANSPORT_PS_CONNECTED and nobody noticed that we had 517 * SYN_ACK, we go to #GNUNET_TRANSPORT_PS_CONNECTED and nobody noticed that we had
518 * trouble; we also send a SESSION_ACK at this time just in case. If 518 * trouble; we also send a ACK at this time just in case. If
519 * the operation times out, we go to #GNUNET_TRANSPORT_PS_DISCONNECT (and notify everyone 519 * the operation times out, we go to #GNUNET_TRANSPORT_PS_DISCONNECT (and notify everyone
520 * about the lost connection). 520 * about the lost connection).
521 * 521 *
522 * If ATS decides to switch addresses while we have a normal 522 * If ATS decides to switch addresses while we have a normal
523 * connection, we go to #GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_CONNECT_SENT 523 * connection, we go to #GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT
524 * and send a SESSION_CONNECT. If we get a SESSION_ACK back, we switch the 524 * and send a SESSION_CONNECT. If we get a ACK back, we switch the
525 * primary connection to the suggested alternative from ATS, go back 525 * primary connection to the suggested alternative from ATS, go back
526 * to #GNUNET_TRANSPORT_PS_CONNECTED and send a SESSION_ACK to the other peer just to be 526 * to #GNUNET_TRANSPORT_PS_CONNECTED and send a ACK to the other peer just to be
527 * sure. If the operation times out 527 * sure. If the operation times out
528 * we go to #GNUNET_TRANSPORT_PS_CONNECTED (and notify ATS that the given alternative 528 * we go to #GNUNET_TRANSPORT_PS_CONNECTED (and notify ATS that the given alternative
529 * address is "invalid"). 529 * address is "invalid").
@@ -534,13 +534,13 @@ GNUNET_TRANSPORT_address_to_string_cancel (struct GNUNET_TRANSPORT_AddressToStri
534 * generating disconnect notifications. 534 * generating disconnect notifications.
535 * 535 *
536 * Note that it is quite possible that while we are in any of these 536 * Note that it is quite possible that while we are in any of these
537 * states, we could receive a 'CONNECT' request from the other peer. 537 * states, we could receive a 'SYN' request from the other peer.
538 * We then enter a 'weird' state where we pursue our own primary state 538 * We then enter a 'weird' state where we pursue our own primary state
539 * machine (as described above), but with the 'send_connect_ack' flag 539 * machine (as described above), but with the 'send_connect_ack' flag
540 * set to 1. If our state machine allows us to send a 'CONNECT_ACK' 540 * set to 1. If our state machine allows us to send a 'SYN_ACK'
541 * (because we have an acceptable address), we send the 'CONNECT_ACK' 541 * (because we have an acceptable address), we send the 'SYN_ACK'
542 * and set the 'send_connect_ack' to 2. If we then receive a 542 * and set the 'send_connect_ack' to 2. If we then receive a
543 * 'SESSION_ACK', we go to #GNUNET_TRANSPORT_PS_CONNECTED (and reset 'send_connect_ack' 543 * 'ACK', we go to #GNUNET_TRANSPORT_PS_CONNECTED (and reset 'send_connect_ack'
544 * to 0). 544 * to 0).
545 * 545 *
546 */ 546 */
@@ -557,23 +557,22 @@ enum GNUNET_TRANSPORT_PeerState
557 GNUNET_TRANSPORT_PS_INIT_ATS, 557 GNUNET_TRANSPORT_PS_INIT_ATS,
558 558
559 /** 559 /**
560 * Sent CONNECT message to other peer, waiting for CONNECT_ACK 560 * Sent SYN message to other peer, waiting for SYN_ACK
561 */ 561 */
562 GNUNET_TRANSPORT_PS_CONNECT_SENT, 562 GNUNET_TRANSPORT_PS_SYN_SENT,
563 563
564 /** 564 /**
565 * Received a CONNECT, asking ATS about address suggestions. 565 * Received a SYN, asking ATS about address suggestions.
566 */ 566 */
567 GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS, 567 GNUNET_TRANSPORT_PS_SYN_RECV_ATS,
568 568
569 /** 569 /**
570 * CONNECT request from other peer was CONNECT_ACK'ed, waiting for 570 * SYN request from other peer was SYN_ACK'ed, waiting for ACK.
571 * SESSION_ACK.
572 */ 571 */
573 GNUNET_TRANSPORT_PS_CONNECT_RECV_ACK, 572 GNUNET_TRANSPORT_PS_SYN_RECV_ACK,
574 573
575 /** 574 /**
576 * Got our CONNECT_ACK/SESSION_ACK, connection is up. 575 * Got our SYN_ACK/ACK, connection is up.
577 */ 576 */
578 GNUNET_TRANSPORT_PS_CONNECTED, 577 GNUNET_TRANSPORT_PS_CONNECTED,
579 578
@@ -584,7 +583,7 @@ enum GNUNET_TRANSPORT_PeerState
584 GNUNET_TRANSPORT_PS_RECONNECT_ATS, 583 GNUNET_TRANSPORT_PS_RECONNECT_ATS,
585 584
586 /** 585 /**
587 * Sent CONNECT over new address (either by ATS telling us to switch 586 * Sent SYN over new address (either by ATS telling us to switch
588 * addresses or from RECONNECT_ATS); if this fails, we need to tell 587 * addresses or from RECONNECT_ATS); if this fails, we need to tell
589 * the rest of the system about a disconnect. 588 * the rest of the system about a disconnect.
590 */ 589 */
@@ -592,11 +591,11 @@ enum GNUNET_TRANSPORT_PeerState
592 591
593 /** 592 /**
594 * We have some primary connection, but ATS suggested we switch 593 * We have some primary connection, but ATS suggested we switch
595 * to some alternative; we now sent a CONNECT message for the 594 * to some alternative; we now sent a SYN message for the
596 * alternative session to the other peer and waiting for a 595 * alternative session to the other peer and waiting for a
597 * CONNECT_ACK to make this our primary connection. 596 * SYN_ACK to make this our primary connection.
598 */ 597 */
599 GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_CONNECT_SENT, 598 GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT,
600 599
601 /** 600 /**
602 * Disconnect in progress (we're sending the DISCONNECT message to the 601 * Disconnect in progress (we're sending the DISCONNECT message to the