1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
// WARNING: This file is machine generated by fidlgen.

// fidl_experiment = no_optional_structs
// fidl_experiment = simple_empty_response_syntax
// fidl_experiment = unknown_interactions

#![allow(
    unused_parens, // one-element-tuple-case is not a tuple
    unused_mut, // not all args require mutation, but many do
    nonstandard_style, // auto-caps does its best, but is not always successful
)]
#![recursion_limit = "512"]

#[cfg(target_os = "fuchsia")]
#[allow(unused_imports)]
use fuchsia_zircon as zx;

#[allow(unused_imports)]
use {
    bitflags::bitflags,
    fidl::{
        client::{decode_transaction_body_fut, QueryResponseFut},
        encoding::{zerocopy, Decodable as _, Encodable as _},
        endpoints::{ControlHandle as _, Responder as _},
        fidl_bits, fidl_empty_struct, fidl_enum, fidl_struct, fidl_struct_copy, fidl_table,
        fidl_union, wrap_handle_metadata,
    },
    fuchsia_zircon_status as zx_status,
    futures::future::{self, MaybeDone, TryFutureExt},
};

#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct Peer {
    pub addr: [u8; 6],
    pub max_tp: u16,
    pub max_probability: u16,
    pub basic_highest: u16,
    pub basic_max_probability: u16,
    pub probes: u64,
    pub entries: Vec<StatsEntry>,
}

impl fidl::encoding::TopLevel for Peer {}

impl fidl::encoding::Persistable for Peer {}

fidl_struct! {
    name: Peer,
    members: [
        addr {
            ty: [u8; 6],
            offset_v1: 0,
            offset_v2: 0,
        },
        max_tp {
            ty: u16,
            offset_v1: 6,
            offset_v2: 6,
        },
        max_probability {
            ty: u16,
            offset_v1: 8,
            offset_v2: 8,
        },
        basic_highest {
            ty: u16,
            offset_v1: 10,
            offset_v2: 10,
        },
        basic_max_probability {
            ty: u16,
            offset_v1: 12,
            offset_v2: 12,
        },
        probes {
            ty: u64,
            offset_v1: 16,
            offset_v2: 16,
        },
        entries {
            ty: Vec<StatsEntry>,
            offset_v1: 24,
            offset_v2: 24,
        },
    ],
    padding_v1: [
        {
            ty: u64,
            offset: 8,
            mask: 0xffff000000000000u64,
        },],
    padding_v2: [
        {
            ty: u64,
            offset: 8,
            mask: 0xffff000000000000u64,
        },],
    size_v1: 40,
    size_v2: 40,
    align_v1: 8,
    align_v2: 8,
}

#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct Peers {
    pub addrs: Vec<[u8; 6]>,
}

impl fidl::encoding::TopLevel for Peers {}

impl fidl::encoding::Persistable for Peers {}

fidl_struct! {
    name: Peers,
    members: [
        addrs {
            ty: Vec<[u8; 6]>,
            offset_v1: 0,
            offset_v2: 0,
        },
    ],
    padding_v1: [],
    padding_v2: [],
    size_v1: 16,
    size_v2: 16,
    align_v1: 8,
    align_v2: 8,
}

#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct StatsEntry {
    pub tx_vector_idx: u16,
    pub tx_vec_desc: String,
    pub success_cur: u64,
    pub attempts_cur: u64,
    pub probability: f32,
    pub cur_tp: f32,
    pub success_total: u64,
    pub attempts_total: u64,
    pub probes_total: u64,
    pub probe_cycles_skipped: u8,
}

impl fidl::encoding::TopLevel for StatsEntry {}

impl fidl::encoding::Persistable for StatsEntry {}

fidl_struct! {
    name: StatsEntry,
    members: [
        tx_vector_idx {
            ty: u16,
            offset_v1: 0,
            offset_v2: 0,
        },
        tx_vec_desc {
            ty: String,
            offset_v1: 8,
            offset_v2: 8,
        },
        success_cur {
            ty: u64,
            offset_v1: 24,
            offset_v2: 24,
        },
        attempts_cur {
            ty: u64,
            offset_v1: 32,
            offset_v2: 32,
        },
        probability {
            ty: f32,
            offset_v1: 40,
            offset_v2: 40,
        },
        cur_tp {
            ty: f32,
            offset_v1: 44,
            offset_v2: 44,
        },
        success_total {
            ty: u64,
            offset_v1: 48,
            offset_v2: 48,
        },
        attempts_total {
            ty: u64,
            offset_v1: 56,
            offset_v2: 56,
        },
        probes_total {
            ty: u64,
            offset_v1: 64,
            offset_v2: 64,
        },
        probe_cycles_skipped {
            ty: u8,
            offset_v1: 72,
            offset_v2: 72,
        },
    ],
    padding_v1: [
        {
            ty: u64,
            offset: 0,
            mask: 0xffffffffffff0000u64,
        },
        {
            ty: u64,
            offset: 72,
            mask: 0xffffffffffffff00u64,
        },],
    padding_v2: [
        {
            ty: u64,
            offset: 0,
            mask: 0xffffffffffff0000u64,
        },
        {
            ty: u64,
            offset: 72,
            mask: 0xffffffffffffff00u64,
        },],
    size_v1: 80,
    size_v2: 80,
    align_v1: 8,
    align_v2: 8,
}