Garrick Evans | f0ab713 | 2019-06-18 14:50:42 +0900 | [diff] [blame] | 1 | // Copyright 2019 The Chromium OS 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 ARC_NETWORK_MOCK_DATAPATH_H_ |
| 6 | #define ARC_NETWORK_MOCK_DATAPATH_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include <base/macros.h> |
| 11 | |
| 12 | #include "arc/network/minijailed_process_runner.h" |
| 13 | |
| 14 | namespace arc_networkd { |
| 15 | |
| 16 | // ARC networking data path configuration utility. |
| 17 | class MockDatapath : public Datapath { |
| 18 | public: |
| 19 | explicit MockDatapath(MinijailedProcessRunner* runner) : Datapath(runner) {} |
| 20 | ~MockDatapath() = default; |
| 21 | |
Yuichiro Hanada | ed427fd | 2019-09-25 08:41:21 +0000 | [diff] [blame] | 22 | MOCK_METHOD2(AddBridge, |
| 23 | bool(const std::string& ifname, const std::string& ipv4_addr)); |
| 24 | MOCK_METHOD1(RemoveBridge, void(const std::string& ifname)); |
Long Cheng | 494fc98 | 2019-09-24 19:09:03 +0000 | [diff] [blame] | 25 | |
Yuichiro Hanada | ed427fd | 2019-09-25 08:41:21 +0000 | [diff] [blame] | 26 | MOCK_METHOD1(AddLegacyIPv4DNAT, bool(const std::string& ipv4_addr)); |
| 27 | MOCK_METHOD0(RemoveLegacyIPv4DNAT, void()); |
| 28 | MOCK_METHOD2(AddInboundIPv4DNAT, |
| 29 | bool(const std::string& ifname, const std::string& ipv4_addr)); |
| 30 | MOCK_METHOD2(RemoveInboundIPv4DNAT, |
| 31 | void(const std::string& ifname, const std::string& ipv4_addr)); |
| 32 | MOCK_METHOD1(AddOutboundIPv4, bool(const std::string& ifname)); |
| 33 | MOCK_METHOD1(RemoveOutboundIPv4, void(const std::string& ifname)); |
Garrick Evans | f0ab713 | 2019-06-18 14:50:42 +0900 | [diff] [blame] | 34 | |
| 35 | private: |
| 36 | DISALLOW_COPY_AND_ASSIGN(MockDatapath); |
| 37 | }; |
| 38 | |
| 39 | } // namespace arc_networkd |
| 40 | |
| 41 | #endif // ARC_NETWORK_MOCK_DATAPATH_H_ |