• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
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 = "proto2";
18package android.service;
19
20import "frameworks/base/core/proto/android/privacy.proto";
21
22option java_multiple_files = true;
23option java_outer_classname = "NetworkStatsServiceProto";
24
25// Represents dumpsys from NetworkStatsService (netstats).
26message NetworkStatsServiceDumpProto {
27    option (android.msg_privacy).dest = DEST_AUTOMATIC;
28
29    repeated NetworkInterfaceProto active_interfaces = 1;
30
31    repeated NetworkInterfaceProto active_uid_interfaces = 2;
32
33    // Device level network stats, which may include non-IP layer traffic.
34    optional NetworkStatsRecorderProto dev_stats = 3;
35
36    // IP-layer traffic stats.
37    optional NetworkStatsRecorderProto xt_stats = 4;
38
39    // Per-UID network stats.
40    optional NetworkStatsRecorderProto uid_stats = 5;
41
42    // Per-UID, per-tag network stats, excluding the default tag (i.e. tag=0).
43    optional NetworkStatsRecorderProto uid_tag_stats = 6;
44}
45
46// Corresponds to NetworkStatsService.mActiveIfaces/mActiveUidIfaces.
47message NetworkInterfaceProto {
48    option (android.msg_privacy).dest = DEST_AUTOMATIC;
49
50    // Name of the network interface (eg: wlan).
51    optional string interface = 1;
52
53    optional NetworkIdentitySetProto identities = 2;
54}
55
56// Corresponds to NetworkIdentitySet.
57message NetworkIdentitySetProto {
58    option (android.msg_privacy).dest = DEST_AUTOMATIC;
59
60    repeated NetworkIdentityProto identities = 1;
61}
62
63// Corresponds to NetworkIdentity.
64message NetworkIdentityProto {
65    option (android.msg_privacy).dest = DEST_AUTOMATIC;
66
67    // Constants from ConnectivityManager.TYPE_*.
68    optional int32 type = 1;
69
70    // Full subscriber ID on eng builds. The IMSI is scrubbed on user & userdebug
71    // builds to only include the info about the GSM network operator (the info
72    // that uniquely identifies the subscriber is removed).
73    optional string subscriber_id = 2 [ (android.privacy).dest = DEST_EXPLICIT ];
74
75    // Name of the network (eg: MyWifi).
76    optional string network_id = 3 [ (android.privacy).dest = DEST_EXPLICIT ];
77
78    optional bool roaming = 4;
79
80    optional bool metered = 5;
81
82    optional bool default_network = 6;
83
84    optional int32 oem_managed_network = 7;
85}
86
87// Corresponds to NetworkStatsRecorder.
88message NetworkStatsRecorderProto {
89    option (android.msg_privacy).dest = DEST_AUTOMATIC;
90
91    optional int64 pending_total_bytes = 1;
92
93    optional NetworkStatsCollectionProto complete_history = 2;
94}
95
96// Corresponds to NetworkStatsCollection.
97message NetworkStatsCollectionProto {
98    option (android.msg_privacy).dest = DEST_AUTOMATIC;
99
100    repeated NetworkStatsCollectionStatsProto stats = 1;
101}
102
103// Corresponds to NetworkStatsCollection.mStats.
104message NetworkStatsCollectionStatsProto {
105    option (android.msg_privacy).dest = DEST_AUTOMATIC;
106
107    optional NetworkStatsCollectionKeyProto key = 1;
108
109    optional NetworkStatsHistoryProto history = 2;
110}
111
112// Corresponds to NetworkStatsCollection.Key.
113message NetworkStatsCollectionKeyProto {
114    option (android.msg_privacy).dest = DEST_AUTOMATIC;
115
116    optional NetworkIdentitySetProto identity = 1;
117
118    optional int32 uid = 2;
119
120    optional int32 set = 3;
121
122    optional int32 tag = 4;
123}
124
125// Corresponds to NetworkStatsHistory.
126message NetworkStatsHistoryProto {
127    option (android.msg_privacy).dest = DEST_AUTOMATIC;
128
129    // Duration for this bucket in milliseconds.
130    optional int64 bucket_duration_ms = 1;
131
132    repeated NetworkStatsHistoryBucketProto buckets = 2;
133}
134
135// Corresponds to each bucket in NetworkStatsHistory.
136message NetworkStatsHistoryBucketProto {
137    option (android.msg_privacy).dest = DEST_AUTOMATIC;
138
139    // Bucket start time in milliseconds since epoch.
140    optional int64 bucket_start_ms = 1;
141
142    optional int64 rx_bytes = 2;
143
144    optional int64 rx_packets = 3;
145
146    optional int64 tx_bytes = 4;
147
148    optional int64 tx_packets = 5;
149
150    optional int64 operations = 6;
151}
152