blob: 8dd35affa05d0fd0b1c52e6eb6c69a66ef9bbde1 [file] [log] [blame]
Hugo Benichi50a84c62016-09-02 09:00:59 +09001// LINT: LEGACY_NAMES
2syntax = "proto2";
3
4package clearcut.connectivity;
5
6option java_package = "com.android.server.connectivity.metrics";
7option java_outer_classname = "IpConnectivityLogClass";
8
9// NetworkId represents the id given by the system to a physical network on the
10// Android device. It is used to relates events to each other for devices with
11// multiple networks (WiFi, 4G, ...).
Hugo Benichif6840502017-03-08 11:59:36 +090012// Deprecated since version 3, replaced by top-level network_id field in
13// IpConnectivityEvent.
Hugo Benichi50a84c62016-09-02 09:00:59 +090014message NetworkId {
15 // Every network gets assigned a network_id on creation based on order of
16 // creation. Thus network_id N is assigned to the network created directly
17 // after network N-1. Thus there is no PII involved here. Zero means no
18 // network. The value 0 is never assigned to a network.
19 optional int32 network_id = 1;
20};
21
Hugo Benichi4e89a022017-01-05 17:08:31 +090022// LinkLayer describes a physical link layer technology used by a network.
23// It is not intended to map one to one to the TRANSPORT_* constants defined in
24// android.net.NetworkCapabilities. Instead it is intended to be used as
25// a dimension field for metrics events and aggregated metrics.
Hugo Benichi6022f7b2017-06-20 11:15:14 +090026// Next tag: 10
Hugo Benichi4e89a022017-01-05 17:08:31 +090027enum LinkLayer {
28 // An unknown link layer technology.
Hugo Benichi807124a2016-11-24 11:25:01 +090029 UNKNOWN = 0;
Hugo Benichi4e89a022017-01-05 17:08:31 +090030
Hugo Benichi807124a2016-11-24 11:25:01 +090031 BLUETOOTH = 1;
32 CELLULAR = 2;
33 ETHERNET = 3;
34 WIFI = 4;
Hugo Benichi6022f7b2017-06-20 11:15:14 +090035 WIFI_P2P = 7;
36 WIFI_NAN = 8; // Also known as WiFi Aware
37 LOWPAN = 9;
Hugo Benichi4e89a022017-01-05 17:08:31 +090038
39 // Indicates that the link layer dimension is not relevant for the metrics or
40 // event considered.
41 NONE = 5;
42
43 // Indicates that the metrics or event considered may involve several links.
44 MULTIPLE = 6;
Hugo Benichi807124a2016-11-24 11:25:01 +090045};
46
Hugo Benichi7c3a7862016-11-24 11:34:49 +090047// A pair of (key, value) integers for describing histogram-like statistics.
48message Pair {
49 optional int32 key = 1;
50 optional int32 value = 2;
51};
52
Hugo Benichi6022f7b2017-06-20 11:15:14 +090053// An event record when the system default network disconnects or the system
54// switches to a new default network.
55// Next tag: 10.
Hugo Benichi50a84c62016-09-02 09:00:59 +090056message DefaultNetworkEvent {
Hugo Benichi50a84c62016-09-02 09:00:59 +090057
Hugo Benichi6022f7b2017-06-20 11:15:14 +090058 // Reason why this network stopped being the default.
59 enum LostReason {
60 UNKNOWN = 0;
61 OUTSCORED = 1;
62 INVALIDATION = 2;
63 DISCONNECT = 3;
64 };
Hugo Benichi50a84c62016-09-02 09:00:59 +090065
66 // Whether the network supports IPv4, IPv6, or both.
67 enum IPSupport {
68 NONE = 0;
69 IPV4 = 1;
70 IPV6 = 2;
71 DUAL = 3;
72 };
73
Hugo Benichi6022f7b2017-06-20 11:15:14 +090074 // Duration in milliseconds when this network was the default.
75 // Since version 4
76 optional int64 default_network_duration_ms = 5;
77
78 // Duration in milliseconds without a default network before this network
79 // became the default.
80 // Since version 4
81 optional int64 no_default_network_duration_ms = 6;
82
83 // Network score of this network when it became the default network.
84 // Since version 4
85 optional int64 initial_score = 7;
86
87 // Network score of this network when it stopped being the default network.
88 // Since version 4
89 optional int64 final_score = 8;
90
91 // Best available information about IP support of this default network.
92 // Since version 4
93 optional IPSupport ip_support = 9;
94
95
96 // Deprecated fields
97
98 // A value of 0 means this is a loss of the system default network.
99 // Deprecated since version 3. Replaced by top level network_id.
100 optional NetworkId network_id = 1 [deprecated = true];
101
102 // A value of 0 means there was no previous default network.
103 // Deprecated since version 3. Replaced by previous_default_network_id.
104 optional NetworkId previous_network_id = 2 [deprecated = true];
105
Hugo Benichi50a84c62016-09-02 09:00:59 +0900106 // Best available information about IP support of the previous network when
107 // disconnecting or switching to a new default network.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900108 // Deprecated since version 3. Replaced by ip_support field.
109 optional IPSupport previous_network_ip_support = 3 [deprecated = true];
Hugo Benichi50a84c62016-09-02 09:00:59 +0900110
111 // The transport types of the new default network, represented by
112 // TRANSPORT_* constants as defined in NetworkCapabilities.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900113 // Deprecated since version 3. Replaced by top-level transports field.
114 repeated int32 transport_types = 4 [deprecated = true];
Hugo Benichi50a84c62016-09-02 09:00:59 +0900115};
116
117// Logs IpReachabilityMonitor probe events and NUD_FAILED events.
118// This message is associated to android.net.metrics.IpReachabilityEvent.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900119// Next tag: 3.
Hugo Benichi50a84c62016-09-02 09:00:59 +0900120message IpReachabilityEvent {
121 // The interface name (wlan, rmnet, lo, ...) on which the probe was sent.
Hugo Benichi4e89a022017-01-05 17:08:31 +0900122 // Deprecated since version 2, to be replaced by link_layer field.
Hugo Benichi807124a2016-11-24 11:25:01 +0900123 optional string if_name = 1 [deprecated = true];
Hugo Benichi50a84c62016-09-02 09:00:59 +0900124
125 // The event type code of the probe, represented by constants defined in
126 // android.net.metrics.IpReachabilityEvent.
Hugo Benichid680d4c2016-10-13 13:16:16 +0900127 // NUD_FAILED_ORGANIC and PROVISIONING_LOST_ORGANIC recorded since version 1.
Hugo Benichi50a84c62016-09-02 09:00:59 +0900128 optional int32 event_type = 2;
129};
130
131// Logs NetworkMonitor and ConnectivityService events related to the state of
132// a network: connection, evaluation, validation, lingering, and disconnection.
133// This message is associated to android.net.metrics.NetworkEvent.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900134// Next tag: 4.
Hugo Benichi50a84c62016-09-02 09:00:59 +0900135message NetworkEvent {
136 // The id of the network on which this event happened.
Hugo Benichif6840502017-03-08 11:59:36 +0900137 // Deprecated since version 3.
138 optional NetworkId network_id = 1 [deprecated = true];
Hugo Benichi50a84c62016-09-02 09:00:59 +0900139
140 // The type of network event, represented by NETWORK_* constants defined in
141 // android.net.metrics.NetworkEvent.
142 optional int32 event_type = 2;
143
144 // Only valid after finishing evaluating a network for Internet connectivity.
145 // The time it took for this evaluation to complete.
146 optional int32 latency_ms = 3;
147}
148
149// Logs individual captive portal probing events that are performed when
150// evaluating or reevaluating networks for Internet connectivity.
151// This message is associated to android.net.metrics.ValidationProbeEvent.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900152// Next tag: 5.
Hugo Benichi50a84c62016-09-02 09:00:59 +0900153message ValidationProbeEvent {
154 // The id of the network for which the probe was sent.
Hugo Benichif6840502017-03-08 11:59:36 +0900155 // Deprecated since version 3.
156 optional NetworkId network_id = 1 [deprecated = true];
Hugo Benichi50a84c62016-09-02 09:00:59 +0900157
158 // The time it took for that probe to complete or time out.
159 optional int32 latency_ms = 2;
160
161 // The type of portal probe, represented by PROBE_* constants defined in
162 // android.net.metrics.ValidationProbeEvent.
163 optional int32 probe_type = 3;
164
165 // The http code result of the probe test.
166 optional int32 probe_result = 4;
167}
168
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900169// Logs DNS lookup latencies.
Hugo Benichi50a84c62016-09-02 09:00:59 +0900170// This message is associated to android.net.metrics.DnsEvent.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900171// Next tag: 11
Hugo Benichi50a84c62016-09-02 09:00:59 +0900172message DNSLookupBatch {
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900173
174 // The time it took for successful DNS lookups to complete.
175 // The number of repeated values can be less than getaddrinfo_query_count
176 // + gethostbyname_query_count in case of event rate-limiting.
177 repeated int32 latencies_ms = 4;
178
179 // The total number of getaddrinfo queries.
180 // Since version 4.
181 optional int64 getaddrinfo_query_count = 5;
182
183 // The total number of gethostbyname queries.
184 // Since version 4.
185 optional int64 gethostbyname_query_count = 6;
186
187 // The total number of getaddrinfo errors.
188 // Since version 4.
189 optional int64 getaddrinfo_error_count = 7;
190
191 // The total number of gethostbyname errors.
192 // Since version 4.
193 optional int64 gethostbyname_error_count = 8;
194
195 // Counts of all errors returned by getaddrinfo.
196 // The Pair key field is the getaddrinfo error value.
197 // The value field is the count for that return value.
198 // Since version 4
199 repeated Pair getaddrinfo_errors = 9;
200
201 // Counts of all errors returned by gethostbyname.
202 // The Pair key field is the gethostbyname errno value.
203 // the Pair value field is the count for that errno code.
204 // Since version 4
205 repeated Pair gethostbyname_errors = 10;
206
207
208 // Deprecated fields
209
Hugo Benichi50a84c62016-09-02 09:00:59 +0900210 // The id of the network on which the DNS lookups took place.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900211 // Deprecated since version 3.
212 optional NetworkId network_id = 1 [deprecated = true];
Hugo Benichi50a84c62016-09-02 09:00:59 +0900213
214 // The types of the DNS lookups, as defined in android.net.metrics.DnsEvent.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900215 // Deprecated since version 3.
216 repeated int32 event_types = 2 [deprecated = true];
Hugo Benichi50a84c62016-09-02 09:00:59 +0900217
218 // The return values of the DNS resolver for each DNS lookups.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900219 // Deprecated since version 3.
220 repeated int32 return_codes = 3 [deprecated = true];
Hugo Benichi50a84c62016-09-02 09:00:59 +0900221};
222
Hugo Benichi7c3a7862016-11-24 11:34:49 +0900223// Represents a collections of DNS lookup latencies and counters for a
224// particular combination of DNS query type and return code.
225// Since version 2.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900226// Next tag: 7.
Hugo Benichi7c3a7862016-11-24 11:34:49 +0900227message DNSLatencies {
228 // The type of the DNS lookups, as defined in android.net.metrics.DnsEvent.
229 // Acts as a key for a set of DNS query results.
230 // Possible values are: 0 for getaddrinfo, 1 for gethostbyname.
231 optional int32 type = 1;
232
233 // The return value of the DNS resolver for the DNS lookups.
234 // Acts as a key for a set of DNS query results.
235 // Possible values are: 0 for success, or errno code for failures.
236 optional int32 return_code = 2;
237
238 // The number of query operations recorded.
239 optional int32 query_count = 3;
240
241 // The number of query operations returning A IPv4 records.
242 optional int32 a_count = 4;
243
244 // The number of query operations returning AAAA IPv6 records.
245 optional int32 aaaa_count = 5;
246
247 // The time it took for each DNS lookup to complete. The number of repeated
248 // values can be less than query_count in case of event rate-limiting.
249 repeated int32 latencies_ms = 6;
250};
251
252// Represents latency and errno statistics of the connect() system call.
253// Since version 2.
Hugo Benichif6840502017-03-08 11:59:36 +0900254// Next tag: 7
Hugo Benichi7c3a7862016-11-24 11:34:49 +0900255message ConnectStatistics {
256 // The number of connect() operations recorded.
257 optional int32 connect_count = 1;
258
Hugo Benichif6840502017-03-08 11:59:36 +0900259 // The number of connect() operations done in blocking mode.
260 // Since version 3.
261 optional int32 connect_blocking_count = 5;
262
Hugo Benichi7c3a7862016-11-24 11:34:49 +0900263 // The number of connect() operations with IPv6 socket address.
264 optional int32 ipv6_addr_count = 2;
265
Hugo Benichif6840502017-03-08 11:59:36 +0900266 // The time it took for successful blocking connect() operations to complete
267 // The number of repeated values can be less than connect_blocking_count in
268 // case of event rate-limiting.
Hugo Benichi7c3a7862016-11-24 11:34:49 +0900269 repeated int32 latencies_ms = 3;
270
Hugo Benichif6840502017-03-08 11:59:36 +0900271 // The time it took for successful connect() operation to complete in
272 // non-blocking mode. The number of repeated values can be less than
273 // connect_count - connect_blocking_count in case of event rate-limiting.
274 repeated int32 non_blocking_latencies_ms = 6;
275
Hugo Benichi7c3a7862016-11-24 11:34:49 +0900276 // Counts of all error values returned by failed connect() operations.
277 // The Pair key field is the errno code. The Pair value field is the count
278 // for that errno code.
279 repeated Pair errnos_counters = 4;
280};
281
Hugo Benichi50a84c62016-09-02 09:00:59 +0900282// Represents a DHCP event on a single interface, which can be a DHCPClient
283// state transition or a response packet parsing error.
284// This message is associated to android.net.metrics.DhcpClientEvent and
285// android.net.metrics.DhcpErrorEvent.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900286// Next tag: 5
Hugo Benichi50a84c62016-09-02 09:00:59 +0900287message DHCPEvent {
288 // The interface name (wlan, rmnet, lo, ...) on which the event happened.
Hugo Benichi4e89a022017-01-05 17:08:31 +0900289 // Deprecated since version 2, to be replaced by link_layer field.
Hugo Benichi807124a2016-11-24 11:25:01 +0900290 optional string if_name = 1 [deprecated = true];
Hugo Benichi50a84c62016-09-02 09:00:59 +0900291
292 oneof value {
293 // The name of a state in the DhcpClient state machine, represented by
294 // the inner classes of android.net.dhcp.DhcpClient.
295 string state_transition = 2;
296
297 // The error code of a DHCP error, represented by constants defined in
298 // android.net.metrics.DhcpErrorEvent.
299 int32 error_code = 3;
300 }
301
302 // Lifetime duration in milliseconds of a DhcpClient state, or transition
303 // time in milliseconds between specific pairs of DhcpClient's states.
Hugo Benichid680d4c2016-10-13 13:16:16 +0900304 // Only populated since version 1, when state_transition is populated.
Hugo Benichi50a84c62016-09-02 09:00:59 +0900305 optional int32 duration_ms = 4;
306}
307
308// Represents the generation of an Android Packet Filter program.
Hugo Benichid680d4c2016-10-13 13:16:16 +0900309// Since version 1.
Hugo Benichif6840502017-03-08 11:59:36 +0900310// Next tag: 8
Hugo Benichi50a84c62016-09-02 09:00:59 +0900311message ApfProgramEvent {
Hugo Benichif6840502017-03-08 11:59:36 +0900312 // Maximum lifetime of the program in seconds.
Hugo Benichi50a84c62016-09-02 09:00:59 +0900313 optional int64 lifetime = 1;
314
Hugo Benichif6840502017-03-08 11:59:36 +0900315 // Effective lifetime of the program in seconds from the time the
316 // program was installed to the time it was replaced or removed.
317 optional int64 effective_lifetime = 7;
318
Hugo Benichi50a84c62016-09-02 09:00:59 +0900319 // Number of RAs filtered by the APF program.
320 optional int32 filtered_ras = 2;
321
322 // Total number of RAs to filter currently tracked by ApfFilter. Can be more
323 // than filtered_ras if all available program size was exhausted.
324 optional int32 current_ras = 3;
325
326 // Length of the APF program in bytes.
327 optional int32 program_length = 4;
328
329 // True if the APF program is dropping multicast and broadcast traffic.
330 optional bool drop_multicast = 5;
331
332 // True if the interface on which APF runs has an IPv4 address.
333 optional bool has_ipv4_addr = 6;
334}
335
336// Represents Router Advertisement listening statistics for an interface with
337// Android Packet Filter enabled.
Hugo Benichid680d4c2016-10-13 13:16:16 +0900338// Since version 1.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900339// Next tag: 15
Hugo Benichi50a84c62016-09-02 09:00:59 +0900340message ApfStatistics {
341 // The time interval in milliseconds these stastistics cover.
342 optional int64 duration_ms = 1;
343
344 // The total number of received RAs.
345 optional int32 received_ras = 2;
346
347 // The total number of received RAs that matched a known RA.
348 optional int32 matching_ras = 3;
349
350 // The total number of received RAs ignored due to the MAX_RAS limit.
351 optional int32 dropped_ras = 5;
352
353 // The total number of received RAs with an effective lifetime of 0 seconds.
354 // Effective lifetime for APF is the minimum of all lifetimes in a RA.
355 optional int32 zero_lifetime_ras = 6;
356
357 // The total number of received RAs that could not be parsed.
358 optional int32 parse_errors = 7;
359
360 // The total number of APF program updates triggered by an RA reception.
361 optional int32 program_updates = 8;
362
363 // The maximum APF program size in byte advertised by hardware.
364 optional int32 max_program_size = 9;
Hugo Benichif6840502017-03-08 11:59:36 +0900365
366 // The total number of successful APF program updates triggered by any state
367 // change in ApfFilter. Since version 3.
368 optional int32 program_updates_all = 10;
369
370 // The total number of APF program updates triggered when disabling the
371 // multicast filter. Since version 3.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900372 // Since version 4.
Hugo Benichif6840502017-03-08 11:59:36 +0900373 optional int32 program_updates_allowing_multicast = 11;
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900374
375 // The total number of packets processed by the APF interpreter.
376 // Since version 4.
377 optional int32 total_packet_processed = 12;
378
379 // The total number of packets dropped by the APF interpreter.
380 // Since version 4.
381 optional int32 total_packet_dropped = 13;
382
383 // List of hardware counters collected by the APF interpreter.
384 // The Pair key is the counter id, defined in android.net.metrics.ApfStats.
385 // The Pair value is the counter value.
386 // Since version 4.
387 repeated Pair hardware_counters = 14;
Hugo Benichi50a84c62016-09-02 09:00:59 +0900388}
389
390// Represents the reception of a Router Advertisement packet for an interface
391// with Android Packet Filter enabled.
Hugo Benichid680d4c2016-10-13 13:16:16 +0900392// Since version 1.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900393// Next tag: 7.
Hugo Benichi50a84c62016-09-02 09:00:59 +0900394message RaEvent {
395 // All lifetime values are expressed in seconds. The default value for an
396 // option lifetime that was not present in the RA option list is -1.
397 // The lifetime of an option (e.g., the Prefix Information Option) is the
398 // minimum lifetime of all such options in the packet.
399
400 // The value of the router lifetime in the RA packet.
401 optional int64 router_lifetime = 1;
402
403 // Prefix valid lifetime from the prefix information option.
404 optional int64 prefix_valid_lifetime = 2;
405
406 // Prefix preferred lifetime from the prefix information option.
407 optional int64 prefix_preferred_lifetime = 3;
408
409 // Route info lifetime.
410 optional int64 route_info_lifetime = 4;
411
412 // Recursive DNS server lifetime.
413 optional int64 rdnss_lifetime = 5;
414
415 // DNS search list lifetime.
416 optional int64 dnssl_lifetime = 6;
417}
418
419// Represents an IP provisioning event in IpManager and how long the
420// provisioning action took.
421// This message is associated to android.net.metrics.IpManagerEvent.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900422// Next tag: 4.
Hugo Benichi50a84c62016-09-02 09:00:59 +0900423message IpProvisioningEvent {
424 // The interface name (wlan, rmnet, lo, ...) on which the probe was sent.
Hugo Benichi4e89a022017-01-05 17:08:31 +0900425 // Deprecated since version 2, to be replaced by link_layer field.
Hugo Benichi807124a2016-11-24 11:25:01 +0900426 optional string if_name = 1 [deprecated = true];
Hugo Benichi50a84c62016-09-02 09:00:59 +0900427
428 // The code of the IP provisioning event, represented by constants defined in
429 // android.net.metrics.IpManagerEvent.
430 optional int32 event_type = 2;
431
432 // The duration of the provisioning action that resulted in this event.
433 optional int32 latency_ms = 3;
434}
435
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900436// Represents statistics from a single android Network.
437// Since version 4. Replace NetworkEvent.
438// Next tag: 9.
439message NetworkStats {
440
441 // Duration of this Network lifecycle in milliseconds.
442 optional int64 duration_ms = 1;
443
444 // Information about IP support of this network.
445 optional DefaultNetworkEvent.IPSupport ip_support = 2;
446
447 // True if the network was validated at least once.
448 optional bool ever_validated = 3;
449
450 // True if a captive portal was found at least once on this network.
451 optional bool portal_found = 4;
452
453 // Total number of times no connectivity was reported for this network.
454 optional int32 no_connectivity_reports = 5;
455
456 // Total number of validation attempts.
457 optional int32 validation_attempts = 6;
458
459 // Results from all validation attempts.
460 // The Pair key is the result:
461 // 0 -> unvalidated
462 // 1 -> validated
463 // 2 -> captive portal
464 // The Pair value is the duration of the validation attempts in milliseconds.
465 repeated Pair validation_events = 7;
466
467 // Time series of validation states in time order.
468 // The Pair key is the state:
469 // 0 -> unvalidated
470 // 1 -> validated
471 // 2 -> captive portal,
472 // The Pair value is the duration of that state in milliseconds.
473 repeated Pair validation_states = 8;
474}
475
Hugo Benichi60c9f632017-09-05 13:34:48 +0900476// Represents statistics from NFLOG wakeup events due to ingress packets.
477// Since oc-mr1.
478// Next tag: 8.
479message WakeupStats {
480 // The time duration in seconds covered by these stats, for deriving
481 // exact wakeup rates.
482 optional int64 duration_sec = 1;
483
484 // The total number of ingress packets waking up the device.
485 optional int64 total_wakeups = 2;
486
487 // The total number of wakeup packets routed to a socket belonging to
488 // the root uid (uid 0).
489 optional int64 root_wakeups = 3;
490
491 // The total number of wakeup packets routed to a socket belonging to
492 // the system server (uid 1000).
493 optional int64 system_wakeups = 4;
494
495 // The total number of wakeup packets routed to a socket belonging to
496 // an application (uid > 9999).
497 optional int64 application_wakeups = 5;
498
499 // The total number of wakeup packets routed to a socket belonging to another
500 // uid than the root uid, system uid, or an application uid (any uid in
501 // between [1001, 9999]. See android.os.Process for possible uids.
502 optional int64 non_application_wakeups = 6;
503
Hugo Benichi175b5742017-09-19 13:15:26 +0900504 // The total number of wakeup packets with no associated socket or uid.
505 optional int64 no_uid_wakeups = 7;
Hugo Benichi60c9f632017-09-05 13:34:48 +0900506}
507
Hugo Benichi50a84c62016-09-02 09:00:59 +0900508// Represents one of the IP connectivity event defined in this file.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900509// Next tag: 20
Hugo Benichi50a84c62016-09-02 09:00:59 +0900510message IpConnectivityEvent {
511 // Time in ms when the event was recorded.
512 optional int64 time_ms = 1;
513
Hugo Benichi4e89a022017-01-05 17:08:31 +0900514 // Physical link layer of the network on which the event happened.
515 // Acts as a dimension key.
Hugo Benichi807124a2016-11-24 11:25:01 +0900516 // Since version 2.
Hugo Benichi4e89a022017-01-05 17:08:31 +0900517 optional LinkLayer link_layer = 15;
Hugo Benichi807124a2016-11-24 11:25:01 +0900518
Hugo Benichif6840502017-03-08 11:59:36 +0900519 // Represents the id given by the system to a physical network on the device.
520 // Every network gets assigned a unique id on creation from a monotonic
521 // counter. The value 0 is never assigned to a network and means no network.
522 // It is used to correlate different types of events to each other for devices
523 // with multiple networks (WiFi, 4G, ...).
524 // Since version 3.
525 optional int32 network_id = 16;
526
527 // The interface name (wlan, rmnet, lo, ...) on which the event happened.
528 // Present if the link_layer field was not inferred from the if_name on
529 // the device, so that post-processing of the serialized proto can backfill
530 // link_layer. Since version 3.
531 optional string if_name = 17;
532
533 // The transport types of the network on which the event happened, expressed
534 // as a bit field of TRANSPORT_* constants as defined in NetworkCapabilities.
535 // Present if the link_layer field was not inferred from the transport types,
536 // so that post-processing of the serialized proto can backfill link_layer
537 // Since version 3.
538 optional int64 transports = 18;
539
Hugo Benichi50a84c62016-09-02 09:00:59 +0900540 oneof event {
541
542 // An event about the system default network.
543 DefaultNetworkEvent default_network_event = 2;
544
545 // An IP reachability probe event.
546 IpReachabilityEvent ip_reachability_event = 3;
547
548 // A network lifecycle event.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900549 NetworkEvent network_event = 4 [deprecated = true];
Hugo Benichi50a84c62016-09-02 09:00:59 +0900550
551 // A batch of DNS lookups.
Hugo Benichi4e89a022017-01-05 17:08:31 +0900552 // Deprecated in the nyc-mr2 release since version 2,and replaced by
553 // dns_latencies.
Hugo Benichi7c3a7862016-11-24 11:34:49 +0900554 DNSLookupBatch dns_lookup_batch = 5 [deprecated = true];
555
556 // DNS lookup latency statistics.
557 DNSLatencies dns_latencies = 13;
558
559 // Connect latency and errno statistics.
560 ConnectStatistics connect_statistics = 14;
Hugo Benichi50a84c62016-09-02 09:00:59 +0900561
562 // A DHCP client event or DHCP receive error.
563 DHCPEvent dhcp_event = 6;
564
565 // An IP provisioning event.
566 IpProvisioningEvent ip_provisioning_event = 7;
567
568 // A network validation probe event.
569 ValidationProbeEvent validation_probe_event = 8;
570
571 // An Android Packet Filter program event.
572 ApfProgramEvent apf_program_event = 9;
573
574 // An Android Packet Filter statistics event.
575 ApfStatistics apf_statistics = 10;
576
577 // An RA packet reception event.
578 RaEvent ra_event = 11;
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900579
580 // Network statistics.
581 NetworkStats network_stats = 19;
Hugo Benichi60c9f632017-09-05 13:34:48 +0900582
583 // Ingress packet wakeup statistics.
584 WakeupStats wakeup_stats = 20;
Hugo Benichi50a84c62016-09-02 09:00:59 +0900585 };
586};
587
588// The information about IP connectivity events.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900589// Next tag: 4.
Hugo Benichi50a84c62016-09-02 09:00:59 +0900590message IpConnectivityLog {
591 // An array of IP connectivity events.
592 repeated IpConnectivityEvent events = 1;
593
594 // The number of events that had to be dropped due to a full buffer.
595 optional int32 dropped_events = 2;
Hugo Benichid680d4c2016-10-13 13:16:16 +0900596
597 // The version number of the metrics events being collected.
Hugo Benichif6840502017-03-08 11:59:36 +0900598 // nyc: not populated, implicitly 0.
Hugo Benichi807124a2016-11-24 11:25:01 +0900599 // nyc-dr1: not populated, implicitly 1 (sailfish and marlin only).
600 // nyc-mr1: not populated, implicitly 1.
601 // nyc-mr2: 2.
Hugo Benichif6840502017-03-08 11:59:36 +0900602 // oc: 3.
Hugo Benichi6022f7b2017-06-20 11:15:14 +0900603 // oc-dr1: 4.
Hugo Benichid680d4c2016-10-13 13:16:16 +0900604 optional int32 version = 3;
Hugo Benichi50a84c62016-09-02 09:00:59 +0900605};