Index: chromeos/dbus/icmp_packet_sender.h |
diff --git a/chromeos/dbus/icmp_packet_sender.h b/chromeos/dbus/icmp_packet_sender.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..97a0b0d10efad58890ef1494b2cc4ce87d6bfbb5 |
--- /dev/null |
+++ b/chromeos/dbus/icmp_packet_sender.h |
@@ -0,0 +1,36 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROMEOS_DBUS_ICMP_PACKET_SENDER_H_ |
+#define CHROMEOS_DBUS_ICMP_PACKET_SENDER_H_ |
+ |
+#include <string> |
+ |
+#include "base/callback.h" |
+#include "chromeos/chromeos_export.h" |
+ |
+namespace chromeos { |
+ |
+class CHROMEOS_EXPORT ICMPPacketSender { |
+ public: |
+ typedef base::Callback<void(bool succeeded, |
+ const std::string& ip, |
+ double latency)> SendCallback; |
+ ICMPPacketSender(); |
+ ~ICMPPacketSender(); |
+ |
+ // Send ICMP packet with given parameters. |
+ // Pass NULL for omitted argument. |
stevenjb
2013/06/17 17:24:24
s/Send/Sends/
s/Pass/Passes/
s/argument/arguments/
Bei Zhang
2013/06/18 18:00:41
Done.
|
+ void Send(const std::string& ip, int* ttl, int* timeout, int* size, |
stevenjb
2013/06/17 17:24:24
Use const int* for optional input parameters.
Bei Zhang
2013/06/18 18:00:41
Done.
|
+ const SendCallback& callback); |
stevenjb
2013/06/17 17:24:24
One parameter per line
Bei Zhang
2013/06/18 18:00:41
Done.
|
+ |
+ static ICMPPacketSender* GetInstance(); |
stevenjb
2013/06/17 17:24:24
nit: blank line
Bei Zhang
2013/06/18 18:00:41
Done.
|
+ private: |
+ void OnSend(const SendCallback& callback, |
+ bool succeeded, const std::string& reply); |
stevenjb
2013/06/17 17:24:24
One param per line (but see note about making this
Bei Zhang
2013/06/18 18:00:41
Done.
|
+}; |
+ |
+} // namespace chromeos |
+ |
+#endif // CHROMEOS_DBUS_ICMP_PACKET_SENDER_H_ |