blob: eff4fc10627a296d79fcaade227a69941e6991f3 [file] [log] [blame]
Paul Stewart8c116a92012-05-02 18:30:03 -07001// 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_RTNL_HANDLER_H_
6#define SHILL_MOCK_RTNL_HANDLER_H_
7
Hristo Stefanoved2c28c2011-11-29 15:37:30 -08008#include <string>
9
Darin Petkovef34f182011-08-26 14:14:40 -070010#include <base/basictypes.h>
Paul Stewartdd60e452011-08-08 11:38:36 -070011#include <gmock/gmock.h>
12
13#include "shill/rtnl_handler.h"
14
15namespace shill {
16
17class MockRTNLHandler : public RTNLHandler {
18 public:
Darin Petkovef34f182011-08-26 14:14:40 -070019 MockRTNLHandler();
20 virtual ~MockRTNLHandler();
21
Paul Stewartdd60e452011-08-08 11:38:36 -070022 MOCK_METHOD2(Start, void(EventDispatcher *dispatcher, Sockets *sockets));
23 MOCK_METHOD1(AddListener, void(RTNLListener *to_add));
24 MOCK_METHOD1(RemoveListener, void(RTNLListener *to_remove));
25 MOCK_METHOD3(SetInterfaceFlags, void(int interface_index,
26 unsigned int flags,
27 unsigned int change));
Paul Stewart48100b02012-03-19 07:53:52 -070028 MOCK_METHOD4(AddInterfaceAddress, bool(int interface_index,
Paul Stewart9a908082011-08-31 12:18:48 -070029 const IPAddress &local,
Paul Stewart48100b02012-03-19 07:53:52 -070030 const IPAddress &broadcast,
31 const IPAddress &peer));
Paul Stewartdd60e452011-08-08 11:38:36 -070032 MOCK_METHOD2(RemoveInterfaceAddress, bool(int interface_index,
Paul Stewart9a908082011-08-31 12:18:48 -070033 const IPAddress &local));
Paul Stewart8c116a92012-05-02 18:30:03 -070034 MOCK_METHOD1(RemoveInterface, bool(int interface_index));
Paul Stewartdd60e452011-08-08 11:38:36 -070035 MOCK_METHOD1(RequestDump, void(int request_flags));
36 MOCK_METHOD1(GetInterfaceIndex, int(const std::string &interface_name));
37 MOCK_METHOD1(SendMessage, bool(RTNLMessage *message));
Darin Petkovef34f182011-08-26 14:14:40 -070038
39 private:
40 DISALLOW_COPY_AND_ASSIGN(MockRTNLHandler);
Paul Stewartdd60e452011-08-08 11:38:36 -070041};
42
43} // namespace shill
44
45#endif // SHILL_MOCK_RTNL_HANDLER_H_