• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 "net_stats_history.h"
17 
18 namespace OHOS {
19 namespace NetManagerStandard {
20 
GetHistory(std::vector<NetStatsInfo> & recv,uint64_t start,uint64_t end)21 int32_t NetStatsHistory::GetHistory(std::vector<NetStatsInfo> &recv, uint64_t start, uint64_t end)
22 {
23     auto handler = std::make_unique<NetStatsDataHandler>();
24     return handler->ReadStatsData(recv, start, end);
25 }
26 
GetHistory(std::vector<NetStatsInfo> & recv,uint32_t uid,uint64_t start,uint64_t end)27 int32_t NetStatsHistory::GetHistory(std::vector<NetStatsInfo> &recv, uint32_t uid, uint64_t start, uint64_t end)
28 {
29     auto handler = std::make_unique<NetStatsDataHandler>();
30     return handler->ReadStatsData(recv, uid, start, end);
31 }
32 
GetHistory(std::vector<NetStatsInfo> & recv,const std::string & iface,uint64_t start,uint64_t end)33 int32_t NetStatsHistory::GetHistory(std::vector<NetStatsInfo> &recv, const std::string &iface, uint64_t start,
34                                     uint64_t end)
35 {
36     auto handler = std::make_unique<NetStatsDataHandler>();
37     return handler->ReadStatsData(recv, iface, start, end);
38 }
39 
GetHistory(std::vector<NetStatsInfo> & recv,const std::string & iface,uint32_t uid,uint64_t start,uint64_t end)40 int32_t NetStatsHistory::GetHistory(std::vector<NetStatsInfo> &recv, const std::string &iface, uint32_t uid,
41                                     uint64_t start, uint64_t end)
42 {
43     auto handler = std::make_unique<NetStatsDataHandler>();
44     return handler->ReadStatsData(recv, iface, uid, start, end);
45 }
46 } // namespace NetManagerStandard
47 } // namespace OHOS