Commit 3bc094ac authored by Bailey Berro's avatar Bailey Berro Committed by Commit Bot

Create NetBiosClientInterface

This change creates the NetBiosClientInterface. This interface will allow
us to create a FakeNetBiosClient that can be injected into the
NetBiosHostLocator class for testing.

Bug: chromium:757625
Change-Id: Iadf5965ce43a504f5babe2220944d91b48b9d537
Reviewed-on: https://chromium-review.googlesource.com/1081299
Commit-Queue: Bailey Berro <baileyberro@chromium.org>
Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565375}
parent da82abe2
// Copyright 2018 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 CHROME_BROWSER_CHROMEOS_SMB_CLIENT_DISCOVERY_NETBIOS_CLIENT_INTERFACE_H_
#define CHROME_BROWSER_CHROMEOS_SMB_CLIENT_DISCOVERY_NETBIOS_CLIENT_INTERFACE_H_
#include <vector>
#include "base/callback.h"
#include "base/macros.h"
namespace net {
class IPAddress;
class IPEndPoint;
} // namespace net
namespace chromeos {
namespace smb_client {
using NetBiosResponseCallback = base::RepeatingCallback<
void(const std::vector<uint8_t>&, uint16_t, const net::IPEndPoint&)>;
class NetBiosClientInterface {
public:
virtual ~NetBiosClientInterface() = default;
// Starts the Name Query Request process. Any response packets that match
// |transaction_id| are passed to |callback|.
virtual void ExecuteNameRequest(const net::IPAddress& broadcast_address,
uint16_t transaction_id,
NetBiosResponseCallback callback) = 0;
protected:
NetBiosClientInterface() = default;
DISALLOW_COPY_AND_ASSIGN(NetBiosClientInterface);
};
} // namespace smb_client
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_SMB_CLIENT_DISCOVERY_NETBIOS_CLIENT_INTERFACE_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment