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 I_NOTIFY_CALLBACK_H
16 #define I_NOTIFY_CALLBACK_H
17 
18 #include <string>
19 
20 #include "dhcp_result_parcel.h"
21 #include "iremote_broker.h"
22 #include "netsys_ipc_interface_code.h"
23 
24 namespace OHOS {
25 namespace NetsysNative {
26 class INotifyCallback : public IRemoteBroker {
27 public:
28     virtual ~INotifyCallback() = default;
29 
30 public:
31     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.NetsysNative.INotifyCallback");
32 
33 public:
34     virtual int32_t OnInterfaceAddressUpdated(const std::string &addr, const std::string &ifName, int flags,
35                                               int scope) = 0;
36     virtual int32_t OnInterfaceAddressRemoved(const std::string &addr, const std::string &ifName, int flags,
37                                               int scope) = 0;
38     virtual int32_t OnInterfaceAdded(const std::string &ifName) = 0;
39     virtual int32_t OnInterfaceRemoved(const std::string &ifName) = 0;
40     virtual int32_t OnInterfaceChanged(const std::string &ifName, bool up) = 0;
41     virtual int32_t OnInterfaceLinkStateChanged(const std::string &ifName, bool up) = 0;
42     virtual int32_t OnRouteChanged(bool updated, const std::string &route, const std::string &gateway,
43                                    const std::string &ifName) = 0;
44     virtual int32_t OnDhcpSuccess(sptr<DhcpResultParcel> &dhcpResult) = 0;
45     virtual int32_t OnBandwidthReachedLimit(const std::string &limitName, const std::string &iface) = 0;
46 };
47 } // namespace NetsysNative
48 } // namespace OHOS
49 #endif // I_NOTIFY_CALLBACK_H
50