Thieu Le | caef893 | 2012-02-28 16:06:59 -0800 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 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 SHILL_MOCK_ROUTING_TABLE_H_ |
| 6 | #define SHILL_MOCK_ROUTING_TABLE_H_ |
| 7 | |
Darin Petkov | eac68e6 | 2011-08-26 16:24:51 -0700 | [diff] [blame] | 8 | #include <base/basictypes.h> |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 9 | #include <gmock/gmock.h> |
| 10 | |
| 11 | #include "shill/routing_table.h" |
| 12 | |
| 13 | namespace shill { |
| 14 | |
| 15 | class MockRoutingTable : public RoutingTable { |
| 16 | public: |
Darin Petkov | eac68e6 | 2011-08-26 16:24:51 -0700 | [diff] [blame] | 17 | MockRoutingTable(); |
| 18 | virtual ~MockRoutingTable(); |
| 19 | |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 20 | MOCK_METHOD0(Start, void()); |
| 21 | MOCK_METHOD0(Stop, void()); |
| 22 | MOCK_METHOD2(AddRoute, bool(int interface_index, |
| 23 | const RoutingTableEntry &entry)); |
| 24 | MOCK_METHOD3(GetDefaultRoute, bool(int interface_index, |
| 25 | IPAddress::Family family, |
| 26 | RoutingTableEntry *entry)); |
| 27 | MOCK_METHOD3(SetDefaultRoute, bool(int interface_index, |
Paul Stewart | 5b7ba8c | 2012-04-18 09:08:00 -0700 | [diff] [blame] | 28 | const IPAddress &gateway_address, |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 29 | uint32 metric)); |
Paul Stewart | 3f68bb1 | 2012-03-15 13:33:10 -0700 | [diff] [blame] | 30 | MOCK_METHOD3(ConfigureRoutes, bool(int interface_index, |
| 31 | const IPConfigRefPtr &ipconfig, |
| 32 | uint32 metric)); |
Ben Chan | a016312 | 2012-09-25 15:10:52 -0700 | [diff] [blame] | 33 | MOCK_METHOD3(CreateBlackholeRoute, bool(int interface_index, |
Ben Chan | a6bfe87 | 2012-09-26 09:48:34 -0700 | [diff] [blame] | 34 | IPAddress::Family family, |
Ben Chan | a016312 | 2012-09-25 15:10:52 -0700 | [diff] [blame] | 35 | uint32 metric)); |
Paul Stewart | 4a6748d | 2012-07-17 14:31:36 -0700 | [diff] [blame] | 36 | MOCK_METHOD3(CreateLinkRoute, bool(int interface_index, |
| 37 | const IPAddress &local_address, |
| 38 | const IPAddress &remote_address)); |
Thieu Le | fb46caf | 2012-03-08 11:57:15 -0800 | [diff] [blame] | 39 | MOCK_METHOD1(FlushRoutes, void(int interface_index)); |
Paul Stewart | e93b038 | 2012-04-24 13:11:28 -0700 | [diff] [blame] | 40 | MOCK_METHOD1(FlushRoutesWithTag, void(int tag)); |
Paul Stewart | c8f4bef | 2011-12-13 09:45:51 -0800 | [diff] [blame] | 41 | MOCK_METHOD0(FlushCache, bool()); |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 42 | MOCK_METHOD1(ResetTable, void(int interface_index)); |
| 43 | MOCK_METHOD2(SetDefaultMetric, void(int interface_index, uint32 metric)); |
Darin Petkov | abf6d28 | 2012-05-08 15:49:05 +0200 | [diff] [blame] | 44 | MOCK_METHOD4(RequestRouteToHost, bool(const IPAddress &addresss, |
Paul Stewart | e93b038 | 2012-04-24 13:11:28 -0700 | [diff] [blame] | 45 | int interface_index, |
Darin Petkov | abf6d28 | 2012-05-08 15:49:05 +0200 | [diff] [blame] | 46 | int tag, |
| 47 | const Query::Callback &callback)); |
Darin Petkov | eac68e6 | 2011-08-26 16:24:51 -0700 | [diff] [blame] | 48 | |
| 49 | private: |
| 50 | DISALLOW_COPY_AND_ASSIGN(MockRoutingTable); |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | } // namespace shill |
| 54 | |
| 55 | #endif // SHILL_MOCK_ROUTING_TABLE_H_ |