diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-11-04 13:59:35 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-11-04 13:59:35 +0000 |
commit | 28a2eb43281a1f08a67954f07beb9af3a9bc9a35 (patch) | |
tree | b1a4eb6bc53497fde67a372249011d9103a48a31 /src/transport | |
parent | 892c5652b368111d42ac15d383109bf7212d70ed (diff) | |
download | gnunet-28a2eb43281a1f08a67954f07beb9af3a9bc9a35.tar.gz gnunet-28a2eb43281a1f08a67954f07beb9af3a9bc9a35.zip |
extending ats api to inform about addresses in use
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 155efbb2f..d0d5b099c 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -2025,6 +2025,14 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, | |||
2025 | if (!is_connected(n)) | 2025 | if (!is_connected(n)) |
2026 | change_state (n, S_CONNECTED); | 2026 | change_state (n, S_CONNECTED); |
2027 | 2027 | ||
2028 | GNUNET_ATS_address_in_use (GST_ats, | ||
2029 | peer, | ||
2030 | plugin_name, | ||
2031 | sender_address, | ||
2032 | sender_address_len, | ||
2033 | session, | ||
2034 | GNUNET_YES); | ||
2035 | |||
2028 | #if DEBUG_TRANSPORT | 2036 | #if DEBUG_TRANSPORT |
2029 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 2037 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
2030 | "Setting inbound quota of %u for peer `%s' to \n", | 2038 | "Setting inbound quota of %u for peer `%s' to \n", |
@@ -2137,6 +2145,14 @@ GST_neighbours_handle_ack (const struct GNUNET_MessageHeader *message, | |||
2137 | was_connected = is_connected(n); | 2145 | was_connected = is_connected(n); |
2138 | change_state (n, S_CONNECTED); | 2146 | change_state (n, S_CONNECTED); |
2139 | 2147 | ||
2148 | GNUNET_ATS_address_in_use (GST_ats, | ||
2149 | peer, | ||
2150 | plugin_name, | ||
2151 | sender_address, | ||
2152 | sender_address_len, | ||
2153 | session, | ||
2154 | GNUNET_YES); | ||
2155 | |||
2140 | GST_neighbours_set_incoming_quota(&n->id, n->bandwidth_in); | 2156 | GST_neighbours_set_incoming_quota(&n->id, n->bandwidth_in); |
2141 | 2157 | ||
2142 | if (n->keepalive_task == GNUNET_SCHEDULER_NO_TASK) | 2158 | if (n->keepalive_task == GNUNET_SCHEDULER_NO_TASK) |
@@ -2166,13 +2182,11 @@ GST_neighbours_handle_ack (const struct GNUNET_MessageHeader *message, | |||
2166 | "Sending outbound quota of %u Bps for peer `%s' to all clients\n", | 2182 | "Sending outbound quota of %u Bps for peer `%s' to all clients\n", |
2167 | ntohl (n->bandwidth_out.value__), GNUNET_i2s (peer)); | 2183 | ntohl (n->bandwidth_out.value__), GNUNET_i2s (peer)); |
2168 | #endif | 2184 | #endif |
2169 | |||
2170 | q_msg.header.size = htons (sizeof (struct QuotaSetMessage)); | 2185 | q_msg.header.size = htons (sizeof (struct QuotaSetMessage)); |
2171 | q_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA); | 2186 | q_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA); |
2172 | q_msg.quota = n->bandwidth_out; | 2187 | q_msg.quota = n->bandwidth_out; |
2173 | q_msg.peer = (*peer); | 2188 | q_msg.peer = (*peer); |
2174 | GST_clients_broadcast (&q_msg.header, GNUNET_NO); | 2189 | GST_clients_broadcast (&q_msg.header, GNUNET_NO); |
2175 | |||
2176 | } | 2190 | } |
2177 | 2191 | ||
2178 | struct BlackListCheckContext | 2192 | struct BlackListCheckContext |