• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
16 #include "net_conn_service_iface.h"
17 #include "net_conn_service.h"
18 #include "net_mgr_log_wrapper.h"
19 
20 namespace OHOS {
21 namespace NetManagerStandard {
GetIfaceNames(NetBearType bearerType,std::list<std::string> & ifaceNames)22 int32_t NetConnServiceIface::GetIfaceNames(NetBearType bearerType, std::list<std::string> &ifaceNames)
23 {
24     return NetConnService::GetInstance()->GetIfaceNames(bearerType, ifaceNames);
25 }
26 
GetIfaceNameByType(NetBearType bearerType,const std::string & ident,std::string & ifaceName)27 int32_t NetConnServiceIface::GetIfaceNameByType(NetBearType bearerType, const std::string &ident,
28                                                 std::string &ifaceName)
29 {
30     return NetConnService::GetInstance()->GetIfaceNameByType(bearerType, ident, ifaceName);
31 }
32 
RegisterNetSupplier(NetBearType bearerType,const std::string & ident,const std::set<NetCap> & netCaps,uint32_t & supplierId)33 int32_t NetConnServiceIface::RegisterNetSupplier(NetBearType bearerType, const std::string &ident,
34                                                  const std::set<NetCap> &netCaps, uint32_t &supplierId)
35 {
36     return NetConnService::GetInstance()->RegisterNetSupplier(bearerType, ident, netCaps, supplierId);
37 }
38 
UnregisterNetSupplier(uint32_t supplierId)39 int32_t NetConnServiceIface::UnregisterNetSupplier(uint32_t supplierId)
40 {
41     return NetConnService::GetInstance()->UnregisterNetSupplier(supplierId);
42 }
43 
UpdateNetLinkInfo(uint32_t supplierId,const sptr<NetLinkInfo> & netLinkInfo)44 int32_t NetConnServiceIface::UpdateNetLinkInfo(uint32_t supplierId, const sptr<NetLinkInfo> &netLinkInfo)
45 {
46     return NetConnService::GetInstance()->UpdateNetLinkInfo(supplierId, netLinkInfo);
47 }
48 
UpdateNetSupplierInfo(uint32_t supplierId,const sptr<NetSupplierInfo> & netSupplierInfo)49 int32_t NetConnServiceIface::UpdateNetSupplierInfo(uint32_t supplierId, const sptr<NetSupplierInfo> &netSupplierInfo)
50 {
51     return NetConnService::GetInstance()->UpdateNetSupplierInfo(supplierId, netSupplierInfo);
52 }
53 
RestrictBackgroundChanged(bool isRestrictBackground)54 int32_t NetConnServiceIface::RestrictBackgroundChanged(bool isRestrictBackground)
55 {
56     return NetConnService::GetInstance()->RestrictBackgroundChanged(isRestrictBackground);
57 }
58 
RegisterNetConnCallback(const sptr<INetConnCallback> & callback)59 int32_t NetConnServiceIface::RegisterNetConnCallback(const sptr<INetConnCallback> &callback)
60 {
61     return NetConnService::GetInstance()->RegisterNetConnCallback(callback);
62 }
63 
RegisterNetFactoryResetCallback(const sptr<INetFactoryResetCallback> & callback)64 int32_t NetConnServiceIface::RegisterNetFactoryResetCallback(const sptr<INetFactoryResetCallback> &callback)
65 {
66     return NetConnService::GetInstance()->RegisterNetFactoryResetCallback(callback);
67 }
68 } // namespace NetManagerStandard
69 } // namespace OHOS