• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 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
16sequenceable OHOS.NetManagerStandard.NetStatsInfo;
17sequenceable OHOS.NetManagerStandard.NetStatsNetwork;
18sequenceable OHOS.NetManagerStandard.NetStatsInfoSequence;
19sequenceable NetPushStatsInfo..OHOS.NetManagerStandard.PushStatsInfo;
20interface OHOS.NetManagerStandard.INetStatsCallback;
21interface OHOS.NetManagerStandard.INetStatsService {
22    void GetIfaceRxBytes([out] unsigned long stats, [in] String interfaceName);
23    void GetIfaceTxBytes([out] unsigned long stats, [in] String interfaceName);
24    void GetCellularRxBytes([out] unsigned long stats);
25    void GetCellularTxBytes([out] unsigned long stats);
26    void GetAllRxBytes([out] unsigned long stats);
27    void GetAllTxBytes([out] unsigned long stats);
28    void GetUidRxBytes([out] unsigned long stats, [in] unsigned int uid);
29    void GetUidTxBytes([out] unsigned long stats, [in] unsigned int uid);
30    void GetAllStatsInfo([out] List<NetStatsInfo> info);
31    void GetAllSimStatsInfo([out] List<NetStatsInfo> infos);
32    void GetTrafficStatsByNetwork([out] Map<unsigned int, NetStatsInfo> infos,
33        [in] NetStatsNetwork network);
34    void GetTrafficStatsByUidNetwork([out] List<NetStatsInfoSequence> infos, [in] unsigned int uid,
35        [in] NetStatsNetwork network);
36    void SetAppStats([in] PushStatsInfo info);
37    void RegisterNetStatsCallback([in] INetStatsCallback cb);
38    void UnregisterNetStatsCallback([in] INetStatsCallback cb);
39    void GetIfaceStatsDetail([in] String iface, [in] unsigned long start, [in] unsigned long end,
40        [out] NetStatsInfo statsInfo);
41    void GetUidStatsDetail([in] String iface, [in] unsigned int uid, [in] unsigned long start,
42        [in] unsigned long end, [out] NetStatsInfo statsInfo);
43    void UpdateIfacesStats([in] String iface, [in] unsigned long start, [in] unsigned long end,
44        [in] NetStatsInfo stats);
45    void UpdateStatsData();
46    void ResetFactory();
47    void GetCookieRxBytes([out] unsigned long stats, [in] unsigned long cookie);
48    void GetCookieTxBytes([out] unsigned long stats, [in] unsigned long cookie);
49    void SaveSharingTraffic([in] NetStatsInfo infos);
50}
51