Paul Stewart | 8c116a9 | 2012-05-02 18:30:03 -0700 | [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_RTNL_HANDLER_H_ |
| 6 | #define SHILL_MOCK_RTNL_HANDLER_H_ |
| 7 | |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Darin Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 10 | #include <base/basictypes.h> |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 11 | #include <gmock/gmock.h> |
| 12 | |
| 13 | #include "shill/rtnl_handler.h" |
| 14 | |
| 15 | namespace shill { |
| 16 | |
| 17 | class MockRTNLHandler : public RTNLHandler { |
| 18 | public: |
Darin Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 19 | MockRTNLHandler(); |
| 20 | virtual ~MockRTNLHandler(); |
| 21 | |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 22 | 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 Stewart | 48100b0 | 2012-03-19 07:53:52 -0700 | [diff] [blame] | 28 | MOCK_METHOD4(AddInterfaceAddress, bool(int interface_index, |
Paul Stewart | 9a90808 | 2011-08-31 12:18:48 -0700 | [diff] [blame] | 29 | const IPAddress &local, |
Paul Stewart | 48100b0 | 2012-03-19 07:53:52 -0700 | [diff] [blame] | 30 | const IPAddress &broadcast, |
| 31 | const IPAddress &peer)); |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 32 | MOCK_METHOD2(RemoveInterfaceAddress, bool(int interface_index, |
Paul Stewart | 9a90808 | 2011-08-31 12:18:48 -0700 | [diff] [blame] | 33 | const IPAddress &local)); |
Paul Stewart | 8c116a9 | 2012-05-02 18:30:03 -0700 | [diff] [blame] | 34 | MOCK_METHOD1(RemoveInterface, bool(int interface_index)); |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 35 | 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 Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 38 | |
| 39 | private: |
| 40 | DISALLOW_COPY_AND_ASSIGN(MockRTNLHandler); |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | } // namespace shill |
| 44 | |
| 45 | #endif // SHILL_MOCK_RTNL_HANDLER_H_ |