• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 COMMON_NOTIFY_CALLBACK_TEST_H
17 #define COMMON_NOTIFY_CALLBACK_TEST_H
18 
19 #include "notify_callback_stub.h"
20 #include "net_dns_result_callback_stub.h"
21 
22 namespace OHOS {
23 namespace NetsysNative {
24 class NotifyCallbackTest : public NotifyCallbackStub {
25 public:
26     NotifyCallbackTest() = default;
~NotifyCallbackTest()27     ~NotifyCallbackTest() override {};
OnInterfaceAddressUpdated(const std::string & addr,const std::string & ifName,int flags,int scope)28     int32_t OnInterfaceAddressUpdated(const std::string &addr, const std::string &ifName, int flags, int scope) override
29     {
30         return 0;
31     }
32 
OnInterfaceAddressRemoved(const std::string & addr,const std::string & ifName,int flags,int scope)33     int32_t OnInterfaceAddressRemoved(const std::string &addr, const std::string &ifName, int flags, int scope) override
34     {
35         return 0;
36     }
37 
OnInterfaceAdded(const std::string & ifName)38     int32_t OnInterfaceAdded(const std::string &ifName) override
39     {
40         return 0;
41     }
42 
OnInterfaceRemoved(const std::string & ifName)43     int32_t OnInterfaceRemoved(const std::string &ifName) override
44     {
45         return 0;
46     }
47 
OnInterfaceChanged(const std::string & ifName,bool up)48     int32_t OnInterfaceChanged(const std::string &ifName, bool up) override
49     {
50         return 0;
51     }
52 
OnInterfaceLinkStateChanged(const std::string & ifName,bool up)53     int32_t OnInterfaceLinkStateChanged(const std::string &ifName, bool up) override
54     {
55         return 0;
56     }
57 
OnRouteChanged(bool updated,const std::string & route,const std::string & gateway,const std::string & ifName)58     int32_t OnRouteChanged(
59         bool updated, const std::string &route, const std::string &gateway, const std::string &ifName) override
60     {
61         return 0;
62     }
63 
OnDhcpSuccess(sptr<DhcpResultParcel> & dhcpResult)64     int32_t OnDhcpSuccess(sptr<DhcpResultParcel> &dhcpResult) override
65     {
66         return 0;
67     }
68 
OnBandwidthReachedLimit(const std::string & limitName,const std::string & iface)69     int32_t OnBandwidthReachedLimit(const std::string &limitName, const std::string &iface) override
70     {
71         return 0;
72     }
73 };
74 
75 class DnsResultCallbackTest : public NetDnsResultCallbackStub {
76 public:
77     DnsResultCallbackTest() = default;
~DnsResultCallbackTest()78     ~DnsResultCallbackTest() override {};
OnDnsResultReport(uint32_t size,std::list<OHOS::NetsysNative::NetDnsResultReport> res)79     int32_t OnDnsResultReport(uint32_t size, std::list<OHOS::NetsysNative::NetDnsResultReport> res) override
80     {
81         return 0;
82     }
83 };
84 } // namespace NetsysNative
85 } // namespace OHOS
86 #endif // COMMON_NOTIFY_CALLBACK_TEST_H
87