1 /* 2 * Copyright (C) 2021-2023 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_I_DHCP_CLIENT_H 16 #define OHOS_I_DHCP_CLIENT_H 17 18 #include <string> 19 #ifndef OHOS_ARCH_LITE 20 #include "iremote_broker.h" 21 #include "message_parcel.h" 22 #include "message_option.h" 23 #endif 24 #include "i_dhcp_client_callback.h" 25 #include "inner_api/include/dhcp_define.h" 26 #include "dhcp_errcode.h" 27 28 namespace OHOS { 29 namespace DHCP { 30 #ifdef OHOS_ARCH_LITE 31 class IDhcpClient { 32 #else 33 class IDhcpClient : public IRemoteBroker { 34 #endif 35 public: ~IDhcpClient()36 virtual ~IDhcpClient() {} 37 #ifdef OHOS_ARCH_LITE 38 virtual ErrCode RegisterDhcpClientCallBack(const std::string& ifname, 39 const std::shared_ptr<IDhcpClientCallBack> &callback) = 0; 40 #else 41 virtual ErrCode RegisterDhcpClientCallBack(const std::string& ifname, 42 const sptr<IDhcpClientCallBack> &callback) = 0; 43 #endif 44 virtual ErrCode StartDhcpClient(const std::string& ifname, bool bIpv6) = 0; 45 virtual ErrCode SetConfiguration(const std::string& ifname, const RouterConfig& config) = 0; 46 virtual ErrCode StopDhcpClient(const std::string& ifname, bool bIpv6) = 0; 47 virtual bool IsRemoteDied() = 0; 48 #ifndef OHOS_ARCH_LITE 49 public: 50 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.wifi.IDhcpClient"); 51 #endif 52 }; 53 } // namespace DHCP 54 } // namespace OHOS 55 #endif