aboutsummaryrefslogtreecommitdiff
path: root/osp/impl/testing/fake_mdns_platform_service.h
blob: a21c48cddd7b3e2a21d3e32a900f447792c2f462 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// 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 OSP_IMPL_TESTING_FAKE_MDNS_PLATFORM_SERVICE_H_
#define OSP_IMPL_TESTING_FAKE_MDNS_PLATFORM_SERVICE_H_

#include <vector>

#include "osp/impl/mdns_platform_service.h"

namespace openscreen {
namespace osp {

class FakeMdnsPlatformService final : public MdnsPlatformService {
 public:
  FakeMdnsPlatformService();
  ~FakeMdnsPlatformService() override;

  void set_interfaces(const std::vector<BoundInterface>& interfaces) {
    interfaces_ = interfaces;
  }

  // PlatformService overrides.
  std::vector<BoundInterface> RegisterInterfaces(
      const std::vector<NetworkInterfaceIndex>& interface_index_allowlist)
      override;
  void DeregisterInterfaces(
      const std::vector<BoundInterface>& registered_interfaces) override;

 private:
  std::vector<BoundInterface> registered_interfaces_;
  std::vector<BoundInterface> interfaces_;
};

}  // namespace osp
}  // namespace openscreen

#endif  // OSP_IMPL_TESTING_FAKE_MDNS_PLATFORM_SERVICE_H_