blob: 51081d094b2f933724a9d0334d261bfdd09b09b2 [file] [log] [blame]
Wade Guthrie0d438532012-05-18 14:18:50 -07001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
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_NL80211_SOCKET_
6#define SHILL_MOCK_NL80211_SOCKET_
7
8#include <gmock/gmock.h>
9
10#include <netlink/attr.h>
11#include <netlink/netlink.h>
12
13#include <string>
14
15#include "shill/nl80211_socket.h"
16
17
18namespace shill {
19
20class MockNl80211Socket : public Nl80211Socket {
21 public:
Christopher Wiley393b93f2012-11-08 17:30:58 -080022 MockNl80211Socket() : sequence_number_(1) {}
Wade Guthrie0d438532012-05-18 14:18:50 -070023 MOCK_METHOD0(Init, bool());
24 MOCK_METHOD1(AddGroupMembership, bool(const std::string &group_name));
Wade Guthrie0d438532012-05-18 14:18:50 -070025 using Nl80211Socket::GetMessages;
26 MOCK_METHOD0(GetMessages, bool());
27 using Nl80211Socket::SetNetlinkCallback;
28 MOCK_METHOD2(SetNetlinkCallback, bool(nl_recvmsg_msg_cb_t on_netlink_data,
29 void *callback_parameter));
Wade Guthrie5d3d6de2012-11-02 11:08:34 -070030 MOCK_METHOD0(GetSequenceNumber, unsigned int());
31
Christopher Wiley393b93f2012-11-08 17:30:58 -080032 virtual uint32 Send(KernelBoundNlMessage *message);
33
34 uint32 GetLastSequenceNumber() const { return sequence_number_; }
Wade Guthrie5d3d6de2012-11-02 11:08:34 -070035
Wade Guthrie0d438532012-05-18 14:18:50 -070036 private:
Christopher Wiley393b93f2012-11-08 17:30:58 -080037 uint32 sequence_number_;
Wade Guthrie5d3d6de2012-11-02 11:08:34 -070038
Wade Guthrie0d438532012-05-18 14:18:50 -070039 DISALLOW_COPY_AND_ASSIGN(MockNl80211Socket);
40};
41
42} // namespace shill
43
44#endif // SHILL_MOCK_NL80211_SOCKET_