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
19 namespace OHOS {
20 namespace NetManagerStandard {
GetIfaceNames(NetBearType bearerType,std::list<std::string> & ifaceNames)21 int32_t NetConnServiceIface::GetIfaceNames(NetBearType bearerType, std::list<std::string> &ifaceNames)
22 {
23 return NetConnService::GetInstance()->GetIfaceNames(bearerType, ifaceNames);
24 }
25
GetIfaceNameByType(NetBearType bearerType,const std::string & ident,std::string & ifaceName)26 int32_t NetConnServiceIface::GetIfaceNameByType(NetBearType bearerType, const std::string &ident,
27 std::string &ifaceName)
28 {
29 return NetConnService::GetInstance()->GetIfaceNameByType(bearerType, ident, ifaceName);
30 }
31
RegisterNetSupplier(NetBearType bearerType,const std::string & ident,const std::set<NetCap> & netCaps,uint32_t & supplierId)32 int32_t NetConnServiceIface::RegisterNetSupplier(NetBearType bearerType, const std::string &ident,
33 const std::set<NetCap> &netCaps, uint32_t &supplierId)
34 {
35 return NetConnService::GetInstance()->RegisterNetSupplier(bearerType, ident, netCaps, supplierId);
36 }
37
UnregisterNetSupplier(uint32_t supplierId)38 int32_t NetConnServiceIface::UnregisterNetSupplier(uint32_t supplierId)
39 {
40 return NetConnService::GetInstance()->UnregisterNetSupplier(supplierId);
41 }
42
UpdateNetLinkInfo(uint32_t supplierId,const sptr<NetLinkInfo> & netLinkInfo)43 int32_t NetConnServiceIface::UpdateNetLinkInfo(uint32_t supplierId, const sptr<NetLinkInfo> &netLinkInfo)
44 {
45 return NetConnService::GetInstance()->UpdateNetLinkInfo(supplierId, netLinkInfo);
46 }
47
UpdateNetSupplierInfo(uint32_t supplierId,const sptr<NetSupplierInfo> & netSupplierInfo)48 int32_t NetConnServiceIface::UpdateNetSupplierInfo(uint32_t supplierId, const sptr<NetSupplierInfo> &netSupplierInfo)
49 {
50 return NetConnService::GetInstance()->UpdateNetSupplierInfo(supplierId, netSupplierInfo);
51 }
52
RestrictBackgroundChanged(bool isRestrictBackground)53 int32_t NetConnServiceIface::RestrictBackgroundChanged(bool isRestrictBackground)
54 {
55 return NetConnService::GetInstance()->RestrictBackgroundChanged(isRestrictBackground);
56 }
57
RegisterNetConnCallback(const sptr<INetConnCallback> & callback)58 int32_t NetConnServiceIface::RegisterNetConnCallback(const sptr<INetConnCallback> &callback)
59 {
60 return NetConnService::GetInstance()->RegisterNetConnCallback(callback);
61 }
62 } // namespace NetManagerStandard
63 } // namespace OHOS