blob: e5dbdbb693a329ce929eace5d9343f41adde0d61 [file] [log] [blame]
Makoto Onukida65a522017-01-13 10:23:30 -08001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto3";
18
19package android.service;
20
21option java_multiple_files = true;
22option java_outer_classname = "NetworkStatsServiceProto";
23
24// Represents dumpsys from NetworkStatsService (netstats).
25message NetworkStatsServiceDumpProto {
26 repeated NetworkInterfaceProto active_interfaces = 1;
27
28 repeated NetworkInterfaceProto active_uid_interfaces = 2;
29
Makoto Onuki9e0800d2017-02-02 10:54:03 -080030 // Device level network stats, which may include non-IP layer traffic.
Makoto Onukida65a522017-01-13 10:23:30 -080031 NetworkStatsRecorderProto dev_stats = 3;
32
Makoto Onuki9e0800d2017-02-02 10:54:03 -080033 // IP-layer traffic stats.
Makoto Onukida65a522017-01-13 10:23:30 -080034 NetworkStatsRecorderProto xt_stats = 4;
35
Makoto Onuki9e0800d2017-02-02 10:54:03 -080036 // Per-UID network stats.
Makoto Onukida65a522017-01-13 10:23:30 -080037 NetworkStatsRecorderProto uid_stats = 5;
38
Makoto Onuki9e0800d2017-02-02 10:54:03 -080039 // Per-UID, per-tag network stats, excluding the default tag (i.e. tag=0).
Makoto Onukida65a522017-01-13 10:23:30 -080040 NetworkStatsRecorderProto uid_tag_stats = 6;
41}
42
43// Corresponds to NetworkStatsService.mActiveIfaces/mActiveUidIfaces.
44message NetworkInterfaceProto {
45 string interface = 1;
46
47 NetworkIdentitySetProto identities = 2;
48}
49
50// Corresponds to NetworkIdentitySet.
51message NetworkIdentitySetProto {
52 repeated NetworkIdentityProto identities = 1;
53}
54
55// Corresponds to NetworkIdentity.
56message NetworkIdentityProto {
57 // Constats from ConnectivityManager.TYPE_*.
58 int32 type = 1;
59
60 string subscriber_id = 2;
61
62 string network_id = 3;
63
64 bool roaming = 4;
65
66 bool metered = 5;
Lorenzo Colitti9781f7852018-01-20 02:02:56 +090067
68 bool default_network = 6;
Makoto Onukida65a522017-01-13 10:23:30 -080069}
70
71// Corresponds to NetworkStatsRecorder.
72message NetworkStatsRecorderProto {
73 int64 pending_total_bytes = 1;
74
75 NetworkStatsCollectionProto complete_history = 2;
76}
77
78// Corresponds to NetworkStatsCollection.
79message NetworkStatsCollectionProto {
80 repeated NetworkStatsCollectionStatsProto stats = 1;
81}
82
83// Corresponds to NetworkStatsCollection.mStats.
84message NetworkStatsCollectionStatsProto {
85 NetworkStatsCollectionKeyProto key = 1;
86
87 NetworkStatsHistoryProto history = 2;
88}
89
90// Corresponds to NetworkStatsCollection.Key.
91message NetworkStatsCollectionKeyProto {
92 NetworkIdentitySetProto identity = 1;
93
94 int32 uid = 2;
95
96 int32 set = 3;
97
98 int32 tag = 4;
99}
100
101// Corresponds to NetworkStatsHistory.
102message NetworkStatsHistoryProto {
103 // Duration for this bucket in milliseconds.
104 int64 bucket_duration_ms = 1;
105
106 repeated NetworkStatsHistoryBucketProto buckets = 2;
107}
108
109// Corresponds to each bucket in NetworkStatsHistory.
110message NetworkStatsHistoryBucketProto {
111 // Bucket start time in milliseconds since epoch.
112 int64 bucket_start_ms = 1;
113
114 int64 rx_bytes = 2;
115
116 int64 rx_packets = 3;
117
118 int64 tx_bytes = 4;
119
120 int64 tx_packets = 5;
121
122 int64 operations = 6;
123}