Paul Stewart | 3f43f43 | 2012-07-16 12:12:45 -0700 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "shill/link_monitor.h" |
| 6 | |
Paul Stewart | f1961f8 | 2012-09-11 20:45:39 -0700 | [diff] [blame] | 7 | #include <string> |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 8 | #include <vector> |
Paul Stewart | 3f43f43 | 2012-07-16 12:12:45 -0700 | [diff] [blame] | 9 | |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 10 | #include <base/bind.h> |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 11 | #include <base/stringprintf.h> |
| 12 | #include <base/string_util.h> |
| 13 | |
| 14 | #include "shill/arp_client.h" |
| 15 | #include "shill/arp_packet.h" |
| 16 | #include "shill/byte_string.h" |
Paul Stewart | 3f43f43 | 2012-07-16 12:12:45 -0700 | [diff] [blame] | 17 | #include "shill/connection.h" |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 18 | #include "shill/device_info.h" |
Paul Stewart | 3f43f43 | 2012-07-16 12:12:45 -0700 | [diff] [blame] | 19 | #include "shill/event_dispatcher.h" |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 20 | #include "shill/ip_address.h" |
Christopher Wiley | b691efd | 2012-08-09 13:51:51 -0700 | [diff] [blame] | 21 | #include "shill/logging.h" |
Paul Stewart | ff845fc | 2012-08-07 07:28:44 -0700 | [diff] [blame] | 22 | #include "shill/metrics.h" |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 23 | #include "shill/shill_time.h" |
| 24 | |
| 25 | using base::Bind; |
| 26 | using base::Unretained; |
| 27 | using std::string; |
Paul Stewart | 3f43f43 | 2012-07-16 12:12:45 -0700 | [diff] [blame] | 28 | |
| 29 | namespace shill { |
| 30 | |
mukesh agrawal | bb2231c | 2013-07-17 16:32:24 -0700 | [diff] [blame] | 31 | const int LinkMonitor::kDefaultTestPeriodMilliseconds = 5000; |
Paul Stewart | 036dba0 | 2012-08-07 12:34:41 -0700 | [diff] [blame] | 32 | const char LinkMonitor::kDefaultLinkMonitorTechnologies[] = "wifi"; |
Paul Stewart | f1961f8 | 2012-09-11 20:45:39 -0700 | [diff] [blame] | 33 | const int LinkMonitor::kFailureThreshold = 5; |
mukesh agrawal | bb2231c | 2013-07-17 16:32:24 -0700 | [diff] [blame] | 34 | const int LinkMonitor::kFastTestPeriodMilliseconds = 200; |
Paul Stewart | f1961f8 | 2012-09-11 20:45:39 -0700 | [diff] [blame] | 35 | const int LinkMonitor::kMaxResponseSampleFilterDepth = 5; |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 36 | |
Paul Stewart | 3f43f43 | 2012-07-16 12:12:45 -0700 | [diff] [blame] | 37 | LinkMonitor::LinkMonitor(const ConnectionRefPtr &connection, |
| 38 | EventDispatcher *dispatcher, |
Paul Stewart | ff845fc | 2012-08-07 07:28:44 -0700 | [diff] [blame] | 39 | Metrics *metrics, |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 40 | DeviceInfo *device_info, |
Paul Stewart | 3f43f43 | 2012-07-16 12:12:45 -0700 | [diff] [blame] | 41 | const FailureCallback &failure_callback) |
| 42 | : connection_(connection), |
| 43 | dispatcher_(dispatcher), |
Paul Stewart | ff845fc | 2012-08-07 07:28:44 -0700 | [diff] [blame] | 44 | metrics_(metrics), |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 45 | device_info_(device_info), |
Paul Stewart | 3f43f43 | 2012-07-16 12:12:45 -0700 | [diff] [blame] | 46 | failure_callback_(failure_callback), |
mukesh agrawal | bb2231c | 2013-07-17 16:32:24 -0700 | [diff] [blame] | 47 | test_period_milliseconds_(kDefaultTestPeriodMilliseconds), |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 48 | broadcast_failure_count_(0), |
| 49 | unicast_failure_count_(0), |
mukesh agrawal | bb2231c | 2013-07-17 16:32:24 -0700 | [diff] [blame] | 50 | broadcast_success_count_(0), |
| 51 | unicast_success_count_(0), |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 52 | is_unicast_(false), |
| 53 | response_sample_count_(0), |
| 54 | response_sample_bucket_(0), |
Paul Stewart | f1961f8 | 2012-09-11 20:45:39 -0700 | [diff] [blame] | 55 | time_(Time::GetInstance()) { |
| 56 | } |
Paul Stewart | 3f43f43 | 2012-07-16 12:12:45 -0700 | [diff] [blame] | 57 | |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 58 | LinkMonitor::~LinkMonitor() { |
| 59 | Stop(); |
| 60 | } |
Paul Stewart | 3f43f43 | 2012-07-16 12:12:45 -0700 | [diff] [blame] | 61 | |
| 62 | bool LinkMonitor::Start() { |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 63 | Stop(); |
mukesh agrawal | bb2231c | 2013-07-17 16:32:24 -0700 | [diff] [blame] | 64 | return StartInternal(kDefaultTestPeriodMilliseconds); |
| 65 | } |
| 66 | |
| 67 | bool LinkMonitor::StartInternal(int probe_period_milliseconds) { |
| 68 | test_period_milliseconds_ = probe_period_milliseconds; |
| 69 | if (test_period_milliseconds_ > kDefaultTestPeriodMilliseconds) { |
| 70 | LOG(WARNING) << "Long test period; UMA stats will be truncated."; |
| 71 | } |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 72 | |
| 73 | if (!device_info_->GetMACAddress( |
mukesh agrawal | bb2231c | 2013-07-17 16:32:24 -0700 | [diff] [blame] | 74 | connection_->interface_index(), &local_mac_address_)) { |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 75 | LOG(ERROR) << "Could not get local MAC address."; |
Paul Stewart | ff845fc | 2012-08-07 07:28:44 -0700 | [diff] [blame] | 76 | metrics_->NotifyLinkMonitorFailure( |
Paul Stewart | 0443aa5 | 2012-08-09 10:43:50 -0700 | [diff] [blame] | 77 | connection_->technology(), |
| 78 | Metrics::kLinkMonitorMacAddressNotFound, |
| 79 | 0, 0, 0); |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 80 | Stop(); |
| 81 | return false; |
| 82 | } |
mukesh agrawal | bb2231c | 2013-07-17 16:32:24 -0700 | [diff] [blame] | 83 | if (gateway_mac_address_.IsEmpty()) { |
| 84 | gateway_mac_address_ = ByteString(local_mac_address_.GetLength()); |
| 85 | } |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 86 | send_request_callback_.Reset( |
Paul Stewart | f1961f8 | 2012-09-11 20:45:39 -0700 | [diff] [blame] | 87 | Bind(base::IgnoreResult(&LinkMonitor::SendRequest), Unretained(this))); |
Paul Stewart | 0443aa5 | 2012-08-09 10:43:50 -0700 | [diff] [blame] | 88 | time_->GetTimeMonotonic(&started_monitoring_at_); |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 89 | return SendRequest(); |
Paul Stewart | 3f43f43 | 2012-07-16 12:12:45 -0700 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | void LinkMonitor::Stop() { |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 93 | SLOG(Link, 2) << "In " << __func__ << "."; |
| 94 | local_mac_address_.Clear(); |
| 95 | gateway_mac_address_.Clear(); |
| 96 | arp_client_.reset(); |
| 97 | broadcast_failure_count_ = 0; |
| 98 | unicast_failure_count_ = 0; |
mukesh agrawal | bb2231c | 2013-07-17 16:32:24 -0700 | [diff] [blame] | 99 | broadcast_success_count_ = 0; |
| 100 | unicast_success_count_ = 0; |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 101 | is_unicast_ = false; |
| 102 | response_sample_bucket_ = 0; |
| 103 | response_sample_count_ = 0; |
| 104 | receive_response_handler_.reset(); |
| 105 | send_request_callback_.Cancel(); |
Paul Stewart | 0443aa5 | 2012-08-09 10:43:50 -0700 | [diff] [blame] | 106 | timerclear(&started_monitoring_at_); |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 107 | timerclear(&sent_request_at_); |
| 108 | } |
| 109 | |
mukesh agrawal | bb2231c | 2013-07-17 16:32:24 -0700 | [diff] [blame] | 110 | void LinkMonitor::OnAfterResume() { |
| 111 | ByteString prior_gateway_mac_address(gateway_mac_address_); |
| 112 | Stop(); |
| 113 | gateway_mac_address_ = prior_gateway_mac_address; |
| 114 | StartInternal(kFastTestPeriodMilliseconds); |
| 115 | } |
| 116 | |
Paul Stewart | f1961f8 | 2012-09-11 20:45:39 -0700 | [diff] [blame] | 117 | int LinkMonitor::GetResponseTimeMilliseconds() const { |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 118 | return response_sample_count_ ? |
| 119 | response_sample_bucket_ / response_sample_count_ : 0; |
| 120 | } |
| 121 | |
Paul Stewart | f1961f8 | 2012-09-11 20:45:39 -0700 | [diff] [blame] | 122 | void LinkMonitor::AddResponseTimeSample(int response_time_milliseconds) { |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 123 | SLOG(Link, 2) << "In " << __func__ << " with sample " |
| 124 | << response_time_milliseconds << "."; |
Paul Stewart | ff845fc | 2012-08-07 07:28:44 -0700 | [diff] [blame] | 125 | metrics_->NotifyLinkMonitorResponseTimeSampleAdded( |
| 126 | connection_->technology(), response_time_milliseconds); |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 127 | response_sample_bucket_ += response_time_milliseconds; |
| 128 | if (response_sample_count_ < kMaxResponseSampleFilterDepth) { |
| 129 | ++response_sample_count_; |
| 130 | } else { |
| 131 | response_sample_bucket_ = |
| 132 | response_sample_bucket_ * kMaxResponseSampleFilterDepth / |
| 133 | (kMaxResponseSampleFilterDepth + 1); |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | // static |
| 138 | string LinkMonitor::HardwareAddressToString(const ByteString &address) { |
| 139 | std::vector<string> address_parts; |
| 140 | for (size_t i = 0; i < address.GetLength(); ++i) { |
| 141 | address_parts.push_back( |
| 142 | base::StringPrintf("%02x", address.GetConstData()[i])); |
| 143 | } |
| 144 | return JoinString(address_parts, ':'); |
| 145 | } |
| 146 | |
| 147 | bool LinkMonitor::CreateClient() { |
| 148 | arp_client_.reset(new ArpClient(connection_->interface_index())); |
| 149 | |
| 150 | if (!arp_client_->Start()) { |
Paul Stewart | ff845fc | 2012-08-07 07:28:44 -0700 | [diff] [blame] | 151 | return false; |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 152 | } |
Paul Stewart | 9f7823e | 2012-08-09 10:58:26 -0700 | [diff] [blame] | 153 | SLOG(Link, 4) << "Created ARP client; listening on socket " |
| 154 | << arp_client_->socket() << "."; |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 155 | receive_response_handler_.reset( |
| 156 | dispatcher_->CreateReadyHandler( |
| 157 | arp_client_->socket(), |
| 158 | IOHandler::kModeInput, |
| 159 | Bind(&LinkMonitor::ReceiveResponse, Unretained(this)))); |
| 160 | return true; |
| 161 | } |
| 162 | |
| 163 | bool LinkMonitor::AddMissedResponse() { |
| 164 | SLOG(Link, 2) << "In " << __func__ << "."; |
mukesh agrawal | bb2231c | 2013-07-17 16:32:24 -0700 | [diff] [blame] | 165 | AddResponseTimeSample(test_period_milliseconds_); |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 166 | |
| 167 | if (is_unicast_) { |
| 168 | ++unicast_failure_count_; |
mukesh agrawal | bb2231c | 2013-07-17 16:32:24 -0700 | [diff] [blame] | 169 | unicast_success_count_ = 0; |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 170 | } else { |
| 171 | ++broadcast_failure_count_; |
mukesh agrawal | bb2231c | 2013-07-17 16:32:24 -0700 | [diff] [blame] | 172 | broadcast_success_count_ = 0; |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | if (unicast_failure_count_ + broadcast_failure_count_ >= kFailureThreshold) { |
| 176 | LOG(ERROR) << "Link monitor has reached the failure threshold with " |
| 177 | << broadcast_failure_count_ |
| 178 | << " broadcast failures and " |
| 179 | << unicast_failure_count_ |
| 180 | << " unicast failures."; |
| 181 | failure_callback_.Run(); |
Paul Stewart | 0443aa5 | 2012-08-09 10:43:50 -0700 | [diff] [blame] | 182 | |
| 183 | struct timeval now, elapsed_time; |
| 184 | time_->GetTimeMonotonic(&now); |
| 185 | timersub(&now, &started_monitoring_at_, &elapsed_time); |
| 186 | |
Paul Stewart | ff845fc | 2012-08-07 07:28:44 -0700 | [diff] [blame] | 187 | metrics_->NotifyLinkMonitorFailure( |
| 188 | connection_->technology(), |
Paul Stewart | 0443aa5 | 2012-08-09 10:43:50 -0700 | [diff] [blame] | 189 | Metrics::kLinkMonitorFailureThresholdReached, |
| 190 | elapsed_time.tv_sec, |
| 191 | broadcast_failure_count_, |
| 192 | unicast_failure_count_); |
| 193 | |
| 194 | Stop(); |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 195 | return true; |
| 196 | } |
| 197 | is_unicast_ = !is_unicast_; |
| 198 | return false; |
| 199 | } |
| 200 | |
Paul Stewart | 9f7823e | 2012-08-09 10:58:26 -0700 | [diff] [blame] | 201 | bool LinkMonitor::IsGatewayFound() const { |
| 202 | return !gateway_mac_address_.IsZero(); |
| 203 | } |
| 204 | |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 205 | void LinkMonitor::ReceiveResponse(int fd) { |
| 206 | SLOG(Link, 2) << "In " << __func__ << "."; |
| 207 | ArpPacket packet; |
| 208 | ByteString sender; |
| 209 | if (!arp_client_->ReceiveReply(&packet, &sender)) { |
| 210 | return; |
| 211 | } |
| 212 | |
Paul Stewart | 9f7823e | 2012-08-09 10:58:26 -0700 | [diff] [blame] | 213 | if (!connection_->local().address().Equals( |
| 214 | packet.remote_ip_address().address())) { |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 215 | SLOG(Link, 4) << "Response is not for our IP address."; |
| 216 | return; |
| 217 | } |
| 218 | |
Paul Stewart | 9f7823e | 2012-08-09 10:58:26 -0700 | [diff] [blame] | 219 | if (!local_mac_address_.Equals(packet.remote_mac_address())) { |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 220 | SLOG(Link, 4) << "Response is not for our MAC address."; |
| 221 | return; |
| 222 | } |
| 223 | |
Paul Stewart | 9f7823e | 2012-08-09 10:58:26 -0700 | [diff] [blame] | 224 | if (!connection_->gateway().address().Equals( |
| 225 | packet.local_ip_address().address())) { |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 226 | SLOG(Link, 4) << "Response is not from the gateway IP address."; |
| 227 | return; |
| 228 | } |
| 229 | |
| 230 | struct timeval now, elapsed_time; |
| 231 | time_->GetTimeMonotonic(&now); |
| 232 | timersub(&now, &sent_request_at_, &elapsed_time); |
| 233 | |
| 234 | AddResponseTimeSample(elapsed_time.tv_sec * 1000 + |
| 235 | elapsed_time.tv_usec / 1000); |
| 236 | |
| 237 | receive_response_handler_.reset(); |
| 238 | arp_client_.reset(); |
| 239 | |
| 240 | if (is_unicast_) { |
mukesh agrawal | bb2231c | 2013-07-17 16:32:24 -0700 | [diff] [blame] | 241 | ++unicast_success_count_; |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 242 | unicast_failure_count_ = 0; |
| 243 | } else { |
mukesh agrawal | bb2231c | 2013-07-17 16:32:24 -0700 | [diff] [blame] | 244 | ++broadcast_success_count_; |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 245 | broadcast_failure_count_ = 0; |
| 246 | } |
| 247 | |
Paul Stewart | 9f7823e | 2012-08-09 10:58:26 -0700 | [diff] [blame] | 248 | if (!gateway_mac_address_.Equals(packet.local_mac_address())) { |
| 249 | const ByteString &new_mac_address = packet.local_mac_address(); |
| 250 | if (!IsGatewayFound()) { |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 251 | SLOG(Link, 2) << "Found gateway at " |
| 252 | << HardwareAddressToString(new_mac_address); |
| 253 | } else { |
| 254 | SLOG(Link, 2) << "Gateway MAC address changed."; |
| 255 | } |
| 256 | gateway_mac_address_ = new_mac_address; |
| 257 | } |
| 258 | |
| 259 | is_unicast_ = !is_unicast_; |
mukesh agrawal | bb2231c | 2013-07-17 16:32:24 -0700 | [diff] [blame] | 260 | if (unicast_success_count_ && broadcast_success_count_) { |
| 261 | test_period_milliseconds_ = kDefaultTestPeriodMilliseconds; |
| 262 | } |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 263 | } |
| 264 | |
| 265 | bool LinkMonitor::SendRequest() { |
| 266 | SLOG(Link, 2) << "In " << __func__ << "."; |
| 267 | if (!arp_client_.get()) { |
| 268 | if (!CreateClient()) { |
| 269 | LOG(ERROR) << "Failed to start ARP client."; |
| 270 | Stop(); |
Paul Stewart | ff845fc | 2012-08-07 07:28:44 -0700 | [diff] [blame] | 271 | metrics_->NotifyLinkMonitorFailure( |
Paul Stewart | 0443aa5 | 2012-08-09 10:43:50 -0700 | [diff] [blame] | 272 | connection_->technology(), |
| 273 | Metrics::kLinkMonitorClientStartFailure, |
| 274 | 0, 0, 0); |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 275 | return false; |
| 276 | } |
| 277 | } else if (AddMissedResponse()) { |
| 278 | // If an ARP client is still listening, this means we have timed |
| 279 | // out reception of the ARP reply. |
| 280 | return false; |
| 281 | } else { |
| 282 | // We already have an ArpClient instance running. These aren't |
| 283 | // bound sockets in the conventional sense, and we cannot distinguish |
| 284 | // which request (from which trial, or even from which component |
| 285 | // in the local system) an ARP reply was sent in response to. |
| 286 | // Therefore we keep the already open ArpClient in the case of |
| 287 | // a non-fatal timeout. |
| 288 | } |
| 289 | |
| 290 | ByteString destination_mac_address(gateway_mac_address_.GetLength()); |
Paul Stewart | 9f7823e | 2012-08-09 10:58:26 -0700 | [diff] [blame] | 291 | if (!IsGatewayFound()) { |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 292 | // The remote MAC addess is set by convention to be all-zeroes in the |
| 293 | // ARP header if not known. The ArpClient will translate an all-zeroes |
| 294 | // remote address into a send to the broadcast (all-ones) address in |
| 295 | // the Ethernet frame header. |
| 296 | SLOG_IF(Link, 2, is_unicast_) << "Sending broadcast since " |
| 297 | << "gateway MAC is unknown"; |
| 298 | is_unicast_ = false; |
| 299 | } else if (is_unicast_) { |
| 300 | destination_mac_address = gateway_mac_address_; |
| 301 | } |
| 302 | |
| 303 | ArpPacket request(connection_->local(), connection_->gateway(), |
| 304 | local_mac_address_, destination_mac_address); |
| 305 | if (!arp_client_->TransmitRequest(request)) { |
| 306 | LOG(ERROR) << "Failed to send ARP request. Stopping."; |
| 307 | Stop(); |
Paul Stewart | ff845fc | 2012-08-07 07:28:44 -0700 | [diff] [blame] | 308 | metrics_->NotifyLinkMonitorFailure( |
Paul Stewart | 0443aa5 | 2012-08-09 10:43:50 -0700 | [diff] [blame] | 309 | connection_->technology(), Metrics::kLinkMonitorTransmitFailure, |
| 310 | 0, 0, 0); |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 311 | return false; |
| 312 | } |
| 313 | |
| 314 | time_->GetTimeMonotonic(&sent_request_at_); |
| 315 | |
| 316 | dispatcher_->PostDelayedTask(send_request_callback_.callback(), |
mukesh agrawal | bb2231c | 2013-07-17 16:32:24 -0700 | [diff] [blame] | 317 | test_period_milliseconds_); |
Paul Stewart | 6c72c97 | 2012-07-27 11:29:20 -0700 | [diff] [blame] | 318 | return true; |
| 319 | } |
| 320 | |
Paul Stewart | 3f43f43 | 2012-07-16 12:12:45 -0700 | [diff] [blame] | 321 | } // namespace shill |