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 16 #ifndef OHOS_DHCP_RESULT_NOTIFY_INTERFACE_H 17 #define OHOS_DHCP_RESULT_NOTIFY_INTERFACE_H 18 19 #include "dhcp_define.h" 20 21 22 namespace OHOS { 23 namespace Wifi { 24 class IDhcpResultNotify { 25 public: 26 /** 27 * @Description : Destroy the dhcp result notify base object. 28 * 29 */ ~IDhcpResultNotify()30 virtual ~IDhcpResultNotify() {} 31 32 /** 33 * @Description : Get the success dhcp result of specified interface. 34 * 35 * @param status - success : DHCP_OPT_SUCCESS, failed : DHCP_OPT_FAILED, timeout : DHCP_OPT_TIMEOUT [in] 36 * @param ifname - interface name, eg:wlan0 [in] 37 * @param result - dhcp result [in] 38 */ 39 virtual void OnSuccess(int status, const std::string& ifname, DhcpResult& result) = 0; 40 41 /** 42 * @Description : Get the failed dhcp result of specified interface. 43 * 44 * @param status - success : DHCP_OPT_SUCCESS, failed : DHCP_OPT_FAILED, timeout : DHCP_OPT_TIMEOUT [in] 45 * @param ifname - interface name, eg:wlan0 [in] 46 * @param reason - failed reason [in] 47 */ 48 virtual void OnFailed(int status, const std::string& ifname, const std::string& reason) = 0; 49 50 /** 51 * @Description : Get the abnormal exit notify of dhcp server process. 52 * 53 * @param ifname - interface name, eg:wlan0 [in] 54 */ 55 virtual void OnSerExitNotify(const std::string& ifname) = 0; 56 }; 57 } // namespace Wifi 58 } // namespace OHOS 59 #endif