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)); |
Paul Stewart | 4a6748d | 2012-07-17 14:31:36 -0700 | [diff] [blame] | 33 | MOCK_METHOD3(CreateLinkRoute, bool(int interface_index, |
| 34 | const IPAddress &local_address, |
| 35 | const IPAddress &remote_address)); |
Thieu Le | fb46caf | 2012-03-08 11:57:15 -0800 | [diff] [blame] | 36 | MOCK_METHOD1(FlushRoutes, void(int interface_index)); |
Paul Stewart | e93b038 | 2012-04-24 13:11:28 -0700 | [diff] [blame] | 37 | MOCK_METHOD1(FlushRoutesWithTag, void(int tag)); |
Paul Stewart | c8f4bef | 2011-12-13 09:45:51 -0800 | [diff] [blame] | 38 | MOCK_METHOD0(FlushCache, bool()); |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 39 | MOCK_METHOD1(ResetTable, void(int interface_index)); |
| 40 | MOCK_METHOD2(SetDefaultMetric, void(int interface_index, uint32 metric)); |
Darin Petkov | abf6d28 | 2012-05-08 15:49:05 +0200 | [diff] [blame] | 41 | MOCK_METHOD4(RequestRouteToHost, bool(const IPAddress &addresss, |
Paul Stewart | e93b038 | 2012-04-24 13:11:28 -0700 | [diff] [blame] | 42 | int interface_index, |
Darin Petkov | abf6d28 | 2012-05-08 15:49:05 +0200 | [diff] [blame] | 43 | int tag, |
| 44 | const Query::Callback &callback)); |
Darin Petkov | eac68e6 | 2011-08-26 16:24:51 -0700 | [diff] [blame] | 45 | |
| 46 | private: |
| 47 | DISALLOW_COPY_AND_ASSIGN(MockRoutingTable); |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | } // namespace shill |
| 51 | |
| 52 | #endif // SHILL_MOCK_ROUTING_TABLE_H_ |