blob: f456b31cfb21b44f40c6f06ab5751573f08be4e7 [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));
Paul Stewart4a6748d2012-07-17 14:31:36 -070033 MOCK_METHOD3(CreateLinkRoute, bool(int interface_index,
34 const IPAddress &local_address,
35 const IPAddress &remote_address));
Thieu Lefb46caf2012-03-08 11:57:15 -080036 MOCK_METHOD1(FlushRoutes, void(int interface_index));
Paul Stewarte93b0382012-04-24 13:11:28 -070037 MOCK_METHOD1(FlushRoutesWithTag, void(int tag));
Paul Stewartc8f4bef2011-12-13 09:45:51 -080038 MOCK_METHOD0(FlushCache, bool());
Paul Stewartdd60e452011-08-08 11:38:36 -070039 MOCK_METHOD1(ResetTable, void(int interface_index));
40 MOCK_METHOD2(SetDefaultMetric, void(int interface_index, uint32 metric));
Darin Petkovabf6d282012-05-08 15:49:05 +020041 MOCK_METHOD4(RequestRouteToHost, bool(const IPAddress &addresss,
Paul Stewarte93b0382012-04-24 13:11:28 -070042 int interface_index,
Darin Petkovabf6d282012-05-08 15:49:05 +020043 int tag,
44 const Query::Callback &callback));
Darin Petkoveac68e62011-08-26 16:24:51 -070045
46 private:
47 DISALLOW_COPY_AND_ASSIGN(MockRoutingTable);
Paul Stewartdd60e452011-08-08 11:38:36 -070048};
49
50} // namespace shill
51
52#endif // SHILL_MOCK_ROUTING_TABLE_H_