1518678f8Sopenharmony_ci/*
2518678f8Sopenharmony_ci * Copyright (C) 2021-2023 Huawei Device Co., Ltd.
3518678f8Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4518678f8Sopenharmony_ci * you may not use this file except in compliance with the License.
5518678f8Sopenharmony_ci * You may obtain a copy of the License at
6518678f8Sopenharmony_ci *
7518678f8Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8518678f8Sopenharmony_ci *
9518678f8Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10518678f8Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11518678f8Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12518678f8Sopenharmony_ci * See the License for the specific language governing permissions and
13518678f8Sopenharmony_ci * limitations under the License.
14518678f8Sopenharmony_ci */
15518678f8Sopenharmony_ci#ifndef OHOS_I_DHCP_SERVICE_H
16518678f8Sopenharmony_ci#define OHOS_I_DHCP_SERVICE_H
17518678f8Sopenharmony_ci
18518678f8Sopenharmony_ci#include <string>
19518678f8Sopenharmony_ci#ifndef OHOS_ARCH_LITE
20518678f8Sopenharmony_ci#include "iremote_broker.h"
21518678f8Sopenharmony_ci#include "message_parcel.h"
22518678f8Sopenharmony_ci#include "message_option.h"
23518678f8Sopenharmony_ci#endif
24518678f8Sopenharmony_ci#include "i_dhcp_server_callback.h"
25518678f8Sopenharmony_ci#include "inner_api/include/dhcp_define.h"
26518678f8Sopenharmony_ci#include "dhcp_errcode.h"
27518678f8Sopenharmony_ci
28518678f8Sopenharmony_cinamespace OHOS {
29518678f8Sopenharmony_cinamespace DHCP {
30518678f8Sopenharmony_ci#ifdef OHOS_ARCH_LITE
31518678f8Sopenharmony_ciclass IDhcpServer {
32518678f8Sopenharmony_ci#else
33518678f8Sopenharmony_ciclass IDhcpServer : public IRemoteBroker {
34518678f8Sopenharmony_ci#endif
35518678f8Sopenharmony_cipublic:
36518678f8Sopenharmony_ci    virtual ~IDhcpServer() {}
37518678f8Sopenharmony_ci#ifdef OHOS_ARCH_LITE
38518678f8Sopenharmony_ci    virtual ErrCode RegisterDhcpServerCallBack(const std::string& ifname,
39518678f8Sopenharmony_ci        const std::shared_ptr<IDhcpServerCallBack> &callback) = 0;
40518678f8Sopenharmony_ci#else
41518678f8Sopenharmony_ci    virtual ErrCode RegisterDhcpServerCallBack(const std::string& ifname,
42518678f8Sopenharmony_ci        const sptr<IDhcpServerCallBack> &callback) = 0;
43518678f8Sopenharmony_ci#endif
44518678f8Sopenharmony_ci    virtual ErrCode StartDhcpServer(const std::string& ifname) = 0;
45518678f8Sopenharmony_ci    virtual ErrCode StopDhcpServer(const std::string& ifname) = 0;
46518678f8Sopenharmony_ci    virtual ErrCode PutDhcpRange(const std::string& tagName, const DhcpRange& range) = 0;
47518678f8Sopenharmony_ci    virtual ErrCode RemoveDhcpRange(const std::string& tagName, const DhcpRange& range) = 0;
48518678f8Sopenharmony_ci    virtual ErrCode RemoveAllDhcpRange(const std::string& tagName) = 0;
49518678f8Sopenharmony_ci    virtual ErrCode SetDhcpRange(const std::string& ifname, const DhcpRange& range) = 0;
50518678f8Sopenharmony_ci    virtual ErrCode SetDhcpName(const std::string& ifname, const std::string& tagName) = 0;
51518678f8Sopenharmony_ci    virtual ErrCode GetDhcpClientInfos(const std::string& ifname, std::vector<std::string>& dhcpClientInfo) = 0;
52518678f8Sopenharmony_ci    virtual ErrCode UpdateLeasesTime(const std::string& leaseTime) = 0;
53518678f8Sopenharmony_ci    virtual bool IsRemoteDied() = 0;
54518678f8Sopenharmony_ci#ifndef OHOS_ARCH_LITE
55518678f8Sopenharmony_cipublic:
56518678f8Sopenharmony_ci    DECLARE_INTERFACE_DESCRIPTOR(u"ohos.wifi.IDhcpServer");
57518678f8Sopenharmony_ci#endif
58518678f8Sopenharmony_ci};
59518678f8Sopenharmony_ci}  // namespace DHCP
60518678f8Sopenharmony_ci}  // namespace OHOS
61518678f8Sopenharmony_ci#endif