blob: fa7a61e6bc5b26193514cea791dd12b37ed3e5a8 [file] [log] [blame]
Thieu Lecaef8932012-02-28 16:06:59 -08001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Paul Stewartdd60e452011-08-08 11:38:36 -07002// 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 Petkoveac68e62011-08-26 16:24:51 -07008#include <base/basictypes.h>
Paul Stewartdd60e452011-08-08 11:38:36 -07009#include <gmock/gmock.h>
10
11#include "shill/routing_table.h"
12
13namespace shill {
14
15class MockRoutingTable : public RoutingTable {
16 public:
Darin Petkoveac68e62011-08-26 16:24:51 -070017 MockRoutingTable();
18 virtual ~MockRoutingTable();
19
Paul Stewartdd60e452011-08-08 11:38:36 -070020 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 Stewart5b7ba8c2012-04-18 09:08:00 -070028 const IPAddress &gateway_address,
Paul Stewartdd60e452011-08-08 11:38:36 -070029 uint32 metric));
Paul Stewart3f68bb12012-03-15 13:33:10 -070030 MOCK_METHOD3(ConfigureRoutes, bool(int interface_index,
31 const IPConfigRefPtr &ipconfig,
32 uint32 metric));
Ben Chana0163122012-09-25 15:10:52 -070033 MOCK_METHOD3(CreateBlackholeRoute, bool(int interface_index,
Ben Chana6bfe872012-09-26 09:48:34 -070034 IPAddress::Family family,
Ben Chana0163122012-09-25 15:10:52 -070035 uint32 metric));
Paul Stewart4a6748d2012-07-17 14:31:36 -070036 MOCK_METHOD3(CreateLinkRoute, bool(int interface_index,
37 const IPAddress &local_address,
38 const IPAddress &remote_address));
Thieu Lefb46caf2012-03-08 11:57:15 -080039 MOCK_METHOD1(FlushRoutes, void(int interface_index));
Paul Stewarte93b0382012-04-24 13:11:28 -070040 MOCK_METHOD1(FlushRoutesWithTag, void(int tag));
Paul Stewartc8f4bef2011-12-13 09:45:51 -080041 MOCK_METHOD0(FlushCache, bool());
Paul Stewartdd60e452011-08-08 11:38:36 -070042 MOCK_METHOD1(ResetTable, void(int interface_index));
43 MOCK_METHOD2(SetDefaultMetric, void(int interface_index, uint32 metric));
Darin Petkovabf6d282012-05-08 15:49:05 +020044 MOCK_METHOD4(RequestRouteToHost, bool(const IPAddress &addresss,
Paul Stewarte93b0382012-04-24 13:11:28 -070045 int interface_index,
Darin Petkovabf6d282012-05-08 15:49:05 +020046 int tag,
47 const Query::Callback &callback));
Darin Petkoveac68e62011-08-26 16:24:51 -070048
49 private:
50 DISALLOW_COPY_AND_ASSIGN(MockRoutingTable);
Paul Stewartdd60e452011-08-08 11:38:36 -070051};
52
53} // namespace shill
54
55#endif // SHILL_MOCK_ROUTING_TABLE_H_