blob: debb1578451a5c20b8aa720bc3b5dc3a5e623ee9 [file] [log] [blame]
Glen Kuhne94814572016-10-25 12:40:35 -07001/*
2 * Copyright (C) 2016 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";
18
19package clearcut.connectivity;
20
21option java_package = "com.android.server.wifi";
22option java_outer_classname = "WifiMetricsProto";
23
24// The information about the Wifi events.
25message WifiLog {
26
27 // Session information that gets logged for every Wifi connection.
28 repeated ConnectionEvent connection_event = 1;
29
30 // Number of saved networks in the user profile.
31 optional int32 num_saved_networks = 2;
32
33 // Number of open networks in the saved networks.
34 optional int32 num_open_networks = 3;
35
36 // Number of personal networks.
37 optional int32 num_personal_networks = 4;
38
39 // Number of enterprise networks.
40 optional int32 num_enterprise_networks = 5;
41
42 // Does the user have location setting enabled.
43 optional bool is_location_enabled = 6;
44
45 // Does the user have scanning enabled.
46 optional bool is_scanning_always_enabled = 7;
47
48 // Number of times user toggled wifi using the settings menu.
49 optional int32 num_wifi_toggled_via_settings = 8;
50
51 // Number of times user toggled wifi using the airplane menu.
52 optional int32 num_wifi_toggled_via_airplane = 9;
53
54 // Number of networks added by the user.
55 optional int32 num_networks_added_by_user = 10;
56
57 // Number of networks added by applications.
58 optional int32 num_networks_added_by_apps = 11;
59
60 // Number scans that returned empty results.
61 optional int32 num_empty_scan_results = 12;
62
63 // Number scans that returned at least one result.
64 optional int32 num_non_empty_scan_results = 13;
65
66 // Number of scans that were one time.
67 optional int32 num_oneshot_scans = 14;
68
69 // Number of repeated background scans that were scheduled to the chip.
70 optional int32 num_background_scans = 15;
71
72 // Error codes that a scan can result in.
73 enum ScanReturnCode {
74
75 // Return Code is unknown.
76 SCAN_UNKNOWN = 0;
77
78 // Scan was successful.
79 SCAN_SUCCESS = 1;
80
81 // Scan was successfully started, but was interrupted.
82 SCAN_FAILURE_INTERRUPTED = 2;
83
84 // Scan failed to start because of invalid configuration
85 // (bad channel, etc).
86 SCAN_FAILURE_INVALID_CONFIGURATION = 3;
87
88 // Could not start a scan because wifi is disabled.
89 FAILURE_WIFI_DISABLED = 4;
90
91 }
92
93 // Mapping of error codes to the number of times that scans resulted
94 // in that error.
95 repeated ScanReturnEntry scan_return_entries = 16;
96
97 message ScanReturnEntry {
98
99 // Return code of the scan.
100 optional ScanReturnCode scan_return_code = 1;
101
102 // Number of entries that were found in the scan.
103 optional int32 scan_results_count = 2;
104 }
105
106 // State of the Wifi.
107 enum WifiState {
108
109 // State is unknown.
110 WIFI_UNKNOWN = 0;
111
112 // Wifi is disabled.
113 WIFI_DISABLED = 1;
114
115 // Wifi is enabled.
116 WIFI_DISCONNECTED = 2;
117
118 // Wifi is enabled and associated with an AP.
119 WIFI_ASSOCIATED = 3;
120 }
121
122 // Mapping of system state to the number of times that scans were requested in
123 // that state
124 repeated WifiSystemStateEntry wifi_system_state_entries = 17;
125
126 message WifiSystemStateEntry {
127
128 // Current WiFi state.
129 optional WifiState wifi_state = 1;
130
131 // Count of scans in state.
132 optional int32 wifi_state_count = 2;
133
134 // Is screen on.
135 optional bool is_screen_on = 3;
136 }
137
138 // Mapping of Error/Success codes to the number of background scans that resulted in it
139 repeated ScanReturnEntry background_scan_return_entries = 18;
140
141 // Mapping of system state to the number of times that Background scans were requested in that
142 // state
143 repeated WifiSystemStateEntry background_scan_request_state = 19;
144
145 // Total number of times the Watchdog of Last Resort triggered, resetting the wifi stack
146 optional int32 num_last_resort_watchdog_triggers = 20;
147
148 // Total number of networks over bad association threshold when watchdog triggered
149 optional int32 num_last_resort_watchdog_bad_association_networks_total = 21;
150
151 // Total number of networks over bad authentication threshold when watchdog triggered
152 optional int32 num_last_resort_watchdog_bad_authentication_networks_total = 22;
153
154 // Total number of networks over bad dhcp threshold when watchdog triggered
155 optional int32 num_last_resort_watchdog_bad_dhcp_networks_total = 23;
156
157 // Total number of networks over bad other threshold when watchdog triggered
158 optional int32 num_last_resort_watchdog_bad_other_networks_total = 24;
159
160 // Total count of networks seen when watchdog triggered
161 optional int32 num_last_resort_watchdog_available_networks_total = 25;
162
163 // Total count of triggers with atleast one bad association network
164 optional int32 num_last_resort_watchdog_triggers_with_bad_association = 26;
165
166 // Total count of triggers with atleast one bad authentication network
167 optional int32 num_last_resort_watchdog_triggers_with_bad_authentication = 27;
168
169 // Total count of triggers with atleast one bad dhcp network
170 optional int32 num_last_resort_watchdog_triggers_with_bad_dhcp = 28;
171
172 // Total count of triggers with atleast one bad other network
173 optional int32 num_last_resort_watchdog_triggers_with_bad_other = 29;
174
175 // Count of times connectivity watchdog confirmed pno is working
176 optional int32 num_connectivity_watchdog_pno_good = 30;
177
178 // Count of times connectivity watchdog found pno not working
179 optional int32 num_connectivity_watchdog_pno_bad = 31;
180
181 // Count of times connectivity watchdog confirmed background scan is working
182 optional int32 num_connectivity_watchdog_background_good = 32;
183
184 // Count of times connectivity watchdog found background scan not working
185 optional int32 num_connectivity_watchdog_background_bad = 33;
186
187 // The time duration represented by this wifi log, from start to end of capture
188 optional int32 record_duration_sec = 34;
189
190 // Counts the occurrences of each individual RSSI poll level
191 repeated RssiPollCount rssi_poll_rssi_count = 35;
192
193 // Total number of times WiFi connected immediately after a Last Resort Watchdog trigger,
194 // without new networks becoming available.
195 optional int32 num_last_resort_watchdog_successes = 36;
196
197 // Total number of saved hidden networks
198 optional int32 num_hidden_networks = 37;
199
200 // Total number of saved passpoint / hotspot 2.0 networks
201 optional int32 num_passpoint_networks = 38;
202
203 // Total number of scan results
204 optional int32 num_total_scan_results = 39;
205
206 // Total number of scan results for open networks
207 optional int32 num_open_network_scan_results = 40;
208
209 // Total number of scan results for personal networks
210 optional int32 num_personal_network_scan_results = 41;
211
212 // Total number of scan results for enterprise networks
213 optional int32 num_enterprise_network_scan_results = 42;
214
215 // Total number of scan results for hidden networks
216 optional int32 num_hidden_network_scan_results = 43;
217
218 // Total number of scan results for hotspot 2.0 r1 networks
219 optional int32 num_hotspot2_r1_network_scan_results = 44;
220
221 // Total number of scan results for hotspot 2.0 r2 networks
222 optional int32 num_hotspot2_r2_network_scan_results = 45;
223
224 // Total number of scans handled by framework (oneshot or otherwise)
225 optional int32 num_scans = 46;
226
227 // Counts the occurrences of each alert reason.
228 repeated AlertReasonCount alert_reason_count = 47;
229
230 // Counts the occurrences of each Wifi score
231 repeated WifiScoreCount wifi_score_count = 48;
232
233 // Histogram of Soft AP Durations
234 repeated SoftApDurationBucket soft_ap_duration = 49;
235
236 // Histogram of Soft AP ReturnCode
237 repeated SoftApReturnCodeCount soft_ap_return_code = 50;
238
239 // Histogram of the delta between scan result RSSI and RSSI polls
240 repeated RssiPollCount rssi_poll_delta_count = 51;
Glen Kuhne8ce9a1c2017-03-28 14:02:48 -0700241
242 // List of events
243 repeated StaEvent sta_event_list = 52;
Glen Kuhne94814572016-10-25 12:40:35 -0700244}
245
246// Information that gets logged for every WiFi connection.
247message RouterFingerPrint {
248
249 enum RoamType {
250
251 // Type is unknown.
252 ROAM_TYPE_UNKNOWN = 0;
253
254 // No roaming - usually happens on a single band (2.4 GHz) router.
255 ROAM_TYPE_NONE = 1;
256
257 // Enterprise router.
258 ROAM_TYPE_ENTERPRISE = 2;
259
260 // DBDC => Dual Band Dual Concurrent essentially a router that
261 // supports both 2.4 GHz and 5 GHz bands.
262 ROAM_TYPE_DBDC = 3;
263 }
264
265 enum Auth {
266
267 // Auth is unknown.
268 AUTH_UNKNOWN = 0;
269
270 // No authentication.
271 AUTH_OPEN = 1;
272
273 // If the router uses a personal authentication.
274 AUTH_PERSONAL = 2;
275
276 // If the router is setup for enterprise authentication.
277 AUTH_ENTERPRISE = 3;
278 }
279
280 enum RouterTechnology {
281
282 // Router is unknown.
283 ROUTER_TECH_UNKNOWN = 0;
284
285 // Router Channel A.
286 ROUTER_TECH_A = 1;
287
288 // Router Channel B.
289 ROUTER_TECH_B = 2;
290
291 // Router Channel G.
292 ROUTER_TECH_G = 3;
293
294 // Router Channel N.
295 ROUTER_TECH_N = 4;
296
297 // Router Channel AC.
298 ROUTER_TECH_AC = 5;
299
300 // When the channel is not one of the above.
301 ROUTER_TECH_OTHER = 6;
302 }
303
304 optional RoamType roam_type = 1;
305
306 // Channel on which the connection takes place.
307 optional int32 channel_info = 2;
308
309 // DTIM setting of the router.
310 optional int32 dtim = 3;
311
312 // Authentication scheme of the router.
313 optional Auth authentication = 4;
314
315 // If the router is hidden.
316 optional bool hidden = 5;
317
318 // Channel information.
319 optional RouterTechnology router_technology = 6;
320
321 // whether ipv6 is supported.
322 optional bool supports_ipv6 = 7;
323
324 // If the router is a passpoint / hotspot 2.0 network
325 optional bool passpoint = 8;
326}
327
328message ConnectionEvent {
329
330 // Roam Type.
331 enum RoamType {
332
333 // Type is unknown.
334 ROAM_UNKNOWN = 0;
335
336 // No roaming.
337 ROAM_NONE = 1;
338
339 // DBDC roaming.
340 ROAM_DBDC = 2;
341
342 // Enterprise roaming.
343 ROAM_ENTERPRISE = 3;
344
345 // User selected roaming.
346 ROAM_USER_SELECTED = 4;
347
348 // Unrelated.
349 ROAM_UNRELATED = 5;
350 }
351
352 // Connectivity Level Failure.
353 enum ConnectivityLevelFailure {
354
355 // Failure is unknown.
356 HLF_UNKNOWN = 0;
357
358 // No failure.
359 HLF_NONE = 1;
360
361 // DHCP failure.
362 HLF_DHCP = 2;
363
364 // No internet connection.
365 HLF_NO_INTERNET = 3;
366
367 // No internet connection.
368 HLF_UNWANTED = 4;
369 }
370
371 // Start time of the connection.
372 optional int64 start_time_millis = 1;// [(datapol.semantic_type) = ST_TIMESTAMP];
373
374 // Duration to connect.
375 optional int32 duration_taken_to_connect_millis = 2;
376
377 // Router information.
378 optional RouterFingerPrint router_fingerprint = 3;
379
380 // RSSI at the start of the connection.
381 optional int32 signal_strength = 4;
382
383 // Roam Type.
384 optional RoamType roam_type = 5;
385
386 // Result of the connection.
387 optional int32 connection_result = 6;
388
389 // Reasons for level 2 failure (needs to be coordinated with wpa-supplicant).
390 optional int32 level_2_failure_code = 7;
391
392 // Failures that happen at the connectivity layer.
393 optional ConnectivityLevelFailure connectivity_level_failure_code = 8;
394
395 // Has bug report been taken.
396 optional bool automatic_bug_report_taken = 9;
397}
398
399// Number of occurrences of a specific RSSI poll rssi value
400message RssiPollCount {
401 // RSSI
402 optional int32 rssi = 1;
403
404 // Number of RSSI polls with 'rssi'
405 optional int32 count = 2;
406}
407
408// Number of occurrences of a specific alert reason value
409message AlertReasonCount {
410 // Alert reason
411 optional int32 reason = 1;
412
413 // Number of alerts with |reason|.
414 optional int32 count = 2;
415}
416
417// Counts the number of instances of a specific Wifi Score calculated by WifiScoreReport
418message WifiScoreCount {
419 // Wifi Score
420 optional int32 score = 1;
421
422 // Number of Wifi score reports with this score
423 optional int32 count = 2;
424}
425
426// Number of occurrences of Soft AP session durations
427message SoftApDurationBucket {
428 // Bucket covers duration : [duration_sec, duration_sec + bucket_size_sec)
429 // The (inclusive) lower bound of Soft AP session duration represented by this bucket
430 optional int32 duration_sec = 1;
431
432 // The size of this bucket
433 optional int32 bucket_size_sec = 2;
434
435 // Number of soft AP session durations that fit into this bucket
436 optional int32 count = 3;
437}
438
439// Number of occurrences of a soft AP session return code
440message SoftApReturnCodeCount {
Rebecca Silberstein28d9de22017-01-24 10:42:59 -0800441
442 enum SoftApStartResult {
443
444 // SoftApManager return code unknown
445 SOFT_AP_RETURN_CODE_UNKNOWN = 0;
446
447 // SoftAp started successfully
448 SOFT_AP_STARTED_SUCCESSFULLY = 1;
449
450 // Catch all for failures with no specific failure reason
451 SOFT_AP_FAILED_GENERAL_ERROR = 2;
452
453 // SoftAp failed to start due to NO_CHANNEL error
454 SOFT_AP_FAILED_NO_CHANNEL = 3;
455 }
456
457 // Historical, no longer used for writing as of 01/2017.
458 optional int32 return_code = 1 [deprecated = true];
Glen Kuhne94814572016-10-25 12:40:35 -0700459
460 // Occurrences of this soft AP return code
461 optional int32 count = 2;
Rebecca Silberstein28d9de22017-01-24 10:42:59 -0800462
463 // Result of attempt to start SoftAp
464 optional SoftApStartResult start_result = 3;
Glen Kuhne94814572016-10-25 12:40:35 -0700465}
Glen Kuhne8ce9a1c2017-03-28 14:02:48 -0700466
467message StaEvent {
468 message ConfigInfo {
469 // The set of key management protocols supported by this configuration.
470 optional uint32 allowed_key_management = 1 [default = 0];
471
472 // The set of security protocols supported by this configuration.
473 optional uint32 allowed_protocols = 2 [default = 0];
474
475 // The set of authentication protocols supported by this configuration.
476 optional uint32 allowed_auth_algorithms = 3 [default = 0];
477
478 // The set of pairwise ciphers for WPA supported by this configuration.
479 optional uint32 allowed_pairwise_ciphers = 4 [default = 0];
480
481 // The set of group ciphers supported by this configuration.
482 optional uint32 allowed_group_ciphers = 5;
483
484 // Is this a 'hidden network'
485 optional bool hidden_ssid = 6;
486
487 // Is this a Hotspot 2.0 / passpoint network
488 optional bool is_passpoint = 7;
489
490 // Is this an 'ephemeral' network (Not in saved network list, recommended externally)
491 optional bool is_ephemeral = 8;
492
493 // Has a successful connection ever been established using this WifiConfiguration
494 optional bool has_ever_connected = 9;
495
496 // RSSI of the scan result candidate associated with this WifiConfiguration
497 optional int32 scan_rssi = 10 [default = -127];
498
499 // Frequency of the scan result candidate associated with this WifiConfiguration
500 optional int32 scan_freq = 11 [default = -1];
501 }
502
503 enum EventType {
504 // Default/Invalid event
505 TYPE_UNKNOWN = 0;
506
507 // Supplicant Association Rejection event. Code contains the 802.11
508 TYPE_ASSOCIATION_REJECTION_EVENT = 1;
509
510 // Supplicant L2 event,
511 TYPE_AUTHENTICATION_FAILURE_EVENT = 2;
512
513 // Supplicant L2 event
514 TYPE_NETWORK_CONNECTION_EVENT = 3;
515
516 // Supplicant L2 event
517 TYPE_NETWORK_DISCONNECTION_EVENT = 4;
518
519 // Supplicant L2 event
520 TYPE_SUPPLICANT_STATE_CHANGE_EVENT = 5;
521
522 // Supplicant L2 event
523 TYPE_CMD_ASSOCIATED_BSSID = 6;
524
525 // IP Manager successfully completed IP Provisioning
526 TYPE_CMD_IP_CONFIGURATION_SUCCESSFUL = 7;
527
528 // IP Manager failed to complete IP Provisioning
529 TYPE_CMD_IP_CONFIGURATION_LOST = 8;
530
531 // IP Manager lost reachability to network neighbors
532 TYPE_CMD_IP_REACHABILITY_LOST = 9;
533
534 // Indicator that Supplicant is targeting a BSSID for roam/connection
535 TYPE_CMD_TARGET_BSSID = 10;
536
537 // Wifi framework is initiating a connection attempt
538 TYPE_CMD_START_CONNECT = 11;
539
540 // Wifi framework is initiating a roaming connection attempt
541 TYPE_CMD_START_ROAM = 12;
542
543 // SystemAPI connect() command, Settings App
544 TYPE_CONNECT_NETWORK = 13;
545
546 // Network Agent has validated the internet connection (Captive Portal Check success, or user
547 // validation)
548 TYPE_NETWORK_AGENT_VALID_NETWORK = 14;
549
550 // Framework initiated disconnect. Sometimes generated to give an extra reason for a disconnect
551 // Should typically be followed by a NETWORK_DISCONNECTION_EVENT with a local_gen = true
552 TYPE_FRAMEWORK_DISCONNECT = 15;
553 }
554
555 enum FrameworkDisconnectReason {
556 // default/none/unknown value
557 DISCONNECT_UNKNOWN = 0;
558
559 // API DISCONNECT
560 DISCONNECT_API = 1;
561
562 // Some framework internal reason (generic)
563 DISCONNECT_GENERIC = 2;
564
565 // Network Agent network validation failed, user signaled network unwanted
566 DISCONNECT_UNWANTED = 3;
567
568 // Roaming timed out
569 DISCONNECT_ROAM_WATCHDOG_TIMER = 4;
570
571 // P2P service requested wifi disconnect
572 DISCONNECT_P2P_DISCONNECT_WIFI_REQUEST = 5;
573
574 // SIM was removed while using a SIM config
575 DISCONNECT_RESET_SIM_NETWORKS = 6;
576 }
577
578 // Authentication Failure reasons as reported through the API.
579 enum AuthFailureReason {
580 // Unknown default
581 AUTH_FAILURE_UNKNOWN = 0;
582
583 // The reason code if there is no error during authentication. It could also imply that there no
584 // authentication in progress,
585 AUTH_FAILURE_NONE = 1;
586
587 // The reason code if there was a timeout authenticating.
588 AUTH_FAILURE_TIMEOUT = 2;
589
590 // The reason code if there was a wrong password while authenticating.
591 AUTH_FAILURE_WRONG_PSWD = 3;
592
593 // The reason code if there was EAP failure while authenticating.
594 AUTH_FAILURE_EAP_FAILURE = 4;
595 }
596
597 // What event was this
598 optional EventType type = 1;
599
600 // 80211 death reason code, relevant to NETWORK_DISCONNECTION_EVENTs
601 optional int32 reason = 2 [default = -1];
602
603 // 80211 Association Status code, relevant to ASSOCIATION_REJECTION_EVENTs
604 optional int32 status = 3 [default = -1];
605
606 // Designates whether a NETWORK_DISCONNECT_EVENT was by the STA or AP
607 optional bool local_gen = 4 [default = false];
608
609 // Network information from the WifiConfiguration of a framework initiated connection attempt
610 optional ConfigInfo config_info = 5;
611
612 // RSSI from the last rssi poll (Only valid for active connections)
613 optional int32 last_rssi = 6 [default = -127];
614
615 // Link speed from the last rssi poll (Only valid for active connections)
616 optional int32 last_link_speed = 7 [default = -1];
617
618 // Frequency from the last rssi poll (Only valid for active connections)
619 optional int32 last_freq = 8 [default = -1];
620
621 // Enum used to define bit positions in the supplicant_state_change_bitmask
622 // See {@code frameworks/base/wifi/java/android/net/wifi/SupplicantState.java} for documentation
623 enum SupplicantState {
624 STATE_DISCONNECTED = 0;
625
626 STATE_INTERFACE_DISABLED = 1;
627
628 STATE_INACTIVE = 2;
629
630 STATE_SCANNING = 3;
631
632 STATE_AUTHENTICATING = 4;
633
634 STATE_ASSOCIATING = 5;
635
636 STATE_ASSOCIATED = 6;
637
638 STATE_FOUR_WAY_HANDSHAKE = 7;
639
640 STATE_GROUP_HANDSHAKE = 8;
641
642 STATE_COMPLETED = 9;
643
644 STATE_DORMANT = 10;
645
646 STATE_UNINITIALIZED = 11;
647
648 STATE_INVALID = 12;
649 }
650
651 // Bit mask of all supplicant state changes that occured since the last event
652 optional uint32 supplicant_state_changes_bitmask = 9 [default = 0];
653
654 // The number of milliseconds that have elapsed since the device booted
655 optional int64 start_time_millis = 10 [default = 0];
656
657 optional FrameworkDisconnectReason framework_disconnect_reason = 11 [default = DISCONNECT_UNKNOWN];
658
659 // Flag which indicates if an association rejection event occured due to a timeout
660 optional bool association_timed_out = 12 [default = false];
661
662 // Authentication failure reason, as reported by WifiManager (calculated from state & deauth code)
663 optional AuthFailureReason auth_failure_reason = 13 [default = AUTH_FAILURE_UNKNOWN];
664}