1 /*
2  * Copyright (C) 2021-2022 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 "data_flow_statistics.h"
17 
18 #include "netsys_controller.h"
19 
20 namespace OHOS {
21 namespace NetManagerStandard {
GetCellularRxBytes()22 int64_t DataFlowStatistics::GetCellularRxBytes()
23 {
24     return NetsysController::GetInstance().GetCellularRxBytes();
25 }
26 
GetCellularTxBytes()27 int64_t DataFlowStatistics::GetCellularTxBytes()
28 {
29     return NetsysController::GetInstance().GetCellularTxBytes();
30 }
31 
GetAllRxBytes()32 int64_t DataFlowStatistics::GetAllRxBytes()
33 {
34     return NetsysController::GetInstance().GetAllRxBytes();
35 }
36 
GetAllTxBytes()37 int64_t DataFlowStatistics::GetAllTxBytes()
38 {
39     return NetsysController::GetInstance().GetAllTxBytes();
40 }
41 
GetUidRxBytes(uint32_t uid)42 int64_t DataFlowStatistics::GetUidRxBytes(uint32_t uid)
43 {
44     return NetsysController::GetInstance().GetUidRxBytes(uid);
45 }
46 
GetUidTxBytes(uint32_t uid)47 int64_t DataFlowStatistics::GetUidTxBytes(uint32_t uid)
48 {
49     return NetsysController::GetInstance().GetUidTxBytes(uid);
50 }
51 
GetIfaceRxBytes(const std::string & interfaceName)52 int64_t DataFlowStatistics::GetIfaceRxBytes(const std::string &interfaceName)
53 {
54     return NetsysController::GetInstance().GetIfaceRxBytes(interfaceName);
55 }
56 
GetIfaceTxBytes(const std::string & interfaceName)57 int64_t DataFlowStatistics::GetIfaceTxBytes(const std::string &interfaceName)
58 {
59     return NetsysController::GetInstance().GetIfaceTxBytes(interfaceName);
60 }
61 
GetIfaceRxPackets(const std::string & interfaceName)62 int64_t DataFlowStatistics::GetIfaceRxPackets(const std::string &interfaceName)
63 {
64     return NetsysController::GetInstance().GetIfaceRxPackets(interfaceName);
65 }
66 
GetIfaceTxPackets(const std::string & interfaceName)67 int64_t DataFlowStatistics::GetIfaceTxPackets(const std::string &interfaceName)
68 {
69     return NetsysController::GetInstance().GetIfaceTxPackets(interfaceName);
70 }
71 } // namespace NetManagerStandard
72 } // namespace OHOS
73