xref: /aosp_15_r20/external/ot-br-posix/src/proto/thread_telemetry.proto (revision 4a64e381480ef79f0532b2421e44e6ee336b8e0d)
1/*
2 *  Copyright (c) 2023, The OpenThread Authors.
3 *  All rights reserved.
4 *
5 *  Redistribution and use in source and binary forms, with or without
6 *  modification, are permitted provided that the following conditions are met:
7 *  1. Redistributions of source code must retain the above copyright
8 *     notice, this list of conditions and the following disclaimer.
9 *  2. Redistributions in binary form must reproduce the above copyright
10 *     notice, this list of conditions and the following disclaimer in the
11 *     documentation and/or other materials provided with the distribution.
12 *  3. Neither the name of the copyright holder nor the
13 *     names of its contributors may be used to endorse or promote products
14 *     derived from this software without specific prior written permission.
15 *
16 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 *  POSSIBILITY OF SUCH DAMAGE.
27 */
28syntax = "proto2";
29option optimize_for = LITE_RUNTIME;
30
31package threadnetwork;
32
33// Thread Telemetry data definition.
34// The field range for your data definition is determined as:
35// ---------------------------------------------------------------------------
36// | Field Range  | Logging From
37// | [1 - 500)    | Primary fields logged from OTBR-agent/OpenThread.
38// | [500-600)    | OTBR vendor fields logged from OTBR-agent/OpenThread.
39// | Other        | Reserved for now.
40// ---------------------------------------------------------------------------
41// Usage:
42// Delete field: do not directly delete field. Deprecate it instead.
43message TelemetryData {
44  message Duration {
45    // Signed seconds of the span of time. Must be from -315,576,000,000
46    // to +315,576,000,000 inclusive. Note: these bounds are computed from:
47    // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
48    optional int64 seconds = 1;
49
50    // Signed fractions of a second at nanosecond resolution of the span
51    // of time. Durations less than one second are represented with a 0
52    // `seconds` field and a positive or negative `nanos` field. For durations
53    // of one second or more, a non-zero value for the `nanos` field must be
54    // of the same sign as the `seconds` field. Must be from -999,999,999
55    // to +999,999,999 inclusive.
56    optional int32 nanos = 2;
57  }
58
59  message WpanStats {
60    optional int32 phy_rx = 1;
61    optional int32 phy_tx = 2;
62    optional int32 mac_unicast_rx = 3;
63    optional int32 mac_unicast_tx = 4;
64    optional int32 mac_broadcast_rx = 5;
65    optional int32 mac_broadcast_tx = 6;
66    optional int32 mac_tx_ack_req = 7;
67    optional int32 mac_tx_no_ack_req = 8;
68    optional int32 mac_tx_acked = 9;
69    optional int32 mac_tx_data = 10;
70    optional int32 mac_tx_data_poll = 11;
71    optional int32 mac_tx_beacon = 12;
72    optional int32 mac_tx_beacon_req = 13;
73    optional int32 mac_tx_other_pkt = 14;
74    optional int32 mac_tx_retry = 15;
75    optional int32 mac_rx_data = 16;
76    optional int32 mac_rx_data_poll = 17;
77    optional int32 mac_rx_beacon = 18;
78    optional int32 mac_rx_beacon_req = 19;
79    optional int32 mac_rx_other_pkt = 20;
80    optional int32 mac_rx_filter_whitelist = 21;
81    optional int32 mac_rx_filter_dest_addr = 22;
82    optional int32 mac_tx_fail_cca = 23;
83    optional int32 mac_rx_fail_decrypt = 24;
84    optional int32 mac_rx_fail_no_frame = 25;
85    optional int32 mac_rx_fail_unknown_neighbor = 26;
86    optional int32 mac_rx_fail_invalid_src_addr = 27;
87    optional int32 mac_rx_fail_fcs = 28;
88    optional int32 mac_rx_fail_other = 29;
89    optional int32 ip_tx_success = 30;
90    optional int32 ip_rx_success = 31;
91    optional int32 ip_tx_failure = 32;
92    optional int32 ip_rx_failure = 33;
93    optional uint32 node_type = 34;
94    optional uint32 channel = 35;
95    optional int32 radio_tx_power = 36;
96    optional float mac_cca_fail_rate = 37;
97  }
98
99  message WpanTopoFull {
100    optional uint32 rloc16 = 1;
101    optional uint32 router_id = 2;
102    optional uint32 leader_router_id = 3;
103    // Deprecate bytes ext_address.
104    reserved 4;
105    optional bytes leader_address = 5;
106    optional uint32 leader_weight = 6;
107    optional uint32 leader_local_weight = 7;
108    optional bytes network_data = 8;
109    optional uint32 network_data_version = 9;
110    optional bytes stable_network_data = 10;
111    optional uint32 stable_network_data_version = 11;
112    optional uint32 preferred_router_id = 12;
113    optional uint32 partition_id = 13;
114    optional uint32 child_table_size = 14;
115    optional uint32 neighbor_table_size = 15;
116    optional int32 instant_rssi = 16;
117    optional uint64 extended_pan_id = 17;
118    // Indicates the number peer BR in Thread mesh network (from network data)
119    optional uint32 peer_br_count = 18;
120  }
121
122  message TopoEntry {
123    // deprecate bytes ext_address.
124    reserved 1;
125    optional uint32 rloc16 = 2;
126    // link quality with data range: 0~3.
127    optional uint32 link_quality_in = 3;
128    // the most recent RSSI measurement (8 bit).
129    optional int32 average_rssi = 4;
130    optional Duration age = 5;
131    optional bool rx_on_when_idle = 6;
132    optional bool full_function = 7;
133    optional bool secure_data_request = 8;
134    optional bool full_network_data = 9;
135    optional int32 last_rssi = 10;
136    optional uint32 link_frame_counter = 11;
137    optional uint32 mle_frame_counter = 12;
138    optional bool is_child = 13;
139    optional Duration timeout = 14;
140    optional uint32 network_data_version = 15;
141    optional float mac_frame_error_rate = 16;
142    optional float ip_message_error_rate = 17;
143    optional int32 version = 18;
144  }
145
146  enum NodeType {
147    NODE_TYPE_UNSPECIFIED = 0;
148    NODE_TYPE_ROUTER = 1;
149    NODE_TYPE_END = 2;
150    NODE_TYPE_SLEEPY_END = 3;
151    NODE_TYPE_MINIMAL_END = 4;
152
153    NODE_TYPE_OFFLINE = 5;
154    NODE_TYPE_DISABLED = 6;
155    NODE_TYPE_DETACHED = 7;
156
157    NODE_TYPE_NL_LURKER = 0x10;
158    NODE_TYPE_COMMISSIONER = 0x20;
159    NODE_TYPE_LEADER = 0x40;
160  }
161
162  message PacketsAndBytes {
163    optional int64 packet_count = 1;
164    optional int64 byte_count = 2;
165  }
166
167  message Nat64TrafficCounters {
168    optional int64 ipv4_to_ipv6_packets = 1;
169    optional int64 ipv4_to_ipv6_bytes = 2;
170    optional int64 ipv6_to_ipv4_packets = 3;
171    optional int64 ipv6_to_ipv4_bytes = 4;
172  }
173
174  message Nat64ProtocolCounters {
175    optional Nat64TrafficCounters tcp = 1;
176    optional Nat64TrafficCounters udp = 2;
177    optional Nat64TrafficCounters icmp = 3;
178  }
179
180  message Nat64PacketCounters {
181    optional int64 ipv4_to_ipv6_packets = 1;
182    optional int64 ipv6_to_ipv4_packets = 2;
183  }
184
185  message Nat64ErrorCounters {
186    optional Nat64PacketCounters unknown = 1;
187    optional Nat64PacketCounters illegal_packet = 2;
188    optional Nat64PacketCounters unsupported_protocol = 3;
189    optional Nat64PacketCounters no_mapping = 4;
190  }
191
192  message BorderRoutingCounters {
193    reserved 1 to 8;
194    // The number of Router Advertisement packets received by otbr-agent on the
195    // infra link
196    optional int64 ra_rx = 9;
197
198    // The number of Router Advertisement packets successfully transmitted by
199    // otbr-agent on the infra link.
200    optional int64 ra_tx_success = 10;
201
202    // The number of Router Advertisement packets failed to transmit by
203    // otbr-agent on the infra link.
204    optional int64 ra_tx_failure = 11;
205
206    // The number of Router Solicitation packets received by otbr-agent on the
207    // infra link
208    optional int64 rs_rx = 12;
209
210    // The number of Router Solicitation packets successfully transmitted by
211    // otbr-agent on the infra link.
212    optional int64 rs_tx_success = 13;
213
214    // The number of Router Solicitation packets failed to transmit by
215    // otbr-agent on the infra link.
216    optional int64 rs_tx_failure = 14;
217
218    // The counters for inbound unicast packets
219    optional PacketsAndBytes inbound_unicast = 15;
220
221    // The counters for inbound multicast packets
222    optional PacketsAndBytes inbound_multicast = 16;
223
224    // The counters for outbound unicast packets
225    optional PacketsAndBytes outbound_unicast = 17;
226
227    // The counters for outbound multicast packets
228    optional PacketsAndBytes outbound_multicast = 18;
229
230    // The inbound and outbound NAT64 traffic through the border router
231    optional Nat64ProtocolCounters nat64_protocol_counters = 19;
232
233    // Error counters for NAT64 translator on the border router
234    optional Nat64ErrorCounters nat64_error_counters = 20;
235
236    // The counter for inbound Internet when DHCPv6 PD enabled
237    optional PacketsAndBytes inbound_internet = 21;
238
239    // The counter for outbound Internet when DHCPv6 PD enabled
240    optional PacketsAndBytes outbound_internet = 22;
241  }
242
243  enum Dhcp6PdState {
244    DHCP6_PD_STATE_UNSPECIFIED = 0;
245
246    // DHCPv6 PD is disabled on the border router.
247    DHCP6_PD_STATE_DISABLED = 1;
248
249    // DHCPv6 PD is enabled but won't try to request and publish a prefix.
250    DHCP6_PD_STATE_STOPPED = 2;
251
252    // DHCPv6 PD is enabled and will try to request and publish a prefix.
253    DHCP6_PD_STATE_RUNNING = 3;
254  }
255
256  message PdProcessedRaInfo {
257    // The number of platform generated RA handled by ApplyPlatfromGeneratedRa.
258    optional uint32 num_platform_ra_received = 1;
259
260    // The number of PIO processed for adding OMR prefixes.
261    optional uint32 num_platform_pio_processed = 2;
262
263    // The timestamp of last processed RA message.
264    optional uint32 last_platform_ra_msec = 3;
265  }
266
267  message SrpServerRegistrationInfo {
268    // The number of active hosts/services registered on the SRP server.
269    optional uint32 fresh_count = 1;
270
271    // The number of hosts/services in 'Deleted' state on the SRP server.
272    optional uint32 deleted_count = 2;
273
274    // The sum of lease time in milliseconds of all active hosts/services on the
275    // SRP server.
276    optional uint64 lease_time_total_ms = 3;
277
278    // The sum of key lease time in milliseconds of all active hosts/services on
279    // the SRP server.
280    optional uint64 key_lease_time_total_ms = 4;
281
282    // The sum of remaining lease time in milliseconds of all active
283    // hosts/services on the SRP server.
284    optional uint64 remaining_lease_time_total_ms = 5;
285
286    // The sum of remaining key lease time in milliseconds of all active
287    // hosts/services on the SRP server.
288    optional uint64 remaining_key_lease_time_total_ms = 6;
289  }
290
291  message SrpServerResponseCounters {
292    // The number of successful responses
293    optional uint32 success_count = 1;
294
295    // The number of server failure responses
296    optional uint32 server_failure_count = 2;
297
298    // The number of format error responses
299    optional uint32 format_error_count = 3;
300
301    // The number of 'name exists' responses
302    optional uint32 name_exists_count = 4;
303
304    // The number of refused responses
305    optional uint32 refused_count = 5;
306
307    // The number of other responses
308    optional uint32 other_count = 6;
309  }
310
311  enum SrpServerState {
312    SRP_SERVER_STATE_UNSPECIFIED = 0;
313    SRP_SERVER_STATE_DISABLED = 1;
314    SRP_SERVER_STATE_RUNNING = 2;
315    SRP_SERVER_STATE_STOPPED = 3;
316  }
317
318  // The address mode used by the SRP server
319  enum SrpServerAddressMode {
320    SRP_SERVER_ADDRESS_MODE_UNSPECIFIED = 0;
321    SRP_SERVER_ADDRESS_MODE_UNICAST = 1;
322    SRP_SERVER_ADDRESS_MODE_STATE_ANYCAST = 2;
323  }
324
325  enum UpstreamDnsQueryState {
326    UPSTREAMDNS_QUERY_STATE_UNSPECIFIED = 0;
327    UPSTREAMDNS_QUERY_STATE_ENABLED = 1;
328    UPSTREAMDNS_QUERY_STATE_DISABLED = 2;
329  }
330
331  message SrpServerInfo {
332    // The state of the SRP server
333    optional SrpServerState state = 1;
334
335    // Listening port number
336    optional uint32 port = 2;
337    // The address mode {unicast, anycast} of the SRP server
338    optional SrpServerAddressMode address_mode = 3;
339
340    // The registration information of hosts on the SRP server
341    optional SrpServerRegistrationInfo hosts = 4;
342
343    // The registration information of services on the SRP server
344    optional SrpServerRegistrationInfo services = 5;
345
346    // The counters of response codes sent by the SRP server
347    optional SrpServerResponseCounters response_counters = 6;
348  }
349
350  message TrelPacketCounters {
351    // The number of packets successfully transmitted through TREL
352    optional uint64 trel_tx_packets = 1;
353
354    // The number of bytes successfully transmitted through TREL
355    optional uint64 trel_tx_bytes = 2;
356
357    // The number of packet transmission failures through TREL
358    optional uint64 trel_tx_packets_failed = 3;
359
360    // The number of packets successfully received through TREL
361    optional uint64 tre_rx_packets = 4;
362
363    // The number of bytes successfully received through TREL
364    optional uint64 trel_rx_bytes = 5;
365  }
366
367  message TrelInfo {
368    // Whether TREL is enabled.
369    optional bool is_trel_enabled = 1;
370
371    // The number of TREL peers.
372    optional uint32 num_trel_peers = 2;
373
374    // TREL packet counters
375    optional TrelPacketCounters counters = 3;
376  }
377
378  message DnsServerResponseCounters {
379    // The number of successful responses
380    optional uint32 success_count = 1;
381
382    // The number of server failure responses
383    optional uint32 server_failure_count = 2;
384
385    // The number of format error responses
386    optional uint32 format_error_count = 3;
387
388    // The number of name error responses
389    optional uint32 name_error_count = 4;
390
391    // The number of 'not implemented' responses
392    optional uint32 not_implemented_count = 5;
393
394    // The number of other responses
395    optional uint32 other_count = 6;
396
397    // The number of queries handled by Upstream DNS server.
398    optional uint32 upstream_dns_queries = 7;
399
400    // The number of responses handled by Upstream DNS server.
401    optional uint32 upstream_dns_responses = 8;
402
403    // The number of upstream DNS failures.
404    optional uint32 upstream_dns_failures = 9;
405  }
406
407  message DnsServerInfo {
408    // The counters of response codes sent by the DNS server
409    optional DnsServerResponseCounters response_counters = 1;
410
411    // The number of DNS queries resolved at the local SRP server
412    optional uint32 resolved_by_local_srp_count = 2;
413
414    // The state of upstream DNS query
415    optional UpstreamDnsQueryState upstream_dns_query_state = 3;
416  }
417
418  message MdnsResponseCounters {
419    // The number of successful responses
420    optional uint32 success_count = 1;
421
422    // The number of 'not found' responses
423    optional uint32 not_found_count = 2;
424
425    // The number of 'invalid arg' responses
426    optional uint32 invalid_args_count = 3;
427
428    // The number of 'duplicated' responses
429    optional uint32 duplicated_count = 4;
430
431    // The number of 'not implemented' responses
432    optional uint32 not_implemented_count = 5;
433
434    // The number of unknown error responses
435    optional uint32 unknown_error_count = 6;
436
437    // The number of aborted responses
438    optional uint32 aborted_count = 7;
439
440    // The number of invalid state responses
441    optional uint32 invalid_state_count = 8;
442  }
443
444  message MdnsInfo {
445    // The response counters of host registrations
446    optional MdnsResponseCounters host_registration_responses = 1;
447
448    // The response counters of service registrations
449    optional MdnsResponseCounters service_registration_responses = 2;
450
451    // The response counters of host resolutions
452    optional MdnsResponseCounters host_resolution_responses = 3;
453
454    // The response counters of service resolutions
455    optional MdnsResponseCounters service_resolution_responses = 4;
456
457    // The EMA (Exponential Moving Average) latencies of mDNS operations
458
459    // The EMA latency of host registrations in milliseconds
460    optional uint32 host_registration_ema_latency_ms = 5;
461
462    // The EMA latency of service registrations in milliseconds
463    optional uint32 service_registration_ema_latency_ms = 6;
464
465    // The EMA latency of host resolutions in milliseconds
466    optional uint32 host_resolution_ema_latency_ms = 7;
467
468    // The EMA latency of service resolutions in milliseconds
469    optional uint32 service_resolution_ema_latency_ms = 8;
470  }
471
472  enum Nat64State {
473    NAT64_STATE_UNSPECIFIED = 0;
474    NAT64_STATE_DISABLED = 1;
475    NAT64_STATE_NOT_RUNNING = 2;
476    NAT64_STATE_IDLE = 3;
477    NAT64_STATE_ACTIVE = 4;
478  }
479
480  message BorderRoutingNat64State {
481    optional Nat64State prefix_manager_state = 1;
482    optional Nat64State translator_state = 2;
483  }
484
485  message Nat64Mapping {
486    optional uint64 mapping_id = 1;
487    optional bytes hashed_ipv6_address = 2;
488    optional Nat64ProtocolCounters counters = 3;
489  }
490
491  message InfraLinkInfo {
492    optional string name = 1;
493    optional bool is_up = 2;
494    optional bool is_running = 3;
495    optional bool is_multicast = 4;
496    optional uint32 link_local_address_count = 5;
497    optional uint32 unique_local_address_count = 6;
498    optional uint32 global_unicast_address_count = 7;
499    // Indicates how many peer BRs (connected to the same Thread mesh network) are on the infra link.
500    optional uint32 peer_br_count = 8;
501  }
502
503  // Message to indicate the information of external routes in network data.
504  message ExternalRoutes {
505    // Indicates whether the a zero-length prefix (::/0) added from this BR
506    optional bool has_default_route_added = 1;
507
508    // Indicates whether the a ULA prefix (fc00::/7) added from this BR
509    optional bool has_ula_route_added = 2;
510
511    // Indicates whether the other prefixes (other than "::/0" or "fc00::/7") added
512    // from this BR. (BR is a managed infrastructure router).
513    optional bool has_others_route_added = 3;
514  }
515
516  message BorderAgentCounters {
517    // The number of ePSKc activations
518    optional uint32 epskc_activations = 1;
519
520    // The number of ePSKc deactivations due to cleared via API
521    optional uint32 epskc_deactivation_clears = 2;
522
523    // The number of ePSKc deactivations due to timeout
524    optional uint32 epskc_deactivation_timeouts = 3;
525
526    // The number of ePSKc deactivations due to max connection attempts reached
527    optional uint32 epskc_deactivation_max_attempts = 4;
528
529    // The number of ePSKc deactivations due to commissioner disconnected
530    optional uint32 epskc_deactivation_disconnects = 5;
531
532    // The number of ePSKc activation failures caused by invalid border agent state
533    optional uint32 epskc_invalid_ba_state_errors = 6;
534
535    // The number of ePSKc activation failures caused by invalid argument
536    optional uint32 epskc_invalid_args_errors = 7;
537
538    // The number of ePSKc activation failures caused by failed to start secure session
539    optional uint32 epskc_start_secure_session_errors = 8;
540
541    // The number of successful secure session establishment with ePSKc
542    optional uint32 epskc_secure_session_successes = 9;
543
544    // The number of failed secure session establishement with ePSKc
545    optional uint32 epskc_secure_session_failures = 10;
546
547    // The number of active commissioner petitioned over secure session establishment with ePSKc
548    optional uint32 epskc_commissioner_petitions = 11;
549
550    // The number of successful secure session establishment with PSKc
551    optional uint32 pskc_secure_session_successes = 12;
552
553    // The number of failed secure session establishement with PSKc
554    optional uint32 pskc_secure_session_failures = 13;
555
556    // The number of active commissioner petitioned over secure session establishment with PSKc
557    optional uint32 pskc_commissioner_petitions = 14;
558
559    // The number of MGMT_ACTIVE_GET.req received
560    optional uint32 mgmt_active_get_reqs = 15;
561
562    // The number of MGMT_PENDING_GET.req received
563    optional uint32 mgmt_pending_get_reqs = 16;
564  }
565
566  message BorderAgentInfo {
567    // The border agent counters
568    optional BorderAgentCounters border_agent_counters = 1;
569  }
570
571  message WpanBorderRouter {
572    // Border routing counters
573    optional BorderRoutingCounters border_routing_counters = 1;
574
575    // Information about the SRP server
576    optional SrpServerInfo srp_server = 2;
577
578    // Information about the DNS server
579    optional DnsServerInfo dns_server = 3;
580
581    // Information about the mDNS publisher
582    optional MdnsInfo mdns = 4;
583
584    // TODO(b/285457467): remove this reserved proto field.
585    reserved 5;
586
587    // Information about the state of components of NAT64
588    optional BorderRoutingNat64State nat64_state = 6;
589
590    // Information about the mappings of NAT64 translator
591    repeated Nat64Mapping nat64_mappings = 7;
592
593    // DHCPv6 PD state
594    optional Dhcp6PdState dhcp6_pd_state = 8;
595
596    // DHCPv6 PD prefix
597    optional bytes hashed_pd_prefix = 9;
598
599    // DHCPv6 PD processed RA Info
600    optional PdProcessedRaInfo pd_processed_ra_info= 10;
601
602    // Information about TREL.
603    optional TrelInfo trel_info = 11;
604
605    // Information about the infra link
606    optional InfraLinkInfo infra_link_info = 12;
607
608    // Information about the external routes in network data.
609    optional ExternalRoutes external_route_info = 13;
610
611    // Information about the Border Agent
612    optional BorderAgentInfo border_agent_info = 14;
613  }
614
615  message RcpStabilityStatistics {
616    optional uint32 rcp_timeout_count = 1;
617    optional uint32 rcp_reset_count = 2;
618    optional uint32 rcp_restoration_count = 3;
619    optional uint32 spinel_parse_error_count = 4;
620    optional int32 rcp_firmware_update_count = 5;
621    optional uint32 thread_stack_uptime = 6;
622  }
623
624  message RcpInterfaceStatistics {
625    optional uint32 rcp_interface_type = 1;
626    optional uint64 transferred_frames_count = 2;
627    optional uint64 transferred_valid_frames_count = 3;
628    optional uint64 transferred_garbage_frames_count = 4;
629    optional uint64 rx_frames_count = 5;
630    optional uint64 rx_bytes_count = 6;
631    optional uint64 tx_frames_count = 7;
632    optional uint64 tx_bytes_count = 8;
633  }
634
635  message WpanRcp {
636    optional RcpStabilityStatistics rcp_stability_statistics = 1;
637    optional RcpInterfaceStatistics rcp_interface_statistics = 2;
638  }
639
640  message CoexMetrics {
641    // Use uint32 instead of int64 to save space for payload, and align with the
642    // raw data size.
643    optional uint32 count_tx_request = 1;
644    optional uint32 count_tx_grant_immediate = 2;
645    optional uint32 count_tx_grant_wait = 3;
646    optional uint32 count_tx_grant_wait_activated = 4;
647    optional uint32 count_tx_grant_wait_timeout = 5;
648    optional uint32 count_tx_grant_deactivated_during_request = 6;
649    optional uint32 tx_average_request_to_grant_time_us = 7;
650    optional uint32 count_rx_request = 8;
651    optional uint32 count_rx_grant_immediate = 9;
652    optional uint32 count_rx_grant_wait = 10;
653    optional uint32 count_rx_grant_wait_activated = 11;
654    optional uint32 count_rx_grant_wait_timeout = 12;
655    optional uint32 count_rx_grant_deactivated_during_request = 13;
656    optional uint32 count_rx_grant_none = 14;
657    optional uint32 rx_average_request_to_grant_time_us = 15;
658  }
659
660  message LinkMetricsEntry {
661    optional int32 link_margin = 1;
662    optional int32 rssi = 2;
663  }
664
665  message LowPowerMetrics {
666    repeated LinkMetricsEntry link_metrics_entries = 1;
667  }
668
669  optional WpanStats wpan_stats = 1;
670  optional WpanTopoFull wpan_topo_full = 2;
671  repeated TopoEntry topo_entries = 3;
672  optional WpanBorderRouter wpan_border_router = 4;
673  optional WpanRcp wpan_rcp = 5;
674  // Deprecate CoexMetrics with int64 as its fields types to save storage.
675  reserved 6;
676  optional CoexMetrics coex_metrics = 7;
677  optional LowPowerMetrics low_power_metrics = 8;
678}
679