Home | History | Annotate | Download | only in net
      1 //
      2 // Copyright (C) 2013 The Android Open Source Project
      3 //
      4 // Licensed under the Apache License, Version 2.0 (the "License");
      5 // you may not use this file except in compliance with the License.
      6 // You may obtain a copy of the License at
      7 //
      8 //      http://www.apache.org/licenses/LICENSE-2.0
      9 //
     10 // Unless required by applicable law or agreed to in writing, software
     11 // distributed under the License is distributed on an "AS IS" BASIS,
     12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 // See the License for the specific language governing permissions and
     14 // limitations under the License.
     15 //
     16 
     17 #ifndef SHILL_NET_MOCK_NETLINK_MANAGER_H_
     18 #define SHILL_NET_MOCK_NETLINK_MANAGER_H_
     19 
     20 #include "shill/net/netlink_manager.h"
     21 
     22 #include <map>
     23 #include <string>
     24 
     25 #include <gmock/gmock.h>
     26 
     27 namespace shill {
     28 
     29 class NetlinkMessage;
     30 
     31 class MockNetlinkManager : public NetlinkManager {
     32  public:
     33   MockNetlinkManager() {}
     34   ~MockNetlinkManager() override {}
     35 
     36   MOCK_METHOD0(Init, bool());
     37   MOCK_METHOD0(Start, void());
     38   MOCK_METHOD2(
     39       GetFamily,
     40       uint16_t(const std::string& family_name,
     41                const NetlinkMessageFactory::FactoryMethod& message_factory));
     42   MOCK_METHOD1(RemoveBroadcastHandler,
     43                bool(const NetlinkMessageHandler& message_handler));
     44   MOCK_METHOD1(AddBroadcastHandler,
     45                bool(const NetlinkMessageHandler& messge_handler));
     46   MOCK_METHOD4(SendControlMessage,
     47                bool(ControlNetlinkMessage* message,
     48                     const ControlNetlinkMessageHandler& message_handler,
     49                     const NetlinkAckHandler& ack_handler,
     50                     const NetlinkAuxilliaryMessageHandler& error_handler));
     51   MOCK_METHOD4(SendNl80211Message,
     52                bool(Nl80211Message* message,
     53                     const Nl80211MessageHandler& message_handler,
     54                     const NetlinkAckHandler& ack_handler,
     55                     const NetlinkAuxilliaryMessageHandler& error_handler));
     56   MOCK_METHOD2(SubscribeToEvents,
     57                bool(const std::string& family, const std::string& group));
     58 
     59  private:
     60   DISALLOW_COPY_AND_ASSIGN(MockNetlinkManager);
     61 };
     62 
     63 }  // namespace shill
     64 
     65 #endif  // SHILL_NET_MOCK_NETLINK_MANAGER_H_
     66