Skip to main content

fidl_fuchsia_net_neighbor_common/
fidl_fuchsia_net_neighbor_common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11/// The maximum number of [`EntryIteratorItem`] returned in a
12/// [`EntryIterator.GetNext`] response.
13pub const MAX_ITEM_BATCH_SIZE: u64 = 256;
14
15/// Errors associated with the neighbor table `Controller` protocol.
16#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
17pub enum ControllerError {
18    /// The specified interface does not exist.
19    InterfaceNotFound,
20    /// The specified interface does not keep a neighbor table (e.g.
21    /// point-to-point links).
22    InterfaceNotSupported,
23    /// The specified neighbor does not exist in the provided interface's
24    /// neighbor table.
25    NeighborNotFound,
26    /// The provided IP address is not a valid neighbor address.
27    InvalidIpAddress,
28    /// The provided MAC address is not a unicast MAC address.
29    MacAddressNotUnicast,
30    /// A probe cannot be manually triggered against the specified neighbor
31    /// because its link address is not known.
32    LinkAddressUnknown,
33    /// The neighbor table is full.
34    TooManyEntries,
35    #[doc(hidden)]
36    __SourceBreaking { unknown_ordinal: u32 },
37}
38
39/// Pattern that matches an unknown `ControllerError` member.
40#[macro_export]
41macro_rules! ControllerErrorUnknown {
42    () => {
43        _
44    };
45}
46
47impl ControllerError {
48    #[inline]
49    pub fn from_primitive(prim: u32) -> Option<Self> {
50        match prim {
51            1 => Some(Self::InterfaceNotFound),
52            2 => Some(Self::InterfaceNotSupported),
53            3 => Some(Self::NeighborNotFound),
54            4 => Some(Self::InvalidIpAddress),
55            5 => Some(Self::MacAddressNotUnicast),
56            6 => Some(Self::LinkAddressUnknown),
57            7 => Some(Self::TooManyEntries),
58            _ => None,
59        }
60    }
61
62    #[inline]
63    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
64        match prim {
65            1 => Self::InterfaceNotFound,
66            2 => Self::InterfaceNotSupported,
67            3 => Self::NeighborNotFound,
68            4 => Self::InvalidIpAddress,
69            5 => Self::MacAddressNotUnicast,
70            6 => Self::LinkAddressUnknown,
71            7 => Self::TooManyEntries,
72            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
73        }
74    }
75
76    #[inline]
77    pub fn unknown() -> Self {
78        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
79    }
80
81    #[inline]
82    pub const fn into_primitive(self) -> u32 {
83        match self {
84            Self::InterfaceNotFound => 1,
85            Self::InterfaceNotSupported => 2,
86            Self::NeighborNotFound => 3,
87            Self::InvalidIpAddress => 4,
88            Self::MacAddressNotUnicast => 5,
89            Self::LinkAddressUnknown => 6,
90            Self::TooManyEntries => 7,
91            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
92        }
93    }
94
95    #[inline]
96    pub fn is_unknown(&self) -> bool {
97        match self {
98            Self::__SourceBreaking { unknown_ordinal: _ } => true,
99            _ => false,
100        }
101    }
102}
103
104#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
105#[repr(u32)]
106pub enum EntryState {
107    /// Reachability is in the process of being confirmed for a newly
108    /// created, non-static entry.
109    Incomplete = 1,
110    /// Positive reachability has been confirmed; the path to the neighbor
111    /// is functioning properly.
112    Reachable = 2,
113    /// Reachability is considered unknown.
114    ///
115    /// Occurs in one of two ways:
116    ///   1. Too much time has elapsed since the last positive reachability
117    ///      confirmation was received.
118    ///   2. Received a reachability confirmation from a neighbor with a
119    ///      different MAC address than the one cached.
120    Stale = 3,
121    /// A packet was recently sent while reachability was considered
122    /// unknown.
123    ///
124    /// This state is an optimization that gives non-Neighbor-Discovery
125    /// related protocols time to confirm reachability after the last
126    /// confirmation of reachability has expired due to lack of recent
127    /// traffic.
128    Delay = 4,
129    /// A reachability confirmation is actively sought by periodically
130    /// retransmitting reachability probes until a reachability confirmation
131    /// is received, or until the maximum number of probes has been sent.
132    Probe = 5,
133    /// Static entries are explicitly added with [`Controller.AddEntry`].
134    /// They do not expire and are not deleted until explicitly removed with
135    /// [`Controller.RemoveEntry`]. A static entry may be converted into a
136    /// dynamic entry with [`Controller.ProbeEntry`], however, at which
137    /// point it may be subject to expiry and deletion.
138    Static = 6,
139    /// Negative reachability has been confirmed; the path to the neighbor
140    /// may not be functioning properly. A reachability confirmation was not
141    /// received after transmitting the maximum number of reachability
142    /// probes.
143    Unreachable = 7,
144}
145
146impl EntryState {
147    #[inline]
148    pub fn from_primitive(prim: u32) -> Option<Self> {
149        match prim {
150            1 => Some(Self::Incomplete),
151            2 => Some(Self::Reachable),
152            3 => Some(Self::Stale),
153            4 => Some(Self::Delay),
154            5 => Some(Self::Probe),
155            6 => Some(Self::Static),
156            7 => Some(Self::Unreachable),
157            _ => None,
158        }
159    }
160
161    #[inline]
162    pub const fn into_primitive(self) -> u32 {
163        self as u32
164    }
165}
166
167#[derive(Clone, Debug, PartialEq)]
168pub struct ControllerAddEntryRequest {
169    pub interface: u64,
170    pub neighbor: fidl_fuchsia_net_common::IpAddress,
171    pub mac: fidl_fuchsia_net_common::MacAddress,
172}
173
174impl fidl::Persistable for ControllerAddEntryRequest {}
175
176#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
177pub struct ControllerClearEntriesRequest {
178    pub interface: u64,
179    pub ip_version: fidl_fuchsia_net_common::IpVersion,
180}
181
182impl fidl::Persistable for ControllerClearEntriesRequest {}
183
184#[derive(Clone, Debug, PartialEq)]
185pub struct ControllerProbeEntryRequest {
186    pub interface: u64,
187    pub neighbor: fidl_fuchsia_net_common::IpAddress,
188}
189
190impl fidl::Persistable for ControllerProbeEntryRequest {}
191
192#[derive(Clone, Debug, PartialEq)]
193pub struct ControllerRemoveEntryRequest {
194    pub interface: u64,
195    pub neighbor: fidl_fuchsia_net_common::IpAddress,
196}
197
198impl fidl::Persistable for ControllerRemoveEntryRequest {}
199
200#[derive(Clone, Debug, PartialEq)]
201pub struct EntryIteratorGetNextResponse {
202    pub events: Vec<EntryIteratorItem>,
203}
204
205impl fidl::Persistable for EntryIteratorGetNextResponse {}
206
207#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
208pub struct IdleEvent;
209
210impl fidl::Persistable for IdleEvent {}
211
212/// Information on a neighboring device in the local network.
213///
214/// There are two types of entries available in the neighbor table.
215///   1. Dynamic entries are discovered automatically by neighbor discovery
216///      protocols (e.g. ARP, NDP). These protocols will attempt to reconfirm
217///      reachability with the device once its `state` becomes
218///      [`EntryState.STALE`].
219///   2. Static entries are explicitly added by a user with
220///      [`Controller.AddEntry`] and have no expiration. Their `state` is always
221///      [`EntryState.STATIC`] unless converted to a dynamic entry as the result
222///      of a [`Controller.ProbeEntry`] call.
223#[derive(Clone, Debug, Default, PartialEq)]
224pub struct Entry {
225    /// Identifier for the interface used for communicating with the neighbor.
226    ///
227    /// Required.
228    pub interface: Option<u64>,
229    /// IP address of the neighbor.
230    ///
231    /// Required.
232    pub neighbor: Option<fidl_fuchsia_net_common::IpAddress>,
233    /// State of the entry within the Neighbor Unreachability Detection (NUD)
234    /// state machine.
235    ///
236    /// Modeled after RFC 4861 section 7.3.2. Descriptions are kept
237    /// implementation-independent by using a set of generic terminology.
238    ///
239    /// ,------------------------------------------------------------------.
240    /// | Generic Term              | ARP Term    | NDP Term               |
241    /// |---------------------------+-------------+------------------------|
242    /// | Reachability Probe        | ARP Request | Neighbor Solicitation  |
243    /// | Reachability Confirmation | ARP Reply   | Neighbor Advertisement |
244    /// `---------------------------+-------------+------------------------'
245    ///
246    /// Required.
247    pub state: Option<EntryState>,
248    /// MAC address of the neighboring device's network interface controller.
249    ///
250    /// May be absent for dynamic entries in [`EntryState.UNREACHABLE`] or
251    /// [`EntryState.INCOMPLETE`].
252    pub mac: Option<fidl_fuchsia_net_common::MacAddress>,
253    /// Timestamp when this entry has changed `state`.
254    ///
255    /// Required.
256    pub updated_at: Option<i64>,
257    #[doc(hidden)]
258    pub __source_breaking: fidl::marker::SourceBreaking,
259}
260
261impl fidl::Persistable for Entry {}
262
263#[derive(Clone, Debug, Default, PartialEq)]
264pub struct EntryIteratorOptions {
265    #[doc(hidden)]
266    pub __source_breaking: fidl::marker::SourceBreaking,
267}
268
269impl fidl::Persistable for EntryIteratorOptions {}
270
271#[derive(Clone, Debug, PartialEq)]
272pub enum EntryIteratorItem {
273    /// An existing entry in the neighbor table. Does not indicate that
274    /// an event occurred.
275    Existing(Entry),
276    /// Empty event for indicating there are no more
277    /// [`EntryIteratorItem.existing`] items to yield.
278    Idle(IdleEvent),
279    /// Event indicating a new entry has been added to the neighbor
280    /// table.
281    Added(Entry),
282    /// Event indicating an entry has changed.
283    Changed(Entry),
284    /// Event indicating an entry has been removed from the neighbor
285    /// table.
286    Removed(Entry),
287}
288
289impl EntryIteratorItem {
290    #[inline]
291    pub fn ordinal(&self) -> u64 {
292        match *self {
293            Self::Existing(_) => 1,
294            Self::Idle(_) => 2,
295            Self::Added(_) => 3,
296            Self::Changed(_) => 4,
297            Self::Removed(_) => 5,
298        }
299    }
300}
301
302impl fidl::Persistable for EntryIteratorItem {}
303
304pub mod controller_ordinals {
305    pub const ADD_ENTRY: u64 = 0x778c829580aa23ac;
306    pub const PROBE_ENTRY: u64 = 0x4f71dd58473f58ad;
307    pub const REMOVE_ENTRY: u64 = 0xfd0b52f53a0f815;
308    pub const CLEAR_ENTRIES: u64 = 0x33e53d9769a999d;
309}
310
311pub mod entry_iterator_ordinals {
312    pub const GET_NEXT: u64 = 0x6d03407803da8647;
313}
314
315pub mod view_ordinals {
316    pub const OPEN_ENTRY_ITERATOR: u64 = 0x3c9531929383e911;
317}
318
319mod internal {
320    use super::*;
321    unsafe impl fidl::encoding::TypeMarker for ControllerError {
322        type Owned = Self;
323
324        #[inline(always)]
325        fn inline_align(_context: fidl::encoding::Context) -> usize {
326            std::mem::align_of::<u32>()
327        }
328
329        #[inline(always)]
330        fn inline_size(_context: fidl::encoding::Context) -> usize {
331            std::mem::size_of::<u32>()
332        }
333
334        #[inline(always)]
335        fn encode_is_copy() -> bool {
336            false
337        }
338
339        #[inline(always)]
340        fn decode_is_copy() -> bool {
341            false
342        }
343    }
344
345    impl fidl::encoding::ValueTypeMarker for ControllerError {
346        type Borrowed<'a> = Self;
347        #[inline(always)]
348        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
349            *value
350        }
351    }
352
353    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
354        for ControllerError
355    {
356        #[inline]
357        unsafe fn encode(
358            self,
359            encoder: &mut fidl::encoding::Encoder<'_, D>,
360            offset: usize,
361            _depth: fidl::encoding::Depth,
362        ) -> fidl::Result<()> {
363            encoder.debug_check_bounds::<Self>(offset);
364            encoder.write_num(self.into_primitive(), offset);
365            Ok(())
366        }
367    }
368
369    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ControllerError {
370        #[inline(always)]
371        fn new_empty() -> Self {
372            Self::unknown()
373        }
374
375        #[inline]
376        unsafe fn decode(
377            &mut self,
378            decoder: &mut fidl::encoding::Decoder<'_, D>,
379            offset: usize,
380            _depth: fidl::encoding::Depth,
381        ) -> fidl::Result<()> {
382            decoder.debug_check_bounds::<Self>(offset);
383            let prim = decoder.read_num::<u32>(offset);
384
385            *self = Self::from_primitive_allow_unknown(prim);
386            Ok(())
387        }
388    }
389    unsafe impl fidl::encoding::TypeMarker for EntryState {
390        type Owned = Self;
391
392        #[inline(always)]
393        fn inline_align(_context: fidl::encoding::Context) -> usize {
394            std::mem::align_of::<u32>()
395        }
396
397        #[inline(always)]
398        fn inline_size(_context: fidl::encoding::Context) -> usize {
399            std::mem::size_of::<u32>()
400        }
401
402        #[inline(always)]
403        fn encode_is_copy() -> bool {
404            true
405        }
406
407        #[inline(always)]
408        fn decode_is_copy() -> bool {
409            false
410        }
411    }
412
413    impl fidl::encoding::ValueTypeMarker for EntryState {
414        type Borrowed<'a> = Self;
415        #[inline(always)]
416        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
417            *value
418        }
419    }
420
421    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for EntryState {
422        #[inline]
423        unsafe fn encode(
424            self,
425            encoder: &mut fidl::encoding::Encoder<'_, D>,
426            offset: usize,
427            _depth: fidl::encoding::Depth,
428        ) -> fidl::Result<()> {
429            encoder.debug_check_bounds::<Self>(offset);
430            encoder.write_num(self.into_primitive(), offset);
431            Ok(())
432        }
433    }
434
435    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EntryState {
436        #[inline(always)]
437        fn new_empty() -> Self {
438            Self::Incomplete
439        }
440
441        #[inline]
442        unsafe fn decode(
443            &mut self,
444            decoder: &mut fidl::encoding::Decoder<'_, D>,
445            offset: usize,
446            _depth: fidl::encoding::Depth,
447        ) -> fidl::Result<()> {
448            decoder.debug_check_bounds::<Self>(offset);
449            let prim = decoder.read_num::<u32>(offset);
450
451            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
452            Ok(())
453        }
454    }
455
456    impl fidl::encoding::ValueTypeMarker for ControllerAddEntryRequest {
457        type Borrowed<'a> = &'a Self;
458        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
459            value
460        }
461    }
462
463    unsafe impl fidl::encoding::TypeMarker for ControllerAddEntryRequest {
464        type Owned = Self;
465
466        #[inline(always)]
467        fn inline_align(_context: fidl::encoding::Context) -> usize {
468            8
469        }
470
471        #[inline(always)]
472        fn inline_size(_context: fidl::encoding::Context) -> usize {
473            32
474        }
475    }
476
477    unsafe impl<D: fidl::encoding::ResourceDialect>
478        fidl::encoding::Encode<ControllerAddEntryRequest, D> for &ControllerAddEntryRequest
479    {
480        #[inline]
481        unsafe fn encode(
482            self,
483            encoder: &mut fidl::encoding::Encoder<'_, D>,
484            offset: usize,
485            _depth: fidl::encoding::Depth,
486        ) -> fidl::Result<()> {
487            encoder.debug_check_bounds::<ControllerAddEntryRequest>(offset);
488            // Delegate to tuple encoding.
489            fidl::encoding::Encode::<ControllerAddEntryRequest, D>::encode(
490                (
491                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.interface),
492                    <fidl_fuchsia_net_common::IpAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.neighbor),
493                    <fidl_fuchsia_net_common::MacAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.mac),
494                ),
495                encoder, offset, _depth
496            )
497        }
498    }
499    unsafe impl<
500        D: fidl::encoding::ResourceDialect,
501        T0: fidl::encoding::Encode<u64, D>,
502        T1: fidl::encoding::Encode<fidl_fuchsia_net_common::IpAddress, D>,
503        T2: fidl::encoding::Encode<fidl_fuchsia_net_common::MacAddress, D>,
504    > fidl::encoding::Encode<ControllerAddEntryRequest, D> for (T0, T1, T2)
505    {
506        #[inline]
507        unsafe fn encode(
508            self,
509            encoder: &mut fidl::encoding::Encoder<'_, D>,
510            offset: usize,
511            depth: fidl::encoding::Depth,
512        ) -> fidl::Result<()> {
513            encoder.debug_check_bounds::<ControllerAddEntryRequest>(offset);
514            // Zero out padding regions. There's no need to apply masks
515            // because the unmasked parts will be overwritten by fields.
516            unsafe {
517                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
518                (ptr as *mut u64).write_unaligned(0);
519            }
520            // Write the fields.
521            self.0.encode(encoder, offset + 0, depth)?;
522            self.1.encode(encoder, offset + 8, depth)?;
523            self.2.encode(encoder, offset + 24, depth)?;
524            Ok(())
525        }
526    }
527
528    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
529        for ControllerAddEntryRequest
530    {
531        #[inline(always)]
532        fn new_empty() -> Self {
533            Self {
534                interface: fidl::new_empty!(u64, D),
535                neighbor: fidl::new_empty!(fidl_fuchsia_net_common::IpAddress, D),
536                mac: fidl::new_empty!(fidl_fuchsia_net_common::MacAddress, D),
537            }
538        }
539
540        #[inline]
541        unsafe fn decode(
542            &mut self,
543            decoder: &mut fidl::encoding::Decoder<'_, D>,
544            offset: usize,
545            _depth: fidl::encoding::Depth,
546        ) -> fidl::Result<()> {
547            decoder.debug_check_bounds::<Self>(offset);
548            // Verify that padding bytes are zero.
549            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
550            let padval = unsafe { (ptr as *const u64).read_unaligned() };
551            let mask = 0xffff000000000000u64;
552            let maskedval = padval & mask;
553            if maskedval != 0 {
554                return Err(fidl::Error::NonZeroPadding {
555                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
556                });
557            }
558            fidl::decode!(u64, D, &mut self.interface, decoder, offset + 0, _depth)?;
559            fidl::decode!(
560                fidl_fuchsia_net_common::IpAddress,
561                D,
562                &mut self.neighbor,
563                decoder,
564                offset + 8,
565                _depth
566            )?;
567            fidl::decode!(
568                fidl_fuchsia_net_common::MacAddress,
569                D,
570                &mut self.mac,
571                decoder,
572                offset + 24,
573                _depth
574            )?;
575            Ok(())
576        }
577    }
578
579    impl fidl::encoding::ValueTypeMarker for ControllerClearEntriesRequest {
580        type Borrowed<'a> = &'a Self;
581        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
582            value
583        }
584    }
585
586    unsafe impl fidl::encoding::TypeMarker for ControllerClearEntriesRequest {
587        type Owned = Self;
588
589        #[inline(always)]
590        fn inline_align(_context: fidl::encoding::Context) -> usize {
591            8
592        }
593
594        #[inline(always)]
595        fn inline_size(_context: fidl::encoding::Context) -> usize {
596            16
597        }
598    }
599
600    unsafe impl<D: fidl::encoding::ResourceDialect>
601        fidl::encoding::Encode<ControllerClearEntriesRequest, D>
602        for &ControllerClearEntriesRequest
603    {
604        #[inline]
605        unsafe fn encode(
606            self,
607            encoder: &mut fidl::encoding::Encoder<'_, D>,
608            offset: usize,
609            _depth: fidl::encoding::Depth,
610        ) -> fidl::Result<()> {
611            encoder.debug_check_bounds::<ControllerClearEntriesRequest>(offset);
612            // Delegate to tuple encoding.
613            fidl::encoding::Encode::<ControllerClearEntriesRequest, D>::encode(
614                (
615                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.interface),
616                    <fidl_fuchsia_net_common::IpVersion as fidl::encoding::ValueTypeMarker>::borrow(
617                        &self.ip_version,
618                    ),
619                ),
620                encoder,
621                offset,
622                _depth,
623            )
624        }
625    }
626    unsafe impl<
627        D: fidl::encoding::ResourceDialect,
628        T0: fidl::encoding::Encode<u64, D>,
629        T1: fidl::encoding::Encode<fidl_fuchsia_net_common::IpVersion, D>,
630    > fidl::encoding::Encode<ControllerClearEntriesRequest, D> for (T0, T1)
631    {
632        #[inline]
633        unsafe fn encode(
634            self,
635            encoder: &mut fidl::encoding::Encoder<'_, D>,
636            offset: usize,
637            depth: fidl::encoding::Depth,
638        ) -> fidl::Result<()> {
639            encoder.debug_check_bounds::<ControllerClearEntriesRequest>(offset);
640            // Zero out padding regions. There's no need to apply masks
641            // because the unmasked parts will be overwritten by fields.
642            unsafe {
643                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
644                (ptr as *mut u64).write_unaligned(0);
645            }
646            // Write the fields.
647            self.0.encode(encoder, offset + 0, depth)?;
648            self.1.encode(encoder, offset + 8, depth)?;
649            Ok(())
650        }
651    }
652
653    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
654        for ControllerClearEntriesRequest
655    {
656        #[inline(always)]
657        fn new_empty() -> Self {
658            Self {
659                interface: fidl::new_empty!(u64, D),
660                ip_version: fidl::new_empty!(fidl_fuchsia_net_common::IpVersion, D),
661            }
662        }
663
664        #[inline]
665        unsafe fn decode(
666            &mut self,
667            decoder: &mut fidl::encoding::Decoder<'_, D>,
668            offset: usize,
669            _depth: fidl::encoding::Depth,
670        ) -> fidl::Result<()> {
671            decoder.debug_check_bounds::<Self>(offset);
672            // Verify that padding bytes are zero.
673            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
674            let padval = unsafe { (ptr as *const u64).read_unaligned() };
675            let mask = 0xffffffff00000000u64;
676            let maskedval = padval & mask;
677            if maskedval != 0 {
678                return Err(fidl::Error::NonZeroPadding {
679                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
680                });
681            }
682            fidl::decode!(u64, D, &mut self.interface, decoder, offset + 0, _depth)?;
683            fidl::decode!(
684                fidl_fuchsia_net_common::IpVersion,
685                D,
686                &mut self.ip_version,
687                decoder,
688                offset + 8,
689                _depth
690            )?;
691            Ok(())
692        }
693    }
694
695    impl fidl::encoding::ValueTypeMarker for ControllerProbeEntryRequest {
696        type Borrowed<'a> = &'a Self;
697        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
698            value
699        }
700    }
701
702    unsafe impl fidl::encoding::TypeMarker for ControllerProbeEntryRequest {
703        type Owned = Self;
704
705        #[inline(always)]
706        fn inline_align(_context: fidl::encoding::Context) -> usize {
707            8
708        }
709
710        #[inline(always)]
711        fn inline_size(_context: fidl::encoding::Context) -> usize {
712            24
713        }
714    }
715
716    unsafe impl<D: fidl::encoding::ResourceDialect>
717        fidl::encoding::Encode<ControllerProbeEntryRequest, D> for &ControllerProbeEntryRequest
718    {
719        #[inline]
720        unsafe fn encode(
721            self,
722            encoder: &mut fidl::encoding::Encoder<'_, D>,
723            offset: usize,
724            _depth: fidl::encoding::Depth,
725        ) -> fidl::Result<()> {
726            encoder.debug_check_bounds::<ControllerProbeEntryRequest>(offset);
727            // Delegate to tuple encoding.
728            fidl::encoding::Encode::<ControllerProbeEntryRequest, D>::encode(
729                (
730                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.interface),
731                    <fidl_fuchsia_net_common::IpAddress as fidl::encoding::ValueTypeMarker>::borrow(
732                        &self.neighbor,
733                    ),
734                ),
735                encoder,
736                offset,
737                _depth,
738            )
739        }
740    }
741    unsafe impl<
742        D: fidl::encoding::ResourceDialect,
743        T0: fidl::encoding::Encode<u64, D>,
744        T1: fidl::encoding::Encode<fidl_fuchsia_net_common::IpAddress, D>,
745    > fidl::encoding::Encode<ControllerProbeEntryRequest, D> for (T0, T1)
746    {
747        #[inline]
748        unsafe fn encode(
749            self,
750            encoder: &mut fidl::encoding::Encoder<'_, D>,
751            offset: usize,
752            depth: fidl::encoding::Depth,
753        ) -> fidl::Result<()> {
754            encoder.debug_check_bounds::<ControllerProbeEntryRequest>(offset);
755            // Zero out padding regions. There's no need to apply masks
756            // because the unmasked parts will be overwritten by fields.
757            // Write the fields.
758            self.0.encode(encoder, offset + 0, depth)?;
759            self.1.encode(encoder, offset + 8, depth)?;
760            Ok(())
761        }
762    }
763
764    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
765        for ControllerProbeEntryRequest
766    {
767        #[inline(always)]
768        fn new_empty() -> Self {
769            Self {
770                interface: fidl::new_empty!(u64, D),
771                neighbor: fidl::new_empty!(fidl_fuchsia_net_common::IpAddress, D),
772            }
773        }
774
775        #[inline]
776        unsafe fn decode(
777            &mut self,
778            decoder: &mut fidl::encoding::Decoder<'_, D>,
779            offset: usize,
780            _depth: fidl::encoding::Depth,
781        ) -> fidl::Result<()> {
782            decoder.debug_check_bounds::<Self>(offset);
783            // Verify that padding bytes are zero.
784            fidl::decode!(u64, D, &mut self.interface, decoder, offset + 0, _depth)?;
785            fidl::decode!(
786                fidl_fuchsia_net_common::IpAddress,
787                D,
788                &mut self.neighbor,
789                decoder,
790                offset + 8,
791                _depth
792            )?;
793            Ok(())
794        }
795    }
796
797    impl fidl::encoding::ValueTypeMarker for ControllerRemoveEntryRequest {
798        type Borrowed<'a> = &'a Self;
799        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
800            value
801        }
802    }
803
804    unsafe impl fidl::encoding::TypeMarker for ControllerRemoveEntryRequest {
805        type Owned = Self;
806
807        #[inline(always)]
808        fn inline_align(_context: fidl::encoding::Context) -> usize {
809            8
810        }
811
812        #[inline(always)]
813        fn inline_size(_context: fidl::encoding::Context) -> usize {
814            24
815        }
816    }
817
818    unsafe impl<D: fidl::encoding::ResourceDialect>
819        fidl::encoding::Encode<ControllerRemoveEntryRequest, D> for &ControllerRemoveEntryRequest
820    {
821        #[inline]
822        unsafe fn encode(
823            self,
824            encoder: &mut fidl::encoding::Encoder<'_, D>,
825            offset: usize,
826            _depth: fidl::encoding::Depth,
827        ) -> fidl::Result<()> {
828            encoder.debug_check_bounds::<ControllerRemoveEntryRequest>(offset);
829            // Delegate to tuple encoding.
830            fidl::encoding::Encode::<ControllerRemoveEntryRequest, D>::encode(
831                (
832                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.interface),
833                    <fidl_fuchsia_net_common::IpAddress as fidl::encoding::ValueTypeMarker>::borrow(
834                        &self.neighbor,
835                    ),
836                ),
837                encoder,
838                offset,
839                _depth,
840            )
841        }
842    }
843    unsafe impl<
844        D: fidl::encoding::ResourceDialect,
845        T0: fidl::encoding::Encode<u64, D>,
846        T1: fidl::encoding::Encode<fidl_fuchsia_net_common::IpAddress, D>,
847    > fidl::encoding::Encode<ControllerRemoveEntryRequest, D> for (T0, T1)
848    {
849        #[inline]
850        unsafe fn encode(
851            self,
852            encoder: &mut fidl::encoding::Encoder<'_, D>,
853            offset: usize,
854            depth: fidl::encoding::Depth,
855        ) -> fidl::Result<()> {
856            encoder.debug_check_bounds::<ControllerRemoveEntryRequest>(offset);
857            // Zero out padding regions. There's no need to apply masks
858            // because the unmasked parts will be overwritten by fields.
859            // Write the fields.
860            self.0.encode(encoder, offset + 0, depth)?;
861            self.1.encode(encoder, offset + 8, depth)?;
862            Ok(())
863        }
864    }
865
866    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
867        for ControllerRemoveEntryRequest
868    {
869        #[inline(always)]
870        fn new_empty() -> Self {
871            Self {
872                interface: fidl::new_empty!(u64, D),
873                neighbor: fidl::new_empty!(fidl_fuchsia_net_common::IpAddress, D),
874            }
875        }
876
877        #[inline]
878        unsafe fn decode(
879            &mut self,
880            decoder: &mut fidl::encoding::Decoder<'_, D>,
881            offset: usize,
882            _depth: fidl::encoding::Depth,
883        ) -> fidl::Result<()> {
884            decoder.debug_check_bounds::<Self>(offset);
885            // Verify that padding bytes are zero.
886            fidl::decode!(u64, D, &mut self.interface, decoder, offset + 0, _depth)?;
887            fidl::decode!(
888                fidl_fuchsia_net_common::IpAddress,
889                D,
890                &mut self.neighbor,
891                decoder,
892                offset + 8,
893                _depth
894            )?;
895            Ok(())
896        }
897    }
898
899    impl fidl::encoding::ValueTypeMarker for EntryIteratorGetNextResponse {
900        type Borrowed<'a> = &'a Self;
901        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
902            value
903        }
904    }
905
906    unsafe impl fidl::encoding::TypeMarker for EntryIteratorGetNextResponse {
907        type Owned = Self;
908
909        #[inline(always)]
910        fn inline_align(_context: fidl::encoding::Context) -> usize {
911            8
912        }
913
914        #[inline(always)]
915        fn inline_size(_context: fidl::encoding::Context) -> usize {
916            16
917        }
918    }
919
920    unsafe impl<D: fidl::encoding::ResourceDialect>
921        fidl::encoding::Encode<EntryIteratorGetNextResponse, D> for &EntryIteratorGetNextResponse
922    {
923        #[inline]
924        unsafe fn encode(
925            self,
926            encoder: &mut fidl::encoding::Encoder<'_, D>,
927            offset: usize,
928            _depth: fidl::encoding::Depth,
929        ) -> fidl::Result<()> {
930            encoder.debug_check_bounds::<EntryIteratorGetNextResponse>(offset);
931            // Delegate to tuple encoding.
932            fidl::encoding::Encode::<EntryIteratorGetNextResponse, D>::encode(
933                (
934                    <fidl::encoding::Vector<EntryIteratorItem, 256> as fidl::encoding::ValueTypeMarker>::borrow(&self.events),
935                ),
936                encoder, offset, _depth
937            )
938        }
939    }
940    unsafe impl<
941        D: fidl::encoding::ResourceDialect,
942        T0: fidl::encoding::Encode<fidl::encoding::Vector<EntryIteratorItem, 256>, D>,
943    > fidl::encoding::Encode<EntryIteratorGetNextResponse, D> for (T0,)
944    {
945        #[inline]
946        unsafe fn encode(
947            self,
948            encoder: &mut fidl::encoding::Encoder<'_, D>,
949            offset: usize,
950            depth: fidl::encoding::Depth,
951        ) -> fidl::Result<()> {
952            encoder.debug_check_bounds::<EntryIteratorGetNextResponse>(offset);
953            // Zero out padding regions. There's no need to apply masks
954            // because the unmasked parts will be overwritten by fields.
955            // Write the fields.
956            self.0.encode(encoder, offset + 0, depth)?;
957            Ok(())
958        }
959    }
960
961    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
962        for EntryIteratorGetNextResponse
963    {
964        #[inline(always)]
965        fn new_empty() -> Self {
966            Self { events: fidl::new_empty!(fidl::encoding::Vector<EntryIteratorItem, 256>, D) }
967        }
968
969        #[inline]
970        unsafe fn decode(
971            &mut self,
972            decoder: &mut fidl::encoding::Decoder<'_, D>,
973            offset: usize,
974            _depth: fidl::encoding::Depth,
975        ) -> fidl::Result<()> {
976            decoder.debug_check_bounds::<Self>(offset);
977            // Verify that padding bytes are zero.
978            fidl::decode!(fidl::encoding::Vector<EntryIteratorItem, 256>, D, &mut self.events, decoder, offset + 0, _depth)?;
979            Ok(())
980        }
981    }
982
983    impl fidl::encoding::ValueTypeMarker for IdleEvent {
984        type Borrowed<'a> = &'a Self;
985        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
986            value
987        }
988    }
989
990    unsafe impl fidl::encoding::TypeMarker for IdleEvent {
991        type Owned = Self;
992
993        #[inline(always)]
994        fn inline_align(_context: fidl::encoding::Context) -> usize {
995            1
996        }
997
998        #[inline(always)]
999        fn inline_size(_context: fidl::encoding::Context) -> usize {
1000            1
1001        }
1002    }
1003
1004    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IdleEvent, D>
1005        for &IdleEvent
1006    {
1007        #[inline]
1008        unsafe fn encode(
1009            self,
1010            encoder: &mut fidl::encoding::Encoder<'_, D>,
1011            offset: usize,
1012            _depth: fidl::encoding::Depth,
1013        ) -> fidl::Result<()> {
1014            encoder.debug_check_bounds::<IdleEvent>(offset);
1015            encoder.write_num(0u8, offset);
1016            Ok(())
1017        }
1018    }
1019
1020    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IdleEvent {
1021        #[inline(always)]
1022        fn new_empty() -> Self {
1023            Self
1024        }
1025
1026        #[inline]
1027        unsafe fn decode(
1028            &mut self,
1029            decoder: &mut fidl::encoding::Decoder<'_, D>,
1030            offset: usize,
1031            _depth: fidl::encoding::Depth,
1032        ) -> fidl::Result<()> {
1033            decoder.debug_check_bounds::<Self>(offset);
1034            match decoder.read_num::<u8>(offset) {
1035                0 => Ok(()),
1036                _ => Err(fidl::Error::Invalid),
1037            }
1038        }
1039    }
1040
1041    impl Entry {
1042        #[inline(always)]
1043        fn max_ordinal_present(&self) -> u64 {
1044            if let Some(_) = self.updated_at {
1045                return 5;
1046            }
1047            if let Some(_) = self.mac {
1048                return 4;
1049            }
1050            if let Some(_) = self.state {
1051                return 3;
1052            }
1053            if let Some(_) = self.neighbor {
1054                return 2;
1055            }
1056            if let Some(_) = self.interface {
1057                return 1;
1058            }
1059            0
1060        }
1061    }
1062
1063    impl fidl::encoding::ValueTypeMarker for Entry {
1064        type Borrowed<'a> = &'a Self;
1065        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1066            value
1067        }
1068    }
1069
1070    unsafe impl fidl::encoding::TypeMarker for Entry {
1071        type Owned = Self;
1072
1073        #[inline(always)]
1074        fn inline_align(_context: fidl::encoding::Context) -> usize {
1075            8
1076        }
1077
1078        #[inline(always)]
1079        fn inline_size(_context: fidl::encoding::Context) -> usize {
1080            16
1081        }
1082    }
1083
1084    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Entry, D> for &Entry {
1085        unsafe fn encode(
1086            self,
1087            encoder: &mut fidl::encoding::Encoder<'_, D>,
1088            offset: usize,
1089            mut depth: fidl::encoding::Depth,
1090        ) -> fidl::Result<()> {
1091            encoder.debug_check_bounds::<Entry>(offset);
1092            // Vector header
1093            let max_ordinal: u64 = self.max_ordinal_present();
1094            encoder.write_num(max_ordinal, offset);
1095            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1096            // Calling encoder.out_of_line_offset(0) is not allowed.
1097            if max_ordinal == 0 {
1098                return Ok(());
1099            }
1100            depth.increment()?;
1101            let envelope_size = 8;
1102            let bytes_len = max_ordinal as usize * envelope_size;
1103            #[allow(unused_variables)]
1104            let offset = encoder.out_of_line_offset(bytes_len);
1105            let mut _prev_end_offset: usize = 0;
1106            if 1 > max_ordinal {
1107                return Ok(());
1108            }
1109
1110            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1111            // are envelope_size bytes.
1112            let cur_offset: usize = (1 - 1) * envelope_size;
1113
1114            // Zero reserved fields.
1115            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1116
1117            // Safety:
1118            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1119            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1120            //   envelope_size bytes, there is always sufficient room.
1121            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1122                self.interface.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1123                encoder,
1124                offset + cur_offset,
1125                depth,
1126            )?;
1127
1128            _prev_end_offset = cur_offset + envelope_size;
1129            if 2 > max_ordinal {
1130                return Ok(());
1131            }
1132
1133            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1134            // are envelope_size bytes.
1135            let cur_offset: usize = (2 - 1) * envelope_size;
1136
1137            // Zero reserved fields.
1138            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1139
1140            // Safety:
1141            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1142            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1143            //   envelope_size bytes, there is always sufficient room.
1144            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net_common::IpAddress, D>(
1145                self.neighbor.as_ref().map(
1146                    <fidl_fuchsia_net_common::IpAddress as fidl::encoding::ValueTypeMarker>::borrow,
1147                ),
1148                encoder,
1149                offset + cur_offset,
1150                depth,
1151            )?;
1152
1153            _prev_end_offset = cur_offset + envelope_size;
1154            if 3 > max_ordinal {
1155                return Ok(());
1156            }
1157
1158            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1159            // are envelope_size bytes.
1160            let cur_offset: usize = (3 - 1) * envelope_size;
1161
1162            // Zero reserved fields.
1163            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1164
1165            // Safety:
1166            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1167            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1168            //   envelope_size bytes, there is always sufficient room.
1169            fidl::encoding::encode_in_envelope_optional::<EntryState, D>(
1170                self.state.as_ref().map(<EntryState as fidl::encoding::ValueTypeMarker>::borrow),
1171                encoder,
1172                offset + cur_offset,
1173                depth,
1174            )?;
1175
1176            _prev_end_offset = cur_offset + envelope_size;
1177            if 4 > max_ordinal {
1178                return Ok(());
1179            }
1180
1181            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1182            // are envelope_size bytes.
1183            let cur_offset: usize = (4 - 1) * envelope_size;
1184
1185            // Zero reserved fields.
1186            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1187
1188            // Safety:
1189            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1190            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1191            //   envelope_size bytes, there is always sufficient room.
1192            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net_common::MacAddress, D>(
1193            self.mac.as_ref().map(<fidl_fuchsia_net_common::MacAddress as fidl::encoding::ValueTypeMarker>::borrow),
1194            encoder, offset + cur_offset, depth
1195        )?;
1196
1197            _prev_end_offset = cur_offset + envelope_size;
1198            if 5 > max_ordinal {
1199                return Ok(());
1200            }
1201
1202            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1203            // are envelope_size bytes.
1204            let cur_offset: usize = (5 - 1) * envelope_size;
1205
1206            // Zero reserved fields.
1207            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1208
1209            // Safety:
1210            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1211            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1212            //   envelope_size bytes, there is always sufficient room.
1213            fidl::encoding::encode_in_envelope_optional::<i64, D>(
1214                self.updated_at.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
1215                encoder,
1216                offset + cur_offset,
1217                depth,
1218            )?;
1219
1220            _prev_end_offset = cur_offset + envelope_size;
1221
1222            Ok(())
1223        }
1224    }
1225
1226    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Entry {
1227        #[inline(always)]
1228        fn new_empty() -> Self {
1229            Self::default()
1230        }
1231
1232        unsafe fn decode(
1233            &mut self,
1234            decoder: &mut fidl::encoding::Decoder<'_, D>,
1235            offset: usize,
1236            mut depth: fidl::encoding::Depth,
1237        ) -> fidl::Result<()> {
1238            decoder.debug_check_bounds::<Self>(offset);
1239            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1240                None => return Err(fidl::Error::NotNullable),
1241                Some(len) => len,
1242            };
1243            // Calling decoder.out_of_line_offset(0) is not allowed.
1244            if len == 0 {
1245                return Ok(());
1246            };
1247            depth.increment()?;
1248            let envelope_size = 8;
1249            let bytes_len = len * envelope_size;
1250            let offset = decoder.out_of_line_offset(bytes_len)?;
1251            // Decode the envelope for each type.
1252            let mut _next_ordinal_to_read = 0;
1253            let mut next_offset = offset;
1254            let end_offset = offset + bytes_len;
1255            _next_ordinal_to_read += 1;
1256            if next_offset >= end_offset {
1257                return Ok(());
1258            }
1259
1260            // Decode unknown envelopes for gaps in ordinals.
1261            while _next_ordinal_to_read < 1 {
1262                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1263                _next_ordinal_to_read += 1;
1264                next_offset += envelope_size;
1265            }
1266
1267            let next_out_of_line = decoder.next_out_of_line();
1268            let handles_before = decoder.remaining_handles();
1269            if let Some((inlined, num_bytes, num_handles)) =
1270                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1271            {
1272                let member_inline_size =
1273                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1274                if inlined != (member_inline_size <= 4) {
1275                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1276                }
1277                let inner_offset;
1278                let mut inner_depth = depth.clone();
1279                if inlined {
1280                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1281                    inner_offset = next_offset;
1282                } else {
1283                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1284                    inner_depth.increment()?;
1285                }
1286                let val_ref = self.interface.get_or_insert_with(|| fidl::new_empty!(u64, D));
1287                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
1288                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1289                {
1290                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1291                }
1292                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1293                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1294                }
1295            }
1296
1297            next_offset += envelope_size;
1298            _next_ordinal_to_read += 1;
1299            if next_offset >= end_offset {
1300                return Ok(());
1301            }
1302
1303            // Decode unknown envelopes for gaps in ordinals.
1304            while _next_ordinal_to_read < 2 {
1305                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1306                _next_ordinal_to_read += 1;
1307                next_offset += envelope_size;
1308            }
1309
1310            let next_out_of_line = decoder.next_out_of_line();
1311            let handles_before = decoder.remaining_handles();
1312            if let Some((inlined, num_bytes, num_handles)) =
1313                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1314            {
1315                let member_inline_size =
1316                    <fidl_fuchsia_net_common::IpAddress as fidl::encoding::TypeMarker>::inline_size(
1317                        decoder.context,
1318                    );
1319                if inlined != (member_inline_size <= 4) {
1320                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1321                }
1322                let inner_offset;
1323                let mut inner_depth = depth.clone();
1324                if inlined {
1325                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1326                    inner_offset = next_offset;
1327                } else {
1328                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1329                    inner_depth.increment()?;
1330                }
1331                let val_ref = self
1332                    .neighbor
1333                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net_common::IpAddress, D));
1334                fidl::decode!(
1335                    fidl_fuchsia_net_common::IpAddress,
1336                    D,
1337                    val_ref,
1338                    decoder,
1339                    inner_offset,
1340                    inner_depth
1341                )?;
1342                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1343                {
1344                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1345                }
1346                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1347                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1348                }
1349            }
1350
1351            next_offset += envelope_size;
1352            _next_ordinal_to_read += 1;
1353            if next_offset >= end_offset {
1354                return Ok(());
1355            }
1356
1357            // Decode unknown envelopes for gaps in ordinals.
1358            while _next_ordinal_to_read < 3 {
1359                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1360                _next_ordinal_to_read += 1;
1361                next_offset += envelope_size;
1362            }
1363
1364            let next_out_of_line = decoder.next_out_of_line();
1365            let handles_before = decoder.remaining_handles();
1366            if let Some((inlined, num_bytes, num_handles)) =
1367                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1368            {
1369                let member_inline_size =
1370                    <EntryState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1371                if inlined != (member_inline_size <= 4) {
1372                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1373                }
1374                let inner_offset;
1375                let mut inner_depth = depth.clone();
1376                if inlined {
1377                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1378                    inner_offset = next_offset;
1379                } else {
1380                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1381                    inner_depth.increment()?;
1382                }
1383                let val_ref = self.state.get_or_insert_with(|| fidl::new_empty!(EntryState, D));
1384                fidl::decode!(EntryState, D, val_ref, decoder, inner_offset, inner_depth)?;
1385                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1386                {
1387                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1388                }
1389                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1390                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1391                }
1392            }
1393
1394            next_offset += envelope_size;
1395            _next_ordinal_to_read += 1;
1396            if next_offset >= end_offset {
1397                return Ok(());
1398            }
1399
1400            // Decode unknown envelopes for gaps in ordinals.
1401            while _next_ordinal_to_read < 4 {
1402                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1403                _next_ordinal_to_read += 1;
1404                next_offset += envelope_size;
1405            }
1406
1407            let next_out_of_line = decoder.next_out_of_line();
1408            let handles_before = decoder.remaining_handles();
1409            if let Some((inlined, num_bytes, num_handles)) =
1410                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1411            {
1412                let member_inline_size = <fidl_fuchsia_net_common::MacAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1413                if inlined != (member_inline_size <= 4) {
1414                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1415                }
1416                let inner_offset;
1417                let mut inner_depth = depth.clone();
1418                if inlined {
1419                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1420                    inner_offset = next_offset;
1421                } else {
1422                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1423                    inner_depth.increment()?;
1424                }
1425                let val_ref = self.mac.get_or_insert_with(|| {
1426                    fidl::new_empty!(fidl_fuchsia_net_common::MacAddress, D)
1427                });
1428                fidl::decode!(
1429                    fidl_fuchsia_net_common::MacAddress,
1430                    D,
1431                    val_ref,
1432                    decoder,
1433                    inner_offset,
1434                    inner_depth
1435                )?;
1436                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1437                {
1438                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1439                }
1440                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1441                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1442                }
1443            }
1444
1445            next_offset += envelope_size;
1446            _next_ordinal_to_read += 1;
1447            if next_offset >= end_offset {
1448                return Ok(());
1449            }
1450
1451            // Decode unknown envelopes for gaps in ordinals.
1452            while _next_ordinal_to_read < 5 {
1453                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1454                _next_ordinal_to_read += 1;
1455                next_offset += envelope_size;
1456            }
1457
1458            let next_out_of_line = decoder.next_out_of_line();
1459            let handles_before = decoder.remaining_handles();
1460            if let Some((inlined, num_bytes, num_handles)) =
1461                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1462            {
1463                let member_inline_size =
1464                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1465                if inlined != (member_inline_size <= 4) {
1466                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1467                }
1468                let inner_offset;
1469                let mut inner_depth = depth.clone();
1470                if inlined {
1471                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1472                    inner_offset = next_offset;
1473                } else {
1474                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1475                    inner_depth.increment()?;
1476                }
1477                let val_ref = self.updated_at.get_or_insert_with(|| fidl::new_empty!(i64, D));
1478                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
1479                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1480                {
1481                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1482                }
1483                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1484                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1485                }
1486            }
1487
1488            next_offset += envelope_size;
1489
1490            // Decode the remaining unknown envelopes.
1491            while next_offset < end_offset {
1492                _next_ordinal_to_read += 1;
1493                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1494                next_offset += envelope_size;
1495            }
1496
1497            Ok(())
1498        }
1499    }
1500
1501    impl EntryIteratorOptions {
1502        #[inline(always)]
1503        fn max_ordinal_present(&self) -> u64 {
1504            0
1505        }
1506    }
1507
1508    impl fidl::encoding::ValueTypeMarker for EntryIteratorOptions {
1509        type Borrowed<'a> = &'a Self;
1510        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1511            value
1512        }
1513    }
1514
1515    unsafe impl fidl::encoding::TypeMarker for EntryIteratorOptions {
1516        type Owned = Self;
1517
1518        #[inline(always)]
1519        fn inline_align(_context: fidl::encoding::Context) -> usize {
1520            8
1521        }
1522
1523        #[inline(always)]
1524        fn inline_size(_context: fidl::encoding::Context) -> usize {
1525            16
1526        }
1527    }
1528
1529    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EntryIteratorOptions, D>
1530        for &EntryIteratorOptions
1531    {
1532        unsafe fn encode(
1533            self,
1534            encoder: &mut fidl::encoding::Encoder<'_, D>,
1535            offset: usize,
1536            mut depth: fidl::encoding::Depth,
1537        ) -> fidl::Result<()> {
1538            encoder.debug_check_bounds::<EntryIteratorOptions>(offset);
1539            // Vector header
1540            let max_ordinal: u64 = self.max_ordinal_present();
1541            encoder.write_num(max_ordinal, offset);
1542            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1543            // Calling encoder.out_of_line_offset(0) is not allowed.
1544            if max_ordinal == 0 {
1545                return Ok(());
1546            }
1547            depth.increment()?;
1548            let envelope_size = 8;
1549            let bytes_len = max_ordinal as usize * envelope_size;
1550            #[allow(unused_variables)]
1551            let offset = encoder.out_of_line_offset(bytes_len);
1552            let mut _prev_end_offset: usize = 0;
1553
1554            Ok(())
1555        }
1556    }
1557
1558    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EntryIteratorOptions {
1559        #[inline(always)]
1560        fn new_empty() -> Self {
1561            Self::default()
1562        }
1563
1564        unsafe fn decode(
1565            &mut self,
1566            decoder: &mut fidl::encoding::Decoder<'_, D>,
1567            offset: usize,
1568            mut depth: fidl::encoding::Depth,
1569        ) -> fidl::Result<()> {
1570            decoder.debug_check_bounds::<Self>(offset);
1571            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1572                None => return Err(fidl::Error::NotNullable),
1573                Some(len) => len,
1574            };
1575            // Calling decoder.out_of_line_offset(0) is not allowed.
1576            if len == 0 {
1577                return Ok(());
1578            };
1579            depth.increment()?;
1580            let envelope_size = 8;
1581            let bytes_len = len * envelope_size;
1582            let offset = decoder.out_of_line_offset(bytes_len)?;
1583            // Decode the envelope for each type.
1584            let mut _next_ordinal_to_read = 0;
1585            let mut next_offset = offset;
1586            let end_offset = offset + bytes_len;
1587
1588            // Decode the remaining unknown envelopes.
1589            while next_offset < end_offset {
1590                _next_ordinal_to_read += 1;
1591                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1592                next_offset += envelope_size;
1593            }
1594
1595            Ok(())
1596        }
1597    }
1598
1599    impl fidl::encoding::ValueTypeMarker for EntryIteratorItem {
1600        type Borrowed<'a> = &'a Self;
1601        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1602            value
1603        }
1604    }
1605
1606    unsafe impl fidl::encoding::TypeMarker for EntryIteratorItem {
1607        type Owned = Self;
1608
1609        #[inline(always)]
1610        fn inline_align(_context: fidl::encoding::Context) -> usize {
1611            8
1612        }
1613
1614        #[inline(always)]
1615        fn inline_size(_context: fidl::encoding::Context) -> usize {
1616            16
1617        }
1618    }
1619
1620    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EntryIteratorItem, D>
1621        for &EntryIteratorItem
1622    {
1623        #[inline]
1624        unsafe fn encode(
1625            self,
1626            encoder: &mut fidl::encoding::Encoder<'_, D>,
1627            offset: usize,
1628            _depth: fidl::encoding::Depth,
1629        ) -> fidl::Result<()> {
1630            encoder.debug_check_bounds::<EntryIteratorItem>(offset);
1631            encoder.write_num::<u64>(self.ordinal(), offset);
1632            match self {
1633                EntryIteratorItem::Existing(ref val) => {
1634                    fidl::encoding::encode_in_envelope::<Entry, D>(
1635                        <Entry as fidl::encoding::ValueTypeMarker>::borrow(val),
1636                        encoder,
1637                        offset + 8,
1638                        _depth,
1639                    )
1640                }
1641                EntryIteratorItem::Idle(ref val) => {
1642                    fidl::encoding::encode_in_envelope::<IdleEvent, D>(
1643                        <IdleEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
1644                        encoder,
1645                        offset + 8,
1646                        _depth,
1647                    )
1648                }
1649                EntryIteratorItem::Added(ref val) => {
1650                    fidl::encoding::encode_in_envelope::<Entry, D>(
1651                        <Entry as fidl::encoding::ValueTypeMarker>::borrow(val),
1652                        encoder,
1653                        offset + 8,
1654                        _depth,
1655                    )
1656                }
1657                EntryIteratorItem::Changed(ref val) => {
1658                    fidl::encoding::encode_in_envelope::<Entry, D>(
1659                        <Entry as fidl::encoding::ValueTypeMarker>::borrow(val),
1660                        encoder,
1661                        offset + 8,
1662                        _depth,
1663                    )
1664                }
1665                EntryIteratorItem::Removed(ref val) => {
1666                    fidl::encoding::encode_in_envelope::<Entry, D>(
1667                        <Entry as fidl::encoding::ValueTypeMarker>::borrow(val),
1668                        encoder,
1669                        offset + 8,
1670                        _depth,
1671                    )
1672                }
1673            }
1674        }
1675    }
1676
1677    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EntryIteratorItem {
1678        #[inline(always)]
1679        fn new_empty() -> Self {
1680            Self::Existing(fidl::new_empty!(Entry, D))
1681        }
1682
1683        #[inline]
1684        unsafe fn decode(
1685            &mut self,
1686            decoder: &mut fidl::encoding::Decoder<'_, D>,
1687            offset: usize,
1688            mut depth: fidl::encoding::Depth,
1689        ) -> fidl::Result<()> {
1690            decoder.debug_check_bounds::<Self>(offset);
1691            #[allow(unused_variables)]
1692            let next_out_of_line = decoder.next_out_of_line();
1693            let handles_before = decoder.remaining_handles();
1694            let (ordinal, inlined, num_bytes, num_handles) =
1695                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
1696
1697            let member_inline_size = match ordinal {
1698                1 => <Entry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1699                2 => <IdleEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1700                3 => <Entry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1701                4 => <Entry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1702                5 => <Entry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1703                _ => return Err(fidl::Error::UnknownUnionTag),
1704            };
1705
1706            if inlined != (member_inline_size <= 4) {
1707                return Err(fidl::Error::InvalidInlineBitInEnvelope);
1708            }
1709            let _inner_offset;
1710            if inlined {
1711                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
1712                _inner_offset = offset + 8;
1713            } else {
1714                depth.increment()?;
1715                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1716            }
1717            match ordinal {
1718                1 => {
1719                    #[allow(irrefutable_let_patterns)]
1720                    if let EntryIteratorItem::Existing(_) = self {
1721                        // Do nothing, read the value into the object
1722                    } else {
1723                        // Initialize `self` to the right variant
1724                        *self = EntryIteratorItem::Existing(fidl::new_empty!(Entry, D));
1725                    }
1726                    #[allow(irrefutable_let_patterns)]
1727                    if let EntryIteratorItem::Existing(ref mut val) = self {
1728                        fidl::decode!(Entry, D, val, decoder, _inner_offset, depth)?;
1729                    } else {
1730                        unreachable!()
1731                    }
1732                }
1733                2 => {
1734                    #[allow(irrefutable_let_patterns)]
1735                    if let EntryIteratorItem::Idle(_) = self {
1736                        // Do nothing, read the value into the object
1737                    } else {
1738                        // Initialize `self` to the right variant
1739                        *self = EntryIteratorItem::Idle(fidl::new_empty!(IdleEvent, D));
1740                    }
1741                    #[allow(irrefutable_let_patterns)]
1742                    if let EntryIteratorItem::Idle(ref mut val) = self {
1743                        fidl::decode!(IdleEvent, D, val, decoder, _inner_offset, depth)?;
1744                    } else {
1745                        unreachable!()
1746                    }
1747                }
1748                3 => {
1749                    #[allow(irrefutable_let_patterns)]
1750                    if let EntryIteratorItem::Added(_) = self {
1751                        // Do nothing, read the value into the object
1752                    } else {
1753                        // Initialize `self` to the right variant
1754                        *self = EntryIteratorItem::Added(fidl::new_empty!(Entry, D));
1755                    }
1756                    #[allow(irrefutable_let_patterns)]
1757                    if let EntryIteratorItem::Added(ref mut val) = self {
1758                        fidl::decode!(Entry, D, val, decoder, _inner_offset, depth)?;
1759                    } else {
1760                        unreachable!()
1761                    }
1762                }
1763                4 => {
1764                    #[allow(irrefutable_let_patterns)]
1765                    if let EntryIteratorItem::Changed(_) = self {
1766                        // Do nothing, read the value into the object
1767                    } else {
1768                        // Initialize `self` to the right variant
1769                        *self = EntryIteratorItem::Changed(fidl::new_empty!(Entry, D));
1770                    }
1771                    #[allow(irrefutable_let_patterns)]
1772                    if let EntryIteratorItem::Changed(ref mut val) = self {
1773                        fidl::decode!(Entry, D, val, decoder, _inner_offset, depth)?;
1774                    } else {
1775                        unreachable!()
1776                    }
1777                }
1778                5 => {
1779                    #[allow(irrefutable_let_patterns)]
1780                    if let EntryIteratorItem::Removed(_) = self {
1781                        // Do nothing, read the value into the object
1782                    } else {
1783                        // Initialize `self` to the right variant
1784                        *self = EntryIteratorItem::Removed(fidl::new_empty!(Entry, D));
1785                    }
1786                    #[allow(irrefutable_let_patterns)]
1787                    if let EntryIteratorItem::Removed(ref mut val) = self {
1788                        fidl::decode!(Entry, D, val, decoder, _inner_offset, depth)?;
1789                    } else {
1790                        unreachable!()
1791                    }
1792                }
1793                ordinal => panic!("unexpected ordinal {:?}", ordinal),
1794            }
1795            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
1796                return Err(fidl::Error::InvalidNumBytesInEnvelope);
1797            }
1798            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1799                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1800            }
1801            Ok(())
1802        }
1803    }
1804}