aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-01-09 13:31:21 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-01-09 13:31:21 +0000
commit2ed861d67db2ffdf22bda9b873c64e5f8782cf8e (patch)
tree59e59ea647a971d2e553ac06ea5a275985c78568 /src/transport
parent957037e37439b9378b1242270530db95b06a458c (diff)
downloadgnunet-2ed861d67db2ffdf22bda9b873c64e5f8782cf8e.tar.gz
gnunet-2ed861d67db2ffdf22bda9b873c64e5f8782cf8e.zip
renaming states according to naming convenations
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c511
-rw-r--r--src/transport/transport_api_monitoring.c76
2 files changed, 287 insertions, 300 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 5b1c2e9ee..54a35caa6 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -576,13 +576,18 @@ free_address (struct NeighbourAddress *na)
576 na->session = NULL; 576 na->session = NULL;
577} 577}
578 578
579/* Change the status of the neighbour */
580 579
580/**
581 * Set net state for this neighbour and notify monitoring
582 *
583 * @param n the respective neighbour
584 * @param s the new state
585 */
581static void 586static void
582set_state (struct NeighbourMapEntry *n, enum GNUNET_TRANSPORT_PeerState s) 587set_state (struct NeighbourMapEntry *n, enum GNUNET_TRANSPORT_PeerState s)
583{ 588{
584 n->state = s; 589 n->state = s;
585 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Neighbour `%s' changed state to %s\n", 590 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Neighbour `%s' changed state to %s\n",
586 GNUNET_i2s (&n->id), 591 GNUNET_i2s (&n->id),
587 GNUNET_TRANSPORT_p2s(s)); 592 GNUNET_TRANSPORT_p2s(s));
588 neighbour_change_cb (callback_cls, 593 neighbour_change_cb (callback_cls,
@@ -594,6 +599,13 @@ set_state (struct NeighbourMapEntry *n, enum GNUNET_TRANSPORT_PeerState s)
594 599
595} 600}
596 601
602/**
603 * Set net state and state timeout for this neighbour and notify monitoring
604 *
605 * @param n the respective neighbour
606 * @param s the new state
607 * @param timeout the new timeout
608 */
597static void 609static void
598set_state_and_timeout (struct NeighbourMapEntry *n, 610set_state_and_timeout (struct NeighbourMapEntry *n,
599 enum GNUNET_TRANSPORT_PeerState s, 611 enum GNUNET_TRANSPORT_PeerState s,
@@ -601,7 +613,7 @@ set_state_and_timeout (struct NeighbourMapEntry *n,
601{ 613{
602 n->state = s; 614 n->state = s;
603 n->timeout = timeout; 615 n->timeout = timeout;
604 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Neighbour `%s' changed state to %s with timeout %s\n", 616 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Neighbour `%s' changed state to %s with timeout %s\n",
605 GNUNET_i2s (&n->id), 617 GNUNET_i2s (&n->id),
606 GNUNET_TRANSPORT_p2s(s), 618 GNUNET_TRANSPORT_p2s(s),
607 GNUNET_STRINGS_absolute_time_to_string (timeout)); 619 GNUNET_STRINGS_absolute_time_to_string (timeout));
@@ -613,12 +625,19 @@ set_state_and_timeout (struct NeighbourMapEntry *n,
613 n->primary_address.bandwidth_out); 625 n->primary_address.bandwidth_out);
614} 626}
615 627
628
629/**
630 * Set new state timeout for this neighbour and notify monitoring
631 *
632 * @param n the respective neighbour
633 * @param timeout the new timeout
634 */
616static void 635static void
617set_timeout (struct NeighbourMapEntry *n, 636set_timeout (struct NeighbourMapEntry *n,
618 struct GNUNET_TIME_Absolute timeout) 637 struct GNUNET_TIME_Absolute timeout)
619{ 638{
620 n->timeout = timeout; 639 n->timeout = timeout;
621 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Neighbour `%s' changed timeout %s\n", 640 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Neighbour `%s' changed timeout %s\n",
622 GNUNET_i2s (&n->id), 641 GNUNET_i2s (&n->id),
623 GNUNET_STRINGS_absolute_time_to_string (timeout)); 642 GNUNET_STRINGS_absolute_time_to_string (timeout));
624 neighbour_change_cb (callback_cls, 643 neighbour_change_cb (callback_cls,
@@ -647,8 +666,7 @@ set_alternative_address (struct NeighbourMapEntry *n,
647 const struct GNUNET_HELLO_Address *address, 666 const struct GNUNET_HELLO_Address *address,
648 struct Session *session, 667 struct Session *session,
649 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 668 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
650 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, 669 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
651 int is_active)
652{ 670{
653 struct GNUNET_TRANSPORT_PluginFunctions *papi; 671 struct GNUNET_TRANSPORT_PluginFunctions *papi;
654 if (NULL == (papi = GST_plugins_find (address->transport_name))) 672 if (NULL == (papi = GST_plugins_find (address->transport_name)))
@@ -660,19 +678,6 @@ set_alternative_address (struct NeighbourMapEntry *n,
660 { 678 {
661 n->alternative_address.bandwidth_in = bandwidth_in; 679 n->alternative_address.bandwidth_in = bandwidth_in;
662 n->alternative_address.bandwidth_out = bandwidth_out; 680 n->alternative_address.bandwidth_out = bandwidth_out;
663 if (is_active != n->alternative_address.ats_active)
664 {
665 n->alternative_address.ats_active = is_active;
666 GNUNET_ATS_address_in_use (GST_ats, n->alternative_address.address,
667 n->alternative_address.session, is_active);
668 GST_validation_set_address_use (n->alternative_address.address,
669 n->alternative_address.session, is_active);
670 }
671 if (GNUNET_YES == is_active)
672 {
673 GST_neighbours_set_incoming_quota (&address->peer, bandwidth_in);
674 send_outbound_quota (&address->peer, bandwidth_out);
675 }
676 return; 681 return;
677 } 682 }
678 free_address (&n->alternative_address); 683 free_address (&n->alternative_address);
@@ -687,7 +692,7 @@ set_alternative_address (struct NeighbourMapEntry *n,
687 return; 692 return;
688 } 693 }
689 694
690 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Neighbour `%s' switched to address %s\n", 695 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Neighbour `%s' configured alternative address %s\n",
691 GNUNET_i2s (&n->id), 696 GNUNET_i2s (&n->id),
692 GST_plugins_a2s(address)); 697 GST_plugins_a2s(address));
693 698
@@ -695,16 +700,8 @@ set_alternative_address (struct NeighbourMapEntry *n,
695 n->alternative_address.bandwidth_in = bandwidth_in; 700 n->alternative_address.bandwidth_in = bandwidth_in;
696 n->alternative_address.bandwidth_out = bandwidth_out; 701 n->alternative_address.bandwidth_out = bandwidth_out;
697 n->alternative_address.session = session; 702 n->alternative_address.session = session;
698 n->alternative_address.ats_active = is_active; 703 n->alternative_address.ats_active = GNUNET_NO;
699 n->alternative_address.keep_alive_nonce = 0; 704 n->alternative_address.keep_alive_nonce = 0;
700 if (GNUNET_YES == is_active)
701 {
702 /* Telling ATS about new session */
703 GNUNET_ATS_address_in_use (GST_ats, n->alternative_address.address, n->alternative_address.session, GNUNET_YES);
704 GST_validation_set_address_use (n->alternative_address.address, n->alternative_address.session, GNUNET_YES);
705 GST_neighbours_set_incoming_quota (&address->peer, bandwidth_in);
706 send_outbound_quota (&address->peer, bandwidth_out);
707 }
708} 705}
709 706
710 707
@@ -779,7 +776,7 @@ set_primary_address (struct NeighbourMapEntry *n,
779 send_outbound_quota (&address->peer, bandwidth_out); 776 send_outbound_quota (&address->peer, bandwidth_out);
780 } 777 }
781 778
782 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Neighbour `%s' switched to address %s\n", 779 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Neighbour `%s' switched to address %s\n",
783 GNUNET_i2s (&n->id), 780 GNUNET_i2s (&n->id),
784 GST_plugins_a2s(address)); 781 GST_plugins_a2s(address));
785 782
@@ -791,6 +788,18 @@ set_primary_address (struct NeighbourMapEntry *n,
791 n->primary_address.bandwidth_out); 788 n->primary_address.bandwidth_out);
792} 789}
793 790
791/**
792 * Clear the primary address of a neighbour since this primary address is not
793 * valid anymore and notify monitoring about it
794 *
795 * @param n the neighbour
796 */
797static void
798unset_primary_address (struct NeighbourMapEntry *n)
799{
800
801}
802
794 803
795/** 804/**
796 * Free a neighbour map entry. 805 * Free a neighbour map entry.
@@ -830,7 +839,7 @@ free_neighbour (struct NeighbourMapEntry *n,
830 GNUNET_NO); 839 GNUNET_NO);
831 disconnect_notify_cb (callback_cls, &n->id); 840 disconnect_notify_cb (callback_cls, &n->id);
832 } 841 }
833 set_state (n, S_DISCONNECT_FINISHED); 842 set_state (n, GNUNET_TRANSPORT_DISCONNECT_FINISHED);
834 843
835 if (NULL != n->primary_address.address) 844 if (NULL != n->primary_address.address)
836 { 845 {
@@ -959,7 +968,7 @@ send_disconnect_cont (void *cls, const struct GNUNET_PeerIdentity *target,
959 n = lookup_neighbour (target); 968 n = lookup_neighbour (target);
960 if (NULL == n) 969 if (NULL == n)
961 return; /* already gone */ 970 return; /* already gone */
962 if (S_DISCONNECT != n->state) 971 if (GNUNET_TRANSPORT_DISCONNECT != n->state)
963 return; /* have created a fresh entry since */ 972 return; /* have created a fresh entry since */
964 if (GNUNET_SCHEDULER_NO_TASK != n->task) 973 if (GNUNET_SCHEDULER_NO_TASK != n->task)
965 GNUNET_SCHEDULER_cancel (n->task); 974 GNUNET_SCHEDULER_cancel (n->task);
@@ -1025,34 +1034,34 @@ disconnect_neighbour (struct NeighbourMapEntry *n)
1025 about disconnect */ 1034 about disconnect */
1026 switch (n->state) 1035 switch (n->state)
1027 { 1036 {
1028 case S_NOT_CONNECTED: 1037 case GNUNET_TRANSPORT_NOT_CONNECTED:
1029 case S_INIT_ATS: 1038 case GNUNET_TRANSPORT_INIT_ATS:
1030 case S_INIT_BLACKLIST: 1039 case GNUNET_TRANSPORT_INIT_BLACKLIST:
1031 /* other peer is completely unaware of us, no need to send DISCONNECT */ 1040 /* other peer is completely unaware of us, no need to send DISCONNECT */
1032 set_state (n, S_DISCONNECT_FINISHED); 1041 set_state (n, GNUNET_TRANSPORT_DISCONNECT_FINISHED);
1033 free_neighbour (n, GNUNET_NO); 1042 free_neighbour (n, GNUNET_NO);
1034 return; 1043 return;
1035 case S_CONNECT_SENT: 1044 case GNUNET_TRANSPORT_CONNECT_SENT:
1036 send_disconnect (n); 1045 send_disconnect (n);
1037 set_state (n, S_DISCONNECT); 1046 set_state (n, GNUNET_TRANSPORT_DISCONNECT);
1038 break; 1047 break;
1039 case S_CONNECT_RECV_BLACKLIST_INBOUND: 1048 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST_INBOUND:
1040 case S_CONNECT_RECV_ATS: 1049 case GNUNET_TRANSPORT_CONNECT_RECV_ATS:
1041 case S_CONNECT_RECV_BLACKLIST: 1050 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST:
1042 /* we never ACK'ed the other peer's request, no need to send DISCONNECT */ 1051 /* we never ACK'ed the other peer's request, no need to send DISCONNECT */
1043 set_state (n, S_DISCONNECT_FINISHED); 1052 set_state (n, GNUNET_TRANSPORT_DISCONNECT_FINISHED);
1044 free_neighbour (n, GNUNET_NO); 1053 free_neighbour (n, GNUNET_NO);
1045 return; 1054 return;
1046 case S_CONNECT_RECV_ACK: 1055 case GNUNET_TRANSPORT_CONNECT_RECV_ACK:
1047 /* we DID ACK the other peer's request, must send DISCONNECT */ 1056 /* we DID ACK the other peer's request, must send DISCONNECT */
1048 send_disconnect (n); 1057 send_disconnect (n);
1049 set_state (n, S_DISCONNECT); 1058 set_state (n, GNUNET_TRANSPORT_DISCONNECT);
1050 break; 1059 break;
1051 case S_CONNECTED: 1060 case GNUNET_TRANSPORT_CONNECTED:
1052 case S_RECONNECT_BLACKLIST: 1061 case GNUNET_TRANSPORT_RECONNECT_BLACKLIST:
1053 case S_RECONNECT_SENT: 1062 case GNUNET_TRANSPORT_RECONNECT_SENT:
1054 case S_CONNECTED_SWITCHING_BLACKLIST: 1063 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_BLACKLIST:
1055 case S_CONNECTED_SWITCHING_CONNECT_SENT: 1064 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_CONNECT_SENT:
1056 /* we are currently connected, need to send disconnect and do 1065 /* we are currently connected, need to send disconnect and do
1057 internal notifications and update statistics */ 1066 internal notifications and update statistics */
1058 send_disconnect (n); 1067 send_disconnect (n);
@@ -1061,21 +1070,21 @@ disconnect_neighbour (struct NeighbourMapEntry *n)
1061 --neighbours_connected, 1070 --neighbours_connected,
1062 GNUNET_NO); 1071 GNUNET_NO);
1063 disconnect_notify_cb (callback_cls, &n->id); 1072 disconnect_notify_cb (callback_cls, &n->id);
1064 set_state (n, S_DISCONNECT); 1073 set_state (n, GNUNET_TRANSPORT_DISCONNECT);
1065 break; 1074 break;
1066 case S_RECONNECT_ATS: 1075 case GNUNET_TRANSPORT_RECONNECT_ATS:
1067 /* ATS address request timeout, disconnect without sending disconnect message */ 1076 /* ATS address request timeout, disconnect without sending disconnect message */
1068 GNUNET_STATISTICS_set (GST_stats, 1077 GNUNET_STATISTICS_set (GST_stats,
1069 gettext_noop ("# peers connected"), 1078 gettext_noop ("# peers connected"),
1070 --neighbours_connected, 1079 --neighbours_connected,
1071 GNUNET_NO); 1080 GNUNET_NO);
1072 disconnect_notify_cb (callback_cls, &n->id); 1081 disconnect_notify_cb (callback_cls, &n->id);
1073 set_state (n, S_DISCONNECT); 1082 set_state (n, GNUNET_TRANSPORT_DISCONNECT);
1074 break; 1083 break;
1075 case S_DISCONNECT: 1084 case GNUNET_TRANSPORT_DISCONNECT:
1076 /* already disconnected, ignore */ 1085 /* already disconnected, ignore */
1077 break; 1086 break;
1078 case S_DISCONNECT_FINISHED: 1087 case GNUNET_TRANSPORT_DISCONNECT_FINISHED:
1079 /* already cleaned up, how did we get here!? */ 1088 /* already cleaned up, how did we get here!? */
1080 GNUNET_assert (0); 1089 GNUNET_assert (0);
1081 break; 1090 break;
@@ -1241,9 +1250,9 @@ send_keepalive (struct NeighbourMapEntry *n)
1241 struct GNUNET_TIME_Relative timeout; 1250 struct GNUNET_TIME_Relative timeout;
1242 uint32_t nonce; 1251 uint32_t nonce;
1243 1252
1244 GNUNET_assert ((S_CONNECTED == n->state) || 1253 GNUNET_assert ((GNUNET_TRANSPORT_CONNECTED == n->state) ||
1245 (S_CONNECTED_SWITCHING_BLACKLIST == n->state) || 1254 (GNUNET_TRANSPORT_CONNECTED_SWITCHING_BLACKLIST == n->state) ||
1246 (S_CONNECTED_SWITCHING_CONNECT_SENT)); 1255 (GNUNET_TRANSPORT_CONNECTED_SWITCHING_CONNECT_SENT));
1247 if (GNUNET_TIME_absolute_get_remaining (n->keep_alive_time).rel_value_us > 0) 1256 if (GNUNET_TIME_absolute_get_remaining (n->keep_alive_time).rel_value_us > 0)
1248 return; /* no keepalive needed at this time */ 1257 return; /* no keepalive needed at this time */
1249 1258
@@ -1356,7 +1365,7 @@ GST_neighbours_keepalive_response (const struct GNUNET_PeerIdentity *neighbour,
1356 1, GNUNET_NO); 1365 1, GNUNET_NO);
1357 return; 1366 return;
1358 } 1367 }
1359 if ( (S_CONNECTED != n->state) || 1368 if ( (GNUNET_TRANSPORT_CONNECTED != n->state) ||
1360 (GNUNET_YES != n->expect_latency_response) ) 1369 (GNUNET_YES != n->expect_latency_response) )
1361 { 1370 {
1362 GNUNET_STATISTICS_update (GST_stats, 1371 GNUNET_STATISTICS_update (GST_stats,
@@ -1698,7 +1707,7 @@ setup_neighbour (const struct GNUNET_PeerIdentity *peer)
1698 GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT, 1707 GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT,
1699 MAX_BANDWIDTH_CARRY_S); 1708 MAX_BANDWIDTH_CARRY_S);
1700 n->task = GNUNET_SCHEDULER_add_now (&master_task, n); 1709 n->task = GNUNET_SCHEDULER_add_now (&master_task, n);
1701 set_state_and_timeout (n, S_NOT_CONNECTED, GNUNET_TIME_UNIT_FOREVER_ABS); 1710 set_state_and_timeout (n, GNUNET_TRANSPORT_NOT_CONNECTED, GNUNET_TIME_UNIT_FOREVER_ABS);
1702 GNUNET_assert (GNUNET_OK == 1711 GNUNET_assert (GNUNET_OK ==
1703 GNUNET_CONTAINER_multipeermap_put (neighbours, 1712 GNUNET_CONTAINER_multipeermap_put (neighbours,
1704 &n->id, n, 1713 &n->id, n,
@@ -1759,37 +1768,37 @@ GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target)
1759 { 1768 {
1760 switch (n->state) 1769 switch (n->state)
1761 { 1770 {
1762 case S_NOT_CONNECTED: 1771 case GNUNET_TRANSPORT_NOT_CONNECTED:
1763 /* this should not be possible */ 1772 /* this should not be possible */
1764 GNUNET_break (0); 1773 GNUNET_break (0);
1765 free_neighbour (n, GNUNET_NO); 1774 free_neighbour (n, GNUNET_NO);
1766 break; 1775 break;
1767 case S_INIT_ATS: 1776 case GNUNET_TRANSPORT_INIT_ATS:
1768 case S_INIT_BLACKLIST: 1777 case GNUNET_TRANSPORT_INIT_BLACKLIST:
1769 case S_CONNECT_SENT: 1778 case GNUNET_TRANSPORT_CONNECT_SENT:
1770 case S_CONNECT_RECV_BLACKLIST_INBOUND: 1779 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST_INBOUND:
1771 case S_CONNECT_RECV_ATS: 1780 case GNUNET_TRANSPORT_CONNECT_RECV_ATS:
1772 case S_CONNECT_RECV_BLACKLIST: 1781 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST:
1773 case S_CONNECT_RECV_ACK: 1782 case GNUNET_TRANSPORT_CONNECT_RECV_ACK:
1774 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 1783 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1775 "Ignoring request to try to connect to `%s', already trying!\n", 1784 "Ignoring request to try to connect to `%s', already trying!\n",
1776 GNUNET_i2s (target)); 1785 GNUNET_i2s (target));
1777 return; /* already trying */ 1786 return; /* already trying */
1778 case S_CONNECTED: 1787 case GNUNET_TRANSPORT_CONNECTED:
1779 case S_RECONNECT_ATS: 1788 case GNUNET_TRANSPORT_RECONNECT_ATS:
1780 case S_RECONNECT_BLACKLIST: 1789 case GNUNET_TRANSPORT_RECONNECT_BLACKLIST:
1781 case S_RECONNECT_SENT: 1790 case GNUNET_TRANSPORT_RECONNECT_SENT:
1782 case S_CONNECTED_SWITCHING_BLACKLIST: 1791 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_BLACKLIST:
1783 case S_CONNECTED_SWITCHING_CONNECT_SENT: 1792 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_CONNECT_SENT:
1784 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 1793 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1785 "Ignoring request to try to connect, already connected to `%s'!\n", 1794 "Ignoring request to try to connect, already connected to `%s'!\n",
1786 GNUNET_i2s (target)); 1795 GNUNET_i2s (target));
1787 return; /* already connected */ 1796 return; /* already connected */
1788 case S_DISCONNECT: 1797 case GNUNET_TRANSPORT_DISCONNECT:
1789 /* get rid of remains, ready to re-try immediately */ 1798 /* get rid of remains, ready to re-try immediately */
1790 free_neighbour (n, GNUNET_NO); 1799 free_neighbour (n, GNUNET_NO);
1791 break; 1800 break;
1792 case S_DISCONNECT_FINISHED: 1801 case GNUNET_TRANSPORT_DISCONNECT_FINISHED:
1793 /* should not be possible */ 1802 /* should not be possible */
1794 GNUNET_assert (0); 1803 GNUNET_assert (0);
1795 default: 1804 default:
@@ -1802,7 +1811,7 @@ GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target)
1802 } 1811 }
1803 } 1812 }
1804 n = setup_neighbour (target); 1813 n = setup_neighbour (target);
1805 set_state_and_timeout (n, S_INIT_ATS, GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT)); 1814 set_state_and_timeout (n, GNUNET_TRANSPORT_INIT_ATS, GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT));
1806 1815
1807 GNUNET_ATS_reset_backoff (GST_ats, target); 1816 GNUNET_ATS_reset_backoff (GST_ats, target);
1808 n->suggest_handle = GNUNET_ATS_suggest_address (GST_ats, target); 1817 n->suggest_handle = GNUNET_ATS_suggest_address (GST_ats, target);
@@ -1859,16 +1868,16 @@ handle_test_blacklist_cont (void *cls,
1859 n->send_connect_ack); 1868 n->send_connect_ack);
1860 switch (n->state) 1869 switch (n->state)
1861 { 1870 {
1862 case S_NOT_CONNECTED: 1871 case GNUNET_TRANSPORT_NOT_CONNECTED:
1863 /* this should not be possible */ 1872 /* this should not be possible */
1864 GNUNET_break (0); 1873 GNUNET_break (0);
1865 free_neighbour (n, GNUNET_NO); 1874 free_neighbour (n, GNUNET_NO);
1866 break; 1875 break;
1867 case S_INIT_ATS: 1876 case GNUNET_TRANSPORT_INIT_ATS:
1868 /* waiting on ATS suggestion; still, pass address to ATS as a 1877 /* waiting on ATS suggestion; still, pass address to ATS as a
1869 possibility */ 1878 possibility */
1870 break; 1879 break;
1871 case S_INIT_BLACKLIST: 1880 case GNUNET_TRANSPORT_INIT_BLACKLIST:
1872 /* check if the address the blacklist was fine with matches 1881 /* check if the address the blacklist was fine with matches
1873 ATS suggestion, if so, we can move on! */ 1882 ATS suggestion, if so, we can move on! */
1874 if ( (GNUNET_OK == result) && 1883 if ( (GNUNET_OK == result) &&
@@ -1888,16 +1897,16 @@ handle_test_blacklist_cont (void *cls,
1888 } 1897 }
1889 if (GNUNET_OK == result) 1898 if (GNUNET_OK == result)
1890 { 1899 {
1891 set_state_and_timeout (n, S_CONNECT_SENT, GNUNET_TIME_relative_to_absolute (SETUP_CONNECTION_TIMEOUT)); 1900 set_state_and_timeout (n, GNUNET_TRANSPORT_CONNECT_SENT, GNUNET_TIME_relative_to_absolute (SETUP_CONNECTION_TIMEOUT));
1892 send_session_connect (&n->primary_address); 1901 send_session_connect (&n->primary_address);
1893 } 1902 }
1894 else 1903 else
1895 { 1904 {
1896 free_address (&n->primary_address); 1905 free_address (&n->primary_address);
1897 set_state_and_timeout (n, S_INIT_ATS, GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT)); 1906 set_state_and_timeout (n, GNUNET_TRANSPORT_INIT_ATS, GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT));
1898 } 1907 }
1899 break; 1908 break;
1900 case S_CONNECT_SENT: 1909 case GNUNET_TRANSPORT_CONNECT_SENT:
1901 /* waiting on CONNECT_ACK, send ACK if one is pending */ 1910 /* waiting on CONNECT_ACK, send ACK if one is pending */
1902 if ( (GNUNET_OK == result) && 1911 if ( (GNUNET_OK == result) &&
1903 (1 == n->send_connect_ack) ) 1912 (1 == n->send_connect_ack) )
@@ -1908,18 +1917,18 @@ handle_test_blacklist_cont (void *cls,
1908 n->connect_ack_timestamp); 1917 n->connect_ack_timestamp);
1909 } 1918 }
1910 break; 1919 break;
1911 case S_CONNECT_RECV_BLACKLIST_INBOUND: 1920 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST_INBOUND:
1912 set_state_and_timeout (n, S_CONNECT_RECV_ATS, GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT)); 1921 set_state_and_timeout (n, GNUNET_TRANSPORT_CONNECT_RECV_ATS, GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT));
1913 GNUNET_ATS_reset_backoff (GST_ats, peer); 1922 GNUNET_ATS_reset_backoff (GST_ats, peer);
1914 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1923 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1915 "Suggesting address for peer %s to ATS\n", 1924 "Suggesting address for peer %s to ATS\n",
1916 GNUNET_i2s (peer)); 1925 GNUNET_i2s (peer));
1917 n->suggest_handle = GNUNET_ATS_suggest_address (GST_ats, peer); 1926 n->suggest_handle = GNUNET_ATS_suggest_address (GST_ats, peer);
1918 break; 1927 break;
1919 case S_CONNECT_RECV_ATS: 1928 case GNUNET_TRANSPORT_CONNECT_RECV_ATS:
1920 /* waiting on ATS suggestion, don't care about blacklist */ 1929 /* waiting on ATS suggestion, don't care about blacklist */
1921 break; 1930 break;
1922 case S_CONNECT_RECV_BLACKLIST: 1931 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST:
1923 if (GNUNET_YES != address_matches (&bcc->na, &n->primary_address)) 1932 if (GNUNET_YES != address_matches (&bcc->na, &n->primary_address))
1924 { 1933 {
1925 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1934 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1928,7 +1937,7 @@ handle_test_blacklist_cont (void *cls,
1928 } 1937 }
1929 if (GNUNET_OK == result) 1938 if (GNUNET_OK == result)
1930 { 1939 {
1931 set_state_and_timeout (n, S_CONNECT_RECV_ACK, GNUNET_TIME_relative_to_absolute (SETUP_CONNECTION_TIMEOUT)); 1940 set_state_and_timeout (n, GNUNET_TRANSPORT_CONNECT_RECV_ACK, GNUNET_TIME_relative_to_absolute (SETUP_CONNECTION_TIMEOUT));
1932 send_session_connect_ack_message (bcc->na.address, 1941 send_session_connect_ack_message (bcc->na.address,
1933 bcc->na.session, 1942 bcc->na.session,
1934 n->connect_ack_timestamp); 1943 n->connect_ack_timestamp);
@@ -1949,11 +1958,11 @@ handle_test_blacklist_cont (void *cls,
1949 } 1958 }
1950 GNUNET_break (NULL != plugin); 1959 GNUNET_break (NULL != plugin);
1951 free_address (&n->primary_address); 1960 free_address (&n->primary_address);
1952 set_state_and_timeout (n, S_INIT_ATS, GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT)); 1961 set_state_and_timeout (n, GNUNET_TRANSPORT_INIT_ATS, GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT));
1953 GNUNET_ATS_reset_backoff (GST_ats, peer); 1962 GNUNET_ATS_reset_backoff (GST_ats, peer);
1954 } 1963 }
1955 break; 1964 break;
1956 case S_CONNECT_RECV_ACK: 1965 case GNUNET_TRANSPORT_CONNECT_RECV_ACK:
1957 /* waiting on SESSION_ACK, send ACK if one is pending */ 1966 /* waiting on SESSION_ACK, send ACK if one is pending */
1958 if ( (GNUNET_OK == result) && 1967 if ( (GNUNET_OK == result) &&
1959 (1 == n->send_connect_ack) ) 1968 (1 == n->send_connect_ack) )
@@ -1964,13 +1973,13 @@ handle_test_blacklist_cont (void *cls,
1964 n->connect_ack_timestamp); 1973 n->connect_ack_timestamp);
1965 } 1974 }
1966 break; 1975 break;
1967 case S_CONNECTED: 1976 case GNUNET_TRANSPORT_CONNECTED:
1968 /* already connected, don't care about blacklist */ 1977 /* already connected, don't care about blacklist */
1969 break; 1978 break;
1970 case S_RECONNECT_ATS: 1979 case GNUNET_TRANSPORT_RECONNECT_ATS:
1971 /* still waiting on ATS suggestion, don't care about blacklist */ 1980 /* still waiting on ATS suggestion, don't care about blacklist */
1972 break; 1981 break;
1973 case S_RECONNECT_BLACKLIST: 1982 case GNUNET_TRANSPORT_RECONNECT_BLACKLIST:
1974 if ( (GNUNET_OK == result) && 1983 if ( (GNUNET_OK == result) &&
1975 (1 == n->send_connect_ack) ) 1984 (1 == n->send_connect_ack) )
1976 { 1985 {
@@ -1987,15 +1996,15 @@ handle_test_blacklist_cont (void *cls,
1987 } 1996 }
1988 if (GNUNET_OK == result) 1997 if (GNUNET_OK == result)
1989 { 1998 {
1990 set_state_and_timeout (n, S_RECONNECT_SENT, GNUNET_TIME_relative_to_absolute (FAST_RECONNECT_TIMEOUT)); 1999 set_state_and_timeout (n, GNUNET_TRANSPORT_RECONNECT_SENT, GNUNET_TIME_relative_to_absolute (FAST_RECONNECT_TIMEOUT));
1991 send_session_connect (&n->primary_address); 2000 send_session_connect (&n->primary_address);
1992 } 2001 }
1993 else 2002 else
1994 { 2003 {
1995 set_state_and_timeout (n, S_RECONNECT_ATS, GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT)); 2004 set_state_and_timeout (n, GNUNET_TRANSPORT_RECONNECT_ATS, GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT));
1996 } 2005 }
1997 break; 2006 break;
1998 case S_RECONNECT_SENT: 2007 case GNUNET_TRANSPORT_RECONNECT_SENT:
1999 /* waiting on CONNECT_ACK, don't care about blacklist */ 2008 /* waiting on CONNECT_ACK, don't care about blacklist */
2000 if ( (GNUNET_OK == result) && 2009 if ( (GNUNET_OK == result) &&
2001 (1 == n->send_connect_ack) ) 2010 (1 == n->send_connect_ack) )
@@ -2006,7 +2015,7 @@ handle_test_blacklist_cont (void *cls,
2006 n->connect_ack_timestamp); 2015 n->connect_ack_timestamp);
2007 } 2016 }
2008 break; 2017 break;
2009 case S_CONNECTED_SWITCHING_BLACKLIST: 2018 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_BLACKLIST:
2010 if (GNUNET_YES != address_matches (&bcc->na, &n->alternative_address)) 2019 if (GNUNET_YES != address_matches (&bcc->na, &n->alternative_address))
2011 { 2020 {
2012 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2021 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -2016,15 +2025,15 @@ handle_test_blacklist_cont (void *cls,
2016 if (GNUNET_OK == result) 2025 if (GNUNET_OK == result)
2017 { 2026 {
2018 send_session_connect (&n->alternative_address); 2027 send_session_connect (&n->alternative_address);
2019 set_state (n, S_CONNECTED_SWITCHING_CONNECT_SENT); 2028 set_state (n, GNUNET_TRANSPORT_CONNECTED_SWITCHING_CONNECT_SENT);
2020 } 2029 }
2021 else 2030 else
2022 { 2031 {
2023 set_state(n, S_CONNECTED); 2032 set_state(n, GNUNET_TRANSPORT_CONNECTED);
2024 free_address (&n->alternative_address); 2033 free_address (&n->alternative_address);
2025 } 2034 }
2026 break; 2035 break;
2027 case S_CONNECTED_SWITCHING_CONNECT_SENT: 2036 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_CONNECT_SENT:
2028 /* waiting on CONNECT_ACK, don't care about blacklist */ 2037 /* waiting on CONNECT_ACK, don't care about blacklist */
2029 if ( (GNUNET_OK == result) && 2038 if ( (GNUNET_OK == result) &&
2030 (1 == n->send_connect_ack) ) 2039 (1 == n->send_connect_ack) )
@@ -2035,10 +2044,10 @@ handle_test_blacklist_cont (void *cls,
2035 n->connect_ack_timestamp); 2044 n->connect_ack_timestamp);
2036 } 2045 }
2037 break; 2046 break;
2038 case S_DISCONNECT: 2047 case GNUNET_TRANSPORT_DISCONNECT:
2039 /* Nothing to do here, ATS will already do what can be done */ 2048 /* Nothing to do here, ATS will already do what can be done */
2040 break; 2049 break;
2041 case S_DISCONNECT_FINISHED: 2050 case GNUNET_TRANSPORT_DISCONNECT_FINISHED:
2042 /* should not be possible */ 2051 /* should not be possible */
2043 GNUNET_assert (0); 2052 GNUNET_assert (0);
2044 break; 2053 break;
@@ -2150,26 +2159,26 @@ GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message,
2150 n->send_connect_ack); 2159 n->send_connect_ack);
2151 switch (n->state) 2160 switch (n->state)
2152 { 2161 {
2153 case S_NOT_CONNECTED: 2162 case GNUNET_TRANSPORT_NOT_CONNECTED:
2154 /* Do a blacklist check for the new address */ 2163 /* Do a blacklist check for the new address */
2155 set_state (n, S_CONNECT_RECV_BLACKLIST_INBOUND); 2164 set_state (n, GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST_INBOUND);
2156 check_blacklist (peer, ts, address, session); 2165 check_blacklist (peer, ts, address, session);
2157 break; 2166 break;
2158 case S_INIT_ATS: 2167 case GNUNET_TRANSPORT_INIT_ATS:
2159 /* CONNECT message takes priority over us asking ATS for address */ 2168 /* CONNECT message takes priority over us asking ATS for address */
2160 set_state (n, S_CONNECT_RECV_BLACKLIST_INBOUND); 2169 set_state (n, GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST_INBOUND);
2161 /* fallthrough */ 2170 /* fallthrough */
2162 case S_INIT_BLACKLIST: 2171 case GNUNET_TRANSPORT_INIT_BLACKLIST:
2163 case S_CONNECT_SENT: 2172 case GNUNET_TRANSPORT_CONNECT_SENT:
2164 case S_CONNECT_RECV_BLACKLIST_INBOUND: 2173 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST_INBOUND:
2165 case S_CONNECT_RECV_ATS: 2174 case GNUNET_TRANSPORT_CONNECT_RECV_ATS:
2166 case S_CONNECT_RECV_BLACKLIST: 2175 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST:
2167 case S_CONNECT_RECV_ACK: 2176 case GNUNET_TRANSPORT_CONNECT_RECV_ACK:
2168 /* It can never hurt to have an alternative address in the above cases, 2177 /* It can never hurt to have an alternative address in the above cases,
2169 see if it is allowed */ 2178 see if it is allowed */
2170 check_blacklist (peer, ts, address, session); 2179 check_blacklist (peer, ts, address, session);
2171 break; 2180 break;
2172 case S_CONNECTED: 2181 case GNUNET_TRANSPORT_CONNECTED:
2173 /* we are already connected and can thus send the ACK immediately; 2182 /* we are already connected and can thus send the ACK immediately;
2174 still, it can never hurt to have an alternative address, so also 2183 still, it can never hurt to have an alternative address, so also
2175 tell ATS about it */ 2184 tell ATS about it */
@@ -2180,15 +2189,15 @@ GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message,
2180 n->primary_address.session, ts); 2189 n->primary_address.session, ts);
2181 check_blacklist (peer, ts, address, session); 2190 check_blacklist (peer, ts, address, session);
2182 break; 2191 break;
2183 case S_RECONNECT_ATS: 2192 case GNUNET_TRANSPORT_RECONNECT_ATS:
2184 case S_RECONNECT_BLACKLIST: 2193 case GNUNET_TRANSPORT_RECONNECT_BLACKLIST:
2185 case S_RECONNECT_SENT: 2194 case GNUNET_TRANSPORT_RECONNECT_SENT:
2186 /* It can never hurt to have an alternative address in the above cases, 2195 /* It can never hurt to have an alternative address in the above cases,
2187 see if it is allowed */ 2196 see if it is allowed */
2188 check_blacklist (peer, ts, address, session); 2197 check_blacklist (peer, ts, address, session);
2189 break; 2198 break;
2190 case S_CONNECTED_SWITCHING_BLACKLIST: 2199 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_BLACKLIST:
2191 case S_CONNECTED_SWITCHING_CONNECT_SENT: 2200 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_CONNECT_SENT:
2192 /* we are already connected and can thus send the ACK immediately; 2201 /* we are already connected and can thus send the ACK immediately;
2193 still, it can never hurt to have an alternative address, so also 2202 still, it can never hurt to have an alternative address, so also
2194 tell ATS about it */ 2203 tell ATS about it */
@@ -2199,15 +2208,15 @@ GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message,
2199 n->primary_address.session, ts); 2208 n->primary_address.session, ts);
2200 check_blacklist (peer, ts, address, session); 2209 check_blacklist (peer, ts, address, session);
2201 break; 2210 break;
2202 case S_DISCONNECT: 2211 case GNUNET_TRANSPORT_DISCONNECT:
2203 /* get rid of remains without terminating sessions, ready to re-try */ 2212 /* get rid of remains without terminating sessions, ready to re-try */
2204 free_neighbour (n, GNUNET_YES); 2213 free_neighbour (n, GNUNET_YES);
2205 n = setup_neighbour (peer); 2214 n = setup_neighbour (peer);
2206 set_state (n, S_CONNECT_RECV_ATS); 2215 set_state (n, GNUNET_TRANSPORT_CONNECT_RECV_ATS);
2207 GNUNET_ATS_reset_backoff (GST_ats, peer); 2216 GNUNET_ATS_reset_backoff (GST_ats, peer);
2208 n->suggest_handle = GNUNET_ATS_suggest_address (GST_ats, peer); 2217 n->suggest_handle = GNUNET_ATS_suggest_address (GST_ats, peer);
2209 break; 2218 break;
2210 case S_DISCONNECT_FINISHED: 2219 case GNUNET_TRANSPORT_DISCONNECT_FINISHED:
2211 /* should not be possible */ 2220 /* should not be possible */
2212 GNUNET_assert (0); 2221 GNUNET_assert (0);
2213 break; 2222 break;
@@ -2309,18 +2318,18 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
2309 } 2318 }
2310 switch (n->state) 2319 switch (n->state)
2311 { 2320 {
2312 case S_NOT_CONNECTED: 2321 case GNUNET_TRANSPORT_NOT_CONNECTED:
2313 GNUNET_break (0); 2322 GNUNET_break (0);
2314 free_neighbour (n, GNUNET_NO); 2323 free_neighbour (n, GNUNET_NO);
2315 return; 2324 return;
2316 case S_INIT_ATS: 2325 case GNUNET_TRANSPORT_INIT_ATS:
2317 set_primary_address (n, address, session, bandwidth_in, bandwidth_out, GNUNET_NO); 2326 set_primary_address (n, address, session, bandwidth_in, bandwidth_out, GNUNET_NO);
2318 set_state_and_timeout (n, S_INIT_BLACKLIST, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT)); 2327 set_state_and_timeout (n, GNUNET_TRANSPORT_INIT_BLACKLIST, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT));
2319 check_blacklist (&n->id, 2328 check_blacklist (&n->id,
2320 n->connect_ack_timestamp, 2329 n->connect_ack_timestamp,
2321 address, session); 2330 address, session);
2322 break; 2331 break;
2323 case S_INIT_BLACKLIST: 2332 case GNUNET_TRANSPORT_INIT_BLACKLIST:
2324 /* ATS suggests a different address, switch again */ 2333 /* ATS suggests a different address, switch again */
2325 set_primary_address (n, 2334 set_primary_address (n,
2326 address, session, bandwidth_in, bandwidth_out, GNUNET_NO); 2335 address, session, bandwidth_in, bandwidth_out, GNUNET_NO);
@@ -2329,44 +2338,40 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
2329 n->connect_ack_timestamp, 2338 n->connect_ack_timestamp,
2330 address, session); 2339 address, session);
2331 break; 2340 break;
2332 case S_CONNECT_SENT: 2341 case GNUNET_TRANSPORT_CONNECT_SENT:
2333 /* ATS suggests a different address, switch again */ 2342 /* ATS suggests a different address, switch again */
2334 set_primary_address (n, address, session, bandwidth_in, bandwidth_out, GNUNET_NO); 2343 set_primary_address (n, address, session, bandwidth_in, bandwidth_out, GNUNET_NO);
2335 set_state_and_timeout (n, S_INIT_BLACKLIST, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT)); 2344 set_state_and_timeout (n, GNUNET_TRANSPORT_INIT_BLACKLIST, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT));
2336 check_blacklist (&n->id, 2345 check_blacklist (&n->id,
2337 n->connect_ack_timestamp, 2346 n->connect_ack_timestamp,
2338 address, session); 2347 address, session);
2339 break; 2348 break;
2340 case S_CONNECT_RECV_ATS: 2349 case GNUNET_TRANSPORT_CONNECT_RECV_ATS:
2341 set_primary_address (n, 2350 set_primary_address (n,
2342 address, session, bandwidth_in, bandwidth_out, GNUNET_NO); 2351 address, session, bandwidth_in, bandwidth_out, GNUNET_NO);
2343 set_state_and_timeout (n, S_CONNECT_RECV_BLACKLIST, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT)); 2352 set_state_and_timeout (n, GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT));
2344 check_blacklist (&n->id, 2353 check_blacklist (&n->id,
2345 n->connect_ack_timestamp, 2354 n->connect_ack_timestamp,
2346 address, session); 2355 address, session);
2347 break; 2356 break;
2348 case S_CONNECT_RECV_BLACKLIST_INBOUND: 2357 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST_INBOUND:
2349 set_timeout (n, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT)); 2358 set_timeout (n, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT));
2350 neighbour_change_cb (callback_cls, &n->id, n->primary_address.address,
2351 n->state, n->timeout, bandwidth_in, bandwidth_out);
2352 check_blacklist (&n->id, 2359 check_blacklist (&n->id,
2353 n->connect_ack_timestamp, 2360 n->connect_ack_timestamp,
2354 address, session); 2361 address, session);
2355 break; 2362 break;
2356 case S_CONNECT_RECV_BLACKLIST: 2363 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST:
2357 case S_CONNECT_RECV_ACK: 2364 case GNUNET_TRANSPORT_CONNECT_RECV_ACK:
2358 /* ATS asks us to switch while we were trying to connect; switch to new 2365 /* ATS asks us to switch while we were trying to connect; switch to new
2359 address and check blacklist again */ 2366 address and check blacklist again */
2360 set_primary_address (n, 2367 set_primary_address (n,
2361 address, session, bandwidth_in, bandwidth_out, GNUNET_NO); 2368 address, session, bandwidth_in, bandwidth_out, GNUNET_NO);
2362 set_state_and_timeout (n, S_CONNECT_RECV_BLACKLIST, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT)); 2369 set_state_and_timeout (n, GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT));
2363 neighbour_change_cb (callback_cls, &n->id, n->primary_address.address,
2364 n->state, n->timeout, bandwidth_in, bandwidth_out);
2365 check_blacklist (&n->id, 2370 check_blacklist (&n->id,
2366 n->connect_ack_timestamp, 2371 n->connect_ack_timestamp,
2367 address, session); 2372 address, session);
2368 break; 2373 break;
2369 case S_CONNECTED: 2374 case GNUNET_TRANSPORT_CONNECTED:
2370 GNUNET_assert (NULL != n->primary_address.address); 2375 GNUNET_assert (NULL != n->primary_address.address);
2371 GNUNET_assert (NULL != n->primary_address.session); 2376 GNUNET_assert (NULL != n->primary_address.session);
2372 if (n->primary_address.session == session) 2377 if (n->primary_address.session == session)
@@ -2374,94 +2379,78 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
2374 /* not an address change, just a quota change */ 2379 /* not an address change, just a quota change */
2375 set_primary_address (n, 2380 set_primary_address (n,
2376 address, session, bandwidth_in, bandwidth_out, GNUNET_YES); 2381 address, session, bandwidth_in, bandwidth_out, GNUNET_YES);
2377 neighbour_change_cb (callback_cls, &n->id, n->primary_address.address,
2378 n->state, n->timeout, bandwidth_in, bandwidth_out);
2379 break; 2382 break;
2380 } 2383 }
2381 /* ATS asks us to switch a life connection; see if we can get 2384 /* ATS asks us to switch a life connection; see if we can get
2382 a CONNECT_ACK on it before we actually do this! */ 2385 a CONNECT_ACK on it before we actually do this! */
2383 set_state (n, S_CONNECTED_SWITCHING_BLACKLIST); 2386 set_state (n, GNUNET_TRANSPORT_CONNECTED_SWITCHING_BLACKLIST);
2384 set_alternative_address (n, 2387 set_alternative_address (n, address, session, bandwidth_in, bandwidth_out);
2385 address, session, bandwidth_in, bandwidth_out, GNUNET_NO);
2386 neighbour_change_cb (callback_cls, &n->id, n->primary_address.address,
2387 n->state, n->timeout, bandwidth_in, bandwidth_out);
2388 check_blacklist (&n->id, 2388 check_blacklist (&n->id,
2389 GNUNET_TIME_absolute_get (), 2389 GNUNET_TIME_absolute_get (),
2390 address, session); 2390 address, session);
2391 break; 2391 break;
2392 case S_RECONNECT_ATS: 2392 case GNUNET_TRANSPORT_RECONNECT_ATS:
2393 set_primary_address (n, 2393 set_primary_address (n,
2394 address, session, bandwidth_in, bandwidth_out, GNUNET_NO); 2394 address, session, bandwidth_in, bandwidth_out, GNUNET_NO);
2395 set_state_and_timeout (n, S_RECONNECT_BLACKLIST, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT)); 2395 set_state_and_timeout (n, GNUNET_TRANSPORT_RECONNECT_BLACKLIST, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT));
2396 neighbour_change_cb (callback_cls, &n->id, n->primary_address.address,
2397 n->state, n->timeout, bandwidth_in, bandwidth_out);
2398 check_blacklist (&n->id, 2396 check_blacklist (&n->id,
2399 n->connect_ack_timestamp, 2397 n->connect_ack_timestamp,
2400 address, session); 2398 address, session);
2401 break; 2399 break;
2402 case S_RECONNECT_BLACKLIST: 2400 case GNUNET_TRANSPORT_RECONNECT_BLACKLIST:
2403 /* ATS asks us to switch while we were trying to reconnect; switch to new 2401 /* ATS asks us to switch while we were trying to reconnect; switch to new
2404 address and check blacklist again */ 2402 address and check blacklist again */
2405 set_primary_address (n, 2403 set_primary_address (n,
2406 address, session, bandwidth_in, bandwidth_out, GNUNET_NO); 2404 address, session, bandwidth_in, bandwidth_out, GNUNET_NO);
2407 set_timeout (n, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT)); 2405 set_timeout (n, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT));
2408 neighbour_change_cb (callback_cls, &n->id, n->primary_address.address,
2409 n->state, n->timeout, bandwidth_in, bandwidth_out);
2410 check_blacklist (&n->id, 2406 check_blacklist (&n->id,
2411 n->connect_ack_timestamp, 2407 n->connect_ack_timestamp,
2412 address, session); 2408 address, session);
2413 break; 2409 break;
2414 case S_RECONNECT_SENT: 2410 case GNUNET_TRANSPORT_RECONNECT_SENT:
2415 /* ATS asks us to switch while we were trying to reconnect; switch to new 2411 /* ATS asks us to switch while we were trying to reconnect; switch to new
2416 address and check blacklist again */ 2412 address and check blacklist again */
2417 set_primary_address (n, 2413 set_primary_address (n,
2418 address, session, bandwidth_in, bandwidth_out, GNUNET_NO); 2414 address, session, bandwidth_in, bandwidth_out, GNUNET_NO);
2419 set_state_and_timeout (n, S_RECONNECT_BLACKLIST, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT)); 2415 set_state_and_timeout (n, GNUNET_TRANSPORT_RECONNECT_BLACKLIST, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT));
2420 neighbour_change_cb (callback_cls, &n->id, n->primary_address.address,
2421 n->state, n->timeout, bandwidth_in, bandwidth_out);
2422 check_blacklist (&n->id, 2416 check_blacklist (&n->id,
2423 n->connect_ack_timestamp, 2417 n->connect_ack_timestamp,
2424 address, session); 2418 address, session);
2425 break; 2419 break;
2426 case S_CONNECTED_SWITCHING_BLACKLIST: 2420 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_BLACKLIST:
2427 if (n->primary_address.session == session) 2421 if (n->primary_address.session == session)
2428 { 2422 {
2429 /* ATS switches back to still-active session */ 2423 /* ATS switches back to still-active session */
2430 set_state(n, S_CONNECTED); 2424 set_state(n, GNUNET_TRANSPORT_CONNECTED);
2431 free_address (&n->alternative_address); 2425 free_address (&n->alternative_address);
2432 break; 2426 break;
2433 } 2427 }
2434 /* ATS asks us to switch a life connection, update blacklist check */ 2428 /* ATS asks us to switch a life connection, update blacklist check */
2435 set_primary_address (n, 2429 set_primary_address (n,
2436 address, session, bandwidth_in, bandwidth_out, GNUNET_NO); 2430 address, session, bandwidth_in, bandwidth_out, GNUNET_NO);
2437 neighbour_change_cb (callback_cls, &n->id, n->primary_address.address,
2438 n->state, n->timeout, bandwidth_in, bandwidth_out);
2439 check_blacklist (&n->id, 2431 check_blacklist (&n->id,
2440 GNUNET_TIME_absolute_get (), 2432 GNUNET_TIME_absolute_get (),
2441 address, session); 2433 address, session);
2442 break; 2434 break;
2443 case S_CONNECTED_SWITCHING_CONNECT_SENT: 2435 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_CONNECT_SENT:
2444 if (n->primary_address.session == session) 2436 if (n->primary_address.session == session)
2445 { 2437 {
2446 /* ATS switches back to still-active session */ 2438 /* ATS switches back to still-active session */
2447 free_address (&n->alternative_address); 2439 free_address (&n->alternative_address);
2448 set_state (n, S_CONNECTED); 2440 set_state (n, GNUNET_TRANSPORT_CONNECTED);
2449 break; 2441 break;
2450 } 2442 }
2451 /* ATS asks us to switch a life connection, update blacklist check */ 2443 /* ATS asks us to switch a life connection, update blacklist check */
2452 set_state (n, S_CONNECTED_SWITCHING_BLACKLIST); 2444 set_state (n, GNUNET_TRANSPORT_CONNECTED_SWITCHING_BLACKLIST);
2453 set_alternative_address (n, 2445 set_alternative_address (n, address, session, bandwidth_in, bandwidth_out);
2454 address, session, bandwidth_in, bandwidth_out, GNUNET_NO);
2455 neighbour_change_cb (callback_cls, &n->id, n->primary_address.address,
2456 n->state, n->timeout, bandwidth_in, bandwidth_out);
2457 check_blacklist (&n->id, 2446 check_blacklist (&n->id,
2458 GNUNET_TIME_absolute_get (), 2447 GNUNET_TIME_absolute_get (),
2459 address, session); 2448 address, session);
2460 break; 2449 break;
2461 case S_DISCONNECT: 2450 case GNUNET_TRANSPORT_DISCONNECT:
2462 /* not going to switch addresses while disconnecting */ 2451 /* not going to switch addresses while disconnecting */
2463 return; 2452 return;
2464 case S_DISCONNECT_FINISHED: 2453 case GNUNET_TRANSPORT_DISCONNECT_FINISHED:
2465 GNUNET_assert (0); 2454 GNUNET_assert (0);
2466 break; 2455 break;
2467 default: 2456 default:
@@ -2639,35 +2628,35 @@ master_task (void *cls,
2639 GNUNET_YES)); 2628 GNUNET_YES));
2640 switch (n->state) 2629 switch (n->state)
2641 { 2630 {
2642 case S_NOT_CONNECTED: 2631 case GNUNET_TRANSPORT_NOT_CONNECTED:
2643 /* invalid state for master task, clean up */ 2632 /* invalid state for master task, clean up */
2644 GNUNET_break (0); 2633 GNUNET_break (0);
2645 set_state (n, S_DISCONNECT_FINISHED); 2634 set_state (n, GNUNET_TRANSPORT_DISCONNECT_FINISHED);
2646 free_neighbour (n, GNUNET_NO); 2635 free_neighbour (n, GNUNET_NO);
2647 return; 2636 return;
2648 case S_INIT_ATS: 2637 case GNUNET_TRANSPORT_INIT_ATS:
2649 if (0 == delay.rel_value_us) 2638 if (0 == delay.rel_value_us)
2650 { 2639 {
2651 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 2640 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
2652 "Connection to `%s' timed out waiting for ATS to provide address\n", 2641 "Connection to `%s' timed out waiting for ATS to provide address\n",
2653 GNUNET_i2s (&n->id)); 2642 GNUNET_i2s (&n->id));
2654 set_state (n, S_DISCONNECT_FINISHED); 2643 set_state (n, GNUNET_TRANSPORT_DISCONNECT_FINISHED);
2655 free_neighbour (n, GNUNET_NO); 2644 free_neighbour (n, GNUNET_NO);
2656 return; 2645 return;
2657 } 2646 }
2658 break; 2647 break;
2659 case S_INIT_BLACKLIST: 2648 case GNUNET_TRANSPORT_INIT_BLACKLIST:
2660 if (0 == delay.rel_value_us) 2649 if (0 == delay.rel_value_us)
2661 { 2650 {
2662 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2651 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2663 "Connection to `%s' timed out waiting for BLACKLIST to approve address\n", 2652 "Connection to `%s' timed out waiting for BLACKLIST to approve address\n",
2664 GNUNET_i2s (&n->id)); 2653 GNUNET_i2s (&n->id));
2665 set_state (n, S_DISCONNECT_FINISHED); 2654 set_state (n, GNUNET_TRANSPORT_DISCONNECT_FINISHED);
2666 free_neighbour (n, GNUNET_NO); 2655 free_neighbour (n, GNUNET_NO);
2667 return; 2656 return;
2668 } 2657 }
2669 break; 2658 break;
2670 case S_CONNECT_SENT: 2659 case GNUNET_TRANSPORT_CONNECT_SENT:
2671 if (0 == delay.rel_value_us) 2660 if (0 == delay.rel_value_us)
2672 { 2661 {
2673 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 2662 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -2683,40 +2672,40 @@ master_task (void *cls,
2683 return; 2672 return;
2684 } 2673 }
2685 break; 2674 break;
2686 case S_CONNECT_RECV_BLACKLIST_INBOUND: 2675 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST_INBOUND:
2687 if (0 == delay.rel_value_us) 2676 if (0 == delay.rel_value_us)
2688 { 2677 {
2689 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2678 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2690 "Connection to `%s' timed out waiting BLACKLIST to approve address to use for received CONNECT\n", 2679 "Connection to `%s' timed out waiting BLACKLIST to approve address to use for received CONNECT\n",
2691 GNUNET_i2s (&n->id)); 2680 GNUNET_i2s (&n->id));
2692 set_state (n, S_DISCONNECT_FINISHED); 2681 set_state (n, GNUNET_TRANSPORT_DISCONNECT_FINISHED);
2693 free_neighbour (n, GNUNET_NO); 2682 free_neighbour (n, GNUNET_NO);
2694 return; 2683 return;
2695 } 2684 }
2696 break; 2685 break;
2697 case S_CONNECT_RECV_ATS: 2686 case GNUNET_TRANSPORT_CONNECT_RECV_ATS:
2698 if (0 == delay.rel_value_us) 2687 if (0 == delay.rel_value_us)
2699 { 2688 {
2700 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2689 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2701 "Connection to `%s' timed out waiting ATS to provide address to use for CONNECT_ACK\n", 2690 "Connection to `%s' timed out waiting ATS to provide address to use for CONNECT_ACK\n",
2702 GNUNET_i2s (&n->id)); 2691 GNUNET_i2s (&n->id));
2703 set_state (n, S_DISCONNECT_FINISHED); 2692 set_state (n, GNUNET_TRANSPORT_DISCONNECT_FINISHED);
2704 free_neighbour (n, GNUNET_NO); 2693 free_neighbour (n, GNUNET_NO);
2705 return; 2694 return;
2706 } 2695 }
2707 break; 2696 break;
2708 case S_CONNECT_RECV_BLACKLIST: 2697 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST:
2709 if (0 == delay.rel_value_us) 2698 if (0 == delay.rel_value_us)
2710 { 2699 {
2711 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2700 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2712 "Connection to `%s' timed out waiting BLACKLIST to approve address to use for CONNECT_ACK\n", 2701 "Connection to `%s' timed out waiting BLACKLIST to approve address to use for CONNECT_ACK\n",
2713 GNUNET_i2s (&n->id)); 2702 GNUNET_i2s (&n->id));
2714 set_state (n, S_DISCONNECT_FINISHED); 2703 set_state (n, GNUNET_TRANSPORT_DISCONNECT_FINISHED);
2715 free_neighbour (n, GNUNET_NO); 2704 free_neighbour (n, GNUNET_NO);
2716 return; 2705 return;
2717 } 2706 }
2718 break; 2707 break;
2719 case S_CONNECT_RECV_ACK: 2708 case GNUNET_TRANSPORT_CONNECT_RECV_ACK:
2720 if (0 == delay.rel_value_us) 2709 if (0 == delay.rel_value_us)
2721 { 2710 {
2722 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2711 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -2726,7 +2715,7 @@ master_task (void *cls,
2726 return; 2715 return;
2727 } 2716 }
2728 break; 2717 break;
2729 case S_CONNECTED: 2718 case GNUNET_TRANSPORT_CONNECTED:
2730 if (0 == delay.rel_value_us) 2719 if (0 == delay.rel_value_us)
2731 { 2720 {
2732 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2721 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -2738,7 +2727,7 @@ master_task (void *cls,
2738 try_transmission_to_peer (n); 2727 try_transmission_to_peer (n);
2739 send_keepalive (n); 2728 send_keepalive (n);
2740 break; 2729 break;
2741 case S_RECONNECT_ATS: 2730 case GNUNET_TRANSPORT_RECONNECT_ATS:
2742 if (0 == delay.rel_value_us) 2731 if (0 == delay.rel_value_us)
2743 { 2732 {
2744 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2733 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -2748,7 +2737,7 @@ master_task (void *cls,
2748 return; 2737 return;
2749 } 2738 }
2750 break; 2739 break;
2751 case S_RECONNECT_BLACKLIST: 2740 case GNUNET_TRANSPORT_RECONNECT_BLACKLIST:
2752 if (0 == delay.rel_value_us) 2741 if (0 == delay.rel_value_us)
2753 { 2742 {
2754 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2743 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -2758,7 +2747,7 @@ master_task (void *cls,
2758 return; 2747 return;
2759 } 2748 }
2760 break; 2749 break;
2761 case S_RECONNECT_SENT: 2750 case GNUNET_TRANSPORT_RECONNECT_SENT:
2762 if (0 == delay.rel_value_us) 2751 if (0 == delay.rel_value_us)
2763 { 2752 {
2764 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2753 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -2768,7 +2757,7 @@ master_task (void *cls,
2768 return; 2757 return;
2769 } 2758 }
2770 break; 2759 break;
2771 case S_CONNECTED_SWITCHING_BLACKLIST: 2760 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_BLACKLIST:
2772 if (0 == delay.rel_value_us) 2761 if (0 == delay.rel_value_us)
2773 { 2762 {
2774 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2763 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -2780,7 +2769,7 @@ master_task (void *cls,
2780 try_transmission_to_peer (n); 2769 try_transmission_to_peer (n);
2781 send_keepalive (n); 2770 send_keepalive (n);
2782 break; 2771 break;
2783 case S_CONNECTED_SWITCHING_CONNECT_SENT: 2772 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_CONNECT_SENT:
2784 if (0 == delay.rel_value_us) 2773 if (0 == delay.rel_value_us)
2785 { 2774 {
2786 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2775 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -2792,13 +2781,13 @@ master_task (void *cls,
2792 try_transmission_to_peer (n); 2781 try_transmission_to_peer (n);
2793 send_keepalive (n); 2782 send_keepalive (n);
2794 break; 2783 break;
2795 case S_DISCONNECT: 2784 case GNUNET_TRANSPORT_DISCONNECT:
2796 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2785 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2797 "Cleaning up connection to `%s' after sending DISCONNECT\n", 2786 "Cleaning up connection to `%s' after sending DISCONNECT\n",
2798 GNUNET_i2s (&n->id)); 2787 GNUNET_i2s (&n->id));
2799 free_neighbour (n, GNUNET_NO); 2788 free_neighbour (n, GNUNET_NO);
2800 return; 2789 return;
2801 case S_DISCONNECT_FINISHED: 2790 case GNUNET_TRANSPORT_DISCONNECT_FINISHED:
2802 /* how did we get here!? */ 2791 /* how did we get here!? */
2803 GNUNET_assert (0); 2792 GNUNET_assert (0);
2804 break; 2793 break;
@@ -2809,9 +2798,9 @@ master_task (void *cls,
2809 GNUNET_break (0); 2798 GNUNET_break (0);
2810 break; 2799 break;
2811 } 2800 }
2812 if ( (S_CONNECTED_SWITCHING_CONNECT_SENT == n->state) || 2801 if ( (GNUNET_TRANSPORT_CONNECTED_SWITCHING_CONNECT_SENT == n->state) ||
2813 (S_CONNECTED_SWITCHING_BLACKLIST == n->state) || 2802 (GNUNET_TRANSPORT_CONNECTED_SWITCHING_BLACKLIST == n->state) ||
2814 (S_CONNECTED == n->state) ) 2803 (GNUNET_TRANSPORT_CONNECTED == n->state) )
2815 { 2804 {
2816 /* if we are *now* in one of these three states, we're sending 2805 /* if we are *now* in one of these three states, we're sending
2817 keep alive messages, so we need to consider the keepalive 2806 keep alive messages, so we need to consider the keepalive
@@ -2893,25 +2882,25 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message,
2893 ts = GNUNET_TIME_absolute_ntoh (scm->timestamp); 2882 ts = GNUNET_TIME_absolute_ntoh (scm->timestamp);
2894 switch (n->state) 2883 switch (n->state)
2895 { 2884 {
2896 case S_NOT_CONNECTED: 2885 case GNUNET_TRANSPORT_NOT_CONNECTED:
2897 GNUNET_break (0); 2886 GNUNET_break (0);
2898 free_neighbour (n, GNUNET_NO); 2887 free_neighbour (n, GNUNET_NO);
2899 return GNUNET_SYSERR; 2888 return GNUNET_SYSERR;
2900 case S_INIT_ATS: 2889 case GNUNET_TRANSPORT_INIT_ATS:
2901 case S_INIT_BLACKLIST: 2890 case GNUNET_TRANSPORT_INIT_BLACKLIST:
2902 GNUNET_STATISTICS_update (GST_stats, 2891 GNUNET_STATISTICS_update (GST_stats,
2903 gettext_noop 2892 gettext_noop
2904 ("# unexpected CONNECT_ACK messages (not ready)"), 2893 ("# unexpected CONNECT_ACK messages (not ready)"),
2905 1, GNUNET_NO); 2894 1, GNUNET_NO);
2906 break; 2895 break;
2907 case S_CONNECT_SENT: 2896 case GNUNET_TRANSPORT_CONNECT_SENT:
2908 if (ts.abs_value_us != n->primary_address.connect_timestamp.abs_value_us) 2897 if (ts.abs_value_us != n->primary_address.connect_timestamp.abs_value_us)
2909 { 2898 {
2910 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 2899 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
2911 "CONNECT_ACK ignored as the timestamp does not match our CONNECT request\n"); 2900 "CONNECT_ACK ignored as the timestamp does not match our CONNECT request\n");
2912 return GNUNET_OK; 2901 return GNUNET_OK;
2913 } 2902 }
2914 set_state_and_timeout (n, S_CONNECTED, GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT)); 2903 set_state_and_timeout (n, GNUNET_TRANSPORT_CONNECTED, GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT));
2915 GNUNET_STATISTICS_set (GST_stats, 2904 GNUNET_STATISTICS_set (GST_stats,
2916 gettext_noop ("# peers connected"), 2905 gettext_noop ("# peers connected"),
2917 ++neighbours_connected, 2906 ++neighbours_connected,
@@ -2931,21 +2920,21 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message,
2931 GNUNET_YES); 2920 GNUNET_YES);
2932 send_session_ack_message (n); 2921 send_session_ack_message (n);
2933 break; 2922 break;
2934 case S_CONNECT_RECV_BLACKLIST_INBOUND: 2923 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST_INBOUND:
2935 case S_CONNECT_RECV_ATS: 2924 case GNUNET_TRANSPORT_CONNECT_RECV_ATS:
2936 case S_CONNECT_RECV_BLACKLIST: 2925 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST:
2937 case S_CONNECT_RECV_ACK: 2926 case GNUNET_TRANSPORT_CONNECT_RECV_ACK:
2938 GNUNET_STATISTICS_update (GST_stats, 2927 GNUNET_STATISTICS_update (GST_stats,
2939 gettext_noop 2928 gettext_noop
2940 ("# unexpected CONNECT_ACK messages (not ready)"), 2929 ("# unexpected CONNECT_ACK messages (not ready)"),
2941 1, GNUNET_NO); 2930 1, GNUNET_NO);
2942 break; 2931 break;
2943 case S_CONNECTED: 2932 case GNUNET_TRANSPORT_CONNECTED:
2944 /* duplicate CONNECT_ACK, let's answer by duplciate SESSION_ACK just in case */ 2933 /* duplicate CONNECT_ACK, let's answer by duplciate SESSION_ACK just in case */
2945 send_session_ack_message (n); 2934 send_session_ack_message (n);
2946 break; 2935 break;
2947 case S_RECONNECT_ATS: 2936 case GNUNET_TRANSPORT_RECONNECT_ATS:
2948 case S_RECONNECT_BLACKLIST: 2937 case GNUNET_TRANSPORT_RECONNECT_BLACKLIST:
2949 /* we didn't expect any CONNECT_ACK, as we are waiting for ATS 2938 /* we didn't expect any CONNECT_ACK, as we are waiting for ATS
2950 to give us a new address... */ 2939 to give us a new address... */
2951 GNUNET_STATISTICS_update (GST_stats, 2940 GNUNET_STATISTICS_update (GST_stats,
@@ -2953,39 +2942,37 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message,
2953 ("# unexpected CONNECT_ACK messages (waiting on ATS)"), 2942 ("# unexpected CONNECT_ACK messages (waiting on ATS)"),
2954 1, GNUNET_NO); 2943 1, GNUNET_NO);
2955 break; 2944 break;
2956 case S_RECONNECT_SENT: 2945 case GNUNET_TRANSPORT_RECONNECT_SENT:
2957 /* new address worked; go back to connected! */ 2946 /* new address worked; go back to connected! */
2958 set_state (n, S_CONNECTED); 2947 set_state (n, GNUNET_TRANSPORT_CONNECTED);
2959 send_session_ack_message (n); 2948 send_session_ack_message (n);
2960 break; 2949 break;
2961 case S_CONNECTED_SWITCHING_BLACKLIST: 2950 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_BLACKLIST:
2962 /* duplicate CONNECT_ACK, let's answer by duplciate SESSION_ACK just in case */ 2951 /* duplicate CONNECT_ACK, let's answer by duplciate SESSION_ACK just in case */
2963 send_session_ack_message (n); 2952 send_session_ack_message (n);
2964 break; 2953 break;
2965 case S_CONNECTED_SWITCHING_CONNECT_SENT: 2954 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_CONNECT_SENT:
2966 /* new address worked; adopt it and go back to connected! */ 2955 /* new address worked; adopt it and go back to connected! */
2967 set_state_and_timeout (n, S_CONNECTED, GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT)); 2956 set_state_and_timeout (n, GNUNET_TRANSPORT_CONNECTED, GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT));
2968 GNUNET_break (GNUNET_NO == n->alternative_address.ats_active); 2957 GNUNET_break (GNUNET_NO == n->alternative_address.ats_active);
2969 2958
2970 GST_ats_add_address (n->alternative_address.address, 2959 GST_ats_add_address (n->alternative_address.address,
2971 n->alternative_address.session, 2960 n->alternative_address.session,
2972 NULL, 0); 2961 NULL, 0);
2973 set_alternative_address (n, 2962 set_primary_address (n, n->alternative_address.address,
2974 n->alternative_address.address, 2963 n->alternative_address.session, n->alternative_address.bandwidth_in,
2975 n->alternative_address.session, 2964 n->alternative_address.bandwidth_out, GNUNET_YES);
2976 n->alternative_address.bandwidth_in, 2965
2977 n->alternative_address.bandwidth_out,
2978 GNUNET_YES);
2979 free_address (&n->alternative_address); 2966 free_address (&n->alternative_address);
2980 send_session_ack_message (n); 2967 send_session_ack_message (n);
2981 break; 2968 break;
2982 case S_DISCONNECT: 2969 case GNUNET_TRANSPORT_DISCONNECT:
2983 GNUNET_STATISTICS_update (GST_stats, 2970 GNUNET_STATISTICS_update (GST_stats,
2984 gettext_noop 2971 gettext_noop
2985 ("# unexpected CONNECT_ACK messages (disconnecting)"), 2972 ("# unexpected CONNECT_ACK messages (disconnecting)"),
2986 1, GNUNET_NO); 2973 1, GNUNET_NO);
2987 return GNUNET_SYSERR; 2974 return GNUNET_SYSERR;
2988 case S_DISCONNECT_FINISHED: 2975 case GNUNET_TRANSPORT_DISCONNECT_FINISHED:
2989 GNUNET_assert (0); 2976 GNUNET_assert (0);
2990 break; 2977 break;
2991 default: 2978 default:
@@ -3038,9 +3025,9 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
3038 { 3025 {
3039 if (session == n->alternative_address.session) 3026 if (session == n->alternative_address.session)
3040 { 3027 {
3041 if ( (S_CONNECTED_SWITCHING_BLACKLIST == n->state) || 3028 if ( (GNUNET_TRANSPORT_CONNECTED_SWITCHING_BLACKLIST == n->state) ||
3042 (S_CONNECTED_SWITCHING_CONNECT_SENT == n->state) ) 3029 (GNUNET_TRANSPORT_CONNECTED_SWITCHING_CONNECT_SENT == n->state) )
3043 set_state (n, S_CONNECTED); 3030 set_state (n, GNUNET_TRANSPORT_CONNECTED);
3044 else 3031 else
3045 GNUNET_break (0); 3032 GNUNET_break (0);
3046 free_address (&n->alternative_address); 3033 free_address (&n->alternative_address);
@@ -3051,59 +3038,59 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
3051 n->expect_latency_response = GNUNET_NO; 3038 n->expect_latency_response = GNUNET_NO;
3052 switch (n->state) 3039 switch (n->state)
3053 { 3040 {
3054 case S_NOT_CONNECTED: 3041 case GNUNET_TRANSPORT_NOT_CONNECTED:
3055 GNUNET_break (0); 3042 GNUNET_break (0);
3056 free_neighbour (n, GNUNET_NO); 3043 free_neighbour (n, GNUNET_NO);
3057 return GNUNET_YES; 3044 return GNUNET_YES;
3058 case S_INIT_ATS: 3045 case GNUNET_TRANSPORT_INIT_ATS:
3059 GNUNET_break (0); 3046 GNUNET_break (0);
3060 free_neighbour (n, GNUNET_NO); 3047 free_neighbour (n, GNUNET_NO);
3061 return GNUNET_YES; 3048 return GNUNET_YES;
3062 case S_INIT_BLACKLIST: 3049 case GNUNET_TRANSPORT_INIT_BLACKLIST:
3063 case S_CONNECT_SENT: 3050 case GNUNET_TRANSPORT_CONNECT_SENT:
3064 free_address (&n->primary_address); 3051 free_address (&n->primary_address);
3065 set_state_and_timeout (n, S_INIT_ATS, GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT)); 3052 set_state_and_timeout (n, GNUNET_TRANSPORT_INIT_ATS, GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT));
3066 break; 3053 break;
3067 case S_CONNECT_RECV_BLACKLIST_INBOUND: 3054 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST_INBOUND:
3068 case S_CONNECT_RECV_ATS: 3055 case GNUNET_TRANSPORT_CONNECT_RECV_ATS:
3069 case S_CONNECT_RECV_BLACKLIST: 3056 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST:
3070 case S_CONNECT_RECV_ACK: 3057 case GNUNET_TRANSPORT_CONNECT_RECV_ACK:
3071 /* error on inbound session; free neighbour entirely */ 3058 /* error on inbound session; free neighbour entirely */
3072 free_address (&n->primary_address); 3059 free_address (&n->primary_address);
3073 free_neighbour (n, GNUNET_NO); 3060 free_neighbour (n, GNUNET_NO);
3074 return GNUNET_YES; 3061 return GNUNET_YES;
3075 case S_CONNECTED: 3062 case GNUNET_TRANSPORT_CONNECTED:
3076 set_state_and_timeout (n, S_INIT_ATS, GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT)); 3063 set_state_and_timeout (n, GNUNET_TRANSPORT_INIT_ATS, GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT));
3077 free_address (&n->primary_address); 3064 free_address (&n->primary_address);
3078 break; 3065 break;
3079 case S_RECONNECT_ATS: 3066 case GNUNET_TRANSPORT_RECONNECT_ATS:
3080 /* we don't have an address, how can it go down? */ 3067 /* we don't have an address, how can it go down? */
3081 GNUNET_break (0); 3068 GNUNET_break (0);
3082 break; 3069 break;
3083 case S_RECONNECT_BLACKLIST: 3070 case GNUNET_TRANSPORT_RECONNECT_BLACKLIST:
3084 case S_RECONNECT_SENT: 3071 case GNUNET_TRANSPORT_RECONNECT_SENT:
3085 set_state_and_timeout (n, S_RECONNECT_ATS, GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT)); 3072 set_state_and_timeout (n, GNUNET_TRANSPORT_RECONNECT_ATS, GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT));
3086 break; 3073 break;
3087 case S_CONNECTED_SWITCHING_BLACKLIST: 3074 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_BLACKLIST:
3088 /* primary went down while we were checking secondary against 3075 /* primary went down while we were checking secondary against
3089 blacklist, adopt secondary as primary */ 3076 blacklist, adopt secondary as primary */
3090 free_address (&n->primary_address); 3077 free_address (&n->primary_address);
3091 set_state_and_timeout (n, S_RECONNECT_BLACKLIST, GNUNET_TIME_relative_to_absolute (FAST_RECONNECT_TIMEOUT)); 3078 set_state_and_timeout (n, GNUNET_TRANSPORT_RECONNECT_BLACKLIST, GNUNET_TIME_relative_to_absolute (FAST_RECONNECT_TIMEOUT));
3092 n->primary_address = n->alternative_address; 3079 n->primary_address = n->alternative_address;
3093 memset (&n->alternative_address, 0, sizeof (struct NeighbourAddress)); 3080 memset (&n->alternative_address, 0, sizeof (struct NeighbourAddress));
3094 break; 3081 break;
3095 case S_CONNECTED_SWITCHING_CONNECT_SENT: 3082 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_CONNECT_SENT:
3096 /* primary went down while we were waiting for CONNECT_ACK on secondary; 3083 /* primary went down while we were waiting for CONNECT_ACK on secondary;
3097 secondary as primary */ 3084 secondary as primary */
3098 free_address (&n->primary_address); 3085 free_address (&n->primary_address);
3099 n->primary_address = n->alternative_address; 3086 n->primary_address = n->alternative_address;
3100 memset (&n->alternative_address, 0, sizeof (struct NeighbourAddress)); 3087 memset (&n->alternative_address, 0, sizeof (struct NeighbourAddress));
3101 set_state_and_timeout (n, S_RECONNECT_SENT, GNUNET_TIME_relative_to_absolute (FAST_RECONNECT_TIMEOUT)); 3088 set_state_and_timeout (n, GNUNET_TRANSPORT_RECONNECT_SENT, GNUNET_TIME_relative_to_absolute (FAST_RECONNECT_TIMEOUT));
3102 break; 3089 break;
3103 case S_DISCONNECT: 3090 case GNUNET_TRANSPORT_DISCONNECT:
3104 free_address (&n->primary_address); 3091 free_address (&n->primary_address);
3105 break; 3092 break;
3106 case S_DISCONNECT_FINISHED: 3093 case GNUNET_TRANSPORT_DISCONNECT_FINISHED:
3107 /* neighbour was freed and plugins told to terminate session */ 3094 /* neighbour was freed and plugins told to terminate session */
3108 return GNUNET_NO; 3095 return GNUNET_NO;
3109 break; 3096 break;
@@ -3160,8 +3147,8 @@ GST_neighbours_handle_session_ack (const struct GNUNET_MessageHeader *message,
3160 } 3147 }
3161 /* check if we are in a plausible state for having sent 3148 /* check if we are in a plausible state for having sent
3162 a CONNECT_ACK. If not, return, otherwise break */ 3149 a CONNECT_ACK. If not, return, otherwise break */
3163 if ( ( (S_CONNECT_RECV_ACK != n->state) && 3150 if ( ( (GNUNET_TRANSPORT_CONNECT_RECV_ACK != n->state) &&
3164 (S_CONNECT_SENT != n->state) ) || 3151 (GNUNET_TRANSPORT_CONNECT_SENT != n->state) ) ||
3165 (2 != n->send_connect_ack) ) 3152 (2 != n->send_connect_ack) )
3166 { 3153 {
3167 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3154 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -3174,7 +3161,7 @@ GST_neighbours_handle_session_ack (const struct GNUNET_MessageHeader *message,
3174 GNUNET_NO); 3161 GNUNET_NO);
3175 return GNUNET_OK; 3162 return GNUNET_OK;
3176 } 3163 }
3177 set_state_and_timeout (n, S_CONNECTED, GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT)); 3164 set_state_and_timeout (n, GNUNET_TRANSPORT_CONNECTED, GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT));
3178 GNUNET_STATISTICS_set (GST_stats, 3165 GNUNET_STATISTICS_set (GST_stats,
3179 gettext_noop ("# peers connected"), 3166 gettext_noop ("# peers connected"),
3180 ++neighbours_connected, 3167 ++neighbours_connected,
@@ -3444,23 +3431,23 @@ GST_neighbour_get_latency (const struct GNUNET_PeerIdentity *peer)
3444 return GNUNET_TIME_UNIT_FOREVER_REL; 3431 return GNUNET_TIME_UNIT_FOREVER_REL;
3445 switch (n->state) 3432 switch (n->state)
3446 { 3433 {
3447 case S_CONNECTED: 3434 case GNUNET_TRANSPORT_CONNECTED:
3448 case S_CONNECTED_SWITCHING_CONNECT_SENT: 3435 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_CONNECT_SENT:
3449 case S_CONNECTED_SWITCHING_BLACKLIST: 3436 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_BLACKLIST:
3450 case S_RECONNECT_SENT: 3437 case GNUNET_TRANSPORT_RECONNECT_SENT:
3451 case S_RECONNECT_ATS: 3438 case GNUNET_TRANSPORT_RECONNECT_ATS:
3452 case S_RECONNECT_BLACKLIST: 3439 case GNUNET_TRANSPORT_RECONNECT_BLACKLIST:
3453 return n->latency; 3440 return n->latency;
3454 case S_NOT_CONNECTED: 3441 case GNUNET_TRANSPORT_NOT_CONNECTED:
3455 case S_INIT_BLACKLIST: 3442 case GNUNET_TRANSPORT_INIT_BLACKLIST:
3456 case S_INIT_ATS: 3443 case GNUNET_TRANSPORT_INIT_ATS:
3457 case S_CONNECT_RECV_BLACKLIST_INBOUND: 3444 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST_INBOUND:
3458 case S_CONNECT_RECV_ATS: 3445 case GNUNET_TRANSPORT_CONNECT_RECV_ATS:
3459 case S_CONNECT_RECV_BLACKLIST: 3446 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST:
3460 case S_CONNECT_RECV_ACK: 3447 case GNUNET_TRANSPORT_CONNECT_RECV_ACK:
3461 case S_CONNECT_SENT: 3448 case GNUNET_TRANSPORT_CONNECT_SENT:
3462 case S_DISCONNECT: 3449 case GNUNET_TRANSPORT_DISCONNECT:
3463 case S_DISCONNECT_FINISHED: 3450 case GNUNET_TRANSPORT_DISCONNECT_FINISHED:
3464 return GNUNET_TIME_UNIT_FOREVER_REL; 3451 return GNUNET_TIME_UNIT_FOREVER_REL;
3465 default: 3452 default:
3466 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 3453 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -3536,7 +3523,7 @@ disconnect_all_neighbours (void *cls,
3536 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3523 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3537 "Disconnecting peer `%4s', %s\n", 3524 "Disconnecting peer `%4s', %s\n",
3538 GNUNET_i2s (&n->id), "SHUTDOWN_TASK"); 3525 GNUNET_i2s (&n->id), "SHUTDOWN_TASK");
3539 set_state (n, S_DISCONNECT_FINISHED); 3526 set_state (n, GNUNET_TRANSPORT_DISCONNECT_FINISHED);
3540 free_neighbour (n, GNUNET_NO); 3527 free_neighbour (n, GNUNET_NO);
3541 return GNUNET_OK; 3528 return GNUNET_OK;
3542} 3529}
diff --git a/src/transport/transport_api_monitoring.c b/src/transport/transport_api_monitoring.c
index 8f67a24b7..b753ce73a 100644
--- a/src/transport/transport_api_monitoring.c
+++ b/src/transport/transport_api_monitoring.c
@@ -151,24 +151,24 @@ GNUNET_TRANSPORT_is_connected (enum GNUNET_TRANSPORT_PeerState state)
151{ 151{
152 switch (state) 152 switch (state)
153 { 153 {
154 case S_NOT_CONNECTED: 154 case GNUNET_TRANSPORT_NOT_CONNECTED:
155 case S_INIT_ATS: 155 case GNUNET_TRANSPORT_INIT_ATS:
156 case S_INIT_BLACKLIST: 156 case GNUNET_TRANSPORT_INIT_BLACKLIST:
157 case S_CONNECT_SENT: 157 case GNUNET_TRANSPORT_CONNECT_SENT:
158 case S_CONNECT_RECV_BLACKLIST_INBOUND: 158 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST_INBOUND:
159 case S_CONNECT_RECV_ATS: 159 case GNUNET_TRANSPORT_CONNECT_RECV_ATS:
160 case S_CONNECT_RECV_BLACKLIST: 160 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST:
161 case S_CONNECT_RECV_ACK: 161 case GNUNET_TRANSPORT_CONNECT_RECV_ACK:
162 return GNUNET_NO; 162 return GNUNET_NO;
163 case S_CONNECTED: 163 case GNUNET_TRANSPORT_CONNECTED:
164 case S_RECONNECT_ATS: 164 case GNUNET_TRANSPORT_RECONNECT_ATS:
165 case S_RECONNECT_BLACKLIST: 165 case GNUNET_TRANSPORT_RECONNECT_BLACKLIST:
166 case S_RECONNECT_SENT: 166 case GNUNET_TRANSPORT_RECONNECT_SENT:
167 case S_CONNECTED_SWITCHING_BLACKLIST: 167 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_BLACKLIST:
168 case S_CONNECTED_SWITCHING_CONNECT_SENT: 168 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_CONNECT_SENT:
169 return GNUNET_YES; 169 return GNUNET_YES;
170 case S_DISCONNECT: 170 case GNUNET_TRANSPORT_DISCONNECT:
171 case S_DISCONNECT_FINISHED: 171 case GNUNET_TRANSPORT_DISCONNECT_FINISHED:
172 return GNUNET_NO; 172 return GNUNET_NO;
173 default: 173 default:
174 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 174 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -191,37 +191,37 @@ GNUNET_TRANSPORT_p2s (enum GNUNET_TRANSPORT_PeerState state)
191{ 191{
192 switch (state) 192 switch (state)
193 { 193 {
194 case S_NOT_CONNECTED: 194 case GNUNET_TRANSPORT_NOT_CONNECTED:
195 return "S_NOT_CONNECTED"; 195 return "S_NOT_CONNECTED";
196 case S_INIT_ATS: 196 case GNUNET_TRANSPORT_INIT_ATS:
197 return "S_INIT_ATS"; 197 return "S_INIT_ATS";
198 case S_INIT_BLACKLIST: 198 case GNUNET_TRANSPORT_INIT_BLACKLIST:
199 return "S_INIT_BLACKLIST"; 199 return "S_INIT_BLACKLIST";
200 case S_CONNECT_SENT: 200 case GNUNET_TRANSPORT_CONNECT_SENT:
201 return "S_CONNECT_SENT"; 201 return "S_CONNECT_SENT";
202 case S_CONNECT_RECV_BLACKLIST_INBOUND: 202 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST_INBOUND:
203 return "S_CONNECT_RECV_BLACKLIST_INBOUND"; 203 return "S_CONNECT_RECV_BLACKLIST_INBOUND";
204 case S_CONNECT_RECV_ATS: 204 case GNUNET_TRANSPORT_CONNECT_RECV_ATS:
205 return "S_CONNECT_RECV_ATS"; 205 return "S_CONNECT_RECV_ATS";
206 case S_CONNECT_RECV_BLACKLIST: 206 case GNUNET_TRANSPORT_CONNECT_RECV_BLACKLIST:
207 return "S_CONNECT_RECV_BLACKLIST"; 207 return "S_CONNECT_RECV_BLACKLIST";
208 case S_CONNECT_RECV_ACK: 208 case GNUNET_TRANSPORT_CONNECT_RECV_ACK:
209 return "S_CONNECT_RECV_ACK"; 209 return "S_CONNECT_RECV_ACK";
210 case S_CONNECTED: 210 case GNUNET_TRANSPORT_CONNECTED:
211 return "S_CONNECTED"; 211 return "S_CONNECTED";
212 case S_RECONNECT_ATS: 212 case GNUNET_TRANSPORT_RECONNECT_ATS:
213 return "S_RECONNECT_ATS"; 213 return "S_RECONNECT_ATS";
214 case S_RECONNECT_BLACKLIST: 214 case GNUNET_TRANSPORT_RECONNECT_BLACKLIST:
215 return "S_RECONNECT_BLACKLIST"; 215 return "S_RECONNECT_BLACKLIST";
216 case S_RECONNECT_SENT: 216 case GNUNET_TRANSPORT_RECONNECT_SENT:
217 return "S_RECONNECT_SENT"; 217 return "S_RECONNECT_SENT";
218 case S_CONNECTED_SWITCHING_BLACKLIST: 218 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_BLACKLIST:
219 return "S_CONNECTED_SWITCHING_BLACKLIST"; 219 return "S_CONNECTED_SWITCHING_BLACKLIST";
220 case S_CONNECTED_SWITCHING_CONNECT_SENT: 220 case GNUNET_TRANSPORT_CONNECTED_SWITCHING_CONNECT_SENT:
221 return "S_CONNECTED_SWITCHING_CONNECT_SENT"; 221 return "S_CONNECTED_SWITCHING_CONNECT_SENT";
222 case S_DISCONNECT: 222 case GNUNET_TRANSPORT_DISCONNECT:
223 return "S_DISCONNECT"; 223 return "S_DISCONNECT";
224 case S_DISCONNECT_FINISHED: 224 case GNUNET_TRANSPORT_DISCONNECT_FINISHED:
225 return "S_DISCONNECT_FINISHED"; 225 return "S_DISCONNECT_FINISHED";
226 default: 226 default:
227 GNUNET_break (0); 227 GNUNET_break (0);
@@ -328,7 +328,7 @@ peer_response_processor (void *cls,
328 if (pal_ctx->one_shot) 328 if (pal_ctx->one_shot)
329 { 329 {
330 pal_ctx->cb (pal_ctx->cb_cls, NULL, NULL, 330 pal_ctx->cb (pal_ctx->cb_cls, NULL, NULL,
331 S_NOT_CONNECTED, GNUNET_TIME_UNIT_ZERO_ABS); 331 GNUNET_TRANSPORT_NOT_CONNECTED, GNUNET_TIME_UNIT_ZERO_ABS);
332 GNUNET_TRANSPORT_monitor_peers_cancel (pal_ctx); 332 GNUNET_TRANSPORT_monitor_peers_cancel (pal_ctx);
333 } 333 }
334 else 334 else
@@ -346,7 +346,7 @@ peer_response_processor (void *cls,
346 if (pal_ctx->one_shot) 346 if (pal_ctx->one_shot)
347 { 347 {
348 pal_ctx->cb (pal_ctx->cb_cls, NULL, NULL, 348 pal_ctx->cb (pal_ctx->cb_cls, NULL, NULL,
349 S_NOT_CONNECTED, GNUNET_TIME_UNIT_ZERO_ABS); 349 GNUNET_TRANSPORT_NOT_CONNECTED, GNUNET_TIME_UNIT_ZERO_ABS);
350 GNUNET_TRANSPORT_monitor_peers_cancel (pal_ctx); 350 GNUNET_TRANSPORT_monitor_peers_cancel (pal_ctx);
351 } 351 }
352 else 352 else
@@ -364,7 +364,7 @@ peer_response_processor (void *cls,
364 if (pal_ctx->one_shot) 364 if (pal_ctx->one_shot)
365 { 365 {
366 pal_ctx->cb (pal_ctx->cb_cls, NULL, NULL, 366 pal_ctx->cb (pal_ctx->cb_cls, NULL, NULL,
367 S_NOT_CONNECTED, GNUNET_TIME_UNIT_ZERO_ABS); 367 GNUNET_TRANSPORT_NOT_CONNECTED, GNUNET_TIME_UNIT_ZERO_ABS);
368 GNUNET_TRANSPORT_monitor_peers_cancel (pal_ctx); 368 GNUNET_TRANSPORT_monitor_peers_cancel (pal_ctx);
369 } 369 }
370 else 370 else
@@ -384,7 +384,7 @@ peer_response_processor (void *cls,
384 if (pal_ctx->one_shot) 384 if (pal_ctx->one_shot)
385 { 385 {
386 pal_ctx->cb (pal_ctx->cb_cls, NULL, NULL, 386 pal_ctx->cb (pal_ctx->cb_cls, NULL, NULL,
387 S_NOT_CONNECTED, GNUNET_TIME_UNIT_ZERO_ABS); 387 GNUNET_TRANSPORT_NOT_CONNECTED, GNUNET_TIME_UNIT_ZERO_ABS);
388 GNUNET_TRANSPORT_monitor_peers_cancel (pal_ctx); 388 GNUNET_TRANSPORT_monitor_peers_cancel (pal_ctx);
389 } 389 }
390 else 390 else
@@ -397,7 +397,7 @@ peer_response_processor (void *cls,
397 if (alen == 0 && tlen == 0) 397 if (alen == 0 && tlen == 0)
398 { 398 {
399 pal_ctx->cb (pal_ctx->cb_cls, &pir_msg->peer, NULL, 399 pal_ctx->cb (pal_ctx->cb_cls, &pir_msg->peer, NULL,
400 S_NOT_CONNECTED, GNUNET_TIME_UNIT_ZERO_ABS); 400 GNUNET_TRANSPORT_NOT_CONNECTED, GNUNET_TIME_UNIT_ZERO_ABS);
401 } 401 }
402 else 402 else
403 { 403 {
@@ -410,7 +410,7 @@ peer_response_processor (void *cls,
410 if (pal_ctx->one_shot) 410 if (pal_ctx->one_shot)
411 { 411 {
412 pal_ctx->cb (pal_ctx->cb_cls, NULL, NULL, 412 pal_ctx->cb (pal_ctx->cb_cls, NULL, NULL,
413 S_NOT_CONNECTED, GNUNET_TIME_UNIT_ZERO_ABS); 413 GNUNET_TRANSPORT_NOT_CONNECTED, GNUNET_TIME_UNIT_ZERO_ABS);
414 GNUNET_TRANSPORT_monitor_peers_cancel (pal_ctx); 414 GNUNET_TRANSPORT_monitor_peers_cancel (pal_ctx);
415 } 415 }
416 else 416 else