diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_transport_service.h | 40 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 4 |
2 files changed, 18 insertions, 26 deletions
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index 0c719d955..69dcefb21 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h | |||
@@ -47,46 +47,38 @@ extern "C" | |||
47 | /** | 47 | /** |
48 | * Possible state of a neighbour. Initially, we are #GNUNET_TRANSPORT_PS_NOT_CONNECTED. | 48 | * Possible state of a neighbour. Initially, we are #GNUNET_TRANSPORT_PS_NOT_CONNECTED. |
49 | * | 49 | * |
50 | * Then, there are two main paths. If we receive a CONNECT message, we | 50 | * Then, there are two main paths. If we receive a CONNECT message, we give |
51 | * first run a check against the blacklist if we are allowed to communicate with | 51 | * the inbound address to ATS. After the check we ask ATS for a suggestion |
52 | * this peer (#GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND). | 52 | * (#GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS). If ATS makes a suggestion, we |
53 | * If this check is successful, we give the inbound address to ATS. | 53 | * send our CONNECT_ACK and go to #GNUNET_TRANSPORT_PS_CONNECT_RECV_ACK. |
54 | * After the check we ask ATS for a suggestion (#GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS). | 54 | * If we receive a SESSION_ACK, we go to #GNUNET_TRANSPORT_PS_CONNECTED |
55 | * If ATS makes a suggestion, we ALSO give that suggestion to the blacklist | 55 | * (and notify everyone about the new connection). If the operation times out, |
56 | * (#GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST). Once the blacklist approves the | 56 | * we go to #GNUNET_TRANSPORT_PS_DISCONNECT. |
57 | * address we got from ATS, we send our CONNECT_ACK and go to | ||
58 | * #GNUNET_TRANSPORT_PS_CONNECT_RECV_ACK. If we receive a SESSION_ACK, we go to | ||
59 | * #GNUNET_TRANSPORT_PS_CONNECTED (and notify everyone about the new connection). | ||
60 | * If the operation times out, we go to #GNUNET_TRANSPORT_PS_DISCONNECT. | ||
61 | * | 57 | * |
62 | * The other case is where we transmit a CONNECT message first. We | 58 | * The other case is where we transmit a CONNECT message first. We |
63 | * start with #GNUNET_TRANSPORT_PS_INIT_ATS. If we get an address, we enter | 59 | * start with #GNUNET_TRANSPORT_PS_INIT_ATS. If we get an address, we send |
64 | * #GNUNET_TRANSPORT_PS_INIT_BLACKLIST and check the blacklist. If the blacklist is OK | 60 | * the CONNECT message and go to state #GNUNET_TRANSPORT_PS_CONNECT_SENT. |
65 | * with the connection, we actually send the CONNECT message and go to | 61 | * Once we receive a CONNECT_ACK, we go to #GNUNET_TRANSPORT_PS_CONNECTED |
66 | * state #GNUNET_TRANSPORT_PS_CONNECT_SENT. Once we receive a CONNECT_ACK, we go to | 62 | * (and notify everyone about the new connection and send |
67 | * #GNUNET_TRANSPORT_PS_CONNECTED (and notify everyone about the new connection and send | ||
68 | * back a SESSION_ACK). If the operation times out, we go to | 63 | * back a SESSION_ACK). If the operation times out, we go to |
69 | * #GNUNET_TRANSPORT_PS_DISCONNECT. | 64 | * #GNUNET_TRANSPORT_PS_DISCONNECT. |
70 | * | 65 | * |
71 | * If the session is in trouble (i.e. transport-level disconnect or | 66 | * If the session is in trouble (i.e. transport-level disconnect or |
72 | * timeout), we go to #GNUNET_TRANSPORT_PS_RECONNECT_ATS where we ask ATS for a new | 67 | * timeout), we go to #GNUNET_TRANSPORT_PS_RECONNECT_ATS where we ask ATS for a new |
73 | * address (we don't notify anyone about the disconnect yet). Once we | 68 | * address (we don't notify anyone about the disconnect yet). Once we |
74 | * have a new address, we go to #GNUNET_TRANSPORT_PS_RECONNECT_BLACKLIST to check the new | 69 | * have a new address, we enter #GNUNET_TRANSPORT_PS_RECONNECT_SENT and send a |
75 | * address against the blacklist. If the blacklist approves, we enter | 70 | * CONNECT message. If we receive a |
76 | * #GNUNET_TRANSPORT_PS_RECONNECT_SENT and send a CONNECT message. If we receive a | ||
77 | * CONNECT_ACK, we go to #GNUNET_TRANSPORT_PS_CONNECTED and nobody noticed that we had | 71 | * CONNECT_ACK, we go to #GNUNET_TRANSPORT_PS_CONNECTED and nobody noticed that we had |
78 | * trouble; we also send a SESSION_ACK at this time just in case. If | 72 | * trouble; we also send a SESSION_ACK at this time just in case. If |
79 | * the operation times out, we go to #GNUNET_TRANSPORT_PS_DISCONNECT (and notify everyone | 73 | * the operation times out, we go to #GNUNET_TRANSPORT_PS_DISCONNECT (and notify everyone |
80 | * about the lost connection). | 74 | * about the lost connection). |
81 | * | 75 | * |
82 | * If ATS decides to switch addresses while we have a normal | 76 | * If ATS decides to switch addresses while we have a normal |
83 | * connection, we go to #GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_BLACKLIST to check the | 77 | * connection, we go to #GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_CONNECT_SENT |
84 | * new address against the blacklist. If the blacklist approves, we | 78 | * and send a SESSION_CONNECT. If we get a SESSION_ACK back, we switch the |
85 | * go to #GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_CONNECT_SENT and send a | ||
86 | * SESSION_CONNECT. If we get a SESSION_ACK back, we switch the | ||
87 | * primary connection to the suggested alternative from ATS, go back | 79 | * primary connection to the suggested alternative from ATS, go back |
88 | * to #GNUNET_TRANSPORT_PS_CONNECTED and send a SESSION_ACK to the other peer just to be | 80 | * to #GNUNET_TRANSPORT_PS_CONNECTED and send a SESSION_ACK to the other peer just to be |
89 | * sure. If the operation times out (or the blacklist disapproves), | 81 | * sure. If the operation times out |
90 | * we go to #GNUNET_TRANSPORT_PS_CONNECTED (and notify ATS that the given alternative | 82 | * we go to #GNUNET_TRANSPORT_PS_CONNECTED (and notify ATS that the given alternative |
91 | * address is "invalid"). | 83 | * address is "invalid"). |
92 | * | 84 | * |
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 58ce9572d..030a4aae2 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -413,7 +413,7 @@ struct NeighbourMapEntry | |||
413 | * Flag to set if we still need to send a CONNECT_ACK message to the other peer | 413 | * Flag to set if we still need to send a CONNECT_ACK message to the other peer |
414 | * (once we have an address to use and the peer has been allowed by our | 414 | * (once we have an address to use and the peer has been allowed by our |
415 | * blacklist). Initially set to #ACK_UNDEFINED. Set to #ACK_SEND_CONNECT_ACK | 415 | * blacklist). Initially set to #ACK_UNDEFINED. Set to #ACK_SEND_CONNECT_ACK |
416 | * if we need to send a CONNECT_ACK. Set to #SESSION_ACK if we did | 416 | * if we need to send a CONNECT_ACK. Set to #ACK_SEND_SESSION_ACK if we did |
417 | * send a CONNECT_ACK and should go to 'S_CONNECTED' upon receiving a | 417 | * send a CONNECT_ACK and should go to 'S_CONNECTED' upon receiving a |
418 | * 'SESSION_ACK' (regardless of what our own state machine might say). | 418 | * 'SESSION_ACK' (regardless of what our own state machine might say). |
419 | */ | 419 | */ |
@@ -447,7 +447,7 @@ struct NeighbourMapEntry | |||
447 | 447 | ||
448 | 448 | ||
449 | /** | 449 | /** |
450 | * Context for blacklist checks and the #handle_test_blacklist_cont() | 450 | * Context for blacklist checks and the #try_connect_bl_check_cont() |
451 | * function. Stores information about ongoing blacklist checks. | 451 | * function. Stores information about ongoing blacklist checks. |
452 | */ | 452 | */ |
453 | struct BlackListCheckContext | 453 | struct BlackListCheckContext |