1 // Copyright 2018 The Chromium 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 #ifndef CHROME_BROWSER_CHROMEOS_SMB_CLIENT_DISCOVERY_NETBIOS_CLIENT_INTERFACE_H_
6 #define CHROME_BROWSER_CHROMEOS_SMB_CLIENT_DISCOVERY_NETBIOS_CLIENT_INTERFACE_H_
7 
8 #include <vector>
9 
10 #include "base/callback.h"
11 #include "base/macros.h"
12 
13 namespace net {
14 
15 class IPAddress;
16 class IPEndPoint;
17 
18 }  // namespace net
19 
20 namespace chromeos {
21 namespace smb_client {
22 
23 using NetBiosResponseCallback = base::RepeatingCallback<
24     void(const std::vector<uint8_t>&, uint16_t, const net::IPEndPoint&)>;
25 
26 class NetBiosClientInterface {
27  public:
28   virtual ~NetBiosClientInterface() = default;
29 
30   // Starts the Name Query Request process. Any response packets that match
31   // |transaction_id| are passed to |callback|.
32   virtual void ExecuteNameRequest(const net::IPAddress& broadcast_address,
33                                   uint16_t transaction_id,
34                                   NetBiosResponseCallback callback) = 0;
35 
36  protected:
37   NetBiosClientInterface() = default;
38 
39   DISALLOW_COPY_AND_ASSIGN(NetBiosClientInterface);
40 };
41 
42 }  // namespace smb_client
43 }  // namespace chromeos
44 
45 #endif  // CHROME_BROWSER_CHROMEOS_SMB_CLIENT_DISCOVERY_NETBIOS_CLIENT_INTERFACE_H_
46