1 /* 2 * Copyright (C) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef OHOS_MOCK_DHCPSERVICE_H 16 #define OHOS_MOCK_DHCPSERVICE_H 17 #include <gtest/gtest.h> 18 #include <gmock/gmock.h> 19 #include "i_dhcp_service.h" 20 21 namespace OHOS { 22 namespace Wifi { 23 class DhcpService : public IDhcpService { 24 public: 25 DhcpService() = default; 26 ~DhcpService() = default; 27 int StartDhcpClient(const std::string& ifname, bool bIpv6); 28 int StopDhcpClient(const std::string& ifname, bool bIpv6); 29 int GetDhcpResult(const std::string& ifname, IDhcpResultNotify *pResultNotify, int timeouts); 30 int RemoveDhcpResult(IDhcpResultNotify *pResultNotify); 31 int GetDhcpInfo(const std::string& ifname, DhcpServiceInfo& dhcp); 32 int RenewDhcpClient(const std::string& ifname); 33 int ReleaseDhcpClient(const std::string& ifname); 34 int StartDhcpServer(const std::string& ifname); 35 int StopDhcpServer(const std::string& ifname); 36 int GetServerStatus(void); 37 int PutDhcpRange(const std::string& tagName, const DhcpRange& range); 38 int RemoveDhcpRange(const std::string& tagName, const DhcpRange& range); 39 int RemoveAllDhcpRange(const std::string& tagName); 40 int SetDhcpRange(const std::string& ifname, const DhcpRange& range); 41 int SetDhcpRange(const std::string& ifname, const std::string& tagName); 42 int GetLeases(const std::string& ifname, std::vector<std::string>& leases); 43 int GetDhcpSerProExit(const std::string& ifname, IDhcpResultNotify *pResultNotify); 44 }; 45 } // namespace Wifi 46 } // namespace OHOS 47 #endif 48