shill: LinkMonitor: Add ArpClient code
Add ArpClient class and start hooking it up to LinkMonitor.
BUG=chromium-os:32600
TEST=Unit tests. Some real-world testing using the test harness
to transmit and receive ARP on a real network.
Change-Id: Ic05d8d7eb921878e3776f35b4be285554ef86456
Reviewed-on: https://gerrit.chromium.org/gerrit/28148
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/mock_arp_client.h b/mock_arp_client.h
new file mode 100644
index 0000000..7c59a90
--- /dev/null
+++ b/mock_arp_client.h
@@ -0,0 +1,34 @@
+// Copyright (c) 2012 The Chromium OS 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 SHILL_MOCK_ARP_CLIENT_H_
+#define SHILL_MOCK_ARP_CLIENT_H_
+
+#include "shill/arp_client.h"
+
+#include <gmock/gmock.h>
+
+#include "shill/arp_packet.h"
+#include "shill/byte_string.h"
+
+namespace shill {
+
+class MockArpClient : public ArpClient {
+ public:
+ MockArpClient();
+ virtual ~MockArpClient();
+
+ MOCK_METHOD0(Start, bool());
+ MOCK_METHOD0(Stop, void());
+ MOCK_CONST_METHOD2(ReceiveReply, bool(ArpPacket *packet, ByteString *sender));
+ MOCK_CONST_METHOD1(TransmitRequest, bool(const ArpPacket &packet));
+ MOCK_CONST_METHOD0(socket, int());
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MockArpClient);
+};
+
+} // namespace shill
+
+#endif // SHILL_MOCK_ARP_CLIENT_H_