blob: ba897e60078d4dc85deadf0c43a2fff304aa21d6 [file] [log] [blame]
// Copyright 2015 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_ARP_CLIENT_TEST_HELPER_H_
#define SHILL_ARP_CLIENT_TEST_HELPER_H_
#include <base/macros.h>
#include "shill/arp_packet.h"
#include "shill/mock_arp_client.h"
#include "shill/net/byte_string.h"
#include "shill/net/ip_address.h"
namespace shill {
// Class for simulate ARP client receiving ARP packets for unit test purpose.
class ArpClientTestHelper {
public:
explicit ArpClientTestHelper(MockArpClient *client);
virtual ~ArpClientTestHelper();
void GeneratePacket(uint16_t operation,
const IPAddress &local_ip,
const ByteString &local_mac,
const IPAddress &remote_ip,
const ByteString &remote_mac);
private:
bool SimulateReceivePacket(ArpPacket *packet, ByteString *sender);
MockArpClient *client_;
ArpPacket packet_;
DISALLOW_COPY_AND_ASSIGN(ArpClientTestHelper);
};
} // namespace shill
#endif // SHILL_ARP_CLIENT_TEST_HELPER_H_